From 456248d4ba73fb9291757a4bc3ddb9a7df417171 Mon Sep 17 00:00:00 2001
From: Amir Alavi
Date: Sat, 3 Dec 2022 17:44:51 -0500
Subject: [PATCH] bump to k8s 1.26-rc.1
---
go.mod | 115 +-
go.sum | 387 +-
.../go/compute/metadata/metadata.go | 536 --
.../go/compute/metadata/retry.go | 114 -
.../github.com/Azure/go-autorest/CHANGELOG.md | 1004 ---
.../github.com/Azure/go-autorest/GNUmakefile | 23 -
.../github.com/Azure/go-autorest/Gopkg.lock | 324 -
.../github.com/Azure/go-autorest/Gopkg.toml | 59 -
vendor/github.com/Azure/go-autorest/LICENSE | 191 -
vendor/github.com/Azure/go-autorest/README.md | 165 -
.../Azure/go-autorest/autorest/LICENSE | 191 -
.../Azure/go-autorest/autorest/adal/README.md | 294 -
.../Azure/go-autorest/autorest/adal/config.go | 151 -
.../go-autorest/autorest/adal/devicetoken.go | 273 -
.../autorest/adal/go_mod_tidy_hack.go | 25 -
.../go-autorest/autorest/adal/persist.go | 135 -
.../Azure/go-autorest/autorest/adal/sender.go | 101 -
.../Azure/go-autorest/autorest/adal/token.go | 1396 ---
.../go-autorest/autorest/adal/token_1.13.go | 76 -
.../go-autorest/autorest/adal/token_legacy.go | 75 -
.../go-autorest/autorest/adal/version.go | 45 -
.../go-autorest/autorest/authorization.go | 353 -
.../go-autorest/autorest/authorization_sas.go | 66 -
.../autorest/authorization_storage.go | 307 -
.../Azure/go-autorest/autorest/autorest.go | 150 -
.../Azure/go-autorest/autorest/azure/async.go | 995 ---
.../Azure/go-autorest/autorest/azure/azure.go | 388 -
.../autorest/azure/environments.go | 331 -
.../autorest/azure/metadata_environment.go | 245 -
.../Azure/go-autorest/autorest/azure/rp.go | 204 -
.../Azure/go-autorest/autorest/client.go | 328 -
.../Azure/go-autorest/autorest/date/LICENSE | 191 -
.../Azure/go-autorest/autorest/date/date.go | 96 -
.../autorest/date/go_mod_tidy_hack.go | 24 -
.../Azure/go-autorest/autorest/date/time.go | 103 -
.../go-autorest/autorest/date/timerfc1123.go | 100 -
.../go-autorest/autorest/date/unixtime.go | 123 -
.../go-autorest/autorest/date/utility.go | 25 -
.../Azure/go-autorest/autorest/error.go | 103 -
.../go-autorest/autorest/go_mod_tidy_hack.go | 25 -
.../Azure/go-autorest/autorest/preparer.go | 549 --
.../Azure/go-autorest/autorest/responder.go | 269 -
.../go-autorest/autorest/retriablerequest.go | 52 -
.../autorest/retriablerequest_1.7.go | 55 -
.../autorest/retriablerequest_1.8.go | 67 -
.../Azure/go-autorest/autorest/sender.go | 458 -
.../Azure/go-autorest/autorest/utility.go | 232 -
.../go-autorest/autorest/utility_1.13.go | 30 -
.../go-autorest/autorest/utility_legacy.go | 32 -
.../Azure/go-autorest/autorest/version.go | 41 -
.../Azure/go-autorest/azure-pipelines.yml | 105 -
vendor/github.com/Azure/go-autorest/doc.go | 18 -
.../Azure/go-autorest/logger/LICENSE | 191 -
.../go-autorest/logger/go_mod_tidy_hack.go | 24 -
.../Azure/go-autorest/logger/logger.go | 337 -
.../Azure/go-autorest/tracing/LICENSE | 191 -
.../go-autorest/tracing/go_mod_tidy_hack.go | 24 -
.../Azure/go-autorest/tracing/tracing.go | 67 -
.../github.com/PuerkitoBio/purell/.gitignore | 5 -
.../github.com/PuerkitoBio/purell/.travis.yml | 12 -
vendor/github.com/PuerkitoBio/purell/LICENSE | 12 -
.../github.com/PuerkitoBio/purell/README.md | 188 -
.../github.com/PuerkitoBio/purell/purell.go | 379 -
.../github.com/PuerkitoBio/urlesc/.travis.yml | 15 -
.../github.com/PuerkitoBio/urlesc/README.md | 16 -
.../github.com/PuerkitoBio/urlesc/urlesc.go | 180 -
.../antlr/antlr4/runtime/Go/antlr/LICENSE | 26 +
.../antlr/antlr4/runtime/Go/antlr/atn.go | 159 +
.../antlr4/runtime/Go/antlr/atn_config.go | 295 +
.../antlr4/runtime/Go/antlr/atn_config_set.go | 407 +
.../Go/antlr/atn_deserialization_options.go | 61 +
.../runtime/Go/antlr/atn_deserializer.go | 683 ++
.../antlr4/runtime/Go/antlr/atn_simulator.go | 50 +
.../antlr4/runtime/Go/antlr/atn_state.go | 392 +
.../antlr/antlr4/runtime/Go/antlr/atn_type.go | 11 +
.../antlr4/runtime/Go/antlr/char_stream.go | 12 +
.../runtime/Go/antlr/common_token_factory.go | 56 +
.../runtime/Go/antlr/common_token_stream.go | 447 +
.../antlr/antlr4/runtime/Go/antlr/dfa.go | 170 +
.../antlr4/runtime/Go/antlr/dfa_serializer.go | 158 +
.../antlr4/runtime/Go/antlr/dfa_state.go | 171 +
.../Go/antlr/diagnostic_error_listener.go | 111 +
.../antlr4/runtime/Go/antlr/error_listener.go | 108 +
.../antlr4/runtime/Go/antlr/error_strategy.go | 762 ++
.../antlr/antlr4/runtime/Go/antlr/errors.go | 241 +
.../antlr4/runtime/Go/antlr/file_stream.go | 49 +
.../antlr4/runtime/Go/antlr/input_stream.go | 113 +
.../antlr4/runtime/Go/antlr/int_stream.go | 16 +
.../antlr4/runtime/Go/antlr/interval_set.go | 308 +
.../antlr/antlr4/runtime/Go/antlr/lexer.go | 418 +
.../antlr4/runtime/Go/antlr/lexer_action.go | 430 +
.../runtime/Go/antlr/lexer_action_executor.go | 173 +
.../runtime/Go/antlr/lexer_atn_simulator.go | 679 ++
.../antlr4/runtime/Go/antlr/ll1_analyzer.go | 212 +
.../antlr/antlr4/runtime/Go/antlr/parser.go | 718 ++
.../runtime/Go/antlr/parser_atn_simulator.go | 1544 ++++
.../runtime/Go/antlr/parser_rule_context.go | 362 +
.../runtime/Go/antlr/prediction_context.go | 751 ++
.../runtime/Go/antlr/prediction_mode.go | 553 ++
.../antlr4/runtime/Go/antlr/recognizer.go | 217 +
.../antlr4/runtime/Go/antlr/rule_context.go | 114 +
.../runtime/Go/antlr/semantic_context.go | 466 +
.../antlr/antlr4/runtime/Go/antlr/token.go | 210 +
.../antlr4/runtime/Go/antlr/token_source.go | 17 +
.../antlr4/runtime/Go/antlr/token_stream.go | 20 +
.../runtime/Go/antlr/tokenstream_rewriter.go | 649 ++
.../antlr4/runtime/Go/antlr/trace_listener.go | 32 +
.../antlr4/runtime/Go/antlr/transition.go | 428 +
.../antlr/antlr4/runtime/Go/antlr/tree.go | 256 +
.../antlr/antlr4/runtime/Go/antlr/trees.go | 137 +
.../antlr/antlr4/runtime/Go/antlr/utils.go | 355 +
.../antlr4/runtime/Go/antlr/utils_set.go | 237 +
.../backoff/v4}/.gitignore | 11 +-
.../cenkalti/backoff/v4/.travis.yml | 10 +
vendor/github.com/cenkalti/backoff/v4/LICENSE | 20 +
.../github.com/cenkalti/backoff/v4/README.md | 32 +
.../github.com/cenkalti/backoff/v4/backoff.go | 66 +
.../github.com/cenkalti/backoff/v4/context.go | 62 +
.../cenkalti/backoff/v4/exponential.go | 161 +
.../github.com/cenkalti/backoff/v4/retry.go | 112 +
.../github.com/cenkalti/backoff/v4/ticker.go | 97 +
.../github.com/cenkalti/backoff/v4/timer.go | 35 +
.../github.com/cenkalti/backoff/v4/tries.go | 38 +
.../emicklei/go-restful/v3/CHANGES.md | 4 +
.../emicklei/go-restful/v3/README.md | 3 +-
.../emicklei/go-restful/v3/filter_adapter.go | 21 +
.../emicklei/go-restful/v3/parameter.go | 8 +
.../emicklei/go-restful/v3/web_service.go | 12 +
vendor/github.com/felixge/httpsnoop/README.md | 3 +-
.../felixge/httpsnoop/capture_metrics.go | 24 +-
.../httpsnoop/wrap_generated_gteq_1.8.go | 337 +-
.../httpsnoop/wrap_generated_lt_1.8.go | 169 +-
.../github.com/fsnotify/fsnotify/.gitignore | 10 +-
vendor/github.com/fsnotify/fsnotify/.mailmap | 2 +
.../github.com/fsnotify/fsnotify/.travis.yml | 36 -
vendor/github.com/fsnotify/fsnotify/AUTHORS | 52 -
.../github.com/fsnotify/fsnotify/CHANGELOG.md | 247 +-
.../fsnotify/fsnotify/CONTRIBUTING.md | 89 +-
vendor/github.com/fsnotify/fsnotify/LICENSE | 47 +-
vendor/github.com/fsnotify/fsnotify/README.md | 237 +-
.../fsnotify/fsnotify/backend_fen.go | 162 +
.../fsnotify/fsnotify/backend_inotify.go | 459 +
.../fsnotify/fsnotify/backend_kqueue.go | 707 ++
.../fsnotify/fsnotify/backend_other.go | 66 +
.../fsnotify/fsnotify/backend_windows.go | 746 ++
vendor/github.com/fsnotify/fsnotify/fen.go | 37 -
.../github.com/fsnotify/fsnotify/fsnotify.go | 97 +-
.../github.com/fsnotify/fsnotify/inotify.go | 337 -
.../fsnotify/fsnotify/inotify_poller.go | 187 -
vendor/github.com/fsnotify/fsnotify/kqueue.go | 521 --
vendor/github.com/fsnotify/fsnotify/mkdoc.zsh | 208 +
.../{open_mode_bsd.go => system_bsd.go} | 5 +-
.../{open_mode_darwin.go => system_darwin.go} | 5 +-
.../github.com/fsnotify/fsnotify/windows.go | 561 --
vendor/github.com/go-logr/logr/funcr/funcr.go | 787 ++
.../go-logr/stdr}/LICENSE | 0
vendor/github.com/go-logr/stdr/README.md | 6 +
vendor/github.com/go-logr/stdr/stdr.go | 170 +
.../jsonreference/internal/normalize_url.go | 63 +
.../go-openapi/jsonreference/reference.go | 6 +-
.../github.com/golang-jwt/jwt/v4/.gitignore | 4 -
vendor/github.com/golang-jwt/jwt/v4/LICENSE | 9 -
.../golang-jwt/jwt/v4/MIGRATION_GUIDE.md | 22 -
vendor/github.com/golang-jwt/jwt/v4/README.md | 114 -
.../golang-jwt/jwt/v4/VERSION_HISTORY.md | 135 -
vendor/github.com/golang-jwt/jwt/v4/claims.go | 273 -
vendor/github.com/golang-jwt/jwt/v4/doc.go | 4 -
vendor/github.com/golang-jwt/jwt/v4/ecdsa.go | 142 -
.../golang-jwt/jwt/v4/ecdsa_utils.go | 69 -
.../github.com/golang-jwt/jwt/v4/ed25519.go | 85 -
.../golang-jwt/jwt/v4/ed25519_utils.go | 64 -
vendor/github.com/golang-jwt/jwt/v4/errors.go | 64 -
vendor/github.com/golang-jwt/jwt/v4/hmac.go | 95 -
.../golang-jwt/jwt/v4/map_claims.go | 148 -
vendor/github.com/golang-jwt/jwt/v4/none.go | 52 -
vendor/github.com/golang-jwt/jwt/v4/parser.go | 170 -
.../golang-jwt/jwt/v4/parser_option.go | 29 -
vendor/github.com/golang-jwt/jwt/v4/rsa.go | 101 -
.../github.com/golang-jwt/jwt/v4/rsa_pss.go | 142 -
.../github.com/golang-jwt/jwt/v4/rsa_utils.go | 105 -
.../golang-jwt/jwt/v4/signing_method.go | 46 -
.../golang-jwt/jwt/v4/staticcheck.conf | 1 -
vendor/github.com/golang-jwt/jwt/v4/token.go | 131 -
vendor/github.com/golang-jwt/jwt/v4/types.go | 127 -
.../golang/protobuf/descriptor/descriptor.go | 180 -
.../protoc-gen-go/descriptor/descriptor.pb.go | 200 -
.../protobuf/ptypes/wrappers/wrappers.pb.go | 71 -
.../autorest/adal => google/cel-go}/LICENSE | 44 +-
.../github.com/google/cel-go/cel/BUILD.bazel | 76 +
vendor/github.com/google/cel-go/cel/cel.go | 19 +
vendor/github.com/google/cel-go/cel/decls.go | 1179 +++
vendor/github.com/google/cel-go/cel/env.go | 613 ++
vendor/github.com/google/cel-go/cel/io.go | 280 +
.../github.com/google/cel-go/cel/library.go | 343 +
vendor/github.com/google/cel-go/cel/macro.go | 139 +
.../github.com/google/cel-go/cel/options.go | 543 ++
.../github.com/google/cel-go/cel/program.go | 564 ++
.../google/cel-go/checker/BUILD.bazel | 60 +
.../google/cel-go/checker/checker.go | 641 ++
.../github.com/google/cel-go/checker/cost.go | 627 ++
.../google/cel-go/checker/decls/BUILD.bazel | 20 +
.../google/cel-go/checker/decls/decls.go | 231 +
.../google/cel-go/checker/decls/scopes.go | 145 +
.../github.com/google/cel-go/checker/env.go | 411 +
.../google/cel-go/checker/errors.go | 96 +
.../google/cel-go/checker/mapping.go | 49 +
.../google/cel-go/checker/options.go | 53 +
.../google/cel-go/checker/printer.go | 71 +
.../google/cel-go/checker/standard.go | 492 ++
.../github.com/google/cel-go/checker/types.go | 494 ++
.../google/cel-go/common/BUILD.bazel | 35 +
.../cel-go/common/containers/BUILD.bazel | 31 +
.../cel-go/common/containers/container.go | 316 +
.../github.com/google/cel-go/common/cost.go | 40 +
.../google/cel-go/common/debug/BUILD.bazel | 18 +
.../google/cel-go/common/debug/debug.go | 305 +
vendor/github.com/google/cel-go/common/doc.go | 17 +
.../github.com/google/cel-go/common/error.go | 73 +
.../github.com/google/cel-go/common/errors.go | 97 +
.../google/cel-go/common/location.go | 51 +
.../cel-go/common/operators/BUILD.bazel | 14 +
.../cel-go/common/operators/operators.go | 153 +
.../cel-go/common/overloads/BUILD.bazel | 14 +
.../cel-go/common/overloads/overloads.go | 317 +
.../google/cel-go/common/runes/BUILD.bazel | 25 +
.../google/cel-go/common/runes/buffer.go | 194 +
.../github.com/google/cel-go/common/source.go | 186 +
.../google/cel-go/common/types/BUILD.bazel | 89 +
.../google/cel-go/common/types/any_value.go | 24 +
.../google/cel-go/common/types/bool.go | 142 +
.../google/cel-go/common/types/bytes.go | 132 +
.../google/cel-go/common/types/compare.go | 97 +
.../google/cel-go/common/types/doc.go | 17 +
.../google/cel-go/common/types/double.go | 216 +
.../google/cel-go/common/types/duration.go | 199 +
.../google/cel-go/common/types/err.go | 130 +
.../google/cel-go/common/types/int.go | 297 +
.../google/cel-go/common/types/iterator.go | 55 +
.../google/cel-go/common/types/json_value.go | 28 +
.../google/cel-go/common/types/list.go | 489 ++
.../google/cel-go/common/types/map.go | 832 ++
.../google/cel-go/common/types/null.go | 97 +
.../google/cel-go/common/types/object.go | 159 +
.../google/cel-go/common/types/overflow.go | 389 +
.../google/cel-go/common/types/pb/BUILD.bazel | 53 +
.../google/cel-go/common/types/pb/checked.go | 93 +
.../google/cel-go/common/types/pb/enum.go | 44 +
.../google/cel-go/common/types/pb/equal.go | 206 +
.../google/cel-go/common/types/pb/file.go | 141 +
.../google/cel-go/common/types/pb/pb.go | 223 +
.../google/cel-go/common/types/pb/type.go | 552 ++
.../google/cel-go/common/types/provider.go | 539 ++
.../cel-go/common/types/ref/BUILD.bazel | 20 +
.../cel-go/common/types/ref/provider.go | 103 +
.../cel-go/common/types/ref/reference.go | 54 +
.../google/cel-go/common/types/string.go | 218 +
.../google/cel-go/common/types/timestamp.go | 316 +
.../cel-go/common/types/traits/BUILD.bazel | 28 +
.../cel-go/common/types/traits/comparer.go | 33 +
.../cel-go/common/types/traits/container.go | 23 +
.../common/types/traits/field_tester.go | 30 +
.../cel-go/common/types/traits/indexer.go | 25 +
.../cel-go/common/types/traits/iterator.go | 36 +
.../cel-go/common/types/traits/lister.go | 33 +
.../cel-go/common/types/traits/mapper.go | 33 +
.../cel-go/common/types/traits/matcher.go | 23 +
.../google/cel-go/common/types/traits/math.go | 62 +
.../cel-go/common/types/traits/receiver.go | 24 +
.../cel-go/common/types/traits/sizer.go | 25 +
.../cel-go/common/types/traits/traits.go | 64 +
.../google/cel-go/common/types/type.go | 102 +
.../google/cel-go/common/types/uint.go | 249 +
.../google/cel-go/common/types/unknown.go | 66 +
.../google/cel-go/common/types/util.go | 48 +
.../github.com/google/cel-go/ext/BUILD.bazel | 36 +
vendor/github.com/google/cel-go/ext/README.md | 194 +
.../github.com/google/cel-go/ext/encoders.go | 88 +
vendor/github.com/google/cel-go/ext/guards.go | 50 +
.../github.com/google/cel-go/ext/strings.go | 483 ++
.../google/cel-go/interpreter/BUILD.bazel | 72 +
.../google/cel-go/interpreter/activation.go | 201 +
.../cel-go/interpreter/attribute_patterns.go | 404 +
.../google/cel-go/interpreter/attributes.go | 1051 +++
.../google/cel-go/interpreter/coster.go | 35 +
.../google/cel-go/interpreter/decorators.go | 269 +
.../google/cel-go/interpreter/dispatcher.go | 100 +
.../google/cel-go/interpreter/evalstate.go | 75 +
.../cel-go/interpreter/functions/BUILD.bazel | 22 +
.../cel-go/interpreter/functions/functions.go | 62 +
.../cel-go/interpreter/functions/standard.go | 270 +
.../cel-go/interpreter/interpretable.go | 1230 +++
.../google/cel-go/interpreter/interpreter.go | 217 +
.../cel-go/interpreter/optimizations.go | 46 +
.../google/cel-go/interpreter/planner.go | 794 ++
.../google/cel-go/interpreter/prune.go | 397 +
.../google/cel-go/interpreter/runtimecost.go | 241 +
.../google/cel-go/parser/BUILD.bazel | 51 +
.../github.com/google/cel-go/parser/errors.go | 30 +
.../google/cel-go/parser/gen/BUILD.bazel | 26 +
.../google/cel-go/parser/gen/CEL.g4 | 186 +
.../google/cel-go/parser/gen/CEL.interp | 96 +
.../google/cel-go/parser/gen/CEL.tokens | 64 +
.../google/cel-go/parser/gen/CELLexer.interp | 136 +
.../google/cel-go/parser/gen/CELLexer.tokens | 64 +
.../cel-go/parser/gen/cel_base_listener.go | 195 +
.../cel-go/parser/gen/cel_base_visitor.go | 124 +
.../google/cel-go/parser/gen/cel_lexer.go | 345 +
.../google/cel-go/parser/gen/cel_listener.go | 183 +
.../google/cel-go/parser/gen/cel_parser.go | 4650 ++++++++++
.../google/cel-go/parser/gen/cel_visitor.go | 96 +
.../google/cel-go/parser/gen/doc.go} | 14 +-
.../google/cel-go/parser/gen/generate.sh | 35 +
.../github.com/google/cel-go/parser/helper.go | 478 +
.../github.com/google/cel-go/parser/input.go | 128 +
.../github.com/google/cel-go/parser/macro.go | 417 +
.../google/cel-go/parser/options.go | 104 +
.../github.com/google/cel-go/parser/parser.go | 905 ++
.../google/cel-go/parser/unescape.go | 237 +
.../google/cel-go/parser/unparser.go | 596 ++
.../github.com/google/go-cmp/cmp/compare.go | 83 +-
.../google/go-cmp/cmp/export_panic.go | 1 +
.../google/go-cmp/cmp/export_unsafe.go | 1 +
.../go-cmp/cmp/internal/diff/debug_disable.go | 1 +
.../go-cmp/cmp/internal/diff/debug_enable.go | 1 +
.../google/go-cmp/cmp/internal/diff/diff.go | 44 +-
.../cmp/internal/flags/toolchain_legacy.go | 10 -
.../cmp/internal/flags/toolchain_recent.go | 10 -
.../google/go-cmp/cmp/internal/value/name.go | 7 +
.../cmp/internal/value/pointer_purego.go | 1 +
.../cmp/internal/value/pointer_unsafe.go | 1 +
.../google/go-cmp/cmp/internal/value/zero.go | 48 -
.../github.com/google/go-cmp/cmp/options.go | 10 +-
vendor/github.com/google/go-cmp/cmp/path.go | 22 +-
.../google/go-cmp/cmp/report_compare.go | 13 +-
.../google/go-cmp/cmp/report_reflect.go | 24 +-
.../google/go-cmp/cmp/report_slices.go | 31 +-
.../google/go-cmp/cmp/report_text.go | 1 +
.../grpc-gateway/internal/BUILD.bazel | 23 -
.../grpc-gateway/internal/errors.pb.go | 189 -
.../grpc-gateway/internal/errors.proto | 26 -
.../grpc-gateway/runtime/BUILD.bazel | 85 -
.../grpc-gateway/runtime/errors.go | 186 -
.../grpc-gateway/runtime/fieldmask.go | 89 -
.../grpc-gateway/runtime/proto_errors.go | 106 -
.../grpc-gateway/runtime/query.go | 406 -
.../grpc-gateway/{ => v2}/LICENSE.txt | 0
.../v2/internal/httprule/BUILD.bazel | 35 +
.../v2/internal/httprule/compile.go | 121 +
.../grpc-gateway/v2/internal/httprule/fuzz.go | 11 +
.../v2/internal/httprule/parse.go | 368 +
.../v2/internal/httprule/types.go | 60 +
.../grpc-gateway/v2/runtime/BUILD.bazel | 91 +
.../grpc-gateway/{ => v2}/runtime/context.go | 64 +-
.../grpc-gateway/{ => v2}/runtime/convert.go | 60 +-
.../grpc-gateway/{ => v2}/runtime/doc.go | 0
.../grpc-gateway/v2/runtime/errors.go | 180 +
.../grpc-gateway/v2/runtime/fieldmask.go | 165 +
.../grpc-gateway/{ => v2}/runtime/handler.go | 73 +-
.../{ => v2}/runtime/marshal_httpbodyproto.go | 21 +-
.../{ => v2}/runtime/marshal_json.go | 2 +-
.../{ => v2}/runtime/marshal_jsonpb.go | 158 +-
.../{ => v2}/runtime/marshal_proto.go | 5 +-
.../{ => v2}/runtime/marshaler.go | 11 +-
.../{ => v2}/runtime/marshaler_registry.go | 12 +-
.../grpc-gateway/{ => v2}/runtime/mux.go | 248 +-
.../grpc-gateway/{ => v2}/runtime/pattern.go | 203 +-
.../{ => v2}/runtime/proto2_convert.go | 2 +-
.../grpc-gateway/v2/runtime/query.go | 329 +
.../{ => v2}/utilities/BUILD.bazel | 14 +-
.../grpc-gateway/{ => v2}/utilities/doc.go | 0
.../{ => v2}/utilities/pattern.go | 0
.../{ => v2}/utilities/readerfactory.go | 0
.../grpc-gateway/{ => v2}/utilities/trie.go | 5 +-
.../inconshreveable/mousetrap/LICENSE | 208 +-
.../client_golang/prometheus/collector.go | 6 +-
.../prometheus/collectors/collectors.go | 40 +
.../collectors/dbstats_collector.go | 119 +
.../prometheus/collectors/expvar_collector.go | 57 +
.../collectors/go_collector_go116.go | 49 +
.../collectors/go_collector_latest.go | 160 +
.../collectors/process_collector.go | 56 +
.../client_golang/prometheus/counter.go | 13 +-
.../client_golang/prometheus/desc.go | 5 +-
.../client_golang/prometheus/doc.go | 93 +-
.../client_golang/prometheus/gauge.go | 6 +-
.../client_golang/prometheus/get_pid.go | 26 +
.../prometheus/get_pid_gopherjs.go | 23 +
.../client_golang/prometheus/go_collector.go | 20 +-
.../prometheus/go_collector_go116.go | 17 +-
...lector_go117.go => go_collector_latest.go} | 314 +-
.../client_golang/prometheus/histogram.go | 978 ++-
.../prometheus/internal/almost_equal.go | 60 +
.../prometheus/internal/difflib.go | 654 ++
.../internal/go_collector_options.go | 32 +
.../prometheus/internal/go_runtime_metrics.go | 18 +-
.../prometheus/internal/metric.go | 28 +-
.../client_golang/prometheus/labels.go | 9 +-
.../client_golang/prometheus/metric.go | 112 +-
.../client_golang/prometheus/num_threads.go | 25 +
.../prometheus/num_threads_gopherjs.go | 22 +
.../client_golang/prometheus/observer.go | 2 +-
.../prometheus/process_collector.go | 10 +-
.../prometheus/process_collector_js.go | 26 +
.../prometheus/process_collector_other.go | 4 +-
.../prometheus/promhttp/delegator.go | 18 +-
.../client_golang/prometheus/promhttp/http.go | 20 +-
.../prometheus/promhttp/instrument_client.go | 40 +-
.../prometheus/promhttp/instrument_server.go | 123 +-
.../prometheus/promhttp/option.go | 39 +-
.../client_golang/prometheus/registry.go | 152 +-
.../client_golang/prometheus/summary.go | 9 +-
.../client_golang/prometheus/testutil/lint.go | 4 +-
.../prometheus/testutil/promlint/promlint.go | 5 +-
.../prometheus/testutil/testutil.go | 166 +-
.../client_golang/prometheus/timer.go | 11 +-
.../client_golang/prometheus/value.go | 47 +-
.../client_golang/prometheus/vec.go | 88 +-
.../client_golang/prometheus/wrap.go | 4 +-
.../prometheus/client_model/go/metrics.pb.go | 333 +-
.../prometheus/common/expfmt/fuzz.go | 1 +
.../common/expfmt/openmetrics_create.go | 4 +-
.../prometheus/common/model/time.go | 2 +-
.../github.com/prometheus/procfs/.gitignore | 3 +-
.../prometheus/procfs/.golangci.yml | 10 +-
.../prometheus/procfs/CODE_OF_CONDUCT.md | 4 +-
.../prometheus/procfs/CONTRIBUTING.md | 4 +-
vendor/github.com/prometheus/procfs/Makefile | 10 +-
.../prometheus/procfs/Makefile.common | 89 +-
.../github.com/prometheus/procfs/SECURITY.md | 2 +-
vendor/github.com/prometheus/procfs/arp.go | 45 +-
.../github.com/prometheus/procfs/cpuinfo.go | 5 +-
.../prometheus/procfs/cpuinfo_armx.go | 1 +
.../prometheus/procfs/cpuinfo_mipsx.go | 1 +
.../prometheus/procfs/cpuinfo_others.go | 4 +-
.../prometheus/procfs/cpuinfo_ppcx.go | 1 +
.../prometheus/procfs/cpuinfo_riscvx.go | 1 +
.../prometheus/procfs/cpuinfo_s390x.go | 1 +
.../prometheus/procfs/cpuinfo_x86.go | 1 +
.../prometheus/procfs/fixtures.ttar | 7673 -----------------
.../prometheus/procfs/internal/fs/fs.go | 2 +-
.../prometheus/procfs/internal/util/parse.go | 6 +-
.../procfs/internal/util/readfile.go | 11 +-
.../procfs/internal/util/sysreadfile.go | 8 +-
.../internal/util/sysreadfile_compat.go | 3 +-
vendor/github.com/prometheus/procfs/ipvs.go | 3 +-
.../prometheus/procfs/kernel_random.go | 1 +
.../github.com/prometheus/procfs/loadavg.go | 2 +-
vendor/github.com/prometheus/procfs/mdstat.go | 10 +-
.../prometheus/procfs/net_conntrackstat.go | 12 +-
.../github.com/prometheus/procfs/net_dev.go | 8 +-
.../prometheus/procfs/net_ip_socket.go | 2 +-
.../prometheus/procfs/net_protocols.go | 4 +-
.../prometheus/procfs/net_softnet.go | 8 +-
.../procfs/{xfrm.go => net_xfrm.go} | 9 +-
.../github.com/prometheus/procfs/netstat.go | 8 +-
vendor/github.com/prometheus/procfs/proc.go | 10 +-
.../prometheus/procfs/proc_cgroup.go | 6 +-
.../prometheus/procfs/proc_cgroups.go | 98 +
.../prometheus/procfs/proc_environ.go | 2 +-
.../prometheus/procfs/proc_fdinfo.go | 3 +-
.../prometheus/procfs/proc_limits.go | 2 +-
.../github.com/prometheus/procfs/proc_maps.go | 12 +-
.../prometheus/procfs/proc_netstat.go | 440 +
.../github.com/prometheus/procfs/proc_psi.go | 14 +-
.../prometheus/procfs/proc_smaps.go | 23 +-
.../github.com/prometheus/procfs/proc_snmp.go | 353 +
.../prometheus/procfs/proc_snmp6.go | 381 +
.../github.com/prometheus/procfs/proc_stat.go | 11 +-
.../prometheus/procfs/proc_status.go | 32 +-
.../github.com/prometheus/procfs/proc_sys.go | 51 +
.../github.com/prometheus/procfs/schedstat.go | 6 +-
vendor/github.com/prometheus/procfs/slab.go | 2 +-
.../github.com/prometheus/procfs/softirqs.go | 160 +
vendor/github.com/prometheus/procfs/stat.go | 10 +-
vendor/github.com/prometheus/procfs/vm.go | 6 +-
.../github.com/prometheus/procfs/zoneinfo.go | 5 +-
vendor/github.com/spf13/cobra/.golangci.yml | 14 +
vendor/github.com/spf13/cobra/CHANGELOG.md | 51 -
vendor/github.com/spf13/cobra/Makefile | 2 +-
vendor/github.com/spf13/cobra/README.md | 13 +-
vendor/github.com/spf13/cobra/active_help.go | 63 +
vendor/github.com/spf13/cobra/active_help.md | 157 +
vendor/github.com/spf13/cobra/args.go | 38 +-
.../spf13/cobra/bash_completions.go | 33 +-
.../spf13/cobra/bash_completionsV2.go | 190 +-
vendor/github.com/spf13/cobra/cobra.go | 25 +-
vendor/github.com/spf13/cobra/command.go | 151 +-
.../github.com/spf13/cobra/command_notwin.go | 14 +
vendor/github.com/spf13/cobra/command_win.go | 14 +
vendor/github.com/spf13/cobra/completions.go | 70 +-
.../spf13/cobra/fish_completions.go | 23 +-
vendor/github.com/spf13/cobra/flag_groups.go | 224 +
.../spf13/cobra/powershell_completions.go | 45 +-
.../spf13/cobra/projects_using_cobra.md | 21 +-
.../spf13/cobra/shell_completions.go | 14 +
.../spf13/cobra/shell_completions.md | 26 +-
vendor/github.com/spf13/cobra/user_guide.md | 116 +-
.../github.com/spf13/cobra/zsh_completions.go | 49 +-
.../github.com/stoewer/go-strcase/.gitignore | 17 +
.../stoewer/go-strcase/.golangci.yml | 26 +
vendor/github.com/stoewer/go-strcase/LICENSE | 21 +
.../github.com/stoewer/go-strcase/README.md | 50 +
vendor/github.com/stoewer/go-strcase/camel.go | 37 +
vendor/github.com/stoewer/go-strcase/doc.go | 8 +
.../github.com/stoewer/go-strcase/helper.go | 71 +
vendor/github.com/stoewer/go-strcase/kebab.go | 14 +
vendor/github.com/stoewer/go-strcase/snake.go | 58 +
.../go.etcd.io/etcd/api/v3/version/version.go | 2 +-
.../etcd/client/pkg/v3/fileutil/filereader.go | 60 +
.../pkg/v3/transport/keepalive_listener.go | 65 +-
.../client/pkg/v3/transport/limit_listen.go | 6 +
.../etcd/client/pkg/v3/transport/listener.go | 19 +-
vendor/go.etcd.io/etcd/client/v3/client.go | 4 +-
vendor/go.etcd.io/etcd/client/v3/lease.go | 13 +-
vendor/go.etcd.io/etcd/client/v3/logger.go | 4 +-
vendor/go.etcd.io/etcd/client/v3/op.go | 2 +-
vendor/go.opentelemetry.io/contrib/.gitignore | 13 -
.../go.opentelemetry.io/contrib/.golangci.yml | 32 -
.../go.opentelemetry.io/contrib/CHANGELOG.md | 319 -
vendor/go.opentelemetry.io/contrib/CODEOWNERS | 17 -
.../contrib/CONTRIBUTING.md | 135 -
vendor/go.opentelemetry.io/contrib/Makefile | 203 -
vendor/go.opentelemetry.io/contrib/README.md | 25 -
.../go.opentelemetry.io/contrib/RELEASING.md | 96 -
.../grpc/otelgrpc/grpctrace.go | 65 +-
.../grpc/otelgrpc/interceptor.go | 151 +-
.../grpc/otelgrpc/interceptorinfo.go | 50 +
.../grpc/otelgrpc/internal/parse.go | 43 +
.../grpc/otelgrpc/semconv.go | 52 +
.../grpc/otelgrpc/version.go} | 8 +-
.../net/http/otelhttp/client.go | 20 +-
.../net/http/otelhttp/common.go | 9 +-
.../net/http/otelhttp/config.go | 103 +-
.../net/http/otelhttp/handler.go | 64 +-
.../net/http/otelhttp/labeler.go | 4 +-
.../net/http/otelhttp/transport.go | 79 +-
.../net/http/otelhttp/version.go | 26 +
.../instrumentation/net/http/otelhttp/wrap.go | 5 +-
.../contrib/pre_release.sh | 158 -
vendor/go.opentelemetry.io/contrib/tag.sh | 178 -
.../go.opentelemetry.io/otel/.gitattributes | 3 +
vendor/go.opentelemetry.io/otel/.gitignore | 4 +-
vendor/go.opentelemetry.io/otel/.golangci.yml | 236 +-
vendor/go.opentelemetry.io/otel/.lycheeignore | 3 +
.../otel/.markdownlint.yaml | 29 +
vendor/go.opentelemetry.io/otel/CHANGELOG.md | 676 +-
vendor/go.opentelemetry.io/otel/CODEOWNERS | 4 +-
.../go.opentelemetry.io/otel/CONTRIBUTING.md | 262 +-
vendor/go.opentelemetry.io/otel/Makefile | 203 +-
vendor/go.opentelemetry.io/otel/README.md | 82 +-
vendor/go.opentelemetry.io/otel/RELEASING.md | 59 +-
vendor/go.opentelemetry.io/otel/VERSIONING.md | 37 +-
.../go.opentelemetry.io/otel/attribute/doc.go | 6 +-
.../otel/attribute/encoder.go | 86 +-
.../otel/attribute/iterator.go | 80 +-
.../go.opentelemetry.io/otel/attribute/key.go | 140 +-
.../go.opentelemetry.io/otel/attribute/kv.go | 92 +-
.../go.opentelemetry.io/otel/attribute/set.go | 211 +-
.../otel/attribute/type_string.go | 9 +-
.../otel/attribute/value.go | 161 +-
.../otel/baggage/baggage.go | 569 +-
.../otel/baggage/context.go | 39 +
.../go.opentelemetry.io/otel/baggage/doc.go | 4 -
vendor/go.opentelemetry.io/otel/codes/doc.go | 4 -
vendor/go.opentelemetry.io/otel/doc.go | 4 -
.../go.opentelemetry.io/otel/error_handler.go | 16 +
.../otel/exporters/otlp/README.md | 31 -
.../otel/exporters/otlp/internal/config.go | 34 +
.../otlp/internal/envconfig/envconfig.go | 148 +
.../otlp/internal/otlpconfig/envconfig.go | 196 -
.../otlp/internal/otlpconfig/options.go | 376 -
.../exporters/otlp/internal/otlpconfig/tls.go | 69 -
.../exporters/otlp/internal/partialsuccess.go | 68 +
.../otlp/{ => internal/retry}/LICENSE | 0
.../exporters/otlp/internal/retry/retry.go | 150 +
.../otlp/internal/transform/attribute.go | 141 -
.../otlp/internal/transform/metric.go | 631 --
.../otel/exporters/otlp/options.go | 45 -
.../otel/exporters/otlp/otlp.go | 179 -
.../exporters/otlp/otlpgrpc/connection.go | 278 -
.../otel/exporters/otlp/otlpgrpc/doc.go | 25 -
.../otel/exporters/otlp/otlpgrpc/driver.go | 195 -
.../otel/exporters/otlp/otlpgrpc/options.go | 202 -
.../otlp/otlptrace}/LICENSE | 0
.../otel/exporters/otlp/otlptrace/README.md | 51 +
.../otel/exporters/otlp/otlptrace/clients.go | 54 +
.../otel/exporters/otlp/otlptrace/exporter.go | 113 +
.../internal/otlpconfig/envconfig.go | 127 +
.../otlptrace/internal/otlpconfig/options.go | 307 +
.../internal/otlpconfig}/optiontypes.go | 14 +-
.../otlp/otlptrace/internal/otlpconfig/tls.go | 34 +
.../internal/tracetransform/attribute.go | 158 +
.../tracetransform}/instrumentation.go | 11 +-
.../internal/tracetransform}/resource.go | 5 +-
.../internal/tracetransform}/span.go | 127 +-
.../otlp/otlptrace/otlptracegrpc}/LICENSE | 0
.../otlp/otlptrace/otlptracegrpc/client.go | 295 +
.../otlp/otlptrace/otlptracegrpc/exporter.go | 31 +
.../otlp/otlptrace/otlptracegrpc/options.go | 189 +
.../otel/exporters/otlp/protocoldriver.go | 145 -
vendor/go.opentelemetry.io/otel/handler.go | 92 +-
.../otel/internal/baggage/baggage.go | 341 +-
.../otel/internal/baggage/context.go | 92 +
.../otel/internal/global/internal_logging.go | 63 +
.../otel/internal/global/meter.go | 348 -
.../otel/internal/global/propagator.go | 2 +-
.../otel/internal/global/state.go | 92 +-
.../otel/internal/global/trace.go | 61 +-
.../otel/internal/metric/async.go | 148 -
.../otel/internal/rawhelpers.go | 4 +-
.../atomicfields.go => internal_logging.go} | 16 +-
.../go.opentelemetry.io/otel/metric/config.go | 119 +-
vendor/go.opentelemetry.io/otel/metric/doc.go | 44 -
.../metric/global/{metric.go => global.go} | 29 +-
.../instrument/asyncfloat64/asyncfloat64.go | 70 +
.../instrument/asyncint64/asyncint64.go | 70 +
.../otel/metric/instrument/config.go | 69 +
.../otel/metric/instrument/instrument.go | 30 +
.../instrument/syncfloat64/syncfloat64.go | 56 +
.../metric/instrument/syncint64/syncint64.go | 56 +
.../otel/metric/instrumentkind_string.go | 28 -
.../metric/internal/global/instruments.go | 360 +
.../otel/metric/internal/global/meter.go | 347 +
.../otel/metric/internal/global/state.go | 68 +
.../go.opentelemetry.io/otel/metric/meter.go | 60 +
.../go.opentelemetry.io/otel/metric/metric.go | 577 --
.../otel/metric/metric_instrument.go | 777 --
.../otel/metric/metric_noop.go | 59 -
.../otel/metric/metric_sdkapi.go | 95 -
.../go.opentelemetry.io/otel/metric/noop.go | 181 +
.../otel/metric/number/kind_string.go | 24 -
.../otel/metric/number/number.go | 538 --
.../otel/metric/registry/doc.go | 24 -
.../otel/metric/registry/registry.go | 170 -
.../otel/{ => metric}/unit/doc.go | 2 +-
.../otel/{ => metric}/unit/unit.go | 4 +-
.../go.opentelemetry.io/otel/pre_release.sh | 95 -
.../otel/propagation/baggage.go | 75 +-
.../otel/propagation/doc.go | 6 +-
.../otel/propagation/propagation.go | 50 +-
.../otel/propagation/trace_context.go | 33 +-
.../export/metric/aggregation/aggregation.go | 154 -
.../sdk/export/metric/exportkind_string.go | 25 -
.../otel/sdk/export/metric/metric.go | 445 -
.../number => sdk/instrumentation}/doc.go | 19 +-
.../otel/sdk/instrumentation/library.go | 20 +-
.../noop.go => sdk/instrumentation/scope.go} | 29 +-
.../otel/sdk/internal/env/env.go | 177 +
.../otel/sdk/internal/sanitize.go | 50 -
.../otel/sdk/metric/aggregator/aggregator.go | 52 -
.../otel/sdk/metric/aggregator/exact/exact.go | 130 -
.../metric/aggregator/histogram/histogram.go | 270 -
.../metric/aggregator/lastvalue/lastvalue.go | 135 -
.../metric/aggregator/minmaxsumcount/mmsc.go | 165 -
.../otel/sdk/metric/aggregator/sum/sum.go | 106 -
.../sdk/metric/controller/basic/config.go | 122 -
.../sdk/metric/controller/basic/controller.go | 312 -
.../otel/sdk/metric/controller/time/time.go | 59 -
.../otel/sdk/metric/doc.go | 141 -
.../otel/sdk/metric/processor/basic/basic.go | 377 -
.../otel/sdk/metric/processor/basic/config.go | 42 -
.../otel/sdk/metric/refcount_mapped.go | 59 -
.../otel/sdk/metric/sdk.go | 555 --
.../otel/sdk/metric/selector/simple/simple.go | 120 -
.../otel/sdk/resource/auto.go | 12 +-
.../otel/sdk/resource/builtin.go | 41 +-
.../otel/sdk/resource/config.go | 228 +-
.../otel/sdk/resource/container.go | 100 +
.../otel/sdk/resource/doc.go | 4 -
.../otel/sdk/resource/env.go | 57 +-
.../otel/sdk/resource/os.go | 68 +-
.../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 | 87 +-
.../otel/sdk/resource/resource.go | 140 +-
.../otel/sdk/trace/attributesmap.go | 91 -
.../otel/sdk/trace/batch_span_processor.go | 186 +-
.../otel/sdk/trace/config.go | 68 -
.../go.opentelemetry.io/otel/sdk/trace/doc.go | 4 -
.../otel/sdk/trace/event.go | 37 +
.../otel/sdk/trace/evictedqueue.go | 24 +-
.../otel/sdk/trace/id_generator.go | 16 +-
.../otel/sdk/trace/link.go | 34 +
.../otel/sdk/trace/provider.go | 257 +-
.../otel/sdk/trace/sampler_env.go | 108 +
.../otel/sdk/trace/sampling.go | 61 +-
.../otel/sdk/trace/simple_span_processor.go | 64 +-
.../otel/sdk/trace/snapshot.go | 144 +
.../otel/sdk/trace/span.go | 746 +-
.../otel/sdk/trace/span_exporter.go | 16 +-
.../otel/sdk/trace/span_limits.go | 125 +
.../otel/sdk/trace/span_processor.go | 11 +
.../otel/sdk/trace/tracer.go | 148 +-
.../otel/semconv/exception.go | 39 -
.../go.opentelemetry.io/otel/semconv/http.go | 297 -
.../otel/semconv/internal/http.go | 336 +
.../otel/semconv/resource.go | 257 -
.../go.opentelemetry.io/otel/semconv/trace.go | 376 -
.../otel/semconv/{ => v1.12.0}/doc.go | 10 +-
.../semconv/v1.12.0/exception.go} | 12 +-
.../otel/semconv/v1.12.0/http.go | 114 +
.../otel/semconv/v1.12.0/resource.go | 1042 +++
.../otlp/doc.go => semconv/v1.12.0/schema.go} | 12 +-
.../otel/semconv/v1.12.0/trace.go | 1704 ++++
vendor/go.opentelemetry.io/otel/tag.sh | 178 -
vendor/go.opentelemetry.io/otel/trace.go | 13 +-
.../go.opentelemetry.io/otel/trace/config.go | 331 +-
vendor/go.opentelemetry.io/otel/trace/doc.go | 4 -
vendor/go.opentelemetry.io/otel/trace/noop.go | 19 +-
.../go.opentelemetry.io/otel/trace/trace.go | 323 +-
.../otel/trace/tracestate.go | 212 +
vendor/go.opentelemetry.io/otel/version.go | 2 +-
vendor/go.opentelemetry.io/otel/versions.yaml | 58 +
.../metrics/v1/metrics_service.pb.go | 255 -
.../metrics/v1/metrics_service.pb.gw.go | 169 -
.../metrics/v1/metrics_service_grpc.pb.go | 101 -
.../collector/trace/v1/trace_config.pb.go | 573 --
.../collector/trace/v1/trace_service.pb.go | 191 +-
.../collector/trace/v1/trace_service.pb.gw.go | 14 +-
.../trace/v1/trace_service_grpc.pb.go | 12 +-
.../proto/otlp/common/v1/common.pb.go | 242 +-
.../proto/otlp/metrics/v1/metrics.pb.go | 2469 ------
.../proto/otlp/resource/v1/resource.pb.go | 31 +-
.../proto/otlp/trace/v1/trace.pb.go | 688 +-
.../golang.org/x/crypto/cryptobyte/builder.go | 5 +
.../golang.org/x/crypto/cryptobyte/string.go | 11 +
.../{subtle/aliasing.go => alias/alias.go} | 5 +-
.../alias_purego.go} | 5 +-
.../x/crypto/nacl/secretbox/secretbox.go | 6 +-
.../golang.org/x/crypto/pkcs12/bmp-string.go | 50 -
vendor/golang.org/x/crypto/pkcs12/crypto.go | 131 -
vendor/golang.org/x/crypto/pkcs12/errors.go | 23 -
.../x/crypto/pkcs12/internal/rc2/rc2.go | 271 -
vendor/golang.org/x/crypto/pkcs12/mac.go | 45 -
vendor/golang.org/x/crypto/pkcs12/pbkdf.go | 170 -
vendor/golang.org/x/crypto/pkcs12/pkcs12.go | 360 -
vendor/golang.org/x/crypto/pkcs12/safebags.go | 57 -
vendor/golang.org/x/mod/module/module.go | 4 +-
vendor/golang.org/x/net/context/go17.go | 4 +-
vendor/golang.org/x/net/http2/frame.go | 22 +-
vendor/golang.org/x/net/http2/hpack/encode.go | 2 +-
vendor/golang.org/x/net/http2/hpack/hpack.go | 16 +-
.../x/net/http2/hpack/static_table.go | 188 +
vendor/golang.org/x/net/http2/hpack/tables.go | 78 +-
vendor/golang.org/x/net/http2/http2.go | 8 +-
vendor/golang.org/x/net/http2/server.go | 98 +-
vendor/golang.org/x/net/http2/transport.go | 122 +-
vendor/golang.org/x/net/trace/trace.go | 2 +-
.../x/oauth2/authhandler/authhandler.go | 56 -
.../golang.org/x/oauth2/google/appengine.go | 38 -
.../x/oauth2/google/appengine_gen1.go | 78 -
.../x/oauth2/google/appengine_gen2_flex.go | 28 -
vendor/golang.org/x/oauth2/google/default.go | 221 -
vendor/golang.org/x/oauth2/google/doc.go | 79 -
vendor/golang.org/x/oauth2/google/google.go | 270 -
.../google/internal/externalaccount/aws.go | 470 -
.../externalaccount/basecredentials.go | 270 -
.../internal/externalaccount/clientauth.go | 45 -
.../google/internal/externalaccount/err.go | 18 -
.../externalaccount/filecredsource.go | 57 -
.../internal/externalaccount/impersonate.go | 98 -
.../internal/externalaccount/sts_exchange.go | 107 -
.../internal/externalaccount/urlcredsource.go | 75 -
vendor/golang.org/x/oauth2/google/jwt.go | 101 -
vendor/golang.org/x/oauth2/google/sdk.go | 201 -
vendor/golang.org/x/oauth2/jws/jws.go | 182 -
vendor/golang.org/x/oauth2/jwt/jwt.go | 185 -
vendor/golang.org/x/sys/cpu/cpu_arm64.go | 12 +-
.../golang.org/x/sys/cpu/cpu_openbsd_arm64.go | 65 +
.../golang.org/x/sys/cpu/cpu_openbsd_arm64.s | 11 +
.../golang.org/x/sys/cpu/cpu_other_arm64.go | 4 +-
.../golang.org/x/sys/cpu/cpu_other_ppc64x.go | 15 +
vendor/golang.org/x/sys/plan9/mkerrors.sh | 4 +-
vendor/golang.org/x/sys/plan9/syscall.go | 10 +-
vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s | 31 +
vendor/golang.org/x/sys/unix/dirent.go | 4 +-
vendor/golang.org/x/sys/unix/ioctl_linux.go | 20 +-
vendor/golang.org/x/sys/unix/mkall.sh | 45 +-
vendor/golang.org/x/sys/unix/mkerrors.sh | 4 +-
vendor/golang.org/x/sys/unix/str.go | 27 -
vendor/golang.org/x/sys/unix/syscall.go | 10 +-
vendor/golang.org/x/sys/unix/syscall_aix.go | 57 +-
vendor/golang.org/x/sys/unix/syscall_bsd.go | 2 +-
.../x/sys/unix/syscall_darwin.1_12.go | 32 -
.../x/sys/unix/syscall_darwin.1_13.go | 108 -
.../golang.org/x/sys/unix/syscall_darwin.go | 90 +
.../x/sys/unix/syscall_freebsd_386.go | 2 +-
.../x/sys/unix/syscall_freebsd_amd64.go | 2 +-
.../x/sys/unix/syscall_freebsd_arm.go | 2 +-
.../x/sys/unix/syscall_freebsd_arm64.go | 2 +-
.../x/sys/unix/syscall_freebsd_riscv64.go | 2 +-
.../golang.org/x/sys/unix/syscall_illumos.go | 106 -
vendor/golang.org/x/sys/unix/syscall_linux.go | 45 +-
.../x/sys/unix/syscall_linux_386.go | 4 -
.../x/sys/unix/syscall_linux_amd64.go | 4 -
.../x/sys/unix/syscall_linux_arm.go | 4 -
.../x/sys/unix/syscall_linux_arm64.go | 4 -
.../x/sys/unix/syscall_linux_loong64.go | 4 -
.../x/sys/unix/syscall_linux_mips64x.go | 4 -
.../x/sys/unix/syscall_linux_mipsx.go | 4 -
.../x/sys/unix/syscall_linux_ppc.go | 4 -
.../x/sys/unix/syscall_linux_ppc64x.go | 4 -
.../x/sys/unix/syscall_linux_riscv64.go | 4 -
.../x/sys/unix/syscall_linux_s390x.go | 4 -
.../x/sys/unix/syscall_linux_sparc64.go | 4 -
.../x/sys/unix/syscall_openbsd_libc.go | 27 +
.../x/sys/unix/syscall_openbsd_ppc64.go | 42 +
.../x/sys/unix/syscall_openbsd_riscv64.go | 42 +
.../golang.org/x/sys/unix/syscall_solaris.go | 215 +-
vendor/golang.org/x/sys/unix/syscall_unix.go | 20 +-
.../golang.org/x/sys/unix/syscall_unix_gc.go | 6 +-
.../x/sys/unix/syscall_zos_s390x.go | 173 +-
vendor/golang.org/x/sys/unix/sysvshm_unix.go | 13 +-
vendor/golang.org/x/sys/unix/xattr_bsd.go | 95 +-
.../x/sys/unix/zerrors_linux_386.go | 4 +-
.../x/sys/unix/zerrors_linux_amd64.go | 4 +-
.../x/sys/unix/zerrors_linux_arm.go | 4 +-
.../x/sys/unix/zerrors_linux_arm64.go | 4 +-
.../x/sys/unix/zerrors_linux_loong64.go | 4 +-
.../x/sys/unix/zerrors_linux_mips.go | 4 +-
.../x/sys/unix/zerrors_linux_mips64.go | 4 +-
.../x/sys/unix/zerrors_linux_mips64le.go | 4 +-
.../x/sys/unix/zerrors_linux_mipsle.go | 4 +-
.../x/sys/unix/zerrors_linux_ppc.go | 4 +-
.../x/sys/unix/zerrors_linux_ppc64.go | 4 +-
.../x/sys/unix/zerrors_linux_ppc64le.go | 4 +-
.../x/sys/unix/zerrors_linux_riscv64.go | 4 +-
.../x/sys/unix/zerrors_linux_s390x.go | 4 +-
.../x/sys/unix/zerrors_linux_sparc64.go | 4 +-
.../x/sys/unix/zerrors_openbsd_ppc64.go | 1905 ++++
.../x/sys/unix/zerrors_openbsd_riscv64.go | 1904 ++++
.../x/sys/unix/zsyscall_darwin_amd64.1_13.go | 40 -
.../x/sys/unix/zsyscall_darwin_amd64.1_13.s | 25 -
.../x/sys/unix/zsyscall_darwin_amd64.go | 32 +-
.../x/sys/unix/zsyscall_darwin_amd64.s | 23 +-
.../x/sys/unix/zsyscall_darwin_arm64.1_13.go | 40 -
.../x/sys/unix/zsyscall_darwin_arm64.1_13.s | 25 -
.../x/sys/unix/zsyscall_darwin_arm64.go | 32 +-
.../x/sys/unix/zsyscall_darwin_arm64.s | 23 +-
.../x/sys/unix/zsyscall_illumos_amd64.go | 28 +-
.../golang.org/x/sys/unix/zsyscall_linux.go | 10 +
.../x/sys/unix/zsyscall_linux_386.go | 40 -
.../x/sys/unix/zsyscall_linux_amd64.go | 40 -
.../x/sys/unix/zsyscall_linux_arm.go | 40 -
.../x/sys/unix/zsyscall_linux_arm64.go | 40 -
.../x/sys/unix/zsyscall_linux_loong64.go | 40 -
.../x/sys/unix/zsyscall_linux_mips.go | 40 -
.../x/sys/unix/zsyscall_linux_mips64.go | 40 -
.../x/sys/unix/zsyscall_linux_mips64le.go | 40 -
.../x/sys/unix/zsyscall_linux_mipsle.go | 40 -
.../x/sys/unix/zsyscall_linux_ppc.go | 40 -
.../x/sys/unix/zsyscall_linux_ppc64.go | 40 -
.../x/sys/unix/zsyscall_linux_ppc64le.go | 40 -
.../x/sys/unix/zsyscall_linux_riscv64.go | 40 -
.../x/sys/unix/zsyscall_linux_s390x.go | 40 -
.../x/sys/unix/zsyscall_linux_sparc64.go | 40 -
.../x/sys/unix/zsyscall_openbsd_386.go | 798 +-
.../x/sys/unix/zsyscall_openbsd_386.s | 796 ++
.../x/sys/unix/zsyscall_openbsd_amd64.go | 798 +-
.../x/sys/unix/zsyscall_openbsd_amd64.s | 796 ++
.../x/sys/unix/zsyscall_openbsd_arm.go | 798 +-
.../x/sys/unix/zsyscall_openbsd_arm.s | 796 ++
.../x/sys/unix/zsyscall_openbsd_arm64.go | 798 +-
.../x/sys/unix/zsyscall_openbsd_arm64.s | 796 ++
.../x/sys/unix/zsyscall_openbsd_ppc64.go | 2221 +++++
.../x/sys/unix/zsyscall_openbsd_ppc64.s | 796 ++
.../x/sys/unix/zsyscall_openbsd_riscv64.go | 2221 +++++
.../x/sys/unix/zsyscall_openbsd_riscv64.s | 796 ++
.../x/sys/unix/zsyscall_solaris_amd64.go | 28 +-
.../x/sys/unix/zsysctl_openbsd_ppc64.go | 281 +
.../x/sys/unix/zsysctl_openbsd_riscv64.go | 282 +
.../x/sys/unix/zsysnum_linux_386.go | 2 +-
.../x/sys/unix/zsysnum_linux_amd64.go | 2 +-
.../x/sys/unix/zsysnum_linux_arm.go | 2 +-
.../x/sys/unix/zsysnum_linux_arm64.go | 2 +-
.../x/sys/unix/zsysnum_linux_loong64.go | 2 +-
.../x/sys/unix/zsysnum_linux_mips.go | 2 +-
.../x/sys/unix/zsysnum_linux_mips64.go | 2 +-
.../x/sys/unix/zsysnum_linux_mips64le.go | 2 +-
.../x/sys/unix/zsysnum_linux_mipsle.go | 2 +-
.../x/sys/unix/zsysnum_linux_ppc.go | 2 +-
.../x/sys/unix/zsysnum_linux_ppc64.go | 2 +-
.../x/sys/unix/zsysnum_linux_ppc64le.go | 2 +-
.../x/sys/unix/zsysnum_linux_riscv64.go | 2 +-
.../x/sys/unix/zsysnum_linux_s390x.go | 2 +-
.../x/sys/unix/zsysnum_linux_sparc64.go | 2 +-
.../x/sys/unix/zsysnum_openbsd_386.go | 1 +
.../x/sys/unix/zsysnum_openbsd_amd64.go | 1 +
.../x/sys/unix/zsysnum_openbsd_arm.go | 1 +
.../x/sys/unix/zsysnum_openbsd_arm64.go | 1 +
.../x/sys/unix/zsysnum_openbsd_ppc64.go | 218 +
.../x/sys/unix/zsysnum_openbsd_riscv64.go | 219 +
.../x/sys/unix/ztypes_freebsd_386.go | 17 +-
.../x/sys/unix/ztypes_freebsd_amd64.go | 18 +-
.../x/sys/unix/ztypes_freebsd_arm.go | 18 +-
.../x/sys/unix/ztypes_freebsd_arm64.go | 18 +-
.../x/sys/unix/ztypes_freebsd_riscv64.go | 18 +-
.../x/sys/unix/ztypes_illumos_amd64.go | 42 -
vendor/golang.org/x/sys/unix/ztypes_linux.go | 8 +
.../golang.org/x/sys/unix/ztypes_linux_386.go | 8 +-
.../x/sys/unix/ztypes_linux_amd64.go | 8 +-
.../golang.org/x/sys/unix/ztypes_linux_arm.go | 8 +-
.../x/sys/unix/ztypes_linux_arm64.go | 8 +-
.../x/sys/unix/ztypes_linux_loong64.go | 8 +-
.../x/sys/unix/ztypes_linux_mips.go | 8 +-
.../x/sys/unix/ztypes_linux_mips64.go | 8 +-
.../x/sys/unix/ztypes_linux_mips64le.go | 8 +-
.../x/sys/unix/ztypes_linux_mipsle.go | 8 +-
.../golang.org/x/sys/unix/ztypes_linux_ppc.go | 8 +-
.../x/sys/unix/ztypes_linux_ppc64.go | 8 +-
.../x/sys/unix/ztypes_linux_ppc64le.go | 8 +-
.../x/sys/unix/ztypes_linux_riscv64.go | 8 +-
.../x/sys/unix/ztypes_linux_s390x.go | 8 +-
.../x/sys/unix/ztypes_linux_sparc64.go | 8 +-
.../x/sys/unix/ztypes_openbsd_ppc64.go | 571 ++
.../x/sys/unix/ztypes_openbsd_riscv64.go | 571 ++
.../x/sys/unix/ztypes_solaris_amd64.go | 35 +
.../golang.org/x/sys/unix/ztypes_zos_s390x.go | 11 +-
.../golang.org/x/sys/windows/registry/key.go | 206 +
.../x/sys/windows/registry/mksyscall.go | 10 +
.../x/sys/windows/registry/syscall.go | 33 +
.../x/sys/windows/registry/value.go | 387 +
.../sys/windows/registry/zsyscall_windows.go | 117 +
.../x/sys/windows/setupapi_windows.go | 2 +-
vendor/golang.org/x/sys/windows/syscall.go | 10 +-
.../x/sys/windows/syscall_windows.go | 130 +-
.../golang.org/x/sys/windows/types_windows.go | 45 +
.../x/sys/windows/zsyscall_windows.go | 97 +
vendor/golang.org/x/term/AUTHORS | 3 -
vendor/golang.org/x/term/CONTRIBUTORS | 3 -
vendor/golang.org/x/term/term.go | 10 +-
vendor/golang.org/x/term/terminal.go | 2 +-
vendor/golang.org/x/text/AUTHORS | 3 -
vendor/golang.org/x/text/CONTRIBUTORS | 3 -
vendor/golang.org/x/text/unicode/bidi/core.go | 26 +-
.../x/text/unicode/norm/forminfo.go | 9 +-
.../x/text/unicode/norm/normalize.go | 11 +-
.../x/text/unicode/norm/tables13.0.0.go | 4 +-
.../golang.org/x/text/width/tables10.0.0.go | 24 +-
.../golang.org/x/text/width/tables11.0.0.go | 24 +-
.../golang.org/x/text/width/tables12.0.0.go | 24 +-
.../golang.org/x/text/width/tables13.0.0.go | 24 +-
vendor/golang.org/x/text/width/tables9.0.0.go | 24 +-
.../x/tools/go/gcexportdata/gcexportdata.go | 177 -
.../x/tools/go/gcexportdata/importer.go | 75 -
.../x/tools/go/internal/gcimporter/bexport.go | 853 --
.../x/tools/go/internal/gcimporter/bimport.go | 1053 ---
.../go/internal/gcimporter/exportdata.go | 99 -
.../go/internal/gcimporter/gcimporter.go | 1125 ---
.../x/tools/go/internal/gcimporter/iexport.go | 1010 ---
.../x/tools/go/internal/gcimporter/iimport.go | 878 --
.../go/internal/gcimporter/newInterface10.go | 22 -
.../go/internal/gcimporter/newInterface11.go | 14 -
.../go/internal/gcimporter/support_go117.go | 16 -
.../go/internal/gcimporter/support_go118.go | 23 -
.../go/internal/gcimporter/unified_no.go | 10 -
.../go/internal/gcimporter/unified_yes.go | 10 -
.../go/internal/gcimporter/ureader_no.go | 19 -
.../go/internal/gcimporter/ureader_yes.go | 612 --
.../tools/go/internal/packagesdriver/sizes.go | 49 -
.../x/tools/go/internal/pkgbits/codes.go | 77 -
.../x/tools/go/internal/pkgbits/decoder.go | 433 -
.../x/tools/go/internal/pkgbits/doc.go | 32 -
.../x/tools/go/internal/pkgbits/encoder.go | 379 -
.../x/tools/go/internal/pkgbits/flags.go | 9 -
.../x/tools/go/internal/pkgbits/frames_go1.go | 21 -
.../tools/go/internal/pkgbits/frames_go17.go | 28 -
.../x/tools/go/internal/pkgbits/reloc.go | 42 -
.../x/tools/go/internal/pkgbits/support.go | 17 -
.../x/tools/go/internal/pkgbits/sync.go | 113 -
.../go/internal/pkgbits/syncmarker_string.go | 89 -
vendor/golang.org/x/tools/go/packages/doc.go | 220 -
.../x/tools/go/packages/external.go | 101 -
.../golang.org/x/tools/go/packages/golist.go | 1173 ---
.../x/tools/go/packages/golist_overlay.go | 575 --
.../x/tools/go/packages/loadmode_string.go | 57 -
.../x/tools/go/packages/packages.go | 1273 ---
.../golang.org/x/tools/go/packages/visit.go | 59 -
.../internal/fastwalk/fastwalk_darwin.go | 119 +
.../internal/fastwalk/fastwalk_dirent_ino.go | 6 +-
.../fastwalk/fastwalk_dirent_namlen_bsd.go | 4 +-
.../tools/internal/fastwalk/fastwalk_unix.go | 4 +-
.../x/tools/internal/gocommand/invoke.go | 83 +-
.../x/tools/internal/gocommand/version.go | 13 +-
.../x/tools/internal/imports/fix.go | 9 +-
.../x/tools/internal/imports/mod.go | 22 +-
.../x/tools/internal/imports/zstdlib.go | 418 +-
.../internal/packagesinternal/packages.go | 30 -
.../tools/internal/typesinternal/errorcode.go | 1526 ----
.../typesinternal/errorcode_string.go | 167 -
.../x/tools/internal/typesinternal/types.go | 52 -
.../tools/internal/typesinternal/types_118.go | 19 -
.../google.golang.org/appengine/.travis.yml | 18 -
.../appengine/CONTRIBUTING.md | 90 -
vendor/google.golang.org/appengine/README.md | 100 -
.../google.golang.org/appengine/appengine.go | 135 -
.../appengine/appengine_vm.go | 20 -
vendor/google.golang.org/appengine/errors.go | 46 -
.../google.golang.org/appengine/identity.go | 142 -
.../app_identity/app_identity_service.pb.go | 611 --
.../app_identity/app_identity_service.proto | 64 -
.../internal/modules/modules_service.pb.go | 786 --
.../internal/modules/modules_service.proto | 80 -
.../google.golang.org/appengine/namespace.go | 25 -
vendor/google.golang.org/appengine/timeout.go | 20 -
.../appengine/travis_install.sh | 18 -
.../appengine/travis_test.sh | 12 -
.../api/expr/v1alpha1/checked.pb.go | 1657 ++++
.../googleapis/api/expr/v1alpha1/eval.pb.go | 579 ++
.../api/expr/v1alpha1/explain.pb.go | 275 +
.../googleapis/api/expr/v1alpha1/syntax.pb.go | 1685 ++++
.../googleapis/api/expr/v1alpha1/value.pb.go | 720 ++
.../rpc/errdetails/error_details.pb.go | 1278 +++
.../grpc/balancer/balancer.go | 53 -
.../grpc/balancer/base/balancer.go | 4 +
.../grpc/balancer/conn_state_evaluator.go | 70 +
vendor/google.golang.org/grpc/clientconn.go | 7 +-
vendor/google.golang.org/grpc/dialoptions.go | 38 +-
.../balancer/gracefulswitch/gracefulswitch.go | 2 +
.../grpc/internal/binarylog/binarylog.go | 4 +-
.../grpc/internal/envconfig/xds.go | 5 +-
.../grpc/internal/grpcutil/method.go | 5 +
.../grpc/internal/internal.go | 70 +
.../grpc/internal/transport/handler_server.go | 22 +-
.../grpc/internal/transport/http2_client.go | 75 +-
.../grpc/internal/transport/http2_server.go | 49 +-
.../grpc/internal/transport/http_util.go | 11 -
.../grpc/internal/transport/transport.go | 6 +-
vendor/google.golang.org/grpc/regenerate.sh | 7 +-
vendor/google.golang.org/grpc/resolver/map.go | 55 +-
vendor/google.golang.org/grpc/server.go | 106 +-
.../google.golang.org/grpc/service_config.go | 7 +-
vendor/google.golang.org/grpc/stream.go | 96 +-
vendor/google.golang.org/grpc/version.go | 2 +-
vendor/google.golang.org/grpc/vet.sh | 1 -
vendor/google.golang.org/protobuf/AUTHORS | 3 -
.../google.golang.org/protobuf/CONTRIBUTORS | 3 -
.../protobuf/encoding/protojson/decode.go | 174 +-
.../protobuf/encoding/protojson/encode.go | 51 +-
.../encoding/protojson/well_known_types.go | 76 +-
.../protobuf/encoding/prototext/decode.go | 116 +-
.../protobuf/encoding/prototext/encode.go | 39 +-
.../protobuf/encoding/protowire/wire.go | 4 +
.../protobuf/internal/descfmt/stringer.go | 66 +-
.../internal/encoding/defval/default.go | 78 +-
.../encoding/messageset/messageset.go | 7 +-
.../protobuf/internal/encoding/tag/tag.go | 96 +-
.../protobuf/internal/encoding/text/decode.go | 30 +-
.../internal/encoding/text/decode_number.go | 6 +-
.../protobuf/internal/encoding/text/doc.go | 4 +-
.../protobuf/internal/filedesc/build.go | 19 +-
.../protobuf/internal/filedesc/desc.go | 378 +-
.../protobuf/internal/filedesc/desc_init.go | 36 +-
.../protobuf/internal/filedesc/desc_lazy.go | 80 +-
.../protobuf/internal/filedesc/desc_list.go | 167 +-
.../protobuf/internal/filedesc/placeholder.go | 136 +-
.../protobuf/internal/filetype/build.go | 87 +-
.../protobuf/internal/impl/api_export.go | 42 +-
.../protobuf/internal/impl/checkinit.go | 12 +-
.../protobuf/internal/impl/codec_extension.go | 36 +-
.../protobuf/internal/impl/codec_field.go | 90 +-
.../protobuf/internal/impl/codec_map.go | 20 +-
.../protobuf/internal/impl/codec_message.go | 30 +-
.../protobuf/internal/impl/codec_tables.go | 290 +-
.../protobuf/internal/impl/convert.go | 228 +-
.../protobuf/internal/impl/convert_list.go | 42 +-
.../protobuf/internal/impl/convert_map.go | 32 +-
.../protobuf/internal/impl/decode.go | 21 +-
.../protobuf/internal/impl/enum.go | 10 +-
.../protobuf/internal/impl/extension.go | 26 +-
.../protobuf/internal/impl/legacy_enum.go | 57 +-
.../protobuf/internal/impl/legacy_export.go | 18 +-
.../internal/impl/legacy_extension.go | 100 +-
.../protobuf/internal/impl/legacy_message.go | 122 +-
.../protobuf/internal/impl/merge.go | 32 +-
.../protobuf/internal/impl/message.go | 41 +-
.../protobuf/internal/impl/message_reflect.go | 74 +-
.../internal/impl/message_reflect_field.go | 118 +-
.../protobuf/internal/impl/validate.go | 50 +-
.../protobuf/internal/impl/weak.go | 16 +-
.../protobuf/internal/order/order.go | 16 +-
.../protobuf/internal/order/range.go | 22 +-
.../protobuf/internal/strs/strings_unsafe.go | 6 +-
.../protobuf/internal/version/version.go | 54 +-
.../protobuf/proto/decode.go | 3 +-
.../google.golang.org/protobuf/proto/doc.go | 21 +-
.../protobuf/proto/encode.go | 5 +-
.../google.golang.org/protobuf/proto/equal.go | 50 +-
.../reflect/protodesc/desc_resolve.go | 6 +-
.../protobuf/reflect/protoreflect/proto.go | 30 +-
.../protobuf/reflect/protoreflect/source.go | 1 +
.../protobuf/reflect/protoreflect/type.go | 1 +
.../reflect/protoreflect/value_union.go | 2 +
.../reflect/protoregistry/registry.go | 2 +
.../protobuf/runtime/protoimpl/version.go | 8 +-
.../protobuf/types/dynamicpb/dynamic.go | 717 ++
.../protobuf/types/known/emptypb/empty.pb.go | 168 +
.../types/known/fieldmaskpb/field_mask.pb.go | 2 +-
.../types/known/structpb/struct.pb.go | 810 ++
.../admissionregistration/v1/generated.proto | 4 +
.../api/admissionregistration/v1/types.go | 4 +
.../admissionregistration/v1alpha1}/doc.go | 13 +-
.../v1alpha1/generated.pb.go | 2956 +++++++
.../v1alpha1/generated.proto | 317 +
.../v1alpha1/register.go | 56 +
.../admissionregistration/v1alpha1/types.go | 373 +
.../v1alpha1/types_swagger_doc_generated.go | 146 +
.../v1alpha1/zz_generated.deepcopy.go | 331 +
.../v1beta1/generated.pb.go | 701 +-
.../v1beta1/generated.proto | 62 +-
.../admissionregistration/v1beta1/types.go | 74 +-
.../v1beta1/types_swagger_doc_generated.go | 21 -
.../v1beta1/zz_generated.deepcopy.go | 73 +-
vendor/k8s.io/api/apidiscovery/v2beta1/doc.go | 24 +
.../api/apidiscovery/v2beta1/generated.pb.go | 1744 ++++
.../api/apidiscovery/v2beta1/generated.proto | 156 +
.../api/apidiscovery/v2beta1/register.go | 56 +
.../k8s.io/api/apidiscovery/v2beta1/types.go | 163 +
.../v2beta1/zz_generated.deepcopy.go | 190 +
.../zz_generated.prerelease-lifecycle.go | 58 +
vendor/k8s.io/api/apps/v1/generated.pb.go | 481 +-
vendor/k8s.io/api/apps/v1/generated.proto | 29 +-
vendor/k8s.io/api/apps/v1/types.go | 29 +-
.../apps/v1/types_swagger_doc_generated.go | 14 +-
.../api/apps/v1/zz_generated.deepcopy.go | 21 +
.../k8s.io/api/apps/v1beta1/generated.pb.go | 459 +-
.../k8s.io/api/apps/v1beta1/generated.proto | 27 +-
vendor/k8s.io/api/apps/v1beta1/types.go | 27 +-
.../v1beta1/types_swagger_doc_generated.go | 12 +-
.../api/apps/v1beta1/zz_generated.deepcopy.go | 21 +
.../k8s.io/api/apps/v1beta2/generated.pb.go | 498 +-
.../k8s.io/api/apps/v1beta2/generated.proto | 29 +-
vendor/k8s.io/api/apps/v1beta2/types.go | 29 +-
.../v1beta2/types_swagger_doc_generated.go | 14 +-
.../api/apps/v1beta2/zz_generated.deepcopy.go | 21 +
.../k8s.io/api/authentication/v1alpha1/doc.go | 23 +
.../authentication/v1alpha1/generated.pb.go | 567 ++
.../authentication/v1alpha1/generated.proto | 50 +
.../api/authentication/v1alpha1/register.go | 51 +
.../api/authentication/v1alpha1/types.go | 47 +
.../v1alpha1/types_swagger_doc_generated.go | 49 +
.../v1alpha1/zz_generated.deepcopy.go | 70 +
.../zz_generated.prerelease-lifecycle.go | 40 +
.../k8s.io/api/autoscaling/v1/generated.proto | 2 +-
vendor/k8s.io/api/autoscaling/v1/types.go | 2 +-
.../v1/types_swagger_doc_generated.go | 2 +-
.../k8s.io/api/autoscaling/v2/generated.proto | 2 +-
vendor/k8s.io/api/autoscaling/v2/types.go | 2 +-
.../v2/types_swagger_doc_generated.go | 2 +-
.../api/autoscaling/v2beta1/generated.proto | 2 +-
.../k8s.io/api/autoscaling/v2beta1/types.go | 2 +-
.../v2beta1/types_swagger_doc_generated.go | 2 +-
.../api/autoscaling/v2beta2/generated.proto | 2 +-
.../k8s.io/api/autoscaling/v2beta2/types.go | 2 +-
.../v2beta2/types_swagger_doc_generated.go | 2 +-
vendor/k8s.io/api/batch/v1/generated.proto | 3 -
vendor/k8s.io/api/batch/v1/types.go | 17 +-
.../batch/v1/types_swagger_doc_generated.go | 2 +-
vendor/k8s.io/api/core/v1/generated.pb.go | 3415 +++++---
vendor/k8s.io/api/core/v1/generated.proto | 164 +-
vendor/k8s.io/api/core/v1/types.go | 185 +-
.../core/v1/types_swagger_doc_generated.go | 68 +-
.../api/core/v1/zz_generated.deepcopy.go | 120 +-
.../k8s.io/api/discovery/v1/generated.proto | 6 +-
vendor/k8s.io/api/discovery/v1/types.go | 6 +-
.../v1/types_swagger_doc_generated.go | 4 +-
.../api/discovery/v1beta1/generated.proto | 6 +-
vendor/k8s.io/api/discovery/v1beta1/types.go | 6 +-
.../v1beta1/types_swagger_doc_generated.go | 4 +-
.../api/extensions/v1beta1/generated.pb.go | 1220 ++-
.../api/extensions/v1beta1/generated.proto | 57 +-
vendor/k8s.io/api/extensions/v1beta1/types.go | 57 +-
.../v1beta1/types_swagger_doc_generated.go | 39 +-
.../v1beta1/zz_generated.deepcopy.go | 67 +
.../api/flowcontrol/v1alpha1/generated.pb.go | 253 +-
.../api/flowcontrol/v1alpha1/generated.proto | 29 +
.../k8s.io/api/flowcontrol/v1alpha1/types.go | 37 +-
.../v1alpha1/types_swagger_doc_generated.go | 2 +
.../v1alpha1/zz_generated.deepcopy.go | 10 +
.../zz_generated.prerelease-lifecycle.go | 8 +-
.../api/flowcontrol/v1beta1/generated.pb.go | 252 +-
.../api/flowcontrol/v1beta1/generated.proto | 29 +
.../k8s.io/api/flowcontrol/v1beta1/types.go | 37 +-
.../v1beta1/types_swagger_doc_generated.go | 2 +
.../v1beta1/zz_generated.deepcopy.go | 10 +
.../zz_generated.prerelease-lifecycle.go | 8 +-
.../api/flowcontrol/v1beta2/generated.pb.go | 252 +-
.../api/flowcontrol/v1beta2/generated.proto | 29 +
.../k8s.io/api/flowcontrol/v1beta2/types.go | 33 +
.../v1beta2/types_swagger_doc_generated.go | 2 +
.../v1beta2/zz_generated.deepcopy.go | 10 +
.../zz_generated.prerelease-lifecycle.go | 28 +
vendor/k8s.io/api/flowcontrol/v1beta3/doc.go | 25 +
.../api/flowcontrol/v1beta3/generated.pb.go | 5428 ++++++++++++
.../api/flowcontrol/v1beta3/generated.proto | 473 +
.../api/flowcontrol/v1beta3/register.go | 58 +
.../k8s.io/api/flowcontrol/v1beta3/types.go | 612 ++
.../v1beta3/types_swagger_doc_generated.go | 263 +
.../v1beta3/zz_generated.deepcopy.go | 552 ++
.../zz_generated.prerelease-lifecycle.go | 94 +
.../k8s.io/api/networking/v1/generated.pb.go | 911 +-
.../k8s.io/api/networking/v1/generated.proto | 55 +-
vendor/k8s.io/api/networking/v1/types.go | 55 +-
.../v1/types_swagger_doc_generated.go | 37 +-
.../networking/v1/zz_generated.deepcopy.go | 67 +
.../api/networking/v1alpha1/generated.proto | 2 +-
.../k8s.io/api/networking/v1alpha1/types.go | 2 +-
.../v1alpha1/types_swagger_doc_generated.go | 2 +-
.../api/networking/v1beta1/generated.pb.go | 830 +-
.../api/networking/v1beta1/generated.proto | 49 +-
vendor/k8s.io/api/networking/v1beta1/types.go | 49 +-
.../v1beta1/types_swagger_doc_generated.go | 31 +
.../v1beta1/zz_generated.deepcopy.go | 67 +
vendor/k8s.io/api/policy/v1/generated.pb.go | 150 +-
vendor/k8s.io/api/policy/v1/generated.proto | 28 +
vendor/k8s.io/api/policy/v1/types.go | 48 +
.../policy/v1/types_swagger_doc_generated.go | 9 +-
.../api/policy/v1/zz_generated.deepcopy.go | 5 +
.../k8s.io/api/policy/v1beta1/generated.pb.go | 287 +-
.../k8s.io/api/policy/v1beta1/generated.proto | 28 +
vendor/k8s.io/api/policy/v1beta1/types.go | 48 +
.../v1beta1/types_swagger_doc_generated.go | 9 +-
.../policy/v1beta1/zz_generated.deepcopy.go | 5 +
vendor/k8s.io/api/resource/v1alpha1/doc.go | 24 +
.../api/resource/v1alpha1/generated.pb.go | 4593 ++++++++++
.../api/resource/v1alpha1/generated.proto | 371 +
.../k8s.io/api/resource/v1alpha1/register.go | 63 +
vendor/k8s.io/api/resource/v1alpha1/types.go | 429 +
.../v1alpha1/types_swagger_doc_generated.go | 222 +
.../v1alpha1/zz_generated.deepcopy.go | 477 +
.../apimachinery/pkg/api/meta/errors.go | 35 +-
.../pkg/api/validation/objectmeta.go | 9 +-
.../apimachinery/pkg/apis/meta/v1/helpers.go | 2 +-
.../pkg/apis/meta/v1/micro_time_proto.go | 10 +-
.../pkg/apis/meta/v1/validation/validation.go | 40 +-
.../apimachinery/pkg/labels/selector.go | 10 +-
.../k8s.io/apimachinery/pkg/util/sets/byte.go | 148 +-
.../k8s.io/apimachinery/pkg/util/sets/doc.go | 7 +-
.../apimachinery/pkg/util/sets/empty.go | 4 +-
.../k8s.io/apimachinery/pkg/util/sets/int.go | 148 +-
.../apimachinery/pkg/util/sets/int32.go | 148 +-
.../apimachinery/pkg/util/sets/int64.go | 148 +-
.../apimachinery/pkg/util/sets/ordered.go | 53 +
.../k8s.io/apimachinery/pkg/util/sets/set.go | 227 +
.../apimachinery/pkg/util/sets/string.go | 148 +-
.../apiserver/pkg/admission/cel/metrics.go | 111 +
.../configuration/mutating_webhook_manager.go | 8 +-
.../validating_webhook_manager.go | 8 +-
.../pkg/admission/initializer/initializer.go | 8 +
.../pkg/admission/initializer/interfaces.go | 13 +
.../plugin/validatingadmissionpolicy/OWNERS | 10 +
.../validatingadmissionpolicy/admission.go | 189 +
.../validatingadmissionpolicy/compiler.go | 231 +
.../validatingadmissionpolicy/controller.go | 406 +
.../controller_reconcile.go | 229 +
.../validatingadmissionpolicy/initializer.go | 30 +
.../validatingadmissionpolicy/interface.go | 50 +
.../internal/generic/controller.go | 272 +
.../internal/generic/doc.go | 29 +
.../internal/generic/informer.go | 36 +
.../internal/generic/interface.go | 62 +
.../internal/generic/lister.go | 100 +
.../matching/matching.go | 192 +
.../policy_decision.go | 70 +
.../validatingadmissionpolicy/validator.go | 318 +
.../pkg/admission/plugin/webhook/accessors.go | 11 +-
.../plugin/webhook/generic/webhook.go | 8 +-
.../plugin/webhook/mutating/dispatcher.go | 23 +-
.../webhook/{ => predicates}/namespace/doc.go | 2 +-
.../{ => predicates}/namespace/matcher.go | 10 +-
.../webhook/{ => predicates}/object/doc.go | 2 +-
.../{ => predicates}/object/matcher.go | 10 +-
.../webhook/{ => predicates}/rules/rules.go | 8 +-
.../plugin/webhook/validating/dispatcher.go | 22 +-
.../k8s.io/apiserver/pkg/admission/plugins.go | 2 +-
.../pkg/apis/config/validation/validation.go | 36 +-
.../pkg/apis/flowcontrol/bootstrap/default.go | 24 +-
vendor/k8s.io/apiserver/pkg/audit/context.go | 183 +-
.../k8s.io/apiserver/pkg/audit/evaluator.go | 12 -
.../apiserver/pkg/audit/policy/reader.go | 21 +-
vendor/k8s.io/apiserver/pkg/audit/request.go | 12 +-
.../pkg/authentication/request/x509/x509.go | 26 +-
.../token/cache/cached_token_authenticator.go | 38 +-
vendor/k8s.io/apiserver/pkg/cel/errors.go | 47 +
vendor/k8s.io/apiserver/pkg/cel/escaping.go | 170 +
.../k8s.io/apiserver/pkg/cel/library/cost.go | 268 +
.../apiserver/pkg/cel/library/libraries.go | 34 +
.../k8s.io/apiserver/pkg/cel/library/lists.go | 312 +
.../k8s.io/apiserver/pkg/cel/library/regex.go | 187 +
.../k8s.io/apiserver/pkg/cel/library/urls.go | 236 +
vendor/k8s.io/apiserver/pkg/cel/limits.go | 48 +
vendor/k8s.io/apiserver/pkg/cel/registry.go | 79 +
vendor/k8s.io/apiserver/pkg/cel/types.go | 552 ++
vendor/k8s.io/apiserver/pkg/cel/url.go | 80 +
vendor/k8s.io/apiserver/pkg/cel/value.go | 769 ++
.../endpoints/discovery/aggregated/etag.go | 84 +
.../endpoints/discovery/aggregated/fake.go | 171 +
.../endpoints/discovery/aggregated/handler.go | 368 +
.../discovery/aggregated/negotiation.go | 45 +
.../endpoints/discovery/aggregated/wrapper.go | 78 +
.../pkg/endpoints/discovery/group.go | 2 +-
.../pkg/endpoints/discovery/legacy.go | 12 +-
.../apiserver/pkg/endpoints/discovery/root.go | 4 +-
.../pkg/endpoints/discovery/version.go | 2 +-
.../endpoints/filterlatency/filterlatency.go | 12 +-
.../apiserver/pkg/endpoints/filters/audit.go | 29 +-
.../endpoints/filters/audit_annotations.go | 38 -
.../{with_auditid.go => audit_init.go} | 19 +-
.../pkg/endpoints/filters/authn_audit.go | 10 +-
.../pkg/endpoints/filters/request_deadline.go | 10 +-
.../apiserver/pkg/endpoints/groupversion.go | 9 +-
.../pkg/endpoints/handlers/create.go | 39 +-
.../pkg/endpoints/handlers/delete.go | 61 +-
.../handlers/fieldmanager/equality.go | 67 +-
.../handlers/fieldmanager/fieldmanager.go | 3 +-
.../apiserver/pkg/endpoints/handlers/get.go | 55 +-
.../pkg/endpoints/handlers/helpers.go | 55 +-
.../pkg/endpoints/handlers/metrics/OWNERS | 4 +
.../pkg/endpoints/handlers/metrics/metrics.go | 51 +
.../apiserver/pkg/endpoints/handlers/patch.go | 43 +-
.../pkg/endpoints/handlers/response.go | 5 +-
.../handlers/responsewriters/writers.go | 91 +-
.../apiserver/pkg/endpoints/handlers/rest.go | 12 +-
.../pkg/endpoints/handlers/trace_util.go | 22 +-
.../pkg/endpoints/handlers/update.go | 39 +-
.../apiserver/pkg/endpoints/installer.go | 94 +-
.../pkg/endpoints/metrics/metrics.go | 94 +-
.../pkg/endpoints/request/auditid.go | 65 -
.../apiserver/pkg/features/kube_features.go | 34 +-
.../pkg/registry/generic/registry/dryrun.go | 6 +-
.../generic/registry/storage_factory.go | 1 +
.../pkg/registry/generic/registry/store.go | 3 +
.../apiserver/pkg/registry/rest/create.go | 18 +-
.../apiserver/pkg/registry/rest/update.go | 8 -
vendor/k8s.io/apiserver/pkg/server/config.go | 78 +-
.../apiserver/pkg/server/deleted_kinds.go | 4 +-
.../dynamic_cafile_content.go | 2 +-
.../dynamic_serving_content.go | 2 +-
.../server/egressselector/egress_selector.go | 11 +-
.../server/egressselector/metrics/metrics.go | 21 +-
.../server/filters/priority-and-fairness.go | 2 +-
.../apiserver/pkg/server/filters/timeout.go | 5 +-
.../apiserver/pkg/server/filters/wrap.go | 5 +-
.../apiserver/pkg/server/genericapiserver.go | 118 +-
.../apiserver/pkg/server/healthz/healthz.go | 6 +-
vendor/k8s.io/apiserver/pkg/server/hooks.go | 4 +-
.../apiserver/pkg/server/httplog/httplog.go | 20 +-
.../apiserver/pkg/server/options/admission.go | 10 +-
.../pkg/server/options/authentication.go | 5 +-
.../options/deprecated_insecure_serving.go | 43 -
.../server/options/encryptionconfig/config.go | 595 +-
.../encryptionconfig/controller/controller.go | 265 +
.../apiserver/pkg/server/options/etcd.go | 255 +-
.../pkg/server/options/recommended.go | 5 +-
.../pkg/server/options/server_run_options.go | 1 +
.../apiserver/pkg/server/options/tracing.go | 15 +-
vendor/k8s.io/apiserver/pkg/server/plugins.go | 2 +
.../pkg/server/storage/storage_codec.go | 9 +-
.../pkg/server/storage/storage_factory.go | 36 +-
.../apiserver/pkg/storage/cacher/cacher.go | 94 +-
.../pkg/storage/cacher/watch_cache.go | 37 +-
.../apiserver/pkg/storage/etcd3/compact.go | 10 +-
.../pkg/storage/etcd3/metrics/metrics.go | 5 +-
.../apiserver/pkg/storage/etcd3/store.go | 254 +-
.../apiserver/pkg/storage/etcd3/watcher.go | 57 +-
.../apiserver/pkg/storage/names/generate.go | 2 +-
.../storage/storagebackend/factory/etcd3.go | 56 +-
.../k8s.io/apiserver/pkg/storage/value/OWNERS | 8 +
.../value/encrypt/envelope/envelope.go | 4 +-
.../value/encrypt/envelope/grpc_service.go | 16 +-
.../value/encrypt/envelope/kmsv2/envelope.go | 95 +-
.../encrypt/envelope/kmsv2/grpc_service.go | 19 +-
.../value/encrypt/identity/identity.go | 12 +-
.../pkg/storage/value/transformer.go | 50 +-
.../apiserver/pkg/storageversion/manager.go | 4 +-
.../apiserver/pkg/util/apihelpers/helpers.go | 2 +-
.../pkg/util/flowcontrol/apf_controller.go | 294 +-
.../pkg/util/flowcontrol/apf_filter.go | 8 +-
.../pkg/util/flowcontrol/conc_alloc.go | 256 +
.../pkg/util/flowcontrol/debug/dump.go | 9 +-
.../flowcontrol/fairqueuing/integrator.go | 35 +-
.../util/flowcontrol/fairqueuing/interface.go | 3 +-
.../fairqueuing/queueset/queueset.go | 105 +-
.../pkg/util/flowcontrol/format/formatting.go | 16 +-
.../pkg/util/flowcontrol/metrics/metrics.go | 159 +-
.../util/flowcontrol/metrics/union_gauge.go | 56 +
.../request/list_work_estimator.go | 9 +
.../request/mutating_work_estimator.go | 18 +
.../apiserver/pkg/util/flowcontrol/rule.go | 2 +-
.../apiserver/pkg/util/webhook/client.go | 2 +-
.../apiserver/pkg/util/webhook/validation.go | 2 +-
.../k8s.io/apiserver/pkg/warning/context.go | 3 +-
.../plugin/pkg/audit/webhook/webhook.go | 15 +-
.../v1alpha1/admissionpolicyspec.go | 75 +
.../v1alpha1/matchresources.go | 90 +
.../v1alpha1/namedrulewithoperations.go | 95 +
.../v1alpha1/paramkind.go | 48 +
.../v1alpha1/paramref.go | 48 +
.../v1alpha1/paramsource.go | 48 +
.../admissionregistration/v1alpha1/rule.go | 76 +
.../v1alpha1/rulewithoperations.go | 85 +
.../v1alpha1/validatingadmissionpolicy.go | 247 +
.../validatingadmissionpolicybinding.go | 247 +
.../validatingadmissionpolicybindingspec.go | 57 +
.../v1alpha1/validatingadmissionpolicyspec.go | 75 +
.../v1alpha1/validation.go | 61 +
.../v1beta1/mutatingwebhook.go | 15 +-
.../v1beta1/rulewithoperations.go | 11 +-
.../v1beta1/validatingwebhook.go | 15 +-
.../apps/v1/statefulsetordinals.go | 39 +
.../apps/v1/statefulsetspec.go | 9 +
.../apps/v1beta1/statefulsetordinals.go | 39 +
.../apps/v1beta1/statefulsetspec.go | 9 +
.../apps/v1beta2/statefulsetordinals.go | 39 +
.../apps/v1beta2/statefulsetspec.go | 9 +
.../core/v1/claimsource.go | 48 +
.../core/v1/persistentvolumeclaimspec.go | 4 +-
.../core/v1/podresourceclaim.go | 48 +
.../core/v1/podschedulinggate.go | 39 +
.../applyconfigurations/core/v1/podspec.go | 28 +
.../core/v1/resourceclaim.go | 39 +
.../core/v1/resourcerequirements.go | 18 +-
.../core/v1/typedobjectreference.go | 66 +
.../v1beta1/ingressloadbalanceringress.go | 62 +
.../v1beta1/ingressloadbalancerstatus.go | 44 +
.../extensions/v1beta1/ingressportstatus.go | 61 +
.../extensions/v1beta1/ingressstatus.go | 8 +-
.../limitedprioritylevelconfiguration.go | 18 +
.../limitedprioritylevelconfiguration.go | 18 +
.../limitedprioritylevelconfiguration.go | 18 +
.../v1beta3/flowdistinguishermethod.go | 43 +
.../flowcontrol/v1beta3/flowschema.go | 256 +
.../v1beta3/flowschemacondition.go | 80 +
.../flowcontrol/v1beta3/flowschemaspec.go | 71 +
.../flowcontrol/v1beta3/flowschemastatus.go | 44 +
.../flowcontrol/v1beta3/groupsubject.go | 39 +
.../limitedprioritylevelconfiguration.go | 66 +
.../flowcontrol/v1beta3/limitresponse.go | 52 +
.../v1beta3/nonresourcepolicyrule.go | 52 +
.../v1beta3/policyruleswithsubjects.go | 72 +
.../v1beta3/prioritylevelconfiguration.go | 256 +
.../prioritylevelconfigurationcondition.go | 80 +
.../prioritylevelconfigurationreference.go | 39 +
.../v1beta3/prioritylevelconfigurationspec.go | 52 +
.../prioritylevelconfigurationstatus.go | 44 +
.../v1beta3/queuingconfiguration.go | 57 +
.../flowcontrol/v1beta3/resourcepolicyrule.go | 83 +
.../v1beta3/serviceaccountsubject.go | 48 +
.../flowcontrol/v1beta3/subject.go | 70 +
.../flowcontrol/v1beta3/usersubject.go | 39 +
.../applyconfigurations/internal/internal.go | 976 ++-
.../meta/v1/groupversionkind.go | 57 +
.../applyconfigurations/meta/v1/status.go | 142 +
.../meta/v1/statuscause.go | 61 +
.../meta/v1/statusdetails.go | 93 +
.../v1/ingressloadbalanceringress.go | 62 +
.../v1/ingressloadbalancerstatus.go | 44 +
.../networking/v1/ingressportstatus.go | 61 +
.../networking/v1/ingressstatus.go | 8 +-
.../v1beta1/ingressloadbalanceringress.go | 62 +
.../v1beta1/ingressloadbalancerstatus.go | 44 +
.../networking/v1beta1/ingressportstatus.go | 61 +
.../networking/v1beta1/ingressstatus.go | 8 +-
.../policy/v1/poddisruptionbudgetspec.go | 16 +-
.../policy/v1beta1/poddisruptionbudgetspec.go | 16 +-
.../resource/v1alpha1/allocationresult.go | 61 +
.../resource/v1alpha1/podscheduling.go | 258 +
.../resource/v1alpha1/podschedulingspec.go | 50 +
.../resource/v1alpha1/podschedulingstatus.go | 44 +
.../resource/v1alpha1/resourceclaim.go | 258 +
.../resourceclaimconsumerreference.go | 70 +
.../resourceclaimparametersreference.go | 57 +
.../v1alpha1/resourceclaimschedulingstatus.go | 50 +
.../resource/v1alpha1/resourceclaimspec.go | 61 +
.../resource/v1alpha1/resourceclaimstatus.go | 71 +
.../v1alpha1/resourceclaimtemplate.go | 249 +
.../v1alpha1/resourceclaimtemplatespec.go | 188 +
.../resource/v1alpha1/resourceclass.go | 266 +
.../resourceclassparametersreference.go | 66 +
.../discovery/aggregated_discovery.go | 108 +
.../client-go/discovery/discovery_client.go | 240 +-
.../client-go/discovery/fake/discovery.go | 5 +
.../dynamic/dynamicinformer/informer.go | 158 +
.../dynamic/dynamicinformer/interface.go | 34 +
.../dynamic/dynamiclister/interface.go | 40 +
.../client-go/dynamic/dynamiclister/lister.go | 91 +
.../client-go/dynamic/dynamiclister/shim.go | 87 +
vendor/k8s.io/client-go/dynamic/interface.go | 63 +
vendor/k8s.io/client-go/dynamic/scheme.go | 108 +
vendor/k8s.io/client-go/dynamic/simple.go | 437 +
.../admissionregistration/interface.go | 8 +
.../v1alpha1/interface.go | 52 +
.../v1alpha1/validatingadmissionpolicy.go | 89 +
.../validatingadmissionpolicybinding.go | 89 +
vendor/k8s.io/client-go/informers/factory.go | 85 +-
.../informers/flowcontrol/interface.go | 8 +
.../flowcontrol/v1beta3/flowschema.go | 89 +
.../flowcontrol/v1beta3/interface.go | 52 +
.../v1beta3/prioritylevelconfiguration.go | 89 +
vendor/k8s.io/client-go/informers/generic.go | 31 +-
.../client-go/informers/resource/interface.go | 46 +
.../informers/resource/v1alpha1/interface.go | 66 +
.../resource/v1alpha1/podscheduling.go | 90 +
.../resource/v1alpha1/resourceclaim.go | 90 +
.../v1alpha1/resourceclaimtemplate.go | 90 +
.../resource/v1alpha1/resourceclass.go | 89 +
.../k8s.io/client-go/kubernetes/clientset.go | 147 +-
.../kubernetes/fake/clientset_generated.go | 28 +
.../client-go/kubernetes/fake/register.go | 8 +
.../client-go/kubernetes/scheme/register.go | 8 +
.../v1alpha1/admissionregistration_client.go | 112 +
.../admissionregistration/v1alpha1/doc.go | 20 +
.../v1alpha1/fake/doc.go | 20 +
.../fake/fake_admissionregistration_client.go | 44 +
.../fake/fake_validatingadmissionpolicy.go | 146 +
.../fake_validatingadmissionpolicybinding.go | 146 +
.../v1alpha1/generated_expansion.go | 23 +
.../v1alpha1/validatingadmissionpolicy.go | 197 +
.../validatingadmissionpolicybinding.go | 197 +
.../v1alpha1/authentication_client.go | 107 +
.../typed/authentication/v1alpha1/doc.go | 20 +
.../typed/authentication/v1alpha1/fake/doc.go | 20 +
.../fake/fake_authentication_client.go | 40 +
.../v1alpha1/fake/fake_selfsubjectreview.go | 47 +
.../v1alpha1/generated_expansion.go | 21 +
.../v1alpha1/selfsubjectreview.go | 64 +
.../typed/core/v1/fake/fake_pod_expansion.go | 4 +-
.../typed/flowcontrol/v1beta3/doc.go | 20 +
.../typed/flowcontrol/v1beta3/fake/doc.go | 20 +
.../v1beta3/fake/fake_flowcontrol_client.go | 44 +
.../v1beta3/fake/fake_flowschema.go | 179 +
.../fake/fake_prioritylevelconfiguration.go | 179 +
.../flowcontrol/v1beta3/flowcontrol_client.go | 112 +
.../typed/flowcontrol/v1beta3/flowschema.go | 243 +
.../v1beta3/generated_expansion.go | 23 +
.../v1beta3/prioritylevelconfiguration.go | 243 +
.../kubernetes/typed/resource/v1alpha1/doc.go | 20 +
.../typed/resource/v1alpha1/fake/doc.go | 20 +
.../v1alpha1/fake/fake_podscheduling.go | 190 +
.../v1alpha1/fake/fake_resource_client.go | 52 +
.../v1alpha1/fake/fake_resourceclaim.go | 190 +
.../fake/fake_resourceclaimtemplate.go | 155 +
.../v1alpha1/fake/fake_resourceclass.go | 146 +
.../resource/v1alpha1/generated_expansion.go | 27 +
.../typed/resource/v1alpha1/podscheduling.go | 256 +
.../resource/v1alpha1/resource_client.go | 122 +
.../typed/resource/v1alpha1/resourceclaim.go | 256 +
.../v1alpha1/resourceclaimtemplate.go | 208 +
.../typed/resource/v1alpha1/resourceclass.go | 197 +
.../v1alpha1/expansion_generated.go | 27 +
.../v1alpha1/validatingadmissionpolicy.go | 68 +
.../validatingadmissionpolicybinding.go | 68 +
.../v1beta3/expansion_generated.go | 27 +
.../listers/flowcontrol/v1beta3/flowschema.go | 68 +
.../v1beta3/prioritylevelconfiguration.go | 68 +
.../resource/v1alpha1/expansion_generated.go | 47 +
.../resource/v1alpha1/podscheduling.go | 99 +
.../resource/v1alpha1/resourceclaim.go | 99 +
.../v1alpha1/resourceclaimtemplate.go | 99 +
.../resource/v1alpha1/resourceclass.go | 68 +
.../k8s.io/client-go/openapi/groupversion.go | 23 +-
.../pkg/apis/clientauthentication/types.go | 5 +
.../pkg/apis/clientauthentication/v1/types.go | 5 +
.../v1/zz_generated.conversion.go | 2 +
.../clientauthentication/v1beta1/types.go | 5 +
.../v1beta1/zz_generated.conversion.go | 2 +
.../plugin/pkg/client/auth/azure/README.md | 56 -
.../plugin/pkg/client/auth/azure/azure.go | 477 -
.../pkg/client/auth/azure/azure_stub.go | 36 +
.../plugin/pkg/client/auth/exec/exec.go | 33 +-
.../plugin/pkg/client/auth/gcp/OWNERS | 8 -
.../plugin/pkg/client/auth/gcp/gcp.go | 389 -
.../plugin/pkg/client/auth/gcp/gcp_stub.go | 36 +
.../plugin/pkg/client/auth/oidc/oidc.go | 4 +-
.../client/auth/openstack/openstack_stub.go | 36 -
.../pkg/client/auth/plugins_providers.go | 1 -
vendor/k8s.io/client-go/rest/config.go | 10 +-
vendor/k8s.io/client-go/rest/exec.go | 4 +-
vendor/k8s.io/client-go/rest/request.go | 105 +-
vendor/k8s.io/client-go/rest/transport.go | 5 +-
vendor/k8s.io/client-go/rest/with_retry.go | 3 +-
vendor/k8s.io/client-go/testing/fixture.go | 2 +-
.../third_party/forked/golang/LICENSE | 27 -
.../third_party/forked/golang/PATENTS | 22 -
.../forked/golang/template/exec.go | 52 -
.../forked/golang/template/funcs.go | 177 -
.../k8s.io/client-go/tools/auth/clientauth.go | 5 +-
.../client-go/tools/cache/expiration_cache.go | 2 -
.../k8s.io/client-go/tools/cache/listers.go | 20 +-
.../client-go/tools/cache/shared_informer.go | 163 +-
.../tools/cache/thread_safe_store.go | 303 +-
.../client-go/tools/clientcmd/api/helpers.go | 91 +-
.../client-go/tools/clientcmd/api/types.go | 5 +
.../client-go/tools/clientcmd/api/v1/types.go | 5 +
.../api/v1/zz_generated.conversion.go | 2 +
.../client-go/tools/clientcmd/auth_loaders.go | 3 +-
.../tools/clientcmd/client_config.go | 7 +-
.../client-go/tools/clientcmd/loader.go | 9 +-
.../client-go/tools/clientcmd/overrides.go | 42 +-
.../tools/events/event_broadcaster.go | 32 +-
.../client-go/tools/events/interfaces.go | 2 +-
.../resourcelock/configmaplock.go | 4 +-
.../resourcelock/endpointslock.go | 4 +-
.../leaderelection/resourcelock/leaselock.go | 4 +-
vendor/k8s.io/client-go/tools/pager/pager.go | 5 +
.../k8s.io/client-go/tools/reference/ref.go | 2 +-
vendor/k8s.io/client-go/transport/cache.go | 19 +-
.../k8s.io/client-go/transport/cache_go118.go | 24 +
vendor/k8s.io/client-go/transport/config.go | 21 +-
.../client-go/transport/token_source.go | 4 +-
.../k8s.io/client-go/transport/transport.go | 27 +-
vendor/k8s.io/client-go/util/cert/cert.go | 10 +-
vendor/k8s.io/client-go/util/cert/io.go | 7 +-
.../client-go/util/jsonpath/jsonpath.go | 579 --
vendor/k8s.io/client-go/util/jsonpath/node.go | 256 -
.../k8s.io/client-go/util/jsonpath/parser.go | 527 --
vendor/k8s.io/client-go/util/keyutil/key.go | 9 +-
vendor/k8s.io/code-generator/README.md | 2 +-
.../generators/generator_for_clientset.go | 3 +-
.../code-generator/cmd/client-gen/main.go | 1 -
.../code-generator/cmd/conversion-gen/main.go | 5 -
.../code-generator/cmd/deepcopy-gen/main.go | 5 -
.../code-generator/cmd/defaulter-gen/main.go | 5 -
.../cmd/go-to-protobuf/protobuf/cmd.go | 4 +-
.../cmd/go-to-protobuf/protobuf/parser.go | 3 +-
.../code-generator/cmd/import-boss/main.go | 3 -
.../cmd/informer-gen/generators/factory.go | 94 +-
.../code-generator/cmd/informer-gen/main.go | 1 -
.../code-generator/cmd/lister-gen/main.go | 1 -
.../code-generator/cmd/register-gen/main.go | 2 -
.../k8s.io/code-generator/cmd/set-gen/main.go | 2 -
.../k8s.io/code-generator/generate-groups.sh | 27 +-
.../generate-internal-groups.sh | 53 +-
.../k8s.io/code-generator/pkg/util/build.go | 39 -
.../config/options/leaderelectionconfig.go | 2 +-
.../featuregate/feature_gate.go | 10 +
.../logs/api/v1/kube_features.go | 2 +-
.../component-base/logs/api/v1/options.go | 23 +-
.../logs/klogflags/klogflags.go | 41 +
vendor/k8s.io/component-base/logs/logs.go | 48 +-
.../k8s.io/component-base/metrics/buckets.go | 43 +
.../component-base/metrics/collector.go | 6 +-
.../k8s.io/component-base/metrics/counter.go | 4 +-
.../metrics/features/kube_features.go | 39 +
vendor/k8s.io/component-base/metrics/gauge.go | 4 +-
.../component-base/metrics/histogram.go | 17 +-
.../metrics/legacyregistry/registry.go | 8 +-
.../k8s.io/component-base/metrics/metric.go | 9 +
vendor/k8s.io/component-base/metrics/opts.go | 6 +
.../metrics/prometheus/feature/metrics.go | 53 +
.../metrics/prometheus/slis/metrics.go | 76 +
.../metrics/prometheus/slis/registry.go | 27 +
.../metrics/prometheus/slis/routes.go | 53 +
.../metrics/prometheus/workqueue/metrics.go | 49 +-
.../k8s.io/component-base/metrics/registry.go | 42 +-
.../k8s.io/component-base/metrics/summary.go | 4 +-
.../metrics/timing_histogram.go | 7 +-
vendor/k8s.io/component-base/metrics/value.go | 10 +
.../k8s.io/component-base/metrics/wrappers.go | 6 +
.../k8s.io/component-base/tracing/tracing.go | 92 +
vendor/k8s.io/component-base/tracing/utils.go | 38 +-
.../gengo/examples/set-gen/generators/sets.go | 16 +-
.../gengo/examples/set-gen/sets/byte.go | 16 +-
.../k8s.io/gengo/examples/set-gen/sets/int.go | 16 +-
.../gengo/examples/set-gen/sets/int64.go | 16 +-
.../gengo/examples/set-gen/sets/string.go | 16 +-
vendor/k8s.io/gengo/parser/parse.go | 1 +
vendor/k8s.io/klog/v2/OWNERS | 1 +
vendor/k8s.io/klog/v2/contextual.go | 5 +-
.../klog/v2/internal/serialize/keyvalues.go | 2 +-
vendor/k8s.io/klog/v2/klog.go | 137 +-
.../go => k8s.io/kms}/LICENSE | 5 +-
.../envelope => kms/apis}/v1beta1/api.pb.go | 0
.../envelope => kms/apis}/v1beta1/api.proto | 0
.../envelope => kms/apis}/v1beta1/v1beta1.go | 0
.../envelope => kms/apis}/v2alpha1/api.pb.go | 0
.../envelope => kms/apis}/v2alpha1/api.proto | 0
.../apis}/v2alpha1/v2alpha1.go | 0
.../k8s.io/kube-openapi/pkg/internal/flags.go | 20 +
.../go-json-experiment/json}/AUTHORS | 0
.../go-json-experiment/json}/CONTRIBUTORS | 0
.../go-json-experiment/json}/LICENSE | 2 +-
.../go-json-experiment/json/README.md | 321 +
.../go-json-experiment/json/arshal.go | 506 ++
.../go-json-experiment/json/arshal_any.go | 219 +
.../go-json-experiment/json/arshal_default.go | 1446 ++++
.../go-json-experiment/json/arshal_funcs.go | 387 +
.../go-json-experiment/json/arshal_inlined.go | 186 +
.../go-json-experiment/json/arshal_methods.go | 229 +
.../go-json-experiment/json/arshal_time.go | 196 +
.../go-json-experiment/json/decode.go | 1655 ++++
.../go-json-experiment/json/doc.go | 185 +
.../go-json-experiment/json/encode.go | 1146 +++
.../go-json-experiment/json/errors.go | 183 +
.../go-json-experiment/json/fields.go | 509 ++
.../go-json-experiment/json/fold.go | 56 +
.../go-json-experiment/json/intern.go | 86 +
.../go-json-experiment/json/pools.go | 150 +
.../go-json-experiment/json/state.go | 747 ++
.../go-json-experiment/json/token.go | 522 ++
.../go-json-experiment/json/value.go | 375 +
.../kube-openapi/pkg/validation/spec/fuzz.go | 502 ++
.../pkg/validation/spec/gnostic.go | 6 +-
.../pkg/validation/spec/header.go | 30 +
.../kube-openapi/pkg/validation/spec/info.go | 48 +
.../kube-openapi/pkg/validation/spec/items.go | 28 +
.../pkg/validation/spec/operation.go | 24 +
.../pkg/validation/spec/parameter.go | 67 +-
.../pkg/validation/spec/path_item.go | 31 +
.../kube-openapi/pkg/validation/spec/paths.go | 59 +
.../pkg/validation/spec/response.go | 37 +-
.../pkg/validation/spec/responses.go | 84 +-
.../pkg/validation/spec/schema.go | 41 +
.../pkg/validation/spec/security_scheme.go | 18 +
.../pkg/validation/spec/swagger.go | 107 +
.../kube-openapi/pkg/validation/spec/tag.go | 23 +
vendor/k8s.io/utils/net/ipfamily.go | 181 +
vendor/k8s.io/utils/net/net.go | 126 +-
vendor/k8s.io/utils/net/port.go | 18 +-
vendor/k8s.io/utils/pointer/pointer.go | 20 +
vendor/k8s.io/utils/trace/trace.go | 30 +-
vendor/modules.txt | 336 +-
.../konnectivity-client/pkg/client/client.go | 347 +-
.../konnectivity-client/pkg/client/conn.go | 7 +
vendor/sigs.k8s.io/yaml/.gitignore | 4 +
vendor/sigs.k8s.io/yaml/.travis.yml | 7 +-
vendor/sigs.k8s.io/yaml/README.md | 2 +-
1730 files changed, 170344 insertions(+), 78341 deletions(-)
delete mode 100644 vendor/cloud.google.com/go/compute/metadata/metadata.go
delete mode 100644 vendor/cloud.google.com/go/compute/metadata/retry.go
delete mode 100644 vendor/github.com/Azure/go-autorest/CHANGELOG.md
delete mode 100644 vendor/github.com/Azure/go-autorest/GNUmakefile
delete mode 100644 vendor/github.com/Azure/go-autorest/Gopkg.lock
delete mode 100644 vendor/github.com/Azure/go-autorest/Gopkg.toml
delete mode 100644 vendor/github.com/Azure/go-autorest/LICENSE
delete mode 100644 vendor/github.com/Azure/go-autorest/README.md
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/LICENSE
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/README.md
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/config.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/go_mod_tidy_hack.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/persist.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/token.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/adal/version.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/authorization.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/autorest.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/azure/async.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/client.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/date/LICENSE
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/date/date.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/date/go_mod_tidy_hack.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/date/time.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/date/utility.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/error.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/go_mod_tidy_hack.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/preparer.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/responder.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/sender.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/utility.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go
delete mode 100644 vendor/github.com/Azure/go-autorest/autorest/version.go
delete mode 100644 vendor/github.com/Azure/go-autorest/azure-pipelines.yml
delete mode 100644 vendor/github.com/Azure/go-autorest/doc.go
delete mode 100644 vendor/github.com/Azure/go-autorest/logger/LICENSE
delete mode 100644 vendor/github.com/Azure/go-autorest/logger/go_mod_tidy_hack.go
delete mode 100644 vendor/github.com/Azure/go-autorest/logger/logger.go
delete mode 100644 vendor/github.com/Azure/go-autorest/tracing/LICENSE
delete mode 100644 vendor/github.com/Azure/go-autorest/tracing/go_mod_tidy_hack.go
delete mode 100644 vendor/github.com/Azure/go-autorest/tracing/tracing.go
delete mode 100644 vendor/github.com/PuerkitoBio/purell/.gitignore
delete mode 100644 vendor/github.com/PuerkitoBio/purell/.travis.yml
delete mode 100644 vendor/github.com/PuerkitoBio/purell/LICENSE
delete mode 100644 vendor/github.com/PuerkitoBio/purell/README.md
delete mode 100644 vendor/github.com/PuerkitoBio/purell/purell.go
delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/.travis.yml
delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/README.md
delete mode 100644 vendor/github.com/PuerkitoBio/urlesc/urlesc.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/LICENSE
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_config.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_config_set.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_deserialization_options.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_deserializer.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_simulator.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_state.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_type.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/char_stream.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/common_token_factory.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/common_token_stream.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa_serializer.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa_state.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/diagnostic_error_listener.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/error_listener.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/error_strategy.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/errors.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/file_stream.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/input_stream.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/int_stream.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/interval_set.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_action.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_action_executor.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_atn_simulator.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/ll1_analyzer.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser_atn_simulator.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser_rule_context.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/prediction_context.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/prediction_mode.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/recognizer.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/rule_context.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/semantic_context.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/token.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/token_source.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/token_stream.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/tokenstream_rewriter.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/trace_listener.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/transition.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/tree.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/trees.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/utils.go
create mode 100644 vendor/github.com/antlr/antlr4/runtime/Go/antlr/utils_set.go
rename vendor/github.com/{Azure/go-autorest => cenkalti/backoff/v4}/.gitignore (56%)
create mode 100644 vendor/github.com/cenkalti/backoff/v4/.travis.yml
create mode 100644 vendor/github.com/cenkalti/backoff/v4/LICENSE
create mode 100644 vendor/github.com/cenkalti/backoff/v4/README.md
create mode 100644 vendor/github.com/cenkalti/backoff/v4/backoff.go
create mode 100644 vendor/github.com/cenkalti/backoff/v4/context.go
create mode 100644 vendor/github.com/cenkalti/backoff/v4/exponential.go
create mode 100644 vendor/github.com/cenkalti/backoff/v4/retry.go
create mode 100644 vendor/github.com/cenkalti/backoff/v4/ticker.go
create mode 100644 vendor/github.com/cenkalti/backoff/v4/timer.go
create mode 100644 vendor/github.com/cenkalti/backoff/v4/tries.go
create mode 100644 vendor/github.com/emicklei/go-restful/v3/filter_adapter.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/.mailmap
delete mode 100644 vendor/github.com/fsnotify/fsnotify/.travis.yml
delete mode 100644 vendor/github.com/fsnotify/fsnotify/AUTHORS
create mode 100644 vendor/github.com/fsnotify/fsnotify/backend_fen.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/backend_inotify.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/backend_kqueue.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/backend_other.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/backend_windows.go
delete mode 100644 vendor/github.com/fsnotify/fsnotify/fen.go
delete mode 100644 vendor/github.com/fsnotify/fsnotify/inotify.go
delete mode 100644 vendor/github.com/fsnotify/fsnotify/inotify_poller.go
delete mode 100644 vendor/github.com/fsnotify/fsnotify/kqueue.go
create mode 100644 vendor/github.com/fsnotify/fsnotify/mkdoc.zsh
rename vendor/github.com/fsnotify/fsnotify/{open_mode_bsd.go => system_bsd.go} (50%)
rename vendor/github.com/fsnotify/fsnotify/{open_mode_darwin.go => system_darwin.go} (50%)
delete mode 100644 vendor/github.com/fsnotify/fsnotify/windows.go
create mode 100644 vendor/github.com/go-logr/logr/funcr/funcr.go
rename vendor/{go.opentelemetry.io/contrib => github.com/go-logr/stdr}/LICENSE (100%)
create mode 100644 vendor/github.com/go-logr/stdr/README.md
create mode 100644 vendor/github.com/go-logr/stdr/stdr.go
create mode 100644 vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/.gitignore
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/LICENSE
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/MIGRATION_GUIDE.md
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/README.md
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/VERSION_HISTORY.md
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/claims.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/doc.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/ecdsa.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/ecdsa_utils.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/ed25519.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/ed25519_utils.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/errors.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/hmac.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/map_claims.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/none.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/parser.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/parser_option.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/rsa.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/rsa_pss.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/rsa_utils.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/signing_method.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/staticcheck.conf
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/token.go
delete mode 100644 vendor/github.com/golang-jwt/jwt/v4/types.go
delete mode 100644 vendor/github.com/golang/protobuf/descriptor/descriptor.go
delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go
delete mode 100644 vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go
rename vendor/github.com/{Azure/go-autorest/autorest/adal => google/cel-go}/LICENSE (82%)
create mode 100644 vendor/github.com/google/cel-go/cel/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/cel/cel.go
create mode 100644 vendor/github.com/google/cel-go/cel/decls.go
create mode 100644 vendor/github.com/google/cel-go/cel/env.go
create mode 100644 vendor/github.com/google/cel-go/cel/io.go
create mode 100644 vendor/github.com/google/cel-go/cel/library.go
create mode 100644 vendor/github.com/google/cel-go/cel/macro.go
create mode 100644 vendor/github.com/google/cel-go/cel/options.go
create mode 100644 vendor/github.com/google/cel-go/cel/program.go
create mode 100644 vendor/github.com/google/cel-go/checker/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/checker/checker.go
create mode 100644 vendor/github.com/google/cel-go/checker/cost.go
create mode 100644 vendor/github.com/google/cel-go/checker/decls/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/checker/decls/decls.go
create mode 100644 vendor/github.com/google/cel-go/checker/decls/scopes.go
create mode 100644 vendor/github.com/google/cel-go/checker/env.go
create mode 100644 vendor/github.com/google/cel-go/checker/errors.go
create mode 100644 vendor/github.com/google/cel-go/checker/mapping.go
create mode 100644 vendor/github.com/google/cel-go/checker/options.go
create mode 100644 vendor/github.com/google/cel-go/checker/printer.go
create mode 100644 vendor/github.com/google/cel-go/checker/standard.go
create mode 100644 vendor/github.com/google/cel-go/checker/types.go
create mode 100644 vendor/github.com/google/cel-go/common/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/containers/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/containers/container.go
create mode 100644 vendor/github.com/google/cel-go/common/cost.go
create mode 100644 vendor/github.com/google/cel-go/common/debug/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/debug/debug.go
create mode 100644 vendor/github.com/google/cel-go/common/doc.go
create mode 100644 vendor/github.com/google/cel-go/common/error.go
create mode 100644 vendor/github.com/google/cel-go/common/errors.go
create mode 100644 vendor/github.com/google/cel-go/common/location.go
create mode 100644 vendor/github.com/google/cel-go/common/operators/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/operators/operators.go
create mode 100644 vendor/github.com/google/cel-go/common/overloads/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/overloads/overloads.go
create mode 100644 vendor/github.com/google/cel-go/common/runes/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/runes/buffer.go
create mode 100644 vendor/github.com/google/cel-go/common/source.go
create mode 100644 vendor/github.com/google/cel-go/common/types/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/types/any_value.go
create mode 100644 vendor/github.com/google/cel-go/common/types/bool.go
create mode 100644 vendor/github.com/google/cel-go/common/types/bytes.go
create mode 100644 vendor/github.com/google/cel-go/common/types/compare.go
create mode 100644 vendor/github.com/google/cel-go/common/types/doc.go
create mode 100644 vendor/github.com/google/cel-go/common/types/double.go
create mode 100644 vendor/github.com/google/cel-go/common/types/duration.go
create mode 100644 vendor/github.com/google/cel-go/common/types/err.go
create mode 100644 vendor/github.com/google/cel-go/common/types/int.go
create mode 100644 vendor/github.com/google/cel-go/common/types/iterator.go
create mode 100644 vendor/github.com/google/cel-go/common/types/json_value.go
create mode 100644 vendor/github.com/google/cel-go/common/types/list.go
create mode 100644 vendor/github.com/google/cel-go/common/types/map.go
create mode 100644 vendor/github.com/google/cel-go/common/types/null.go
create mode 100644 vendor/github.com/google/cel-go/common/types/object.go
create mode 100644 vendor/github.com/google/cel-go/common/types/overflow.go
create mode 100644 vendor/github.com/google/cel-go/common/types/pb/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/types/pb/checked.go
create mode 100644 vendor/github.com/google/cel-go/common/types/pb/enum.go
create mode 100644 vendor/github.com/google/cel-go/common/types/pb/equal.go
create mode 100644 vendor/github.com/google/cel-go/common/types/pb/file.go
create mode 100644 vendor/github.com/google/cel-go/common/types/pb/pb.go
create mode 100644 vendor/github.com/google/cel-go/common/types/pb/type.go
create mode 100644 vendor/github.com/google/cel-go/common/types/provider.go
create mode 100644 vendor/github.com/google/cel-go/common/types/ref/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/types/ref/provider.go
create mode 100644 vendor/github.com/google/cel-go/common/types/ref/reference.go
create mode 100644 vendor/github.com/google/cel-go/common/types/string.go
create mode 100644 vendor/github.com/google/cel-go/common/types/timestamp.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/comparer.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/container.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/field_tester.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/indexer.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/iterator.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/lister.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/mapper.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/matcher.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/math.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/receiver.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/sizer.go
create mode 100644 vendor/github.com/google/cel-go/common/types/traits/traits.go
create mode 100644 vendor/github.com/google/cel-go/common/types/type.go
create mode 100644 vendor/github.com/google/cel-go/common/types/uint.go
create mode 100644 vendor/github.com/google/cel-go/common/types/unknown.go
create mode 100644 vendor/github.com/google/cel-go/common/types/util.go
create mode 100644 vendor/github.com/google/cel-go/ext/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/ext/README.md
create mode 100644 vendor/github.com/google/cel-go/ext/encoders.go
create mode 100644 vendor/github.com/google/cel-go/ext/guards.go
create mode 100644 vendor/github.com/google/cel-go/ext/strings.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/interpreter/activation.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/attribute_patterns.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/attributes.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/coster.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/decorators.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/dispatcher.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/evalstate.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/functions/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/interpreter/functions/functions.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/functions/standard.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/interpretable.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/interpreter.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/optimizations.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/planner.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/prune.go
create mode 100644 vendor/github.com/google/cel-go/interpreter/runtimecost.go
create mode 100644 vendor/github.com/google/cel-go/parser/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/parser/errors.go
create mode 100644 vendor/github.com/google/cel-go/parser/gen/BUILD.bazel
create mode 100644 vendor/github.com/google/cel-go/parser/gen/CEL.g4
create mode 100644 vendor/github.com/google/cel-go/parser/gen/CEL.interp
create mode 100644 vendor/github.com/google/cel-go/parser/gen/CEL.tokens
create mode 100644 vendor/github.com/google/cel-go/parser/gen/CELLexer.interp
create mode 100644 vendor/github.com/google/cel-go/parser/gen/CELLexer.tokens
create mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_base_listener.go
create mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_base_visitor.go
create mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_lexer.go
create mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_listener.go
create mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_parser.go
create mode 100644 vendor/github.com/google/cel-go/parser/gen/cel_visitor.go
rename vendor/{cloud.google.com/go/compute/metadata/retry_linux.go => github.com/google/cel-go/parser/gen/doc.go} (65%)
create mode 100644 vendor/github.com/google/cel-go/parser/gen/generate.sh
create mode 100644 vendor/github.com/google/cel-go/parser/helper.go
create mode 100644 vendor/github.com/google/cel-go/parser/input.go
create mode 100644 vendor/github.com/google/cel-go/parser/macro.go
create mode 100644 vendor/github.com/google/cel-go/parser/options.go
create mode 100644 vendor/github.com/google/cel-go/parser/parser.go
create mode 100644 vendor/github.com/google/cel-go/parser/unescape.go
create mode 100644 vendor/github.com/google/cel-go/parser/unparser.go
delete mode 100644 vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go
delete mode 100644 vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go
delete mode 100644 vendor/github.com/google/go-cmp/cmp/internal/value/zero.go
delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/internal/BUILD.bazel
delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.pb.go
delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/internal/errors.proto
delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/BUILD.bazel
delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/errors.go
delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/fieldmask.go
delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/proto_errors.go
delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/query.go
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/LICENSE.txt (100%)
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/compile.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/fuzz.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/parse.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/types.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/context.go (79%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/convert.go (80%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/doc.go (100%)
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/errors.go
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/handler.go (77%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/marshal_httpbodyproto.go (54%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/marshal_json.go (95%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/marshal_jsonpb.go (58%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/marshal_proto.go (93%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/marshaler.go (80%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/marshaler_registry.go (91%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/mux.go (59%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/pattern.go (57%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/runtime/proto2_convert.go (98%)
create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/utilities/BUILD.bazel (59%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/utilities/doc.go (100%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/utilities/pattern.go (100%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/utilities/readerfactory.go (100%)
rename vendor/github.com/grpc-ecosystem/grpc-gateway/{ => v2}/utilities/trie.go (98%)
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/collectors/collectors.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/collectors/dbstats_collector.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/collectors/expvar_collector.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/collectors/go_collector_go116.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/collectors/go_collector_latest.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/collectors/process_collector.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/get_pid.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/get_pid_gopherjs.go
rename vendor/github.com/prometheus/client_golang/prometheus/{go_collector_go117.go => go_collector_latest.go} (53%)
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/internal/almost_equal.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/internal/go_collector_options.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/num_threads.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/num_threads_gopherjs.go
create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/process_collector_js.go
delete mode 100644 vendor/github.com/prometheus/procfs/fixtures.ttar
rename vendor/github.com/prometheus/procfs/{xfrm.go => net_xfrm.go} (96%)
create mode 100644 vendor/github.com/prometheus/procfs/proc_cgroups.go
create mode 100644 vendor/github.com/prometheus/procfs/proc_netstat.go
create mode 100644 vendor/github.com/prometheus/procfs/proc_snmp.go
create mode 100644 vendor/github.com/prometheus/procfs/proc_snmp6.go
create mode 100644 vendor/github.com/prometheus/procfs/proc_sys.go
create mode 100644 vendor/github.com/prometheus/procfs/softirqs.go
delete mode 100644 vendor/github.com/spf13/cobra/CHANGELOG.md
create mode 100644 vendor/github.com/spf13/cobra/active_help.go
create mode 100644 vendor/github.com/spf13/cobra/active_help.md
create mode 100644 vendor/github.com/spf13/cobra/flag_groups.go
create mode 100644 vendor/github.com/stoewer/go-strcase/.gitignore
create mode 100644 vendor/github.com/stoewer/go-strcase/.golangci.yml
create mode 100644 vendor/github.com/stoewer/go-strcase/LICENSE
create mode 100644 vendor/github.com/stoewer/go-strcase/README.md
create mode 100644 vendor/github.com/stoewer/go-strcase/camel.go
create mode 100644 vendor/github.com/stoewer/go-strcase/doc.go
create mode 100644 vendor/github.com/stoewer/go-strcase/helper.go
create mode 100644 vendor/github.com/stoewer/go-strcase/kebab.go
create mode 100644 vendor/github.com/stoewer/go-strcase/snake.go
create mode 100644 vendor/go.etcd.io/etcd/client/pkg/v3/fileutil/filereader.go
delete mode 100644 vendor/go.opentelemetry.io/contrib/.gitignore
delete mode 100644 vendor/go.opentelemetry.io/contrib/.golangci.yml
delete mode 100644 vendor/go.opentelemetry.io/contrib/CHANGELOG.md
delete mode 100644 vendor/go.opentelemetry.io/contrib/CODEOWNERS
delete mode 100644 vendor/go.opentelemetry.io/contrib/CONTRIBUTING.md
delete mode 100644 vendor/go.opentelemetry.io/contrib/Makefile
delete mode 100644 vendor/go.opentelemetry.io/contrib/README.md
delete mode 100644 vendor/go.opentelemetry.io/contrib/RELEASING.md
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/interceptorinfo.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal/parse.go
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/semconv.go
rename vendor/go.opentelemetry.io/contrib/{contrib.go => instrumentation/google.golang.org/grpc/otelgrpc/version.go} (75%)
create mode 100644 vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go
delete mode 100644 vendor/go.opentelemetry.io/contrib/pre_release.sh
delete mode 100644 vendor/go.opentelemetry.io/contrib/tag.sh
create mode 100644 vendor/go.opentelemetry.io/otel/.gitattributes
create mode 100644 vendor/go.opentelemetry.io/otel/.lycheeignore
create mode 100644 vendor/go.opentelemetry.io/otel/.markdownlint.yaml
create mode 100644 vendor/go.opentelemetry.io/otel/baggage/context.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/internal/config.go
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/internal/envconfig/envconfig.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/envconfig.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/options.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/internal/otlpconfig/tls.go
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/internal/partialsuccess.go
rename vendor/go.opentelemetry.io/otel/exporters/otlp/{ => internal/retry}/LICENSE (100%)
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/internal/retry/retry.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/attribute.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/internal/transform/metric.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/options.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlp.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/connection.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/doc.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/driver.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlpgrpc/options.go
rename vendor/go.opentelemetry.io/otel/{sdk/export/metric => exporters/otlp/otlptrace}/LICENSE (100%)
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/README.md
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/clients.go
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/exporter.go
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig/envconfig.go
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig/options.go
rename vendor/go.opentelemetry.io/otel/exporters/otlp/{ => otlptrace/internal/otlpconfig}/optiontypes.go (70%)
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/otlpconfig/tls.go
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/internal/tracetransform/attribute.go
rename vendor/go.opentelemetry.io/otel/exporters/otlp/{internal/transform => otlptrace/internal/tracetransform}/instrumentation.go (74%)
rename vendor/go.opentelemetry.io/otel/exporters/otlp/{internal/transform => otlptrace/internal/tracetransform}/resource.go (89%)
rename vendor/go.opentelemetry.io/otel/exporters/otlp/{internal/transform => otlptrace/internal/tracetransform}/span.go (56%)
rename vendor/go.opentelemetry.io/otel/{sdk/metric => exporters/otlp/otlptrace/otlptracegrpc}/LICENSE (100%)
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/client.go
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/exporter.go
create mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc/options.go
delete mode 100644 vendor/go.opentelemetry.io/otel/exporters/otlp/protocoldriver.go
create mode 100644 vendor/go.opentelemetry.io/otel/internal/baggage/context.go
create 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/metric/async.go
rename vendor/go.opentelemetry.io/otel/{sdk/metric/atomicfields.go => internal_logging.go} (67%)
rename vendor/go.opentelemetry.io/otel/metric/global/{metric.go => global.go} (50%)
create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/asyncfloat64/asyncfloat64.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/asyncint64/asyncint64.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/config.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/instrument.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/syncfloat64/syncfloat64.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument/syncint64/syncint64.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/instrumentkind_string.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/internal/global/instruments.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/internal/global/meter.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/internal/global/state.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/meter.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/metric.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/metric_instrument.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/metric_noop.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/metric_sdkapi.go
create mode 100644 vendor/go.opentelemetry.io/otel/metric/noop.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/number/kind_string.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/number/number.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/registry/doc.go
delete mode 100644 vendor/go.opentelemetry.io/otel/metric/registry/registry.go
rename vendor/go.opentelemetry.io/otel/{ => metric}/unit/doc.go (93%)
rename vendor/go.opentelemetry.io/otel/{ => metric}/unit/unit.go (81%)
delete mode 100644 vendor/go.opentelemetry.io/otel/pre_release.sh
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/export/metric/aggregation/aggregation.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/export/metric/exportkind_string.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/export/metric/metric.go
rename vendor/go.opentelemetry.io/otel/{metric/number => sdk/instrumentation}/doc.go (51%)
rename vendor/go.opentelemetry.io/otel/{internal/trace/noop/noop.go => sdk/instrumentation/scope.go} (59%)
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/internal/sanitize.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/aggregator.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/exact/exact.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/histogram/histogram.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue/lastvalue.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount/mmsc.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/aggregator/sum/sum.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/controller/basic/config.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/controller/basic/controller.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/controller/time/time.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/doc.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/processor/basic/basic.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/processor/basic/config.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/refcount_mapped.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/sdk.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/metric/selector/simple/simple.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/container.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/attributesmap.go
delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/config.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/event.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/link.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go
create mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go
delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/exception.go
delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/http.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/internal/http.go
delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/resource.go
delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/trace.go
rename vendor/go.opentelemetry.io/otel/semconv/{ => v1.12.0}/doc.go (64%)
rename vendor/go.opentelemetry.io/{contrib/doc.go => otel/semconv/v1.12.0/exception.go} (64%)
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go
rename vendor/go.opentelemetry.io/otel/{exporters/otlp/doc.go => semconv/v1.12.0/schema.go} (61%)
create mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go
delete mode 100644 vendor/go.opentelemetry.io/otel/tag.sh
create mode 100644 vendor/go.opentelemetry.io/otel/trace/tracestate.go
create mode 100644 vendor/go.opentelemetry.io/otel/versions.yaml
delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service.pb.go
delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service.pb.gw.go
delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/collector/metrics/v1/metrics_service_grpc.pb.go
delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/collector/trace/v1/trace_config.pb.go
delete mode 100644 vendor/go.opentelemetry.io/proto/otlp/metrics/v1/metrics.pb.go
rename vendor/golang.org/x/crypto/internal/{subtle/aliasing.go => alias/alias.go} (84%)
rename vendor/golang.org/x/crypto/internal/{subtle/aliasing_purego.go => alias/alias_purego.go} (86%)
delete mode 100644 vendor/golang.org/x/crypto/pkcs12/bmp-string.go
delete mode 100644 vendor/golang.org/x/crypto/pkcs12/crypto.go
delete mode 100644 vendor/golang.org/x/crypto/pkcs12/errors.go
delete mode 100644 vendor/golang.org/x/crypto/pkcs12/internal/rc2/rc2.go
delete mode 100644 vendor/golang.org/x/crypto/pkcs12/mac.go
delete mode 100644 vendor/golang.org/x/crypto/pkcs12/pbkdf.go
delete mode 100644 vendor/golang.org/x/crypto/pkcs12/pkcs12.go
delete mode 100644 vendor/golang.org/x/crypto/pkcs12/safebags.go
create mode 100644 vendor/golang.org/x/net/http2/hpack/static_table.go
delete mode 100644 vendor/golang.org/x/oauth2/authhandler/authhandler.go
delete mode 100644 vendor/golang.org/x/oauth2/google/appengine.go
delete mode 100644 vendor/golang.org/x/oauth2/google/appengine_gen1.go
delete mode 100644 vendor/golang.org/x/oauth2/google/appengine_gen2_flex.go
delete mode 100644 vendor/golang.org/x/oauth2/google/default.go
delete mode 100644 vendor/golang.org/x/oauth2/google/doc.go
delete mode 100644 vendor/golang.org/x/oauth2/google/google.go
delete mode 100644 vendor/golang.org/x/oauth2/google/internal/externalaccount/aws.go
delete mode 100644 vendor/golang.org/x/oauth2/google/internal/externalaccount/basecredentials.go
delete mode 100644 vendor/golang.org/x/oauth2/google/internal/externalaccount/clientauth.go
delete mode 100644 vendor/golang.org/x/oauth2/google/internal/externalaccount/err.go
delete mode 100644 vendor/golang.org/x/oauth2/google/internal/externalaccount/filecredsource.go
delete mode 100644 vendor/golang.org/x/oauth2/google/internal/externalaccount/impersonate.go
delete mode 100644 vendor/golang.org/x/oauth2/google/internal/externalaccount/sts_exchange.go
delete mode 100644 vendor/golang.org/x/oauth2/google/internal/externalaccount/urlcredsource.go
delete mode 100644 vendor/golang.org/x/oauth2/google/jwt.go
delete mode 100644 vendor/golang.org/x/oauth2/google/sdk.go
delete mode 100644 vendor/golang.org/x/oauth2/jws/jws.go
delete mode 100644 vendor/golang.org/x/oauth2/jwt/jwt.go
create mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go
create mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s
create mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go
create mode 100644 vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s
delete mode 100644 vendor/golang.org/x/sys/unix/str.go
delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go
delete mode 100644 vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
create mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go
create mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go
create mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go
create mode 100644 vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go
create mode 100644 vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go
delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go
delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s
delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go
delete mode 100644 vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s
create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s
create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s
create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s
create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s
create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go
create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s
create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go
create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s
create mode 100644 vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go
create mode 100644 vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go
create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go
create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go
delete mode 100644 vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go
create mode 100644 vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go
create mode 100644 vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go
create mode 100644 vendor/golang.org/x/sys/windows/registry/key.go
create mode 100644 vendor/golang.org/x/sys/windows/registry/mksyscall.go
create mode 100644 vendor/golang.org/x/sys/windows/registry/syscall.go
create mode 100644 vendor/golang.org/x/sys/windows/registry/value.go
create mode 100644 vendor/golang.org/x/sys/windows/registry/zsyscall_windows.go
delete mode 100644 vendor/golang.org/x/term/AUTHORS
delete mode 100644 vendor/golang.org/x/term/CONTRIBUTORS
delete mode 100644 vendor/golang.org/x/text/AUTHORS
delete mode 100644 vendor/golang.org/x/text/CONTRIBUTORS
delete mode 100644 vendor/golang.org/x/tools/go/gcexportdata/gcexportdata.go
delete mode 100644 vendor/golang.org/x/tools/go/gcexportdata/importer.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/bexport.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/bimport.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/exportdata.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/gcimporter.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/iexport.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/iimport.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/newInterface10.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/newInterface11.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/support_go117.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/support_go118.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/unified_no.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/unified_yes.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/ureader_no.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/ureader_yes.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/codes.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/decoder.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/doc.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/encoder.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/flags.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/frames_go1.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/frames_go17.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/reloc.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/support.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/sync.go
delete mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/syncmarker_string.go
delete mode 100644 vendor/golang.org/x/tools/go/packages/doc.go
delete mode 100644 vendor/golang.org/x/tools/go/packages/external.go
delete mode 100644 vendor/golang.org/x/tools/go/packages/golist.go
delete mode 100644 vendor/golang.org/x/tools/go/packages/golist_overlay.go
delete mode 100644 vendor/golang.org/x/tools/go/packages/loadmode_string.go
delete mode 100644 vendor/golang.org/x/tools/go/packages/packages.go
delete mode 100644 vendor/golang.org/x/tools/go/packages/visit.go
create mode 100644 vendor/golang.org/x/tools/internal/fastwalk/fastwalk_darwin.go
delete mode 100644 vendor/golang.org/x/tools/internal/packagesinternal/packages.go
delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/errorcode.go
delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/errorcode_string.go
delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/types.go
delete mode 100644 vendor/golang.org/x/tools/internal/typesinternal/types_118.go
delete mode 100644 vendor/google.golang.org/appengine/.travis.yml
delete mode 100644 vendor/google.golang.org/appengine/CONTRIBUTING.md
delete mode 100644 vendor/google.golang.org/appengine/README.md
delete mode 100644 vendor/google.golang.org/appengine/appengine.go
delete mode 100644 vendor/google.golang.org/appengine/appengine_vm.go
delete mode 100644 vendor/google.golang.org/appengine/errors.go
delete mode 100644 vendor/google.golang.org/appengine/identity.go
delete mode 100644 vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.pb.go
delete mode 100644 vendor/google.golang.org/appengine/internal/app_identity/app_identity_service.proto
delete mode 100644 vendor/google.golang.org/appengine/internal/modules/modules_service.pb.go
delete mode 100644 vendor/google.golang.org/appengine/internal/modules/modules_service.proto
delete mode 100644 vendor/google.golang.org/appengine/namespace.go
delete mode 100644 vendor/google.golang.org/appengine/timeout.go
delete mode 100644 vendor/google.golang.org/appengine/travis_install.sh
delete mode 100644 vendor/google.golang.org/appengine/travis_test.sh
create mode 100644 vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/checked.pb.go
create mode 100644 vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/eval.pb.go
create mode 100644 vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/explain.pb.go
create mode 100644 vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/syntax.pb.go
create mode 100644 vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1/value.pb.go
create mode 100644 vendor/google.golang.org/genproto/googleapis/rpc/errdetails/error_details.pb.go
create mode 100644 vendor/google.golang.org/grpc/balancer/conn_state_evaluator.go
delete mode 100644 vendor/google.golang.org/protobuf/AUTHORS
delete mode 100644 vendor/google.golang.org/protobuf/CONTRIBUTORS
create mode 100644 vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go
create mode 100644 vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go
create mode 100644 vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go
rename vendor/k8s.io/{client-go/util/jsonpath => api/admissionregistration/v1alpha1}/doc.go (63%)
create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/generated.pb.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/generated.proto
create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/register.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/types.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/admissionregistration/v1alpha1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/doc.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/generated.pb.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/generated.proto
create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/register.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/types.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/apidiscovery/v2beta1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/doc.go
create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/generated.pb.go
create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/generated.proto
create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/register.go
create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/types.go
create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/authentication/v1alpha1/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/doc.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/generated.pb.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/generated.proto
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/register.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/types.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/api/flowcontrol/v1beta3/zz_generated.prerelease-lifecycle.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha1/doc.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha1/generated.pb.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha1/generated.proto
create mode 100644 vendor/k8s.io/api/resource/v1alpha1/register.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha1/types.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha1/types_swagger_doc_generated.go
create mode 100644 vendor/k8s.io/api/resource/v1alpha1/zz_generated.deepcopy.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/ordered.go
create mode 100644 vendor/k8s.io/apimachinery/pkg/util/sets/set.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/cel/metrics.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/OWNERS
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/admission.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/compiler.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/controller.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/controller_reconcile.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/initializer.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/interface.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/controller.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/doc.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/informer.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/interface.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/internal/generic/lister.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/matching/matching.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/policy_decision.go
create mode 100644 vendor/k8s.io/apiserver/pkg/admission/plugin/validatingadmissionpolicy/validator.go
rename vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/namespace/doc.go (96%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/namespace/matcher.go (92%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/object/doc.go (96%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/object/matcher.go (82%)
rename vendor/k8s.io/apiserver/pkg/admission/plugin/webhook/{ => predicates}/rules/rules.go (89%)
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/errors.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/escaping.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/cost.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/libraries.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/lists.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/regex.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/library/urls.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/limits.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/registry.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/types.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/url.go
create mode 100644 vendor/k8s.io/apiserver/pkg/cel/value.go
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/etag.go
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/fake.go
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/handler.go
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/negotiation.go
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/discovery/aggregated/wrapper.go
delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/filters/audit_annotations.go
rename vendor/k8s.io/apiserver/pkg/endpoints/filters/{with_auditid.go => audit_init.go} (80%)
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/handlers/metrics/OWNERS
create mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/handlers/metrics/metrics.go
delete mode 100644 vendor/k8s.io/apiserver/pkg/endpoints/request/auditid.go
create mode 100644 vendor/k8s.io/apiserver/pkg/server/options/encryptionconfig/controller/controller.go
create mode 100644 vendor/k8s.io/apiserver/pkg/storage/value/OWNERS
create mode 100644 vendor/k8s.io/apiserver/pkg/util/flowcontrol/conc_alloc.go
create mode 100644 vendor/k8s.io/apiserver/pkg/util/flowcontrol/metrics/union_gauge.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/admissionpolicyspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/matchresources.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/namedrulewithoperations.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/paramkind.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/paramref.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/paramsource.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/rule.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/rulewithoperations.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybindingspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1/validation.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/apps/v1/statefulsetordinals.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/apps/v1beta1/statefulsetordinals.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/apps/v1beta2/statefulsetordinals.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/claimsource.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/podresourceclaim.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/podschedulinggate.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/core/v1/typedobjectreference.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingressloadbalanceringress.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingressloadbalancerstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/extensions/v1beta1/ingressportstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowdistinguishermethod.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschema.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschemacondition.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschemaspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/flowschemastatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/groupsubject.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/limitedprioritylevelconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/limitresponse.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/nonresourcepolicyrule.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/policyruleswithsubjects.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationcondition.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationreference.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/queuingconfiguration.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/resourcepolicyrule.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/serviceaccountsubject.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/subject.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3/usersubject.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/meta/v1/groupversionkind.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/meta/v1/status.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/meta/v1/statuscause.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/meta/v1/statusdetails.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressloadbalanceringress.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressloadbalancerstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1/ingressportstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressloadbalanceringress.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressloadbalancerstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/networking/v1beta1/ingressportstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/allocationresult.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/podscheduling.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/podschedulingspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/podschedulingstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/resourceclaimconsumerreference.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/resourceclaimparametersreference.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/resourceclaimschedulingstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/resourceclaimspec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/resourceclaimstatus.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/resourceclaimtemplatespec.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/resourceclass.go
create mode 100644 vendor/k8s.io/client-go/applyconfigurations/resource/v1alpha1/resourceclassparametersreference.go
create mode 100644 vendor/k8s.io/client-go/discovery/aggregated_discovery.go
create mode 100644 vendor/k8s.io/client-go/dynamic/dynamicinformer/informer.go
create mode 100644 vendor/k8s.io/client-go/dynamic/dynamicinformer/interface.go
create mode 100644 vendor/k8s.io/client-go/dynamic/dynamiclister/interface.go
create mode 100644 vendor/k8s.io/client-go/dynamic/dynamiclister/lister.go
create mode 100644 vendor/k8s.io/client-go/dynamic/dynamiclister/shim.go
create mode 100644 vendor/k8s.io/client-go/dynamic/interface.go
create mode 100644 vendor/k8s.io/client-go/dynamic/scheme.go
create mode 100644 vendor/k8s.io/client-go/dynamic/simple.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/informers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/flowschema.go
create mode 100644 vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/flowcontrol/v1beta3/prioritylevelconfiguration.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha1/interface.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha1/podscheduling.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha1/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha1/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/informers/resource/v1alpha1/resourceclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/authentication_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_authentication_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/generated_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1alpha1/selfsubjectreview.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowcontrol_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/flowcontrol_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/flowschema.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/generated_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/fake/doc.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/fake/fake_podscheduling.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/fake/fake_resource_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/fake/fake_resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/fake/fake_resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/fake/fake_resourceclass.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/generated_expansion.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/podscheduling.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/resource_client.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/resource/v1alpha1/resourceclass.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/expansion_generated.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/validatingadmissionpolicy.go
create mode 100644 vendor/k8s.io/client-go/listers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go
create mode 100644 vendor/k8s.io/client-go/listers/flowcontrol/v1beta3/expansion_generated.go
create mode 100644 vendor/k8s.io/client-go/listers/flowcontrol/v1beta3/flowschema.go
create mode 100644 vendor/k8s.io/client-go/listers/flowcontrol/v1beta3/prioritylevelconfiguration.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha1/expansion_generated.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha1/podscheduling.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha1/resourceclaim.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha1/resourceclaimtemplate.go
create mode 100644 vendor/k8s.io/client-go/listers/resource/v1alpha1/resourceclass.go
delete mode 100644 vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/README.md
delete mode 100644 vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go
create mode 100644 vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure_stub.go
delete mode 100644 vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/OWNERS
delete mode 100644 vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp.go
create mode 100644 vendor/k8s.io/client-go/plugin/pkg/client/auth/gcp/gcp_stub.go
delete mode 100644 vendor/k8s.io/client-go/plugin/pkg/client/auth/openstack/openstack_stub.go
delete mode 100644 vendor/k8s.io/client-go/third_party/forked/golang/LICENSE
delete mode 100644 vendor/k8s.io/client-go/third_party/forked/golang/PATENTS
delete mode 100644 vendor/k8s.io/client-go/third_party/forked/golang/template/exec.go
delete mode 100644 vendor/k8s.io/client-go/third_party/forked/golang/template/funcs.go
create mode 100644 vendor/k8s.io/client-go/transport/cache_go118.go
delete mode 100644 vendor/k8s.io/client-go/util/jsonpath/jsonpath.go
delete mode 100644 vendor/k8s.io/client-go/util/jsonpath/node.go
delete mode 100644 vendor/k8s.io/client-go/util/jsonpath/parser.go
create mode 100644 vendor/k8s.io/component-base/logs/klogflags/klogflags.go
create mode 100644 vendor/k8s.io/component-base/metrics/buckets.go
create mode 100644 vendor/k8s.io/component-base/metrics/features/kube_features.go
create mode 100644 vendor/k8s.io/component-base/metrics/prometheus/feature/metrics.go
create mode 100644 vendor/k8s.io/component-base/metrics/prometheus/slis/metrics.go
create mode 100644 vendor/k8s.io/component-base/metrics/prometheus/slis/registry.go
create mode 100644 vendor/k8s.io/component-base/metrics/prometheus/slis/routes.go
create mode 100644 vendor/k8s.io/component-base/tracing/tracing.go
rename vendor/{cloud.google.com/go => k8s.io/kms}/LICENSE (99%)
rename vendor/k8s.io/{apiserver/pkg/storage/value/encrypt/envelope => kms/apis}/v1beta1/api.pb.go (100%)
rename vendor/k8s.io/{apiserver/pkg/storage/value/encrypt/envelope => kms/apis}/v1beta1/api.proto (100%)
rename vendor/k8s.io/{apiserver/pkg/storage/value/encrypt/envelope => kms/apis}/v1beta1/v1beta1.go (100%)
rename vendor/k8s.io/{apiserver/pkg/storage/value/encrypt/envelope => kms/apis}/v2alpha1/api.pb.go (100%)
rename vendor/k8s.io/{apiserver/pkg/storage/value/encrypt/envelope => kms/apis}/v2alpha1/api.proto (100%)
rename vendor/k8s.io/{apiserver/pkg/storage/value/encrypt/envelope => kms/apis}/v2alpha1/v2alpha1.go (100%)
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/flags.go
rename vendor/{golang.org/x/crypto => k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json}/AUTHORS (100%)
rename vendor/{golang.org/x/crypto => k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json}/CONTRIBUTORS (100%)
rename vendor/{github.com/PuerkitoBio/urlesc => k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json}/LICENSE (96%)
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/README.md
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_any.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_default.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_funcs.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_inlined.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_methods.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/arshal_time.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/decode.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/doc.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/encode.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/errors.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fields.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/fold.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/intern.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/pools.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/state.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/token.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/internal/third_party/go-json-experiment/json/value.go
create mode 100644 vendor/k8s.io/kube-openapi/pkg/validation/spec/fuzz.go
create mode 100644 vendor/k8s.io/utils/net/ipfamily.go
diff --git a/go.mod b/go.mod
index 6148fa09b..e3824b618 100644
--- a/go.mod
+++ b/go.mod
@@ -4,112 +4,107 @@ go 1.19
require (
github.com/client9/misspell v0.3.4
- github.com/google/go-cmp v0.5.6
- github.com/spf13/cobra v1.4.0
+ github.com/google/go-cmp v0.5.9
+ github.com/spf13/cobra v1.6.0
github.com/spf13/pflag v1.0.5
- k8s.io/api v0.25.0
- k8s.io/apimachinery v0.25.0
- k8s.io/apiserver v0.25.0
- k8s.io/client-go v0.25.0
- k8s.io/code-generator v0.25.0
- k8s.io/component-base v0.25.0
- k8s.io/component-helpers v0.25.0
- k8s.io/klog/v2 v2.70.1
- k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73
+ k8s.io/api v0.26.0-rc.1
+ k8s.io/apimachinery v0.26.0-rc.1
+ k8s.io/apiserver v0.26.0-rc.1
+ k8s.io/client-go v0.26.0-rc.1
+ k8s.io/code-generator v0.26.0-rc.1
+ k8s.io/component-base v0.26.0-rc.1
+ k8s.io/component-helpers v0.26.0-rc.1
+ k8s.io/klog/v2 v2.80.1
+ k8s.io/utils v0.0.0-20221128185143-99ec85e7a448
sigs.k8s.io/mdtoc v1.0.1
)
require (
- cloud.google.com/go v0.97.0 // indirect
- github.com/Azure/go-autorest v14.2.0+incompatible // indirect
- github.com/Azure/go-autorest/autorest v0.11.27 // indirect
- github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
- github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
- github.com/Azure/go-autorest/logger v0.2.1 // indirect
- github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/NYTimes/gziphandler v1.1.1 // indirect
- github.com/PuerkitoBio/purell v1.1.1 // indirect
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
+ github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
+ github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/emicklei/go-restful/v3 v3.8.0 // indirect
+ github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
- github.com/felixge/httpsnoop v1.0.1 // indirect
- github.com/fsnotify/fsnotify v1.4.9 // indirect
+ github.com/felixge/httpsnoop v1.0.3 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
+ github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
- github.com/go-openapi/jsonreference v0.19.5 // indirect
+ github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
- github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gomarkdown/markdown v0.0.0-20200824053859-8c8b3816f167 // indirect
+ github.com/google/cel-go v0.12.5 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
- github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
- github.com/inconshreveable/mousetrap v1.0.0 // indirect
+ github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/mmarkdown/mmark v2.0.40+incompatible // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
- github.com/prometheus/client_golang v1.12.1 // indirect
- github.com/prometheus/client_model v0.2.0 // indirect
- github.com/prometheus/common v0.32.1 // indirect
- github.com/prometheus/procfs v0.7.3 // indirect
- go.etcd.io/etcd/api/v3 v3.5.4 // indirect
- go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect
- go.etcd.io/etcd/client/v3 v3.5.4 // indirect
- go.opentelemetry.io/contrib v0.20.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 // indirect
- go.opentelemetry.io/otel v0.20.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp v0.20.0 // indirect
- go.opentelemetry.io/otel/metric v0.20.0 // indirect
- go.opentelemetry.io/otel/sdk v0.20.0 // indirect
- go.opentelemetry.io/otel/sdk/export/metric v0.20.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v0.20.0 // indirect
- go.opentelemetry.io/otel/trace v0.20.0 // indirect
- go.opentelemetry.io/proto/otlp v0.7.0 // indirect
+ github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_model v0.3.0 // indirect
+ github.com/prometheus/common v0.37.0 // indirect
+ github.com/prometheus/procfs v0.8.0 // indirect
+ github.com/stoewer/go-strcase v1.2.0 // indirect
+ go.etcd.io/etcd/api/v3 v3.5.5 // indirect
+ go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
+ go.etcd.io/etcd/client/v3 v3.5.5 // indirect
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0 // indirect
+ go.opentelemetry.io/otel v1.10.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect
+ go.opentelemetry.io/otel/metric v0.31.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.10.0 // indirect
+ go.opentelemetry.io/otel/trace v1.10.0 // indirect
+ go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.0 // indirect
- golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 // indirect
- golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
- golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
- golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
+ golang.org/x/crypto v0.1.0 // indirect
+ golang.org/x/mod v0.6.0 // indirect
+ golang.org/x/net v0.1.1-0.20221027164007-c63010009c80 // indirect
+ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
- golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
- golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
- golang.org/x/text v0.3.7 // indirect
+ golang.org/x/sys v0.1.0 // indirect
+ golang.org/x/term v0.1.0 // indirect
+ golang.org/x/text v0.4.0 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
- golang.org/x/tools v0.1.12 // indirect
+ golang.org/x/tools v0.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21 // indirect
- google.golang.org/grpc v1.47.0 // indirect
- google.golang.org/protobuf v1.28.0 // indirect
+ google.golang.org/grpc v1.49.0 // indirect
+ google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
- k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 // indirect
- k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
- sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.32 // indirect
+ k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
+ k8s.io/kms v0.0.0-20221028080743-a9ba1c11c0c6 // indirect
+ k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
+ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
- sigs.k8s.io/yaml v1.2.0 // indirect
+ sigs.k8s.io/yaml v1.3.0 // indirect
)
diff --git a/go.sum b/go.sum
index 42e4ded15..5a887854b 100644
--- a/go.sum
+++ b/go.sum
@@ -13,19 +13,7 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV
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 v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
-cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
-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 h1:3DXvAyifywvq64LfkKaMOmkWPS1CikIQdMe2lY9vxU8=
-cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
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=
@@ -44,39 +32,20 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
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=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
-github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
-github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
-github.com/Azure/go-autorest/autorest v0.11.27 h1:F3R3q42aWytozkV8ihzcgMO4OA4cuqr3bNlsEuF6//A=
-github.com/Azure/go-autorest/autorest v0.11.27/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U=
-github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ=
-github.com/Azure/go-autorest/autorest/adal v0.9.20 h1:gJ3E98kMpFB1MFqQCvA1yFab8vthOeD4VlFRQULxahg=
-github.com/Azure/go-autorest/autorest/adal v0.9.20/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ=
-github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=
-github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
-github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
-github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw=
-github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU=
-github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg=
-github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
-github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
-github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
-github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
-github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
-github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
-github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
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/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
-github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
+github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 h1:yL7+Jz0jTC6yykIK/Wh74gnTJnrGr5AyrNMXuA0gves=
+github.com/antlr/antlr4/runtime/Go/antlr v1.4.10/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY=
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
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=
@@ -85,6 +54,8 @@ 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/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
+github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4=
+github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -96,10 +67,10 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
-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=
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=
@@ -107,7 +78,7 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
-github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
@@ -115,24 +86,24 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
-github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw=
-github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
+github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
+github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
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/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
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/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
-github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
-github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
+github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk=
+github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c=
-github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
-github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
+github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
+github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
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=
@@ -140,22 +111,25 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2
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-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
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 v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
+github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU=
github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+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-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A=
github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
-github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM=
-github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg=
+github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA=
+github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng=
github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
@@ -164,10 +138,9 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
-github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU=
-github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
+github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
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=
@@ -180,8 +153,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
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/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.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=
@@ -197,15 +168,15 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
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.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
-github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gomarkdown/markdown v0.0.0-20200824053859-8c8b3816f167 h1:LP/6EfrZ/LyCc+SXvANDrIJ4sP9u2NAtqyv6QknetNQ=
github.com/gomarkdown/markdown v0.0.0-20200824053859-8c8b3816f167/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU=
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/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4=
+github.com/google/cel-go v0.12.5 h1:DmzaiSgoaqGCjtpPQWl26/gND+yRpim56H1jCVev6d8=
+github.com/google/cel-go v0.12.5/go.mod h1:Jk7ljRzLBhkmiAwBoUxB1sZSCVBAzkqPF25olK/iRDw=
github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54=
github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -215,19 +186,16 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
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.3/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 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
github.com/google/gofuzz v1.1.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/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
-github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
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=
@@ -235,33 +203,26 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf
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-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
-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/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/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/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
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/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
-github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
-github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
-github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
+github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ=
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=
@@ -291,8 +252,8 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN
github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA=
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
-github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
+github.com/matttproud/golang_protobuf_extensions v1.0.2 h1:hAHbPm5IJGijwng3PWk09JkG9WeqChjprR5s9bBZ+OM=
+github.com/matttproud/golang_protobuf_extensions v1.0.2/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/mmarkdown/mmark v2.0.40+incompatible h1:vMeUeDzBK3H+/mU0oMVfMuhSXJlIA+DE/DMPQNAj5C4=
github.com/mmarkdown/mmark v2.0.40+incompatible/go.mod h1:Uvmoz7tvsWpr7bMVxIpqZPyN3FbOtzDmnsJDFp7ltJs=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -308,8 +269,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
-github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY=
-github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
+github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs=
+github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys=
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=
@@ -321,24 +282,28 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn
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.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
-github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk=
github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
+github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
+github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
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 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
+github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
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 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4=
github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
+github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE=
+github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA=
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 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
+github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
+github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@@ -348,12 +313,11 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
-github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
-github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
-github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
-github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
+github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI=
+github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
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/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU=
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
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=
@@ -362,8 +326,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
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 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -372,51 +336,46 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
-go.etcd.io/etcd/api/v3 v3.5.4 h1:OHVyt3TopwtUQ2GKdd5wu3PmmipR4FTwCqoEjSyRdIc=
-go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
-go.etcd.io/etcd/client/pkg/v3 v3.5.4 h1:lrneYvz923dvC14R54XcA7FXoZ3mlGZAgmwhfm7HqOg=
-go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
-go.etcd.io/etcd/client/v2 v2.305.4 h1:Dcx3/MYyfKcPNLpR4VVQUP5KgYrBeJtktBwEKkw08Ao=
-go.etcd.io/etcd/client/v3 v3.5.4 h1:p83BUL3tAYS0OT/r0qglgc3M1JjhM0diV8DSWAhVXv4=
-go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY=
-go.etcd.io/etcd/pkg/v3 v3.5.4 h1:V5Dvl7S39ZDwjkKqJG2BfXgxZ3QREqqKifWQgIw5IM0=
-go.etcd.io/etcd/raft/v3 v3.5.4 h1:YGrnAgRfgXloBNuqa+oBI/aRZMcK/1GS6trJePJ/Gqc=
-go.etcd.io/etcd/server/v3 v3.5.4 h1:CMAZd0g8Bn5NRhynW6pKhc4FRg41/0QYy3d7aNm9874=
+go.etcd.io/etcd/api/v3 v3.5.5 h1:BX4JIbQ7hl7+jL+g+2j5UAr0o1bctCm6/Ct+ArBGkf0=
+go.etcd.io/etcd/api/v3 v3.5.5/go.mod h1:KFtNaxGDw4Yx/BA4iPPwevUTAuqcsPxzyX8PHydchN8=
+go.etcd.io/etcd/client/pkg/v3 v3.5.5 h1:9S0JUVvmrVl7wCF39iTQthdaaNIiAaQbmK75ogO6GU8=
+go.etcd.io/etcd/client/pkg/v3 v3.5.5/go.mod h1:ggrwbk069qxpKPq8/FKkQ3Xq9y39kbFR4LnKszpRXeQ=
+go.etcd.io/etcd/client/v2 v2.305.5 h1:DktRP60//JJpnPC0VBymAN/7V71GHMdjDCBt4ZPXDjI=
+go.etcd.io/etcd/client/v3 v3.5.5 h1:q++2WTJbUgpQu4B6hCuT7VkdwaTP7Qz6Daak3WzbrlI=
+go.etcd.io/etcd/client/v3 v3.5.5/go.mod h1:aApjR4WGlSumpnJ2kloS75h6aHUmAyaPLjHMxpc7E7c=
+go.etcd.io/etcd/pkg/v3 v3.5.5 h1:Ablg7T7OkR+AeeeU32kdVhw/AGDsitkKPl7aW73ssjU=
+go.etcd.io/etcd/raft/v3 v3.5.5 h1:Ibz6XyZ60OYyRopu73lLM/P+qco3YtlZMOhnXNS051I=
+go.etcd.io/etcd/server/v3 v3.5.5 h1:jNjYm/9s+f9A9r6+SC4RvNaz6AqixpOvhrFdT0PvIj0=
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.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
-go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
-go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0=
-go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 h1:sO4WKdPAudZGKPcpZT4MJn6JaDmpyLrMPDGGyA1SttE=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0 h1:Q3C9yzW6I9jqEc8sawxzxZmY48fs9u220KXq6d5s3XU=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4=
-go.opentelemetry.io/otel v0.20.0 h1:eaP0Fqu7SXHwvjiqDq83zImeehOHX8doTvU9AwXON8g=
-go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo=
-go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg=
-go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM=
-go.opentelemetry.io/otel/metric v0.20.0 h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8=
-go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU=
-go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw=
-go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw=
-go.opentelemetry.io/otel/sdk v0.20.0 h1:JsxtGXd06J8jrnya7fdI/U/MR6yXA5DtbZy+qoHQlr8=
-go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc=
-go.opentelemetry.io/otel/sdk/export/metric v0.20.0 h1:c5VRjxCXdQlx1HjzwGdQHzZaVI82b5EbBgOu2ljD92g=
-go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE=
-go.opentelemetry.io/otel/sdk/metric v0.20.0 h1:7ao1wpzHRVKf0OQ7GIxiQJA6X7DLX9o14gmVon7mMK8=
-go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE=
-go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw=
-go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw=
-go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0 h1:xFSRQBbXF6VvYRf2lqMJXxoB72XI1K/azav8TekHHSw=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0/go.mod h1:h8TWwRAhQpOd0aM5nYsRD8+flnkj+526GEIVlarH7eY=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0 h1:Ajldaqhxqw/gNzQA45IKFWLdG7jZuXX/wBW1d5qvbUI=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0/go.mod h1:9NiG9I2aHTKkcxqCILhjtyNA1QEiCjdBACv4IvrFQ+c=
+go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4=
+go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ=
+go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y=
+go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0/go.mod h1:Krqnjl22jUJ0HgMzw5eveuCvFDXY4nSYb4F8t5gdrag=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0/go.mod h1:OfUCyyIiDvNXHWpcWgbF+MWvqPZiNa3YDEnivcnYsV0=
+go.opentelemetry.io/otel/metric v0.31.0 h1:6SiklT+gfWAwWUR0meEMxQBtihpiEs4c+vL9spDTqUs=
+go.opentelemetry.io/otel/metric v0.31.0/go.mod h1:ohmwj9KTSIeBnDBm/ZwH2PSZxZzoOaG2xZeekTRzL5A=
+go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY=
+go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE=
+go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
+go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
+go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
+go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
-go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
+go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
@@ -429,10 +388,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
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-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-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
-golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 h1:SLP7Q4Di66FONjDJbCYrCRrh97focO6sLogHO7/g8F0=
-golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
+golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
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=
@@ -455,8 +412,6 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl
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/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-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
@@ -466,11 +421,9 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
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.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.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
-golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I=
+golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
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=
@@ -485,7 +438,6 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL
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-20190827160401-ba9fcec4b297/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=
@@ -501,35 +453,21 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R
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-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
-golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/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-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
-golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/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 h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
-golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+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.1.1-0.20221027164007-c63010009c80 h1:CtRWmqbiPSOXwJV1JoY7pWiTx2xzVKQ813bvU+Y/9jI=
+golang.org/x/net v0.1.1-0.20221027164007-c63010009c80/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
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-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
-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-20210514164344-f6687ab2804c/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 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg=
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b h1:clP8eMhB30EHdc0bd2Twtq6kgU7yl5ub2cQLSdrv1Dg=
+golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
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=
@@ -556,7 +494,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
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-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/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=
@@ -575,46 +512,35 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w
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-20200905004654-be1d3432aa8f/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-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/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-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-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/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-20210514084401-e8d321eab015/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-20210603125802-9665404d3644/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-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-20211216021012-1d35b9e2eb4e/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-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
-golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/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 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
+golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
-golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
+golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
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.4/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 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
+golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
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=
@@ -663,24 +589,13 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY
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-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
-golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
-golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/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/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
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.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
-golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
-golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
+golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
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 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
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=
@@ -698,18 +613,6 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M
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/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
-google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
-google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
-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.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
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=
@@ -748,32 +651,9 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc
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-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-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-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-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-20220502173005-c8bf987b8c21 h1:hrbNEivu7Zn1pxvHk6MBrq9iE22woVILTHqexqBxe6I=
google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
@@ -788,23 +668,15 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa
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.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
-google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
-google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
-google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
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.38.0/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.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k=
+google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
-google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8=
-google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
-google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
+google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw=
+google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
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=
@@ -818,8 +690,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
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.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
+google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
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=
@@ -852,40 +725,42 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
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=
-k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0=
-k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk=
-k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU=
-k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0=
-k8s.io/apiserver v0.25.0 h1:8kl2ifbNffD440MyvHtPaIz1mw4mGKVgWqM0nL+oyu4=
-k8s.io/apiserver v0.25.0/go.mod h1:BKwsE+PTC+aZK+6OJQDPr0v6uS91/HWxX7evElAH6xo=
-k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E=
-k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8=
-k8s.io/code-generator v0.25.0 h1:QP8fJuXu882ztf6dsqJsso/Btm94pMd68TAZC1rE6KI=
-k8s.io/code-generator v0.25.0/go.mod h1:B6jZgI3DvDFAualltPitbYMQ74NjaCFxum3YeKZZ+3w=
-k8s.io/component-base v0.25.0 h1:haVKlLkPCFZhkcqB6WCvpVxftrg6+FK5x1ZuaIDaQ5Y=
-k8s.io/component-base v0.25.0/go.mod h1:F2Sumv9CnbBlqrpdf7rKZTmmd2meJq0HizeyY/yAFxk=
-k8s.io/component-helpers v0.25.0 h1:vNzYfqnVXj7f+CPksduKVv2Z9kC+IDsOs9yaOyxZrj0=
-k8s.io/component-helpers v0.25.0/go.mod h1:auaFj2bvb5Zmy0mLk4WJNmwP0w4e7Zk+/Tu9FFBGA20=
-k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 h1:TT1WdmqqXareKxZ/oNXEUSwKlLiHzPMyB0t8BaFeBYI=
-k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
-k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
+k8s.io/api v0.26.0-rc.1 h1:CAdJgdbab07D/NLFAh+gvdZ7SpmZ1Ofl9H7VeH8ET40=
+k8s.io/api v0.26.0-rc.1/go.mod h1:jkiQnWZq3gb350ta8dyocZlioyShoDL8+Opgr/lKG2g=
+k8s.io/apimachinery v0.26.0-rc.1 h1:KSPpcG3g7J9rW6VhELgtEaGHYV4AOgzcHSaS/m/4K2Q=
+k8s.io/apimachinery v0.26.0-rc.1/go.mod h1:VXMmlsE7YRJ5vyAyWpkKIfFkEbDNpVs0ObpkuQf1WfM=
+k8s.io/apiserver v0.26.0-rc.1 h1:hDKrjd3ReD+/We9WhbAE5Hsub+x3nSxDakHASXc5hsA=
+k8s.io/apiserver v0.26.0-rc.1/go.mod h1:ktE+6QySfVd7KkPa8nZWWZTBO5xC70RrLG7wRvBDn9A=
+k8s.io/client-go v0.26.0-rc.1 h1:KQmd73Pg7mLTzPZGxb967wHCYthORZ9+KWAL99YvBzY=
+k8s.io/client-go v0.26.0-rc.1/go.mod h1:hMmdXz7ni/DIoKfCshx9ioejmtSOXV7J7Zpc3pkxbn8=
+k8s.io/code-generator v0.26.0-rc.1 h1:RMdHiP4Dhrg4G5liuCVFTtjMNjz4N+NojIag/ZqMA18=
+k8s.io/code-generator v0.26.0-rc.1/go.mod h1:EzIGoP4u7NcVT4orMRQyvQcWqFCUVApa+V+28R7t/+M=
+k8s.io/component-base v0.26.0-rc.1 h1:FoK7c9mcJn4CRAGhfd/6Fsl25OOHIldVYaPZxgwDF24=
+k8s.io/component-base v0.26.0-rc.1/go.mod h1:2YJ4nmUK5Y9subjnTomohvv0OwmQluewc4FtyAAFFiQ=
+k8s.io/component-helpers v0.26.0-rc.1 h1:D6GpUyZmSHLaBIJ2BuGkMU15qn/96E1qMnAM1wP1WPw=
+k8s.io/component-helpers v0.26.0-rc.1/go.mod h1:OMwqunFVrPCTw22oLKa6Ad8SCP7bB7u7Sev0gakNGaw=
+k8s.io/gengo v0.0.0-20220902162205-c0856e24416d h1:U9tB195lKdzwqicbJvyJeOXV7Klv+wNAWENRnXEGi08=
+k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=
-k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ=
-k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
-k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA=
-k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU=
-k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73 h1:H9TCJUUx+2VA0ZiD9lvtaX8fthFsMoD+Izn93E/hm8U=
-k8s.io/utils v0.0.0-20220823124924-e9cbc92d1a73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
+k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
+k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
+k8s.io/kms v0.0.0-20221028080743-a9ba1c11c0c6 h1:d/x+J+EPT4UkD2pH39Ms5xKo1IVDfYlzoxowFd99tFg=
+k8s.io/kms v0.0.0-20221028080743-a9ba1c11c0c6/go.mod h1:cvW8uNcFX5HPpTk6XURAIylLjIzrE7ACcRGt0HRL7eI=
+k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E=
+k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4=
+k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y=
+k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
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=
-sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.32 h1:2WjukG7txtEsbXsSKWtTibCdsyYAhcu6KFnttyDdZOQ=
-sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.32/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33 h1:LYqFq+6Cj2D0gFfrJvL7iElD4ET6ir3VDdhDdTK7rgc=
+sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.33/go.mod h1:soWkSNf2tZC7aMibXEqVhCd73GOY5fJikn8qbdzemB0=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/mdtoc v1.0.1 h1:6ECKhQnbetwZBR6R2IeT2LH+1w+2Zsip0iXjikgaXIk=
sigs.k8s.io/mdtoc v1.0.1/go.mod h1:COYBtOjsaCg7o7SC4eaLwEXPuVRSuiVuLLRrHd7kShw=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E=
-sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
+sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
+sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
diff --git a/vendor/cloud.google.com/go/compute/metadata/metadata.go b/vendor/cloud.google.com/go/compute/metadata/metadata.go
deleted file mode 100644
index b6e1f7b61..000000000
--- a/vendor/cloud.google.com/go/compute/metadata/metadata.go
+++ /dev/null
@@ -1,536 +0,0 @@
-// Copyright 2014 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.
-
-// Package metadata provides access to Google Compute Engine (GCE)
-// metadata and API service accounts.
-//
-// This package is a wrapper around the GCE metadata service,
-// as documented at https://developers.google.com/compute/docs/metadata.
-package metadata // import "cloud.google.com/go/compute/metadata"
-
-import (
- "context"
- "encoding/json"
- "fmt"
- "io/ioutil"
- "net"
- "net/http"
- "net/url"
- "os"
- "runtime"
- "strings"
- "sync"
- "time"
-)
-
-const (
- // metadataIP is the documented metadata server IP address.
- metadataIP = "169.254.169.254"
-
- // metadataHostEnv is the environment variable specifying the
- // GCE metadata hostname. If empty, the default value of
- // metadataIP ("169.254.169.254") is used instead.
- // This is variable name is not defined by any spec, as far as
- // I know; it was made up for the Go package.
- metadataHostEnv = "GCE_METADATA_HOST"
-
- userAgent = "gcloud-golang/0.1"
-)
-
-type cachedValue struct {
- k string
- trim bool
- mu sync.Mutex
- v string
-}
-
-var (
- projID = &cachedValue{k: "project/project-id", trim: true}
- projNum = &cachedValue{k: "project/numeric-project-id", trim: true}
- instID = &cachedValue{k: "instance/id", trim: true}
-)
-
-var defaultClient = &Client{hc: &http.Client{
- Transport: &http.Transport{
- Dial: (&net.Dialer{
- Timeout: 2 * time.Second,
- KeepAlive: 30 * time.Second,
- }).Dial,
- },
-}}
-
-// NotDefinedError is returned when requested metadata is not defined.
-//
-// The underlying string is the suffix after "/computeMetadata/v1/".
-//
-// This error is not returned if the value is defined to be the empty
-// string.
-type NotDefinedError string
-
-func (suffix NotDefinedError) Error() string {
- return fmt.Sprintf("metadata: GCE metadata %q not defined", string(suffix))
-}
-
-func (c *cachedValue) get(cl *Client) (v string, err error) {
- defer c.mu.Unlock()
- c.mu.Lock()
- if c.v != "" {
- return c.v, nil
- }
- if c.trim {
- v, err = cl.getTrimmed(c.k)
- } else {
- v, err = cl.Get(c.k)
- }
- if err == nil {
- c.v = v
- }
- return
-}
-
-var (
- onGCEOnce sync.Once
- onGCE bool
-)
-
-// OnGCE reports whether this process is running on Google Compute Engine.
-func OnGCE() bool {
- onGCEOnce.Do(initOnGCE)
- return onGCE
-}
-
-func initOnGCE() {
- onGCE = testOnGCE()
-}
-
-func testOnGCE() bool {
- // The user explicitly said they're on GCE, so trust them.
- if os.Getenv(metadataHostEnv) != "" {
- return true
- }
-
- ctx, cancel := context.WithCancel(context.Background())
- defer cancel()
-
- resc := make(chan bool, 2)
-
- // Try two strategies in parallel.
- // See https://github.com/googleapis/google-cloud-go/issues/194
- go func() {
- req, _ := http.NewRequest("GET", "http://"+metadataIP, nil)
- req.Header.Set("User-Agent", userAgent)
- res, err := defaultClient.hc.Do(req.WithContext(ctx))
- if err != nil {
- resc <- false
- return
- }
- defer res.Body.Close()
- resc <- res.Header.Get("Metadata-Flavor") == "Google"
- }()
-
- go func() {
- addrs, err := net.DefaultResolver.LookupHost(ctx, "metadata.google.internal")
- if err != nil || len(addrs) == 0 {
- resc <- false
- return
- }
- resc <- strsContains(addrs, metadataIP)
- }()
-
- tryHarder := systemInfoSuggestsGCE()
- if tryHarder {
- res := <-resc
- if res {
- // The first strategy succeeded, so let's use it.
- return true
- }
- // Wait for either the DNS or metadata server probe to
- // contradict the other one and say we are running on
- // GCE. Give it a lot of time to do so, since the system
- // info already suggests we're running on a GCE BIOS.
- timer := time.NewTimer(5 * time.Second)
- defer timer.Stop()
- select {
- case res = <-resc:
- return res
- case <-timer.C:
- // Too slow. Who knows what this system is.
- return false
- }
- }
-
- // There's no hint from the system info that we're running on
- // GCE, so use the first probe's result as truth, whether it's
- // true or false. The goal here is to optimize for speed for
- // users who are NOT running on GCE. We can't assume that
- // either a DNS lookup or an HTTP request to a blackholed IP
- // address is fast. Worst case this should return when the
- // metaClient's Transport.ResponseHeaderTimeout or
- // Transport.Dial.Timeout fires (in two seconds).
- return <-resc
-}
-
-// systemInfoSuggestsGCE reports whether the local system (without
-// doing network requests) suggests that we're running on GCE. If this
-// returns true, testOnGCE tries a bit harder to reach its metadata
-// server.
-func systemInfoSuggestsGCE() bool {
- if runtime.GOOS != "linux" {
- // We don't have any non-Linux clues available, at least yet.
- return false
- }
- slurp, _ := ioutil.ReadFile("/sys/class/dmi/id/product_name")
- name := strings.TrimSpace(string(slurp))
- return name == "Google" || name == "Google Compute Engine"
-}
-
-// Subscribe calls Client.Subscribe on the default client.
-func Subscribe(suffix string, fn func(v string, ok bool) error) error {
- return defaultClient.Subscribe(suffix, fn)
-}
-
-// Get calls Client.Get on the default client.
-func Get(suffix string) (string, error) { return defaultClient.Get(suffix) }
-
-// ProjectID returns the current instance's project ID string.
-func ProjectID() (string, error) { return defaultClient.ProjectID() }
-
-// NumericProjectID returns the current instance's numeric project ID.
-func NumericProjectID() (string, error) { return defaultClient.NumericProjectID() }
-
-// InternalIP returns the instance's primary internal IP address.
-func InternalIP() (string, error) { return defaultClient.InternalIP() }
-
-// ExternalIP returns the instance's primary external (public) IP address.
-func ExternalIP() (string, error) { return defaultClient.ExternalIP() }
-
-// Email calls Client.Email on the default client.
-func Email(serviceAccount string) (string, error) { return defaultClient.Email(serviceAccount) }
-
-// Hostname returns the instance's hostname. This will be of the form
-// ".c..internal".
-func Hostname() (string, error) { return defaultClient.Hostname() }
-
-// InstanceTags returns the list of user-defined instance tags,
-// assigned when initially creating a GCE instance.
-func InstanceTags() ([]string, error) { return defaultClient.InstanceTags() }
-
-// InstanceID returns the current VM's numeric instance ID.
-func InstanceID() (string, error) { return defaultClient.InstanceID() }
-
-// InstanceName returns the current VM's instance ID string.
-func InstanceName() (string, error) { return defaultClient.InstanceName() }
-
-// Zone returns the current VM's zone, such as "us-central1-b".
-func Zone() (string, error) { return defaultClient.Zone() }
-
-// InstanceAttributes calls Client.InstanceAttributes on the default client.
-func InstanceAttributes() ([]string, error) { return defaultClient.InstanceAttributes() }
-
-// ProjectAttributes calls Client.ProjectAttributes on the default client.
-func ProjectAttributes() ([]string, error) { return defaultClient.ProjectAttributes() }
-
-// InstanceAttributeValue calls Client.InstanceAttributeValue on the default client.
-func InstanceAttributeValue(attr string) (string, error) {
- return defaultClient.InstanceAttributeValue(attr)
-}
-
-// ProjectAttributeValue calls Client.ProjectAttributeValue on the default client.
-func ProjectAttributeValue(attr string) (string, error) {
- return defaultClient.ProjectAttributeValue(attr)
-}
-
-// Scopes calls Client.Scopes on the default client.
-func Scopes(serviceAccount string) ([]string, error) { return defaultClient.Scopes(serviceAccount) }
-
-func strsContains(ss []string, s string) bool {
- for _, v := range ss {
- if v == s {
- return true
- }
- }
- return false
-}
-
-// A Client provides metadata.
-type Client struct {
- hc *http.Client
-}
-
-// NewClient returns a Client that can be used to fetch metadata.
-// Returns the client that uses the specified http.Client for HTTP requests.
-// If nil is specified, returns the default client.
-func NewClient(c *http.Client) *Client {
- if c == nil {
- return defaultClient
- }
-
- return &Client{hc: c}
-}
-
-// getETag returns a value from the metadata service as well as the associated ETag.
-// This func is otherwise equivalent to Get.
-func (c *Client) getETag(suffix string) (value, etag string, err error) {
- ctx := context.TODO()
- // Using a fixed IP makes it very difficult to spoof the metadata service in
- // a container, which is an important use-case for local testing of cloud
- // deployments. To enable spoofing of the metadata service, the environment
- // variable GCE_METADATA_HOST is first inspected to decide where metadata
- // requests shall go.
- host := os.Getenv(metadataHostEnv)
- if host == "" {
- // Using 169.254.169.254 instead of "metadata" here because Go
- // binaries built with the "netgo" tag and without cgo won't
- // know the search suffix for "metadata" is
- // ".google.internal", and this IP address is documented as
- // being stable anyway.
- host = metadataIP
- }
- suffix = strings.TrimLeft(suffix, "/")
- u := "http://" + host + "/computeMetadata/v1/" + suffix
- req, err := http.NewRequest("GET", u, nil)
- if err != nil {
- return "", "", err
- }
- req.Header.Set("Metadata-Flavor", "Google")
- req.Header.Set("User-Agent", userAgent)
- var res *http.Response
- var reqErr error
- retryer := newRetryer()
- for {
- res, reqErr = c.hc.Do(req)
- var code int
- if res != nil {
- code = res.StatusCode
- }
- if delay, shouldRetry := retryer.Retry(code, reqErr); shouldRetry {
- if err := sleep(ctx, delay); err != nil {
- return "", "", err
- }
- continue
- }
- break
- }
- if reqErr != nil {
- return "", "", nil
- }
- defer res.Body.Close()
- if res.StatusCode == http.StatusNotFound {
- return "", "", NotDefinedError(suffix)
- }
- all, err := ioutil.ReadAll(res.Body)
- if err != nil {
- return "", "", err
- }
- if res.StatusCode != 200 {
- return "", "", &Error{Code: res.StatusCode, Message: string(all)}
- }
- return string(all), res.Header.Get("Etag"), nil
-}
-
-// Get returns a value from the metadata service.
-// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/".
-//
-// If the GCE_METADATA_HOST environment variable is not defined, a default of
-// 169.254.169.254 will be used instead.
-//
-// If the requested metadata is not defined, the returned error will
-// be of type NotDefinedError.
-func (c *Client) Get(suffix string) (string, error) {
- val, _, err := c.getETag(suffix)
- return val, err
-}
-
-func (c *Client) getTrimmed(suffix string) (s string, err error) {
- s, err = c.Get(suffix)
- s = strings.TrimSpace(s)
- return
-}
-
-func (c *Client) lines(suffix string) ([]string, error) {
- j, err := c.Get(suffix)
- if err != nil {
- return nil, err
- }
- s := strings.Split(strings.TrimSpace(j), "\n")
- for i := range s {
- s[i] = strings.TrimSpace(s[i])
- }
- return s, nil
-}
-
-// ProjectID returns the current instance's project ID string.
-func (c *Client) ProjectID() (string, error) { return projID.get(c) }
-
-// NumericProjectID returns the current instance's numeric project ID.
-func (c *Client) NumericProjectID() (string, error) { return projNum.get(c) }
-
-// InstanceID returns the current VM's numeric instance ID.
-func (c *Client) InstanceID() (string, error) { return instID.get(c) }
-
-// InternalIP returns the instance's primary internal IP address.
-func (c *Client) InternalIP() (string, error) {
- return c.getTrimmed("instance/network-interfaces/0/ip")
-}
-
-// Email returns the email address associated with the service account.
-// The account may be empty or the string "default" to use the instance's
-// main account.
-func (c *Client) Email(serviceAccount string) (string, error) {
- if serviceAccount == "" {
- serviceAccount = "default"
- }
- return c.getTrimmed("instance/service-accounts/" + serviceAccount + "/email")
-}
-
-// ExternalIP returns the instance's primary external (public) IP address.
-func (c *Client) ExternalIP() (string, error) {
- return c.getTrimmed("instance/network-interfaces/0/access-configs/0/external-ip")
-}
-
-// Hostname returns the instance's hostname. This will be of the form
-// ".c..internal".
-func (c *Client) Hostname() (string, error) {
- return c.getTrimmed("instance/hostname")
-}
-
-// InstanceTags returns the list of user-defined instance tags,
-// assigned when initially creating a GCE instance.
-func (c *Client) InstanceTags() ([]string, error) {
- var s []string
- j, err := c.Get("instance/tags")
- if err != nil {
- return nil, err
- }
- if err := json.NewDecoder(strings.NewReader(j)).Decode(&s); err != nil {
- return nil, err
- }
- return s, nil
-}
-
-// InstanceName returns the current VM's instance ID string.
-func (c *Client) InstanceName() (string, error) {
- return c.getTrimmed("instance/name")
-}
-
-// Zone returns the current VM's zone, such as "us-central1-b".
-func (c *Client) Zone() (string, error) {
- zone, err := c.getTrimmed("instance/zone")
- // zone is of the form "projects//zones/".
- if err != nil {
- return "", err
- }
- return zone[strings.LastIndex(zone, "/")+1:], nil
-}
-
-// InstanceAttributes returns the list of user-defined attributes,
-// assigned when initially creating a GCE VM instance. The value of an
-// attribute can be obtained with InstanceAttributeValue.
-func (c *Client) InstanceAttributes() ([]string, error) { return c.lines("instance/attributes/") }
-
-// ProjectAttributes returns the list of user-defined attributes
-// applying to the project as a whole, not just this VM. The value of
-// an attribute can be obtained with ProjectAttributeValue.
-func (c *Client) ProjectAttributes() ([]string, error) { return c.lines("project/attributes/") }
-
-// InstanceAttributeValue returns the value of the provided VM
-// instance attribute.
-//
-// If the requested attribute is not defined, the returned error will
-// be of type NotDefinedError.
-//
-// InstanceAttributeValue may return ("", nil) if the attribute was
-// defined to be the empty string.
-func (c *Client) InstanceAttributeValue(attr string) (string, error) {
- return c.Get("instance/attributes/" + attr)
-}
-
-// ProjectAttributeValue returns the value of the provided
-// project attribute.
-//
-// If the requested attribute is not defined, the returned error will
-// be of type NotDefinedError.
-//
-// ProjectAttributeValue may return ("", nil) if the attribute was
-// defined to be the empty string.
-func (c *Client) ProjectAttributeValue(attr string) (string, error) {
- return c.Get("project/attributes/" + attr)
-}
-
-// Scopes returns the service account scopes for the given account.
-// The account may be empty or the string "default" to use the instance's
-// main account.
-func (c *Client) Scopes(serviceAccount string) ([]string, error) {
- if serviceAccount == "" {
- serviceAccount = "default"
- }
- return c.lines("instance/service-accounts/" + serviceAccount + "/scopes")
-}
-
-// Subscribe subscribes to a value from the metadata service.
-// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/".
-// The suffix may contain query parameters.
-//
-// Subscribe calls fn with the latest metadata value indicated by the provided
-// suffix. If the metadata value is deleted, fn is called with the empty string
-// and ok false. Subscribe blocks until fn returns a non-nil error or the value
-// is deleted. Subscribe returns the error value returned from the last call to
-// fn, which may be nil when ok == false.
-func (c *Client) Subscribe(suffix string, fn func(v string, ok bool) error) error {
- const failedSubscribeSleep = time.Second * 5
-
- // First check to see if the metadata value exists at all.
- val, lastETag, err := c.getETag(suffix)
- if err != nil {
- return err
- }
-
- if err := fn(val, true); err != nil {
- return err
- }
-
- ok := true
- if strings.ContainsRune(suffix, '?') {
- suffix += "&wait_for_change=true&last_etag="
- } else {
- suffix += "?wait_for_change=true&last_etag="
- }
- for {
- val, etag, err := c.getETag(suffix + url.QueryEscape(lastETag))
- if err != nil {
- if _, deleted := err.(NotDefinedError); !deleted {
- time.Sleep(failedSubscribeSleep)
- continue // Retry on other errors.
- }
- ok = false
- }
- lastETag = etag
-
- if err := fn(val, ok); err != nil || !ok {
- return err
- }
- }
-}
-
-// Error contains an error response from the server.
-type Error struct {
- // Code is the HTTP response status code.
- Code int
- // Message is the server response message.
- Message string
-}
-
-func (e *Error) Error() string {
- return fmt.Sprintf("compute: Received %d `%s`", e.Code, e.Message)
-}
diff --git a/vendor/cloud.google.com/go/compute/metadata/retry.go b/vendor/cloud.google.com/go/compute/metadata/retry.go
deleted file mode 100644
index 0f18f3cda..000000000
--- a/vendor/cloud.google.com/go/compute/metadata/retry.go
+++ /dev/null
@@ -1,114 +0,0 @@
-// Copyright 2021 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.
-
-package metadata
-
-import (
- "context"
- "io"
- "math/rand"
- "net/http"
- "time"
-)
-
-const (
- maxRetryAttempts = 5
-)
-
-var (
- syscallRetryable = func(err error) bool { return false }
-)
-
-// defaultBackoff is basically equivalent to gax.Backoff without the need for
-// the dependency.
-type defaultBackoff struct {
- max time.Duration
- mul float64
- cur time.Duration
-}
-
-func (b *defaultBackoff) Pause() time.Duration {
- d := time.Duration(1 + rand.Int63n(int64(b.cur)))
- b.cur = time.Duration(float64(b.cur) * b.mul)
- if b.cur > b.max {
- b.cur = b.max
- }
- return d
-}
-
-// sleep is the equivalent of gax.Sleep without the need for the dependency.
-func sleep(ctx context.Context, d time.Duration) error {
- t := time.NewTimer(d)
- select {
- case <-ctx.Done():
- t.Stop()
- return ctx.Err()
- case <-t.C:
- return nil
- }
-}
-
-func newRetryer() *metadataRetryer {
- return &metadataRetryer{bo: &defaultBackoff{
- cur: 100 * time.Millisecond,
- max: 30 * time.Second,
- mul: 2,
- }}
-}
-
-type backoff interface {
- Pause() time.Duration
-}
-
-type metadataRetryer struct {
- bo backoff
- attempts int
-}
-
-func (r *metadataRetryer) Retry(status int, err error) (time.Duration, bool) {
- if status == http.StatusOK {
- return 0, false
- }
- retryOk := shouldRetry(status, err)
- if !retryOk {
- return 0, false
- }
- if r.attempts == maxRetryAttempts {
- return 0, false
- }
- r.attempts++
- return r.bo.Pause(), true
-}
-
-func shouldRetry(status int, err error) bool {
- if 500 <= status && status <= 599 {
- return true
- }
- if err == io.ErrUnexpectedEOF {
- return true
- }
- // Transient network errors should be retried.
- if syscallRetryable(err) {
- return true
- }
- if err, ok := err.(interface{ Temporary() bool }); ok {
- if err.Temporary() {
- return true
- }
- }
- if err, ok := err.(interface{ Unwrap() error }); ok {
- return shouldRetry(status, err.Unwrap())
- }
- return false
-}
diff --git a/vendor/github.com/Azure/go-autorest/CHANGELOG.md b/vendor/github.com/Azure/go-autorest/CHANGELOG.md
deleted file mode 100644
index d1f596bfc..000000000
--- a/vendor/github.com/Azure/go-autorest/CHANGELOG.md
+++ /dev/null
@@ -1,1004 +0,0 @@
-# CHANGELOG
-
-## v14.2.0
-
-- Added package comment to make `github.com/Azure/go-autorest` importable.
-
-## v14.1.1
-
-### Bug Fixes
-
-- Change `x-ms-authorization-auxiliary` header value separator to comma.
-
-## v14.1.0
-
-### New Features
-
-- Added `azure.SetEnvironment()` that will update the global environments map with the specified values.
-
-## v14.0.1
-
-### Bug Fixes
-
-- Fix race condition when refreshing token.
-- Fixed some tests to work with Go 1.14.
-
-## v14.0.0
-
-## Breaking Changes
-
-- By default, the `DoRetryForStatusCodes` functions will no longer infinitely retry a request when the response returns an HTTP status code of 429 (StatusTooManyRequests). To opt in to the old behavior set `autorest.Count429AsRetry` to `false`.
-
-## New Features
-
-- Variable `autorest.Max429Delay` can be used to control the maximum delay between retries when a 429 is received with no `Retry-After` header. The default is zero which means there is no cap.
-
-## v13.4.0
-
-## New Features
-
-- Added field `SendDecorators` to the `Client` type. This can be used to specify a custom chain of SendDecorators per client.
-- Added method `Client.Send()` which includes logic for selecting the preferred chain of SendDecorators.
-
-## v13.3.3
-
-### Bug Fixes
-
-- Fixed connection leak when retrying requests.
-- Enabled exponential back-off with a 2-minute cap when retrying on 429.
-- Fixed some cases where errors were inadvertently dropped.
-
-## v13.3.2
-
-### Bug Fixes
-
-- Updated `autorest.AsStringSlice()` to convert slice elements to their string representation.
-
-## v13.3.1
-
-- Updated external dependencies.
-
-### Bug Fixes
-
-## v13.3.0
-
-### New Features
-
-- Added support for shared key and shared access signature token authorization.
- - `autorest.NewSharedKeyAuthorizer()` and dependent types.
- - `autorest.NewSASTokenAuthorizer()` and dependent types.
-- Added `ServicePrincipalToken.SetCustomRefresh()` so a custom refresh function can be invoked when a token has expired.
-
-### Bug Fixes
-
-- Fixed `cli.AccessTokensPath()` to respect `AZURE_CONFIG_DIR` when set.
-- Support parsing error messages in XML responses.
-
-## v13.2.0
-
-### New Features
-
-- Added the following functions to replace their versions that don't take a context.
- - `adal.InitiateDeviceAuthWithContext()`
- - `adal.CheckForUserCompletionWithContext()`
- - `adal.WaitForUserCompletionWithContext()`
-
-## v13.1.0
-
-### New Features
-
-- Added support for MSI authentication on Azure App Service and Azure Functions.
-
-## v13.0.2
-
-### Bug Fixes
-
-- Always retry a request even if the sender returns a non-nil error.
-
-## v13.0.1
-
-## Bug Fixes
-
-- Fixed `autorest.WithQueryParameters()` so that it properly encodes multi-value query parameters.
-
-## v13.0.0
-
-## Breaking Changes
-
-The `tracing` package has been rewritten to provide a common interface for consumers to wire in the tracing package of their choice.
-What this means is that by default no tracing provider will be compiled into your program and setting the `AZURE_SDK_TRACING_ENABLED`
-environment variable will have no effect. To enable this previous behavior you must now add the following import to your source file.
-```go
- import _ "github.com/Azure/go-autorest/tracing/opencensus"
-```
-The APIs required by autorest-generated code have remained but some APIs have been removed and new ones added.
-The following APIs and variables have been removed (the majority of them were moved to the `opencensus` package).
-- tracing.Transport
-- tracing.Enable()
-- tracing.EnableWithAIForwarding()
-- tracing.Disable()
-
-The following APIs and types have been added
-- tracing.Tracer
-- tracing.Register()
-
-To hook up a tracer simply call `tracing.Register()` passing in a type that satisfies the `tracing.Tracer` interface.
-
-## v12.4.3
-
-### Bug Fixes
-
-- `autorest.MultiTenantServicePrincipalTokenAuthorizer` will now properly add its auxiliary bearer tokens.
-
-## v12.4.2
-
-### Bug Fixes
-
-- Improvements to the fixes made in v12.4.1.
- - Remove `override` stanza from Gopkg.toml and `replace` directive from go.mod as they don't apply when being consumed as a dependency.
- - Switched to latest version of `ocagent` that still depends on protobuf v1.2.
- - Add indirect dependencies to the `required` clause with matching `constraint` stanzas so that `dep` dependencies match go.sum.
-
-## v12.4.1
-
-### Bug Fixes
-
-- Updated OpenCensus and OCAgent versions to versions that don't depend on v1.3+ of protobuf as it was breaking kubernetes.
-- Pinned opencensus-proto to a version that's compatible with our versions of OpenCensus and OCAgent.
-
-## v12.4.0
-
-### New Features
-
-- Added `autorest.WithPrepareDecorators` and `autorest.GetPrepareDecorators` for adding and retrieving a custom chain of PrepareDecorators to the provided context.
-
-## v12.3.0
-
-### New Features
-
-- Support for multi-tenant via x-ms-authorization-auxiliary header has been added for client credentials with
- secret scenario; this basically bundles multiple OAuthConfig and ServicePrincipalToken types into corresponding
- MultiTenant* types along with a new authorizer that adds the primary and auxiliary token headers to the reqest.
- The authenticaion helpers have been updated to support this scenario; if environment var AZURE_AUXILIARY_TENANT_IDS
- is set with a semicolon delimited list of tenants the multi-tenant codepath will kick in to create the appropriate authorizer.
- See `adal.NewMultiTenantOAuthConfig`, `adal.NewMultiTenantServicePrincipalToken` and `autorest.NewMultiTenantServicePrincipalTokenAuthorizer`
- along with their supporting types and methods.
-- Added `autorest.WithSendDecorators` and `autorest.GetSendDecorators` for adding and retrieving a custom chain of SendDecorators to the provided context.
-- Added `autorest.DoRetryForStatusCodesWithCap` and `autorest.DelayForBackoffWithCap` to enforce an upper bound on the duration between retries.
-
-## v12.2.0
-
-### New Features
-
-- Added `autorest.WithXML`, `autorest.AsMerge`, `autorest.WithBytes` preparer decorators.
-- Added `autorest.ByUnmarshallingBytes` response decorator.
-- Added `Response.IsHTTPStatus` and `Response.HasHTTPStatus` helper methods for inspecting HTTP status code in `autorest.Response` types.
-
-### Bug Fixes
-
-- `autorest.DelayWithRetryAfter` now supports HTTP-Dates in the `Retry-After` header and is not limited to just 429 status codes.
-
-## v12.1.0
-
-### New Features
-
-- Added `to.ByteSlicePtr()`.
-- Added blob/queue storage resource ID to `azure.ResourceIdentifier`.
-
-## v12.0.0
-
-### Breaking Changes
-
-In preparation for modules the following deprecated content has been removed.
-
- - async.NewFuture()
- - async.Future.Done()
- - async.Future.WaitForCompletion()
- - async.DoPollForAsynchronous()
- - The `utils` package
- - validation.NewErrorWithValidationError()
- - The `version` package
-
-## v11.9.0
-
-### New Features
-
-- Add `ResourceIdentifiers` field to `azure.Environment` containing resource IDs for public and sovereign clouds.
-
-## v11.8.0
-
-### New Features
-
-- Added `autorest.NewClientWithOptions()` to support endpoints that require free renegotiation.
-
-## v11.7.1
-
-### Bug Fixes
-
-- Fix missing support for http(s) proxy when using the default sender.
-
-## v11.7.0
-
-### New Features
-
-- Added methods to obtain a ServicePrincipalToken on the various credential configuration types in the `auth` package.
-
-## v11.6.1
-
-### Bug Fixes
-
-- Fix ACR DNS endpoint for government clouds.
-- Add Cosmos DB DNS endpoints.
-- Update dependencies to resolve build breaks in OpenCensus.
-
-## v11.6.0
-
-### New Features
-
-- Added type `autorest.BasicAuthorizer` to support Basic authentication.
-
-## v11.5.2
-
-### Bug Fixes
-
-- Fixed `GetTokenFromCLI` did not work with zsh.
-
-## v11.5.1
-
-### Bug Fixes
-
-- In `Client.sender()` set the minimum TLS version on HTTP clients to 1.2.
-
-## v11.5.0
-
-### New Features
-
-- The `auth` package has been refactored so that the environment and file settings are now available.
-- The methods used in `auth.NewAuthorizerFromEnvironment()` are now exported so that custom authorization chains can be created.
-- Added support for certificate authorization for file-based config.
-
-## v11.4.0
-
-### New Features
-
-- Added `adal.AddToUserAgent()` so callers can append custom data to the user-agent header used for ADAL requests.
-- Exported `adal.UserAgent()` for parity with `autorest.Client`.
-
-## v11.3.2
-
-### Bug Fixes
-
-- In `Future.WaitForCompletionRef()` if the provided context has a deadline don't add the default deadline.
-
-## v11.3.1
-
-### Bug Fixes
-
-- For an LRO PUT operation the final GET URL was incorrectly set to the Location polling header in some cases.
-
-## v11.3.0
-
-### New Features
-
-- Added method `ServicePrincipalToken()` to `DeviceFlowConfig` type.
-
-## v11.2.8
-
-### Bug Fixes
-
-- Deprecate content in the `version` package. The functionality has been superseded by content in the `autorest` package.
-
-## v11.2.7
-
-### Bug Fixes
-
-- Fix environment variable name for enabling tracing from `AZURE_SDK_TRACING_ENABELD` to `AZURE_SDK_TRACING_ENABLED`.
- Note that for backward compatibility reasons, both will work until the next major version release of the package.
-
-## v11.2.6
-
-### Bug Fixes
-
-- If zero bytes are read from a polling response body don't attempt to unmarshal them.
-
-## v11.2.5
-
-### Bug Fixes
-
-- Removed race condition in `autorest.DoRetryForStatusCodes`.
-
-## v11.2.4
-
-### Bug Fixes
-
-- Function `cli.ProfilePath` now respects environment `AZURE_CONFIG_DIR` if available.
-
-## v11.2.1
-
-NOTE: Versions of Go prior to 1.10 have been removed from CI as they no
-longer work with golint.
-
-### Bug Fixes
-
-- Method `MSIConfig.Authorizer` now supports user-assigned identities.
-- The adal package now reports its own user-agent string.
-
-## v11.2.0
-
-### New Features
-
-- Added `tracing` package that enables instrumentation of HTTP and API calls.
- Setting the env variable `AZURE_SDK_TRACING_ENABLED` or calling `tracing.Enable`
- will start instrumenting the code for metrics and traces.
- Additionally, setting the env variable `OCAGENT_TRACE_EXPORTER_ENDPOINT` or
- calling `tracing.EnableWithAIForwarding` will start the instrumentation and connect to an
- App Insights Local Forwarder that is needs to be running. Note that if the
- AI Local Forwarder is not running tracking will still be enabled.
- By default, instrumentation is disabled. Once enabled, instrumentation can also
- be programatically disabled by calling `Disable`.
-- Added `DoneWithContext` call for checking LRO status. `Done` has been deprecated.
-
-### Bug Fixes
-
-- Don't use the initial request's context for LRO polling.
-- Don't override the `refreshLock` and the `http.Client` when unmarshalling `ServicePrincipalToken` if
- it is already set.
-
-## v11.1.1
-
-### Bug Fixes
-
-- When creating a future always include the polling tracker even if there's a failure; this allows the underlying response to be obtained by the caller.
-
-## v11.1.0
-
-### New Features
-
-- Added `auth.NewAuthorizerFromCLI` to create an authorizer configured from the Azure 2.0 CLI.
-- Added `adal.NewOAuthConfigWithAPIVersion` to create an OAuthConfig with the specified API version.
-
-## v11.0.1
-
-### New Features
-
-- Added `x5c` header to client assertion for certificate Issuer+Subject Name authentication.
-
-## v11.0.0
-
-### Breaking Changes
-
-- To handle differences between ADFS and AAD the following fields have had their types changed from `string` to `json.Number`
- - ExpiresIn
- - ExpiresOn
- - NotBefore
-
-### New Features
-
-- Added `auth.NewAuthorizerFromFileWithResource` to create an authorizer from the config file with the specified resource.
-- Setting a client's `PollingDuration` to zero will use the provided context to control a LRO's polling duration.
-
-## v10.15.5
-
-### Bug Fixes
-
-- In `DoRetryForStatusCodes`, if a request's context is cancelled return the last response.
-
-## v10.15.4
-
-### Bug Fixes
-
-- If a polling operation returns a failure status code return the associated error.
-
-## v10.15.3
-
-### Bug Fixes
-
-- Initialize the polling URL and method for an LRO tracker on each iteration, favoring the Azure-AsyncOperation header.
-
-## v10.15.2
-
-### Bug Fixes
-
-- Use fmt.Fprint when printing request/response so that any escape sequences aren't treated as format specifiers.
-
-## v10.15.1
-
-### Bug Fixes
-
-- If an LRO API returns a `Failed` provisioning state in the initial response return an error at that point so the caller doesn't have to poll.
-- For failed LROs without an OData v4 error include the response body in the error's `AdditionalInfo` field to aid in diagnosing the failure.
-
-## v10.15.0
-
-### New Features
-
-- Add initial support for request/response logging via setting environment variables.
- Setting `AZURE_GO_SDK_LOG_LEVEL` to `LogInfo` will log request/response
- without their bodies. To include the bodies set the log level to `LogDebug`.
- By default the logger writes to strerr, however it can also write to stdout or a file
- if specified in `AZURE_GO_SDK_LOG_FILE`. Note that if the specified file
- already exists it will be truncated.
- IMPORTANT: by default the logger will redact the Authorization and Ocp-Apim-Subscription-Key
- headers. Any other secrets will _not_ be redacted.
-
-## v10.14.0
-
-### New Features
-
-- Added package version that contains version constants and user-agent data.
-
-### Bug Fixes
-
-- Add the user-agent to token requests.
-
-## v10.13.0
-
-- Added support for additionalInfo in ServiceError type.
-
-## v10.12.0
-
-### New Features
-
-- Added field ServicePrincipalToken.MaxMSIRefreshAttempts to configure the maximun number of attempts to refresh an MSI token.
-
-## v10.11.4
-
-### Bug Fixes
-
-- If an LRO returns http.StatusOK on the initial response with no async headers return the response body from Future.GetResult().
-- If there is no "final GET URL" return an error from Future.GetResult().
-
-## v10.11.3
-
-### Bug Fixes
-
-- In IMDS retry logic, if we don't receive a response don't retry.
- - Renamed the retry function so it's clear it's meant for IMDS only.
-- For error response bodies that aren't OData-v4 compliant stick the raw JSON in the ServiceError.Details field so the information isn't lost.
- - Also add the raw HTTP response to the DetailedResponse.
-- Removed superfluous wrapping of response error in azure.DoRetryWithRegistration().
-
-## v10.11.2
-
-### Bug Fixes
-
-- Validation for integers handles int and int64 types.
-
-## v10.11.1
-
-### Bug Fixes
-
-- Adding User information to authorization config as parsed from CLI cache.
-
-## v10.11.0
-
-### New Features
-
-- Added NewServicePrincipalTokenFromManualTokenSecret for creating a new SPT using a manual token and secret
-- Added method ServicePrincipalToken.MarshalTokenJSON() to marshall the inner Token
-
-## v10.10.0
-
-### New Features
-
-- Most ServicePrincipalTokens can now be marshalled/unmarshall to/from JSON (ServicePrincipalCertificateSecret and ServicePrincipalMSISecret are not supported).
-- Added method ServicePrincipalToken.SetRefreshCallbacks().
-
-## v10.9.2
-
-### Bug Fixes
-
-- Refreshing a refresh token obtained from a web app authorization code now works.
-
-## v10.9.1
-
-### Bug Fixes
-
-- The retry logic for MSI token requests now uses exponential backoff per the guidelines.
-- IsTemporaryNetworkError() will return true for errors that don't implement the net.Error interface.
-
-## v10.9.0
-
-### Deprecated Methods
-
-| Old Method | New Method |
-| -------------------------: | :---------------------------: |
-| azure.NewFuture() | azure.NewFutureFromResponse() |
-| Future.WaitForCompletion() | Future.WaitForCompletionRef() |
-
-### New Features
-
-- Added azure.NewFutureFromResponse() for creating a Future from the initial response from an async operation.
-- Added Future.GetResult() for making the final GET call to retrieve the result from an async operation.
-
-### Bug Fixes
-
-- Some futures failed to return their results, this should now be fixed.
-
-## v10.8.2
-
-### Bug Fixes
-
-- Add nil-gaurd to token retry logic.
-
-## v10.8.1
-
-### Bug Fixes
-
-- Return a TokenRefreshError if the sender fails on the initial request.
-- Don't retry on non-temporary network errors.
-
-## v10.8.0
-
-- Added NewAuthorizerFromEnvironmentWithResource() helper function.
-
-## v10.7.0
-
-### New Features
-
-- Added \*WithContext() methods to ADAL token refresh operations.
-
-## v10.6.2
-
-- Fixed a bug on device authentication.
-
-## v10.6.1
-
-- Added retries to MSI token get request.
-
-## v10.6.0
-
-- Changed MSI token implementation. Now, the token endpoint is the IMDS endpoint.
-
-## v10.5.1
-
-### Bug Fixes
-
-- `DeviceFlowConfig.Authorizer()` now prints the device code message when running `go test`. `-v` flag is required.
-
-## v10.5.0
-
-### New Features
-
-- Added NewPollingRequestWithContext() for use with polling asynchronous operations.
-
-### Bug Fixes
-
-- Make retry logic use the request's context instead of the deprecated Cancel object.
-
-## v10.4.0
-
-### New Features
-
-- Added helper for parsing Azure Resource ID's.
-- Added deprecation message to utils.GetEnvVarOrExit()
-
-## v10.3.0
-
-### New Features
-
-- Added EnvironmentFromURL method to load an Environment from a given URL. This function is particularly useful in the private and hybrid Cloud model, where one may define their own endpoints
-- Added TokenAudience endpoint to Environment structure. This is useful in private and hybrid cloud models where TokenAudience endpoint can be different from ResourceManagerEndpoint
-
-## v10.2.0
-
-### New Features
-
-- Added endpoints for batch management.
-
-## v10.1.3
-
-### Bug Fixes
-
-- In Client.Do() invoke WithInspection() last so that it will inspect WithAuthorization().
-- Fixed authorization methods to invoke p.Prepare() first, aligning them with the other preparers.
-
-## v10.1.2
-
-- Corrected comment for auth.NewAuthorizerFromFile() function.
-
-## v10.1.1
-
-- Updated version number to match current release.
-
-## v10.1.0
-
-### New Features
-
-- Expose the polling URL for futures.
-
-### Bug Fixes
-
-- Add validation.NewErrorWithValidationError back to prevent breaking changes (it is deprecated).
-
-## v10.0.0
-
-### New Features
-
-- Added target and innererror fields to ServiceError to comply with OData v4 spec.
-- The Done() method on futures will now return a ServiceError object when available (it used to return a partial value of such errors).
-- Added helper methods for obtaining authorizers.
-- Expose the polling URL for futures.
-
-### Bug Fixes
-
-- Switched from glide to dep for dependency management.
-- Fixed unmarshaling of ServiceError for JSON bodies that don't conform to the OData spec.
-- Fixed a race condition in token refresh.
-
-### Breaking Changes
-
-- The ServiceError.Details field type has been changed to match the OData v4 spec.
-- Go v1.7 has been dropped from CI.
-- API parameter validation failures will now return a unique error type validation.Error.
-- The adal.Token type has been decomposed from adal.ServicePrincipalToken (this was necessary in order to fix the token refresh race).
-
-## v9.10.0
-
-- Fix the Service Bus suffix in Azure public env
-- Add Service Bus Endpoint (AAD ResourceURI) for use in [Azure Service Bus RBAC Preview](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-role-based-access-control)
-
-## v9.9.0
-
-### New Features
-
-- Added EventGridKeyAuthorizer for key authorization with event grid topics.
-
-### Bug Fixes
-
-- Fixed race condition when auto-refreshing service principal tokens.
-
-## v9.8.1
-
-### Bug Fixes
-
-- Added http.StatusNoContent (204) to the list of expected status codes for long-running operations.
-- Updated runtime version info so it's current.
-
-## v9.8.0
-
-### New Features
-
-- Added type azure.AsyncOpIncompleteError to be returned from a future's Result() method when the operation has not completed.
-
-## v9.7.1
-
-### Bug Fixes
-
-- Use correct AAD and Graph endpoints for US Gov environment.
-
-## v9.7.0
-
-### New Features
-
-- Added support for application/octet-stream MIME types.
-
-## v9.6.1
-
-### Bug Fixes
-
-- Ensure Authorization header is added to request when polling for registration status.
-
-## v9.6.0
-
-### New Features
-
-- Added support for acquiring tokens via MSI with a user assigned identity.
-
-## v9.5.3
-
-### Bug Fixes
-
-- Don't remove encoding of existing URL Query parameters when calling autorest.WithQueryParameters.
-- Set correct Content Type when using autorest.WithFormData.
-
-## v9.5.2
-
-### Bug Fixes
-
-- Check for nil \*http.Response before dereferencing it.
-
-## v9.5.1
-
-### Bug Fixes
-
-- Don't count http.StatusTooManyRequests (429) against the retry cap.
-- Use retry logic when SkipResourceProviderRegistration is set to true.
-
-## v9.5.0
-
-### New Features
-
-- Added support for username + password, API key, authoriazation code and cognitive services authentication.
-- Added field SkipResourceProviderRegistration to clients to provide a way to skip auto-registration of RPs.
-- Added utility function AsStringSlice() to convert its parameters to a string slice.
-
-### Bug Fixes
-
-- When checking for authentication failures look at the error type not the status code as it could vary.
-
-## v9.4.2
-
-### Bug Fixes
-
-- Validate parameters when creating credentials.
-- Don't retry requests if the returned status is a 401 (http.StatusUnauthorized) as it will never succeed.
-
-## v9.4.1
-
-### Bug Fixes
-
-- Update the AccessTokensPath() to read access tokens path through AZURE_ACCESS_TOKEN_FILE. If this
- environment variable is not set, it will fall back to use default path set by Azure CLI.
-- Use case-insensitive string comparison for polling states.
-
-## v9.4.0
-
-### New Features
-
-- Added WaitForCompletion() to Future as a default polling implementation.
-
-### Bug Fixes
-
-- Method Future.Done() shouldn't update polling status for unexpected HTTP status codes.
-
-## v9.3.1
-
-### Bug Fixes
-
-- DoRetryForStatusCodes will retry if sender.Do returns a non-nil error.
-
-## v9.3.0
-
-### New Features
-
-- Added PollingMethod() to Future so callers know what kind of polling mechanism is used.
-- Added azure.ChangeToGet() which transforms an http.Request into a GET (to be used with LROs).
-
-## v9.2.0
-
-### New Features
-
-- Added support for custom Azure Stack endpoints.
-- Added type azure.Future used to track the status of long-running operations.
-
-### Bug Fixes
-
-- Preserve the original error in DoRetryWithRegistration when registration fails.
-
-## v9.1.1
-
-- Fixes a bug regarding the cookie jar on `autorest.Client.Sender`.
-
-## v9.1.0
-
-### New Features
-
-- In cases where there is a non-empty error from the service, attempt to unmarshal it instead of uniformly calling it an "Unknown" error.
-- Support for loading Azure CLI Authentication files.
-- Automatically register your subscription with the Azure Resource Provider if it hadn't been previously.
-
-### Bug Fixes
-
-- RetriableRequest can now tolerate a ReadSeekable body being read but not reset.
-- Adding missing Apache Headers
-
-## v9.0.0
-
-> **IMPORTANT:** This release was intially labeled incorrectly as `v8.4.0`. From the time it was released, it should have been marked `v9.0.0` because it contains breaking changes to the MSI packages. We appologize for any inconvenience this causes.
-
-Adding MSI Endpoint Support and CLI token rehydration.
-
-## v8.3.1
-
-Pick up bug fix in adal for MSI support.
-
-## v8.3.0
-
-Updates to Error string formats for clarity. Also, adding a copy of the http.Response to errors for an improved debugging experience.
-
-## v8.2.0
-
-### New Features
-
-- Add support for bearer authentication callbacks
-- Support 429 response codes that include "Retry-After" header
-- Support validation constraint "Pattern" for map keys
-
-### Bug Fixes
-
-- Make RetriableRequest work with multiple versions of Go
-
-## v8.1.1
-
-Updates the RetriableRequest to take advantage of GetBody() added in Go 1.8.
-
-## v8.1.0
-
-Adds RetriableRequest type for more efficient handling of retrying HTTP requests.
-
-## v8.0.0
-
-ADAL refactored into its own package.
-Support for UNIX time.
-
-## v7.3.1
-
-- Version Testing now removed from production bits that are shipped with the library.
-
-## v7.3.0
-
-- Exposing new `RespondDecorator`, `ByDiscardingBody`. This allows operations
- to acknowledge that they do not need either the entire or a trailing portion
- of accepts response body. In doing so, Go's http library can reuse HTTP
- connections more readily.
-- Adding `PrepareDecorator` to target custom BaseURLs.
-- Adding ACR suffix to public cloud environment.
-- Updating Glide dependencies.
-
-## v7.2.5
-
-- Fixed the Active Directory endpoint for the China cloud.
-- Removes UTF-8 BOM if present in response payload.
-- Added telemetry.
-
-## v7.2.3
-
-- Fixing bug in calls to `DelayForBackoff` that caused doubling of delay
- duration.
-
-## v7.2.2
-
-- autorest/azure: added ASM and ARM VM DNS suffixes.
-
-## v7.2.1
-
-- fixed parsing of UTC times that are not RFC3339 conformant.
-
-## v7.2.0
-
-- autorest/validation: Reformat validation error for better error message.
-
-## v7.1.0
-
-- preparer: Added support for multipart formdata - WithMultiPartFormdata()
-- preparer: Added support for sending file in request body - WithFile
-- client: Added RetryDuration parameter.
-- autorest/validation: new package for validation code for Azure Go SDK.
-
-## v7.0.7
-
-- Add trailing / to endpoint
-- azure: add EnvironmentFromName
-
-## v7.0.6
-
-- Add retry logic for 408, 500, 502, 503 and 504 status codes.
-- Change url path and query encoding logic.
-- Fix DelayForBackoff for proper exponential delay.
-- Add CookieJar in Client.
-
-## v7.0.5
-
-- Add check to start polling only when status is in [200,201,202].
-- Refactoring for unchecked errors.
-- azure/persist changes.
-- Fix 'file in use' issue in renewing token in deviceflow.
-- Store header RetryAfter for subsequent requests in polling.
-- Add attribute details in service error.
-
-## v7.0.4
-
-- Better error messages for long running operation failures
-
-## v7.0.3
-
-- Corrected DoPollForAsynchronous to properly handle the initial response
-
-## v7.0.2
-
-- Corrected DoPollForAsynchronous to continue using the polling method first discovered
-
-## v7.0.1
-
-- Fixed empty JSON input error in ByUnmarshallingJSON
-- Fixed polling support for GET calls
-- Changed format name from TimeRfc1123 to TimeRFC1123
-
-## v7.0.0
-
-- Added ByCopying responder with supporting TeeReadCloser
-- Rewrote Azure asynchronous handling
-- Reverted to only unmarshalling JSON
-- Corrected handling of RFC3339 time strings and added support for Rfc1123 time format
-
-The `json.Decoder` does not catch bad data as thoroughly as `json.Unmarshal`. Since
-`encoding/json` successfully deserializes all core types, and extended types normally provide
-their custom JSON serialization handlers, the code has been reverted back to using
-`json.Unmarshal`. The original change to use `json.Decode` was made to reduce duplicate
-code; there is no loss of function, and there is a gain in accuracy, by reverting.
-
-Additionally, Azure services indicate requests to be polled by multiple means. The existing code
-only checked for one of those (that is, the presence of the `Azure-AsyncOperation` header).
-The new code correctly covers all cases and aligns with the other Azure SDKs.
-
-## v6.1.0
-
-- Introduced `date.ByUnmarshallingJSONDate` and `date.ByUnmarshallingJSONTime` to enable JSON encoded values.
-
-## v6.0.0
-
-- Completely reworked the handling of polled and asynchronous requests
-- Removed unnecessary routines
-- Reworked `mocks.Sender` to replay a series of `http.Response` objects
-- Added `PrepareDecorators` for primitive types (e.g., bool, int32)
-
-Handling polled and asynchronous requests is no longer part of `Client#Send`. Instead new
-`SendDecorators` implement different styles of polled behavior. See`autorest.DoPollForStatusCodes`
-and `azure.DoPollForAsynchronous` for examples.
-
-## v5.0.0
-
-- Added new RespondDecorators unmarshalling primitive types
-- Corrected application of inspection and authorization PrependDecorators
-
-## v4.0.0
-
-- Added support for Azure long-running operations.
-- Added cancelation support to all decorators and functions that may delay.
-- Breaking: `DelayForBackoff` now accepts a channel, which may be nil.
-
-## v3.1.0
-
-- Add support for OAuth Device Flow authorization.
-- Add support for ServicePrincipalTokens that are backed by an existing token, rather than other secret material.
-- Add helpers for persisting and restoring Tokens.
-- Increased code coverage in the github.com/Azure/autorest/azure package
-
-## v3.0.0
-
-- Breaking: `NewErrorWithError` no longer takes `statusCode int`.
-- Breaking: `NewErrorWithStatusCode` is replaced with `NewErrorWithResponse`.
-- Breaking: `Client#Send()` no longer takes `codes ...int` argument.
-- Add: XML unmarshaling support with `ByUnmarshallingXML()`
-- Stopped vending dependencies locally and switched to [Glide](https://github.com/Masterminds/glide).
- Applications using this library should either use Glide or vendor dependencies locally some other way.
-- Add: `azure.WithErrorUnlessStatusCode()` decorator to handle Azure errors.
-- Fix: use `net/http.DefaultClient` as base client.
-- Fix: Missing inspection for polling responses added.
-- Add: CopyAndDecode helpers.
-- Improved `./autorest/to` with `[]string` helpers.
-- Removed golint suppressions in .travis.yml.
-
-## v2.1.0
-
-- Added `StatusCode` to `Error` for more easily obtaining the HTTP Reponse StatusCode (if any)
-
-## v2.0.0
-
-- Changed `to.StringMapPtr` method signature to return a pointer
-- Changed `ServicePrincipalCertificateSecret` and `NewServicePrincipalTokenFromCertificate` to support generic certificate and private keys
-
-## v1.0.0
-
-- Added Logging inspectors to trace http.Request / Response
-- Added support for User-Agent header
-- Changed WithHeader PrepareDecorator to use set vs. add
-- Added JSON to error when unmarshalling fails
-- Added Client#Send method
-- Corrected case of "Azure" in package paths
-- Added "to" helpers, Azure helpers, and improved ease-of-use
-- Corrected golint issues
-
-## v1.0.1
-
-- Added CHANGELOG.md
-
-## v1.1.0
-
-- Added mechanism to retrieve a ServicePrincipalToken using a certificate-signed JWT
-- Added an example of creating a certificate-based ServicePrincipal and retrieving an OAuth token using the certificate
-
-## v1.1.1
-
-- Introduce godeps and vendor dependencies introduced in v1.1.1
diff --git a/vendor/github.com/Azure/go-autorest/GNUmakefile b/vendor/github.com/Azure/go-autorest/GNUmakefile
deleted file mode 100644
index a434e73ac..000000000
--- a/vendor/github.com/Azure/go-autorest/GNUmakefile
+++ /dev/null
@@ -1,23 +0,0 @@
-DIR?=./autorest/
-
-default: build
-
-build: fmt
- go install $(DIR)
-
-test:
- go test $(DIR) || exit 1
-
-vet:
- @echo "go vet ."
- @go vet $(DIR)... ; if [ $$? -eq 1 ]; then \
- echo ""; \
- echo "Vet found suspicious constructs. Please check the reported constructs"; \
- echo "and fix them if necessary before submitting the code for review."; \
- exit 1; \
- fi
-
-fmt:
- gofmt -w $(DIR)
-
-.PHONY: build test vet fmt
diff --git a/vendor/github.com/Azure/go-autorest/Gopkg.lock b/vendor/github.com/Azure/go-autorest/Gopkg.lock
deleted file mode 100644
index dc6e3e633..000000000
--- a/vendor/github.com/Azure/go-autorest/Gopkg.lock
+++ /dev/null
@@ -1,324 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
- digest = "1:892e39e5c083d0943f1e80ab8351690f183c6a5ab24e1d280adcad424c26255e"
- name = "contrib.go.opencensus.io/exporter/ocagent"
- packages = ["."]
- pruneopts = "UT"
- revision = "a8a6f458bbc1d5042322ad1f9b65eeb0b69be9ea"
- version = "v0.6.0"
-
-[[projects]]
- digest = "1:8f5acd4d4462b5136af644d25101f0968a7a94ee90fcb2059cec5b7cc42e0b20"
- name = "github.com/census-instrumentation/opencensus-proto"
- packages = [
- "gen-go/agent/common/v1",
- "gen-go/agent/metrics/v1",
- "gen-go/agent/trace/v1",
- "gen-go/metrics/v1",
- "gen-go/resource/v1",
- "gen-go/trace/v1",
- ]
- pruneopts = "UT"
- revision = "d89fa54de508111353cb0b06403c00569be780d8"
- version = "v0.2.1"
-
-[[projects]]
- digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec"
- name = "github.com/davecgh/go-spew"
- packages = ["spew"]
- pruneopts = "UT"
- revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73"
- version = "v1.1.1"
-
-[[projects]]
- digest = "1:76dc72490af7174349349838f2fe118996381b31ea83243812a97e5a0fd5ed55"
- name = "github.com/dgrijalva/jwt-go"
- packages = ["."]
- pruneopts = "UT"
- revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e"
- version = "v3.2.0"
-
-[[projects]]
- digest = "1:cf0d2e435fd4ce45b789e93ef24b5f08e86be0e9807a16beb3694e2d8c9af965"
- name = "github.com/dimchansky/utfbom"
- packages = ["."]
- pruneopts = "UT"
- revision = "d2133a1ce379ef6fa992b0514a77146c60db9d1c"
- version = "v1.1.0"
-
-[[projects]]
- branch = "master"
- digest = "1:b7cb6054d3dff43b38ad2e92492f220f57ae6087ee797dca298139776749ace8"
- name = "github.com/golang/groupcache"
- packages = ["lru"]
- pruneopts = "UT"
- revision = "611e8accdfc92c4187d399e95ce826046d4c8d73"
-
-[[projects]]
- digest = "1:e3839df32927e8d3403cd5aa7253d966e8ff80fc8f10e2e35d146461cd83fcfa"
- name = "github.com/golang/protobuf"
- packages = [
- "descriptor",
- "jsonpb",
- "proto",
- "protoc-gen-go/descriptor",
- "ptypes",
- "ptypes/any",
- "ptypes/duration",
- "ptypes/struct",
- "ptypes/timestamp",
- "ptypes/wrappers",
- ]
- pruneopts = "UT"
- revision = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7"
- version = "v1.3.2"
-
-[[projects]]
- digest = "1:c560cd79300fac84f124b96225181a637a70b60155919a3c36db50b7cca6b806"
- name = "github.com/grpc-ecosystem/grpc-gateway"
- packages = [
- "internal",
- "runtime",
- "utilities",
- ]
- pruneopts = "UT"
- revision = "f7120437bb4f6c71f7f5076ad65a45310de2c009"
- version = "v1.12.1"
-
-[[projects]]
- digest = "1:5d231480e1c64a726869bc4142d270184c419749d34f167646baa21008eb0a79"
- name = "github.com/mitchellh/go-homedir"
- packages = ["."]
- pruneopts = "UT"
- revision = "af06845cf3004701891bf4fdb884bfe4920b3727"
- version = "v1.1.0"
-
-[[projects]]
- digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe"
- name = "github.com/pmezard/go-difflib"
- packages = ["difflib"]
- pruneopts = "UT"
- revision = "792786c7400a136282c1664665ae0a8db921c6c2"
- version = "v1.0.0"
-
-[[projects]]
- digest = "1:99d32780e5238c2621fff621123997c3e3cca96db8be13179013aea77dfab551"
- name = "github.com/stretchr/testify"
- packages = [
- "assert",
- "require",
- ]
- pruneopts = "UT"
- revision = "221dbe5ed46703ee255b1da0dec05086f5035f62"
- version = "v1.4.0"
-
-[[projects]]
- digest = "1:7c5e00383399fe13de0b4b65c9fdde16275407ce8ac02d867eafeaa916edcc71"
- name = "go.opencensus.io"
- packages = [
- ".",
- "internal",
- "internal/tagencoding",
- "metric/metricdata",
- "metric/metricproducer",
- "plugin/ocgrpc",
- "plugin/ochttp",
- "plugin/ochttp/propagation/b3",
- "plugin/ochttp/propagation/tracecontext",
- "resource",
- "stats",
- "stats/internal",
- "stats/view",
- "tag",
- "trace",
- "trace/internal",
- "trace/propagation",
- "trace/tracestate",
- ]
- pruneopts = "UT"
- revision = "aad2c527c5defcf89b5afab7f37274304195a6b2"
- version = "v0.22.2"
-
-[[projects]]
- branch = "master"
- digest = "1:f604f5e2ee721b6757d962dfe7bab4f28aae50c456e39cfb2f3819762a44a6ae"
- name = "golang.org/x/crypto"
- packages = [
- "pkcs12",
- "pkcs12/internal/rc2",
- ]
- pruneopts = "UT"
- revision = "e9b2fee46413994441b28dfca259d911d963dfed"
-
-[[projects]]
- branch = "master"
- digest = "1:334b27eac455cb6567ea28cd424230b07b1a64334a2f861a8075ac26ce10af43"
- name = "golang.org/x/lint"
- packages = [
- ".",
- "golint",
- ]
- pruneopts = "UT"
- revision = "fdd1cda4f05fd1fd86124f0ef9ce31a0b72c8448"
-
-[[projects]]
- branch = "master"
- digest = "1:257a75d024975428ab9192bfc334c3490882f8cb21322ea5784ca8eca000a910"
- name = "golang.org/x/net"
- packages = [
- "http/httpguts",
- "http2",
- "http2/hpack",
- "idna",
- "internal/timeseries",
- "trace",
- ]
- pruneopts = "UT"
- revision = "1ddd1de85cb0337b623b740a609d35817d516a8d"
-
-[[projects]]
- branch = "master"
- digest = "1:382bb5a7fb4034db3b6a2d19e5a4a6bcf52f4750530603c01ca18a172fa3089b"
- name = "golang.org/x/sync"
- packages = ["semaphore"]
- pruneopts = "UT"
- revision = "cd5d95a43a6e21273425c7ae415d3df9ea832eeb"
-
-[[projects]]
- branch = "master"
- digest = "1:4da420ceda5f68e8d748aa2169d0ed44ffadb1bbd6537cf778a49563104189b8"
- name = "golang.org/x/sys"
- packages = ["unix"]
- pruneopts = "UT"
- revision = "ce4227a45e2eb77e5c847278dcc6a626742e2945"
-
-[[projects]]
- digest = "1:8d8faad6b12a3a4c819a3f9618cb6ee1fa1cfc33253abeeea8b55336721e3405"
- name = "golang.org/x/text"
- packages = [
- "collate",
- "collate/build",
- "internal/colltab",
- "internal/gen",
- "internal/language",
- "internal/language/compact",
- "internal/tag",
- "internal/triegen",
- "internal/ucd",
- "language",
- "secure/bidirule",
- "transform",
- "unicode/bidi",
- "unicode/cldr",
- "unicode/norm",
- "unicode/rangetable",
- ]
- pruneopts = "UT"
- revision = "342b2e1fbaa52c93f31447ad2c6abc048c63e475"
- version = "v0.3.2"
-
-[[projects]]
- branch = "master"
- digest = "1:4eb5ea8395fb60212dd58b92c9db80bab59d5e99c7435f9a6a0a528c373b60e7"
- name = "golang.org/x/tools"
- packages = [
- "go/ast/astutil",
- "go/gcexportdata",
- "go/internal/gcimporter",
- "go/types/typeutil",
- ]
- pruneopts = "UT"
- revision = "259af5ff87bdcd4abf2ecda8edc3f13f04f26a42"
-
-[[projects]]
- digest = "1:964bb30febc27fabfbec4759fa530c6ec35e77a7c85fed90b9317ea39a054877"
- name = "google.golang.org/api"
- packages = ["support/bundler"]
- pruneopts = "UT"
- revision = "8a410c21381766a810817fd6200fce8838ecb277"
- version = "v0.14.0"
-
-[[projects]]
- branch = "master"
- digest = "1:a8d5c2c6e746b3485e36908ab2a9e3d77b86b81f8156d88403c7d2b462431dfd"
- name = "google.golang.org/genproto"
- packages = [
- "googleapis/api/httpbody",
- "googleapis/rpc/status",
- "protobuf/field_mask",
- ]
- pruneopts = "UT"
- revision = "51378566eb590fa106d1025ea12835a4416dda84"
-
-[[projects]]
- digest = "1:b59ce3ddb11daeeccccc9cb3183b58ebf8e9a779f1c853308cd91612e817a301"
- name = "google.golang.org/grpc"
- packages = [
- ".",
- "backoff",
- "balancer",
- "balancer/base",
- "balancer/roundrobin",
- "binarylog/grpc_binarylog_v1",
- "codes",
- "connectivity",
- "credentials",
- "credentials/internal",
- "encoding",
- "encoding/proto",
- "grpclog",
- "internal",
- "internal/backoff",
- "internal/balancerload",
- "internal/binarylog",
- "internal/buffer",
- "internal/channelz",
- "internal/envconfig",
- "internal/grpcrand",
- "internal/grpcsync",
- "internal/resolver/dns",
- "internal/resolver/passthrough",
- "internal/syscall",
- "internal/transport",
- "keepalive",
- "metadata",
- "naming",
- "peer",
- "resolver",
- "serviceconfig",
- "stats",
- "status",
- "tap",
- ]
- pruneopts = "UT"
- revision = "1a3960e4bd028ac0cec0a2afd27d7d8e67c11514"
- version = "v1.25.1"
-
-[[projects]]
- digest = "1:b75b3deb2bce8bc079e16bb2aecfe01eb80098f5650f9e93e5643ca8b7b73737"
- name = "gopkg.in/yaml.v2"
- packages = ["."]
- pruneopts = "UT"
- revision = "1f64d6156d11335c3f22d9330b0ad14fc1e789ce"
- version = "v2.2.7"
-
-[solve-meta]
- analyzer-name = "dep"
- analyzer-version = 1
- input-imports = [
- "contrib.go.opencensus.io/exporter/ocagent",
- "github.com/dgrijalva/jwt-go",
- "github.com/dimchansky/utfbom",
- "github.com/mitchellh/go-homedir",
- "github.com/stretchr/testify/require",
- "go.opencensus.io/plugin/ochttp",
- "go.opencensus.io/plugin/ochttp/propagation/tracecontext",
- "go.opencensus.io/stats/view",
- "go.opencensus.io/trace",
- "golang.org/x/crypto/pkcs12",
- "golang.org/x/lint/golint",
- ]
- solver-name = "gps-cdcl"
- solver-version = 1
diff --git a/vendor/github.com/Azure/go-autorest/Gopkg.toml b/vendor/github.com/Azure/go-autorest/Gopkg.toml
deleted file mode 100644
index 1fc286596..000000000
--- a/vendor/github.com/Azure/go-autorest/Gopkg.toml
+++ /dev/null
@@ -1,59 +0,0 @@
-# Gopkg.toml example
-#
-# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
-# for detailed Gopkg.toml documentation.
-#
-# required = ["github.com/user/thing/cmd/thing"]
-# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
-#
-# [[constraint]]
-# name = "github.com/user/project"
-# version = "1.0.0"
-#
-# [[constraint]]
-# name = "github.com/user/project2"
-# branch = "dev"
-# source = "github.com/myfork/project2"
-#
-# [[override]]
-# name = "github.com/x/y"
-# version = "2.4.0"
-#
-# [prune]
-# non-go = false
-# go-tests = true
-# unused-packages = true
-
-required = ["golang.org/x/lint/golint"]
-
-[prune]
- go-tests = true
- unused-packages = true
-
-[[constraint]]
- name = "contrib.go.opencensus.io/exporter/ocagent"
- version = "0.6.0"
-
-[[constraint]]
- name = "github.com/dgrijalva/jwt-go"
- version = "3.2.0"
-
-[[constraint]]
- name = "github.com/dimchansky/utfbom"
- version = "1.1.0"
-
-[[constraint]]
- name = "github.com/mitchellh/go-homedir"
- version = "1.1.0"
-
-[[constraint]]
- name = "github.com/stretchr/testify"
- version = "1.3.0"
-
-[[constraint]]
- name = "go.opencensus.io"
- version = "0.22.0"
-
-[[constraint]]
- branch = "master"
- name = "golang.org/x/crypto"
diff --git a/vendor/github.com/Azure/go-autorest/LICENSE b/vendor/github.com/Azure/go-autorest/LICENSE
deleted file mode 100644
index b9d6a27ea..000000000
--- a/vendor/github.com/Azure/go-autorest/LICENSE
+++ /dev/null
@@ -1,191 +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
-
- Copyright 2015 Microsoft Corporation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT 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/Azure/go-autorest/README.md b/vendor/github.com/Azure/go-autorest/README.md
deleted file mode 100644
index de1e19a44..000000000
--- a/vendor/github.com/Azure/go-autorest/README.md
+++ /dev/null
@@ -1,165 +0,0 @@
-# go-autorest
-
-[](https://godoc.org/github.com/Azure/go-autorest/autorest)
-[](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=625&branchName=master)
-[](https://goreportcard.com/report/Azure/go-autorest)
-
-Package go-autorest provides an HTTP request client for use with [Autorest](https://github.com/Azure/autorest.go)-generated API client packages.
-
-An authentication client tested with Azure Active Directory (AAD) is also
-provided in this repo in the package
-`github.com/Azure/go-autorest/autorest/adal`. Despite its name, this package
-is maintained only as part of the Azure Go SDK and is not related to other
-"ADAL" libraries in [github.com/AzureAD](https://github.com/AzureAD).
-
-## Overview
-
-Package go-autorest implements an HTTP request pipeline suitable for use across
-multiple goroutines and provides the shared routines used by packages generated
-by [Autorest](https://github.com/Azure/autorest.go).
-
-The package breaks sending and responding to HTTP requests into three phases: Preparing, Sending,
-and Responding. A typical pattern is:
-
-```go
- req, err := Prepare(&http.Request{},
- token.WithAuthorization())
-
- resp, err := Send(req,
- WithLogging(logger),
- DoErrorIfStatusCode(http.StatusInternalServerError),
- DoCloseIfError(),
- DoRetryForAttempts(5, time.Second))
-
- err = Respond(resp,
- ByDiscardingBody(),
- ByClosing())
-```
-
-Each phase relies on decorators to modify and / or manage processing. Decorators may first modify
-and then pass the data along, pass the data first and then modify the result, or wrap themselves
-around passing the data (such as a logger might do). Decorators run in the order provided. For
-example, the following:
-
-```go
- req, err := Prepare(&http.Request{},
- WithBaseURL("https://microsoft.com/"),
- WithPath("a"),
- WithPath("b"),
- WithPath("c"))
-```
-
-will set the URL to:
-
-```
- https://microsoft.com/a/b/c
-```
-
-Preparers and Responders may be shared and re-used (assuming the underlying decorators support
-sharing and re-use). Performant use is obtained by creating one or more Preparers and Responders
-shared among multiple go-routines, and a single Sender shared among multiple sending go-routines,
-all bound together by means of input / output channels.
-
-Decorators hold their passed state within a closure (such as the path components in the example
-above). Be careful to share Preparers and Responders only in a context where such held state
-applies. For example, it may not make sense to share a Preparer that applies a query string from a
-fixed set of values. Similarly, sharing a Responder that reads the response body into a passed
-struct (e.g., `ByUnmarshallingJson`) is likely incorrect.
-
-Errors raised by autorest objects and methods will conform to the `autorest.Error` interface.
-
-See the included examples for more detail. For details on the suggested use of this package by
-generated clients, see the Client described below.
-
-## Helpers
-
-### Handling Swagger Dates
-
-The Swagger specification (https://swagger.io) that drives AutoRest
-(https://github.com/Azure/autorest/) precisely defines two date forms: date and date-time. The
-github.com/Azure/go-autorest/autorest/date package provides time.Time derivations to ensure correct
-parsing and formatting.
-
-### Handling Empty Values
-
-In JSON, missing values have different semantics than empty values. This is especially true for
-services using the HTTP PATCH verb. The JSON submitted with a PATCH request generally contains
-only those values to modify. Missing values are to be left unchanged. Developers, then, require a
-means to both specify an empty value and to leave the value out of the submitted JSON.
-
-The Go JSON package (`encoding/json`) supports the `omitempty` tag. When specified, it omits
-empty values from the rendered JSON. Since Go defines default values for all base types (such as ""
-for string and 0 for int) and provides no means to mark a value as actually empty, the JSON package
-treats default values as meaning empty, omitting them from the rendered JSON. This means that, using
-the Go base types encoded through the default JSON package, it is not possible to create JSON to
-clear a value at the server.
-
-The workaround within the Go community is to use pointers to base types in lieu of base types within
-structures that map to JSON. For example, instead of a value of type `string`, the workaround uses
-`*string`. While this enables distinguishing empty values from those to be unchanged, creating
-pointers to a base type (notably constant, in-line values) requires additional variables. This, for
-example,
-
-```go
- s := struct {
- S *string
- }{ S: &"foo" }
-```
-fails, while, this
-
-```go
- v := "foo"
- s := struct {
- S *string
- }{ S: &v }
-```
-succeeds.
-
-To ease using pointers, the subpackage `to` contains helpers that convert to and from pointers for
-Go base types which have Swagger analogs. It also provides a helper that converts between
-`map[string]string` and `map[string]*string`, enabling the JSON to specify that the value
-associated with a key should be cleared. With the helpers, the previous example becomes
-
-```go
- s := struct {
- S *string
- }{ S: to.StringPtr("foo") }
-```
-
-## Install
-
-```bash
-go get github.com/Azure/go-autorest/autorest
-go get github.com/Azure/go-autorest/autorest/azure
-go get github.com/Azure/go-autorest/autorest/date
-go get github.com/Azure/go-autorest/autorest/to
-```
-
-### Using with Go Modules
-In [v12.0.1](https://github.com/Azure/go-autorest/pull/386), this repository introduced the following modules.
-
-- autorest/adal
-- autorest/azure/auth
-- autorest/azure/cli
-- autorest/date
-- autorest/mocks
-- autorest/to
-- autorest/validation
-- autorest
-- logger
-- tracing
-
-Tagging cumulative SDK releases as a whole (e.g. `v12.3.0`) is still enabled to support consumers of this repo that have not yet migrated to modules.
-
-## License
-
-See LICENSE file.
-
------
-
-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-autorest/autorest/LICENSE b/vendor/github.com/Azure/go-autorest/autorest/LICENSE
deleted file mode 100644
index b9d6a27ea..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/LICENSE
+++ /dev/null
@@ -1,191 +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
-
- Copyright 2015 Microsoft Corporation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT 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/Azure/go-autorest/autorest/adal/README.md b/vendor/github.com/Azure/go-autorest/autorest/adal/README.md
deleted file mode 100644
index b11eb0788..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md
+++ /dev/null
@@ -1,294 +0,0 @@
-# NOTE: This module will go out of support by March 31, 2023. For authenticating with Azure AD, use module [azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity) instead. For help migrating from `adal` to `azidentiy` please consult the [migration guide](https://aka.ms/azsdk/go/identity/migration). General information about the retirement of this and other legacy modules can be found [here](https://azure.microsoft.com/updates/support-for-azure-sdk-libraries-that-do-not-conform-to-our-current-azure-sdk-guidelines-will-be-retired-as-of-31-march-2023/).
-
-# Azure Active Directory authentication for Go
-
-This is a standalone package for authenticating with Azure Active
-Directory from other Go libraries and applications, in particular the [Azure SDK
-for Go](https://github.com/Azure/azure-sdk-for-go).
-
-Note: Despite the package's name it is not related to other "ADAL" libraries
-maintained in the [github.com/AzureAD](https://github.com/AzureAD) org. Issues
-should be opened in [this repo's](https://github.com/Azure/go-autorest/issues)
-or [the SDK's](https://github.com/Azure/azure-sdk-for-go/issues) issue
-trackers.
-
-## Install
-
-```bash
-go get -u github.com/Azure/go-autorest/autorest/adal
-```
-
-## Usage
-
-An Active Directory application is required in order to use this library. An application can be registered in the [Azure Portal](https://portal.azure.com/) by following these [guidelines](https://docs.microsoft.com/azure/active-directory/develop/active-directory-integrating-applications) or using the [Azure CLI](https://github.com/Azure/azure-cli).
-
-### Register an Azure AD Application with secret
-
-
-1. Register a new application with a `secret` credential
-
- ```
- az ad app create \
- --display-name example-app \
- --homepage https://example-app/home \
- --identifier-uris https://example-app/app \
- --password secret
- ```
-
-2. Create a service principal using the `Application ID` from previous step
-
- ```
- az ad sp create --id "Application ID"
- ```
-
- * Replace `Application ID` with `appId` from step 1.
-
-### Register an Azure AD Application with certificate
-
-1. Create a private key
-
- ```
- openssl genrsa -out "example-app.key" 2048
- ```
-
-2. Create the certificate
-
- ```
- openssl req -new -key "example-app.key" -subj "/CN=example-app" -out "example-app.csr"
- openssl x509 -req -in "example-app.csr" -signkey "example-app.key" -out "example-app.crt" -days 10000
- ```
-
-3. Create the PKCS12 version of the certificate containing also the private key
-
- ```
- openssl pkcs12 -export -out "example-app.pfx" -inkey "example-app.key" -in "example-app.crt" -passout pass:
-
- ```
-
-4. Register a new application with the certificate content form `example-app.crt`
-
- ```
- certificateContents="$(tail -n+2 "example-app.crt" | head -n-1)"
-
- az ad app create \
- --display-name example-app \
- --homepage https://example-app/home \
- --identifier-uris https://example-app/app \
- --key-usage Verify --end-date 2018-01-01 \
- --key-value "${certificateContents}"
- ```
-
-5. Create a service principal using the `Application ID` from previous step
-
- ```
- az ad sp create --id "APPLICATION_ID"
- ```
-
- * Replace `APPLICATION_ID` with `appId` from step 4.
-
-
-### Grant the necessary permissions
-
-Azure relies on a Role-Based Access Control (RBAC) model to manage the access to resources at a fine-grained
-level. There is a set of [pre-defined roles](https://docs.microsoft.com/azure/active-directory/role-based-access-built-in-roles)
-which can be assigned to a service principal of an Azure AD application depending of your needs.
-
-```
-az role assignment create --assigner "SERVICE_PRINCIPAL_ID" --role "ROLE_NAME"
-```
-
-* Replace the `SERVICE_PRINCIPAL_ID` with the `appId` from previous step.
-* Replace the `ROLE_NAME` with a role name of your choice.
-
-It is also possible to define custom role definitions.
-
-```
-az role definition create --role-definition role-definition.json
-```
-
-* Check [custom roles](https://docs.microsoft.com/azure/active-directory/role-based-access-control-custom-roles) for more details regarding the content of `role-definition.json` file.
-
-
-### Acquire Access Token
-
-The common configuration used by all flows:
-
-```Go
-const activeDirectoryEndpoint = "https://login.microsoftonline.com/"
-tenantID := "TENANT_ID"
-oauthConfig, err := adal.NewOAuthConfig(activeDirectoryEndpoint, tenantID)
-
-applicationID := "APPLICATION_ID"
-
-callback := func(token adal.Token) error {
- // This is called after the token is acquired
-}
-
-// The resource for which the token is acquired
-resource := "https://management.core.windows.net/"
-```
-
-* Replace the `TENANT_ID` with your tenant ID.
-* Replace the `APPLICATION_ID` with the value from previous section.
-
-#### Client Credentials
-
-```Go
-applicationSecret := "APPLICATION_SECRET"
-
-spt, err := adal.NewServicePrincipalToken(
- *oauthConfig,
- appliationID,
- applicationSecret,
- resource,
- callbacks...)
-if err != nil {
- return nil, err
-}
-
-// Acquire a new access token
-err = spt.Refresh()
-if (err == nil) {
- token := spt.Token
-}
-```
-
-* Replace the `APPLICATION_SECRET` with the `password` value from previous section.
-
-#### Client Certificate
-
-```Go
-certificatePath := "./example-app.pfx"
-
-certData, err := ioutil.ReadFile(certificatePath)
-if err != nil {
- return nil, fmt.Errorf("failed to read the certificate file (%s): %v", certificatePath, err)
-}
-
-// Get the certificate and private key from pfx file
-certificate, rsaPrivateKey, err := decodePkcs12(certData, "")
-if err != nil {
- return nil, fmt.Errorf("failed to decode pkcs12 certificate while creating spt: %v", err)
-}
-
-spt, err := adal.NewServicePrincipalTokenFromCertificate(
- *oauthConfig,
- applicationID,
- certificate,
- rsaPrivateKey,
- resource,
- callbacks...)
-
-// Acquire a new access token
-err = spt.Refresh()
-if (err == nil) {
- token := spt.Token
-}
-```
-
-* Update the certificate path to point to the example-app.pfx file which was created in previous section.
-
-
-#### Device Code
-
-```Go
-oauthClient := &http.Client{}
-
-// Acquire the device code
-deviceCode, err := adal.InitiateDeviceAuth(
- oauthClient,
- *oauthConfig,
- applicationID,
- resource)
-if err != nil {
- return nil, fmt.Errorf("Failed to start device auth flow: %s", err)
-}
-
-// Display the authentication message
-fmt.Println(*deviceCode.Message)
-
-// Wait here until the user is authenticated
-token, err := adal.WaitForUserCompletion(oauthClient, deviceCode)
-if err != nil {
- return nil, fmt.Errorf("Failed to finish device auth flow: %s", err)
-}
-
-spt, err := adal.NewServicePrincipalTokenFromManualToken(
- *oauthConfig,
- applicationID,
- resource,
- *token,
- callbacks...)
-
-if (err == nil) {
- token := spt.Token
-}
-```
-
-#### Username password authenticate
-
-```Go
-spt, err := adal.NewServicePrincipalTokenFromUsernamePassword(
- *oauthConfig,
- applicationID,
- username,
- password,
- resource,
- callbacks...)
-
-if (err == nil) {
- token := spt.Token
-}
-```
-
-#### Authorization code authenticate
-
-``` Go
-spt, err := adal.NewServicePrincipalTokenFromAuthorizationCode(
- *oauthConfig,
- applicationID,
- clientSecret,
- authorizationCode,
- redirectURI,
- resource,
- callbacks...)
-
-err = spt.Refresh()
-if (err == nil) {
- token := spt.Token
-}
-```
-
-### Command Line Tool
-
-A command line tool is available in `cmd/adal.go` that can acquire a token for a given resource. It supports all flows mentioned above.
-
-```
-adal -h
-
-Usage of ./adal:
- -applicationId string
- application id
- -certificatePath string
- path to pk12/PFC application certificate
- -mode string
- authentication mode (device, secret, cert, refresh) (default "device")
- -resource string
- resource for which the token is requested
- -secret string
- application secret
- -tenantId string
- tenant id
- -tokenCachePath string
- location of oath token cache (default "/home/cgc/.adal/accessToken.json")
-```
-
-Example acquire a token for `https://management.core.windows.net/` using device code flow:
-
-```
-adal -mode device \
- -applicationId "APPLICATION_ID" \
- -tenantId "TENANT_ID" \
- -resource https://management.core.windows.net/
-
-```
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go b/vendor/github.com/Azure/go-autorest/autorest/adal/config.go
deleted file mode 100644
index fa5964742..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go
+++ /dev/null
@@ -1,151 +0,0 @@
-package adal
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "errors"
- "fmt"
- "net/url"
-)
-
-const (
- activeDirectoryEndpointTemplate = "%s/oauth2/%s%s"
-)
-
-// OAuthConfig represents the endpoints needed
-// in OAuth operations
-type OAuthConfig struct {
- AuthorityEndpoint url.URL `json:"authorityEndpoint"`
- AuthorizeEndpoint url.URL `json:"authorizeEndpoint"`
- TokenEndpoint url.URL `json:"tokenEndpoint"`
- DeviceCodeEndpoint url.URL `json:"deviceCodeEndpoint"`
-}
-
-// IsZero returns true if the OAuthConfig object is zero-initialized.
-func (oac OAuthConfig) IsZero() bool {
- return oac == OAuthConfig{}
-}
-
-func validateStringParam(param, name string) error {
- if len(param) == 0 {
- return fmt.Errorf("parameter '" + name + "' cannot be empty")
- }
- return nil
-}
-
-// NewOAuthConfig returns an OAuthConfig with tenant specific urls
-func NewOAuthConfig(activeDirectoryEndpoint, tenantID string) (*OAuthConfig, error) {
- apiVer := "1.0"
- return NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID, &apiVer)
-}
-
-// NewOAuthConfigWithAPIVersion returns an OAuthConfig with tenant specific urls.
-// If apiVersion is not nil the "api-version" query parameter will be appended to the endpoint URLs with the specified value.
-func NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID string, apiVersion *string) (*OAuthConfig, error) {
- if err := validateStringParam(activeDirectoryEndpoint, "activeDirectoryEndpoint"); err != nil {
- return nil, err
- }
- api := ""
- // it's legal for tenantID to be empty so don't validate it
- if apiVersion != nil {
- if err := validateStringParam(*apiVersion, "apiVersion"); err != nil {
- return nil, err
- }
- api = fmt.Sprintf("?api-version=%s", *apiVersion)
- }
- u, err := url.Parse(activeDirectoryEndpoint)
- if err != nil {
- return nil, err
- }
- authorityURL, err := u.Parse(tenantID)
- if err != nil {
- return nil, err
- }
- authorizeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "authorize", api))
- if err != nil {
- return nil, err
- }
- tokenURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "token", api))
- if err != nil {
- return nil, err
- }
- deviceCodeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "devicecode", api))
- if err != nil {
- return nil, err
- }
-
- return &OAuthConfig{
- AuthorityEndpoint: *authorityURL,
- AuthorizeEndpoint: *authorizeURL,
- TokenEndpoint: *tokenURL,
- DeviceCodeEndpoint: *deviceCodeURL,
- }, nil
-}
-
-// MultiTenantOAuthConfig provides endpoints for primary and aulixiary tenant IDs.
-type MultiTenantOAuthConfig interface {
- PrimaryTenant() *OAuthConfig
- AuxiliaryTenants() []*OAuthConfig
-}
-
-// OAuthOptions contains optional OAuthConfig creation arguments.
-type OAuthOptions struct {
- APIVersion string
-}
-
-func (c OAuthOptions) apiVersion() string {
- if c.APIVersion != "" {
- return fmt.Sprintf("?api-version=%s", c.APIVersion)
- }
- return "1.0"
-}
-
-// NewMultiTenantOAuthConfig creates an object that support multitenant OAuth configuration.
-// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/authenticate-multi-tenant for more information.
-func NewMultiTenantOAuthConfig(activeDirectoryEndpoint, primaryTenantID string, auxiliaryTenantIDs []string, options OAuthOptions) (MultiTenantOAuthConfig, error) {
- if len(auxiliaryTenantIDs) == 0 || len(auxiliaryTenantIDs) > 3 {
- return nil, errors.New("must specify one to three auxiliary tenants")
- }
- mtCfg := multiTenantOAuthConfig{
- cfgs: make([]*OAuthConfig, len(auxiliaryTenantIDs)+1),
- }
- apiVer := options.apiVersion()
- pri, err := NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, primaryTenantID, &apiVer)
- if err != nil {
- return nil, fmt.Errorf("failed to create OAuthConfig for primary tenant: %v", err)
- }
- mtCfg.cfgs[0] = pri
- for i := range auxiliaryTenantIDs {
- aux, err := NewOAuthConfig(activeDirectoryEndpoint, auxiliaryTenantIDs[i])
- if err != nil {
- return nil, fmt.Errorf("failed to create OAuthConfig for tenant '%s': %v", auxiliaryTenantIDs[i], err)
- }
- mtCfg.cfgs[i+1] = aux
- }
- return mtCfg, nil
-}
-
-type multiTenantOAuthConfig struct {
- // first config in the slice is the primary tenant
- cfgs []*OAuthConfig
-}
-
-func (m multiTenantOAuthConfig) PrimaryTenant() *OAuthConfig {
- return m.cfgs[0]
-}
-
-func (m multiTenantOAuthConfig) AuxiliaryTenants() []*OAuthConfig {
- return m.cfgs[1:]
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go b/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go
deleted file mode 100644
index 9daa4b58b..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go
+++ /dev/null
@@ -1,273 +0,0 @@
-package adal
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 file is largely based on rjw57/oauth2device's code, with the follow differences:
- * scope -> resource, and only allow a single one
- * receive "Message" in the DeviceCode struct and show it to users as the prompt
- * azure-xplat-cli has the following behavior that this emulates:
- - does not send client_secret during the token exchange
- - sends resource again in the token exchange request
-*/
-
-import (
- "context"
- "encoding/json"
- "fmt"
- "io/ioutil"
- "net/http"
- "net/url"
- "strings"
- "time"
-)
-
-const (
- logPrefix = "autorest/adal/devicetoken:"
-)
-
-var (
- // ErrDeviceGeneric represents an unknown error from the token endpoint when using device flow
- ErrDeviceGeneric = fmt.Errorf("%s Error while retrieving OAuth token: Unknown Error", logPrefix)
-
- // ErrDeviceAccessDenied represents an access denied error from the token endpoint when using device flow
- ErrDeviceAccessDenied = fmt.Errorf("%s Error while retrieving OAuth token: Access Denied", logPrefix)
-
- // ErrDeviceAuthorizationPending represents the server waiting on the user to complete the device flow
- ErrDeviceAuthorizationPending = fmt.Errorf("%s Error while retrieving OAuth token: Authorization Pending", logPrefix)
-
- // ErrDeviceCodeExpired represents the server timing out and expiring the code during device flow
- ErrDeviceCodeExpired = fmt.Errorf("%s Error while retrieving OAuth token: Code Expired", logPrefix)
-
- // ErrDeviceSlowDown represents the service telling us we're polling too often during device flow
- ErrDeviceSlowDown = fmt.Errorf("%s Error while retrieving OAuth token: Slow Down", logPrefix)
-
- // ErrDeviceCodeEmpty represents an empty device code from the device endpoint while using device flow
- ErrDeviceCodeEmpty = fmt.Errorf("%s Error while retrieving device code: Device Code Empty", logPrefix)
-
- // ErrOAuthTokenEmpty represents an empty OAuth token from the token endpoint when using device flow
- ErrOAuthTokenEmpty = fmt.Errorf("%s Error while retrieving OAuth token: Token Empty", logPrefix)
-
- errCodeSendingFails = "Error occurred while sending request for Device Authorization Code"
- errCodeHandlingFails = "Error occurred while handling response from the Device Endpoint"
- errTokenSendingFails = "Error occurred while sending request with device code for a token"
- errTokenHandlingFails = "Error occurred while handling response from the Token Endpoint (during device flow)"
- errStatusNotOK = "Error HTTP status != 200"
-)
-
-// DeviceCode is the object returned by the device auth endpoint
-// It contains information to instruct the user to complete the auth flow
-type DeviceCode struct {
- DeviceCode *string `json:"device_code,omitempty"`
- UserCode *string `json:"user_code,omitempty"`
- VerificationURL *string `json:"verification_url,omitempty"`
- ExpiresIn *int64 `json:"expires_in,string,omitempty"`
- Interval *int64 `json:"interval,string,omitempty"`
-
- Message *string `json:"message"` // Azure specific
- Resource string // store the following, stored when initiating, used when exchanging
- OAuthConfig OAuthConfig
- ClientID string
-}
-
-// TokenError is the object returned by the token exchange endpoint
-// when something is amiss
-type TokenError struct {
- Error *string `json:"error,omitempty"`
- ErrorCodes []int `json:"error_codes,omitempty"`
- ErrorDescription *string `json:"error_description,omitempty"`
- Timestamp *string `json:"timestamp,omitempty"`
- TraceID *string `json:"trace_id,omitempty"`
-}
-
-// DeviceToken is the object return by the token exchange endpoint
-// It can either look like a Token or an ErrorToken, so put both here
-// and check for presence of "Error" to know if we are in error state
-type deviceToken struct {
- Token
- TokenError
-}
-
-// InitiateDeviceAuth initiates a device auth flow. It returns a DeviceCode
-// that can be used with CheckForUserCompletion or WaitForUserCompletion.
-// Deprecated: use InitiateDeviceAuthWithContext() instead.
-func InitiateDeviceAuth(sender Sender, oauthConfig OAuthConfig, clientID, resource string) (*DeviceCode, error) {
- return InitiateDeviceAuthWithContext(context.Background(), sender, oauthConfig, clientID, resource)
-}
-
-// InitiateDeviceAuthWithContext initiates a device auth flow. It returns a DeviceCode
-// that can be used with CheckForUserCompletion or WaitForUserCompletion.
-func InitiateDeviceAuthWithContext(ctx context.Context, sender Sender, oauthConfig OAuthConfig, clientID, resource string) (*DeviceCode, error) {
- v := url.Values{
- "client_id": []string{clientID},
- "resource": []string{resource},
- }
-
- s := v.Encode()
- body := ioutil.NopCloser(strings.NewReader(s))
-
- req, err := http.NewRequest(http.MethodPost, oauthConfig.DeviceCodeEndpoint.String(), body)
- if err != nil {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeSendingFails, err.Error())
- }
-
- req.ContentLength = int64(len(s))
- req.Header.Set(contentType, mimeTypeFormPost)
- resp, err := sender.Do(req.WithContext(ctx))
- if err != nil {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeSendingFails, err.Error())
- }
- defer resp.Body.Close()
-
- rb, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, err.Error())
- }
-
- if resp.StatusCode != http.StatusOK {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, errStatusNotOK)
- }
-
- if len(strings.Trim(string(rb), " ")) == 0 {
- return nil, ErrDeviceCodeEmpty
- }
-
- var code DeviceCode
- err = json.Unmarshal(rb, &code)
- if err != nil {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, err.Error())
- }
-
- code.ClientID = clientID
- code.Resource = resource
- code.OAuthConfig = oauthConfig
-
- return &code, nil
-}
-
-// CheckForUserCompletion takes a DeviceCode and checks with the Azure AD OAuth endpoint
-// to see if the device flow has: been completed, timed out, or otherwise failed
-// Deprecated: use CheckForUserCompletionWithContext() instead.
-func CheckForUserCompletion(sender Sender, code *DeviceCode) (*Token, error) {
- return CheckForUserCompletionWithContext(context.Background(), sender, code)
-}
-
-// CheckForUserCompletionWithContext takes a DeviceCode and checks with the Azure AD OAuth endpoint
-// to see if the device flow has: been completed, timed out, or otherwise failed
-func CheckForUserCompletionWithContext(ctx context.Context, sender Sender, code *DeviceCode) (*Token, error) {
- v := url.Values{
- "client_id": []string{code.ClientID},
- "code": []string{*code.DeviceCode},
- "grant_type": []string{OAuthGrantTypeDeviceCode},
- "resource": []string{code.Resource},
- }
-
- s := v.Encode()
- body := ioutil.NopCloser(strings.NewReader(s))
-
- req, err := http.NewRequest(http.MethodPost, code.OAuthConfig.TokenEndpoint.String(), body)
- if err != nil {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenSendingFails, err.Error())
- }
-
- req.ContentLength = int64(len(s))
- req.Header.Set(contentType, mimeTypeFormPost)
- resp, err := sender.Do(req.WithContext(ctx))
- if err != nil {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenSendingFails, err.Error())
- }
- defer resp.Body.Close()
-
- rb, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenHandlingFails, err.Error())
- }
-
- if resp.StatusCode != http.StatusOK && len(strings.Trim(string(rb), " ")) == 0 {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenHandlingFails, errStatusNotOK)
- }
- if len(strings.Trim(string(rb), " ")) == 0 {
- return nil, ErrOAuthTokenEmpty
- }
-
- var token deviceToken
- err = json.Unmarshal(rb, &token)
- if err != nil {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenHandlingFails, err.Error())
- }
-
- if token.Error == nil {
- return &token.Token, nil
- }
-
- switch *token.Error {
- case "authorization_pending":
- return nil, ErrDeviceAuthorizationPending
- case "slow_down":
- return nil, ErrDeviceSlowDown
- case "access_denied":
- return nil, ErrDeviceAccessDenied
- case "code_expired":
- return nil, ErrDeviceCodeExpired
- default:
- // return a more meaningful error message if available
- if token.ErrorDescription != nil {
- return nil, fmt.Errorf("%s %s: %s", logPrefix, *token.Error, *token.ErrorDescription)
- }
- return nil, ErrDeviceGeneric
- }
-}
-
-// WaitForUserCompletion calls CheckForUserCompletion repeatedly until a token is granted or an error state occurs.
-// This prevents the user from looping and checking against 'ErrDeviceAuthorizationPending'.
-// Deprecated: use WaitForUserCompletionWithContext() instead.
-func WaitForUserCompletion(sender Sender, code *DeviceCode) (*Token, error) {
- return WaitForUserCompletionWithContext(context.Background(), sender, code)
-}
-
-// WaitForUserCompletionWithContext calls CheckForUserCompletion repeatedly until a token is granted or an error
-// state occurs. This prevents the user from looping and checking against 'ErrDeviceAuthorizationPending'.
-func WaitForUserCompletionWithContext(ctx context.Context, sender Sender, code *DeviceCode) (*Token, error) {
- intervalDuration := time.Duration(*code.Interval) * time.Second
- waitDuration := intervalDuration
-
- for {
- token, err := CheckForUserCompletionWithContext(ctx, sender, code)
-
- if err == nil {
- return token, nil
- }
-
- switch err {
- case ErrDeviceSlowDown:
- waitDuration += waitDuration
- case ErrDeviceAuthorizationPending:
- // noop
- default: // everything else is "fatal" to us
- return nil, err
- }
-
- if waitDuration > (intervalDuration * 3) {
- return nil, fmt.Errorf("%s Error waiting for user to complete device flow. Server told us to slow_down too much", logPrefix)
- }
-
- select {
- case <-time.After(waitDuration):
- // noop
- case <-ctx.Done():
- return nil, ctx.Err()
- }
- }
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/autorest/adal/go_mod_tidy_hack.go
deleted file mode 100644
index 647a61bb8..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/go_mod_tidy_hack.go
+++ /dev/null
@@ -1,25 +0,0 @@
-//go:build modhack
-// +build modhack
-
-package adal
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 file, and the github.com/Azure/go-autorest import, won't actually become part of
-// the resultant binary.
-
-// Necessary for safely adding multi-module repo.
-// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository
-import _ "github.com/Azure/go-autorest"
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go b/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go
deleted file mode 100644
index 2a974a39b..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go
+++ /dev/null
@@ -1,135 +0,0 @@
-package adal
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "crypto/rsa"
- "crypto/x509"
- "encoding/json"
- "errors"
- "fmt"
- "io/ioutil"
- "os"
- "path/filepath"
-
- "golang.org/x/crypto/pkcs12"
-)
-
-var (
- // ErrMissingCertificate is returned when no local certificate is found in the provided PFX data.
- ErrMissingCertificate = errors.New("adal: certificate missing")
-
- // ErrMissingPrivateKey is returned when no private key is found in the provided PFX data.
- ErrMissingPrivateKey = errors.New("adal: private key missing")
-)
-
-// LoadToken restores a Token object from a file located at 'path'.
-func LoadToken(path string) (*Token, error) {
- file, err := os.Open(path)
- if err != nil {
- return nil, fmt.Errorf("failed to open file (%s) while loading token: %v", path, err)
- }
- defer file.Close()
-
- var token Token
-
- dec := json.NewDecoder(file)
- if err = dec.Decode(&token); err != nil {
- return nil, fmt.Errorf("failed to decode contents of file (%s) into Token representation: %v", path, err)
- }
- return &token, nil
-}
-
-// SaveToken persists an oauth token at the given location on disk.
-// It moves the new file into place so it can safely be used to replace an existing file
-// that maybe accessed by multiple processes.
-func SaveToken(path string, mode os.FileMode, token Token) error {
- dir := filepath.Dir(path)
- err := os.MkdirAll(dir, os.ModePerm)
- if err != nil {
- return fmt.Errorf("failed to create directory (%s) to store token in: %v", dir, err)
- }
-
- newFile, err := ioutil.TempFile(dir, "token")
- if err != nil {
- return fmt.Errorf("failed to create the temp file to write the token: %v", err)
- }
- tempPath := newFile.Name()
-
- if err := json.NewEncoder(newFile).Encode(token); err != nil {
- return fmt.Errorf("failed to encode token to file (%s) while saving token: %v", tempPath, err)
- }
- if err := newFile.Close(); err != nil {
- return fmt.Errorf("failed to close temp file %s: %v", tempPath, err)
- }
-
- // Atomic replace to avoid multi-writer file corruptions
- if err := os.Rename(tempPath, path); err != nil {
- return fmt.Errorf("failed to move temporary token to desired output location. src=%s dst=%s: %v", tempPath, path, err)
- }
- if err := os.Chmod(path, mode); err != nil {
- return fmt.Errorf("failed to chmod the token file %s: %v", path, err)
- }
- return nil
-}
-
-// DecodePfxCertificateData extracts the x509 certificate and RSA private key from the provided PFX data.
-// The PFX data must contain a private key along with a certificate whose public key matches that of the
-// private key or an error is returned.
-// If the private key is not password protected pass the empty string for password.
-func DecodePfxCertificateData(pfxData []byte, password string) (*x509.Certificate, *rsa.PrivateKey, error) {
- blocks, err := pkcs12.ToPEM(pfxData, password)
- if err != nil {
- return nil, nil, err
- }
- // first extract the private key
- var priv *rsa.PrivateKey
- for _, block := range blocks {
- if block.Type == "PRIVATE KEY" {
- priv, err = x509.ParsePKCS1PrivateKey(block.Bytes)
- if err != nil {
- return nil, nil, err
- }
- break
- }
- }
- if priv == nil {
- return nil, nil, ErrMissingPrivateKey
- }
- // now find the certificate with the matching public key of our private key
- var cert *x509.Certificate
- for _, block := range blocks {
- if block.Type == "CERTIFICATE" {
- pcert, err := x509.ParseCertificate(block.Bytes)
- if err != nil {
- return nil, nil, err
- }
- certKey, ok := pcert.PublicKey.(*rsa.PublicKey)
- if !ok {
- // keep looking
- continue
- }
- if priv.E == certKey.E && priv.N.Cmp(certKey.N) == 0 {
- // found a match
- cert = pcert
- break
- }
- }
- }
- if cert == nil {
- return nil, nil, ErrMissingCertificate
- }
- return cert, priv, nil
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go b/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
deleted file mode 100644
index eb649bce9..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go
+++ /dev/null
@@ -1,101 +0,0 @@
-package adal
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "crypto/tls"
- "net"
- "net/http"
- "net/http/cookiejar"
- "sync"
- "time"
-
- "github.com/Azure/go-autorest/tracing"
-)
-
-const (
- contentType = "Content-Type"
- mimeTypeFormPost = "application/x-www-form-urlencoded"
-)
-
-// DO NOT ACCESS THIS DIRECTLY. go through sender()
-var defaultSender Sender
-var defaultSenderInit = &sync.Once{}
-
-// Sender is the interface that wraps the Do method to send HTTP requests.
-//
-// The standard http.Client conforms to this interface.
-type Sender interface {
- Do(*http.Request) (*http.Response, error)
-}
-
-// SenderFunc is a method that implements the Sender interface.
-type SenderFunc func(*http.Request) (*http.Response, error)
-
-// Do implements the Sender interface on SenderFunc.
-func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) {
- return sf(r)
-}
-
-// SendDecorator takes and possibly decorates, by wrapping, a Sender. Decorators may affect the
-// http.Request and pass it along or, first, pass the http.Request along then react to the
-// http.Response result.
-type SendDecorator func(Sender) Sender
-
-// CreateSender creates, decorates, and returns, as a Sender, the default http.Client.
-func CreateSender(decorators ...SendDecorator) Sender {
- return DecorateSender(sender(), decorators...)
-}
-
-// DecorateSender accepts a Sender and a, possibly empty, set of SendDecorators, which is applies to
-// the Sender. Decorators are applied in the order received, but their affect upon the request
-// depends on whether they are a pre-decorator (change the http.Request and then pass it along) or a
-// post-decorator (pass the http.Request along and react to the results in http.Response).
-func DecorateSender(s Sender, decorators ...SendDecorator) Sender {
- for _, decorate := range decorators {
- s = decorate(s)
- }
- return s
-}
-
-func sender() Sender {
- // note that we can't init defaultSender in init() since it will
- // execute before calling code has had a chance to enable tracing
- defaultSenderInit.Do(func() {
- // copied from http.DefaultTransport with a TLS minimum version.
- transport := &http.Transport{
- Proxy: http.ProxyFromEnvironment,
- DialContext: (&net.Dialer{
- Timeout: 30 * time.Second,
- KeepAlive: 30 * time.Second,
- }).DialContext,
- ForceAttemptHTTP2: true,
- MaxIdleConns: 100,
- IdleConnTimeout: 90 * time.Second,
- TLSHandshakeTimeout: 10 * time.Second,
- ExpectContinueTimeout: 1 * time.Second,
- TLSClientConfig: &tls.Config{
- MinVersion: tls.VersionTLS12,
- },
- }
- var roundTripper http.RoundTripper = transport
- if tracing.IsEnabled() {
- roundTripper = tracing.NewTransport(transport)
- }
- j, _ := cookiejar.New(nil)
- defaultSender = &http.Client{Jar: j, Transport: roundTripper}
- })
- return defaultSender
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go
deleted file mode 100644
index 1a9c8ab53..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go
+++ /dev/null
@@ -1,1396 +0,0 @@
-package adal
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "context"
- "crypto/rand"
- "crypto/rsa"
- "crypto/sha1"
- "crypto/x509"
- "encoding/base64"
- "encoding/json"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "math"
- "net/http"
- "net/url"
- "os"
- "strconv"
- "strings"
- "sync"
- "time"
-
- "github.com/Azure/go-autorest/autorest/date"
- "github.com/Azure/go-autorest/logger"
- "github.com/golang-jwt/jwt/v4"
-)
-
-const (
- defaultRefresh = 5 * time.Minute
-
- // OAuthGrantTypeDeviceCode is the "grant_type" identifier used in device flow
- OAuthGrantTypeDeviceCode = "device_code"
-
- // OAuthGrantTypeClientCredentials is the "grant_type" identifier used in credential flows
- OAuthGrantTypeClientCredentials = "client_credentials"
-
- // OAuthGrantTypeUserPass is the "grant_type" identifier used in username and password auth flows
- OAuthGrantTypeUserPass = "password"
-
- // OAuthGrantTypeRefreshToken is the "grant_type" identifier used in refresh token flows
- OAuthGrantTypeRefreshToken = "refresh_token"
-
- // OAuthGrantTypeAuthorizationCode is the "grant_type" identifier used in authorization code flows
- OAuthGrantTypeAuthorizationCode = "authorization_code"
-
- // metadataHeader is the header required by MSI extension
- metadataHeader = "Metadata"
-
- // msiEndpoint is the well known endpoint for getting MSI authentications tokens
- msiEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token"
-
- // the API version to use for the MSI endpoint
- msiAPIVersion = "2018-02-01"
-
- // the default number of attempts to refresh an MSI authentication token
- defaultMaxMSIRefreshAttempts = 5
-
- // asMSIEndpointEnv is the environment variable used to store the endpoint on App Service and Functions
- msiEndpointEnv = "MSI_ENDPOINT"
-
- // asMSISecretEnv is the environment variable used to store the request secret on App Service and Functions
- msiSecretEnv = "MSI_SECRET"
-
- // the API version to use for the legacy App Service MSI endpoint
- appServiceAPIVersion2017 = "2017-09-01"
-
- // secret header used when authenticating against app service MSI endpoint
- secretHeader = "Secret"
-
- // the format for expires_on in UTC with AM/PM
- expiresOnDateFormatPM = "1/2/2006 15:04:05 PM +00:00"
-
- // the format for expires_on in UTC without AM/PM
- expiresOnDateFormat = "1/2/2006 15:04:05 +00:00"
-)
-
-// OAuthTokenProvider is an interface which should be implemented by an access token retriever
-type OAuthTokenProvider interface {
- OAuthToken() string
-}
-
-// MultitenantOAuthTokenProvider provides tokens used for multi-tenant authorization.
-type MultitenantOAuthTokenProvider interface {
- PrimaryOAuthToken() string
- AuxiliaryOAuthTokens() []string
-}
-
-// TokenRefreshError is an interface used by errors returned during token refresh.
-type TokenRefreshError interface {
- error
- Response() *http.Response
-}
-
-// Refresher is an interface for token refresh functionality
-type Refresher interface {
- Refresh() error
- RefreshExchange(resource string) error
- EnsureFresh() error
-}
-
-// RefresherWithContext is an interface for token refresh functionality
-type RefresherWithContext interface {
- RefreshWithContext(ctx context.Context) error
- RefreshExchangeWithContext(ctx context.Context, resource string) error
- EnsureFreshWithContext(ctx context.Context) error
-}
-
-// TokenRefreshCallback is the type representing callbacks that will be called after
-// a successful token refresh
-type TokenRefreshCallback func(Token) error
-
-// TokenRefresh is a type representing a custom callback to refresh a token
-type TokenRefresh func(ctx context.Context, resource string) (*Token, error)
-
-// Token encapsulates the access token used to authorize Azure requests.
-// https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow#service-to-service-access-token-response
-type Token struct {
- AccessToken string `json:"access_token"`
- RefreshToken string `json:"refresh_token"`
-
- ExpiresIn json.Number `json:"expires_in"`
- ExpiresOn json.Number `json:"expires_on"`
- NotBefore json.Number `json:"not_before"`
-
- Resource string `json:"resource"`
- Type string `json:"token_type"`
-}
-
-func newToken() Token {
- return Token{
- ExpiresIn: "0",
- ExpiresOn: "0",
- NotBefore: "0",
- }
-}
-
-// IsZero returns true if the token object is zero-initialized.
-func (t Token) IsZero() bool {
- return t == Token{}
-}
-
-// Expires returns the time.Time when the Token expires.
-func (t Token) Expires() time.Time {
- s, err := t.ExpiresOn.Float64()
- if err != nil {
- s = -3600
- }
-
- expiration := date.NewUnixTimeFromSeconds(s)
-
- return time.Time(expiration).UTC()
-}
-
-// IsExpired returns true if the Token is expired, false otherwise.
-func (t Token) IsExpired() bool {
- return t.WillExpireIn(0)
-}
-
-// WillExpireIn returns true if the Token will expire after the passed time.Duration interval
-// from now, false otherwise.
-func (t Token) WillExpireIn(d time.Duration) bool {
- return !t.Expires().After(time.Now().Add(d))
-}
-
-//OAuthToken return the current access token
-func (t *Token) OAuthToken() string {
- return t.AccessToken
-}
-
-// ServicePrincipalSecret is an interface that allows various secret mechanism to fill the form
-// that is submitted when acquiring an oAuth token.
-type ServicePrincipalSecret interface {
- SetAuthenticationValues(spt *ServicePrincipalToken, values *url.Values) error
-}
-
-// ServicePrincipalNoSecret represents a secret type that contains no secret
-// meaning it is not valid for fetching a fresh token. This is used by Manual
-type ServicePrincipalNoSecret struct {
-}
-
-// SetAuthenticationValues is a method of the interface ServicePrincipalSecret
-// It only returns an error for the ServicePrincipalNoSecret type
-func (noSecret *ServicePrincipalNoSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
- return fmt.Errorf("Manually created ServicePrincipalToken does not contain secret material to retrieve a new access token")
-}
-
-// MarshalJSON implements the json.Marshaler interface.
-func (noSecret ServicePrincipalNoSecret) MarshalJSON() ([]byte, error) {
- type tokenType struct {
- Type string `json:"type"`
- }
- return json.Marshal(tokenType{
- Type: "ServicePrincipalNoSecret",
- })
-}
-
-// ServicePrincipalTokenSecret implements ServicePrincipalSecret for client_secret type authorization.
-type ServicePrincipalTokenSecret struct {
- ClientSecret string `json:"value"`
-}
-
-// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
-// It will populate the form submitted during oAuth Token Acquisition using the client_secret.
-func (tokenSecret *ServicePrincipalTokenSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
- v.Set("client_secret", tokenSecret.ClientSecret)
- return nil
-}
-
-// MarshalJSON implements the json.Marshaler interface.
-func (tokenSecret ServicePrincipalTokenSecret) MarshalJSON() ([]byte, error) {
- type tokenType struct {
- Type string `json:"type"`
- Value string `json:"value"`
- }
- return json.Marshal(tokenType{
- Type: "ServicePrincipalTokenSecret",
- Value: tokenSecret.ClientSecret,
- })
-}
-
-// ServicePrincipalCertificateSecret implements ServicePrincipalSecret for generic RSA cert auth with signed JWTs.
-type ServicePrincipalCertificateSecret struct {
- Certificate *x509.Certificate
- PrivateKey *rsa.PrivateKey
-}
-
-// SignJwt returns the JWT signed with the certificate's private key.
-func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalToken) (string, error) {
- hasher := sha1.New()
- _, err := hasher.Write(secret.Certificate.Raw)
- if err != nil {
- return "", err
- }
-
- thumbprint := base64.URLEncoding.EncodeToString(hasher.Sum(nil))
-
- // The jti (JWT ID) claim provides a unique identifier for the JWT.
- jti := make([]byte, 20)
- _, err = rand.Read(jti)
- if err != nil {
- return "", err
- }
-
- token := jwt.New(jwt.SigningMethodRS256)
- token.Header["x5t"] = thumbprint
- x5c := []string{base64.StdEncoding.EncodeToString(secret.Certificate.Raw)}
- token.Header["x5c"] = x5c
- token.Claims = jwt.MapClaims{
- "aud": spt.inner.OauthConfig.TokenEndpoint.String(),
- "iss": spt.inner.ClientID,
- "sub": spt.inner.ClientID,
- "jti": base64.URLEncoding.EncodeToString(jti),
- "nbf": time.Now().Unix(),
- "exp": time.Now().Add(24 * time.Hour).Unix(),
- }
-
- signedString, err := token.SignedString(secret.PrivateKey)
- return signedString, err
-}
-
-// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
-// It will populate the form submitted during oAuth Token Acquisition using a JWT signed with a certificate.
-func (secret *ServicePrincipalCertificateSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
- jwt, err := secret.SignJwt(spt)
- if err != nil {
- return err
- }
-
- v.Set("client_assertion", jwt)
- v.Set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer")
- return nil
-}
-
-// MarshalJSON implements the json.Marshaler interface.
-func (secret ServicePrincipalCertificateSecret) MarshalJSON() ([]byte, error) {
- return nil, errors.New("marshalling ServicePrincipalCertificateSecret is not supported")
-}
-
-// ServicePrincipalMSISecret implements ServicePrincipalSecret for machines running the MSI Extension.
-type ServicePrincipalMSISecret struct {
- msiType msiType
- clientResourceID string
-}
-
-// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
-func (msiSecret *ServicePrincipalMSISecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
- return nil
-}
-
-// MarshalJSON implements the json.Marshaler interface.
-func (msiSecret ServicePrincipalMSISecret) MarshalJSON() ([]byte, error) {
- return nil, errors.New("marshalling ServicePrincipalMSISecret is not supported")
-}
-
-// ServicePrincipalUsernamePasswordSecret implements ServicePrincipalSecret for username and password auth.
-type ServicePrincipalUsernamePasswordSecret struct {
- Username string `json:"username"`
- Password string `json:"password"`
-}
-
-// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
-func (secret *ServicePrincipalUsernamePasswordSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
- v.Set("username", secret.Username)
- v.Set("password", secret.Password)
- return nil
-}
-
-// MarshalJSON implements the json.Marshaler interface.
-func (secret ServicePrincipalUsernamePasswordSecret) MarshalJSON() ([]byte, error) {
- type tokenType struct {
- Type string `json:"type"`
- Username string `json:"username"`
- Password string `json:"password"`
- }
- return json.Marshal(tokenType{
- Type: "ServicePrincipalUsernamePasswordSecret",
- Username: secret.Username,
- Password: secret.Password,
- })
-}
-
-// ServicePrincipalAuthorizationCodeSecret implements ServicePrincipalSecret for authorization code auth.
-type ServicePrincipalAuthorizationCodeSecret struct {
- ClientSecret string `json:"value"`
- AuthorizationCode string `json:"authCode"`
- RedirectURI string `json:"redirect"`
-}
-
-// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
-func (secret *ServicePrincipalAuthorizationCodeSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
- v.Set("code", secret.AuthorizationCode)
- v.Set("client_secret", secret.ClientSecret)
- v.Set("redirect_uri", secret.RedirectURI)
- return nil
-}
-
-// MarshalJSON implements the json.Marshaler interface.
-func (secret ServicePrincipalAuthorizationCodeSecret) MarshalJSON() ([]byte, error) {
- type tokenType struct {
- Type string `json:"type"`
- Value string `json:"value"`
- AuthCode string `json:"authCode"`
- Redirect string `json:"redirect"`
- }
- return json.Marshal(tokenType{
- Type: "ServicePrincipalAuthorizationCodeSecret",
- Value: secret.ClientSecret,
- AuthCode: secret.AuthorizationCode,
- Redirect: secret.RedirectURI,
- })
-}
-
-// ServicePrincipalFederatedSecret implements ServicePrincipalSecret for Federated JWTs.
-type ServicePrincipalFederatedSecret struct {
- jwt string
-}
-
-// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
-// It will populate the form submitted during OAuth Token Acquisition using a JWT signed by an OIDC issuer.
-func (secret *ServicePrincipalFederatedSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
-
- v.Set("client_assertion", secret.jwt)
- v.Set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer")
- return nil
-}
-
-// MarshalJSON implements the json.Marshaler interface.
-func (secret ServicePrincipalFederatedSecret) MarshalJSON() ([]byte, error) {
- return nil, errors.New("marshalling ServicePrincipalFederatedSecret is not supported")
-}
-
-// ServicePrincipalToken encapsulates a Token created for a Service Principal.
-type ServicePrincipalToken struct {
- inner servicePrincipalToken
- refreshLock *sync.RWMutex
- sender Sender
- customRefreshFunc TokenRefresh
- refreshCallbacks []TokenRefreshCallback
- // MaxMSIRefreshAttempts is the maximum number of attempts to refresh an MSI token.
- // Settings this to a value less than 1 will use the default value.
- MaxMSIRefreshAttempts int
-}
-
-// MarshalTokenJSON returns the marshalled inner token.
-func (spt ServicePrincipalToken) MarshalTokenJSON() ([]byte, error) {
- return json.Marshal(spt.inner.Token)
-}
-
-// SetRefreshCallbacks replaces any existing refresh callbacks with the specified callbacks.
-func (spt *ServicePrincipalToken) SetRefreshCallbacks(callbacks []TokenRefreshCallback) {
- spt.refreshCallbacks = callbacks
-}
-
-// SetCustomRefreshFunc sets a custom refresh function used to refresh the token.
-func (spt *ServicePrincipalToken) SetCustomRefreshFunc(customRefreshFunc TokenRefresh) {
- spt.customRefreshFunc = customRefreshFunc
-}
-
-// MarshalJSON implements the json.Marshaler interface.
-func (spt ServicePrincipalToken) MarshalJSON() ([]byte, error) {
- return json.Marshal(spt.inner)
-}
-
-// UnmarshalJSON implements the json.Unmarshaler interface.
-func (spt *ServicePrincipalToken) UnmarshalJSON(data []byte) error {
- // need to determine the token type
- raw := map[string]interface{}{}
- err := json.Unmarshal(data, &raw)
- if err != nil {
- return err
- }
- secret := raw["secret"].(map[string]interface{})
- switch secret["type"] {
- case "ServicePrincipalNoSecret":
- spt.inner.Secret = &ServicePrincipalNoSecret{}
- case "ServicePrincipalTokenSecret":
- spt.inner.Secret = &ServicePrincipalTokenSecret{}
- case "ServicePrincipalCertificateSecret":
- return errors.New("unmarshalling ServicePrincipalCertificateSecret is not supported")
- case "ServicePrincipalMSISecret":
- return errors.New("unmarshalling ServicePrincipalMSISecret is not supported")
- case "ServicePrincipalUsernamePasswordSecret":
- spt.inner.Secret = &ServicePrincipalUsernamePasswordSecret{}
- case "ServicePrincipalAuthorizationCodeSecret":
- spt.inner.Secret = &ServicePrincipalAuthorizationCodeSecret{}
- case "ServicePrincipalFederatedSecret":
- return errors.New("unmarshalling ServicePrincipalFederatedSecret is not supported")
- default:
- return fmt.Errorf("unrecognized token type '%s'", secret["type"])
- }
- err = json.Unmarshal(data, &spt.inner)
- if err != nil {
- return err
- }
- // Don't override the refreshLock or the sender if those have been already set.
- if spt.refreshLock == nil {
- spt.refreshLock = &sync.RWMutex{}
- }
- if spt.sender == nil {
- spt.sender = sender()
- }
- return nil
-}
-
-// internal type used for marshalling/unmarshalling
-type servicePrincipalToken struct {
- Token Token `json:"token"`
- Secret ServicePrincipalSecret `json:"secret"`
- OauthConfig OAuthConfig `json:"oauth"`
- ClientID string `json:"clientID"`
- Resource string `json:"resource"`
- AutoRefresh bool `json:"autoRefresh"`
- RefreshWithin time.Duration `json:"refreshWithin"`
-}
-
-func validateOAuthConfig(oac OAuthConfig) error {
- if oac.IsZero() {
- return fmt.Errorf("parameter 'oauthConfig' cannot be zero-initialized")
- }
- return nil
-}
-
-// NewServicePrincipalTokenWithSecret create a ServicePrincipalToken using the supplied ServicePrincipalSecret implementation.
-func NewServicePrincipalTokenWithSecret(oauthConfig OAuthConfig, id string, resource string, secret ServicePrincipalSecret, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if err := validateOAuthConfig(oauthConfig); err != nil {
- return nil, err
- }
- if err := validateStringParam(id, "id"); err != nil {
- return nil, err
- }
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
- if secret == nil {
- return nil, fmt.Errorf("parameter 'secret' cannot be nil")
- }
- spt := &ServicePrincipalToken{
- inner: servicePrincipalToken{
- Token: newToken(),
- OauthConfig: oauthConfig,
- Secret: secret,
- ClientID: id,
- Resource: resource,
- AutoRefresh: true,
- RefreshWithin: defaultRefresh,
- },
- refreshLock: &sync.RWMutex{},
- sender: sender(),
- refreshCallbacks: callbacks,
- }
- return spt, nil
-}
-
-// NewServicePrincipalTokenFromManualToken creates a ServicePrincipalToken using the supplied token
-func NewServicePrincipalTokenFromManualToken(oauthConfig OAuthConfig, clientID string, resource string, token Token, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if err := validateOAuthConfig(oauthConfig); err != nil {
- return nil, err
- }
- if err := validateStringParam(clientID, "clientID"); err != nil {
- return nil, err
- }
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
- if token.IsZero() {
- return nil, fmt.Errorf("parameter 'token' cannot be zero-initialized")
- }
- spt, err := NewServicePrincipalTokenWithSecret(
- oauthConfig,
- clientID,
- resource,
- &ServicePrincipalNoSecret{},
- callbacks...)
- if err != nil {
- return nil, err
- }
-
- spt.inner.Token = token
-
- return spt, nil
-}
-
-// NewServicePrincipalTokenFromManualTokenSecret creates a ServicePrincipalToken using the supplied token and secret
-func NewServicePrincipalTokenFromManualTokenSecret(oauthConfig OAuthConfig, clientID string, resource string, token Token, secret ServicePrincipalSecret, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if err := validateOAuthConfig(oauthConfig); err != nil {
- return nil, err
- }
- if err := validateStringParam(clientID, "clientID"); err != nil {
- return nil, err
- }
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
- if secret == nil {
- return nil, fmt.Errorf("parameter 'secret' cannot be nil")
- }
- if token.IsZero() {
- return nil, fmt.Errorf("parameter 'token' cannot be zero-initialized")
- }
- spt, err := NewServicePrincipalTokenWithSecret(
- oauthConfig,
- clientID,
- resource,
- secret,
- callbacks...)
- if err != nil {
- return nil, err
- }
-
- spt.inner.Token = token
-
- return spt, nil
-}
-
-// NewServicePrincipalToken creates a ServicePrincipalToken from the supplied Service Principal
-// credentials scoped to the named resource.
-func NewServicePrincipalToken(oauthConfig OAuthConfig, clientID string, secret string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if err := validateOAuthConfig(oauthConfig); err != nil {
- return nil, err
- }
- if err := validateStringParam(clientID, "clientID"); err != nil {
- return nil, err
- }
- if err := validateStringParam(secret, "secret"); err != nil {
- return nil, err
- }
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
- return NewServicePrincipalTokenWithSecret(
- oauthConfig,
- clientID,
- resource,
- &ServicePrincipalTokenSecret{
- ClientSecret: secret,
- },
- callbacks...,
- )
-}
-
-// NewServicePrincipalTokenFromCertificate creates a ServicePrincipalToken from the supplied pkcs12 bytes.
-func NewServicePrincipalTokenFromCertificate(oauthConfig OAuthConfig, clientID string, certificate *x509.Certificate, privateKey *rsa.PrivateKey, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if err := validateOAuthConfig(oauthConfig); err != nil {
- return nil, err
- }
- if err := validateStringParam(clientID, "clientID"); err != nil {
- return nil, err
- }
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
- if certificate == nil {
- return nil, fmt.Errorf("parameter 'certificate' cannot be nil")
- }
- if privateKey == nil {
- return nil, fmt.Errorf("parameter 'privateKey' cannot be nil")
- }
- return NewServicePrincipalTokenWithSecret(
- oauthConfig,
- clientID,
- resource,
- &ServicePrincipalCertificateSecret{
- PrivateKey: privateKey,
- Certificate: certificate,
- },
- callbacks...,
- )
-}
-
-// NewServicePrincipalTokenFromUsernamePassword creates a ServicePrincipalToken from the username and password.
-func NewServicePrincipalTokenFromUsernamePassword(oauthConfig OAuthConfig, clientID string, username string, password string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if err := validateOAuthConfig(oauthConfig); err != nil {
- return nil, err
- }
- if err := validateStringParam(clientID, "clientID"); err != nil {
- return nil, err
- }
- if err := validateStringParam(username, "username"); err != nil {
- return nil, err
- }
- if err := validateStringParam(password, "password"); err != nil {
- return nil, err
- }
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
- return NewServicePrincipalTokenWithSecret(
- oauthConfig,
- clientID,
- resource,
- &ServicePrincipalUsernamePasswordSecret{
- Username: username,
- Password: password,
- },
- callbacks...,
- )
-}
-
-// NewServicePrincipalTokenFromAuthorizationCode creates a ServicePrincipalToken from the
-func NewServicePrincipalTokenFromAuthorizationCode(oauthConfig OAuthConfig, clientID string, clientSecret string, authorizationCode string, redirectURI string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
-
- if err := validateOAuthConfig(oauthConfig); err != nil {
- return nil, err
- }
- if err := validateStringParam(clientID, "clientID"); err != nil {
- return nil, err
- }
- if err := validateStringParam(clientSecret, "clientSecret"); err != nil {
- return nil, err
- }
- if err := validateStringParam(authorizationCode, "authorizationCode"); err != nil {
- return nil, err
- }
- if err := validateStringParam(redirectURI, "redirectURI"); err != nil {
- return nil, err
- }
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
-
- return NewServicePrincipalTokenWithSecret(
- oauthConfig,
- clientID,
- resource,
- &ServicePrincipalAuthorizationCodeSecret{
- ClientSecret: clientSecret,
- AuthorizationCode: authorizationCode,
- RedirectURI: redirectURI,
- },
- callbacks...,
- )
-}
-
-// NewServicePrincipalTokenFromFederatedToken creates a ServicePrincipalToken from the supplied federated OIDC JWT.
-func NewServicePrincipalTokenFromFederatedToken(oauthConfig OAuthConfig, clientID string, jwt string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if err := validateOAuthConfig(oauthConfig); err != nil {
- return nil, err
- }
- if err := validateStringParam(clientID, "clientID"); err != nil {
- return nil, err
- }
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
- if jwt == "" {
- return nil, fmt.Errorf("parameter 'jwt' cannot be empty")
- }
- return NewServicePrincipalTokenWithSecret(
- oauthConfig,
- clientID,
- resource,
- &ServicePrincipalFederatedSecret{
- jwt: jwt,
- },
- callbacks...,
- )
-}
-
-type msiType int
-
-const (
- msiTypeUnavailable msiType = iota
- msiTypeAppServiceV20170901
- msiTypeCloudShell
- msiTypeIMDS
-)
-
-func (m msiType) String() string {
- switch m {
- case msiTypeAppServiceV20170901:
- return "AppServiceV20170901"
- case msiTypeCloudShell:
- return "CloudShell"
- case msiTypeIMDS:
- return "IMDS"
- default:
- return fmt.Sprintf("unhandled MSI type %d", m)
- }
-}
-
-// returns the MSI type and endpoint, or an error
-func getMSIType() (msiType, string, error) {
- if endpointEnvVar := os.Getenv(msiEndpointEnv); endpointEnvVar != "" {
- // if the env var MSI_ENDPOINT is set
- if secretEnvVar := os.Getenv(msiSecretEnv); secretEnvVar != "" {
- // if BOTH the env vars MSI_ENDPOINT and MSI_SECRET are set the msiType is AppService
- return msiTypeAppServiceV20170901, endpointEnvVar, nil
- }
- // if ONLY the env var MSI_ENDPOINT is set the msiType is CloudShell
- return msiTypeCloudShell, endpointEnvVar, nil
- }
- // if MSI_ENDPOINT is NOT set assume the msiType is IMDS
- return msiTypeIMDS, msiEndpoint, nil
-}
-
-// GetMSIVMEndpoint gets the MSI endpoint on Virtual Machines.
-// NOTE: this always returns the IMDS endpoint, it does not work for app services or cloud shell.
-// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint.
-func GetMSIVMEndpoint() (string, error) {
- return msiEndpoint, nil
-}
-
-// GetMSIAppServiceEndpoint get the MSI endpoint for App Service and Functions.
-// It will return an error when not running in an app service/functions environment.
-// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint.
-func GetMSIAppServiceEndpoint() (string, error) {
- msiType, endpoint, err := getMSIType()
- if err != nil {
- return "", err
- }
- switch msiType {
- case msiTypeAppServiceV20170901:
- return endpoint, nil
- default:
- return "", fmt.Errorf("%s is not app service environment", msiType)
- }
-}
-
-// GetMSIEndpoint get the appropriate MSI endpoint depending on the runtime environment
-// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint.
-func GetMSIEndpoint() (string, error) {
- _, endpoint, err := getMSIType()
- return endpoint, err
-}
-
-// NewServicePrincipalTokenFromMSI creates a ServicePrincipalToken via the MSI VM Extension.
-// It will use the system assigned identity when creating the token.
-// msiEndpoint - empty string, or pass a non-empty string to override the default value.
-// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead.
-func NewServicePrincipalTokenFromMSI(msiEndpoint, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- return newServicePrincipalTokenFromMSI(msiEndpoint, resource, "", "", callbacks...)
-}
-
-// NewServicePrincipalTokenFromMSIWithUserAssignedID creates a ServicePrincipalToken via the MSI VM Extension.
-// It will use the clientID of specified user assigned identity when creating the token.
-// msiEndpoint - empty string, or pass a non-empty string to override the default value.
-// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead.
-func NewServicePrincipalTokenFromMSIWithUserAssignedID(msiEndpoint, resource string, userAssignedID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if err := validateStringParam(userAssignedID, "userAssignedID"); err != nil {
- return nil, err
- }
- return newServicePrincipalTokenFromMSI(msiEndpoint, resource, userAssignedID, "", callbacks...)
-}
-
-// NewServicePrincipalTokenFromMSIWithIdentityResourceID creates a ServicePrincipalToken via the MSI VM Extension.
-// It will use the azure resource id of user assigned identity when creating the token.
-// msiEndpoint - empty string, or pass a non-empty string to override the default value.
-// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead.
-func NewServicePrincipalTokenFromMSIWithIdentityResourceID(msiEndpoint, resource string, identityResourceID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if err := validateStringParam(identityResourceID, "identityResourceID"); err != nil {
- return nil, err
- }
- return newServicePrincipalTokenFromMSI(msiEndpoint, resource, "", identityResourceID, callbacks...)
-}
-
-// ManagedIdentityOptions contains optional values for configuring managed identity authentication.
-type ManagedIdentityOptions struct {
- // ClientID is the user-assigned identity to use during authentication.
- // It is mutually exclusive with IdentityResourceID.
- ClientID string
-
- // IdentityResourceID is the resource ID of the user-assigned identity to use during authentication.
- // It is mutually exclusive with ClientID.
- IdentityResourceID string
-}
-
-// NewServicePrincipalTokenFromManagedIdentity creates a ServicePrincipalToken using a managed identity.
-// It supports the following managed identity environments.
-// - App Service Environment (API version 2017-09-01 only)
-// - Cloud shell
-// - IMDS with a system or user assigned identity
-func NewServicePrincipalTokenFromManagedIdentity(resource string, options *ManagedIdentityOptions, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if options == nil {
- options = &ManagedIdentityOptions{}
- }
- return newServicePrincipalTokenFromMSI("", resource, options.ClientID, options.IdentityResourceID, callbacks...)
-}
-
-func newServicePrincipalTokenFromMSI(msiEndpoint, resource, userAssignedID, identityResourceID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
- if userAssignedID != "" && identityResourceID != "" {
- return nil, errors.New("cannot specify userAssignedID and identityResourceID")
- }
- msiType, endpoint, err := getMSIType()
- if err != nil {
- logger.Instance.Writef(logger.LogError, "Error determining managed identity environment: %v\n", err)
- return nil, err
- }
- logger.Instance.Writef(logger.LogInfo, "Managed identity environment is %s, endpoint is %s\n", msiType, endpoint)
- if msiEndpoint != "" {
- endpoint = msiEndpoint
- logger.Instance.Writef(logger.LogInfo, "Managed identity custom endpoint is %s\n", endpoint)
- }
- msiEndpointURL, err := url.Parse(endpoint)
- if err != nil {
- return nil, err
- }
- // cloud shell sends its data in the request body
- if msiType != msiTypeCloudShell {
- v := url.Values{}
- v.Set("resource", resource)
- clientIDParam := "client_id"
- switch msiType {
- case msiTypeAppServiceV20170901:
- clientIDParam = "clientid"
- v.Set("api-version", appServiceAPIVersion2017)
- break
- case msiTypeIMDS:
- v.Set("api-version", msiAPIVersion)
- }
- if userAssignedID != "" {
- v.Set(clientIDParam, userAssignedID)
- } else if identityResourceID != "" {
- v.Set("mi_res_id", identityResourceID)
- }
- msiEndpointURL.RawQuery = v.Encode()
- }
-
- spt := &ServicePrincipalToken{
- inner: servicePrincipalToken{
- Token: newToken(),
- OauthConfig: OAuthConfig{
- TokenEndpoint: *msiEndpointURL,
- },
- Secret: &ServicePrincipalMSISecret{
- msiType: msiType,
- clientResourceID: identityResourceID,
- },
- Resource: resource,
- AutoRefresh: true,
- RefreshWithin: defaultRefresh,
- ClientID: userAssignedID,
- },
- refreshLock: &sync.RWMutex{},
- sender: sender(),
- refreshCallbacks: callbacks,
- MaxMSIRefreshAttempts: defaultMaxMSIRefreshAttempts,
- }
-
- return spt, nil
-}
-
-// internal type that implements TokenRefreshError
-type tokenRefreshError struct {
- message string
- resp *http.Response
-}
-
-// Error implements the error interface which is part of the TokenRefreshError interface.
-func (tre tokenRefreshError) Error() string {
- return tre.message
-}
-
-// Response implements the TokenRefreshError interface, it returns the raw HTTP response from the refresh operation.
-func (tre tokenRefreshError) Response() *http.Response {
- return tre.resp
-}
-
-func newTokenRefreshError(message string, resp *http.Response) TokenRefreshError {
- return tokenRefreshError{message: message, resp: resp}
-}
-
-// EnsureFresh will refresh the token if it will expire within the refresh window (as set by
-// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use.
-func (spt *ServicePrincipalToken) EnsureFresh() error {
- return spt.EnsureFreshWithContext(context.Background())
-}
-
-// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by
-// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use.
-func (spt *ServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error {
- // must take the read lock when initially checking the token's expiration
- if spt.inner.AutoRefresh && spt.Token().WillExpireIn(spt.inner.RefreshWithin) {
- // take the write lock then check again to see if the token was already refreshed
- spt.refreshLock.Lock()
- defer spt.refreshLock.Unlock()
- if spt.inner.Token.WillExpireIn(spt.inner.RefreshWithin) {
- return spt.refreshInternal(ctx, spt.inner.Resource)
- }
- }
- return nil
-}
-
-// InvokeRefreshCallbacks calls any TokenRefreshCallbacks that were added to the SPT during initialization
-func (spt *ServicePrincipalToken) InvokeRefreshCallbacks(token Token) error {
- if spt.refreshCallbacks != nil {
- for _, callback := range spt.refreshCallbacks {
- err := callback(spt.inner.Token)
- if err != nil {
- return fmt.Errorf("adal: TokenRefreshCallback handler failed. Error = '%v'", err)
- }
- }
- }
- return nil
-}
-
-// Refresh obtains a fresh token for the Service Principal.
-// This method is safe for concurrent use.
-func (spt *ServicePrincipalToken) Refresh() error {
- return spt.RefreshWithContext(context.Background())
-}
-
-// RefreshWithContext obtains a fresh token for the Service Principal.
-// This method is safe for concurrent use.
-func (spt *ServicePrincipalToken) RefreshWithContext(ctx context.Context) error {
- spt.refreshLock.Lock()
- defer spt.refreshLock.Unlock()
- return spt.refreshInternal(ctx, spt.inner.Resource)
-}
-
-// RefreshExchange refreshes the token, but for a different resource.
-// This method is safe for concurrent use.
-func (spt *ServicePrincipalToken) RefreshExchange(resource string) error {
- return spt.RefreshExchangeWithContext(context.Background(), resource)
-}
-
-// RefreshExchangeWithContext refreshes the token, but for a different resource.
-// This method is safe for concurrent use.
-func (spt *ServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error {
- spt.refreshLock.Lock()
- defer spt.refreshLock.Unlock()
- return spt.refreshInternal(ctx, resource)
-}
-
-func (spt *ServicePrincipalToken) getGrantType() string {
- switch spt.inner.Secret.(type) {
- case *ServicePrincipalUsernamePasswordSecret:
- return OAuthGrantTypeUserPass
- case *ServicePrincipalAuthorizationCodeSecret:
- return OAuthGrantTypeAuthorizationCode
- default:
- return OAuthGrantTypeClientCredentials
- }
-}
-
-func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource string) error {
- if spt.customRefreshFunc != nil {
- token, err := spt.customRefreshFunc(ctx, resource)
- if err != nil {
- return err
- }
- spt.inner.Token = *token
- return spt.InvokeRefreshCallbacks(spt.inner.Token)
- }
- req, err := http.NewRequest(http.MethodPost, spt.inner.OauthConfig.TokenEndpoint.String(), nil)
- if err != nil {
- return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err)
- }
- req.Header.Add("User-Agent", UserAgent())
- req = req.WithContext(ctx)
- var resp *http.Response
- authBodyFilter := func(b []byte) []byte {
- if logger.Level() != logger.LogAuth {
- return []byte("**REDACTED** authentication body")
- }
- return b
- }
- if msiSecret, ok := spt.inner.Secret.(*ServicePrincipalMSISecret); ok {
- switch msiSecret.msiType {
- case msiTypeAppServiceV20170901:
- req.Method = http.MethodGet
- req.Header.Set("secret", os.Getenv(msiSecretEnv))
- break
- case msiTypeCloudShell:
- req.Header.Set("Metadata", "true")
- data := url.Values{}
- data.Set("resource", spt.inner.Resource)
- if spt.inner.ClientID != "" {
- data.Set("client_id", spt.inner.ClientID)
- } else if msiSecret.clientResourceID != "" {
- data.Set("msi_res_id", msiSecret.clientResourceID)
- }
- req.Body = ioutil.NopCloser(strings.NewReader(data.Encode()))
- req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
- break
- case msiTypeIMDS:
- req.Method = http.MethodGet
- req.Header.Set("Metadata", "true")
- break
- }
- logger.Instance.WriteRequest(req, logger.Filter{Body: authBodyFilter})
- resp, err = retryForIMDS(spt.sender, req, spt.MaxMSIRefreshAttempts)
- } else {
- v := url.Values{}
- v.Set("client_id", spt.inner.ClientID)
- v.Set("resource", resource)
-
- if spt.inner.Token.RefreshToken != "" {
- v.Set("grant_type", OAuthGrantTypeRefreshToken)
- v.Set("refresh_token", spt.inner.Token.RefreshToken)
- // web apps must specify client_secret when refreshing tokens
- // see https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code#refreshing-the-access-tokens
- if spt.getGrantType() == OAuthGrantTypeAuthorizationCode {
- err := spt.inner.Secret.SetAuthenticationValues(spt, &v)
- if err != nil {
- return err
- }
- }
- } else {
- v.Set("grant_type", spt.getGrantType())
- err := spt.inner.Secret.SetAuthenticationValues(spt, &v)
- if err != nil {
- return err
- }
- }
-
- s := v.Encode()
- body := ioutil.NopCloser(strings.NewReader(s))
- req.ContentLength = int64(len(s))
- req.Header.Set(contentType, mimeTypeFormPost)
- req.Body = body
- logger.Instance.WriteRequest(req, logger.Filter{Body: authBodyFilter})
- resp, err = spt.sender.Do(req)
- }
-
- // don't return a TokenRefreshError here; this will allow retry logic to apply
- if err != nil {
- return fmt.Errorf("adal: Failed to execute the refresh request. Error = '%v'", err)
- } else if resp == nil {
- return fmt.Errorf("adal: received nil response and error")
- }
-
- logger.Instance.WriteResponse(resp, logger.Filter{Body: authBodyFilter})
- defer resp.Body.Close()
- rb, err := ioutil.ReadAll(resp.Body)
-
- if resp.StatusCode != http.StatusOK {
- if err != nil {
- return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Failed reading response body: %v Endpoint %s", resp.StatusCode, err, req.URL.String()), resp)
- }
- return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Response body: %s Endpoint %s", resp.StatusCode, string(rb), req.URL.String()), resp)
- }
-
- // for the following error cases don't return a TokenRefreshError. the operation succeeded
- // but some transient failure happened during deserialization. by returning a generic error
- // the retry logic will kick in (we don't retry on TokenRefreshError).
-
- if err != nil {
- return fmt.Errorf("adal: Failed to read a new service principal token during refresh. Error = '%v'", err)
- }
- if len(strings.Trim(string(rb), " ")) == 0 {
- return fmt.Errorf("adal: Empty service principal token received during refresh")
- }
- token := struct {
- AccessToken string `json:"access_token"`
- RefreshToken string `json:"refresh_token"`
-
- // AAD returns expires_in as a string, ADFS returns it as an int
- ExpiresIn json.Number `json:"expires_in"`
- // expires_on can be in three formats, a UTC time stamp, or the number of seconds as a string *or* int.
- ExpiresOn interface{} `json:"expires_on"`
- NotBefore json.Number `json:"not_before"`
-
- Resource string `json:"resource"`
- Type string `json:"token_type"`
- }{}
- // return a TokenRefreshError in the follow error cases as the token is in an unexpected format
- err = json.Unmarshal(rb, &token)
- if err != nil {
- return newTokenRefreshError(fmt.Sprintf("adal: Failed to unmarshal the service principal token during refresh. Error = '%v' JSON = '%s'", err, string(rb)), resp)
- }
- expiresOn := json.Number("")
- // ADFS doesn't include the expires_on field
- if token.ExpiresOn != nil {
- if expiresOn, err = parseExpiresOn(token.ExpiresOn); err != nil {
- return newTokenRefreshError(fmt.Sprintf("adal: failed to parse expires_on: %v value '%s'", err, token.ExpiresOn), resp)
- }
- }
- spt.inner.Token.AccessToken = token.AccessToken
- spt.inner.Token.RefreshToken = token.RefreshToken
- spt.inner.Token.ExpiresIn = token.ExpiresIn
- spt.inner.Token.ExpiresOn = expiresOn
- spt.inner.Token.NotBefore = token.NotBefore
- spt.inner.Token.Resource = token.Resource
- spt.inner.Token.Type = token.Type
-
- return spt.InvokeRefreshCallbacks(spt.inner.Token)
-}
-
-// converts expires_on to the number of seconds
-func parseExpiresOn(s interface{}) (json.Number, error) {
- // the JSON unmarshaler treats JSON numbers unmarshaled into an interface{} as float64
- asFloat64, ok := s.(float64)
- if ok {
- // this is the number of seconds as int case
- return json.Number(strconv.FormatInt(int64(asFloat64), 10)), nil
- }
- asStr, ok := s.(string)
- if !ok {
- return "", fmt.Errorf("unexpected expires_on type %T", s)
- }
- // convert the expiration date to the number of seconds from the unix epoch
- timeToDuration := func(t time.Time) json.Number {
- return json.Number(strconv.FormatInt(t.UTC().Unix(), 10))
- }
- if _, err := json.Number(asStr).Int64(); err == nil {
- // this is the number of seconds case, no conversion required
- return json.Number(asStr), nil
- } else if eo, err := time.Parse(expiresOnDateFormatPM, asStr); err == nil {
- return timeToDuration(eo), nil
- } else if eo, err := time.Parse(expiresOnDateFormat, asStr); err == nil {
- return timeToDuration(eo), nil
- } else {
- // unknown format
- return json.Number(""), err
- }
-}
-
-// retry logic specific to retrieving a token from the IMDS endpoint
-func retryForIMDS(sender Sender, req *http.Request, maxAttempts int) (resp *http.Response, err error) {
- // copied from client.go due to circular dependency
- retries := []int{
- http.StatusRequestTimeout, // 408
- http.StatusTooManyRequests, // 429
- http.StatusInternalServerError, // 500
- http.StatusBadGateway, // 502
- http.StatusServiceUnavailable, // 503
- http.StatusGatewayTimeout, // 504
- }
- // extra retry status codes specific to IMDS
- retries = append(retries,
- http.StatusNotFound,
- http.StatusGone,
- // all remaining 5xx
- http.StatusNotImplemented,
- http.StatusHTTPVersionNotSupported,
- http.StatusVariantAlsoNegotiates,
- http.StatusInsufficientStorage,
- http.StatusLoopDetected,
- http.StatusNotExtended,
- http.StatusNetworkAuthenticationRequired)
-
- // see https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/how-to-use-vm-token#retry-guidance
-
- const maxDelay time.Duration = 60 * time.Second
-
- attempt := 0
- delay := time.Duration(0)
-
- // maxAttempts is user-specified, ensure that its value is greater than zero else no request will be made
- if maxAttempts < 1 {
- maxAttempts = defaultMaxMSIRefreshAttempts
- }
-
- for attempt < maxAttempts {
- if resp != nil && resp.Body != nil {
- io.Copy(ioutil.Discard, resp.Body)
- resp.Body.Close()
- }
- resp, err = sender.Do(req)
- // we want to retry if err is not nil or the status code is in the list of retry codes
- if err == nil && !responseHasStatusCode(resp, retries...) {
- return
- }
-
- // perform exponential backoff with a cap.
- // must increment attempt before calculating delay.
- attempt++
- // the base value of 2 is the "delta backoff" as specified in the guidance doc
- delay += (time.Duration(math.Pow(2, float64(attempt))) * time.Second)
- if delay > maxDelay {
- delay = maxDelay
- }
-
- select {
- case <-time.After(delay):
- // intentionally left blank
- case <-req.Context().Done():
- err = req.Context().Err()
- return
- }
- }
- return
-}
-
-func responseHasStatusCode(resp *http.Response, codes ...int) bool {
- if resp != nil {
- for _, i := range codes {
- if i == resp.StatusCode {
- return true
- }
- }
- }
- return false
-}
-
-// SetAutoRefresh enables or disables automatic refreshing of stale tokens.
-func (spt *ServicePrincipalToken) SetAutoRefresh(autoRefresh bool) {
- spt.inner.AutoRefresh = autoRefresh
-}
-
-// SetRefreshWithin sets the interval within which if the token will expire, EnsureFresh will
-// refresh the token.
-func (spt *ServicePrincipalToken) SetRefreshWithin(d time.Duration) {
- spt.inner.RefreshWithin = d
- return
-}
-
-// SetSender sets the http.Client used when obtaining the Service Principal token. An
-// undecorated http.Client is used by default.
-func (spt *ServicePrincipalToken) SetSender(s Sender) { spt.sender = s }
-
-// OAuthToken implements the OAuthTokenProvider interface. It returns the current access token.
-func (spt *ServicePrincipalToken) OAuthToken() string {
- spt.refreshLock.RLock()
- defer spt.refreshLock.RUnlock()
- return spt.inner.Token.OAuthToken()
-}
-
-// Token returns a copy of the current token.
-func (spt *ServicePrincipalToken) Token() Token {
- spt.refreshLock.RLock()
- defer spt.refreshLock.RUnlock()
- return spt.inner.Token
-}
-
-// MultiTenantServicePrincipalToken contains tokens for multi-tenant authorization.
-type MultiTenantServicePrincipalToken struct {
- PrimaryToken *ServicePrincipalToken
- AuxiliaryTokens []*ServicePrincipalToken
-}
-
-// PrimaryOAuthToken returns the primary authorization token.
-func (mt *MultiTenantServicePrincipalToken) PrimaryOAuthToken() string {
- return mt.PrimaryToken.OAuthToken()
-}
-
-// AuxiliaryOAuthTokens returns one to three auxiliary authorization tokens.
-func (mt *MultiTenantServicePrincipalToken) AuxiliaryOAuthTokens() []string {
- tokens := make([]string, len(mt.AuxiliaryTokens))
- for i := range mt.AuxiliaryTokens {
- tokens[i] = mt.AuxiliaryTokens[i].OAuthToken()
- }
- return tokens
-}
-
-// NewMultiTenantServicePrincipalToken creates a new MultiTenantServicePrincipalToken with the specified credentials and resource.
-func NewMultiTenantServicePrincipalToken(multiTenantCfg MultiTenantOAuthConfig, clientID string, secret string, resource string) (*MultiTenantServicePrincipalToken, error) {
- if err := validateStringParam(clientID, "clientID"); err != nil {
- return nil, err
- }
- if err := validateStringParam(secret, "secret"); err != nil {
- return nil, err
- }
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
- auxTenants := multiTenantCfg.AuxiliaryTenants()
- m := MultiTenantServicePrincipalToken{
- AuxiliaryTokens: make([]*ServicePrincipalToken, len(auxTenants)),
- }
- primary, err := NewServicePrincipalToken(*multiTenantCfg.PrimaryTenant(), clientID, secret, resource)
- if err != nil {
- return nil, fmt.Errorf("failed to create SPT for primary tenant: %v", err)
- }
- m.PrimaryToken = primary
- for i := range auxTenants {
- aux, err := NewServicePrincipalToken(*auxTenants[i], clientID, secret, resource)
- if err != nil {
- return nil, fmt.Errorf("failed to create SPT for auxiliary tenant: %v", err)
- }
- m.AuxiliaryTokens[i] = aux
- }
- return &m, nil
-}
-
-// NewMultiTenantServicePrincipalTokenFromCertificate creates a new MultiTenantServicePrincipalToken with the specified certificate credentials and resource.
-func NewMultiTenantServicePrincipalTokenFromCertificate(multiTenantCfg MultiTenantOAuthConfig, clientID string, certificate *x509.Certificate, privateKey *rsa.PrivateKey, resource string) (*MultiTenantServicePrincipalToken, error) {
- if err := validateStringParam(clientID, "clientID"); err != nil {
- return nil, err
- }
- if err := validateStringParam(resource, "resource"); err != nil {
- return nil, err
- }
- if certificate == nil {
- return nil, fmt.Errorf("parameter 'certificate' cannot be nil")
- }
- if privateKey == nil {
- return nil, fmt.Errorf("parameter 'privateKey' cannot be nil")
- }
- auxTenants := multiTenantCfg.AuxiliaryTenants()
- m := MultiTenantServicePrincipalToken{
- AuxiliaryTokens: make([]*ServicePrincipalToken, len(auxTenants)),
- }
- primary, err := NewServicePrincipalTokenWithSecret(
- *multiTenantCfg.PrimaryTenant(),
- clientID,
- resource,
- &ServicePrincipalCertificateSecret{
- PrivateKey: privateKey,
- Certificate: certificate,
- },
- )
- if err != nil {
- return nil, fmt.Errorf("failed to create SPT for primary tenant: %v", err)
- }
- m.PrimaryToken = primary
- for i := range auxTenants {
- aux, err := NewServicePrincipalTokenWithSecret(
- *auxTenants[i],
- clientID,
- resource,
- &ServicePrincipalCertificateSecret{
- PrivateKey: privateKey,
- Certificate: certificate,
- },
- )
- if err != nil {
- return nil, fmt.Errorf("failed to create SPT for auxiliary tenant: %v", err)
- }
- m.AuxiliaryTokens[i] = aux
- }
- return &m, nil
-}
-
-// MSIAvailable returns true if the MSI endpoint is available for authentication.
-func MSIAvailable(ctx context.Context, s Sender) bool {
- msiType, _, err := getMSIType()
-
- if err != nil {
- return false
- }
-
- if msiType != msiTypeIMDS {
- return true
- }
-
- if s == nil {
- s = sender()
- }
-
- resp, err := getMSIEndpoint(ctx, s)
-
- if err == nil {
- resp.Body.Close()
- }
-
- return err == nil
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go
deleted file mode 100644
index 89190a421..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go
+++ /dev/null
@@ -1,76 +0,0 @@
-//go:build go1.13
-// +build go1.13
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package adal
-
-import (
- "context"
- "fmt"
- "net/http"
- "time"
-)
-
-func getMSIEndpoint(ctx context.Context, sender Sender) (*http.Response, error) {
- tempCtx, cancel := context.WithTimeout(ctx, 2*time.Second)
- defer cancel()
- // http.NewRequestWithContext() was added in Go 1.13
- req, _ := http.NewRequestWithContext(tempCtx, http.MethodGet, msiEndpoint, nil)
- q := req.URL.Query()
- q.Add("api-version", msiAPIVersion)
- req.URL.RawQuery = q.Encode()
- return sender.Do(req)
-}
-
-// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by
-// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use.
-func (mt *MultiTenantServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error {
- if err := mt.PrimaryToken.EnsureFreshWithContext(ctx); err != nil {
- return fmt.Errorf("failed to refresh primary token: %w", err)
- }
- for _, aux := range mt.AuxiliaryTokens {
- if err := aux.EnsureFreshWithContext(ctx); err != nil {
- return fmt.Errorf("failed to refresh auxiliary token: %w", err)
- }
- }
- return nil
-}
-
-// RefreshWithContext obtains a fresh token for the Service Principal.
-func (mt *MultiTenantServicePrincipalToken) RefreshWithContext(ctx context.Context) error {
- if err := mt.PrimaryToken.RefreshWithContext(ctx); err != nil {
- return fmt.Errorf("failed to refresh primary token: %w", err)
- }
- for _, aux := range mt.AuxiliaryTokens {
- if err := aux.RefreshWithContext(ctx); err != nil {
- return fmt.Errorf("failed to refresh auxiliary token: %w", err)
- }
- }
- return nil
-}
-
-// RefreshExchangeWithContext refreshes the token, but for a different resource.
-func (mt *MultiTenantServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error {
- if err := mt.PrimaryToken.RefreshExchangeWithContext(ctx, resource); err != nil {
- return fmt.Errorf("failed to refresh primary token: %w", err)
- }
- for _, aux := range mt.AuxiliaryTokens {
- if err := aux.RefreshExchangeWithContext(ctx, resource); err != nil {
- return fmt.Errorf("failed to refresh auxiliary token: %w", err)
- }
- }
- return nil
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go
deleted file mode 100644
index 27ec4efad..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go
+++ /dev/null
@@ -1,75 +0,0 @@
-//go:build !go1.13
-// +build !go1.13
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package adal
-
-import (
- "context"
- "net/http"
- "time"
-)
-
-func getMSIEndpoint(ctx context.Context, sender Sender) (*http.Response, error) {
- tempCtx, cancel := context.WithTimeout(ctx, 2*time.Second)
- defer cancel()
- req, _ := http.NewRequest(http.MethodGet, msiEndpoint, nil)
- req = req.WithContext(tempCtx)
- q := req.URL.Query()
- q.Add("api-version", msiAPIVersion)
- req.URL.RawQuery = q.Encode()
- return sender.Do(req)
-}
-
-// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by
-// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use.
-func (mt *MultiTenantServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error {
- if err := mt.PrimaryToken.EnsureFreshWithContext(ctx); err != nil {
- return err
- }
- for _, aux := range mt.AuxiliaryTokens {
- if err := aux.EnsureFreshWithContext(ctx); err != nil {
- return err
- }
- }
- return nil
-}
-
-// RefreshWithContext obtains a fresh token for the Service Principal.
-func (mt *MultiTenantServicePrincipalToken) RefreshWithContext(ctx context.Context) error {
- if err := mt.PrimaryToken.RefreshWithContext(ctx); err != nil {
- return err
- }
- for _, aux := range mt.AuxiliaryTokens {
- if err := aux.RefreshWithContext(ctx); err != nil {
- return err
- }
- }
- return nil
-}
-
-// RefreshExchangeWithContext refreshes the token, but for a different resource.
-func (mt *MultiTenantServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error {
- if err := mt.PrimaryToken.RefreshExchangeWithContext(ctx, resource); err != nil {
- return err
- }
- for _, aux := range mt.AuxiliaryTokens {
- if err := aux.RefreshExchangeWithContext(ctx, resource); err != nil {
- return err
- }
- }
- return nil
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/version.go b/vendor/github.com/Azure/go-autorest/autorest/adal/version.go
deleted file mode 100644
index c867b3484..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/adal/version.go
+++ /dev/null
@@ -1,45 +0,0 @@
-package adal
-
-import (
- "fmt"
- "runtime"
-)
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-const number = "v1.0.0"
-
-var (
- ua = fmt.Sprintf("Go/%s (%s-%s) go-autorest/adal/%s",
- runtime.Version(),
- runtime.GOARCH,
- runtime.GOOS,
- number,
- )
-)
-
-// UserAgent returns a string containing the Go version, system architecture and OS, and the adal version.
-func UserAgent() string {
- return ua
-}
-
-// AddToUserAgent adds an extension to the current user agent
-func AddToUserAgent(extension string) error {
- if extension != "" {
- ua = fmt.Sprintf("%s %s", ua, extension)
- return nil
- }
- return fmt.Errorf("Extension was empty, User Agent remained as '%s'", ua)
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization.go b/vendor/github.com/Azure/go-autorest/autorest/authorization.go
deleted file mode 100644
index 1226c4111..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/authorization.go
+++ /dev/null
@@ -1,353 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "crypto/tls"
- "encoding/base64"
- "fmt"
- "net/http"
- "net/url"
- "strings"
-
- "github.com/Azure/go-autorest/autorest/adal"
-)
-
-const (
- bearerChallengeHeader = "Www-Authenticate"
- bearer = "Bearer"
- tenantID = "tenantID"
- apiKeyAuthorizerHeader = "Ocp-Apim-Subscription-Key"
- bingAPISdkHeader = "X-BingApis-SDK-Client"
- golangBingAPISdkHeaderValue = "Go-SDK"
- authorization = "Authorization"
- basic = "Basic"
-)
-
-// Authorizer is the interface that provides a PrepareDecorator used to supply request
-// authorization. Most often, the Authorizer decorator runs last so it has access to the full
-// state of the formed HTTP request.
-type Authorizer interface {
- WithAuthorization() PrepareDecorator
-}
-
-// NullAuthorizer implements a default, "do nothing" Authorizer.
-type NullAuthorizer struct{}
-
-// WithAuthorization returns a PrepareDecorator that does nothing.
-func (na NullAuthorizer) WithAuthorization() PrepareDecorator {
- return WithNothing()
-}
-
-// APIKeyAuthorizer implements API Key authorization.
-type APIKeyAuthorizer struct {
- headers map[string]interface{}
- queryParameters map[string]interface{}
-}
-
-// NewAPIKeyAuthorizerWithHeaders creates an ApiKeyAuthorizer with headers.
-func NewAPIKeyAuthorizerWithHeaders(headers map[string]interface{}) *APIKeyAuthorizer {
- return NewAPIKeyAuthorizer(headers, nil)
-}
-
-// NewAPIKeyAuthorizerWithQueryParameters creates an ApiKeyAuthorizer with query parameters.
-func NewAPIKeyAuthorizerWithQueryParameters(queryParameters map[string]interface{}) *APIKeyAuthorizer {
- return NewAPIKeyAuthorizer(nil, queryParameters)
-}
-
-// NewAPIKeyAuthorizer creates an ApiKeyAuthorizer with headers.
-func NewAPIKeyAuthorizer(headers map[string]interface{}, queryParameters map[string]interface{}) *APIKeyAuthorizer {
- return &APIKeyAuthorizer{headers: headers, queryParameters: queryParameters}
-}
-
-// WithAuthorization returns a PrepareDecorator that adds an HTTP headers and Query Parameters.
-func (aka *APIKeyAuthorizer) WithAuthorization() PrepareDecorator {
- return func(p Preparer) Preparer {
- return DecoratePreparer(p, WithHeaders(aka.headers), WithQueryParameters(aka.queryParameters))
- }
-}
-
-// CognitiveServicesAuthorizer implements authorization for Cognitive Services.
-type CognitiveServicesAuthorizer struct {
- subscriptionKey string
-}
-
-// NewCognitiveServicesAuthorizer is
-func NewCognitiveServicesAuthorizer(subscriptionKey string) *CognitiveServicesAuthorizer {
- return &CognitiveServicesAuthorizer{subscriptionKey: subscriptionKey}
-}
-
-// WithAuthorization is
-func (csa *CognitiveServicesAuthorizer) WithAuthorization() PrepareDecorator {
- headers := make(map[string]interface{})
- headers[apiKeyAuthorizerHeader] = csa.subscriptionKey
- headers[bingAPISdkHeader] = golangBingAPISdkHeaderValue
-
- return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization()
-}
-
-// BearerAuthorizer implements the bearer authorization
-type BearerAuthorizer struct {
- tokenProvider adal.OAuthTokenProvider
-}
-
-// NewBearerAuthorizer crates a BearerAuthorizer using the given token provider
-func NewBearerAuthorizer(tp adal.OAuthTokenProvider) *BearerAuthorizer {
- return &BearerAuthorizer{tokenProvider: tp}
-}
-
-// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose
-// value is "Bearer " followed by the token.
-//
-// By default, the token will be automatically refreshed through the Refresher interface.
-func (ba *BearerAuthorizer) WithAuthorization() PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- // the ordering is important here, prefer RefresherWithContext if available
- if refresher, ok := ba.tokenProvider.(adal.RefresherWithContext); ok {
- err = refresher.EnsureFreshWithContext(r.Context())
- } else if refresher, ok := ba.tokenProvider.(adal.Refresher); ok {
- err = refresher.EnsureFresh()
- }
- if err != nil {
- var resp *http.Response
- if tokError, ok := err.(adal.TokenRefreshError); ok {
- resp = tokError.Response()
- }
- return r, NewErrorWithError(err, "azure.BearerAuthorizer", "WithAuthorization", resp,
- "Failed to refresh the Token for request to %s", r.URL)
- }
- return Prepare(r, WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", ba.tokenProvider.OAuthToken())))
- }
- return r, err
- })
- }
-}
-
-// TokenProvider returns OAuthTokenProvider so that it can be used for authorization outside the REST.
-func (ba *BearerAuthorizer) TokenProvider() adal.OAuthTokenProvider {
- return ba.tokenProvider
-}
-
-// BearerAuthorizerCallbackFunc is the authentication callback signature.
-type BearerAuthorizerCallbackFunc func(tenantID, resource string) (*BearerAuthorizer, error)
-
-// BearerAuthorizerCallback implements bearer authorization via a callback.
-type BearerAuthorizerCallback struct {
- sender Sender
- callback BearerAuthorizerCallbackFunc
-}
-
-// NewBearerAuthorizerCallback creates a bearer authorization callback. The callback
-// is invoked when the HTTP request is submitted.
-func NewBearerAuthorizerCallback(s Sender, callback BearerAuthorizerCallbackFunc) *BearerAuthorizerCallback {
- if s == nil {
- s = sender(tls.RenegotiateNever)
- }
- return &BearerAuthorizerCallback{sender: s, callback: callback}
-}
-
-// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose value
-// is "Bearer " followed by the token. The BearerAuthorizer is obtained via a user-supplied callback.
-//
-// By default, the token will be automatically refreshed through the Refresher interface.
-func (bacb *BearerAuthorizerCallback) WithAuthorization() PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- // make a copy of the request and remove the body as it's not
- // required and avoids us having to create a copy of it.
- rCopy := *r
- removeRequestBody(&rCopy)
-
- resp, err := bacb.sender.Do(&rCopy)
- if err != nil {
- return r, err
- }
- DrainResponseBody(resp)
- if resp.StatusCode == 401 && hasBearerChallenge(resp.Header) {
- bc, err := newBearerChallenge(resp.Header)
- if err != nil {
- return r, err
- }
- if bacb.callback != nil {
- ba, err := bacb.callback(bc.values[tenantID], bc.values["resource"])
- if err != nil {
- return r, err
- }
- return Prepare(r, ba.WithAuthorization())
- }
- }
- }
- return r, err
- })
- }
-}
-
-// returns true if the HTTP response contains a bearer challenge
-func hasBearerChallenge(header http.Header) bool {
- authHeader := header.Get(bearerChallengeHeader)
- if len(authHeader) == 0 || strings.Index(authHeader, bearer) < 0 {
- return false
- }
- return true
-}
-
-type bearerChallenge struct {
- values map[string]string
-}
-
-func newBearerChallenge(header http.Header) (bc bearerChallenge, err error) {
- challenge := strings.TrimSpace(header.Get(bearerChallengeHeader))
- trimmedChallenge := challenge[len(bearer)+1:]
-
- // challenge is a set of key=value pairs that are comma delimited
- pairs := strings.Split(trimmedChallenge, ",")
- if len(pairs) < 1 {
- err = fmt.Errorf("challenge '%s' contains no pairs", challenge)
- return bc, err
- }
-
- bc.values = make(map[string]string)
- for i := range pairs {
- trimmedPair := strings.TrimSpace(pairs[i])
- pair := strings.Split(trimmedPair, "=")
- if len(pair) == 2 {
- // remove the enclosing quotes
- key := strings.Trim(pair[0], "\"")
- value := strings.Trim(pair[1], "\"")
-
- switch key {
- case "authorization", "authorization_uri":
- // strip the tenant ID from the authorization URL
- asURL, err := url.Parse(value)
- if err != nil {
- return bc, err
- }
- bc.values[tenantID] = asURL.Path[1:]
- default:
- bc.values[key] = value
- }
- }
- }
-
- return bc, err
-}
-
-// EventGridKeyAuthorizer implements authorization for event grid using key authentication.
-type EventGridKeyAuthorizer struct {
- topicKey string
-}
-
-// NewEventGridKeyAuthorizer creates a new EventGridKeyAuthorizer
-// with the specified topic key.
-func NewEventGridKeyAuthorizer(topicKey string) EventGridKeyAuthorizer {
- return EventGridKeyAuthorizer{topicKey: topicKey}
-}
-
-// WithAuthorization returns a PrepareDecorator that adds the aeg-sas-key authentication header.
-func (egta EventGridKeyAuthorizer) WithAuthorization() PrepareDecorator {
- headers := map[string]interface{}{
- "aeg-sas-key": egta.topicKey,
- }
- return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization()
-}
-
-// BasicAuthorizer implements basic HTTP authorization by adding the Authorization HTTP header
-// with the value "Basic " where is a base64-encoded username:password tuple.
-type BasicAuthorizer struct {
- userName string
- password string
-}
-
-// NewBasicAuthorizer creates a new BasicAuthorizer with the specified username and password.
-func NewBasicAuthorizer(userName, password string) *BasicAuthorizer {
- return &BasicAuthorizer{
- userName: userName,
- password: password,
- }
-}
-
-// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose
-// value is "Basic " followed by the base64-encoded username:password tuple.
-func (ba *BasicAuthorizer) WithAuthorization() PrepareDecorator {
- headers := make(map[string]interface{})
- headers[authorization] = basic + " " + base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", ba.userName, ba.password)))
-
- return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization()
-}
-
-// MultiTenantServicePrincipalTokenAuthorizer provides authentication across tenants.
-type MultiTenantServicePrincipalTokenAuthorizer interface {
- WithAuthorization() PrepareDecorator
-}
-
-// NewMultiTenantServicePrincipalTokenAuthorizer crates a BearerAuthorizer using the given token provider
-func NewMultiTenantServicePrincipalTokenAuthorizer(tp adal.MultitenantOAuthTokenProvider) MultiTenantServicePrincipalTokenAuthorizer {
- return NewMultiTenantBearerAuthorizer(tp)
-}
-
-// MultiTenantBearerAuthorizer implements bearer authorization across multiple tenants.
-type MultiTenantBearerAuthorizer struct {
- tp adal.MultitenantOAuthTokenProvider
-}
-
-// NewMultiTenantBearerAuthorizer creates a MultiTenantBearerAuthorizer using the given token provider.
-func NewMultiTenantBearerAuthorizer(tp adal.MultitenantOAuthTokenProvider) *MultiTenantBearerAuthorizer {
- return &MultiTenantBearerAuthorizer{tp: tp}
-}
-
-// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header using the
-// primary token along with the auxiliary authorization header using the auxiliary tokens.
-//
-// By default, the token will be automatically refreshed through the Refresher interface.
-func (mt *MultiTenantBearerAuthorizer) WithAuthorization() PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err != nil {
- return r, err
- }
- if refresher, ok := mt.tp.(adal.RefresherWithContext); ok {
- err = refresher.EnsureFreshWithContext(r.Context())
- if err != nil {
- var resp *http.Response
- if tokError, ok := err.(adal.TokenRefreshError); ok {
- resp = tokError.Response()
- }
- return r, NewErrorWithError(err, "azure.multiTenantSPTAuthorizer", "WithAuthorization", resp,
- "Failed to refresh one or more Tokens for request to %s", r.URL)
- }
- }
- r, err = Prepare(r, WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", mt.tp.PrimaryOAuthToken())))
- if err != nil {
- return r, err
- }
- auxTokens := mt.tp.AuxiliaryOAuthTokens()
- for i := range auxTokens {
- auxTokens[i] = fmt.Sprintf("Bearer %s", auxTokens[i])
- }
- return Prepare(r, WithHeader(headerAuxAuthorization, strings.Join(auxTokens, ", ")))
- })
- }
-}
-
-// TokenProvider returns the underlying MultitenantOAuthTokenProvider for this authorizer.
-func (mt *MultiTenantBearerAuthorizer) TokenProvider() adal.MultitenantOAuthTokenProvider {
- return mt.tp
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go b/vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go
deleted file mode 100644
index 66501493b..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go
+++ /dev/null
@@ -1,66 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "fmt"
- "net/http"
- "strings"
-)
-
-// SASTokenAuthorizer implements an authorization for SAS Token Authentication
-// this can be used for interaction with Blob Storage Endpoints
-type SASTokenAuthorizer struct {
- sasToken string
-}
-
-// NewSASTokenAuthorizer creates a SASTokenAuthorizer using the given credentials
-func NewSASTokenAuthorizer(sasToken string) (*SASTokenAuthorizer, error) {
- if strings.TrimSpace(sasToken) == "" {
- return nil, fmt.Errorf("sasToken cannot be empty")
- }
-
- token := sasToken
- if strings.HasPrefix(sasToken, "?") {
- token = strings.TrimPrefix(sasToken, "?")
- }
-
- return &SASTokenAuthorizer{
- sasToken: token,
- }, nil
-}
-
-// WithAuthorization returns a PrepareDecorator that adds a shared access signature token to the
-// URI's query parameters. This can be used for the Blob, Queue, and File Services.
-//
-// See https://docs.microsoft.com/en-us/rest/api/storageservices/delegate-access-with-shared-access-signature
-func (sas *SASTokenAuthorizer) WithAuthorization() PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err != nil {
- return r, err
- }
-
- if r.URL.RawQuery == "" {
- r.URL.RawQuery = sas.sasToken
- } else if !strings.Contains(r.URL.RawQuery, sas.sasToken) {
- r.URL.RawQuery = fmt.Sprintf("%s&%s", r.URL.RawQuery, sas.sasToken)
- }
-
- return Prepare(r)
- })
- }
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go b/vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go
deleted file mode 100644
index 2af5030a1..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go
+++ /dev/null
@@ -1,307 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "bytes"
- "crypto/hmac"
- "crypto/sha256"
- "encoding/base64"
- "fmt"
- "net/http"
- "net/url"
- "sort"
- "strings"
- "time"
-)
-
-// SharedKeyType defines the enumeration for the various shared key types.
-// See https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key for details on the shared key types.
-type SharedKeyType string
-
-const (
- // SharedKey is used to authorize against blobs, files and queues services.
- SharedKey SharedKeyType = "sharedKey"
-
- // SharedKeyForTable is used to authorize against the table service.
- SharedKeyForTable SharedKeyType = "sharedKeyTable"
-
- // SharedKeyLite is used to authorize against blobs, files and queues services. It's provided for
- // backwards compatibility with API versions before 2009-09-19. Prefer SharedKey instead.
- SharedKeyLite SharedKeyType = "sharedKeyLite"
-
- // SharedKeyLiteForTable is used to authorize against the table service. It's provided for
- // backwards compatibility with older table API versions. Prefer SharedKeyForTable instead.
- SharedKeyLiteForTable SharedKeyType = "sharedKeyLiteTable"
-)
-
-const (
- headerAccept = "Accept"
- headerAcceptCharset = "Accept-Charset"
- headerContentEncoding = "Content-Encoding"
- headerContentLength = "Content-Length"
- headerContentMD5 = "Content-MD5"
- headerContentLanguage = "Content-Language"
- headerIfModifiedSince = "If-Modified-Since"
- headerIfMatch = "If-Match"
- headerIfNoneMatch = "If-None-Match"
- headerIfUnmodifiedSince = "If-Unmodified-Since"
- headerDate = "Date"
- headerXMSDate = "X-Ms-Date"
- headerXMSVersion = "x-ms-version"
- headerRange = "Range"
-)
-
-const storageEmulatorAccountName = "devstoreaccount1"
-
-// SharedKeyAuthorizer implements an authorization for Shared Key
-// this can be used for interaction with Blob, File and Queue Storage Endpoints
-type SharedKeyAuthorizer struct {
- accountName string
- accountKey []byte
- keyType SharedKeyType
-}
-
-// NewSharedKeyAuthorizer creates a SharedKeyAuthorizer using the provided credentials and shared key type.
-func NewSharedKeyAuthorizer(accountName, accountKey string, keyType SharedKeyType) (*SharedKeyAuthorizer, error) {
- key, err := base64.StdEncoding.DecodeString(accountKey)
- if err != nil {
- return nil, fmt.Errorf("malformed storage account key: %v", err)
- }
- return &SharedKeyAuthorizer{
- accountName: accountName,
- accountKey: key,
- keyType: keyType,
- }, nil
-}
-
-// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose
-// value is " " followed by the computed key.
-// This can be used for the Blob, Queue, and File Services
-//
-// from: https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key
-// You may use Shared Key authorization to authorize a request made against the
-// 2009-09-19 version and later of the Blob and Queue services,
-// and version 2014-02-14 and later of the File services.
-func (sk *SharedKeyAuthorizer) WithAuthorization() PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err != nil {
- return r, err
- }
-
- sk, err := buildSharedKey(sk.accountName, sk.accountKey, r, sk.keyType)
- if err != nil {
- return r, err
- }
- return Prepare(r, WithHeader(headerAuthorization, sk))
- })
- }
-}
-
-func buildSharedKey(accName string, accKey []byte, req *http.Request, keyType SharedKeyType) (string, error) {
- canRes, err := buildCanonicalizedResource(accName, req.URL.String(), keyType)
- if err != nil {
- return "", err
- }
-
- if req.Header == nil {
- req.Header = http.Header{}
- }
-
- // ensure date is set
- if req.Header.Get(headerDate) == "" && req.Header.Get(headerXMSDate) == "" {
- date := time.Now().UTC().Format(http.TimeFormat)
- req.Header.Set(headerXMSDate, date)
- }
- canString, err := buildCanonicalizedString(req.Method, req.Header, canRes, keyType)
- if err != nil {
- return "", err
- }
- return createAuthorizationHeader(accName, accKey, canString, keyType), nil
-}
-
-func buildCanonicalizedResource(accountName, uri string, keyType SharedKeyType) (string, error) {
- errMsg := "buildCanonicalizedResource error: %s"
- u, err := url.Parse(uri)
- if err != nil {
- return "", fmt.Errorf(errMsg, err.Error())
- }
-
- cr := bytes.NewBufferString("")
- if accountName != storageEmulatorAccountName {
- cr.WriteString("/")
- cr.WriteString(getCanonicalizedAccountName(accountName))
- }
-
- if len(u.Path) > 0 {
- // Any portion of the CanonicalizedResource string that is derived from
- // the resource's URI should be encoded exactly as it is in the URI.
- // -- https://msdn.microsoft.com/en-gb/library/azure/dd179428.aspx
- cr.WriteString(u.EscapedPath())
- } else {
- // a slash is required to indicate the root path
- cr.WriteString("/")
- }
-
- params, err := url.ParseQuery(u.RawQuery)
- if err != nil {
- return "", fmt.Errorf(errMsg, err.Error())
- }
-
- // See https://github.com/Azure/azure-storage-net/blob/master/Lib/Common/Core/Util/AuthenticationUtility.cs#L277
- if keyType == SharedKey {
- if len(params) > 0 {
- cr.WriteString("\n")
-
- keys := []string{}
- for key := range params {
- keys = append(keys, key)
- }
- sort.Strings(keys)
-
- completeParams := []string{}
- for _, key := range keys {
- if len(params[key]) > 1 {
- sort.Strings(params[key])
- }
-
- completeParams = append(completeParams, fmt.Sprintf("%s:%s", key, strings.Join(params[key], ",")))
- }
- cr.WriteString(strings.Join(completeParams, "\n"))
- }
- } else {
- // search for "comp" parameter, if exists then add it to canonicalizedresource
- if v, ok := params["comp"]; ok {
- cr.WriteString("?comp=" + v[0])
- }
- }
-
- return string(cr.Bytes()), nil
-}
-
-func getCanonicalizedAccountName(accountName string) string {
- // since we may be trying to access a secondary storage account, we need to
- // remove the -secondary part of the storage name
- return strings.TrimSuffix(accountName, "-secondary")
-}
-
-func buildCanonicalizedString(verb string, headers http.Header, canonicalizedResource string, keyType SharedKeyType) (string, error) {
- contentLength := headers.Get(headerContentLength)
- if contentLength == "0" {
- contentLength = ""
- }
- date := headers.Get(headerDate)
- if v := headers.Get(headerXMSDate); v != "" {
- if keyType == SharedKey || keyType == SharedKeyLite {
- date = ""
- } else {
- date = v
- }
- }
- var canString string
- switch keyType {
- case SharedKey:
- canString = strings.Join([]string{
- verb,
- headers.Get(headerContentEncoding),
- headers.Get(headerContentLanguage),
- contentLength,
- headers.Get(headerContentMD5),
- headers.Get(headerContentType),
- date,
- headers.Get(headerIfModifiedSince),
- headers.Get(headerIfMatch),
- headers.Get(headerIfNoneMatch),
- headers.Get(headerIfUnmodifiedSince),
- headers.Get(headerRange),
- buildCanonicalizedHeader(headers),
- canonicalizedResource,
- }, "\n")
- case SharedKeyForTable:
- canString = strings.Join([]string{
- verb,
- headers.Get(headerContentMD5),
- headers.Get(headerContentType),
- date,
- canonicalizedResource,
- }, "\n")
- case SharedKeyLite:
- canString = strings.Join([]string{
- verb,
- headers.Get(headerContentMD5),
- headers.Get(headerContentType),
- date,
- buildCanonicalizedHeader(headers),
- canonicalizedResource,
- }, "\n")
- case SharedKeyLiteForTable:
- canString = strings.Join([]string{
- date,
- canonicalizedResource,
- }, "\n")
- default:
- return "", fmt.Errorf("key type '%s' is not supported", keyType)
- }
- return canString, nil
-}
-
-func buildCanonicalizedHeader(headers http.Header) string {
- cm := make(map[string]string)
-
- for k := range headers {
- headerName := strings.TrimSpace(strings.ToLower(k))
- if strings.HasPrefix(headerName, "x-ms-") {
- cm[headerName] = headers.Get(k)
- }
- }
-
- if len(cm) == 0 {
- return ""
- }
-
- keys := []string{}
- for key := range cm {
- keys = append(keys, key)
- }
-
- sort.Strings(keys)
-
- ch := bytes.NewBufferString("")
-
- for _, key := range keys {
- ch.WriteString(key)
- ch.WriteRune(':')
- ch.WriteString(cm[key])
- ch.WriteRune('\n')
- }
-
- return strings.TrimSuffix(string(ch.Bytes()), "\n")
-}
-
-func createAuthorizationHeader(accountName string, accountKey []byte, canonicalizedString string, keyType SharedKeyType) string {
- h := hmac.New(sha256.New, accountKey)
- h.Write([]byte(canonicalizedString))
- signature := base64.StdEncoding.EncodeToString(h.Sum(nil))
- var key string
- switch keyType {
- case SharedKey, SharedKeyForTable:
- key = "SharedKey"
- case SharedKeyLite, SharedKeyLiteForTable:
- key = "SharedKeyLite"
- }
- return fmt.Sprintf("%s %s:%s", key, getCanonicalizedAccountName(accountName), signature)
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/autorest.go b/vendor/github.com/Azure/go-autorest/autorest/autorest.go
deleted file mode 100644
index aafdf021f..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/autorest.go
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-Package autorest implements an HTTP request pipeline suitable for use across multiple go-routines
-and provides the shared routines relied on by AutoRest (see https://github.com/Azure/autorest/)
-generated Go code.
-
-The package breaks sending and responding to HTTP requests into three phases: Preparing, Sending,
-and Responding. A typical pattern is:
-
- req, err := Prepare(&http.Request{},
- token.WithAuthorization())
-
- resp, err := Send(req,
- WithLogging(logger),
- DoErrorIfStatusCode(http.StatusInternalServerError),
- DoCloseIfError(),
- DoRetryForAttempts(5, time.Second))
-
- err = Respond(resp,
- ByDiscardingBody(),
- ByClosing())
-
-Each phase relies on decorators to modify and / or manage processing. Decorators may first modify
-and then pass the data along, pass the data first and then modify the result, or wrap themselves
-around passing the data (such as a logger might do). Decorators run in the order provided. For
-example, the following:
-
- req, err := Prepare(&http.Request{},
- WithBaseURL("https://microsoft.com/"),
- WithPath("a"),
- WithPath("b"),
- WithPath("c"))
-
-will set the URL to:
-
- https://microsoft.com/a/b/c
-
-Preparers and Responders may be shared and re-used (assuming the underlying decorators support
-sharing and re-use). Performant use is obtained by creating one or more Preparers and Responders
-shared among multiple go-routines, and a single Sender shared among multiple sending go-routines,
-all bound together by means of input / output channels.
-
-Decorators hold their passed state within a closure (such as the path components in the example
-above). Be careful to share Preparers and Responders only in a context where such held state
-applies. For example, it may not make sense to share a Preparer that applies a query string from a
-fixed set of values. Similarly, sharing a Responder that reads the response body into a passed
-struct (e.g., ByUnmarshallingJson) is likely incorrect.
-
-Lastly, the Swagger specification (https://swagger.io) that drives AutoRest
-(https://github.com/Azure/autorest/) precisely defines two date forms: date and date-time. The
-github.com/Azure/go-autorest/autorest/date package provides time.Time derivations to ensure
-correct parsing and formatting.
-
-Errors raised by autorest objects and methods will conform to the autorest.Error interface.
-
-See the included examples for more detail. For details on the suggested use of this package by
-generated clients, see the Client described below.
-*/
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "context"
- "net/http"
- "time"
-)
-
-const (
- // HeaderLocation specifies the HTTP Location header.
- HeaderLocation = "Location"
-
- // HeaderRetryAfter specifies the HTTP Retry-After header.
- HeaderRetryAfter = "Retry-After"
-)
-
-// ResponseHasStatusCode returns true if the status code in the HTTP Response is in the passed set
-// and false otherwise.
-func ResponseHasStatusCode(resp *http.Response, codes ...int) bool {
- if resp == nil {
- return false
- }
- return containsInt(codes, resp.StatusCode)
-}
-
-// GetLocation retrieves the URL from the Location header of the passed response.
-func GetLocation(resp *http.Response) string {
- return resp.Header.Get(HeaderLocation)
-}
-
-// GetRetryAfter extracts the retry delay from the Retry-After header of the passed response. If
-// the header is absent or is malformed, it will return the supplied default delay time.Duration.
-func GetRetryAfter(resp *http.Response, defaultDelay time.Duration) time.Duration {
- retry := resp.Header.Get(HeaderRetryAfter)
- if retry == "" {
- return defaultDelay
- }
-
- d, err := time.ParseDuration(retry + "s")
- if err != nil {
- return defaultDelay
- }
-
- return d
-}
-
-// NewPollingRequest allocates and returns a new http.Request to poll for the passed response.
-func NewPollingRequest(resp *http.Response, cancel <-chan struct{}) (*http.Request, error) {
- location := GetLocation(resp)
- if location == "" {
- return nil, NewErrorWithResponse("autorest", "NewPollingRequest", resp, "Location header missing from response that requires polling")
- }
-
- req, err := Prepare(&http.Request{Cancel: cancel},
- AsGet(),
- WithBaseURL(location))
- if err != nil {
- return nil, NewErrorWithError(err, "autorest", "NewPollingRequest", nil, "Failure creating poll request to %s", location)
- }
-
- return req, nil
-}
-
-// NewPollingRequestWithContext allocates and returns a new http.Request with the specified context to poll for the passed response.
-func NewPollingRequestWithContext(ctx context.Context, resp *http.Response) (*http.Request, error) {
- location := GetLocation(resp)
- if location == "" {
- return nil, NewErrorWithResponse("autorest", "NewPollingRequestWithContext", resp, "Location header missing from response that requires polling")
- }
-
- req, err := Prepare((&http.Request{}).WithContext(ctx),
- AsGet(),
- WithBaseURL(location))
- if err != nil {
- return nil, NewErrorWithError(err, "autorest", "NewPollingRequestWithContext", nil, "Failure creating poll request to %s", location)
- }
-
- return req, nil
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go
deleted file mode 100644
index 45575eedb..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go
+++ /dev/null
@@ -1,995 +0,0 @@
-package azure
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "bytes"
- "context"
- "encoding/json"
- "fmt"
- "io/ioutil"
- "net/http"
- "net/url"
- "strings"
- "time"
-
- "github.com/Azure/go-autorest/autorest"
- "github.com/Azure/go-autorest/logger"
- "github.com/Azure/go-autorest/tracing"
-)
-
-const (
- headerAsyncOperation = "Azure-AsyncOperation"
-)
-
-const (
- operationInProgress string = "InProgress"
- operationCanceled string = "Canceled"
- operationFailed string = "Failed"
- operationSucceeded string = "Succeeded"
-)
-
-var pollingCodes = [...]int{http.StatusNoContent, http.StatusAccepted, http.StatusCreated, http.StatusOK}
-
-// FutureAPI contains the set of methods on the Future type.
-type FutureAPI interface {
- // Response returns the last HTTP response.
- Response() *http.Response
-
- // Status returns the last status message of the operation.
- Status() string
-
- // PollingMethod returns the method used to monitor the status of the asynchronous operation.
- PollingMethod() PollingMethodType
-
- // DoneWithContext queries the service to see if the operation has completed.
- DoneWithContext(context.Context, autorest.Sender) (bool, error)
-
- // GetPollingDelay returns a duration the application should wait before checking
- // the status of the asynchronous request and true; this value is returned from
- // the service via the Retry-After response header. If the header wasn't returned
- // then the function returns the zero-value time.Duration and false.
- GetPollingDelay() (time.Duration, bool)
-
- // WaitForCompletionRef will return when one of the following conditions is met: the long
- // running operation has completed, the provided context is cancelled, or the client's
- // polling duration has been exceeded. It will retry failed polling attempts based on
- // the retry value defined in the client up to the maximum retry attempts.
- // If no deadline is specified in the context then the client.PollingDuration will be
- // used to determine if a default deadline should be used.
- // If PollingDuration is greater than zero the value will be used as the context's timeout.
- // If PollingDuration is zero then no default deadline will be used.
- WaitForCompletionRef(context.Context, autorest.Client) error
-
- // MarshalJSON implements the json.Marshaler interface.
- MarshalJSON() ([]byte, error)
-
- // MarshalJSON implements the json.Unmarshaler interface.
- UnmarshalJSON([]byte) error
-
- // PollingURL returns the URL used for retrieving the status of the long-running operation.
- PollingURL() string
-
- // GetResult should be called once polling has completed successfully.
- // It makes the final GET call to retrieve the resultant payload.
- GetResult(autorest.Sender) (*http.Response, error)
-}
-
-var _ FutureAPI = (*Future)(nil)
-
-// Future provides a mechanism to access the status and results of an asynchronous request.
-// Since futures are stateful they should be passed by value to avoid race conditions.
-type Future struct {
- pt pollingTracker
-}
-
-// NewFutureFromResponse returns a new Future object initialized
-// with the initial response from an asynchronous operation.
-func NewFutureFromResponse(resp *http.Response) (Future, error) {
- pt, err := createPollingTracker(resp)
- return Future{pt: pt}, err
-}
-
-// Response returns the last HTTP response.
-func (f Future) Response() *http.Response {
- if f.pt == nil {
- return nil
- }
- return f.pt.latestResponse()
-}
-
-// Status returns the last status message of the operation.
-func (f Future) Status() string {
- if f.pt == nil {
- return ""
- }
- return f.pt.pollingStatus()
-}
-
-// PollingMethod returns the method used to monitor the status of the asynchronous operation.
-func (f Future) PollingMethod() PollingMethodType {
- if f.pt == nil {
- return PollingUnknown
- }
- return f.pt.pollingMethod()
-}
-
-// DoneWithContext queries the service to see if the operation has completed.
-func (f *Future) DoneWithContext(ctx context.Context, sender autorest.Sender) (done bool, err error) {
- ctx = tracing.StartSpan(ctx, "github.com/Azure/go-autorest/autorest/azure/async.DoneWithContext")
- defer func() {
- sc := -1
- resp := f.Response()
- if resp != nil {
- sc = resp.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
-
- if f.pt == nil {
- return false, autorest.NewError("Future", "Done", "future is not initialized")
- }
- if f.pt.hasTerminated() {
- return true, f.pt.pollingError()
- }
- if err := f.pt.pollForStatus(ctx, sender); err != nil {
- return false, err
- }
- if err := f.pt.checkForErrors(); err != nil {
- return f.pt.hasTerminated(), err
- }
- if err := f.pt.updatePollingState(f.pt.provisioningStateApplicable()); err != nil {
- return false, err
- }
- if err := f.pt.initPollingMethod(); err != nil {
- return false, err
- }
- if err := f.pt.updatePollingMethod(); err != nil {
- return false, err
- }
- return f.pt.hasTerminated(), f.pt.pollingError()
-}
-
-// GetPollingDelay returns a duration the application should wait before checking
-// the status of the asynchronous request and true; this value is returned from
-// the service via the Retry-After response header. If the header wasn't returned
-// then the function returns the zero-value time.Duration and false.
-func (f Future) GetPollingDelay() (time.Duration, bool) {
- if f.pt == nil {
- return 0, false
- }
- resp := f.pt.latestResponse()
- if resp == nil {
- return 0, false
- }
-
- retry := resp.Header.Get(autorest.HeaderRetryAfter)
- if retry == "" {
- return 0, false
- }
-
- d, err := time.ParseDuration(retry + "s")
- if err != nil {
- panic(err)
- }
-
- return d, true
-}
-
-// WaitForCompletionRef will return when one of the following conditions is met: the long
-// running operation has completed, the provided context is cancelled, or the client's
-// polling duration has been exceeded. It will retry failed polling attempts based on
-// the retry value defined in the client up to the maximum retry attempts.
-// If no deadline is specified in the context then the client.PollingDuration will be
-// used to determine if a default deadline should be used.
-// If PollingDuration is greater than zero the value will be used as the context's timeout.
-// If PollingDuration is zero then no default deadline will be used.
-func (f *Future) WaitForCompletionRef(ctx context.Context, client autorest.Client) (err error) {
- ctx = tracing.StartSpan(ctx, "github.com/Azure/go-autorest/autorest/azure/async.WaitForCompletionRef")
- defer func() {
- sc := -1
- resp := f.Response()
- if resp != nil {
- sc = resp.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- cancelCtx := ctx
- // if the provided context already has a deadline don't override it
- _, hasDeadline := ctx.Deadline()
- if d := client.PollingDuration; !hasDeadline && d != 0 {
- var cancel context.CancelFunc
- cancelCtx, cancel = context.WithTimeout(ctx, d)
- defer cancel()
- }
- // if the initial response has a Retry-After, sleep for the specified amount of time before starting to poll
- if delay, ok := f.GetPollingDelay(); ok {
- logger.Instance.Writeln(logger.LogInfo, "WaitForCompletionRef: initial polling delay")
- if delayElapsed := autorest.DelayForBackoff(delay, 0, cancelCtx.Done()); !delayElapsed {
- err = cancelCtx.Err()
- return
- }
- }
- done, err := f.DoneWithContext(ctx, client)
- for attempts := 0; !done; done, err = f.DoneWithContext(ctx, client) {
- if attempts >= client.RetryAttempts {
- return autorest.NewErrorWithError(err, "Future", "WaitForCompletion", f.pt.latestResponse(), "the number of retries has been exceeded")
- }
- // we want delayAttempt to be zero in the non-error case so
- // that DelayForBackoff doesn't perform exponential back-off
- var delayAttempt int
- var delay time.Duration
- if err == nil {
- // check for Retry-After delay, if not present use the client's polling delay
- var ok bool
- delay, ok = f.GetPollingDelay()
- if !ok {
- logger.Instance.Writeln(logger.LogInfo, "WaitForCompletionRef: Using client polling delay")
- delay = client.PollingDelay
- }
- } else {
- // there was an error polling for status so perform exponential
- // back-off based on the number of attempts using the client's retry
- // duration. update attempts after delayAttempt to avoid off-by-one.
- logger.Instance.Writef(logger.LogError, "WaitForCompletionRef: %s\n", err)
- delayAttempt = attempts
- delay = client.RetryDuration
- attempts++
- }
- // wait until the delay elapses or the context is cancelled
- delayElapsed := autorest.DelayForBackoff(delay, delayAttempt, cancelCtx.Done())
- if !delayElapsed {
- return autorest.NewErrorWithError(cancelCtx.Err(), "Future", "WaitForCompletion", f.pt.latestResponse(), "context has been cancelled")
- }
- }
- return
-}
-
-// MarshalJSON implements the json.Marshaler interface.
-func (f Future) MarshalJSON() ([]byte, error) {
- return json.Marshal(f.pt)
-}
-
-// UnmarshalJSON implements the json.Unmarshaler interface.
-func (f *Future) UnmarshalJSON(data []byte) error {
- // unmarshal into JSON object to determine the tracker type
- obj := map[string]interface{}{}
- err := json.Unmarshal(data, &obj)
- if err != nil {
- return err
- }
- if obj["method"] == nil {
- return autorest.NewError("Future", "UnmarshalJSON", "missing 'method' property")
- }
- method := obj["method"].(string)
- switch strings.ToUpper(method) {
- case http.MethodDelete:
- f.pt = &pollingTrackerDelete{}
- case http.MethodPatch:
- f.pt = &pollingTrackerPatch{}
- case http.MethodPost:
- f.pt = &pollingTrackerPost{}
- case http.MethodPut:
- f.pt = &pollingTrackerPut{}
- default:
- return autorest.NewError("Future", "UnmarshalJSON", "unsupoorted method '%s'", method)
- }
- // now unmarshal into the tracker
- return json.Unmarshal(data, &f.pt)
-}
-
-// PollingURL returns the URL used for retrieving the status of the long-running operation.
-func (f Future) PollingURL() string {
- if f.pt == nil {
- return ""
- }
- return f.pt.pollingURL()
-}
-
-// GetResult should be called once polling has completed successfully.
-// It makes the final GET call to retrieve the resultant payload.
-func (f Future) GetResult(sender autorest.Sender) (*http.Response, error) {
- if f.pt.finalGetURL() == "" {
- // we can end up in this situation if the async operation returns a 200
- // with no polling URLs. in that case return the response which should
- // contain the JSON payload (only do this for successful terminal cases).
- if lr := f.pt.latestResponse(); lr != nil && f.pt.hasSucceeded() {
- return lr, nil
- }
- return nil, autorest.NewError("Future", "GetResult", "missing URL for retrieving result")
- }
- req, err := http.NewRequest(http.MethodGet, f.pt.finalGetURL(), nil)
- if err != nil {
- return nil, err
- }
- resp, err := sender.Do(req)
- if err == nil && resp.Body != nil {
- // copy the body and close it so callers don't have to
- defer resp.Body.Close()
- b, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return resp, err
- }
- resp.Body = ioutil.NopCloser(bytes.NewReader(b))
- }
- return resp, err
-}
-
-type pollingTracker interface {
- // these methods can differ per tracker
-
- // checks the response headers and status code to determine the polling mechanism
- updatePollingMethod() error
-
- // checks the response for tracker-specific error conditions
- checkForErrors() error
-
- // returns true if provisioning state should be checked
- provisioningStateApplicable() bool
-
- // methods common to all trackers
-
- // initializes a tracker's polling URL and method, called for each iteration.
- // these values can be overridden by each polling tracker as required.
- initPollingMethod() error
-
- // initializes the tracker's internal state, call this when the tracker is created
- initializeState() error
-
- // makes an HTTP request to check the status of the LRO
- pollForStatus(ctx context.Context, sender autorest.Sender) error
-
- // updates internal tracker state, call this after each call to pollForStatus
- updatePollingState(provStateApl bool) error
-
- // returns the error response from the service, can be nil
- pollingError() error
-
- // returns the polling method being used
- pollingMethod() PollingMethodType
-
- // returns the state of the LRO as returned from the service
- pollingStatus() string
-
- // returns the URL used for polling status
- pollingURL() string
-
- // returns the URL used for the final GET to retrieve the resource
- finalGetURL() string
-
- // returns true if the LRO is in a terminal state
- hasTerminated() bool
-
- // returns true if the LRO is in a failed terminal state
- hasFailed() bool
-
- // returns true if the LRO is in a successful terminal state
- hasSucceeded() bool
-
- // returns the cached HTTP response after a call to pollForStatus(), can be nil
- latestResponse() *http.Response
-}
-
-type pollingTrackerBase struct {
- // resp is the last response, either from the submission of the LRO or from polling
- resp *http.Response
-
- // method is the HTTP verb, this is needed for deserialization
- Method string `json:"method"`
-
- // rawBody is the raw JSON response body
- rawBody map[string]interface{}
-
- // denotes if polling is using async-operation or location header
- Pm PollingMethodType `json:"pollingMethod"`
-
- // the URL to poll for status
- URI string `json:"pollingURI"`
-
- // the state of the LRO as returned from the service
- State string `json:"lroState"`
-
- // the URL to GET for the final result
- FinalGetURI string `json:"resultURI"`
-
- // used to hold an error object returned from the service
- Err *ServiceError `json:"error,omitempty"`
-}
-
-func (pt *pollingTrackerBase) initializeState() error {
- // determine the initial polling state based on response body and/or HTTP status
- // code. this is applicable to the initial LRO response, not polling responses!
- pt.Method = pt.resp.Request.Method
- if err := pt.updateRawBody(); err != nil {
- return err
- }
- switch pt.resp.StatusCode {
- case http.StatusOK:
- if ps := pt.getProvisioningState(); ps != nil {
- pt.State = *ps
- if pt.hasFailed() {
- pt.updateErrorFromResponse()
- return pt.pollingError()
- }
- } else {
- pt.State = operationSucceeded
- }
- case http.StatusCreated:
- if ps := pt.getProvisioningState(); ps != nil {
- pt.State = *ps
- } else {
- pt.State = operationInProgress
- }
- case http.StatusAccepted:
- pt.State = operationInProgress
- case http.StatusNoContent:
- pt.State = operationSucceeded
- default:
- pt.State = operationFailed
- pt.updateErrorFromResponse()
- return pt.pollingError()
- }
- return pt.initPollingMethod()
-}
-
-func (pt pollingTrackerBase) getProvisioningState() *string {
- if pt.rawBody != nil && pt.rawBody["properties"] != nil {
- p := pt.rawBody["properties"].(map[string]interface{})
- if ps := p["provisioningState"]; ps != nil {
- s := ps.(string)
- return &s
- }
- }
- return nil
-}
-
-func (pt *pollingTrackerBase) updateRawBody() error {
- pt.rawBody = map[string]interface{}{}
- if pt.resp.ContentLength != 0 {
- defer pt.resp.Body.Close()
- b, err := ioutil.ReadAll(pt.resp.Body)
- if err != nil {
- return autorest.NewErrorWithError(err, "pollingTrackerBase", "updateRawBody", nil, "failed to read response body")
- }
- // put the body back so it's available to other callers
- pt.resp.Body = ioutil.NopCloser(bytes.NewReader(b))
- // observed in 204 responses over HTTP/2.0; the content length is -1 but body is empty
- if len(b) == 0 {
- return nil
- }
- if err = json.Unmarshal(b, &pt.rawBody); err != nil {
- return autorest.NewErrorWithError(err, "pollingTrackerBase", "updateRawBody", nil, "failed to unmarshal response body")
- }
- }
- return nil
-}
-
-func (pt *pollingTrackerBase) pollForStatus(ctx context.Context, sender autorest.Sender) error {
- req, err := http.NewRequest(http.MethodGet, pt.URI, nil)
- if err != nil {
- return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed to create HTTP request")
- }
-
- req = req.WithContext(ctx)
- preparer := autorest.CreatePreparer(autorest.GetPrepareDecorators(ctx)...)
- req, err = preparer.Prepare(req)
- if err != nil {
- return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed preparing HTTP request")
- }
- pt.resp, err = sender.Do(req)
- if err != nil {
- return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed to send HTTP request")
- }
- if autorest.ResponseHasStatusCode(pt.resp, pollingCodes[:]...) {
- // reset the service error on success case
- pt.Err = nil
- err = pt.updateRawBody()
- } else {
- // check response body for error content
- pt.updateErrorFromResponse()
- err = pt.pollingError()
- }
- return err
-}
-
-// attempts to unmarshal a ServiceError type from the response body.
-// if that fails then make a best attempt at creating something meaningful.
-// NOTE: this assumes that the async operation has failed.
-func (pt *pollingTrackerBase) updateErrorFromResponse() {
- var err error
- if pt.resp.ContentLength != 0 {
- type respErr struct {
- ServiceError *ServiceError `json:"error"`
- }
- re := respErr{}
- defer pt.resp.Body.Close()
- var b []byte
- if b, err = ioutil.ReadAll(pt.resp.Body); err != nil {
- goto Default
- }
- // put the body back so it's available to other callers
- pt.resp.Body = ioutil.NopCloser(bytes.NewReader(b))
- if len(b) == 0 {
- goto Default
- }
- if err = json.Unmarshal(b, &re); err != nil {
- goto Default
- }
- // unmarshalling the error didn't yield anything, try unwrapped error
- if re.ServiceError == nil {
- err = json.Unmarshal(b, &re.ServiceError)
- if err != nil {
- goto Default
- }
- }
- // the unmarshaller will ensure re.ServiceError is non-nil
- // even if there was no content unmarshalled so check the code.
- if re.ServiceError.Code != "" {
- pt.Err = re.ServiceError
- return
- }
- }
-Default:
- se := &ServiceError{
- Code: pt.pollingStatus(),
- Message: "The async operation failed.",
- }
- if err != nil {
- se.InnerError = make(map[string]interface{})
- se.InnerError["unmarshalError"] = err.Error()
- }
- // stick the response body into the error object in hopes
- // it contains something useful to help diagnose the failure.
- if len(pt.rawBody) > 0 {
- se.AdditionalInfo = []map[string]interface{}{
- pt.rawBody,
- }
- }
- pt.Err = se
-}
-
-func (pt *pollingTrackerBase) updatePollingState(provStateApl bool) error {
- if pt.Pm == PollingAsyncOperation && pt.rawBody["status"] != nil {
- pt.State = pt.rawBody["status"].(string)
- } else {
- if pt.resp.StatusCode == http.StatusAccepted {
- pt.State = operationInProgress
- } else if provStateApl {
- if ps := pt.getProvisioningState(); ps != nil {
- pt.State = *ps
- } else {
- pt.State = operationSucceeded
- }
- } else {
- return autorest.NewError("pollingTrackerBase", "updatePollingState", "the response from the async operation has an invalid status code")
- }
- }
- // if the operation has failed update the error state
- if pt.hasFailed() {
- pt.updateErrorFromResponse()
- }
- return nil
-}
-
-func (pt pollingTrackerBase) pollingError() error {
- if pt.Err == nil {
- return nil
- }
- return pt.Err
-}
-
-func (pt pollingTrackerBase) pollingMethod() PollingMethodType {
- return pt.Pm
-}
-
-func (pt pollingTrackerBase) pollingStatus() string {
- return pt.State
-}
-
-func (pt pollingTrackerBase) pollingURL() string {
- return pt.URI
-}
-
-func (pt pollingTrackerBase) finalGetURL() string {
- return pt.FinalGetURI
-}
-
-func (pt pollingTrackerBase) hasTerminated() bool {
- return strings.EqualFold(pt.State, operationCanceled) || strings.EqualFold(pt.State, operationFailed) || strings.EqualFold(pt.State, operationSucceeded)
-}
-
-func (pt pollingTrackerBase) hasFailed() bool {
- return strings.EqualFold(pt.State, operationCanceled) || strings.EqualFold(pt.State, operationFailed)
-}
-
-func (pt pollingTrackerBase) hasSucceeded() bool {
- return strings.EqualFold(pt.State, operationSucceeded)
-}
-
-func (pt pollingTrackerBase) latestResponse() *http.Response {
- return pt.resp
-}
-
-// error checking common to all trackers
-func (pt pollingTrackerBase) baseCheckForErrors() error {
- // for Azure-AsyncOperations the response body cannot be nil or empty
- if pt.Pm == PollingAsyncOperation {
- if pt.resp.Body == nil || pt.resp.ContentLength == 0 {
- return autorest.NewError("pollingTrackerBase", "baseCheckForErrors", "for Azure-AsyncOperation response body cannot be nil")
- }
- if pt.rawBody["status"] == nil {
- return autorest.NewError("pollingTrackerBase", "baseCheckForErrors", "missing status property in Azure-AsyncOperation response body")
- }
- }
- return nil
-}
-
-// default initialization of polling URL/method. each verb tracker will update this as required.
-func (pt *pollingTrackerBase) initPollingMethod() error {
- if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil {
- return err
- } else if ao != "" {
- pt.URI = ao
- pt.Pm = PollingAsyncOperation
- return nil
- }
- if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
- return err
- } else if lh != "" {
- pt.URI = lh
- pt.Pm = PollingLocation
- return nil
- }
- // it's ok if we didn't find a polling header, this will be handled elsewhere
- return nil
-}
-
-// DELETE
-
-type pollingTrackerDelete struct {
- pollingTrackerBase
-}
-
-func (pt *pollingTrackerDelete) updatePollingMethod() error {
- // for 201 the Location header is required
- if pt.resp.StatusCode == http.StatusCreated {
- if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
- return err
- } else if lh == "" {
- return autorest.NewError("pollingTrackerDelete", "updateHeaders", "missing Location header in 201 response")
- } else {
- pt.URI = lh
- }
- pt.Pm = PollingLocation
- pt.FinalGetURI = pt.URI
- }
- // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary
- if pt.resp.StatusCode == http.StatusAccepted {
- ao, err := getURLFromAsyncOpHeader(pt.resp)
- if err != nil {
- return err
- } else if ao != "" {
- pt.URI = ao
- pt.Pm = PollingAsyncOperation
- }
- // if the Location header is invalid and we already have a polling URL
- // then we don't care if the Location header URL is malformed.
- if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" {
- return err
- } else if lh != "" {
- if ao == "" {
- pt.URI = lh
- pt.Pm = PollingLocation
- }
- // when both headers are returned we use the value in the Location header for the final GET
- pt.FinalGetURI = lh
- }
- // make sure a polling URL was found
- if pt.URI == "" {
- return autorest.NewError("pollingTrackerPost", "updateHeaders", "didn't get any suitable polling URLs in 202 response")
- }
- }
- return nil
-}
-
-func (pt pollingTrackerDelete) checkForErrors() error {
- return pt.baseCheckForErrors()
-}
-
-func (pt pollingTrackerDelete) provisioningStateApplicable() bool {
- return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusNoContent
-}
-
-// PATCH
-
-type pollingTrackerPatch struct {
- pollingTrackerBase
-}
-
-func (pt *pollingTrackerPatch) updatePollingMethod() error {
- // by default we can use the original URL for polling and final GET
- if pt.URI == "" {
- pt.URI = pt.resp.Request.URL.String()
- }
- if pt.FinalGetURI == "" {
- pt.FinalGetURI = pt.resp.Request.URL.String()
- }
- if pt.Pm == PollingUnknown {
- pt.Pm = PollingRequestURI
- }
- // for 201 it's permissible for no headers to be returned
- if pt.resp.StatusCode == http.StatusCreated {
- if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil {
- return err
- } else if ao != "" {
- pt.URI = ao
- pt.Pm = PollingAsyncOperation
- }
- }
- // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary
- // note the absence of the "final GET" mechanism for PATCH
- if pt.resp.StatusCode == http.StatusAccepted {
- ao, err := getURLFromAsyncOpHeader(pt.resp)
- if err != nil {
- return err
- } else if ao != "" {
- pt.URI = ao
- pt.Pm = PollingAsyncOperation
- }
- if ao == "" {
- if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
- return err
- } else if lh == "" {
- return autorest.NewError("pollingTrackerPatch", "updateHeaders", "didn't get any suitable polling URLs in 202 response")
- } else {
- pt.URI = lh
- pt.Pm = PollingLocation
- }
- }
- }
- return nil
-}
-
-func (pt pollingTrackerPatch) checkForErrors() error {
- return pt.baseCheckForErrors()
-}
-
-func (pt pollingTrackerPatch) provisioningStateApplicable() bool {
- return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusCreated
-}
-
-// POST
-
-type pollingTrackerPost struct {
- pollingTrackerBase
-}
-
-func (pt *pollingTrackerPost) updatePollingMethod() error {
- // 201 requires Location header
- if pt.resp.StatusCode == http.StatusCreated {
- if lh, err := getURLFromLocationHeader(pt.resp); err != nil {
- return err
- } else if lh == "" {
- return autorest.NewError("pollingTrackerPost", "updateHeaders", "missing Location header in 201 response")
- } else {
- pt.URI = lh
- pt.FinalGetURI = lh
- pt.Pm = PollingLocation
- }
- }
- // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary
- if pt.resp.StatusCode == http.StatusAccepted {
- ao, err := getURLFromAsyncOpHeader(pt.resp)
- if err != nil {
- return err
- } else if ao != "" {
- pt.URI = ao
- pt.Pm = PollingAsyncOperation
- }
- // if the Location header is invalid and we already have a polling URL
- // then we don't care if the Location header URL is malformed.
- if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" {
- return err
- } else if lh != "" {
- if ao == "" {
- pt.URI = lh
- pt.Pm = PollingLocation
- }
- // when both headers are returned we use the value in the Location header for the final GET
- pt.FinalGetURI = lh
- }
- // make sure a polling URL was found
- if pt.URI == "" {
- return autorest.NewError("pollingTrackerPost", "updateHeaders", "didn't get any suitable polling URLs in 202 response")
- }
- }
- return nil
-}
-
-func (pt pollingTrackerPost) checkForErrors() error {
- return pt.baseCheckForErrors()
-}
-
-func (pt pollingTrackerPost) provisioningStateApplicable() bool {
- return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusNoContent
-}
-
-// PUT
-
-type pollingTrackerPut struct {
- pollingTrackerBase
-}
-
-func (pt *pollingTrackerPut) updatePollingMethod() error {
- // by default we can use the original URL for polling and final GET
- if pt.URI == "" {
- pt.URI = pt.resp.Request.URL.String()
- }
- if pt.FinalGetURI == "" {
- pt.FinalGetURI = pt.resp.Request.URL.String()
- }
- if pt.Pm == PollingUnknown {
- pt.Pm = PollingRequestURI
- }
- // for 201 it's permissible for no headers to be returned
- if pt.resp.StatusCode == http.StatusCreated {
- if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil {
- return err
- } else if ao != "" {
- pt.URI = ao
- pt.Pm = PollingAsyncOperation
- }
- }
- // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary
- if pt.resp.StatusCode == http.StatusAccepted {
- ao, err := getURLFromAsyncOpHeader(pt.resp)
- if err != nil {
- return err
- } else if ao != "" {
- pt.URI = ao
- pt.Pm = PollingAsyncOperation
- }
- // if the Location header is invalid and we already have a polling URL
- // then we don't care if the Location header URL is malformed.
- if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" {
- return err
- } else if lh != "" {
- if ao == "" {
- pt.URI = lh
- pt.Pm = PollingLocation
- }
- }
- // make sure a polling URL was found
- if pt.URI == "" {
- return autorest.NewError("pollingTrackerPut", "updateHeaders", "didn't get any suitable polling URLs in 202 response")
- }
- }
- return nil
-}
-
-func (pt pollingTrackerPut) checkForErrors() error {
- err := pt.baseCheckForErrors()
- if err != nil {
- return err
- }
- // if there are no LRO headers then the body cannot be empty
- ao, err := getURLFromAsyncOpHeader(pt.resp)
- if err != nil {
- return err
- }
- lh, err := getURLFromLocationHeader(pt.resp)
- if err != nil {
- return err
- }
- if ao == "" && lh == "" && len(pt.rawBody) == 0 {
- return autorest.NewError("pollingTrackerPut", "checkForErrors", "the response did not contain a body")
- }
- return nil
-}
-
-func (pt pollingTrackerPut) provisioningStateApplicable() bool {
- return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusCreated
-}
-
-// creates a polling tracker based on the verb of the original request
-func createPollingTracker(resp *http.Response) (pollingTracker, error) {
- var pt pollingTracker
- switch strings.ToUpper(resp.Request.Method) {
- case http.MethodDelete:
- pt = &pollingTrackerDelete{pollingTrackerBase: pollingTrackerBase{resp: resp}}
- case http.MethodPatch:
- pt = &pollingTrackerPatch{pollingTrackerBase: pollingTrackerBase{resp: resp}}
- case http.MethodPost:
- pt = &pollingTrackerPost{pollingTrackerBase: pollingTrackerBase{resp: resp}}
- case http.MethodPut:
- pt = &pollingTrackerPut{pollingTrackerBase: pollingTrackerBase{resp: resp}}
- default:
- return nil, autorest.NewError("azure", "createPollingTracker", "unsupported HTTP method %s", resp.Request.Method)
- }
- if err := pt.initializeState(); err != nil {
- return pt, err
- }
- // this initializes the polling header values, we do this during creation in case the
- // initial response send us invalid values; this way the API call will return a non-nil
- // error (not doing this means the error shows up in Future.Done)
- return pt, pt.updatePollingMethod()
-}
-
-// gets the polling URL from the Azure-AsyncOperation header.
-// ensures the URL is well-formed and absolute.
-func getURLFromAsyncOpHeader(resp *http.Response) (string, error) {
- s := resp.Header.Get(http.CanonicalHeaderKey(headerAsyncOperation))
- if s == "" {
- return "", nil
- }
- if !isValidURL(s) {
- return "", autorest.NewError("azure", "getURLFromAsyncOpHeader", "invalid polling URL '%s'", s)
- }
- return s, nil
-}
-
-// gets the polling URL from the Location header.
-// ensures the URL is well-formed and absolute.
-func getURLFromLocationHeader(resp *http.Response) (string, error) {
- s := resp.Header.Get(http.CanonicalHeaderKey(autorest.HeaderLocation))
- if s == "" {
- return "", nil
- }
- if !isValidURL(s) {
- return "", autorest.NewError("azure", "getURLFromLocationHeader", "invalid polling URL '%s'", s)
- }
- return s, nil
-}
-
-// verify that the URL is valid and absolute
-func isValidURL(s string) bool {
- u, err := url.Parse(s)
- return err == nil && u.IsAbs()
-}
-
-// PollingMethodType defines a type used for enumerating polling mechanisms.
-type PollingMethodType string
-
-const (
- // PollingAsyncOperation indicates the polling method uses the Azure-AsyncOperation header.
- PollingAsyncOperation PollingMethodType = "AsyncOperation"
-
- // PollingLocation indicates the polling method uses the Location header.
- PollingLocation PollingMethodType = "Location"
-
- // PollingRequestURI indicates the polling method uses the original request URI.
- PollingRequestURI PollingMethodType = "RequestURI"
-
- // PollingUnknown indicates an unknown polling method and is the default value.
- PollingUnknown PollingMethodType = ""
-)
-
-// AsyncOpIncompleteError is the type that's returned from a future that has not completed.
-type AsyncOpIncompleteError struct {
- // FutureType is the name of the type composed of a azure.Future.
- FutureType string
-}
-
-// Error returns an error message including the originating type name of the error.
-func (e AsyncOpIncompleteError) Error() string {
- return fmt.Sprintf("%s: asynchronous operation has not completed", e.FutureType)
-}
-
-// NewAsyncOpIncompleteError creates a new AsyncOpIncompleteError with the specified parameters.
-func NewAsyncOpIncompleteError(futureType string) AsyncOpIncompleteError {
- return AsyncOpIncompleteError{
- FutureType: futureType,
- }
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
deleted file mode 100644
index 1328f1764..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go
+++ /dev/null
@@ -1,388 +0,0 @@
-// Package azure provides Azure-specific implementations used with AutoRest.
-// See the included examples for more detail.
-package azure
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "io/ioutil"
- "net/http"
- "regexp"
- "strconv"
- "strings"
-
- "github.com/Azure/go-autorest/autorest"
-)
-
-const (
- // HeaderClientID is the Azure extension header to set a user-specified request ID.
- HeaderClientID = "x-ms-client-request-id"
-
- // HeaderReturnClientID is the Azure extension header to set if the user-specified request ID
- // should be included in the response.
- HeaderReturnClientID = "x-ms-return-client-request-id"
-
- // HeaderContentType is the type of the content in the HTTP response.
- HeaderContentType = "Content-Type"
-
- // HeaderRequestID is the Azure extension header of the service generated request ID returned
- // in the response.
- HeaderRequestID = "x-ms-request-id"
-)
-
-// ServiceError encapsulates the error response from an Azure service.
-// It adhears to the OData v4 specification for error responses.
-type ServiceError struct {
- Code string `json:"code"`
- Message string `json:"message"`
- Target *string `json:"target"`
- Details []map[string]interface{} `json:"details"`
- InnerError map[string]interface{} `json:"innererror"`
- AdditionalInfo []map[string]interface{} `json:"additionalInfo"`
-}
-
-func (se ServiceError) Error() string {
- result := fmt.Sprintf("Code=%q Message=%q", se.Code, se.Message)
-
- if se.Target != nil {
- result += fmt.Sprintf(" Target=%q", *se.Target)
- }
-
- if se.Details != nil {
- d, err := json.Marshal(se.Details)
- if err != nil {
- result += fmt.Sprintf(" Details=%v", se.Details)
- }
- result += fmt.Sprintf(" Details=%s", d)
- }
-
- if se.InnerError != nil {
- d, err := json.Marshal(se.InnerError)
- if err != nil {
- result += fmt.Sprintf(" InnerError=%v", se.InnerError)
- }
- result += fmt.Sprintf(" InnerError=%s", d)
- }
-
- if se.AdditionalInfo != nil {
- d, err := json.Marshal(se.AdditionalInfo)
- if err != nil {
- result += fmt.Sprintf(" AdditionalInfo=%v", se.AdditionalInfo)
- }
- result += fmt.Sprintf(" AdditionalInfo=%s", d)
- }
-
- return result
-}
-
-// UnmarshalJSON implements the json.Unmarshaler interface for the ServiceError type.
-func (se *ServiceError) UnmarshalJSON(b []byte) error {
- // http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091
-
- type serviceErrorInternal struct {
- Code string `json:"code"`
- Message string `json:"message"`
- Target *string `json:"target,omitempty"`
- AdditionalInfo []map[string]interface{} `json:"additionalInfo,omitempty"`
- // not all services conform to the OData v4 spec.
- // the following fields are where we've seen discrepancies
-
- // spec calls for []map[string]interface{} but have seen map[string]interface{}
- Details interface{} `json:"details,omitempty"`
-
- // spec calls for map[string]interface{} but have seen []map[string]interface{} and string
- InnerError interface{} `json:"innererror,omitempty"`
- }
-
- sei := serviceErrorInternal{}
- if err := json.Unmarshal(b, &sei); err != nil {
- return err
- }
-
- // copy the fields we know to be correct
- se.AdditionalInfo = sei.AdditionalInfo
- se.Code = sei.Code
- se.Message = sei.Message
- se.Target = sei.Target
-
- // converts an []interface{} to []map[string]interface{}
- arrayOfObjs := func(v interface{}) ([]map[string]interface{}, bool) {
- arrayOf, ok := v.([]interface{})
- if !ok {
- return nil, false
- }
- final := []map[string]interface{}{}
- for _, item := range arrayOf {
- as, ok := item.(map[string]interface{})
- if !ok {
- return nil, false
- }
- final = append(final, as)
- }
- return final, true
- }
-
- // convert the remaining fields, falling back to raw JSON if necessary
-
- if c, ok := arrayOfObjs(sei.Details); ok {
- se.Details = c
- } else if c, ok := sei.Details.(map[string]interface{}); ok {
- se.Details = []map[string]interface{}{c}
- } else if sei.Details != nil {
- // stuff into Details
- se.Details = []map[string]interface{}{
- {"raw": sei.Details},
- }
- }
-
- if c, ok := sei.InnerError.(map[string]interface{}); ok {
- se.InnerError = c
- } else if c, ok := arrayOfObjs(sei.InnerError); ok {
- // if there's only one error extract it
- if len(c) == 1 {
- se.InnerError = c[0]
- } else {
- // multiple errors, stuff them into the value
- se.InnerError = map[string]interface{}{
- "multi": c,
- }
- }
- } else if c, ok := sei.InnerError.(string); ok {
- se.InnerError = map[string]interface{}{"error": c}
- } else if sei.InnerError != nil {
- // stuff into InnerError
- se.InnerError = map[string]interface{}{
- "raw": sei.InnerError,
- }
- }
- return nil
-}
-
-// RequestError describes an error response returned by Azure service.
-type RequestError struct {
- autorest.DetailedError
-
- // The error returned by the Azure service.
- ServiceError *ServiceError `json:"error" xml:"Error"`
-
- // The request id (from the x-ms-request-id-header) of the request.
- RequestID string
-}
-
-// Error returns a human-friendly error message from service error.
-func (e RequestError) Error() string {
- return fmt.Sprintf("autorest/azure: Service returned an error. Status=%v %v",
- e.StatusCode, e.ServiceError)
-}
-
-// IsAzureError returns true if the passed error is an Azure Service error; false otherwise.
-func IsAzureError(e error) bool {
- _, ok := e.(*RequestError)
- return ok
-}
-
-// Resource contains details about an Azure resource.
-type Resource struct {
- SubscriptionID string
- ResourceGroup string
- Provider string
- ResourceType string
- ResourceName string
-}
-
-// String function returns a string in form of azureResourceID
-func (r Resource) String() string {
- return fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/%s/%s/%s", r.SubscriptionID, r.ResourceGroup, r.Provider, r.ResourceType, r.ResourceName)
-}
-
-// ParseResourceID parses a resource ID into a ResourceDetails struct.
-// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-resource?tabs=json#resourceid.
-func ParseResourceID(resourceID string) (Resource, error) {
-
- const resourceIDPatternText = `(?i)subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+)`
- resourceIDPattern := regexp.MustCompile(resourceIDPatternText)
- match := resourceIDPattern.FindStringSubmatch(resourceID)
-
- if len(match) == 0 {
- return Resource{}, fmt.Errorf("parsing failed for %s. Invalid resource Id format", resourceID)
- }
-
- v := strings.Split(match[5], "/")
- resourceName := v[len(v)-1]
-
- result := Resource{
- SubscriptionID: match[1],
- ResourceGroup: match[2],
- Provider: match[3],
- ResourceType: match[4],
- ResourceName: resourceName,
- }
-
- return result, nil
-}
-
-// NewErrorWithError creates a new Error conforming object from the
-// passed packageType, method, statusCode of the given resp (UndefinedStatusCode
-// if resp is nil), message, and original error. message is treated as a format
-// string to which the optional args apply.
-func NewErrorWithError(original error, packageType string, method string, resp *http.Response, message string, args ...interface{}) RequestError {
- if v, ok := original.(*RequestError); ok {
- return *v
- }
-
- statusCode := autorest.UndefinedStatusCode
- if resp != nil {
- statusCode = resp.StatusCode
- }
- return RequestError{
- DetailedError: autorest.DetailedError{
- Original: original,
- PackageType: packageType,
- Method: method,
- StatusCode: statusCode,
- Message: fmt.Sprintf(message, args...),
- },
- }
-}
-
-// WithReturningClientID returns a PrepareDecorator that adds an HTTP extension header of
-// x-ms-client-request-id whose value is the passed, undecorated UUID (e.g.,
-// "0F39878C-5F76-4DB8-A25D-61D2C193C3CA"). It also sets the x-ms-return-client-request-id
-// header to true such that UUID accompanies the http.Response.
-func WithReturningClientID(uuid string) autorest.PrepareDecorator {
- preparer := autorest.CreatePreparer(
- WithClientID(uuid),
- WithReturnClientID(true))
-
- return func(p autorest.Preparer) autorest.Preparer {
- return autorest.PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err != nil {
- return r, err
- }
- return preparer.Prepare(r)
- })
- }
-}
-
-// WithClientID returns a PrepareDecorator that adds an HTTP extension header of
-// x-ms-client-request-id whose value is passed, undecorated UUID (e.g.,
-// "0F39878C-5F76-4DB8-A25D-61D2C193C3CA").
-func WithClientID(uuid string) autorest.PrepareDecorator {
- return autorest.WithHeader(HeaderClientID, uuid)
-}
-
-// WithReturnClientID returns a PrepareDecorator that adds an HTTP extension header of
-// x-ms-return-client-request-id whose boolean value indicates if the value of the
-// x-ms-client-request-id header should be included in the http.Response.
-func WithReturnClientID(b bool) autorest.PrepareDecorator {
- return autorest.WithHeader(HeaderReturnClientID, strconv.FormatBool(b))
-}
-
-// ExtractClientID extracts the client identifier from the x-ms-client-request-id header set on the
-// http.Request sent to the service (and returned in the http.Response)
-func ExtractClientID(resp *http.Response) string {
- return autorest.ExtractHeaderValue(HeaderClientID, resp)
-}
-
-// ExtractRequestID extracts the Azure server generated request identifier from the
-// x-ms-request-id header.
-func ExtractRequestID(resp *http.Response) string {
- return autorest.ExtractHeaderValue(HeaderRequestID, resp)
-}
-
-// WithErrorUnlessStatusCode returns a RespondDecorator that emits an
-// azure.RequestError by reading the response body unless the response HTTP status code
-// is among the set passed.
-//
-// If there is a chance service may return responses other than the Azure error
-// format and the response cannot be parsed into an error, a decoding error will
-// be returned containing the response body. In any case, the Responder will
-// return an error if the status code is not satisfied.
-//
-// If this Responder returns an error, the response body will be replaced with
-// an in-memory reader, which needs no further closing.
-func WithErrorUnlessStatusCode(codes ...int) autorest.RespondDecorator {
- return func(r autorest.Responder) autorest.Responder {
- return autorest.ResponderFunc(func(resp *http.Response) error {
- err := r.Respond(resp)
- if err == nil && !autorest.ResponseHasStatusCode(resp, codes...) {
- var e RequestError
- defer resp.Body.Close()
-
- encodedAs := autorest.EncodedAsJSON
- if strings.Contains(resp.Header.Get("Content-Type"), "xml") {
- encodedAs = autorest.EncodedAsXML
- }
-
- // Copy and replace the Body in case it does not contain an error object.
- // This will leave the Body available to the caller.
- b, decodeErr := autorest.CopyAndDecode(encodedAs, resp.Body, &e)
- resp.Body = ioutil.NopCloser(&b)
- if decodeErr != nil {
- return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b, decodeErr)
- }
- if e.ServiceError == nil {
- // Check if error is unwrapped ServiceError
- decoder := autorest.NewDecoder(encodedAs, bytes.NewReader(b.Bytes()))
- if err := decoder.Decode(&e.ServiceError); err != nil {
- return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b, err)
- }
-
- // for example, should the API return the literal value `null` as the response
- if e.ServiceError == nil {
- e.ServiceError = &ServiceError{
- Code: "Unknown",
- Message: "Unknown service error",
- Details: []map[string]interface{}{
- {
- "HttpResponse.Body": b.String(),
- },
- },
- }
- }
- }
-
- if e.ServiceError != nil && e.ServiceError.Message == "" {
- // if we're here it means the returned error wasn't OData v4 compliant.
- // try to unmarshal the body in hopes of getting something.
- rawBody := map[string]interface{}{}
- decoder := autorest.NewDecoder(encodedAs, bytes.NewReader(b.Bytes()))
- if err := decoder.Decode(&rawBody); err != nil {
- return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b, err)
- }
-
- e.ServiceError = &ServiceError{
- Code: "Unknown",
- Message: "Unknown service error",
- }
- if len(rawBody) > 0 {
- e.ServiceError.Details = []map[string]interface{}{rawBody}
- }
- }
- e.Response = resp
- e.RequestID = ExtractRequestID(resp)
- if e.StatusCode == nil {
- e.StatusCode = resp.StatusCode
- }
- err = &e
- }
- return err
- })
- }
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
deleted file mode 100644
index b0a53769f..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go
+++ /dev/null
@@ -1,331 +0,0 @@
-package azure
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "encoding/json"
- "fmt"
- "io/ioutil"
- "os"
- "strings"
-)
-
-const (
- // EnvironmentFilepathName captures the name of the environment variable containing the path to the file
- // to be used while populating the Azure Environment.
- EnvironmentFilepathName = "AZURE_ENVIRONMENT_FILEPATH"
-
- // NotAvailable is used for endpoints and resource IDs that are not available for a given cloud.
- NotAvailable = "N/A"
-)
-
-var environments = map[string]Environment{
- "AZURECHINACLOUD": ChinaCloud,
- "AZUREGERMANCLOUD": GermanCloud,
- "AZURECLOUD": PublicCloud,
- "AZUREPUBLICCLOUD": PublicCloud,
- "AZUREUSGOVERNMENT": USGovernmentCloud,
- "AZUREUSGOVERNMENTCLOUD": USGovernmentCloud, //TODO: deprecate
-}
-
-// ResourceIdentifier contains a set of Azure resource IDs.
-type ResourceIdentifier struct {
- Graph string `json:"graph"`
- KeyVault string `json:"keyVault"`
- Datalake string `json:"datalake"`
- Batch string `json:"batch"`
- OperationalInsights string `json:"operationalInsights"`
- OSSRDBMS string `json:"ossRDBMS"`
- Storage string `json:"storage"`
- Synapse string `json:"synapse"`
- ServiceBus string `json:"serviceBus"`
- SQLDatabase string `json:"sqlDatabase"`
- CosmosDB string `json:"cosmosDB"`
- ManagedHSM string `json:"managedHSM"`
- MicrosoftGraph string `json:"microsoftGraph"`
-}
-
-// Environment represents a set of endpoints for each of Azure's Clouds.
-type Environment struct {
- Name string `json:"name"`
- ManagementPortalURL string `json:"managementPortalURL"`
- PublishSettingsURL string `json:"publishSettingsURL"`
- ServiceManagementEndpoint string `json:"serviceManagementEndpoint"`
- ResourceManagerEndpoint string `json:"resourceManagerEndpoint"`
- ActiveDirectoryEndpoint string `json:"activeDirectoryEndpoint"`
- GalleryEndpoint string `json:"galleryEndpoint"`
- KeyVaultEndpoint string `json:"keyVaultEndpoint"`
- ManagedHSMEndpoint string `json:"managedHSMEndpoint"`
- GraphEndpoint string `json:"graphEndpoint"`
- ServiceBusEndpoint string `json:"serviceBusEndpoint"`
- BatchManagementEndpoint string `json:"batchManagementEndpoint"`
- MicrosoftGraphEndpoint string `json:"microsoftGraphEndpoint"`
- StorageEndpointSuffix string `json:"storageEndpointSuffix"`
- CosmosDBDNSSuffix string `json:"cosmosDBDNSSuffix"`
- MariaDBDNSSuffix string `json:"mariaDBDNSSuffix"`
- MySQLDatabaseDNSSuffix string `json:"mySqlDatabaseDNSSuffix"`
- PostgresqlDatabaseDNSSuffix string `json:"postgresqlDatabaseDNSSuffix"`
- SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"`
- TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"`
- KeyVaultDNSSuffix string `json:"keyVaultDNSSuffix"`
- ManagedHSMDNSSuffix string `json:"managedHSMDNSSuffix"`
- ServiceBusEndpointSuffix string `json:"serviceBusEndpointSuffix"`
- ServiceManagementVMDNSSuffix string `json:"serviceManagementVMDNSSuffix"`
- ResourceManagerVMDNSSuffix string `json:"resourceManagerVMDNSSuffix"`
- ContainerRegistryDNSSuffix string `json:"containerRegistryDNSSuffix"`
- TokenAudience string `json:"tokenAudience"`
- APIManagementHostNameSuffix string `json:"apiManagementHostNameSuffix"`
- SynapseEndpointSuffix string `json:"synapseEndpointSuffix"`
- DatalakeSuffix string `json:"datalakeSuffix"`
- ResourceIdentifiers ResourceIdentifier `json:"resourceIdentifiers"`
-}
-
-var (
- // PublicCloud is the default public Azure cloud environment
- PublicCloud = Environment{
- Name: "AzurePublicCloud",
- ManagementPortalURL: "https://manage.windowsazure.com/",
- PublishSettingsURL: "https://manage.windowsazure.com/publishsettings/index",
- ServiceManagementEndpoint: "https://management.core.windows.net/",
- ResourceManagerEndpoint: "https://management.azure.com/",
- ActiveDirectoryEndpoint: "https://login.microsoftonline.com/",
- GalleryEndpoint: "https://gallery.azure.com/",
- KeyVaultEndpoint: "https://vault.azure.net/",
- ManagedHSMEndpoint: "https://managedhsm.azure.net/",
- GraphEndpoint: "https://graph.windows.net/",
- ServiceBusEndpoint: "https://servicebus.windows.net/",
- BatchManagementEndpoint: "https://batch.core.windows.net/",
- MicrosoftGraphEndpoint: "https://graph.microsoft.com/",
- StorageEndpointSuffix: "core.windows.net",
- CosmosDBDNSSuffix: "documents.azure.com",
- MariaDBDNSSuffix: "mariadb.database.azure.com",
- MySQLDatabaseDNSSuffix: "mysql.database.azure.com",
- PostgresqlDatabaseDNSSuffix: "postgres.database.azure.com",
- SQLDatabaseDNSSuffix: "database.windows.net",
- TrafficManagerDNSSuffix: "trafficmanager.net",
- KeyVaultDNSSuffix: "vault.azure.net",
- ManagedHSMDNSSuffix: "managedhsm.azure.net",
- ServiceBusEndpointSuffix: "servicebus.windows.net",
- ServiceManagementVMDNSSuffix: "cloudapp.net",
- ResourceManagerVMDNSSuffix: "cloudapp.azure.com",
- ContainerRegistryDNSSuffix: "azurecr.io",
- TokenAudience: "https://management.azure.com/",
- APIManagementHostNameSuffix: "azure-api.net",
- SynapseEndpointSuffix: "dev.azuresynapse.net",
- DatalakeSuffix: "azuredatalakestore.net",
- ResourceIdentifiers: ResourceIdentifier{
- Graph: "https://graph.windows.net/",
- KeyVault: "https://vault.azure.net",
- Datalake: "https://datalake.azure.net/",
- Batch: "https://batch.core.windows.net/",
- OperationalInsights: "https://api.loganalytics.io",
- OSSRDBMS: "https://ossrdbms-aad.database.windows.net",
- Storage: "https://storage.azure.com/",
- Synapse: "https://dev.azuresynapse.net",
- ServiceBus: "https://servicebus.azure.net/",
- SQLDatabase: "https://database.windows.net/",
- CosmosDB: "https://cosmos.azure.com",
- ManagedHSM: "https://managedhsm.azure.net",
- MicrosoftGraph: "https://graph.microsoft.com/",
- },
- }
-
- // USGovernmentCloud is the cloud environment for the US Government
- USGovernmentCloud = Environment{
- Name: "AzureUSGovernmentCloud",
- ManagementPortalURL: "https://manage.windowsazure.us/",
- PublishSettingsURL: "https://manage.windowsazure.us/publishsettings/index",
- ServiceManagementEndpoint: "https://management.core.usgovcloudapi.net/",
- ResourceManagerEndpoint: "https://management.usgovcloudapi.net/",
- ActiveDirectoryEndpoint: "https://login.microsoftonline.us/",
- GalleryEndpoint: "https://gallery.usgovcloudapi.net/",
- KeyVaultEndpoint: "https://vault.usgovcloudapi.net/",
- ManagedHSMEndpoint: NotAvailable,
- GraphEndpoint: "https://graph.windows.net/",
- ServiceBusEndpoint: "https://servicebus.usgovcloudapi.net/",
- BatchManagementEndpoint: "https://batch.core.usgovcloudapi.net/",
- MicrosoftGraphEndpoint: "https://graph.microsoft.us/",
- StorageEndpointSuffix: "core.usgovcloudapi.net",
- CosmosDBDNSSuffix: "documents.azure.us",
- MariaDBDNSSuffix: "mariadb.database.usgovcloudapi.net",
- MySQLDatabaseDNSSuffix: "mysql.database.usgovcloudapi.net",
- PostgresqlDatabaseDNSSuffix: "postgres.database.usgovcloudapi.net",
- SQLDatabaseDNSSuffix: "database.usgovcloudapi.net",
- TrafficManagerDNSSuffix: "usgovtrafficmanager.net",
- KeyVaultDNSSuffix: "vault.usgovcloudapi.net",
- ManagedHSMDNSSuffix: NotAvailable,
- ServiceBusEndpointSuffix: "servicebus.usgovcloudapi.net",
- ServiceManagementVMDNSSuffix: "usgovcloudapp.net",
- ResourceManagerVMDNSSuffix: "cloudapp.usgovcloudapi.net",
- ContainerRegistryDNSSuffix: "azurecr.us",
- TokenAudience: "https://management.usgovcloudapi.net/",
- APIManagementHostNameSuffix: "azure-api.us",
- SynapseEndpointSuffix: "dev.azuresynapse.usgovcloudapi.net",
- DatalakeSuffix: NotAvailable,
- ResourceIdentifiers: ResourceIdentifier{
- Graph: "https://graph.windows.net/",
- KeyVault: "https://vault.usgovcloudapi.net",
- Datalake: NotAvailable,
- Batch: "https://batch.core.usgovcloudapi.net/",
- OperationalInsights: "https://api.loganalytics.us",
- OSSRDBMS: "https://ossrdbms-aad.database.usgovcloudapi.net",
- Storage: "https://storage.azure.com/",
- Synapse: "https://dev.azuresynapse.usgovcloudapi.net",
- ServiceBus: "https://servicebus.azure.net/",
- SQLDatabase: "https://database.usgovcloudapi.net/",
- CosmosDB: "https://cosmos.azure.com",
- ManagedHSM: NotAvailable,
- MicrosoftGraph: "https://graph.microsoft.us/",
- },
- }
-
- // ChinaCloud is the cloud environment operated in China
- ChinaCloud = Environment{
- Name: "AzureChinaCloud",
- ManagementPortalURL: "https://manage.chinacloudapi.com/",
- PublishSettingsURL: "https://manage.chinacloudapi.com/publishsettings/index",
- ServiceManagementEndpoint: "https://management.core.chinacloudapi.cn/",
- ResourceManagerEndpoint: "https://management.chinacloudapi.cn/",
- ActiveDirectoryEndpoint: "https://login.chinacloudapi.cn/",
- GalleryEndpoint: "https://gallery.chinacloudapi.cn/",
- KeyVaultEndpoint: "https://vault.azure.cn/",
- ManagedHSMEndpoint: NotAvailable,
- GraphEndpoint: "https://graph.chinacloudapi.cn/",
- ServiceBusEndpoint: "https://servicebus.chinacloudapi.cn/",
- BatchManagementEndpoint: "https://batch.chinacloudapi.cn/",
- MicrosoftGraphEndpoint: "https://microsoftgraph.chinacloudapi.cn/",
- StorageEndpointSuffix: "core.chinacloudapi.cn",
- CosmosDBDNSSuffix: "documents.azure.cn",
- MariaDBDNSSuffix: "mariadb.database.chinacloudapi.cn",
- MySQLDatabaseDNSSuffix: "mysql.database.chinacloudapi.cn",
- PostgresqlDatabaseDNSSuffix: "postgres.database.chinacloudapi.cn",
- SQLDatabaseDNSSuffix: "database.chinacloudapi.cn",
- TrafficManagerDNSSuffix: "trafficmanager.cn",
- KeyVaultDNSSuffix: "vault.azure.cn",
- ManagedHSMDNSSuffix: NotAvailable,
- ServiceBusEndpointSuffix: "servicebus.chinacloudapi.cn",
- ServiceManagementVMDNSSuffix: "chinacloudapp.cn",
- ResourceManagerVMDNSSuffix: "cloudapp.chinacloudapi.cn",
- ContainerRegistryDNSSuffix: "azurecr.cn",
- TokenAudience: "https://management.chinacloudapi.cn/",
- APIManagementHostNameSuffix: "azure-api.cn",
- SynapseEndpointSuffix: "dev.azuresynapse.azure.cn",
- DatalakeSuffix: NotAvailable,
- ResourceIdentifiers: ResourceIdentifier{
- Graph: "https://graph.chinacloudapi.cn/",
- KeyVault: "https://vault.azure.cn",
- Datalake: NotAvailable,
- Batch: "https://batch.chinacloudapi.cn/",
- OperationalInsights: NotAvailable,
- OSSRDBMS: "https://ossrdbms-aad.database.chinacloudapi.cn",
- Storage: "https://storage.azure.com/",
- Synapse: "https://dev.azuresynapse.net",
- ServiceBus: "https://servicebus.azure.net/",
- SQLDatabase: "https://database.chinacloudapi.cn/",
- CosmosDB: "https://cosmos.azure.com",
- ManagedHSM: NotAvailable,
- MicrosoftGraph: "https://microsoftgraph.chinacloudapi.cn",
- },
- }
-
- // GermanCloud is the cloud environment operated in Germany
- GermanCloud = Environment{
- Name: "AzureGermanCloud",
- ManagementPortalURL: "http://portal.microsoftazure.de/",
- PublishSettingsURL: "https://manage.microsoftazure.de/publishsettings/index",
- ServiceManagementEndpoint: "https://management.core.cloudapi.de/",
- ResourceManagerEndpoint: "https://management.microsoftazure.de/",
- ActiveDirectoryEndpoint: "https://login.microsoftonline.de/",
- GalleryEndpoint: "https://gallery.cloudapi.de/",
- KeyVaultEndpoint: "https://vault.microsoftazure.de/",
- ManagedHSMEndpoint: NotAvailable,
- GraphEndpoint: "https://graph.cloudapi.de/",
- ServiceBusEndpoint: "https://servicebus.cloudapi.de/",
- BatchManagementEndpoint: "https://batch.cloudapi.de/",
- MicrosoftGraphEndpoint: NotAvailable,
- StorageEndpointSuffix: "core.cloudapi.de",
- CosmosDBDNSSuffix: "documents.microsoftazure.de",
- MariaDBDNSSuffix: "mariadb.database.cloudapi.de",
- MySQLDatabaseDNSSuffix: "mysql.database.cloudapi.de",
- PostgresqlDatabaseDNSSuffix: "postgres.database.cloudapi.de",
- SQLDatabaseDNSSuffix: "database.cloudapi.de",
- TrafficManagerDNSSuffix: "azuretrafficmanager.de",
- KeyVaultDNSSuffix: "vault.microsoftazure.de",
- ManagedHSMDNSSuffix: NotAvailable,
- ServiceBusEndpointSuffix: "servicebus.cloudapi.de",
- ServiceManagementVMDNSSuffix: "azurecloudapp.de",
- ResourceManagerVMDNSSuffix: "cloudapp.microsoftazure.de",
- ContainerRegistryDNSSuffix: NotAvailable,
- TokenAudience: "https://management.microsoftazure.de/",
- APIManagementHostNameSuffix: NotAvailable,
- SynapseEndpointSuffix: NotAvailable,
- DatalakeSuffix: NotAvailable,
- ResourceIdentifiers: ResourceIdentifier{
- Graph: "https://graph.cloudapi.de/",
- KeyVault: "https://vault.microsoftazure.de",
- Datalake: NotAvailable,
- Batch: "https://batch.cloudapi.de/",
- OperationalInsights: NotAvailable,
- OSSRDBMS: "https://ossrdbms-aad.database.cloudapi.de",
- Storage: "https://storage.azure.com/",
- Synapse: NotAvailable,
- ServiceBus: "https://servicebus.azure.net/",
- SQLDatabase: "https://database.cloudapi.de/",
- CosmosDB: "https://cosmos.azure.com",
- ManagedHSM: NotAvailable,
- MicrosoftGraph: NotAvailable,
- },
- }
-)
-
-// EnvironmentFromName returns an Environment based on the common name specified.
-func EnvironmentFromName(name string) (Environment, error) {
- // IMPORTANT
- // As per @radhikagupta5:
- // This is technical debt, fundamentally here because Kubernetes is not currently accepting
- // contributions to the providers. Once that is an option, the provider should be updated to
- // directly call `EnvironmentFromFile`. Until then, we rely on dispatching Azure Stack environment creation
- // from this method based on the name that is provided to us.
- if strings.EqualFold(name, "AZURESTACKCLOUD") {
- return EnvironmentFromFile(os.Getenv(EnvironmentFilepathName))
- }
-
- name = strings.ToUpper(name)
- env, ok := environments[name]
- if !ok {
- return env, fmt.Errorf("autorest/azure: There is no cloud environment matching the name %q", name)
- }
-
- return env, nil
-}
-
-// EnvironmentFromFile loads an Environment from a configuration file available on disk.
-// This function is particularly useful in the Hybrid Cloud model, where one must define their own
-// endpoints.
-func EnvironmentFromFile(location string) (unmarshaled Environment, err error) {
- fileContents, err := ioutil.ReadFile(location)
- if err != nil {
- return
- }
-
- err = json.Unmarshal(fileContents, &unmarshaled)
-
- return
-}
-
-// SetEnvironment updates the environment map with the specified values.
-func SetEnvironment(name string, env Environment) {
- environments[strings.ToUpper(name)] = env
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go b/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go
deleted file mode 100644
index 507f9e95c..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go
+++ /dev/null
@@ -1,245 +0,0 @@
-package azure
-
-import (
- "encoding/json"
- "fmt"
- "io/ioutil"
- "net/http"
- "strings"
-
- "github.com/Azure/go-autorest/autorest"
-)
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-type audience []string
-
-type authentication struct {
- LoginEndpoint string `json:"loginEndpoint"`
- Audiences audience `json:"audiences"`
-}
-
-type environmentMetadataInfo struct {
- GalleryEndpoint string `json:"galleryEndpoint"`
- GraphEndpoint string `json:"graphEndpoint"`
- PortalEndpoint string `json:"portalEndpoint"`
- Authentication authentication `json:"authentication"`
-}
-
-// EnvironmentProperty represent property names that clients can override
-type EnvironmentProperty string
-
-const (
- // EnvironmentName ...
- EnvironmentName EnvironmentProperty = "name"
- // EnvironmentManagementPortalURL ..
- EnvironmentManagementPortalURL EnvironmentProperty = "managementPortalURL"
- // EnvironmentPublishSettingsURL ...
- EnvironmentPublishSettingsURL EnvironmentProperty = "publishSettingsURL"
- // EnvironmentServiceManagementEndpoint ...
- EnvironmentServiceManagementEndpoint EnvironmentProperty = "serviceManagementEndpoint"
- // EnvironmentResourceManagerEndpoint ...
- EnvironmentResourceManagerEndpoint EnvironmentProperty = "resourceManagerEndpoint"
- // EnvironmentActiveDirectoryEndpoint ...
- EnvironmentActiveDirectoryEndpoint EnvironmentProperty = "activeDirectoryEndpoint"
- // EnvironmentGalleryEndpoint ...
- EnvironmentGalleryEndpoint EnvironmentProperty = "galleryEndpoint"
- // EnvironmentKeyVaultEndpoint ...
- EnvironmentKeyVaultEndpoint EnvironmentProperty = "keyVaultEndpoint"
- // EnvironmentGraphEndpoint ...
- EnvironmentGraphEndpoint EnvironmentProperty = "graphEndpoint"
- // EnvironmentServiceBusEndpoint ...
- EnvironmentServiceBusEndpoint EnvironmentProperty = "serviceBusEndpoint"
- // EnvironmentBatchManagementEndpoint ...
- EnvironmentBatchManagementEndpoint EnvironmentProperty = "batchManagementEndpoint"
- // EnvironmentStorageEndpointSuffix ...
- EnvironmentStorageEndpointSuffix EnvironmentProperty = "storageEndpointSuffix"
- // EnvironmentSQLDatabaseDNSSuffix ...
- EnvironmentSQLDatabaseDNSSuffix EnvironmentProperty = "sqlDatabaseDNSSuffix"
- // EnvironmentTrafficManagerDNSSuffix ...
- EnvironmentTrafficManagerDNSSuffix EnvironmentProperty = "trafficManagerDNSSuffix"
- // EnvironmentKeyVaultDNSSuffix ...
- EnvironmentKeyVaultDNSSuffix EnvironmentProperty = "keyVaultDNSSuffix"
- // EnvironmentServiceBusEndpointSuffix ...
- EnvironmentServiceBusEndpointSuffix EnvironmentProperty = "serviceBusEndpointSuffix"
- // EnvironmentServiceManagementVMDNSSuffix ...
- EnvironmentServiceManagementVMDNSSuffix EnvironmentProperty = "serviceManagementVMDNSSuffix"
- // EnvironmentResourceManagerVMDNSSuffix ...
- EnvironmentResourceManagerVMDNSSuffix EnvironmentProperty = "resourceManagerVMDNSSuffix"
- // EnvironmentContainerRegistryDNSSuffix ...
- EnvironmentContainerRegistryDNSSuffix EnvironmentProperty = "containerRegistryDNSSuffix"
- // EnvironmentTokenAudience ...
- EnvironmentTokenAudience EnvironmentProperty = "tokenAudience"
-)
-
-// OverrideProperty represents property name and value that clients can override
-type OverrideProperty struct {
- Key EnvironmentProperty
- Value string
-}
-
-// EnvironmentFromURL loads an Environment from a URL
-// This function is particularly useful in the Hybrid Cloud model, where one may define their own
-// endpoints.
-func EnvironmentFromURL(resourceManagerEndpoint string, properties ...OverrideProperty) (environment Environment, err error) {
- var metadataEnvProperties environmentMetadataInfo
-
- if resourceManagerEndpoint == "" {
- return environment, fmt.Errorf("Metadata resource manager endpoint is empty")
- }
-
- if metadataEnvProperties, err = retrieveMetadataEnvironment(resourceManagerEndpoint); err != nil {
- return environment, err
- }
-
- // Give priority to user's override values
- overrideProperties(&environment, properties)
-
- if environment.Name == "" {
- environment.Name = "HybridEnvironment"
- }
- stampDNSSuffix := environment.StorageEndpointSuffix
- if stampDNSSuffix == "" {
- stampDNSSuffix = strings.TrimSuffix(strings.TrimPrefix(strings.Replace(resourceManagerEndpoint, strings.Split(resourceManagerEndpoint, ".")[0], "", 1), "."), "/")
- environment.StorageEndpointSuffix = stampDNSSuffix
- }
- if environment.KeyVaultDNSSuffix == "" {
- environment.KeyVaultDNSSuffix = fmt.Sprintf("%s.%s", "vault", stampDNSSuffix)
- }
- if environment.KeyVaultEndpoint == "" {
- environment.KeyVaultEndpoint = fmt.Sprintf("%s%s", "https://", environment.KeyVaultDNSSuffix)
- }
- if environment.TokenAudience == "" {
- environment.TokenAudience = metadataEnvProperties.Authentication.Audiences[0]
- }
- if environment.ActiveDirectoryEndpoint == "" {
- environment.ActiveDirectoryEndpoint = metadataEnvProperties.Authentication.LoginEndpoint
- }
- if environment.ResourceManagerEndpoint == "" {
- environment.ResourceManagerEndpoint = resourceManagerEndpoint
- }
- if environment.GalleryEndpoint == "" {
- environment.GalleryEndpoint = metadataEnvProperties.GalleryEndpoint
- }
- if environment.GraphEndpoint == "" {
- environment.GraphEndpoint = metadataEnvProperties.GraphEndpoint
- }
-
- return environment, nil
-}
-
-func overrideProperties(environment *Environment, properties []OverrideProperty) {
- for _, property := range properties {
- switch property.Key {
- case EnvironmentName:
- {
- environment.Name = property.Value
- }
- case EnvironmentManagementPortalURL:
- {
- environment.ManagementPortalURL = property.Value
- }
- case EnvironmentPublishSettingsURL:
- {
- environment.PublishSettingsURL = property.Value
- }
- case EnvironmentServiceManagementEndpoint:
- {
- environment.ServiceManagementEndpoint = property.Value
- }
- case EnvironmentResourceManagerEndpoint:
- {
- environment.ResourceManagerEndpoint = property.Value
- }
- case EnvironmentActiveDirectoryEndpoint:
- {
- environment.ActiveDirectoryEndpoint = property.Value
- }
- case EnvironmentGalleryEndpoint:
- {
- environment.GalleryEndpoint = property.Value
- }
- case EnvironmentKeyVaultEndpoint:
- {
- environment.KeyVaultEndpoint = property.Value
- }
- case EnvironmentGraphEndpoint:
- {
- environment.GraphEndpoint = property.Value
- }
- case EnvironmentServiceBusEndpoint:
- {
- environment.ServiceBusEndpoint = property.Value
- }
- case EnvironmentBatchManagementEndpoint:
- {
- environment.BatchManagementEndpoint = property.Value
- }
- case EnvironmentStorageEndpointSuffix:
- {
- environment.StorageEndpointSuffix = property.Value
- }
- case EnvironmentSQLDatabaseDNSSuffix:
- {
- environment.SQLDatabaseDNSSuffix = property.Value
- }
- case EnvironmentTrafficManagerDNSSuffix:
- {
- environment.TrafficManagerDNSSuffix = property.Value
- }
- case EnvironmentKeyVaultDNSSuffix:
- {
- environment.KeyVaultDNSSuffix = property.Value
- }
- case EnvironmentServiceBusEndpointSuffix:
- {
- environment.ServiceBusEndpointSuffix = property.Value
- }
- case EnvironmentServiceManagementVMDNSSuffix:
- {
- environment.ServiceManagementVMDNSSuffix = property.Value
- }
- case EnvironmentResourceManagerVMDNSSuffix:
- {
- environment.ResourceManagerVMDNSSuffix = property.Value
- }
- case EnvironmentContainerRegistryDNSSuffix:
- {
- environment.ContainerRegistryDNSSuffix = property.Value
- }
- case EnvironmentTokenAudience:
- {
- environment.TokenAudience = property.Value
- }
- }
- }
-}
-
-func retrieveMetadataEnvironment(endpoint string) (environment environmentMetadataInfo, err error) {
- client := autorest.NewClientWithUserAgent("")
- managementEndpoint := fmt.Sprintf("%s%s", strings.TrimSuffix(endpoint, "/"), "/metadata/endpoints?api-version=1.0")
- req, _ := http.NewRequest("GET", managementEndpoint, nil)
- response, err := client.Do(req)
- if err != nil {
- return environment, err
- }
- defer response.Body.Close()
- jsonResponse, err := ioutil.ReadAll(response.Body)
- if err != nil {
- return environment, err
- }
- err = json.Unmarshal(jsonResponse, &environment)
- return environment, err
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
deleted file mode 100644
index 5b52357f9..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package azure
-
-import (
- "errors"
- "fmt"
- "net/http"
- "net/url"
- "strings"
- "time"
-
- "github.com/Azure/go-autorest/autorest"
-)
-
-// DoRetryWithRegistration tries to register the resource provider in case it is unregistered.
-// It also handles request retries
-func DoRetryWithRegistration(client autorest.Client) autorest.SendDecorator {
- return func(s autorest.Sender) autorest.Sender {
- return autorest.SenderFunc(func(r *http.Request) (resp *http.Response, err error) {
- rr := autorest.NewRetriableRequest(r)
- for currentAttempt := 0; currentAttempt < client.RetryAttempts; currentAttempt++ {
- err = rr.Prepare()
- if err != nil {
- return resp, err
- }
-
- resp, err = autorest.SendWithSender(s, rr.Request(),
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...),
- )
- if err != nil {
- return resp, err
- }
-
- if resp.StatusCode != http.StatusConflict || client.SkipResourceProviderRegistration {
- return resp, err
- }
-
- var re RequestError
- if strings.Contains(r.Header.Get("Content-Type"), "xml") {
- // XML errors (e.g. Storage Data Plane) only return the inner object
- err = autorest.Respond(resp, autorest.ByUnmarshallingXML(&re.ServiceError))
- } else {
- err = autorest.Respond(resp, autorest.ByUnmarshallingJSON(&re))
- }
-
- if err != nil {
- return resp, err
- }
- err = re
-
- if re.ServiceError != nil && re.ServiceError.Code == "MissingSubscriptionRegistration" {
- regErr := register(client, r, re)
- if regErr != nil {
- return resp, fmt.Errorf("failed auto registering Resource Provider: %s. Original error: %w", regErr, err)
- }
- }
- }
- return resp, err
- })
- }
-}
-
-func getProvider(re RequestError) (string, error) {
- if re.ServiceError != nil && len(re.ServiceError.Details) > 0 {
- return re.ServiceError.Details[0]["target"].(string), nil
- }
- return "", errors.New("provider was not found in the response")
-}
-
-func register(client autorest.Client, originalReq *http.Request, re RequestError) error {
- subID := getSubscription(originalReq.URL.Path)
- if subID == "" {
- return errors.New("missing parameter subscriptionID to register resource provider")
- }
- providerName, err := getProvider(re)
- if err != nil {
- return fmt.Errorf("missing parameter provider to register resource provider: %s", err)
- }
- newURL := url.URL{
- Scheme: originalReq.URL.Scheme,
- Host: originalReq.URL.Host,
- }
-
- // taken from the resources SDK
- // with almost identical code, this sections are easier to mantain
- // It is also not a good idea to import the SDK here
- // https://github.com/Azure/azure-sdk-for-go/blob/9f366792afa3e0ddaecdc860e793ba9d75e76c27/arm/resources/resources/providers.go#L252
- pathParameters := map[string]interface{}{
- "resourceProviderNamespace": autorest.Encode("path", providerName),
- "subscriptionId": autorest.Encode("path", subID),
- }
-
- const APIVersion = "2016-09-01"
- queryParameters := map[string]interface{}{
- "api-version": APIVersion,
- }
-
- preparer := autorest.CreatePreparer(
- autorest.AsPost(),
- autorest.WithBaseURL(newURL.String()),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", pathParameters),
- autorest.WithQueryParameters(queryParameters),
- )
-
- req, err := preparer.Prepare(&http.Request{})
- if err != nil {
- return err
- }
- req = req.WithContext(originalReq.Context())
-
- resp, err := autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...),
- )
- if err != nil {
- return err
- }
-
- type Provider struct {
- RegistrationState *string `json:"registrationState,omitempty"`
- }
- var provider Provider
-
- err = autorest.Respond(
- resp,
- WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&provider),
- autorest.ByClosing(),
- )
- if err != nil {
- return err
- }
-
- // poll for registered provisioning state
- registrationStartTime := time.Now()
- for err == nil && (client.PollingDuration == 0 || (client.PollingDuration != 0 && time.Since(registrationStartTime) < client.PollingDuration)) {
- // taken from the resources SDK
- // https://github.com/Azure/azure-sdk-for-go/blob/9f366792afa3e0ddaecdc860e793ba9d75e76c27/arm/resources/resources/providers.go#L45
- preparer := autorest.CreatePreparer(
- autorest.AsGet(),
- autorest.WithBaseURL(newURL.String()),
- autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}", pathParameters),
- autorest.WithQueryParameters(queryParameters),
- )
- req, err = preparer.Prepare(&http.Request{})
- if err != nil {
- return err
- }
- req = req.WithContext(originalReq.Context())
-
- resp, err := autorest.SendWithSender(client, req,
- autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...),
- )
- if err != nil {
- return err
- }
-
- err = autorest.Respond(
- resp,
- WithErrorUnlessStatusCode(http.StatusOK),
- autorest.ByUnmarshallingJSON(&provider),
- autorest.ByClosing(),
- )
- if err != nil {
- return err
- }
-
- if provider.RegistrationState != nil &&
- *provider.RegistrationState == "Registered" {
- break
- }
-
- delayed := autorest.DelayWithRetryAfter(resp, originalReq.Context().Done())
- if !delayed && !autorest.DelayForBackoff(client.PollingDelay, 0, originalReq.Context().Done()) {
- return originalReq.Context().Err()
- }
- }
- if client.PollingDuration != 0 && !(time.Since(registrationStartTime) < client.PollingDuration) {
- return errors.New("polling for resource provider registration has exceeded the polling duration")
- }
- return err
-}
-
-func getSubscription(path string) string {
- parts := strings.Split(path, "/")
- for i, v := range parts {
- if v == "subscriptions" && (i+1) < len(parts) {
- return parts[i+1]
- }
- }
- return ""
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/client.go b/vendor/github.com/Azure/go-autorest/autorest/client.go
deleted file mode 100644
index bb5f9396e..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/client.go
+++ /dev/null
@@ -1,328 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "bytes"
- "crypto/tls"
- "errors"
- "fmt"
- "io"
- "io/ioutil"
- "log"
- "net/http"
- "strings"
- "time"
-
- "github.com/Azure/go-autorest/logger"
-)
-
-const (
- // DefaultPollingDelay is a reasonable delay between polling requests.
- DefaultPollingDelay = 30 * time.Second
-
- // DefaultPollingDuration is a reasonable total polling duration.
- DefaultPollingDuration = 15 * time.Minute
-
- // DefaultRetryAttempts is number of attempts for retry status codes (5xx).
- DefaultRetryAttempts = 3
-
- // DefaultRetryDuration is the duration to wait between retries.
- DefaultRetryDuration = 30 * time.Second
-)
-
-var (
- // StatusCodesForRetry are a defined group of status code for which the client will retry
- StatusCodesForRetry = []int{
- http.StatusRequestTimeout, // 408
- http.StatusTooManyRequests, // 429
- http.StatusInternalServerError, // 500
- http.StatusBadGateway, // 502
- http.StatusServiceUnavailable, // 503
- http.StatusGatewayTimeout, // 504
- }
-)
-
-const (
- requestFormat = `HTTP Request Begin ===================================================
-%s
-===================================================== HTTP Request End
-`
- responseFormat = `HTTP Response Begin ===================================================
-%s
-===================================================== HTTP Response End
-`
-)
-
-// Response serves as the base for all responses from generated clients. It provides access to the
-// last http.Response.
-type Response struct {
- *http.Response `json:"-"`
-}
-
-// IsHTTPStatus returns true if the returned HTTP status code matches the provided status code.
-// If there was no response (i.e. the underlying http.Response is nil) the return value is false.
-func (r Response) IsHTTPStatus(statusCode int) bool {
- if r.Response == nil {
- return false
- }
- return r.Response.StatusCode == statusCode
-}
-
-// HasHTTPStatus returns true if the returned HTTP status code matches one of the provided status codes.
-// If there was no response (i.e. the underlying http.Response is nil) or not status codes are provided
-// the return value is false.
-func (r Response) HasHTTPStatus(statusCodes ...int) bool {
- return ResponseHasStatusCode(r.Response, statusCodes...)
-}
-
-// LoggingInspector implements request and response inspectors that log the full request and
-// response to a supplied log.
-type LoggingInspector struct {
- Logger *log.Logger
-}
-
-// WithInspection returns a PrepareDecorator that emits the http.Request to the supplied logger. The
-// body is restored after being emitted.
-//
-// Note: Since it reads the entire Body, this decorator should not be used where body streaming is
-// important. It is best used to trace JSON or similar body values.
-func (li LoggingInspector) WithInspection() PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- var body, b bytes.Buffer
-
- defer r.Body.Close()
-
- r.Body = ioutil.NopCloser(io.TeeReader(r.Body, &body))
- if err := r.Write(&b); err != nil {
- return nil, fmt.Errorf("Failed to write response: %v", err)
- }
-
- li.Logger.Printf(requestFormat, b.String())
-
- r.Body = ioutil.NopCloser(&body)
- return p.Prepare(r)
- })
- }
-}
-
-// ByInspecting returns a RespondDecorator that emits the http.Response to the supplied logger. The
-// body is restored after being emitted.
-//
-// Note: Since it reads the entire Body, this decorator should not be used where body streaming is
-// important. It is best used to trace JSON or similar body values.
-func (li LoggingInspector) ByInspecting() RespondDecorator {
- return func(r Responder) Responder {
- return ResponderFunc(func(resp *http.Response) error {
- var body, b bytes.Buffer
- defer resp.Body.Close()
- resp.Body = ioutil.NopCloser(io.TeeReader(resp.Body, &body))
- if err := resp.Write(&b); err != nil {
- return fmt.Errorf("Failed to write response: %v", err)
- }
-
- li.Logger.Printf(responseFormat, b.String())
-
- resp.Body = ioutil.NopCloser(&body)
- return r.Respond(resp)
- })
- }
-}
-
-// Client is the base for autorest generated clients. It provides default, "do nothing"
-// implementations of an Authorizer, RequestInspector, and ResponseInspector. It also returns the
-// standard, undecorated http.Client as a default Sender.
-//
-// Generated clients should also use Error (see NewError and NewErrorWithError) for errors and
-// return responses that compose with Response.
-//
-// Most customization of generated clients is best achieved by supplying a custom Authorizer, custom
-// RequestInspector, and / or custom ResponseInspector. Users may log requests, implement circuit
-// breakers (see https://msdn.microsoft.com/en-us/library/dn589784.aspx) or otherwise influence
-// sending the request by providing a decorated Sender.
-type Client struct {
- Authorizer Authorizer
- Sender Sender
- RequestInspector PrepareDecorator
- ResponseInspector RespondDecorator
-
- // PollingDelay sets the polling frequency used in absence of a Retry-After HTTP header
- PollingDelay time.Duration
-
- // PollingDuration sets the maximum polling time after which an error is returned.
- // Setting this to zero will use the provided context to control the duration.
- PollingDuration time.Duration
-
- // RetryAttempts sets the total number of times the client will attempt to make an HTTP request.
- // Set the value to 1 to disable retries. DO NOT set the value to less than 1.
- RetryAttempts int
-
- // RetryDuration sets the delay duration for retries.
- RetryDuration time.Duration
-
- // UserAgent, if not empty, will be set as the HTTP User-Agent header on all requests sent
- // through the Do method.
- UserAgent string
-
- Jar http.CookieJar
-
- // Set to true to skip attempted registration of resource providers (false by default).
- SkipResourceProviderRegistration bool
-
- // SendDecorators can be used to override the default chain of SendDecorators.
- // This can be used to specify things like a custom retry SendDecorator.
- // Set this to an empty slice to use no SendDecorators.
- SendDecorators []SendDecorator
-}
-
-// NewClientWithUserAgent returns an instance of a Client with the UserAgent set to the passed
-// string.
-func NewClientWithUserAgent(ua string) Client {
- return newClient(ua, tls.RenegotiateNever)
-}
-
-// ClientOptions contains various Client configuration options.
-type ClientOptions struct {
- // UserAgent is an optional user-agent string to append to the default user agent.
- UserAgent string
-
- // Renegotiation is an optional setting to control client-side TLS renegotiation.
- Renegotiation tls.RenegotiationSupport
-}
-
-// NewClientWithOptions returns an instance of a Client with the specified values.
-func NewClientWithOptions(options ClientOptions) Client {
- return newClient(options.UserAgent, options.Renegotiation)
-}
-
-func newClient(ua string, renegotiation tls.RenegotiationSupport) Client {
- c := Client{
- PollingDelay: DefaultPollingDelay,
- PollingDuration: DefaultPollingDuration,
- RetryAttempts: DefaultRetryAttempts,
- RetryDuration: DefaultRetryDuration,
- UserAgent: UserAgent(),
- }
- c.Sender = c.sender(renegotiation)
- c.AddToUserAgent(ua)
- return c
-}
-
-// AddToUserAgent adds an extension to the current user agent
-func (c *Client) AddToUserAgent(extension string) error {
- if extension != "" {
- c.UserAgent = fmt.Sprintf("%s %s", c.UserAgent, extension)
- return nil
- }
- return fmt.Errorf("Extension was empty, User Agent stayed as %s", c.UserAgent)
-}
-
-// Do implements the Sender interface by invoking the active Sender after applying authorization.
-// If Sender is not set, it uses a new instance of http.Client. In both cases it will, if UserAgent
-// is set, apply set the User-Agent header.
-func (c Client) Do(r *http.Request) (*http.Response, error) {
- if r.UserAgent() == "" {
- r, _ = Prepare(r,
- WithUserAgent(c.UserAgent))
- }
- // NOTE: c.WithInspection() must be last in the list so that it can inspect all preceding operations
- r, err := Prepare(r,
- c.WithAuthorization(),
- c.WithInspection())
- if err != nil {
- var resp *http.Response
- if detErr, ok := err.(DetailedError); ok {
- // if the authorization failed (e.g. invalid credentials) there will
- // be a response associated with the error, be sure to return it.
- resp = detErr.Response
- }
- return resp, NewErrorWithError(err, "autorest/Client", "Do", nil, "Preparing request failed")
- }
- logger.Instance.WriteRequest(r, logger.Filter{
- Header: func(k string, v []string) (bool, []string) {
- // remove the auth token from the log
- if strings.EqualFold(k, "Authorization") || strings.EqualFold(k, "Ocp-Apim-Subscription-Key") {
- v = []string{"**REDACTED**"}
- }
- return true, v
- },
- })
- resp, err := SendWithSender(c.sender(tls.RenegotiateNever), r)
- if resp == nil && err == nil {
- err = errors.New("autorest: received nil response and error")
- }
- logger.Instance.WriteResponse(resp, logger.Filter{})
- Respond(resp, c.ByInspecting())
- return resp, err
-}
-
-// sender returns the Sender to which to send requests.
-func (c Client) sender(renengotiation tls.RenegotiationSupport) Sender {
- if c.Sender == nil {
- return sender(renengotiation)
- }
- return c.Sender
-}
-
-// WithAuthorization is a convenience method that returns the WithAuthorization PrepareDecorator
-// from the current Authorizer. If not Authorizer is set, it uses the NullAuthorizer.
-func (c Client) WithAuthorization() PrepareDecorator {
- return c.authorizer().WithAuthorization()
-}
-
-// authorizer returns the Authorizer to use.
-func (c Client) authorizer() Authorizer {
- if c.Authorizer == nil {
- return NullAuthorizer{}
- }
- return c.Authorizer
-}
-
-// WithInspection is a convenience method that passes the request to the supplied RequestInspector,
-// if present, or returns the WithNothing PrepareDecorator otherwise.
-func (c Client) WithInspection() PrepareDecorator {
- if c.RequestInspector == nil {
- return WithNothing()
- }
- return c.RequestInspector
-}
-
-// ByInspecting is a convenience method that passes the response to the supplied ResponseInspector,
-// if present, or returns the ByIgnoring RespondDecorator otherwise.
-func (c Client) ByInspecting() RespondDecorator {
- if c.ResponseInspector == nil {
- return ByIgnoring()
- }
- return c.ResponseInspector
-}
-
-// Send sends the provided http.Request using the client's Sender or the default sender.
-// It returns the http.Response and possible error. It also accepts a, possibly empty,
-// default set of SendDecorators used when sending the request.
-// SendDecorators have the following precedence:
-// 1. In a request's context via WithSendDecorators()
-// 2. Specified on the client in SendDecorators
-// 3. The default values specified in this method
-func (c Client) Send(req *http.Request, decorators ...SendDecorator) (*http.Response, error) {
- if c.SendDecorators != nil {
- decorators = c.SendDecorators
- }
- inCtx := req.Context().Value(ctxSendDecorators{})
- if sd, ok := inCtx.([]SendDecorator); ok {
- decorators = sd
- }
- return SendWithSender(c, req, decorators...)
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/LICENSE b/vendor/github.com/Azure/go-autorest/autorest/date/LICENSE
deleted file mode 100644
index b9d6a27ea..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/date/LICENSE
+++ /dev/null
@@ -1,191 +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
-
- Copyright 2015 Microsoft Corporation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT 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/Azure/go-autorest/autorest/date/date.go b/vendor/github.com/Azure/go-autorest/autorest/date/date.go
deleted file mode 100644
index c45710656..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/date/date.go
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-Package date provides time.Time derivatives that conform to the Swagger.io (https://swagger.io/)
-defined date formats: Date and DateTime. Both types may, in most cases, be used in lieu of
-time.Time types. And both convert to time.Time through a ToTime method.
-*/
-package date
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "fmt"
- "time"
-)
-
-const (
- fullDate = "2006-01-02"
- fullDateJSON = `"2006-01-02"`
- dateFormat = "%04d-%02d-%02d"
- jsonFormat = `"%04d-%02d-%02d"`
-)
-
-// Date defines a type similar to time.Time but assumes a layout of RFC3339 full-date (i.e.,
-// 2006-01-02).
-type Date struct {
- time.Time
-}
-
-// ParseDate create a new Date from the passed string.
-func ParseDate(date string) (d Date, err error) {
- return parseDate(date, fullDate)
-}
-
-func parseDate(date string, format string) (Date, error) {
- d, err := time.Parse(format, date)
- return Date{Time: d}, err
-}
-
-// MarshalBinary preserves the Date as a byte array conforming to RFC3339 full-date (i.e.,
-// 2006-01-02).
-func (d Date) MarshalBinary() ([]byte, error) {
- return d.MarshalText()
-}
-
-// UnmarshalBinary reconstitutes a Date saved as a byte array conforming to RFC3339 full-date (i.e.,
-// 2006-01-02).
-func (d *Date) UnmarshalBinary(data []byte) error {
- return d.UnmarshalText(data)
-}
-
-// MarshalJSON preserves the Date as a JSON string conforming to RFC3339 full-date (i.e.,
-// 2006-01-02).
-func (d Date) MarshalJSON() (json []byte, err error) {
- return []byte(fmt.Sprintf(jsonFormat, d.Year(), d.Month(), d.Day())), nil
-}
-
-// UnmarshalJSON reconstitutes the Date from a JSON string conforming to RFC3339 full-date (i.e.,
-// 2006-01-02).
-func (d *Date) UnmarshalJSON(data []byte) (err error) {
- d.Time, err = time.Parse(fullDateJSON, string(data))
- return err
-}
-
-// MarshalText preserves the Date as a byte array conforming to RFC3339 full-date (i.e.,
-// 2006-01-02).
-func (d Date) MarshalText() (text []byte, err error) {
- return []byte(fmt.Sprintf(dateFormat, d.Year(), d.Month(), d.Day())), nil
-}
-
-// UnmarshalText reconstitutes a Date saved as a byte array conforming to RFC3339 full-date (i.e.,
-// 2006-01-02).
-func (d *Date) UnmarshalText(data []byte) (err error) {
- d.Time, err = time.Parse(fullDate, string(data))
- return err
-}
-
-// String returns the Date formatted as an RFC3339 full-date string (i.e., 2006-01-02).
-func (d Date) String() string {
- return fmt.Sprintf(dateFormat, d.Year(), d.Month(), d.Day())
-}
-
-// ToTime returns a Date as a time.Time
-func (d Date) ToTime() time.Time {
- return d.Time
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/autorest/date/go_mod_tidy_hack.go
deleted file mode 100644
index 4e0543207..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/date/go_mod_tidy_hack.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// +build modhack
-
-package date
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 file, and the github.com/Azure/go-autorest import, won't actually become part of
-// the resultant binary.
-
-// Necessary for safely adding multi-module repo.
-// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository
-import _ "github.com/Azure/go-autorest"
diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/time.go b/vendor/github.com/Azure/go-autorest/autorest/date/time.go
deleted file mode 100644
index b453fad04..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/date/time.go
+++ /dev/null
@@ -1,103 +0,0 @@
-package date
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "regexp"
- "time"
-)
-
-// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases.
-const (
- azureUtcFormatJSON = `"2006-01-02T15:04:05.999999999"`
- azureUtcFormat = "2006-01-02T15:04:05.999999999"
- rfc3339JSON = `"` + time.RFC3339Nano + `"`
- rfc3339 = time.RFC3339Nano
- tzOffsetRegex = `(Z|z|\+|-)(\d+:\d+)*"*$`
-)
-
-// Time defines a type similar to time.Time but assumes a layout of RFC3339 date-time (i.e.,
-// 2006-01-02T15:04:05Z).
-type Time struct {
- time.Time
-}
-
-// MarshalBinary preserves the Time as a byte array conforming to RFC3339 date-time (i.e.,
-// 2006-01-02T15:04:05Z).
-func (t Time) MarshalBinary() ([]byte, error) {
- return t.Time.MarshalText()
-}
-
-// UnmarshalBinary reconstitutes a Time saved as a byte array conforming to RFC3339 date-time
-// (i.e., 2006-01-02T15:04:05Z).
-func (t *Time) UnmarshalBinary(data []byte) error {
- return t.UnmarshalText(data)
-}
-
-// MarshalJSON preserves the Time as a JSON string conforming to RFC3339 date-time (i.e.,
-// 2006-01-02T15:04:05Z).
-func (t Time) MarshalJSON() (json []byte, err error) {
- return t.Time.MarshalJSON()
-}
-
-// UnmarshalJSON reconstitutes the Time from a JSON string conforming to RFC3339 date-time
-// (i.e., 2006-01-02T15:04:05Z).
-func (t *Time) UnmarshalJSON(data []byte) (err error) {
- timeFormat := azureUtcFormatJSON
- match, err := regexp.Match(tzOffsetRegex, data)
- if err != nil {
- return err
- } else if match {
- timeFormat = rfc3339JSON
- }
- t.Time, err = ParseTime(timeFormat, string(data))
- return err
-}
-
-// MarshalText preserves the Time as a byte array conforming to RFC3339 date-time (i.e.,
-// 2006-01-02T15:04:05Z).
-func (t Time) MarshalText() (text []byte, err error) {
- return t.Time.MarshalText()
-}
-
-// UnmarshalText reconstitutes a Time saved as a byte array conforming to RFC3339 date-time
-// (i.e., 2006-01-02T15:04:05Z).
-func (t *Time) UnmarshalText(data []byte) (err error) {
- timeFormat := azureUtcFormat
- match, err := regexp.Match(tzOffsetRegex, data)
- if err != nil {
- return err
- } else if match {
- timeFormat = rfc3339
- }
- t.Time, err = ParseTime(timeFormat, string(data))
- return err
-}
-
-// String returns the Time formatted as an RFC3339 date-time string (i.e.,
-// 2006-01-02T15:04:05Z).
-func (t Time) String() string {
- // Note: time.Time.String does not return an RFC3339 compliant string, time.Time.MarshalText does.
- b, err := t.MarshalText()
- if err != nil {
- return ""
- }
- return string(b)
-}
-
-// ToTime returns a Time as a time.Time
-func (t Time) ToTime() time.Time {
- return t.Time
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go b/vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go
deleted file mode 100644
index 48fb39ba9..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go
+++ /dev/null
@@ -1,100 +0,0 @@
-package date
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "errors"
- "time"
-)
-
-const (
- rfc1123JSON = `"` + time.RFC1123 + `"`
- rfc1123 = time.RFC1123
-)
-
-// TimeRFC1123 defines a type similar to time.Time but assumes a layout of RFC1123 date-time (i.e.,
-// Mon, 02 Jan 2006 15:04:05 MST).
-type TimeRFC1123 struct {
- time.Time
-}
-
-// UnmarshalJSON reconstitutes the Time from a JSON string conforming to RFC1123 date-time
-// (i.e., Mon, 02 Jan 2006 15:04:05 MST).
-func (t *TimeRFC1123) UnmarshalJSON(data []byte) (err error) {
- t.Time, err = ParseTime(rfc1123JSON, string(data))
- if err != nil {
- return err
- }
- return nil
-}
-
-// MarshalJSON preserves the Time as a JSON string conforming to RFC1123 date-time (i.e.,
-// Mon, 02 Jan 2006 15:04:05 MST).
-func (t TimeRFC1123) MarshalJSON() ([]byte, error) {
- if y := t.Year(); y < 0 || y >= 10000 {
- return nil, errors.New("Time.MarshalJSON: year outside of range [0,9999]")
- }
- b := []byte(t.Format(rfc1123JSON))
- return b, nil
-}
-
-// MarshalText preserves the Time as a byte array conforming to RFC1123 date-time (i.e.,
-// Mon, 02 Jan 2006 15:04:05 MST).
-func (t TimeRFC1123) MarshalText() ([]byte, error) {
- if y := t.Year(); y < 0 || y >= 10000 {
- return nil, errors.New("Time.MarshalText: year outside of range [0,9999]")
- }
-
- b := []byte(t.Format(rfc1123))
- return b, nil
-}
-
-// UnmarshalText reconstitutes a Time saved as a byte array conforming to RFC1123 date-time
-// (i.e., Mon, 02 Jan 2006 15:04:05 MST).
-func (t *TimeRFC1123) UnmarshalText(data []byte) (err error) {
- t.Time, err = ParseTime(rfc1123, string(data))
- if err != nil {
- return err
- }
- return nil
-}
-
-// MarshalBinary preserves the Time as a byte array conforming to RFC1123 date-time (i.e.,
-// Mon, 02 Jan 2006 15:04:05 MST).
-func (t TimeRFC1123) MarshalBinary() ([]byte, error) {
- return t.MarshalText()
-}
-
-// UnmarshalBinary reconstitutes a Time saved as a byte array conforming to RFC1123 date-time
-// (i.e., Mon, 02 Jan 2006 15:04:05 MST).
-func (t *TimeRFC1123) UnmarshalBinary(data []byte) error {
- return t.UnmarshalText(data)
-}
-
-// ToTime returns a Time as a time.Time
-func (t TimeRFC1123) ToTime() time.Time {
- return t.Time
-}
-
-// String returns the Time formatted as an RFC1123 date-time string (i.e.,
-// Mon, 02 Jan 2006 15:04:05 MST).
-func (t TimeRFC1123) String() string {
- // Note: time.Time.String does not return an RFC1123 compliant string, time.Time.MarshalText does.
- b, err := t.MarshalText()
- if err != nil {
- return ""
- }
- return string(b)
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go b/vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go
deleted file mode 100644
index 7073959b2..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go
+++ /dev/null
@@ -1,123 +0,0 @@
-package date
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "bytes"
- "encoding/binary"
- "encoding/json"
- "time"
-)
-
-// unixEpoch is the moment in time that should be treated as timestamp 0.
-var unixEpoch = time.Date(1970, time.January, 1, 0, 0, 0, 0, time.UTC)
-
-// UnixTime marshals and unmarshals a time that is represented as the number
-// of seconds (ignoring skip-seconds) since the Unix Epoch.
-type UnixTime time.Time
-
-// Duration returns the time as a Duration since the UnixEpoch.
-func (t UnixTime) Duration() time.Duration {
- return time.Time(t).Sub(unixEpoch)
-}
-
-// NewUnixTimeFromSeconds creates a UnixTime as a number of seconds from the UnixEpoch.
-func NewUnixTimeFromSeconds(seconds float64) UnixTime {
- return NewUnixTimeFromDuration(time.Duration(seconds * float64(time.Second)))
-}
-
-// NewUnixTimeFromNanoseconds creates a UnixTime as a number of nanoseconds from the UnixEpoch.
-func NewUnixTimeFromNanoseconds(nanoseconds int64) UnixTime {
- return NewUnixTimeFromDuration(time.Duration(nanoseconds))
-}
-
-// NewUnixTimeFromDuration creates a UnixTime as a duration of time since the UnixEpoch.
-func NewUnixTimeFromDuration(dur time.Duration) UnixTime {
- return UnixTime(unixEpoch.Add(dur))
-}
-
-// UnixEpoch retreives the moment considered the Unix Epoch. I.e. The time represented by '0'
-func UnixEpoch() time.Time {
- return unixEpoch
-}
-
-// MarshalJSON preserves the UnixTime as a JSON number conforming to Unix Timestamp requirements.
-// (i.e. the number of seconds since midnight January 1st, 1970 not considering leap seconds.)
-func (t UnixTime) MarshalJSON() ([]byte, error) {
- buffer := &bytes.Buffer{}
- enc := json.NewEncoder(buffer)
- err := enc.Encode(float64(time.Time(t).UnixNano()) / 1e9)
- if err != nil {
- return nil, err
- }
- return buffer.Bytes(), nil
-}
-
-// UnmarshalJSON reconstitures a UnixTime saved as a JSON number of the number of seconds since
-// midnight January 1st, 1970.
-func (t *UnixTime) UnmarshalJSON(text []byte) error {
- dec := json.NewDecoder(bytes.NewReader(text))
-
- var secondsSinceEpoch float64
- if err := dec.Decode(&secondsSinceEpoch); err != nil {
- return err
- }
-
- *t = NewUnixTimeFromSeconds(secondsSinceEpoch)
-
- return nil
-}
-
-// MarshalText stores the number of seconds since the Unix Epoch as a textual floating point number.
-func (t UnixTime) MarshalText() ([]byte, error) {
- cast := time.Time(t)
- return cast.MarshalText()
-}
-
-// UnmarshalText populates a UnixTime with a value stored textually as a floating point number of seconds since the Unix Epoch.
-func (t *UnixTime) UnmarshalText(raw []byte) error {
- var unmarshaled time.Time
-
- if err := unmarshaled.UnmarshalText(raw); err != nil {
- return err
- }
-
- *t = UnixTime(unmarshaled)
- return nil
-}
-
-// MarshalBinary converts a UnixTime into a binary.LittleEndian float64 of nanoseconds since the epoch.
-func (t UnixTime) MarshalBinary() ([]byte, error) {
- buf := &bytes.Buffer{}
-
- payload := int64(t.Duration())
-
- if err := binary.Write(buf, binary.LittleEndian, &payload); err != nil {
- return nil, err
- }
-
- return buf.Bytes(), nil
-}
-
-// UnmarshalBinary converts a from a binary.LittleEndian float64 of nanoseconds since the epoch into a UnixTime.
-func (t *UnixTime) UnmarshalBinary(raw []byte) error {
- var nanosecondsSinceEpoch int64
-
- if err := binary.Read(bytes.NewReader(raw), binary.LittleEndian, &nanosecondsSinceEpoch); err != nil {
- return err
- }
- *t = NewUnixTimeFromNanoseconds(nanosecondsSinceEpoch)
- return nil
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/utility.go b/vendor/github.com/Azure/go-autorest/autorest/date/utility.go
deleted file mode 100644
index 12addf0eb..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/date/utility.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package date
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "strings"
- "time"
-)
-
-// ParseTime to parse Time string to specified format.
-func ParseTime(format string, t string) (d time.Time, err error) {
- return time.Parse(format, strings.ToUpper(t))
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/error.go b/vendor/github.com/Azure/go-autorest/autorest/error.go
deleted file mode 100644
index 35098eda8..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/error.go
+++ /dev/null
@@ -1,103 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "fmt"
- "net/http"
-)
-
-const (
- // UndefinedStatusCode is used when HTTP status code is not available for an error.
- UndefinedStatusCode = 0
-)
-
-// DetailedError encloses a error with details of the package, method, and associated HTTP
-// status code (if any).
-type DetailedError struct {
- Original error
-
- // PackageType is the package type of the object emitting the error. For types, the value
- // matches that produced the the '%T' format specifier of the fmt package. For other elements,
- // such as functions, it is just the package name (e.g., "autorest").
- PackageType string
-
- // Method is the name of the method raising the error.
- Method string
-
- // StatusCode is the HTTP Response StatusCode (if non-zero) that led to the error.
- StatusCode interface{}
-
- // Message is the error message.
- Message string
-
- // Service Error is the response body of failed API in bytes
- ServiceError []byte
-
- // Response is the response object that was returned during failure if applicable.
- Response *http.Response
-}
-
-// NewError creates a new Error conforming object from the passed packageType, method, and
-// message. message is treated as a format string to which the optional args apply.
-func NewError(packageType string, method string, message string, args ...interface{}) DetailedError {
- return NewErrorWithError(nil, packageType, method, nil, message, args...)
-}
-
-// NewErrorWithResponse creates a new Error conforming object from the passed
-// packageType, method, statusCode of the given resp (UndefinedStatusCode if
-// resp is nil), and message. message is treated as a format string to which the
-// optional args apply.
-func NewErrorWithResponse(packageType string, method string, resp *http.Response, message string, args ...interface{}) DetailedError {
- return NewErrorWithError(nil, packageType, method, resp, message, args...)
-}
-
-// NewErrorWithError creates a new Error conforming object from the
-// passed packageType, method, statusCode of the given resp (UndefinedStatusCode
-// if resp is nil), message, and original error. message is treated as a format
-// string to which the optional args apply.
-func NewErrorWithError(original error, packageType string, method string, resp *http.Response, message string, args ...interface{}) DetailedError {
- if v, ok := original.(DetailedError); ok {
- return v
- }
-
- statusCode := UndefinedStatusCode
- if resp != nil {
- statusCode = resp.StatusCode
- }
-
- return DetailedError{
- Original: original,
- PackageType: packageType,
- Method: method,
- StatusCode: statusCode,
- Message: fmt.Sprintf(message, args...),
- Response: resp,
- }
-}
-
-// Error returns a formatted containing all available details (i.e., PackageType, Method,
-// StatusCode, Message, and original error (if any)).
-func (e DetailedError) Error() string {
- if e.Original == nil {
- return fmt.Sprintf("%s#%s: %s: StatusCode=%d", e.PackageType, e.Method, e.Message, e.StatusCode)
- }
- return fmt.Sprintf("%s#%s: %s: StatusCode=%d -- Original Error: %v", e.PackageType, e.Method, e.Message, e.StatusCode, e.Original)
-}
-
-// Unwrap returns the original error.
-func (e DetailedError) Unwrap() error {
- return e.Original
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/autorest/go_mod_tidy_hack.go
deleted file mode 100644
index 792f82d4b..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/go_mod_tidy_hack.go
+++ /dev/null
@@ -1,25 +0,0 @@
-//go:build modhack
-// +build modhack
-
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 file, and the github.com/Azure/go-autorest import, won't actually become part of
-// the resultant binary.
-
-// Necessary for safely adding multi-module repo.
-// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository
-import _ "github.com/Azure/go-autorest"
diff --git a/vendor/github.com/Azure/go-autorest/autorest/preparer.go b/vendor/github.com/Azure/go-autorest/autorest/preparer.go
deleted file mode 100644
index 121a66fa8..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/preparer.go
+++ /dev/null
@@ -1,549 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "bytes"
- "context"
- "encoding/json"
- "encoding/xml"
- "fmt"
- "io"
- "io/ioutil"
- "mime/multipart"
- "net/http"
- "net/url"
- "strings"
-)
-
-const (
- mimeTypeJSON = "application/json"
- mimeTypeOctetStream = "application/octet-stream"
- mimeTypeFormPost = "application/x-www-form-urlencoded"
-
- headerAuthorization = "Authorization"
- headerAuxAuthorization = "x-ms-authorization-auxiliary"
- headerContentType = "Content-Type"
- headerUserAgent = "User-Agent"
-)
-
-// used as a key type in context.WithValue()
-type ctxPrepareDecorators struct{}
-
-// WithPrepareDecorators adds the specified PrepareDecorators to the provided context.
-// If no PrepareDecorators are provided the context is unchanged.
-func WithPrepareDecorators(ctx context.Context, prepareDecorator []PrepareDecorator) context.Context {
- if len(prepareDecorator) == 0 {
- return ctx
- }
- return context.WithValue(ctx, ctxPrepareDecorators{}, prepareDecorator)
-}
-
-// GetPrepareDecorators returns the PrepareDecorators in the provided context or the provided default PrepareDecorators.
-func GetPrepareDecorators(ctx context.Context, defaultPrepareDecorators ...PrepareDecorator) []PrepareDecorator {
- inCtx := ctx.Value(ctxPrepareDecorators{})
- if pd, ok := inCtx.([]PrepareDecorator); ok {
- return pd
- }
- return defaultPrepareDecorators
-}
-
-// Preparer is the interface that wraps the Prepare method.
-//
-// Prepare accepts and possibly modifies an http.Request (e.g., adding Headers). Implementations
-// must ensure to not share or hold per-invocation state since Preparers may be shared and re-used.
-type Preparer interface {
- Prepare(*http.Request) (*http.Request, error)
-}
-
-// PreparerFunc is a method that implements the Preparer interface.
-type PreparerFunc func(*http.Request) (*http.Request, error)
-
-// Prepare implements the Preparer interface on PreparerFunc.
-func (pf PreparerFunc) Prepare(r *http.Request) (*http.Request, error) {
- return pf(r)
-}
-
-// PrepareDecorator takes and possibly decorates, by wrapping, a Preparer. Decorators may affect the
-// http.Request and pass it along or, first, pass the http.Request along then affect the result.
-type PrepareDecorator func(Preparer) Preparer
-
-// CreatePreparer creates, decorates, and returns a Preparer.
-// Without decorators, the returned Preparer returns the passed http.Request unmodified.
-// Preparers are safe to share and re-use.
-func CreatePreparer(decorators ...PrepareDecorator) Preparer {
- return DecoratePreparer(
- Preparer(PreparerFunc(func(r *http.Request) (*http.Request, error) { return r, nil })),
- decorators...)
-}
-
-// DecoratePreparer accepts a Preparer and a, possibly empty, set of PrepareDecorators, which it
-// applies to the Preparer. Decorators are applied in the order received, but their affect upon the
-// request depends on whether they are a pre-decorator (change the http.Request and then pass it
-// along) or a post-decorator (pass the http.Request along and alter it on return).
-func DecoratePreparer(p Preparer, decorators ...PrepareDecorator) Preparer {
- for _, decorate := range decorators {
- p = decorate(p)
- }
- return p
-}
-
-// Prepare accepts an http.Request and a, possibly empty, set of PrepareDecorators.
-// It creates a Preparer from the decorators which it then applies to the passed http.Request.
-func Prepare(r *http.Request, decorators ...PrepareDecorator) (*http.Request, error) {
- if r == nil {
- return nil, NewError("autorest", "Prepare", "Invoked without an http.Request")
- }
- return CreatePreparer(decorators...).Prepare(r)
-}
-
-// WithNothing returns a "do nothing" PrepareDecorator that makes no changes to the passed
-// http.Request.
-func WithNothing() PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- return p.Prepare(r)
- })
- }
-}
-
-// WithHeader returns a PrepareDecorator that sets the specified HTTP header of the http.Request to
-// the passed value. It canonicalizes the passed header name (via http.CanonicalHeaderKey) before
-// adding the header.
-func WithHeader(header string, value string) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- setHeader(r, http.CanonicalHeaderKey(header), value)
- }
- return r, err
- })
- }
-}
-
-// WithHeaders returns a PrepareDecorator that sets the specified HTTP headers of the http.Request to
-// the passed value. It canonicalizes the passed headers name (via http.CanonicalHeaderKey) before
-// adding them.
-func WithHeaders(headers map[string]interface{}) PrepareDecorator {
- h := ensureValueStrings(headers)
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- if r.Header == nil {
- r.Header = make(http.Header)
- }
-
- for name, value := range h {
- r.Header.Set(http.CanonicalHeaderKey(name), value)
- }
- }
- return r, err
- })
- }
-}
-
-// WithBearerAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose
-// value is "Bearer " followed by the supplied token.
-func WithBearerAuthorization(token string) PrepareDecorator {
- return WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", token))
-}
-
-// AsContentType returns a PrepareDecorator that adds an HTTP Content-Type header whose value
-// is the passed contentType.
-func AsContentType(contentType string) PrepareDecorator {
- return WithHeader(headerContentType, contentType)
-}
-
-// WithUserAgent returns a PrepareDecorator that adds an HTTP User-Agent header whose value is the
-// passed string.
-func WithUserAgent(ua string) PrepareDecorator {
- return WithHeader(headerUserAgent, ua)
-}
-
-// AsFormURLEncoded returns a PrepareDecorator that adds an HTTP Content-Type header whose value is
-// "application/x-www-form-urlencoded".
-func AsFormURLEncoded() PrepareDecorator {
- return AsContentType(mimeTypeFormPost)
-}
-
-// AsJSON returns a PrepareDecorator that adds an HTTP Content-Type header whose value is
-// "application/json".
-func AsJSON() PrepareDecorator {
- return AsContentType(mimeTypeJSON)
-}
-
-// AsOctetStream returns a PrepareDecorator that adds the "application/octet-stream" Content-Type header.
-func AsOctetStream() PrepareDecorator {
- return AsContentType(mimeTypeOctetStream)
-}
-
-// WithMethod returns a PrepareDecorator that sets the HTTP method of the passed request. The
-// decorator does not validate that the passed method string is a known HTTP method.
-func WithMethod(method string) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r.Method = method
- return p.Prepare(r)
- })
- }
-}
-
-// AsDelete returns a PrepareDecorator that sets the HTTP method to DELETE.
-func AsDelete() PrepareDecorator { return WithMethod("DELETE") }
-
-// AsGet returns a PrepareDecorator that sets the HTTP method to GET.
-func AsGet() PrepareDecorator { return WithMethod("GET") }
-
-// AsHead returns a PrepareDecorator that sets the HTTP method to HEAD.
-func AsHead() PrepareDecorator { return WithMethod("HEAD") }
-
-// AsMerge returns a PrepareDecorator that sets the HTTP method to MERGE.
-func AsMerge() PrepareDecorator { return WithMethod("MERGE") }
-
-// AsOptions returns a PrepareDecorator that sets the HTTP method to OPTIONS.
-func AsOptions() PrepareDecorator { return WithMethod("OPTIONS") }
-
-// AsPatch returns a PrepareDecorator that sets the HTTP method to PATCH.
-func AsPatch() PrepareDecorator { return WithMethod("PATCH") }
-
-// AsPost returns a PrepareDecorator that sets the HTTP method to POST.
-func AsPost() PrepareDecorator { return WithMethod("POST") }
-
-// AsPut returns a PrepareDecorator that sets the HTTP method to PUT.
-func AsPut() PrepareDecorator { return WithMethod("PUT") }
-
-// WithBaseURL returns a PrepareDecorator that populates the http.Request with a url.URL constructed
-// from the supplied baseUrl. Query parameters will be encoded as required.
-func WithBaseURL(baseURL string) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- var u *url.URL
- if u, err = url.Parse(baseURL); err != nil {
- return r, err
- }
- if u.Scheme == "" {
- return r, fmt.Errorf("autorest: No scheme detected in URL %s", baseURL)
- }
- if u.RawQuery != "" {
- // handle unencoded semicolons (ideally the server would send them already encoded)
- u.RawQuery = strings.Replace(u.RawQuery, ";", "%3B", -1)
- q, err := url.ParseQuery(u.RawQuery)
- if err != nil {
- return r, err
- }
- u.RawQuery = q.Encode()
- }
- r.URL = u
- }
- return r, err
- })
- }
-}
-
-// WithBytes returns a PrepareDecorator that takes a list of bytes
-// which passes the bytes directly to the body
-func WithBytes(input *[]byte) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- if input == nil {
- return r, fmt.Errorf("Input Bytes was nil")
- }
-
- r.ContentLength = int64(len(*input))
- r.Body = ioutil.NopCloser(bytes.NewReader(*input))
- }
- return r, err
- })
- }
-}
-
-// WithCustomBaseURL returns a PrepareDecorator that replaces brace-enclosed keys within the
-// request base URL (i.e., http.Request.URL) with the corresponding values from the passed map.
-func WithCustomBaseURL(baseURL string, urlParameters map[string]interface{}) PrepareDecorator {
- parameters := ensureValueStrings(urlParameters)
- for key, value := range parameters {
- baseURL = strings.Replace(baseURL, "{"+key+"}", value, -1)
- }
- return WithBaseURL(baseURL)
-}
-
-// WithFormData returns a PrepareDecoratore that "URL encodes" (e.g., bar=baz&foo=quux) into the
-// http.Request body.
-func WithFormData(v url.Values) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- s := v.Encode()
-
- setHeader(r, http.CanonicalHeaderKey(headerContentType), mimeTypeFormPost)
- r.ContentLength = int64(len(s))
- r.Body = ioutil.NopCloser(strings.NewReader(s))
- }
- return r, err
- })
- }
-}
-
-// WithMultiPartFormData returns a PrepareDecoratore that "URL encodes" (e.g., bar=baz&foo=quux) form parameters
-// into the http.Request body.
-func WithMultiPartFormData(formDataParameters map[string]interface{}) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- var body bytes.Buffer
- writer := multipart.NewWriter(&body)
- for key, value := range formDataParameters {
- if rc, ok := value.(io.ReadCloser); ok {
- var fd io.Writer
- if fd, err = writer.CreateFormFile(key, key); err != nil {
- return r, err
- }
- if _, err = io.Copy(fd, rc); err != nil {
- return r, err
- }
- } else {
- if err = writer.WriteField(key, ensureValueString(value)); err != nil {
- return r, err
- }
- }
- }
- if err = writer.Close(); err != nil {
- return r, err
- }
- setHeader(r, http.CanonicalHeaderKey(headerContentType), writer.FormDataContentType())
- r.Body = ioutil.NopCloser(bytes.NewReader(body.Bytes()))
- r.ContentLength = int64(body.Len())
- return r, err
- }
- return r, err
- })
- }
-}
-
-// WithFile returns a PrepareDecorator that sends file in request body.
-func WithFile(f io.ReadCloser) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- b, err := ioutil.ReadAll(f)
- if err != nil {
- return r, err
- }
- r.Body = ioutil.NopCloser(bytes.NewReader(b))
- r.ContentLength = int64(len(b))
- }
- return r, err
- })
- }
-}
-
-// WithBool returns a PrepareDecorator that encodes the passed bool into the body of the request
-// and sets the Content-Length header.
-func WithBool(v bool) PrepareDecorator {
- return WithString(fmt.Sprintf("%v", v))
-}
-
-// WithFloat32 returns a PrepareDecorator that encodes the passed float32 into the body of the
-// request and sets the Content-Length header.
-func WithFloat32(v float32) PrepareDecorator {
- return WithString(fmt.Sprintf("%v", v))
-}
-
-// WithFloat64 returns a PrepareDecorator that encodes the passed float64 into the body of the
-// request and sets the Content-Length header.
-func WithFloat64(v float64) PrepareDecorator {
- return WithString(fmt.Sprintf("%v", v))
-}
-
-// WithInt32 returns a PrepareDecorator that encodes the passed int32 into the body of the request
-// and sets the Content-Length header.
-func WithInt32(v int32) PrepareDecorator {
- return WithString(fmt.Sprintf("%v", v))
-}
-
-// WithInt64 returns a PrepareDecorator that encodes the passed int64 into the body of the request
-// and sets the Content-Length header.
-func WithInt64(v int64) PrepareDecorator {
- return WithString(fmt.Sprintf("%v", v))
-}
-
-// WithString returns a PrepareDecorator that encodes the passed string into the body of the request
-// and sets the Content-Length header.
-func WithString(v string) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- r.ContentLength = int64(len(v))
- r.Body = ioutil.NopCloser(strings.NewReader(v))
- }
- return r, err
- })
- }
-}
-
-// WithJSON returns a PrepareDecorator that encodes the data passed as JSON into the body of the
-// request and sets the Content-Length header.
-func WithJSON(v interface{}) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- b, err := json.Marshal(v)
- if err == nil {
- r.ContentLength = int64(len(b))
- r.Body = ioutil.NopCloser(bytes.NewReader(b))
- }
- }
- return r, err
- })
- }
-}
-
-// WithXML returns a PrepareDecorator that encodes the data passed as XML into the body of the
-// request and sets the Content-Length header.
-func WithXML(v interface{}) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- b, err := xml.Marshal(v)
- if err == nil {
- // we have to tack on an XML header
- withHeader := xml.Header + string(b)
- bytesWithHeader := []byte(withHeader)
-
- r.ContentLength = int64(len(bytesWithHeader))
- setHeader(r, headerContentLength, fmt.Sprintf("%d", len(bytesWithHeader)))
- r.Body = ioutil.NopCloser(bytes.NewReader(bytesWithHeader))
- }
- }
- return r, err
- })
- }
-}
-
-// WithPath returns a PrepareDecorator that adds the supplied path to the request URL. If the path
-// is absolute (that is, it begins with a "/"), it replaces the existing path.
-func WithPath(path string) PrepareDecorator {
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- if r.URL == nil {
- return r, NewError("autorest", "WithPath", "Invoked with a nil URL")
- }
- if r.URL, err = parseURL(r.URL, path); err != nil {
- return r, err
- }
- }
- return r, err
- })
- }
-}
-
-// WithEscapedPathParameters returns a PrepareDecorator that replaces brace-enclosed keys within the
-// request path (i.e., http.Request.URL.Path) with the corresponding values from the passed map. The
-// values will be escaped (aka URL encoded) before insertion into the path.
-func WithEscapedPathParameters(path string, pathParameters map[string]interface{}) PrepareDecorator {
- parameters := escapeValueStrings(ensureValueStrings(pathParameters))
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- if r.URL == nil {
- return r, NewError("autorest", "WithEscapedPathParameters", "Invoked with a nil URL")
- }
- for key, value := range parameters {
- path = strings.Replace(path, "{"+key+"}", value, -1)
- }
- if r.URL, err = parseURL(r.URL, path); err != nil {
- return r, err
- }
- }
- return r, err
- })
- }
-}
-
-// WithPathParameters returns a PrepareDecorator that replaces brace-enclosed keys within the
-// request path (i.e., http.Request.URL.Path) with the corresponding values from the passed map.
-func WithPathParameters(path string, pathParameters map[string]interface{}) PrepareDecorator {
- parameters := ensureValueStrings(pathParameters)
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- if r.URL == nil {
- return r, NewError("autorest", "WithPathParameters", "Invoked with a nil URL")
- }
- for key, value := range parameters {
- path = strings.Replace(path, "{"+key+"}", value, -1)
- }
-
- if r.URL, err = parseURL(r.URL, path); err != nil {
- return r, err
- }
- }
- return r, err
- })
- }
-}
-
-func parseURL(u *url.URL, path string) (*url.URL, error) {
- p := strings.TrimRight(u.String(), "/")
- if !strings.HasPrefix(path, "/") {
- path = "/" + path
- }
- return url.Parse(p + path)
-}
-
-// WithQueryParameters returns a PrepareDecorators that encodes and applies the query parameters
-// given in the supplied map (i.e., key=value).
-func WithQueryParameters(queryParameters map[string]interface{}) PrepareDecorator {
- parameters := MapToValues(queryParameters)
- return func(p Preparer) Preparer {
- return PreparerFunc(func(r *http.Request) (*http.Request, error) {
- r, err := p.Prepare(r)
- if err == nil {
- if r.URL == nil {
- return r, NewError("autorest", "WithQueryParameters", "Invoked with a nil URL")
- }
- v := r.URL.Query()
- for key, value := range parameters {
- for i := range value {
- d, err := url.QueryUnescape(value[i])
- if err != nil {
- return r, err
- }
- value[i] = d
- }
- v[key] = value
- }
- r.URL.RawQuery = v.Encode()
- }
- return r, err
- })
- }
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/responder.go b/vendor/github.com/Azure/go-autorest/autorest/responder.go
deleted file mode 100644
index 349e1963a..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/responder.go
+++ /dev/null
@@ -1,269 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "bytes"
- "encoding/json"
- "encoding/xml"
- "fmt"
- "io"
- "io/ioutil"
- "net/http"
- "strings"
-)
-
-// Responder is the interface that wraps the Respond method.
-//
-// Respond accepts and reacts to an http.Response. Implementations must ensure to not share or hold
-// state since Responders may be shared and re-used.
-type Responder interface {
- Respond(*http.Response) error
-}
-
-// ResponderFunc is a method that implements the Responder interface.
-type ResponderFunc func(*http.Response) error
-
-// Respond implements the Responder interface on ResponderFunc.
-func (rf ResponderFunc) Respond(r *http.Response) error {
- return rf(r)
-}
-
-// RespondDecorator takes and possibly decorates, by wrapping, a Responder. Decorators may react to
-// the http.Response and pass it along or, first, pass the http.Response along then react.
-type RespondDecorator func(Responder) Responder
-
-// CreateResponder creates, decorates, and returns a Responder. Without decorators, the returned
-// Responder returns the passed http.Response unmodified. Responders may or may not be safe to share
-// and re-used: It depends on the applied decorators. For example, a standard decorator that closes
-// the response body is fine to share whereas a decorator that reads the body into a passed struct
-// is not.
-//
-// To prevent memory leaks, ensure that at least one Responder closes the response body.
-func CreateResponder(decorators ...RespondDecorator) Responder {
- return DecorateResponder(
- Responder(ResponderFunc(func(r *http.Response) error { return nil })),
- decorators...)
-}
-
-// DecorateResponder accepts a Responder and a, possibly empty, set of RespondDecorators, which it
-// applies to the Responder. Decorators are applied in the order received, but their affect upon the
-// request depends on whether they are a pre-decorator (react to the http.Response and then pass it
-// along) or a post-decorator (pass the http.Response along and then react).
-func DecorateResponder(r Responder, decorators ...RespondDecorator) Responder {
- for _, decorate := range decorators {
- r = decorate(r)
- }
- return r
-}
-
-// Respond accepts an http.Response and a, possibly empty, set of RespondDecorators.
-// It creates a Responder from the decorators it then applies to the passed http.Response.
-func Respond(r *http.Response, decorators ...RespondDecorator) error {
- if r == nil {
- return nil
- }
- return CreateResponder(decorators...).Respond(r)
-}
-
-// ByIgnoring returns a RespondDecorator that ignores the passed http.Response passing it unexamined
-// to the next RespondDecorator.
-func ByIgnoring() RespondDecorator {
- return func(r Responder) Responder {
- return ResponderFunc(func(resp *http.Response) error {
- return r.Respond(resp)
- })
- }
-}
-
-// ByCopying copies the contents of the http.Response Body into the passed bytes.Buffer as
-// the Body is read.
-func ByCopying(b *bytes.Buffer) RespondDecorator {
- return func(r Responder) Responder {
- return ResponderFunc(func(resp *http.Response) error {
- err := r.Respond(resp)
- if err == nil && resp != nil && resp.Body != nil {
- resp.Body = TeeReadCloser(resp.Body, b)
- }
- return err
- })
- }
-}
-
-// ByDiscardingBody returns a RespondDecorator that first invokes the passed Responder after which
-// it copies the remaining bytes (if any) in the response body to ioutil.Discard. Since the passed
-// Responder is invoked prior to discarding the response body, the decorator may occur anywhere
-// within the set.
-func ByDiscardingBody() RespondDecorator {
- return func(r Responder) Responder {
- return ResponderFunc(func(resp *http.Response) error {
- err := r.Respond(resp)
- if err == nil && resp != nil && resp.Body != nil {
- if _, err := io.Copy(ioutil.Discard, resp.Body); err != nil {
- return fmt.Errorf("Error discarding the response body: %v", err)
- }
- }
- return err
- })
- }
-}
-
-// ByClosing returns a RespondDecorator that first invokes the passed Responder after which it
-// closes the response body. Since the passed Responder is invoked prior to closing the response
-// body, the decorator may occur anywhere within the set.
-func ByClosing() RespondDecorator {
- return func(r Responder) Responder {
- return ResponderFunc(func(resp *http.Response) error {
- err := r.Respond(resp)
- if resp != nil && resp.Body != nil {
- if err := resp.Body.Close(); err != nil {
- return fmt.Errorf("Error closing the response body: %v", err)
- }
- }
- return err
- })
- }
-}
-
-// ByClosingIfError returns a RespondDecorator that first invokes the passed Responder after which
-// it closes the response if the passed Responder returns an error and the response body exists.
-func ByClosingIfError() RespondDecorator {
- return func(r Responder) Responder {
- return ResponderFunc(func(resp *http.Response) error {
- err := r.Respond(resp)
- if err != nil && resp != nil && resp.Body != nil {
- if err := resp.Body.Close(); err != nil {
- return fmt.Errorf("Error closing the response body: %v", err)
- }
- }
- return err
- })
- }
-}
-
-// ByUnmarshallingBytes returns a RespondDecorator that copies the Bytes returned in the
-// response Body into the value pointed to by v.
-func ByUnmarshallingBytes(v *[]byte) RespondDecorator {
- return func(r Responder) Responder {
- return ResponderFunc(func(resp *http.Response) error {
- err := r.Respond(resp)
- if err == nil {
- bytes, errInner := ioutil.ReadAll(resp.Body)
- if errInner != nil {
- err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner)
- } else {
- *v = bytes
- }
- }
- return err
- })
- }
-}
-
-// ByUnmarshallingJSON returns a RespondDecorator that decodes a JSON document returned in the
-// response Body into the value pointed to by v.
-func ByUnmarshallingJSON(v interface{}) RespondDecorator {
- return func(r Responder) Responder {
- return ResponderFunc(func(resp *http.Response) error {
- err := r.Respond(resp)
- if err == nil {
- b, errInner := ioutil.ReadAll(resp.Body)
- // Some responses might include a BOM, remove for successful unmarshalling
- b = bytes.TrimPrefix(b, []byte("\xef\xbb\xbf"))
- if errInner != nil {
- err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner)
- } else if len(strings.Trim(string(b), " ")) > 0 {
- errInner = json.Unmarshal(b, v)
- if errInner != nil {
- err = fmt.Errorf("Error occurred unmarshalling JSON - Error = '%v' JSON = '%s'", errInner, string(b))
- }
- }
- }
- return err
- })
- }
-}
-
-// ByUnmarshallingXML returns a RespondDecorator that decodes a XML document returned in the
-// response Body into the value pointed to by v.
-func ByUnmarshallingXML(v interface{}) RespondDecorator {
- return func(r Responder) Responder {
- return ResponderFunc(func(resp *http.Response) error {
- err := r.Respond(resp)
- if err == nil {
- b, errInner := ioutil.ReadAll(resp.Body)
- if errInner != nil {
- err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner)
- } else {
- errInner = xml.Unmarshal(b, v)
- if errInner != nil {
- err = fmt.Errorf("Error occurred unmarshalling Xml - Error = '%v' Xml = '%s'", errInner, string(b))
- }
- }
- }
- return err
- })
- }
-}
-
-// WithErrorUnlessStatusCode returns a RespondDecorator that emits an error unless the response
-// StatusCode is among the set passed. On error, response body is fully read into a buffer and
-// presented in the returned error, as well as in the response body.
-func WithErrorUnlessStatusCode(codes ...int) RespondDecorator {
- return func(r Responder) Responder {
- return ResponderFunc(func(resp *http.Response) error {
- err := r.Respond(resp)
- if err == nil && !ResponseHasStatusCode(resp, codes...) {
- derr := NewErrorWithResponse("autorest", "WithErrorUnlessStatusCode", resp, "%v %v failed with %s",
- resp.Request.Method,
- resp.Request.URL,
- resp.Status)
- if resp.Body != nil {
- defer resp.Body.Close()
- b, _ := ioutil.ReadAll(resp.Body)
- derr.ServiceError = b
- resp.Body = ioutil.NopCloser(bytes.NewReader(b))
- }
- err = derr
- }
- return err
- })
- }
-}
-
-// WithErrorUnlessOK returns a RespondDecorator that emits an error if the response StatusCode is
-// anything other than HTTP 200.
-func WithErrorUnlessOK() RespondDecorator {
- return WithErrorUnlessStatusCode(http.StatusOK)
-}
-
-// ExtractHeader extracts all values of the specified header from the http.Response. It returns an
-// empty string slice if the passed http.Response is nil or the header does not exist.
-func ExtractHeader(header string, resp *http.Response) []string {
- if resp != nil && resp.Header != nil {
- return resp.Header[http.CanonicalHeaderKey(header)]
- }
- return nil
-}
-
-// ExtractHeaderValue extracts the first value of the specified header from the http.Response. It
-// returns an empty string if the passed http.Response is nil or the header does not exist.
-func ExtractHeaderValue(header string, resp *http.Response) string {
- h := ExtractHeader(header, resp)
- if len(h) > 0 {
- return h[0]
- }
- return ""
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go b/vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go
deleted file mode 100644
index fa11dbed7..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "bytes"
- "io"
- "io/ioutil"
- "net/http"
-)
-
-// NewRetriableRequest returns a wrapper around an HTTP request that support retry logic.
-func NewRetriableRequest(req *http.Request) *RetriableRequest {
- return &RetriableRequest{req: req}
-}
-
-// Request returns the wrapped HTTP request.
-func (rr *RetriableRequest) Request() *http.Request {
- return rr.req
-}
-
-func (rr *RetriableRequest) prepareFromByteReader() (err error) {
- // fall back to making a copy (only do this once)
- b := []byte{}
- if rr.req.ContentLength > 0 {
- b = make([]byte, rr.req.ContentLength)
- _, err = io.ReadFull(rr.req.Body, b)
- if err != nil {
- return err
- }
- } else {
- b, err = ioutil.ReadAll(rr.req.Body)
- if err != nil {
- return err
- }
- }
- rr.br = bytes.NewReader(b)
- rr.req.Body = ioutil.NopCloser(rr.br)
- return err
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go b/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go
deleted file mode 100644
index 4c87030e8..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go
+++ /dev/null
@@ -1,55 +0,0 @@
-//go:build !go1.8
-// +build !go1.8
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package autorest
-
-import (
- "bytes"
- "io/ioutil"
- "net/http"
-)
-
-// RetriableRequest provides facilities for retrying an HTTP request.
-type RetriableRequest struct {
- req *http.Request
- br *bytes.Reader
-}
-
-// Prepare signals that the request is about to be sent.
-func (rr *RetriableRequest) Prepare() (err error) {
- // preserve the request body; this is to support retry logic as
- // the underlying transport will always close the reqeust body
- if rr.req.Body != nil {
- if rr.br != nil {
- _, err = rr.br.Seek(0, 0 /*io.SeekStart*/)
- rr.req.Body = ioutil.NopCloser(rr.br)
- }
- if err != nil {
- return err
- }
- if rr.br == nil {
- // fall back to making a copy (only do this once)
- err = rr.prepareFromByteReader()
- }
- }
- return err
-}
-
-func removeRequestBody(req *http.Request) {
- req.Body = nil
- req.ContentLength = 0
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go b/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go
deleted file mode 100644
index 05847c08b..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go
+++ /dev/null
@@ -1,67 +0,0 @@
-//go:build go1.8
-// +build go1.8
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package autorest
-
-import (
- "bytes"
- "io"
- "io/ioutil"
- "net/http"
-)
-
-// RetriableRequest provides facilities for retrying an HTTP request.
-type RetriableRequest struct {
- req *http.Request
- rc io.ReadCloser
- br *bytes.Reader
-}
-
-// Prepare signals that the request is about to be sent.
-func (rr *RetriableRequest) Prepare() (err error) {
- // preserve the request body; this is to support retry logic as
- // the underlying transport will always close the reqeust body
- if rr.req.Body != nil {
- if rr.rc != nil {
- rr.req.Body = rr.rc
- } else if rr.br != nil {
- _, err = rr.br.Seek(0, io.SeekStart)
- rr.req.Body = ioutil.NopCloser(rr.br)
- }
- if err != nil {
- return err
- }
- if rr.req.GetBody != nil {
- // this will allow us to preserve the body without having to
- // make a copy. note we need to do this on each iteration
- rr.rc, err = rr.req.GetBody()
- if err != nil {
- return err
- }
- } else if rr.br == nil {
- // fall back to making a copy (only do this once)
- err = rr.prepareFromByteReader()
- }
- }
- return err
-}
-
-func removeRequestBody(req *http.Request) {
- req.Body = nil
- req.GetBody = nil
- req.ContentLength = 0
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/sender.go b/vendor/github.com/Azure/go-autorest/autorest/sender.go
deleted file mode 100644
index 118de8141..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/sender.go
+++ /dev/null
@@ -1,458 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "context"
- "crypto/tls"
- "fmt"
- "log"
- "math"
- "net"
- "net/http"
- "net/http/cookiejar"
- "strconv"
- "sync"
- "time"
-
- "github.com/Azure/go-autorest/logger"
- "github.com/Azure/go-autorest/tracing"
-)
-
-// there is one sender per TLS renegotiation type, i.e. count of tls.RenegotiationSupport enums
-const defaultSendersCount = 3
-
-type defaultSender struct {
- sender Sender
- init *sync.Once
-}
-
-// each type of sender will be created on demand in sender()
-var defaultSenders [defaultSendersCount]defaultSender
-
-func init() {
- for i := 0; i < defaultSendersCount; i++ {
- defaultSenders[i].init = &sync.Once{}
- }
-}
-
-// used as a key type in context.WithValue()
-type ctxSendDecorators struct{}
-
-// WithSendDecorators adds the specified SendDecorators to the provided context.
-// If no SendDecorators are provided the context is unchanged.
-func WithSendDecorators(ctx context.Context, sendDecorator []SendDecorator) context.Context {
- if len(sendDecorator) == 0 {
- return ctx
- }
- return context.WithValue(ctx, ctxSendDecorators{}, sendDecorator)
-}
-
-// GetSendDecorators returns the SendDecorators in the provided context or the provided default SendDecorators.
-func GetSendDecorators(ctx context.Context, defaultSendDecorators ...SendDecorator) []SendDecorator {
- inCtx := ctx.Value(ctxSendDecorators{})
- if sd, ok := inCtx.([]SendDecorator); ok {
- return sd
- }
- return defaultSendDecorators
-}
-
-// Sender is the interface that wraps the Do method to send HTTP requests.
-//
-// The standard http.Client conforms to this interface.
-type Sender interface {
- Do(*http.Request) (*http.Response, error)
-}
-
-// SenderFunc is a method that implements the Sender interface.
-type SenderFunc func(*http.Request) (*http.Response, error)
-
-// Do implements the Sender interface on SenderFunc.
-func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) {
- return sf(r)
-}
-
-// SendDecorator takes and possibly decorates, by wrapping, a Sender. Decorators may affect the
-// http.Request and pass it along or, first, pass the http.Request along then react to the
-// http.Response result.
-type SendDecorator func(Sender) Sender
-
-// CreateSender creates, decorates, and returns, as a Sender, the default http.Client.
-func CreateSender(decorators ...SendDecorator) Sender {
- return DecorateSender(sender(tls.RenegotiateNever), decorators...)
-}
-
-// DecorateSender accepts a Sender and a, possibly empty, set of SendDecorators, which is applies to
-// the Sender. Decorators are applied in the order received, but their affect upon the request
-// depends on whether they are a pre-decorator (change the http.Request and then pass it along) or a
-// post-decorator (pass the http.Request along and react to the results in http.Response).
-func DecorateSender(s Sender, decorators ...SendDecorator) Sender {
- for _, decorate := range decorators {
- s = decorate(s)
- }
- return s
-}
-
-// Send sends, by means of the default http.Client, the passed http.Request, returning the
-// http.Response and possible error. It also accepts a, possibly empty, set of SendDecorators which
-// it will apply the http.Client before invoking the Do method.
-//
-// Send is a convenience method and not recommended for production. Advanced users should use
-// SendWithSender, passing and sharing their own Sender (e.g., instance of http.Client).
-//
-// Send will not poll or retry requests.
-func Send(r *http.Request, decorators ...SendDecorator) (*http.Response, error) {
- return SendWithSender(sender(tls.RenegotiateNever), r, decorators...)
-}
-
-// SendWithSender sends the passed http.Request, through the provided Sender, returning the
-// http.Response and possible error. It also accepts a, possibly empty, set of SendDecorators which
-// it will apply the http.Client before invoking the Do method.
-//
-// SendWithSender will not poll or retry requests.
-func SendWithSender(s Sender, r *http.Request, decorators ...SendDecorator) (*http.Response, error) {
- return DecorateSender(s, decorators...).Do(r)
-}
-
-func sender(renengotiation tls.RenegotiationSupport) Sender {
- // note that we can't init defaultSenders in init() since it will
- // execute before calling code has had a chance to enable tracing
- defaultSenders[renengotiation].init.Do(func() {
- // copied from http.DefaultTransport with a TLS minimum version.
- transport := &http.Transport{
- Proxy: http.ProxyFromEnvironment,
- DialContext: (&net.Dialer{
- Timeout: 30 * time.Second,
- KeepAlive: 30 * time.Second,
- }).DialContext,
- ForceAttemptHTTP2: true,
- MaxIdleConns: 100,
- IdleConnTimeout: 90 * time.Second,
- TLSHandshakeTimeout: 10 * time.Second,
- ExpectContinueTimeout: 1 * time.Second,
- TLSClientConfig: &tls.Config{
- MinVersion: tls.VersionTLS12,
- Renegotiation: renengotiation,
- },
- }
- var roundTripper http.RoundTripper = transport
- if tracing.IsEnabled() {
- roundTripper = tracing.NewTransport(transport)
- }
- j, _ := cookiejar.New(nil)
- defaultSenders[renengotiation].sender = &http.Client{Jar: j, Transport: roundTripper}
- })
- return defaultSenders[renengotiation].sender
-}
-
-// AfterDelay returns a SendDecorator that delays for the passed time.Duration before
-// invoking the Sender. The delay may be terminated by closing the optional channel on the
-// http.Request. If canceled, no further Senders are invoked.
-func AfterDelay(d time.Duration) SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (*http.Response, error) {
- if !DelayForBackoff(d, 0, r.Context().Done()) {
- return nil, fmt.Errorf("autorest: AfterDelay canceled before full delay")
- }
- return s.Do(r)
- })
- }
-}
-
-// AsIs returns a SendDecorator that invokes the passed Sender without modifying the http.Request.
-func AsIs() SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (*http.Response, error) {
- return s.Do(r)
- })
- }
-}
-
-// DoCloseIfError returns a SendDecorator that first invokes the passed Sender after which
-// it closes the response if the passed Sender returns an error and the response body exists.
-func DoCloseIfError() SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (*http.Response, error) {
- resp, err := s.Do(r)
- if err != nil {
- Respond(resp, ByDiscardingBody(), ByClosing())
- }
- return resp, err
- })
- }
-}
-
-// DoErrorIfStatusCode returns a SendDecorator that emits an error if the response StatusCode is
-// among the set passed. Since these are artificial errors, the response body may still require
-// closing.
-func DoErrorIfStatusCode(codes ...int) SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (*http.Response, error) {
- resp, err := s.Do(r)
- if err == nil && ResponseHasStatusCode(resp, codes...) {
- err = NewErrorWithResponse("autorest", "DoErrorIfStatusCode", resp, "%v %v failed with %s",
- resp.Request.Method,
- resp.Request.URL,
- resp.Status)
- }
- return resp, err
- })
- }
-}
-
-// DoErrorUnlessStatusCode returns a SendDecorator that emits an error unless the response
-// StatusCode is among the set passed. Since these are artificial errors, the response body
-// may still require closing.
-func DoErrorUnlessStatusCode(codes ...int) SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (*http.Response, error) {
- resp, err := s.Do(r)
- if err == nil && !ResponseHasStatusCode(resp, codes...) {
- err = NewErrorWithResponse("autorest", "DoErrorUnlessStatusCode", resp, "%v %v failed with %s",
- resp.Request.Method,
- resp.Request.URL,
- resp.Status)
- }
- return resp, err
- })
- }
-}
-
-// DoPollForStatusCodes returns a SendDecorator that polls if the http.Response contains one of the
-// passed status codes. It expects the http.Response to contain a Location header providing the
-// URL at which to poll (using GET) and will poll until the time passed is equal to or greater than
-// the supplied duration. It will delay between requests for the duration specified in the
-// RetryAfter header or, if the header is absent, the passed delay. Polling may be canceled by
-// closing the optional channel on the http.Request.
-func DoPollForStatusCodes(duration time.Duration, delay time.Duration, codes ...int) SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (resp *http.Response, err error) {
- resp, err = s.Do(r)
-
- if err == nil && ResponseHasStatusCode(resp, codes...) {
- r, err = NewPollingRequestWithContext(r.Context(), resp)
-
- for err == nil && ResponseHasStatusCode(resp, codes...) {
- Respond(resp,
- ByDiscardingBody(),
- ByClosing())
- resp, err = SendWithSender(s, r,
- AfterDelay(GetRetryAfter(resp, delay)))
- }
- }
-
- return resp, err
- })
- }
-}
-
-// DoRetryForAttempts returns a SendDecorator that retries a failed request for up to the specified
-// number of attempts, exponentially backing off between requests using the supplied backoff
-// time.Duration (which may be zero). Retrying may be canceled by closing the optional channel on
-// the http.Request.
-func DoRetryForAttempts(attempts int, backoff time.Duration) SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (resp *http.Response, err error) {
- rr := NewRetriableRequest(r)
- for attempt := 0; attempt < attempts; attempt++ {
- err = rr.Prepare()
- if err != nil {
- return resp, err
- }
- DrainResponseBody(resp)
- resp, err = s.Do(rr.Request())
- if err == nil {
- return resp, err
- }
- logger.Instance.Writef(logger.LogError, "DoRetryForAttempts: received error for attempt %d: %v\n", attempt+1, err)
- if !DelayForBackoff(backoff, attempt, r.Context().Done()) {
- return nil, r.Context().Err()
- }
- }
- return resp, err
- })
- }
-}
-
-// Count429AsRetry indicates that a 429 response should be included as a retry attempt.
-var Count429AsRetry = true
-
-// Max429Delay is the maximum duration to wait between retries on a 429 if no Retry-After header was received.
-var Max429Delay time.Duration
-
-// DoRetryForStatusCodes returns a SendDecorator that retries for specified statusCodes for up to the specified
-// number of attempts, exponentially backing off between requests using the supplied backoff
-// time.Duration (which may be zero). Retrying may be canceled by cancelling the context on the http.Request.
-// NOTE: Code http.StatusTooManyRequests (429) will *not* be counted against the number of attempts.
-func DoRetryForStatusCodes(attempts int, backoff time.Duration, codes ...int) SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (*http.Response, error) {
- return doRetryForStatusCodesImpl(s, r, Count429AsRetry, attempts, backoff, 0, codes...)
- })
- }
-}
-
-// DoRetryForStatusCodesWithCap returns a SendDecorator that retries for specified statusCodes for up to the
-// specified number of attempts, exponentially backing off between requests using the supplied backoff
-// time.Duration (which may be zero). To cap the maximum possible delay between iterations specify a value greater
-// than zero for cap. Retrying may be canceled by cancelling the context on the http.Request.
-func DoRetryForStatusCodesWithCap(attempts int, backoff, cap time.Duration, codes ...int) SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (*http.Response, error) {
- return doRetryForStatusCodesImpl(s, r, Count429AsRetry, attempts, backoff, cap, codes...)
- })
- }
-}
-
-func doRetryForStatusCodesImpl(s Sender, r *http.Request, count429 bool, attempts int, backoff, cap time.Duration, codes ...int) (resp *http.Response, err error) {
- rr := NewRetriableRequest(r)
- // Increment to add the first call (attempts denotes number of retries)
- for attempt, delayCount := 0, 0; attempt < attempts+1; {
- err = rr.Prepare()
- if err != nil {
- return
- }
- DrainResponseBody(resp)
- resp, err = s.Do(rr.Request())
- // we want to retry if err is not nil (e.g. transient network failure). note that for failed authentication
- // resp and err will both have a value, so in this case we don't want to retry as it will never succeed.
- if err == nil && !ResponseHasStatusCode(resp, codes...) || IsTokenRefreshError(err) {
- return resp, err
- }
- if err != nil {
- logger.Instance.Writef(logger.LogError, "DoRetryForStatusCodes: received error for attempt %d: %v\n", attempt+1, err)
- }
- delayed := DelayWithRetryAfter(resp, r.Context().Done())
- // if this was a 429 set the delay cap as specified.
- // applicable only in the absence of a retry-after header.
- if resp != nil && resp.StatusCode == http.StatusTooManyRequests {
- cap = Max429Delay
- }
- if !delayed && !DelayForBackoffWithCap(backoff, cap, delayCount, r.Context().Done()) {
- return resp, r.Context().Err()
- }
- // when count429 == false don't count a 429 against the number
- // of attempts so that we continue to retry until it succeeds
- if count429 || (resp == nil || resp.StatusCode != http.StatusTooManyRequests) {
- attempt++
- }
- // delay count is tracked separately from attempts to
- // ensure that 429 participates in exponential back-off
- delayCount++
- }
- return resp, err
-}
-
-// DelayWithRetryAfter invokes time.After for the duration specified in the "Retry-After" header.
-// The value of Retry-After can be either the number of seconds or a date in RFC1123 format.
-// The function returns true after successfully waiting for the specified duration. If there is
-// no Retry-After header or the wait is cancelled the return value is false.
-func DelayWithRetryAfter(resp *http.Response, cancel <-chan struct{}) bool {
- if resp == nil {
- return false
- }
- var dur time.Duration
- ra := resp.Header.Get("Retry-After")
- if retryAfter, _ := strconv.Atoi(ra); retryAfter > 0 {
- dur = time.Duration(retryAfter) * time.Second
- } else if t, err := time.Parse(time.RFC1123, ra); err == nil {
- dur = t.Sub(time.Now())
- }
- if dur > 0 {
- select {
- case <-time.After(dur):
- return true
- case <-cancel:
- return false
- }
- }
- return false
-}
-
-// DoRetryForDuration returns a SendDecorator that retries the request until the total time is equal
-// to or greater than the specified duration, exponentially backing off between requests using the
-// supplied backoff time.Duration (which may be zero). Retrying may be canceled by closing the
-// optional channel on the http.Request.
-func DoRetryForDuration(d time.Duration, backoff time.Duration) SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (resp *http.Response, err error) {
- rr := NewRetriableRequest(r)
- end := time.Now().Add(d)
- for attempt := 0; time.Now().Before(end); attempt++ {
- err = rr.Prepare()
- if err != nil {
- return resp, err
- }
- DrainResponseBody(resp)
- resp, err = s.Do(rr.Request())
- if err == nil {
- return resp, err
- }
- logger.Instance.Writef(logger.LogError, "DoRetryForDuration: received error for attempt %d: %v\n", attempt+1, err)
- if !DelayForBackoff(backoff, attempt, r.Context().Done()) {
- return nil, r.Context().Err()
- }
- }
- return resp, err
- })
- }
-}
-
-// WithLogging returns a SendDecorator that implements simple before and after logging of the
-// request.
-func WithLogging(logger *log.Logger) SendDecorator {
- return func(s Sender) Sender {
- return SenderFunc(func(r *http.Request) (*http.Response, error) {
- logger.Printf("Sending %s %s", r.Method, r.URL)
- resp, err := s.Do(r)
- if err != nil {
- logger.Printf("%s %s received error '%v'", r.Method, r.URL, err)
- } else {
- logger.Printf("%s %s received %s", r.Method, r.URL, resp.Status)
- }
- return resp, err
- })
- }
-}
-
-// DelayForBackoff invokes time.After for the supplied backoff duration raised to the power of
-// passed attempt (i.e., an exponential backoff delay). Backoff duration is in seconds and can set
-// to zero for no delay. The delay may be canceled by closing the passed channel. If terminated early,
-// returns false.
-// Note: Passing attempt 1 will result in doubling "backoff" duration. Treat this as a zero-based attempt
-// count.
-func DelayForBackoff(backoff time.Duration, attempt int, cancel <-chan struct{}) bool {
- return DelayForBackoffWithCap(backoff, 0, attempt, cancel)
-}
-
-// DelayForBackoffWithCap invokes time.After for the supplied backoff duration raised to the power of
-// passed attempt (i.e., an exponential backoff delay). Backoff duration is in seconds and can set
-// to zero for no delay. To cap the maximum possible delay specify a value greater than zero for cap.
-// The delay may be canceled by closing the passed channel. If terminated early, returns false.
-// Note: Passing attempt 1 will result in doubling "backoff" duration. Treat this as a zero-based attempt
-// count.
-func DelayForBackoffWithCap(backoff, cap time.Duration, attempt int, cancel <-chan struct{}) bool {
- d := time.Duration(backoff.Seconds()*math.Pow(2, float64(attempt))) * time.Second
- if cap > 0 && d > cap {
- d = cap
- }
- logger.Instance.Writef(logger.LogInfo, "DelayForBackoffWithCap: sleeping for %s\n", d)
- select {
- case <-time.After(d):
- return true
- case <-cancel:
- return false
- }
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility.go b/vendor/github.com/Azure/go-autorest/autorest/utility.go
deleted file mode 100644
index 3467b8fa6..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/utility.go
+++ /dev/null
@@ -1,232 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "bytes"
- "encoding/json"
- "encoding/xml"
- "fmt"
- "io"
- "io/ioutil"
- "net"
- "net/http"
- "net/url"
- "reflect"
- "strings"
-)
-
-// EncodedAs is a series of constants specifying various data encodings
-type EncodedAs string
-
-const (
- // EncodedAsJSON states that data is encoded as JSON
- EncodedAsJSON EncodedAs = "JSON"
-
- // EncodedAsXML states that data is encoded as Xml
- EncodedAsXML EncodedAs = "XML"
-)
-
-// Decoder defines the decoding method json.Decoder and xml.Decoder share
-type Decoder interface {
- Decode(v interface{}) error
-}
-
-// NewDecoder creates a new decoder appropriate to the passed encoding.
-// encodedAs specifies the type of encoding and r supplies the io.Reader containing the
-// encoded data.
-func NewDecoder(encodedAs EncodedAs, r io.Reader) Decoder {
- if encodedAs == EncodedAsJSON {
- return json.NewDecoder(r)
- } else if encodedAs == EncodedAsXML {
- return xml.NewDecoder(r)
- }
- return nil
-}
-
-// CopyAndDecode decodes the data from the passed io.Reader while making a copy. Having a copy
-// is especially useful if there is a chance the data will fail to decode.
-// encodedAs specifies the expected encoding, r provides the io.Reader to the data, and v
-// is the decoding destination.
-func CopyAndDecode(encodedAs EncodedAs, r io.Reader, v interface{}) (bytes.Buffer, error) {
- b := bytes.Buffer{}
- return b, NewDecoder(encodedAs, io.TeeReader(r, &b)).Decode(v)
-}
-
-// TeeReadCloser returns a ReadCloser that writes to w what it reads from rc.
-// It utilizes io.TeeReader to copy the data read and has the same behavior when reading.
-// Further, when it is closed, it ensures that rc is closed as well.
-func TeeReadCloser(rc io.ReadCloser, w io.Writer) io.ReadCloser {
- return &teeReadCloser{rc, io.TeeReader(rc, w)}
-}
-
-type teeReadCloser struct {
- rc io.ReadCloser
- r io.Reader
-}
-
-func (t *teeReadCloser) Read(p []byte) (int, error) {
- return t.r.Read(p)
-}
-
-func (t *teeReadCloser) Close() error {
- return t.rc.Close()
-}
-
-func containsInt(ints []int, n int) bool {
- for _, i := range ints {
- if i == n {
- return true
- }
- }
- return false
-}
-
-func escapeValueStrings(m map[string]string) map[string]string {
- for key, value := range m {
- m[key] = url.QueryEscape(value)
- }
- return m
-}
-
-func ensureValueStrings(mapOfInterface map[string]interface{}) map[string]string {
- mapOfStrings := make(map[string]string)
- for key, value := range mapOfInterface {
- mapOfStrings[key] = ensureValueString(value)
- }
- return mapOfStrings
-}
-
-func ensureValueString(value interface{}) string {
- if value == nil {
- return ""
- }
- switch v := value.(type) {
- case string:
- return v
- case []byte:
- return string(v)
- default:
- return fmt.Sprintf("%v", v)
- }
-}
-
-// MapToValues method converts map[string]interface{} to url.Values.
-func MapToValues(m map[string]interface{}) url.Values {
- v := url.Values{}
- for key, value := range m {
- x := reflect.ValueOf(value)
- if x.Kind() == reflect.Array || x.Kind() == reflect.Slice {
- for i := 0; i < x.Len(); i++ {
- v.Add(key, ensureValueString(x.Index(i)))
- }
- } else {
- v.Add(key, ensureValueString(value))
- }
- }
- return v
-}
-
-// AsStringSlice method converts interface{} to []string.
-// s must be of type slice or array or an error is returned.
-// Each element of s will be converted to its string representation.
-func AsStringSlice(s interface{}) ([]string, error) {
- v := reflect.ValueOf(s)
- if v.Kind() != reflect.Slice && v.Kind() != reflect.Array {
- return nil, NewError("autorest", "AsStringSlice", "the value's type is not a slice or array.")
- }
- stringSlice := make([]string, 0, v.Len())
-
- for i := 0; i < v.Len(); i++ {
- stringSlice = append(stringSlice, fmt.Sprintf("%v", v.Index(i)))
- }
- return stringSlice, nil
-}
-
-// String method converts interface v to string. If interface is a list, it
-// joins list elements using the separator. Note that only sep[0] will be used for
-// joining if any separator is specified.
-func String(v interface{}, sep ...string) string {
- if len(sep) == 0 {
- return ensureValueString(v)
- }
- stringSlice, ok := v.([]string)
- if ok == false {
- var err error
- stringSlice, err = AsStringSlice(v)
- if err != nil {
- panic(fmt.Sprintf("autorest: Couldn't convert value to a string %s.", err))
- }
- }
- return ensureValueString(strings.Join(stringSlice, sep[0]))
-}
-
-// Encode method encodes url path and query parameters.
-func Encode(location string, v interface{}, sep ...string) string {
- s := String(v, sep...)
- switch strings.ToLower(location) {
- case "path":
- return pathEscape(s)
- case "query":
- return queryEscape(s)
- default:
- return s
- }
-}
-
-func pathEscape(s string) string {
- return strings.Replace(url.QueryEscape(s), "+", "%20", -1)
-}
-
-func queryEscape(s string) string {
- return url.QueryEscape(s)
-}
-
-// ChangeToGet turns the specified http.Request into a GET (it assumes it wasn't).
-// This is mainly useful for long-running operations that use the Azure-AsyncOperation
-// header, so we change the initial PUT into a GET to retrieve the final result.
-func ChangeToGet(req *http.Request) *http.Request {
- req.Method = "GET"
- req.Body = nil
- req.ContentLength = 0
- req.Header.Del("Content-Length")
- return req
-}
-
-// IsTemporaryNetworkError returns true if the specified error is a temporary network error or false
-// if it's not. If the error doesn't implement the net.Error interface the return value is true.
-func IsTemporaryNetworkError(err error) bool {
- if netErr, ok := err.(net.Error); !ok || (ok && netErr.Temporary()) {
- return true
- }
- return false
-}
-
-// DrainResponseBody reads the response body then closes it.
-func DrainResponseBody(resp *http.Response) error {
- if resp != nil && resp.Body != nil {
- _, err := io.Copy(ioutil.Discard, resp.Body)
- resp.Body.Close()
- return err
- }
- return nil
-}
-
-func setHeader(r *http.Request, key, value string) {
- if r.Header == nil {
- r.Header = make(http.Header)
- }
- r.Header.Set(key, value)
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go b/vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go
deleted file mode 100644
index 3133fcc08..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go
+++ /dev/null
@@ -1,30 +0,0 @@
-//go:build go1.13
-// +build go1.13
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package autorest
-
-import (
- "errors"
-
- "github.com/Azure/go-autorest/autorest/adal"
-)
-
-// IsTokenRefreshError returns true if the specified error implements the TokenRefreshError interface.
-func IsTokenRefreshError(err error) bool {
- var tre adal.TokenRefreshError
- return errors.As(err, &tre)
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go b/vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go
deleted file mode 100644
index 851e152db..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go
+++ /dev/null
@@ -1,32 +0,0 @@
-//go:build !go1.13
-// +build !go1.13
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package autorest
-
-import "github.com/Azure/go-autorest/autorest/adal"
-
-// IsTokenRefreshError returns true if the specified error implements the TokenRefreshError
-// interface. If err is a DetailedError it will walk the chain of Original errors.
-func IsTokenRefreshError(err error) bool {
- if _, ok := err.(adal.TokenRefreshError); ok {
- return true
- }
- if de, ok := err.(DetailedError); ok {
- return IsTokenRefreshError(de.Original)
- }
- return false
-}
diff --git a/vendor/github.com/Azure/go-autorest/autorest/version.go b/vendor/github.com/Azure/go-autorest/autorest/version.go
deleted file mode 100644
index 713e23581..000000000
--- a/vendor/github.com/Azure/go-autorest/autorest/version.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "fmt"
- "runtime"
-)
-
-const number = "v14.2.1"
-
-var (
- userAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s",
- runtime.Version(),
- runtime.GOARCH,
- runtime.GOOS,
- number,
- )
-)
-
-// UserAgent returns a string containing the Go version, system architecture and OS, and the go-autorest version.
-func UserAgent() string {
- return userAgent
-}
-
-// Version returns the semantic version (see http://semver.org).
-func Version() string {
- return number
-}
diff --git a/vendor/github.com/Azure/go-autorest/azure-pipelines.yml b/vendor/github.com/Azure/go-autorest/azure-pipelines.yml
deleted file mode 100644
index 6fb8404fd..000000000
--- a/vendor/github.com/Azure/go-autorest/azure-pipelines.yml
+++ /dev/null
@@ -1,105 +0,0 @@
-variables:
- GOPATH: '$(system.defaultWorkingDirectory)/work'
- sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)'
-
-jobs:
- - job: 'goautorest'
- displayName: 'Run go-autorest CI Checks'
-
- strategy:
- matrix:
- Linux_Go113:
- vm.image: 'ubuntu-18.04'
- go.version: '1.13'
- Linux_Go114:
- vm.image: 'ubuntu-18.04'
- go.version: '1.14'
-
- pool:
- vmImage: '$(vm.image)'
-
- steps:
- - task: GoTool@0
- inputs:
- version: '$(go.version)'
- displayName: "Select Go Version"
-
- - script: |
- set -e
- mkdir -p '$(GOPATH)/bin'
- mkdir -p '$(sdkPath)'
- shopt -s extglob
- mv !(work) '$(sdkPath)'
- echo '##vso[task.prependpath]$(GOPATH)/bin'
- displayName: 'Create Go Workspace'
-
- - script: |
- set -e
- curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
- dep ensure -v
- go install ./vendor/golang.org/x/lint/golint
- go get github.com/jstemmer/go-junit-report
- go get github.com/axw/gocov/gocov
- go get github.com/AlekSi/gocov-xml
- go get -u github.com/matm/gocov-html
- workingDirectory: '$(sdkPath)'
- displayName: 'Install Dependencies'
-
- - script: |
- go vet ./autorest/...
- go vet ./logger/...
- go vet ./tracing/...
- workingDirectory: '$(sdkPath)'
- displayName: 'Vet'
-
- - script: |
- go build -v ./autorest/...
- go build -v ./logger/...
- go build -v ./tracing/...
- workingDirectory: '$(sdkPath)'
- displayName: 'Build'
-
- - script: |
- set -e
- go test -race -v -coverprofile=coverage.txt -covermode atomic ./autorest/... ./logger/... ./tracing/... 2>&1 | go-junit-report > report.xml
- gocov convert coverage.txt > coverage.json
- gocov-xml < coverage.json > coverage.xml
- gocov-html < coverage.json > coverage.html
- workingDirectory: '$(sdkPath)'
- displayName: 'Run Tests'
-
- - script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2
- workingDirectory: '$(sdkPath)'
- displayName: 'Copyright Header Check'
- failOnStderr: true
- condition: succeededOrFailed()
-
- - script: |
- gofmt -s -l -w ./autorest/. >&2
- gofmt -s -l -w ./logger/. >&2
- gofmt -s -l -w ./tracing/. >&2
- workingDirectory: '$(sdkPath)'
- displayName: 'Format Check'
- failOnStderr: true
- condition: succeededOrFailed()
-
- - script: |
- golint ./autorest/... >&2
- golint ./logger/... >&2
- golint ./tracing/... >&2
- workingDirectory: '$(sdkPath)'
- displayName: 'Linter Check'
- failOnStderr: true
- condition: succeededOrFailed()
-
- - task: PublishTestResults@2
- inputs:
- testRunner: JUnit
- testResultsFiles: $(sdkPath)/report.xml
- failTaskOnFailedTests: true
-
- - task: PublishCodeCoverageResults@1
- inputs:
- codeCoverageTool: Cobertura
- summaryFileLocation: $(sdkPath)/coverage.xml
- additionalCodeCoverageFiles: $(sdkPath)/coverage.html
diff --git a/vendor/github.com/Azure/go-autorest/doc.go b/vendor/github.com/Azure/go-autorest/doc.go
deleted file mode 100644
index 99ae6ca98..000000000
--- a/vendor/github.com/Azure/go-autorest/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Package go-autorest provides an HTTP request client for use with Autorest-generated API client packages.
-*/
-package go_autorest
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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/Azure/go-autorest/logger/LICENSE b/vendor/github.com/Azure/go-autorest/logger/LICENSE
deleted file mode 100644
index b9d6a27ea..000000000
--- a/vendor/github.com/Azure/go-autorest/logger/LICENSE
+++ /dev/null
@@ -1,191 +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
-
- Copyright 2015 Microsoft Corporation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT 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/Azure/go-autorest/logger/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/logger/go_mod_tidy_hack.go
deleted file mode 100644
index 0aa27680d..000000000
--- a/vendor/github.com/Azure/go-autorest/logger/go_mod_tidy_hack.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// +build modhack
-
-package logger
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 file, and the github.com/Azure/go-autorest import, won't actually become part of
-// the resultant binary.
-
-// Necessary for safely adding multi-module repo.
-// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository
-import _ "github.com/Azure/go-autorest"
diff --git a/vendor/github.com/Azure/go-autorest/logger/logger.go b/vendor/github.com/Azure/go-autorest/logger/logger.go
deleted file mode 100644
index 2f5d8cc1a..000000000
--- a/vendor/github.com/Azure/go-autorest/logger/logger.go
+++ /dev/null
@@ -1,337 +0,0 @@
-package logger
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "bytes"
- "fmt"
- "io"
- "io/ioutil"
- "net/http"
- "net/url"
- "os"
- "strings"
- "sync"
- "time"
-)
-
-// LevelType tells a logger the minimum level to log. When code reports a log entry,
-// the LogLevel indicates the level of the log entry. The logger only records entries
-// whose level is at least the level it was told to log. See the Log* constants.
-// For example, if a logger is configured with LogError, then LogError, LogPanic,
-// and LogFatal entries will be logged; lower level entries are ignored.
-type LevelType uint32
-
-const (
- // LogNone tells a logger not to log any entries passed to it.
- LogNone LevelType = iota
-
- // LogFatal tells a logger to log all LogFatal entries passed to it.
- LogFatal
-
- // LogPanic tells a logger to log all LogPanic and LogFatal entries passed to it.
- LogPanic
-
- // LogError tells a logger to log all LogError, LogPanic and LogFatal entries passed to it.
- LogError
-
- // LogWarning tells a logger to log all LogWarning, LogError, LogPanic and LogFatal entries passed to it.
- LogWarning
-
- // LogInfo tells a logger to log all LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it.
- LogInfo
-
- // LogDebug tells a logger to log all LogDebug, LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it.
- LogDebug
-
- // LogAuth is a special case of LogDebug, it tells a logger to also log the body of an authentication request and response.
- // NOTE: this can disclose sensitive information, use with care.
- LogAuth
-)
-
-const (
- logNone = "NONE"
- logFatal = "FATAL"
- logPanic = "PANIC"
- logError = "ERROR"
- logWarning = "WARNING"
- logInfo = "INFO"
- logDebug = "DEBUG"
- logAuth = "AUTH"
- logUnknown = "UNKNOWN"
-)
-
-// ParseLevel converts the specified string into the corresponding LevelType.
-func ParseLevel(s string) (lt LevelType, err error) {
- switch strings.ToUpper(s) {
- case logFatal:
- lt = LogFatal
- case logPanic:
- lt = LogPanic
- case logError:
- lt = LogError
- case logWarning:
- lt = LogWarning
- case logInfo:
- lt = LogInfo
- case logDebug:
- lt = LogDebug
- case logAuth:
- lt = LogAuth
- default:
- err = fmt.Errorf("bad log level '%s'", s)
- }
- return
-}
-
-// String implements the stringer interface for LevelType.
-func (lt LevelType) String() string {
- switch lt {
- case LogNone:
- return logNone
- case LogFatal:
- return logFatal
- case LogPanic:
- return logPanic
- case LogError:
- return logError
- case LogWarning:
- return logWarning
- case LogInfo:
- return logInfo
- case LogDebug:
- return logDebug
- case LogAuth:
- return logAuth
- default:
- return logUnknown
- }
-}
-
-// Filter defines functions for filtering HTTP request/response content.
-type Filter struct {
- // URL returns a potentially modified string representation of a request URL.
- URL func(u *url.URL) string
-
- // Header returns a potentially modified set of values for the specified key.
- // To completely exclude the header key/values return false.
- Header func(key string, val []string) (bool, []string)
-
- // Body returns a potentially modified request/response body.
- Body func(b []byte) []byte
-}
-
-func (f Filter) processURL(u *url.URL) string {
- if f.URL == nil {
- return u.String()
- }
- return f.URL(u)
-}
-
-func (f Filter) processHeader(k string, val []string) (bool, []string) {
- if f.Header == nil {
- return true, val
- }
- return f.Header(k, val)
-}
-
-func (f Filter) processBody(b []byte) []byte {
- if f.Body == nil {
- return b
- }
- return f.Body(b)
-}
-
-// Writer defines methods for writing to a logging facility.
-type Writer interface {
- // Writeln writes the specified message with the standard log entry header and new-line character.
- Writeln(level LevelType, message string)
-
- // Writef writes the specified format specifier with the standard log entry header and no new-line character.
- Writef(level LevelType, format string, a ...interface{})
-
- // WriteRequest writes the specified HTTP request to the logger if the log level is greater than
- // or equal to LogInfo. The request body, if set, is logged at level LogDebug or higher.
- // Custom filters can be specified to exclude URL, header, and/or body content from the log.
- // By default no request content is excluded.
- WriteRequest(req *http.Request, filter Filter)
-
- // WriteResponse writes the specified HTTP response to the logger if the log level is greater than
- // or equal to LogInfo. The response body, if set, is logged at level LogDebug or higher.
- // Custom filters can be specified to exclude URL, header, and/or body content from the log.
- // By default no response content is excluded.
- WriteResponse(resp *http.Response, filter Filter)
-}
-
-// Instance is the default log writer initialized during package init.
-// This can be replaced with a custom implementation as required.
-var Instance Writer
-
-// default log level
-var logLevel = LogNone
-
-// Level returns the value specified in AZURE_GO_AUTOREST_LOG_LEVEL.
-// If no value was specified the default value is LogNone.
-// Custom loggers can call this to retrieve the configured log level.
-func Level() LevelType {
- return logLevel
-}
-
-func init() {
- // separated for testing purposes
- initDefaultLogger()
-}
-
-func initDefaultLogger() {
- // init with nilLogger so callers don't have to do a nil check on Default
- Instance = nilLogger{}
- llStr := strings.ToLower(os.Getenv("AZURE_GO_SDK_LOG_LEVEL"))
- if llStr == "" {
- return
- }
- var err error
- logLevel, err = ParseLevel(llStr)
- if err != nil {
- fmt.Fprintf(os.Stderr, "go-autorest: failed to parse log level: %s\n", err.Error())
- return
- }
- if logLevel == LogNone {
- return
- }
- // default to stderr
- dest := os.Stderr
- lfStr := os.Getenv("AZURE_GO_SDK_LOG_FILE")
- if strings.EqualFold(lfStr, "stdout") {
- dest = os.Stdout
- } else if lfStr != "" {
- lf, err := os.Create(lfStr)
- if err == nil {
- dest = lf
- } else {
- fmt.Fprintf(os.Stderr, "go-autorest: failed to create log file, using stderr: %s\n", err.Error())
- }
- }
- Instance = fileLogger{
- logLevel: logLevel,
- mu: &sync.Mutex{},
- logFile: dest,
- }
-}
-
-// the nil logger does nothing
-type nilLogger struct{}
-
-func (nilLogger) Writeln(LevelType, string) {}
-
-func (nilLogger) Writef(LevelType, string, ...interface{}) {}
-
-func (nilLogger) WriteRequest(*http.Request, Filter) {}
-
-func (nilLogger) WriteResponse(*http.Response, Filter) {}
-
-// A File is used instead of a Logger so the stream can be flushed after every write.
-type fileLogger struct {
- logLevel LevelType
- mu *sync.Mutex // for synchronizing writes to logFile
- logFile *os.File
-}
-
-func (fl fileLogger) Writeln(level LevelType, message string) {
- fl.Writef(level, "%s\n", message)
-}
-
-func (fl fileLogger) Writef(level LevelType, format string, a ...interface{}) {
- if fl.logLevel >= level {
- fl.mu.Lock()
- defer fl.mu.Unlock()
- fmt.Fprintf(fl.logFile, "%s %s", entryHeader(level), fmt.Sprintf(format, a...))
- fl.logFile.Sync()
- }
-}
-
-func (fl fileLogger) WriteRequest(req *http.Request, filter Filter) {
- if req == nil || fl.logLevel < LogInfo {
- return
- }
- b := &bytes.Buffer{}
- fmt.Fprintf(b, "%s REQUEST: %s %s\n", entryHeader(LogInfo), req.Method, filter.processURL(req.URL))
- // dump headers
- for k, v := range req.Header {
- if ok, mv := filter.processHeader(k, v); ok {
- fmt.Fprintf(b, "%s: %s\n", k, strings.Join(mv, ","))
- }
- }
- if fl.shouldLogBody(req.Header, req.Body) {
- // dump body
- body, err := ioutil.ReadAll(req.Body)
- if err == nil {
- fmt.Fprintln(b, string(filter.processBody(body)))
- if nc, ok := req.Body.(io.Seeker); ok {
- // rewind to the beginning
- nc.Seek(0, io.SeekStart)
- } else {
- // recreate the body
- req.Body = ioutil.NopCloser(bytes.NewReader(body))
- }
- } else {
- fmt.Fprintf(b, "failed to read body: %v\n", err)
- }
- }
- fl.mu.Lock()
- defer fl.mu.Unlock()
- fmt.Fprint(fl.logFile, b.String())
- fl.logFile.Sync()
-}
-
-func (fl fileLogger) WriteResponse(resp *http.Response, filter Filter) {
- if resp == nil || fl.logLevel < LogInfo {
- return
- }
- b := &bytes.Buffer{}
- fmt.Fprintf(b, "%s RESPONSE: %d %s\n", entryHeader(LogInfo), resp.StatusCode, filter.processURL(resp.Request.URL))
- // dump headers
- for k, v := range resp.Header {
- if ok, mv := filter.processHeader(k, v); ok {
- fmt.Fprintf(b, "%s: %s\n", k, strings.Join(mv, ","))
- }
- }
- if fl.shouldLogBody(resp.Header, resp.Body) {
- // dump body
- defer resp.Body.Close()
- body, err := ioutil.ReadAll(resp.Body)
- if err == nil {
- fmt.Fprintln(b, string(filter.processBody(body)))
- resp.Body = ioutil.NopCloser(bytes.NewReader(body))
- } else {
- fmt.Fprintf(b, "failed to read body: %v\n", err)
- }
- }
- fl.mu.Lock()
- defer fl.mu.Unlock()
- fmt.Fprint(fl.logFile, b.String())
- fl.logFile.Sync()
-}
-
-// returns true if the provided body should be included in the log
-func (fl fileLogger) shouldLogBody(header http.Header, body io.ReadCloser) bool {
- ct := header.Get("Content-Type")
- return fl.logLevel >= LogDebug && body != nil && !strings.Contains(ct, "application/octet-stream")
-}
-
-// creates standard header for log entries, it contains a timestamp and the log level
-func entryHeader(level LevelType) string {
- // this format provides a fixed number of digits so the size of the timestamp is constant
- return fmt.Sprintf("(%s) %s:", time.Now().Format("2006-01-02T15:04:05.0000000Z07:00"), level.String())
-}
diff --git a/vendor/github.com/Azure/go-autorest/tracing/LICENSE b/vendor/github.com/Azure/go-autorest/tracing/LICENSE
deleted file mode 100644
index b9d6a27ea..000000000
--- a/vendor/github.com/Azure/go-autorest/tracing/LICENSE
+++ /dev/null
@@ -1,191 +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
-
- Copyright 2015 Microsoft Corporation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT 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/Azure/go-autorest/tracing/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/tracing/go_mod_tidy_hack.go
deleted file mode 100644
index e163975cd..000000000
--- a/vendor/github.com/Azure/go-autorest/tracing/go_mod_tidy_hack.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// +build modhack
-
-package tracing
-
-// Copyright 2017 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT 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 file, and the github.com/Azure/go-autorest import, won't actually become part of
-// the resultant binary.
-
-// Necessary for safely adding multi-module repo.
-// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository
-import _ "github.com/Azure/go-autorest"
diff --git a/vendor/github.com/Azure/go-autorest/tracing/tracing.go b/vendor/github.com/Azure/go-autorest/tracing/tracing.go
deleted file mode 100644
index 0e7a6e962..000000000
--- a/vendor/github.com/Azure/go-autorest/tracing/tracing.go
+++ /dev/null
@@ -1,67 +0,0 @@
-package tracing
-
-// Copyright 2018 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-import (
- "context"
- "net/http"
-)
-
-// Tracer represents an HTTP tracing facility.
-type Tracer interface {
- NewTransport(base *http.Transport) http.RoundTripper
- StartSpan(ctx context.Context, name string) context.Context
- EndSpan(ctx context.Context, httpStatusCode int, err error)
-}
-
-var (
- tracer Tracer
-)
-
-// Register will register the provided Tracer. Pass nil to unregister a Tracer.
-func Register(t Tracer) {
- tracer = t
-}
-
-// IsEnabled returns true if a Tracer has been registered.
-func IsEnabled() bool {
- return tracer != nil
-}
-
-// NewTransport creates a new instrumenting http.RoundTripper for the
-// registered Tracer. If no Tracer has been registered it returns nil.
-func NewTransport(base *http.Transport) http.RoundTripper {
- if tracer != nil {
- return tracer.NewTransport(base)
- }
- return nil
-}
-
-// StartSpan starts a trace span with the specified name, associating it with the
-// provided context. Has no effect if a Tracer has not been registered.
-func StartSpan(ctx context.Context, name string) context.Context {
- if tracer != nil {
- return tracer.StartSpan(ctx, name)
- }
- return ctx
-}
-
-// EndSpan ends a previously started span stored in the context.
-// Has no effect if a Tracer has not been registered.
-func EndSpan(ctx context.Context, httpStatusCode int, err error) {
- if tracer != nil {
- tracer.EndSpan(ctx, httpStatusCode, err)
- }
-}
diff --git a/vendor/github.com/PuerkitoBio/purell/.gitignore b/vendor/github.com/PuerkitoBio/purell/.gitignore
deleted file mode 100644
index 748e4c807..000000000
--- a/vendor/github.com/PuerkitoBio/purell/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*.sublime-*
-.DS_Store
-*.swp
-*.swo
-tags
diff --git a/vendor/github.com/PuerkitoBio/purell/.travis.yml b/vendor/github.com/PuerkitoBio/purell/.travis.yml
deleted file mode 100644
index cf31e6af6..000000000
--- a/vendor/github.com/PuerkitoBio/purell/.travis.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-language: go
-
-go:
- - 1.4.x
- - 1.5.x
- - 1.6.x
- - 1.7.x
- - 1.8.x
- - 1.9.x
- - "1.10.x"
- - "1.11.x"
- - tip
diff --git a/vendor/github.com/PuerkitoBio/purell/LICENSE b/vendor/github.com/PuerkitoBio/purell/LICENSE
deleted file mode 100644
index 4b9986dea..000000000
--- a/vendor/github.com/PuerkitoBio/purell/LICENSE
+++ /dev/null
@@ -1,12 +0,0 @@
-Copyright (c) 2012, Martin Angers
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
-* Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/PuerkitoBio/purell/README.md b/vendor/github.com/PuerkitoBio/purell/README.md
deleted file mode 100644
index 07de0c498..000000000
--- a/vendor/github.com/PuerkitoBio/purell/README.md
+++ /dev/null
@@ -1,188 +0,0 @@
-# Purell
-
-Purell is a tiny Go library to normalize URLs. It returns a pure URL. Pure-ell. Sanitizer and all. Yeah, I know...
-
-Based on the [wikipedia paper][wiki] and the [RFC 3986 document][rfc].
-
-[](http://travis-ci.org/PuerkitoBio/purell)
-
-## Install
-
-`go get github.com/PuerkitoBio/purell`
-
-## Changelog
-
-* **v1.1.1** : Fix failing test due to Go1.12 changes (thanks to @ianlancetaylor).
-* **2016-11-14 (v1.1.0)** : IDN: Conform to RFC 5895: Fold character width (thanks to @beeker1121).
-* **2016-07-27 (v1.0.0)** : Normalize IDN to ASCII (thanks to @zenovich).
-* **2015-02-08** : Add fix for relative paths issue ([PR #5][pr5]) and add fix for unnecessary encoding of reserved characters ([see issue #7][iss7]).
-* **v0.2.0** : Add benchmarks, Attempt IDN support.
-* **v0.1.0** : Initial release.
-
-## Examples
-
-From `example_test.go` (note that in your code, you would import "github.com/PuerkitoBio/purell", and would prefix references to its methods and constants with "purell."):
-
-```go
-package purell
-
-import (
- "fmt"
- "net/url"
-)
-
-func ExampleNormalizeURLString() {
- if normalized, err := NormalizeURLString("hTTp://someWEBsite.com:80/Amazing%3f/url/",
- FlagLowercaseScheme|FlagLowercaseHost|FlagUppercaseEscapes); err != nil {
- panic(err)
- } else {
- fmt.Print(normalized)
- }
- // Output: http://somewebsite.com:80/Amazing%3F/url/
-}
-
-func ExampleMustNormalizeURLString() {
- normalized := MustNormalizeURLString("hTTpS://someWEBsite.com:443/Amazing%fa/url/",
- FlagsUnsafeGreedy)
- fmt.Print(normalized)
-
- // Output: http://somewebsite.com/Amazing%FA/url
-}
-
-func ExampleNormalizeURL() {
- if u, err := url.Parse("Http://SomeUrl.com:8080/a/b/.././c///g?c=3&a=1&b=9&c=0#target"); err != nil {
- panic(err)
- } else {
- normalized := NormalizeURL(u, FlagsUsuallySafeGreedy|FlagRemoveDuplicateSlashes|FlagRemoveFragment)
- fmt.Print(normalized)
- }
-
- // Output: http://someurl.com:8080/a/c/g?c=3&a=1&b=9&c=0
-}
-```
-
-## API
-
-As seen in the examples above, purell offers three methods, `NormalizeURLString(string, NormalizationFlags) (string, error)`, `MustNormalizeURLString(string, NormalizationFlags) (string)` and `NormalizeURL(*url.URL, NormalizationFlags) (string)`. They all normalize the provided URL based on the specified flags. Here are the available flags:
-
-```go
-const (
- // Safe normalizations
- FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1
- FlagLowercaseHost // http://HOST -> http://host
- FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF
- FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA
- FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$
- FlagRemoveDefaultPort // http://host:80 -> http://host
- FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path
-
- // Usually safe normalizations
- FlagRemoveTrailingSlash // http://host/path/ -> http://host/path
- FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags)
- FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c
-
- // Unsafe normalizations
- FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/
- FlagRemoveFragment // http://host/path#fragment -> http://host/path
- FlagForceHTTP // https://host -> http://host
- FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b
- FlagRemoveWWW // http://www.host/ -> http://host/
- FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags)
- FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3
-
- // Normalizations not in the wikipedia article, required to cover tests cases
- // submitted by jehiah
- FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147
- FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147
- FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147
- FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path
- FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path
-
- // Convenience set of safe normalizations
- FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator
-
- // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags,
- // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix".
-
- // Convenience set of usually safe normalizations (includes FlagsSafe)
- FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments
- FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments
-
- // Convenience set of unsafe normalizations (includes FlagsUsuallySafe)
- FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery
- FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery
-
- // Convenience set of all available flags
- FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator
- FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator
-)
-```
-
-For convenience, the set of flags `FlagsSafe`, `FlagsUsuallySafe[Greedy|NonGreedy]`, `FlagsUnsafe[Greedy|NonGreedy]` and `FlagsAll[Greedy|NonGreedy]` are provided for the similarly grouped normalizations on [wikipedia's URL normalization page][wiki]. You can add (using the bitwise OR `|` operator) or remove (using the bitwise AND NOT `&^` operator) individual flags from the sets if required, to build your own custom set.
-
-The [full godoc reference is available on gopkgdoc][godoc].
-
-Some things to note:
-
-* `FlagDecodeUnnecessaryEscapes`, `FlagEncodeNecessaryEscapes`, `FlagUppercaseEscapes` and `FlagRemoveEmptyQuerySeparator` are always implicitly set, because internally, the URL string is parsed as an URL object, which automatically decodes unnecessary escapes, uppercases and encodes necessary ones, and removes empty query separators (an unnecessary `?` at the end of the url). So this operation cannot **not** be done. For this reason, `FlagRemoveEmptyQuerySeparator` (as well as the other three) has been included in the `FlagsSafe` convenience set, instead of `FlagsUnsafe`, where Wikipedia puts it.
-
-* The `FlagDecodeUnnecessaryEscapes` decodes the following escapes (*from -> to*):
- - %24 -> $
- - %26 -> &
- - %2B-%3B -> +,-./0123456789:;
- - %3D -> =
- - %40-%5A -> @ABCDEFGHIJKLMNOPQRSTUVWXYZ
- - %5F -> _
- - %61-%7A -> abcdefghijklmnopqrstuvwxyz
- - %7E -> ~
-
-
-* When the `NormalizeURL` function is used (passing an URL object), this source URL object is modified (that is, after the call, the URL object will be modified to reflect the normalization).
-
-* The *replace IP with domain name* normalization (`http://208.77.188.166/ → http://www.example.com/`) is obviously not possible for a library without making some network requests. This is not implemented in purell.
-
-* The *remove unused query string parameters* and *remove default query parameters* are also not implemented, since this is a very case-specific normalization, and it is quite trivial to do with an URL object.
-
-### Safe vs Usually Safe vs Unsafe
-
-Purell allows you to control the level of risk you take while normalizing an URL. You can aggressively normalize, play it totally safe, or anything in between.
-
-Consider the following URL:
-
-`HTTPS://www.RooT.com/toto/t%45%1f///a/./b/../c/?z=3&w=2&a=4&w=1#invalid`
-
-Normalizing with the `FlagsSafe` gives:
-
-`https://www.root.com/toto/tE%1F///a/./b/../c/?z=3&w=2&a=4&w=1#invalid`
-
-With the `FlagsUsuallySafeGreedy`:
-
-`https://www.root.com/toto/tE%1F///a/c?z=3&w=2&a=4&w=1#invalid`
-
-And with `FlagsUnsafeGreedy`:
-
-`http://root.com/toto/tE%1F/a/c?a=4&w=1&w=2&z=3`
-
-## TODOs
-
-* Add a class/default instance to allow specifying custom directory index names? At the moment, removing directory index removes `(^|/)((?:default|index)\.\w{1,4})$`.
-
-## Thanks / Contributions
-
-@rogpeppe
-@jehiah
-@opennota
-@pchristopher1275
-@zenovich
-@beeker1121
-
-## License
-
-The [BSD 3-Clause license][bsd].
-
-[bsd]: http://opensource.org/licenses/BSD-3-Clause
-[wiki]: http://en.wikipedia.org/wiki/URL_normalization
-[rfc]: http://tools.ietf.org/html/rfc3986#section-6
-[godoc]: http://go.pkgdoc.org/github.com/PuerkitoBio/purell
-[pr5]: https://github.com/PuerkitoBio/purell/pull/5
-[iss7]: https://github.com/PuerkitoBio/purell/issues/7
diff --git a/vendor/github.com/PuerkitoBio/purell/purell.go b/vendor/github.com/PuerkitoBio/purell/purell.go
deleted file mode 100644
index 6d0fc190a..000000000
--- a/vendor/github.com/PuerkitoBio/purell/purell.go
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
-Package purell offers URL normalization as described on the wikipedia page:
-http://en.wikipedia.org/wiki/URL_normalization
-*/
-package purell
-
-import (
- "bytes"
- "fmt"
- "net/url"
- "regexp"
- "sort"
- "strconv"
- "strings"
-
- "github.com/PuerkitoBio/urlesc"
- "golang.org/x/net/idna"
- "golang.org/x/text/unicode/norm"
- "golang.org/x/text/width"
-)
-
-// A set of normalization flags determines how a URL will
-// be normalized.
-type NormalizationFlags uint
-
-const (
- // Safe normalizations
- FlagLowercaseScheme NormalizationFlags = 1 << iota // HTTP://host -> http://host, applied by default in Go1.1
- FlagLowercaseHost // http://HOST -> http://host
- FlagUppercaseEscapes // http://host/t%ef -> http://host/t%EF
- FlagDecodeUnnecessaryEscapes // http://host/t%41 -> http://host/tA
- FlagEncodeNecessaryEscapes // http://host/!"#$ -> http://host/%21%22#$
- FlagRemoveDefaultPort // http://host:80 -> http://host
- FlagRemoveEmptyQuerySeparator // http://host/path? -> http://host/path
-
- // Usually safe normalizations
- FlagRemoveTrailingSlash // http://host/path/ -> http://host/path
- FlagAddTrailingSlash // http://host/path -> http://host/path/ (should choose only one of these add/remove trailing slash flags)
- FlagRemoveDotSegments // http://host/path/./a/b/../c -> http://host/path/a/c
-
- // Unsafe normalizations
- FlagRemoveDirectoryIndex // http://host/path/index.html -> http://host/path/
- FlagRemoveFragment // http://host/path#fragment -> http://host/path
- FlagForceHTTP // https://host -> http://host
- FlagRemoveDuplicateSlashes // http://host/path//a///b -> http://host/path/a/b
- FlagRemoveWWW // http://www.host/ -> http://host/
- FlagAddWWW // http://host/ -> http://www.host/ (should choose only one of these add/remove WWW flags)
- FlagSortQuery // http://host/path?c=3&b=2&a=1&b=1 -> http://host/path?a=1&b=1&b=2&c=3
-
- // Normalizations not in the wikipedia article, required to cover tests cases
- // submitted by jehiah
- FlagDecodeDWORDHost // http://1113982867 -> http://66.102.7.147
- FlagDecodeOctalHost // http://0102.0146.07.0223 -> http://66.102.7.147
- FlagDecodeHexHost // http://0x42660793 -> http://66.102.7.147
- FlagRemoveUnnecessaryHostDots // http://.host../path -> http://host/path
- FlagRemoveEmptyPortSeparator // http://host:/path -> http://host/path
-
- // Convenience set of safe normalizations
- FlagsSafe NormalizationFlags = FlagLowercaseHost | FlagLowercaseScheme | FlagUppercaseEscapes | FlagDecodeUnnecessaryEscapes | FlagEncodeNecessaryEscapes | FlagRemoveDefaultPort | FlagRemoveEmptyQuerySeparator
-
- // For convenience sets, "greedy" uses the "remove trailing slash" and "remove www. prefix" flags,
- // while "non-greedy" uses the "add (or keep) the trailing slash" and "add www. prefix".
-
- // Convenience set of usually safe normalizations (includes FlagsSafe)
- FlagsUsuallySafeGreedy NormalizationFlags = FlagsSafe | FlagRemoveTrailingSlash | FlagRemoveDotSegments
- FlagsUsuallySafeNonGreedy NormalizationFlags = FlagsSafe | FlagAddTrailingSlash | FlagRemoveDotSegments
-
- // Convenience set of unsafe normalizations (includes FlagsUsuallySafe)
- FlagsUnsafeGreedy NormalizationFlags = FlagsUsuallySafeGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagRemoveWWW | FlagSortQuery
- FlagsUnsafeNonGreedy NormalizationFlags = FlagsUsuallySafeNonGreedy | FlagRemoveDirectoryIndex | FlagRemoveFragment | FlagForceHTTP | FlagRemoveDuplicateSlashes | FlagAddWWW | FlagSortQuery
-
- // Convenience set of all available flags
- FlagsAllGreedy = FlagsUnsafeGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator
- FlagsAllNonGreedy = FlagsUnsafeNonGreedy | FlagDecodeDWORDHost | FlagDecodeOctalHost | FlagDecodeHexHost | FlagRemoveUnnecessaryHostDots | FlagRemoveEmptyPortSeparator
-)
-
-const (
- defaultHttpPort = ":80"
- defaultHttpsPort = ":443"
-)
-
-// Regular expressions used by the normalizations
-var rxPort = regexp.MustCompile(`(:\d+)/?$`)
-var rxDirIndex = regexp.MustCompile(`(^|/)((?:default|index)\.\w{1,4})$`)
-var rxDupSlashes = regexp.MustCompile(`/{2,}`)
-var rxDWORDHost = regexp.MustCompile(`^(\d+)((?:\.+)?(?:\:\d*)?)$`)
-var rxOctalHost = regexp.MustCompile(`^(0\d*)\.(0\d*)\.(0\d*)\.(0\d*)((?:\.+)?(?:\:\d*)?)$`)
-var rxHexHost = regexp.MustCompile(`^0x([0-9A-Fa-f]+)((?:\.+)?(?:\:\d*)?)$`)
-var rxHostDots = regexp.MustCompile(`^(.+?)(:\d+)?$`)
-var rxEmptyPort = regexp.MustCompile(`:+$`)
-
-// Map of flags to implementation function.
-// FlagDecodeUnnecessaryEscapes has no action, since it is done automatically
-// by parsing the string as an URL. Same for FlagUppercaseEscapes and FlagRemoveEmptyQuerySeparator.
-
-// Since maps have undefined traversing order, make a slice of ordered keys
-var flagsOrder = []NormalizationFlags{
- FlagLowercaseScheme,
- FlagLowercaseHost,
- FlagRemoveDefaultPort,
- FlagRemoveDirectoryIndex,
- FlagRemoveDotSegments,
- FlagRemoveFragment,
- FlagForceHTTP, // Must be after remove default port (because https=443/http=80)
- FlagRemoveDuplicateSlashes,
- FlagRemoveWWW,
- FlagAddWWW,
- FlagSortQuery,
- FlagDecodeDWORDHost,
- FlagDecodeOctalHost,
- FlagDecodeHexHost,
- FlagRemoveUnnecessaryHostDots,
- FlagRemoveEmptyPortSeparator,
- FlagRemoveTrailingSlash, // These two (add/remove trailing slash) must be last
- FlagAddTrailingSlash,
-}
-
-// ... and then the map, where order is unimportant
-var flags = map[NormalizationFlags]func(*url.URL){
- FlagLowercaseScheme: lowercaseScheme,
- FlagLowercaseHost: lowercaseHost,
- FlagRemoveDefaultPort: removeDefaultPort,
- FlagRemoveDirectoryIndex: removeDirectoryIndex,
- FlagRemoveDotSegments: removeDotSegments,
- FlagRemoveFragment: removeFragment,
- FlagForceHTTP: forceHTTP,
- FlagRemoveDuplicateSlashes: removeDuplicateSlashes,
- FlagRemoveWWW: removeWWW,
- FlagAddWWW: addWWW,
- FlagSortQuery: sortQuery,
- FlagDecodeDWORDHost: decodeDWORDHost,
- FlagDecodeOctalHost: decodeOctalHost,
- FlagDecodeHexHost: decodeHexHost,
- FlagRemoveUnnecessaryHostDots: removeUnncessaryHostDots,
- FlagRemoveEmptyPortSeparator: removeEmptyPortSeparator,
- FlagRemoveTrailingSlash: removeTrailingSlash,
- FlagAddTrailingSlash: addTrailingSlash,
-}
-
-// MustNormalizeURLString returns the normalized string, and panics if an error occurs.
-// It takes an URL string as input, as well as the normalization flags.
-func MustNormalizeURLString(u string, f NormalizationFlags) string {
- result, e := NormalizeURLString(u, f)
- if e != nil {
- panic(e)
- }
- return result
-}
-
-// NormalizeURLString returns the normalized string, or an error if it can't be parsed into an URL object.
-// It takes an URL string as input, as well as the normalization flags.
-func NormalizeURLString(u string, f NormalizationFlags) (string, error) {
- parsed, err := url.Parse(u)
- if err != nil {
- return "", err
- }
-
- if f&FlagLowercaseHost == FlagLowercaseHost {
- parsed.Host = strings.ToLower(parsed.Host)
- }
-
- // The idna package doesn't fully conform to RFC 5895
- // (https://tools.ietf.org/html/rfc5895), so we do it here.
- // Taken from Go 1.8 cycle source, courtesy of bradfitz.
- // TODO: Remove when (if?) idna package conforms to RFC 5895.
- parsed.Host = width.Fold.String(parsed.Host)
- parsed.Host = norm.NFC.String(parsed.Host)
- if parsed.Host, err = idna.ToASCII(parsed.Host); err != nil {
- return "", err
- }
-
- return NormalizeURL(parsed, f), nil
-}
-
-// NormalizeURL returns the normalized string.
-// It takes a parsed URL object as input, as well as the normalization flags.
-func NormalizeURL(u *url.URL, f NormalizationFlags) string {
- for _, k := range flagsOrder {
- if f&k == k {
- flags[k](u)
- }
- }
- return urlesc.Escape(u)
-}
-
-func lowercaseScheme(u *url.URL) {
- if len(u.Scheme) > 0 {
- u.Scheme = strings.ToLower(u.Scheme)
- }
-}
-
-func lowercaseHost(u *url.URL) {
- if len(u.Host) > 0 {
- u.Host = strings.ToLower(u.Host)
- }
-}
-
-func removeDefaultPort(u *url.URL) {
- if len(u.Host) > 0 {
- scheme := strings.ToLower(u.Scheme)
- u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string {
- if (scheme == "http" && val == defaultHttpPort) || (scheme == "https" && val == defaultHttpsPort) {
- return ""
- }
- return val
- })
- }
-}
-
-func removeTrailingSlash(u *url.URL) {
- if l := len(u.Path); l > 0 {
- if strings.HasSuffix(u.Path, "/") {
- u.Path = u.Path[:l-1]
- }
- } else if l = len(u.Host); l > 0 {
- if strings.HasSuffix(u.Host, "/") {
- u.Host = u.Host[:l-1]
- }
- }
-}
-
-func addTrailingSlash(u *url.URL) {
- if l := len(u.Path); l > 0 {
- if !strings.HasSuffix(u.Path, "/") {
- u.Path += "/"
- }
- } else if l = len(u.Host); l > 0 {
- if !strings.HasSuffix(u.Host, "/") {
- u.Host += "/"
- }
- }
-}
-
-func removeDotSegments(u *url.URL) {
- if len(u.Path) > 0 {
- var dotFree []string
- var lastIsDot bool
-
- sections := strings.Split(u.Path, "/")
- for _, s := range sections {
- if s == ".." {
- if len(dotFree) > 0 {
- dotFree = dotFree[:len(dotFree)-1]
- }
- } else if s != "." {
- dotFree = append(dotFree, s)
- }
- lastIsDot = (s == "." || s == "..")
- }
- // Special case if host does not end with / and new path does not begin with /
- u.Path = strings.Join(dotFree, "/")
- if u.Host != "" && !strings.HasSuffix(u.Host, "/") && !strings.HasPrefix(u.Path, "/") {
- u.Path = "/" + u.Path
- }
- // Special case if the last segment was a dot, make sure the path ends with a slash
- if lastIsDot && !strings.HasSuffix(u.Path, "/") {
- u.Path += "/"
- }
- }
-}
-
-func removeDirectoryIndex(u *url.URL) {
- if len(u.Path) > 0 {
- u.Path = rxDirIndex.ReplaceAllString(u.Path, "$1")
- }
-}
-
-func removeFragment(u *url.URL) {
- u.Fragment = ""
-}
-
-func forceHTTP(u *url.URL) {
- if strings.ToLower(u.Scheme) == "https" {
- u.Scheme = "http"
- }
-}
-
-func removeDuplicateSlashes(u *url.URL) {
- if len(u.Path) > 0 {
- u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/")
- }
-}
-
-func removeWWW(u *url.URL) {
- if len(u.Host) > 0 && strings.HasPrefix(strings.ToLower(u.Host), "www.") {
- u.Host = u.Host[4:]
- }
-}
-
-func addWWW(u *url.URL) {
- if len(u.Host) > 0 && !strings.HasPrefix(strings.ToLower(u.Host), "www.") {
- u.Host = "www." + u.Host
- }
-}
-
-func sortQuery(u *url.URL) {
- q := u.Query()
-
- if len(q) > 0 {
- arKeys := make([]string, len(q))
- i := 0
- for k := range q {
- arKeys[i] = k
- i++
- }
- sort.Strings(arKeys)
- buf := new(bytes.Buffer)
- for _, k := range arKeys {
- sort.Strings(q[k])
- for _, v := range q[k] {
- if buf.Len() > 0 {
- buf.WriteRune('&')
- }
- buf.WriteString(fmt.Sprintf("%s=%s", k, urlesc.QueryEscape(v)))
- }
- }
-
- // Rebuild the raw query string
- u.RawQuery = buf.String()
- }
-}
-
-func decodeDWORDHost(u *url.URL) {
- if len(u.Host) > 0 {
- if matches := rxDWORDHost.FindStringSubmatch(u.Host); len(matches) > 2 {
- var parts [4]int64
-
- dword, _ := strconv.ParseInt(matches[1], 10, 0)
- for i, shift := range []uint{24, 16, 8, 0} {
- parts[i] = dword >> shift & 0xFF
- }
- u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[2])
- }
- }
-}
-
-func decodeOctalHost(u *url.URL) {
- if len(u.Host) > 0 {
- if matches := rxOctalHost.FindStringSubmatch(u.Host); len(matches) > 5 {
- var parts [4]int64
-
- for i := 1; i <= 4; i++ {
- parts[i-1], _ = strconv.ParseInt(matches[i], 8, 0)
- }
- u.Host = fmt.Sprintf("%d.%d.%d.%d%s", parts[0], parts[1], parts[2], parts[3], matches[5])
- }
- }
-}
-
-func decodeHexHost(u *url.URL) {
- if len(u.Host) > 0 {
- if matches := rxHexHost.FindStringSubmatch(u.Host); len(matches) > 2 {
- // Conversion is safe because of regex validation
- parsed, _ := strconv.ParseInt(matches[1], 16, 0)
- // Set host as DWORD (base 10) encoded host
- u.Host = fmt.Sprintf("%d%s", parsed, matches[2])
- // The rest is the same as decoding a DWORD host
- decodeDWORDHost(u)
- }
- }
-}
-
-func removeUnncessaryHostDots(u *url.URL) {
- if len(u.Host) > 0 {
- if matches := rxHostDots.FindStringSubmatch(u.Host); len(matches) > 1 {
- // Trim the leading and trailing dots
- u.Host = strings.Trim(matches[1], ".")
- if len(matches) > 2 {
- u.Host += matches[2]
- }
- }
- }
-}
-
-func removeEmptyPortSeparator(u *url.URL) {
- if len(u.Host) > 0 {
- u.Host = rxEmptyPort.ReplaceAllString(u.Host, "")
- }
-}
diff --git a/vendor/github.com/PuerkitoBio/urlesc/.travis.yml b/vendor/github.com/PuerkitoBio/urlesc/.travis.yml
deleted file mode 100644
index ba6b225f9..000000000
--- a/vendor/github.com/PuerkitoBio/urlesc/.travis.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-language: go
-
-go:
- - 1.4.x
- - 1.5.x
- - 1.6.x
- - 1.7.x
- - 1.8.x
- - tip
-
-install:
- - go build .
-
-script:
- - go test -v
diff --git a/vendor/github.com/PuerkitoBio/urlesc/README.md b/vendor/github.com/PuerkitoBio/urlesc/README.md
deleted file mode 100644
index 57aff0a53..000000000
--- a/vendor/github.com/PuerkitoBio/urlesc/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-urlesc [](https://travis-ci.org/PuerkitoBio/urlesc) [](http://godoc.org/github.com/PuerkitoBio/urlesc)
-======
-
-Package urlesc implements query escaping as per RFC 3986.
-
-It contains some parts of the net/url package, modified so as to allow
-some reserved characters incorrectly escaped by net/url (see [issue 5684](https://github.com/golang/go/issues/5684)).
-
-## Install
-
- go get github.com/PuerkitoBio/urlesc
-
-## License
-
-Go license (BSD-3-Clause)
-
diff --git a/vendor/github.com/PuerkitoBio/urlesc/urlesc.go b/vendor/github.com/PuerkitoBio/urlesc/urlesc.go
deleted file mode 100644
index 1b8462459..000000000
--- a/vendor/github.com/PuerkitoBio/urlesc/urlesc.go
+++ /dev/null
@@ -1,180 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package urlesc implements query escaping as per RFC 3986.
-// It contains some parts of the net/url package, modified so as to allow
-// some reserved characters incorrectly escaped by net/url.
-// See https://github.com/golang/go/issues/5684
-package urlesc
-
-import (
- "bytes"
- "net/url"
- "strings"
-)
-
-type encoding int
-
-const (
- encodePath encoding = 1 + iota
- encodeUserPassword
- encodeQueryComponent
- encodeFragment
-)
-
-// Return true if the specified character should be escaped when
-// appearing in a URL string, according to RFC 3986.
-func shouldEscape(c byte, mode encoding) bool {
- // §2.3 Unreserved characters (alphanum)
- if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' {
- return false
- }
-
- switch c {
- case '-', '.', '_', '~': // §2.3 Unreserved characters (mark)
- return false
-
- // §2.2 Reserved characters (reserved)
- case ':', '/', '?', '#', '[', ']', '@', // gen-delims
- '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // sub-delims
- // Different sections of the URL allow a few of
- // the reserved characters to appear unescaped.
- switch mode {
- case encodePath: // §3.3
- // The RFC allows sub-delims and : @.
- // '/', '[' and ']' can be used to assign meaning to individual path
- // segments. This package only manipulates the path as a whole,
- // so we allow those as well. That leaves only ? and # to escape.
- return c == '?' || c == '#'
-
- case encodeUserPassword: // §3.2.1
- // The RFC allows : and sub-delims in
- // userinfo. The parsing of userinfo treats ':' as special so we must escape
- // all the gen-delims.
- return c == ':' || c == '/' || c == '?' || c == '#' || c == '[' || c == ']' || c == '@'
-
- case encodeQueryComponent: // §3.4
- // The RFC allows / and ?.
- return c != '/' && c != '?'
-
- case encodeFragment: // §4.1
- // The RFC text is silent but the grammar allows
- // everything, so escape nothing but #
- return c == '#'
- }
- }
-
- // Everything else must be escaped.
- return true
-}
-
-// QueryEscape escapes the string so it can be safely placed
-// inside a URL query.
-func QueryEscape(s string) string {
- return escape(s, encodeQueryComponent)
-}
-
-func escape(s string, mode encoding) string {
- spaceCount, hexCount := 0, 0
- for i := 0; i < len(s); i++ {
- c := s[i]
- if shouldEscape(c, mode) {
- if c == ' ' && mode == encodeQueryComponent {
- spaceCount++
- } else {
- hexCount++
- }
- }
- }
-
- if spaceCount == 0 && hexCount == 0 {
- return s
- }
-
- t := make([]byte, len(s)+2*hexCount)
- j := 0
- for i := 0; i < len(s); i++ {
- switch c := s[i]; {
- case c == ' ' && mode == encodeQueryComponent:
- t[j] = '+'
- j++
- case shouldEscape(c, mode):
- t[j] = '%'
- t[j+1] = "0123456789ABCDEF"[c>>4]
- t[j+2] = "0123456789ABCDEF"[c&15]
- j += 3
- default:
- t[j] = s[i]
- j++
- }
- }
- return string(t)
-}
-
-var uiReplacer = strings.NewReplacer(
- "%21", "!",
- "%27", "'",
- "%28", "(",
- "%29", ")",
- "%2A", "*",
-)
-
-// unescapeUserinfo unescapes some characters that need not to be escaped as per RFC3986.
-func unescapeUserinfo(s string) string {
- return uiReplacer.Replace(s)
-}
-
-// Escape reassembles the URL into a valid URL string.
-// The general form of the result is one of:
-//
-// scheme:opaque
-// scheme://userinfo@host/path?query#fragment
-//
-// If u.Opaque is non-empty, String uses the first form;
-// otherwise it uses the second form.
-//
-// In the second form, the following rules apply:
-// - if u.Scheme is empty, scheme: is omitted.
-// - if u.User is nil, userinfo@ is omitted.
-// - if u.Host is empty, host/ is omitted.
-// - if u.Scheme and u.Host are empty and u.User is nil,
-// the entire scheme://userinfo@host/ is omitted.
-// - if u.Host is non-empty and u.Path begins with a /,
-// the form host/path does not add its own /.
-// - if u.RawQuery is empty, ?query is omitted.
-// - if u.Fragment is empty, #fragment is omitted.
-func Escape(u *url.URL) string {
- var buf bytes.Buffer
- if u.Scheme != "" {
- buf.WriteString(u.Scheme)
- buf.WriteByte(':')
- }
- if u.Opaque != "" {
- buf.WriteString(u.Opaque)
- } else {
- if u.Scheme != "" || u.Host != "" || u.User != nil {
- buf.WriteString("//")
- if ui := u.User; ui != nil {
- buf.WriteString(unescapeUserinfo(ui.String()))
- buf.WriteByte('@')
- }
- if h := u.Host; h != "" {
- buf.WriteString(h)
- }
- }
- if u.Path != "" && u.Path[0] != '/' && u.Host != "" {
- buf.WriteByte('/')
- }
- buf.WriteString(escape(u.Path, encodePath))
- }
- if u.RawQuery != "" {
- buf.WriteByte('?')
- buf.WriteString(u.RawQuery)
- }
- if u.Fragment != "" {
- buf.WriteByte('#')
- buf.WriteString(escape(u.Fragment, encodeFragment))
- }
- return buf.String()
-}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/LICENSE b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/LICENSE
new file mode 100644
index 000000000..52cf18e42
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/LICENSE
@@ -0,0 +1,26 @@
+Copyright 2021 The ANTLR Project
+
+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/antlr/antlr4/runtime/Go/antlr/atn.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn.go
new file mode 100644
index 000000000..a4e2079e6
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn.go
@@ -0,0 +1,159 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import "sync"
+
+var ATNInvalidAltNumber int
+
+type ATN struct {
+ // DecisionToState is the decision points for all rules, subrules, optional
+ // blocks, ()+, ()*, etc. Used to build DFA predictors for them.
+ DecisionToState []DecisionState
+
+ // grammarType is the ATN type and is used for deserializing ATNs from strings.
+ grammarType int
+
+ // lexerActions is referenced by action transitions in the ATN for lexer ATNs.
+ lexerActions []LexerAction
+
+ // maxTokenType is the maximum value for any symbol recognized by a transition in the ATN.
+ maxTokenType int
+
+ modeNameToStartState map[string]*TokensStartState
+
+ modeToStartState []*TokensStartState
+
+ // ruleToStartState maps from rule index to starting state number.
+ ruleToStartState []*RuleStartState
+
+ // ruleToStopState maps from rule index to stop state number.
+ ruleToStopState []*RuleStopState
+
+ // ruleToTokenType maps the rule index to the resulting token type for lexer
+ // ATNs. For parser ATNs, it maps the rule index to the generated bypass token
+ // type if ATNDeserializationOptions.isGenerateRuleBypassTransitions was
+ // specified, and otherwise is nil.
+ ruleToTokenType []int
+
+ states []ATNState
+
+ mu sync.Mutex
+ stateMu sync.RWMutex
+ edgeMu sync.RWMutex
+}
+
+func NewATN(grammarType int, maxTokenType int) *ATN {
+ return &ATN{
+ grammarType: grammarType,
+ maxTokenType: maxTokenType,
+ modeNameToStartState: make(map[string]*TokensStartState),
+ }
+}
+
+// NextTokensInContext computes the set of valid tokens that can occur starting
+// in state s. If ctx is nil, the set of tokens will not include what can follow
+// the rule surrounding s. In other words, the set will be restricted to tokens
+// reachable staying within the rule of s.
+func (a *ATN) NextTokensInContext(s ATNState, ctx RuleContext) *IntervalSet {
+ return NewLL1Analyzer(a).Look(s, nil, ctx)
+}
+
+// NextTokensNoContext computes the set of valid tokens that can occur starting
+// in s and staying in same rule. Token.EPSILON is in set if we reach end of
+// rule.
+func (a *ATN) NextTokensNoContext(s ATNState) *IntervalSet {
+ a.mu.Lock()
+ defer a.mu.Unlock()
+ iset := s.GetNextTokenWithinRule()
+ if iset == nil {
+ iset = a.NextTokensInContext(s, nil)
+ iset.readOnly = true
+ s.SetNextTokenWithinRule(iset)
+ }
+ return iset
+}
+
+func (a *ATN) NextTokens(s ATNState, ctx RuleContext) *IntervalSet {
+ if ctx == nil {
+ return a.NextTokensNoContext(s)
+ }
+
+ return a.NextTokensInContext(s, ctx)
+}
+
+func (a *ATN) addState(state ATNState) {
+ if state != nil {
+ state.SetATN(a)
+ state.SetStateNumber(len(a.states))
+ }
+
+ a.states = append(a.states, state)
+}
+
+func (a *ATN) removeState(state ATNState) {
+ a.states[state.GetStateNumber()] = nil // Just free the memory; don't shift states in the slice
+}
+
+func (a *ATN) defineDecisionState(s DecisionState) int {
+ a.DecisionToState = append(a.DecisionToState, s)
+ s.setDecision(len(a.DecisionToState) - 1)
+
+ return s.getDecision()
+}
+
+func (a *ATN) getDecisionState(decision int) DecisionState {
+ if len(a.DecisionToState) == 0 {
+ return nil
+ }
+
+ return a.DecisionToState[decision]
+}
+
+// getExpectedTokens computes the set of input symbols which could follow ATN
+// state number stateNumber in the specified full parse context ctx and returns
+// the set of potentially valid input symbols which could follow the specified
+// state in the specified context. This method considers the complete parser
+// context, but does not evaluate semantic predicates (i.e. all predicates
+// encountered during the calculation are assumed true). If a path in the ATN
+// exists from the starting state to the RuleStopState of the outermost context
+// without Matching any symbols, Token.EOF is added to the returned set.
+//
+// A nil ctx defaults to ParserRuleContext.EMPTY.
+//
+// It panics if the ATN does not contain state stateNumber.
+func (a *ATN) getExpectedTokens(stateNumber int, ctx RuleContext) *IntervalSet {
+ if stateNumber < 0 || stateNumber >= len(a.states) {
+ panic("Invalid state number.")
+ }
+
+ s := a.states[stateNumber]
+ following := a.NextTokens(s, nil)
+
+ if !following.contains(TokenEpsilon) {
+ return following
+ }
+
+ expected := NewIntervalSet()
+
+ expected.addSet(following)
+ expected.removeOne(TokenEpsilon)
+
+ for ctx != nil && ctx.GetInvokingState() >= 0 && following.contains(TokenEpsilon) {
+ invokingState := a.states[ctx.GetInvokingState()]
+ rt := invokingState.GetTransitions()[0]
+
+ following = a.NextTokens(rt.(*RuleTransition).followState, nil)
+ expected.addSet(following)
+ expected.removeOne(TokenEpsilon)
+ ctx = ctx.GetParent().(RuleContext)
+ }
+
+ if following.contains(TokenEpsilon) {
+ expected.addOne(TokenEOF)
+ }
+
+ return expected
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_config.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_config.go
new file mode 100644
index 000000000..97ba417f7
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_config.go
@@ -0,0 +1,295 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+)
+
+type comparable interface {
+ equals(other interface{}) bool
+}
+
+// ATNConfig is a tuple: (ATN state, predicted alt, syntactic, semantic
+// context). The syntactic context is a graph-structured stack node whose
+// path(s) to the root is the rule invocation(s) chain used to arrive at the
+// state. The semantic context is the tree of semantic predicates encountered
+// before reaching an ATN state.
+type ATNConfig interface {
+ comparable
+
+ hash() int
+
+ GetState() ATNState
+ GetAlt() int
+ GetSemanticContext() SemanticContext
+
+ GetContext() PredictionContext
+ SetContext(PredictionContext)
+
+ GetReachesIntoOuterContext() int
+ SetReachesIntoOuterContext(int)
+
+ String() string
+
+ getPrecedenceFilterSuppressed() bool
+ setPrecedenceFilterSuppressed(bool)
+}
+
+type BaseATNConfig struct {
+ precedenceFilterSuppressed bool
+ state ATNState
+ alt int
+ context PredictionContext
+ semanticContext SemanticContext
+ reachesIntoOuterContext int
+}
+
+func NewBaseATNConfig7(old *BaseATNConfig) *BaseATNConfig { // TODO: Dup
+ return &BaseATNConfig{
+ state: old.state,
+ alt: old.alt,
+ context: old.context,
+ semanticContext: old.semanticContext,
+ reachesIntoOuterContext: old.reachesIntoOuterContext,
+ }
+}
+
+func NewBaseATNConfig6(state ATNState, alt int, context PredictionContext) *BaseATNConfig {
+ return NewBaseATNConfig5(state, alt, context, SemanticContextNone)
+}
+
+func NewBaseATNConfig5(state ATNState, alt int, context PredictionContext, semanticContext SemanticContext) *BaseATNConfig {
+ if semanticContext == nil {
+ panic("semanticContext cannot be nil") // TODO: Necessary?
+ }
+
+ return &BaseATNConfig{state: state, alt: alt, context: context, semanticContext: semanticContext}
+}
+
+func NewBaseATNConfig4(c ATNConfig, state ATNState) *BaseATNConfig {
+ return NewBaseATNConfig(c, state, c.GetContext(), c.GetSemanticContext())
+}
+
+func NewBaseATNConfig3(c ATNConfig, state ATNState, semanticContext SemanticContext) *BaseATNConfig {
+ return NewBaseATNConfig(c, state, c.GetContext(), semanticContext)
+}
+
+func NewBaseATNConfig2(c ATNConfig, semanticContext SemanticContext) *BaseATNConfig {
+ return NewBaseATNConfig(c, c.GetState(), c.GetContext(), semanticContext)
+}
+
+func NewBaseATNConfig1(c ATNConfig, state ATNState, context PredictionContext) *BaseATNConfig {
+ return NewBaseATNConfig(c, state, context, c.GetSemanticContext())
+}
+
+func NewBaseATNConfig(c ATNConfig, state ATNState, context PredictionContext, semanticContext SemanticContext) *BaseATNConfig {
+ if semanticContext == nil {
+ panic("semanticContext cannot be nil")
+ }
+
+ return &BaseATNConfig{
+ state: state,
+ alt: c.GetAlt(),
+ context: context,
+ semanticContext: semanticContext,
+ reachesIntoOuterContext: c.GetReachesIntoOuterContext(),
+ precedenceFilterSuppressed: c.getPrecedenceFilterSuppressed(),
+ }
+}
+
+func (b *BaseATNConfig) getPrecedenceFilterSuppressed() bool {
+ return b.precedenceFilterSuppressed
+}
+
+func (b *BaseATNConfig) setPrecedenceFilterSuppressed(v bool) {
+ b.precedenceFilterSuppressed = v
+}
+
+func (b *BaseATNConfig) GetState() ATNState {
+ return b.state
+}
+
+func (b *BaseATNConfig) GetAlt() int {
+ return b.alt
+}
+
+func (b *BaseATNConfig) SetContext(v PredictionContext) {
+ b.context = v
+}
+func (b *BaseATNConfig) GetContext() PredictionContext {
+ return b.context
+}
+
+func (b *BaseATNConfig) GetSemanticContext() SemanticContext {
+ return b.semanticContext
+}
+
+func (b *BaseATNConfig) GetReachesIntoOuterContext() int {
+ return b.reachesIntoOuterContext
+}
+
+func (b *BaseATNConfig) SetReachesIntoOuterContext(v int) {
+ b.reachesIntoOuterContext = v
+}
+
+// An ATN configuration is equal to another if both have the same state, they
+// predict the same alternative, and syntactic/semantic contexts are the same.
+func (b *BaseATNConfig) equals(o interface{}) bool {
+ if b == o {
+ return true
+ }
+
+ var other, ok = o.(*BaseATNConfig)
+
+ if !ok {
+ return false
+ }
+
+ var equal bool
+
+ if b.context == nil {
+ equal = other.context == nil
+ } else {
+ equal = b.context.equals(other.context)
+ }
+
+ var (
+ nums = b.state.GetStateNumber() == other.state.GetStateNumber()
+ alts = b.alt == other.alt
+ cons = b.semanticContext.equals(other.semanticContext)
+ sups = b.precedenceFilterSuppressed == other.precedenceFilterSuppressed
+ )
+
+ return nums && alts && cons && sups && equal
+}
+
+func (b *BaseATNConfig) hash() int {
+ var c int
+ if b.context != nil {
+ c = b.context.hash()
+ }
+
+ h := murmurInit(7)
+ h = murmurUpdate(h, b.state.GetStateNumber())
+ h = murmurUpdate(h, b.alt)
+ h = murmurUpdate(h, c)
+ h = murmurUpdate(h, b.semanticContext.hash())
+ return murmurFinish(h, 4)
+}
+
+func (b *BaseATNConfig) String() string {
+ var s1, s2, s3 string
+
+ if b.context != nil {
+ s1 = ",[" + fmt.Sprint(b.context) + "]"
+ }
+
+ if b.semanticContext != SemanticContextNone {
+ s2 = "," + fmt.Sprint(b.semanticContext)
+ }
+
+ if b.reachesIntoOuterContext > 0 {
+ s3 = ",up=" + fmt.Sprint(b.reachesIntoOuterContext)
+ }
+
+ return fmt.Sprintf("(%v,%v%v%v%v)", b.state, b.alt, s1, s2, s3)
+}
+
+type LexerATNConfig struct {
+ *BaseATNConfig
+ lexerActionExecutor *LexerActionExecutor
+ passedThroughNonGreedyDecision bool
+}
+
+func NewLexerATNConfig6(state ATNState, alt int, context PredictionContext) *LexerATNConfig {
+ return &LexerATNConfig{BaseATNConfig: NewBaseATNConfig5(state, alt, context, SemanticContextNone)}
+}
+
+func NewLexerATNConfig5(state ATNState, alt int, context PredictionContext, lexerActionExecutor *LexerActionExecutor) *LexerATNConfig {
+ return &LexerATNConfig{
+ BaseATNConfig: NewBaseATNConfig5(state, alt, context, SemanticContextNone),
+ lexerActionExecutor: lexerActionExecutor,
+ }
+}
+
+func NewLexerATNConfig4(c *LexerATNConfig, state ATNState) *LexerATNConfig {
+ return &LexerATNConfig{
+ BaseATNConfig: NewBaseATNConfig(c, state, c.GetContext(), c.GetSemanticContext()),
+ lexerActionExecutor: c.lexerActionExecutor,
+ passedThroughNonGreedyDecision: checkNonGreedyDecision(c, state),
+ }
+}
+
+func NewLexerATNConfig3(c *LexerATNConfig, state ATNState, lexerActionExecutor *LexerActionExecutor) *LexerATNConfig {
+ return &LexerATNConfig{
+ BaseATNConfig: NewBaseATNConfig(c, state, c.GetContext(), c.GetSemanticContext()),
+ lexerActionExecutor: lexerActionExecutor,
+ passedThroughNonGreedyDecision: checkNonGreedyDecision(c, state),
+ }
+}
+
+func NewLexerATNConfig2(c *LexerATNConfig, state ATNState, context PredictionContext) *LexerATNConfig {
+ return &LexerATNConfig{
+ BaseATNConfig: NewBaseATNConfig(c, state, context, c.GetSemanticContext()),
+ lexerActionExecutor: c.lexerActionExecutor,
+ passedThroughNonGreedyDecision: checkNonGreedyDecision(c, state),
+ }
+}
+
+func NewLexerATNConfig1(state ATNState, alt int, context PredictionContext) *LexerATNConfig {
+ return &LexerATNConfig{BaseATNConfig: NewBaseATNConfig5(state, alt, context, SemanticContextNone)}
+}
+
+func (l *LexerATNConfig) hash() int {
+ var f int
+ if l.passedThroughNonGreedyDecision {
+ f = 1
+ } else {
+ f = 0
+ }
+ h := murmurInit(7)
+ h = murmurUpdate(h, l.state.GetStateNumber())
+ h = murmurUpdate(h, l.alt)
+ h = murmurUpdate(h, l.context.hash())
+ h = murmurUpdate(h, l.semanticContext.hash())
+ h = murmurUpdate(h, f)
+ h = murmurUpdate(h, l.lexerActionExecutor.hash())
+ h = murmurFinish(h, 6)
+ return h
+}
+
+func (l *LexerATNConfig) equals(other interface{}) bool {
+ var othert, ok = other.(*LexerATNConfig)
+
+ if l == other {
+ return true
+ } else if !ok {
+ return false
+ } else if l.passedThroughNonGreedyDecision != othert.passedThroughNonGreedyDecision {
+ return false
+ }
+
+ var b bool
+
+ if l.lexerActionExecutor != nil {
+ b = !l.lexerActionExecutor.equals(othert.lexerActionExecutor)
+ } else {
+ b = othert.lexerActionExecutor != nil
+ }
+
+ if b {
+ return false
+ }
+
+ return l.BaseATNConfig.equals(othert.BaseATNConfig)
+}
+
+
+func checkNonGreedyDecision(source *LexerATNConfig, target ATNState) bool {
+ var ds, ok = target.(DecisionState)
+
+ return source.passedThroughNonGreedyDecision || (ok && ds.getNonGreedy())
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_config_set.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_config_set.go
new file mode 100644
index 000000000..49ad4a719
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_config_set.go
@@ -0,0 +1,407 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import "fmt"
+
+type ATNConfigSet interface {
+ hash() int
+ Add(ATNConfig, *DoubleDict) bool
+ AddAll([]ATNConfig) bool
+
+ GetStates() Set
+ GetPredicates() []SemanticContext
+ GetItems() []ATNConfig
+
+ OptimizeConfigs(interpreter *BaseATNSimulator)
+
+ Equals(other interface{}) bool
+
+ Length() int
+ IsEmpty() bool
+ Contains(ATNConfig) bool
+ ContainsFast(ATNConfig) bool
+ Clear()
+ String() string
+
+ HasSemanticContext() bool
+ SetHasSemanticContext(v bool)
+
+ ReadOnly() bool
+ SetReadOnly(bool)
+
+ GetConflictingAlts() *BitSet
+ SetConflictingAlts(*BitSet)
+
+ Alts() *BitSet
+
+ FullContext() bool
+
+ GetUniqueAlt() int
+ SetUniqueAlt(int)
+
+ GetDipsIntoOuterContext() bool
+ SetDipsIntoOuterContext(bool)
+}
+
+// BaseATNConfigSet is a specialized set of ATNConfig that tracks information
+// about its elements and can combine similar configurations using a
+// graph-structured stack.
+type BaseATNConfigSet struct {
+ cachedHash int
+
+ // configLookup is used to determine whether two BaseATNConfigSets are equal. We
+ // need all configurations with the same (s, i, _, semctx) to be equal. A key
+ // effectively doubles the number of objects associated with ATNConfigs. All
+ // keys are hashed by (s, i, _, pi), not including the context. Wiped out when
+ // read-only because a set becomes a DFA state.
+ configLookup Set
+
+ // configs is the added elements.
+ configs []ATNConfig
+
+ // TODO: These fields make me pretty uncomfortable, but it is nice to pack up
+ // info together because it saves recomputation. Can we track conflicts as they
+ // are added to save scanning configs later?
+ conflictingAlts *BitSet
+
+ // dipsIntoOuterContext is used by parsers and lexers. In a lexer, it indicates
+ // we hit a pred while computing a closure operation. Do not make a DFA state
+ // from the BaseATNConfigSet in this case. TODO: How is this used by parsers?
+ dipsIntoOuterContext bool
+
+ // fullCtx is whether it is part of a full context LL prediction. Used to
+ // determine how to merge $. It is a wildcard with SLL, but not for an LL
+ // context merge.
+ fullCtx bool
+
+ // Used in parser and lexer. In lexer, it indicates we hit a pred
+ // while computing a closure operation. Don't make a DFA state from a.
+ hasSemanticContext bool
+
+ // readOnly is whether it is read-only. Do not
+ // allow any code to manipulate the set if true because DFA states will point at
+ // sets and those must not change. It not protect other fields; conflictingAlts
+ // in particular, which is assigned after readOnly.
+ readOnly bool
+
+ // TODO: These fields make me pretty uncomfortable, but it is nice to pack up
+ // info together because it saves recomputation. Can we track conflicts as they
+ // are added to save scanning configs later?
+ uniqueAlt int
+}
+
+func (b *BaseATNConfigSet) Alts() *BitSet {
+ alts := NewBitSet()
+ for _, it := range b.configs {
+ alts.add(it.GetAlt())
+ }
+ return alts
+}
+
+func NewBaseATNConfigSet(fullCtx bool) *BaseATNConfigSet {
+ return &BaseATNConfigSet{
+ cachedHash: -1,
+ configLookup: newArray2DHashSetWithCap(hashATNConfig, equalATNConfigs, 16, 2),
+ fullCtx: fullCtx,
+ }
+}
+
+// Add merges contexts with existing configs for (s, i, pi, _), where s is the
+// ATNConfig.state, i is the ATNConfig.alt, and pi is the
+// ATNConfig.semanticContext. We use (s,i,pi) as the key. Updates
+// dipsIntoOuterContext and hasSemanticContext when necessary.
+func (b *BaseATNConfigSet) Add(config ATNConfig, mergeCache *DoubleDict) bool {
+ if b.readOnly {
+ panic("set is read-only")
+ }
+
+ if config.GetSemanticContext() != SemanticContextNone {
+ b.hasSemanticContext = true
+ }
+
+ if config.GetReachesIntoOuterContext() > 0 {
+ b.dipsIntoOuterContext = true
+ }
+
+ existing := b.configLookup.Add(config).(ATNConfig)
+
+ if existing == config {
+ b.cachedHash = -1
+ b.configs = append(b.configs, config) // Track order here
+ return true
+ }
+
+ // Merge a previous (s, i, pi, _) with it and save the result
+ rootIsWildcard := !b.fullCtx
+ merged := merge(existing.GetContext(), config.GetContext(), rootIsWildcard, mergeCache)
+
+ // No need to check for existing.context because config.context is in the cache,
+ // since the only way to create new graphs is the "call rule" and here. We cache
+ // at both places.
+ existing.SetReachesIntoOuterContext(intMax(existing.GetReachesIntoOuterContext(), config.GetReachesIntoOuterContext()))
+
+ // Preserve the precedence filter suppression during the merge
+ if config.getPrecedenceFilterSuppressed() {
+ existing.setPrecedenceFilterSuppressed(true)
+ }
+
+ // Replace the context because there is no need to do alt mapping
+ existing.SetContext(merged)
+
+ return true
+}
+
+func (b *BaseATNConfigSet) GetStates() Set {
+ states := newArray2DHashSet(nil, nil)
+
+ for i := 0; i < len(b.configs); i++ {
+ states.Add(b.configs[i].GetState())
+ }
+
+ return states
+}
+
+func (b *BaseATNConfigSet) HasSemanticContext() bool {
+ return b.hasSemanticContext
+}
+
+func (b *BaseATNConfigSet) SetHasSemanticContext(v bool) {
+ b.hasSemanticContext = v
+}
+
+func (b *BaseATNConfigSet) GetPredicates() []SemanticContext {
+ preds := make([]SemanticContext, 0)
+
+ for i := 0; i < len(b.configs); i++ {
+ c := b.configs[i].GetSemanticContext()
+
+ if c != SemanticContextNone {
+ preds = append(preds, c)
+ }
+ }
+
+ return preds
+}
+
+func (b *BaseATNConfigSet) GetItems() []ATNConfig {
+ return b.configs
+}
+
+func (b *BaseATNConfigSet) OptimizeConfigs(interpreter *BaseATNSimulator) {
+ if b.readOnly {
+ panic("set is read-only")
+ }
+
+ if b.configLookup.Len() == 0 {
+ return
+ }
+
+ for i := 0; i < len(b.configs); i++ {
+ config := b.configs[i]
+
+ config.SetContext(interpreter.getCachedContext(config.GetContext()))
+ }
+}
+
+func (b *BaseATNConfigSet) AddAll(coll []ATNConfig) bool {
+ for i := 0; i < len(coll); i++ {
+ b.Add(coll[i], nil)
+ }
+
+ return false
+}
+
+func (b *BaseATNConfigSet) Equals(other interface{}) bool {
+ if b == other {
+ return true
+ } else if _, ok := other.(*BaseATNConfigSet); !ok {
+ return false
+ }
+
+ other2 := other.(*BaseATNConfigSet)
+
+ return b.configs != nil &&
+ // TODO: b.configs.equals(other2.configs) && // TODO: Is b necessary?
+ b.fullCtx == other2.fullCtx &&
+ b.uniqueAlt == other2.uniqueAlt &&
+ b.conflictingAlts == other2.conflictingAlts &&
+ b.hasSemanticContext == other2.hasSemanticContext &&
+ b.dipsIntoOuterContext == other2.dipsIntoOuterContext
+}
+
+func (b *BaseATNConfigSet) hash() int {
+ if b.readOnly {
+ if b.cachedHash == -1 {
+ b.cachedHash = b.hashCodeConfigs()
+ }
+
+ return b.cachedHash
+ }
+
+ return b.hashCodeConfigs()
+}
+
+func (b *BaseATNConfigSet) hashCodeConfigs() int {
+ h := 1
+ for _, config := range b.configs {
+ h = 31*h + config.hash()
+ }
+ return h
+}
+
+func (b *BaseATNConfigSet) Length() int {
+ return len(b.configs)
+}
+
+func (b *BaseATNConfigSet) IsEmpty() bool {
+ return len(b.configs) == 0
+}
+
+func (b *BaseATNConfigSet) Contains(item ATNConfig) bool {
+ if b.configLookup == nil {
+ panic("not implemented for read-only sets")
+ }
+
+ return b.configLookup.Contains(item)
+}
+
+func (b *BaseATNConfigSet) ContainsFast(item ATNConfig) bool {
+ if b.configLookup == nil {
+ panic("not implemented for read-only sets")
+ }
+
+ return b.configLookup.Contains(item) // TODO: containsFast is not implemented for Set
+}
+
+func (b *BaseATNConfigSet) Clear() {
+ if b.readOnly {
+ panic("set is read-only")
+ }
+
+ b.configs = make([]ATNConfig, 0)
+ b.cachedHash = -1
+ b.configLookup = newArray2DHashSet(nil, equalATNConfigs)
+}
+
+func (b *BaseATNConfigSet) FullContext() bool {
+ return b.fullCtx
+}
+
+func (b *BaseATNConfigSet) GetDipsIntoOuterContext() bool {
+ return b.dipsIntoOuterContext
+}
+
+func (b *BaseATNConfigSet) SetDipsIntoOuterContext(v bool) {
+ b.dipsIntoOuterContext = v
+}
+
+func (b *BaseATNConfigSet) GetUniqueAlt() int {
+ return b.uniqueAlt
+}
+
+func (b *BaseATNConfigSet) SetUniqueAlt(v int) {
+ b.uniqueAlt = v
+}
+
+func (b *BaseATNConfigSet) GetConflictingAlts() *BitSet {
+ return b.conflictingAlts
+}
+
+func (b *BaseATNConfigSet) SetConflictingAlts(v *BitSet) {
+ b.conflictingAlts = v
+}
+
+func (b *BaseATNConfigSet) ReadOnly() bool {
+ return b.readOnly
+}
+
+func (b *BaseATNConfigSet) SetReadOnly(readOnly bool) {
+ b.readOnly = readOnly
+
+ if readOnly {
+ b.configLookup = nil // Read only, so no need for the lookup cache
+ }
+}
+
+func (b *BaseATNConfigSet) String() string {
+ s := "["
+
+ for i, c := range b.configs {
+ s += c.String()
+
+ if i != len(b.configs)-1 {
+ s += ", "
+ }
+ }
+
+ s += "]"
+
+ if b.hasSemanticContext {
+ s += ",hasSemanticContext=" + fmt.Sprint(b.hasSemanticContext)
+ }
+
+ if b.uniqueAlt != ATNInvalidAltNumber {
+ s += ",uniqueAlt=" + fmt.Sprint(b.uniqueAlt)
+ }
+
+ if b.conflictingAlts != nil {
+ s += ",conflictingAlts=" + b.conflictingAlts.String()
+ }
+
+ if b.dipsIntoOuterContext {
+ s += ",dipsIntoOuterContext"
+ }
+
+ return s
+}
+
+type OrderedATNConfigSet struct {
+ *BaseATNConfigSet
+}
+
+func NewOrderedATNConfigSet() *OrderedATNConfigSet {
+ b := NewBaseATNConfigSet(false)
+
+ b.configLookup = newArray2DHashSet(nil, nil)
+
+ return &OrderedATNConfigSet{BaseATNConfigSet: b}
+}
+
+func hashATNConfig(i interface{}) int {
+ o := i.(ATNConfig)
+ hash := 7
+ hash = 31*hash + o.GetState().GetStateNumber()
+ hash = 31*hash + o.GetAlt()
+ hash = 31*hash + o.GetSemanticContext().hash()
+ return hash
+}
+
+func equalATNConfigs(a, b interface{}) bool {
+ if a == nil || b == nil {
+ return false
+ }
+
+ if a == b {
+ return true
+ }
+
+ var ai, ok = a.(ATNConfig)
+ var bi, ok1 = b.(ATNConfig)
+
+ if !ok || !ok1 {
+ return false
+ }
+
+ if ai.GetState().GetStateNumber() != bi.GetState().GetStateNumber() {
+ return false
+ }
+
+ if ai.GetAlt() != bi.GetAlt() {
+ return false
+ }
+
+ return ai.GetSemanticContext().equals(bi.GetSemanticContext())
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_deserialization_options.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_deserialization_options.go
new file mode 100644
index 000000000..cb8eafb0b
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_deserialization_options.go
@@ -0,0 +1,61 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import "errors"
+
+var defaultATNDeserializationOptions = ATNDeserializationOptions{true, true, false}
+
+type ATNDeserializationOptions struct {
+ readOnly bool
+ verifyATN bool
+ generateRuleBypassTransitions bool
+}
+
+func (opts *ATNDeserializationOptions) ReadOnly() bool {
+ return opts.readOnly
+}
+
+func (opts *ATNDeserializationOptions) SetReadOnly(readOnly bool) {
+ if opts.readOnly {
+ panic(errors.New("Cannot mutate read only ATNDeserializationOptions"))
+ }
+ opts.readOnly = readOnly
+}
+
+func (opts *ATNDeserializationOptions) VerifyATN() bool {
+ return opts.verifyATN
+}
+
+func (opts *ATNDeserializationOptions) SetVerifyATN(verifyATN bool) {
+ if opts.readOnly {
+ panic(errors.New("Cannot mutate read only ATNDeserializationOptions"))
+ }
+ opts.verifyATN = verifyATN
+}
+
+func (opts *ATNDeserializationOptions) GenerateRuleBypassTransitions() bool {
+ return opts.generateRuleBypassTransitions
+}
+
+func (opts *ATNDeserializationOptions) SetGenerateRuleBypassTransitions(generateRuleBypassTransitions bool) {
+ if opts.readOnly {
+ panic(errors.New("Cannot mutate read only ATNDeserializationOptions"))
+ }
+ opts.generateRuleBypassTransitions = generateRuleBypassTransitions
+}
+
+func DefaultATNDeserializationOptions() *ATNDeserializationOptions {
+ return NewATNDeserializationOptions(&defaultATNDeserializationOptions)
+}
+
+func NewATNDeserializationOptions(other *ATNDeserializationOptions) *ATNDeserializationOptions {
+ o := new(ATNDeserializationOptions)
+ if other != nil {
+ *o = *other
+ o.readOnly = false
+ }
+ return o
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_deserializer.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_deserializer.go
new file mode 100644
index 000000000..aea9bbfa9
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_deserializer.go
@@ -0,0 +1,683 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "strconv"
+)
+
+const serializedVersion = 4
+
+type loopEndStateIntPair struct {
+ item0 *LoopEndState
+ item1 int
+}
+
+type blockStartStateIntPair struct {
+ item0 BlockStartState
+ item1 int
+}
+
+type ATNDeserializer struct {
+ options *ATNDeserializationOptions
+ data []int32
+ pos int
+}
+
+func NewATNDeserializer(options *ATNDeserializationOptions) *ATNDeserializer {
+ if options == nil {
+ options = &defaultATNDeserializationOptions
+ }
+
+ return &ATNDeserializer{options: options}
+}
+
+func stringInSlice(a string, list []string) int {
+ for i, b := range list {
+ if b == a {
+ return i
+ }
+ }
+
+ return -1
+}
+
+func (a *ATNDeserializer) Deserialize(data []int32) *ATN {
+ a.data = data
+ a.pos = 0
+ a.checkVersion()
+
+ atn := a.readATN()
+
+ a.readStates(atn)
+ a.readRules(atn)
+ a.readModes(atn)
+
+ sets := a.readSets(atn, nil)
+
+ a.readEdges(atn, sets)
+ a.readDecisions(atn)
+ a.readLexerActions(atn)
+ a.markPrecedenceDecisions(atn)
+ a.verifyATN(atn)
+
+ if a.options.GenerateRuleBypassTransitions() && atn.grammarType == ATNTypeParser {
+ a.generateRuleBypassTransitions(atn)
+ // Re-verify after modification
+ a.verifyATN(atn)
+ }
+
+ return atn
+
+}
+
+func (a *ATNDeserializer) checkVersion() {
+ version := a.readInt()
+
+ if version != serializedVersion {
+ panic("Could not deserialize ATN with version " + strconv.Itoa(version) + " (expected " + strconv.Itoa(serializedVersion) + ").")
+ }
+}
+
+func (a *ATNDeserializer) readATN() *ATN {
+ grammarType := a.readInt()
+ maxTokenType := a.readInt()
+
+ return NewATN(grammarType, maxTokenType)
+}
+
+func (a *ATNDeserializer) readStates(atn *ATN) {
+ nstates := a.readInt()
+
+ // Allocate worst case size.
+ loopBackStateNumbers := make([]loopEndStateIntPair, 0, nstates)
+ endStateNumbers := make([]blockStartStateIntPair, 0, nstates)
+
+ // Preallocate states slice.
+ atn.states = make([]ATNState, 0, nstates)
+
+ for i := 0; i < nstates; i++ {
+ stype := a.readInt()
+
+ // Ignore bad types of states
+ if stype == ATNStateInvalidType {
+ atn.addState(nil)
+ continue
+ }
+
+ ruleIndex := a.readInt()
+
+ s := a.stateFactory(stype, ruleIndex)
+
+ if stype == ATNStateLoopEnd {
+ loopBackStateNumber := a.readInt()
+
+ loopBackStateNumbers = append(loopBackStateNumbers, loopEndStateIntPair{s.(*LoopEndState), loopBackStateNumber})
+ } else if s2, ok := s.(BlockStartState); ok {
+ endStateNumber := a.readInt()
+
+ endStateNumbers = append(endStateNumbers, blockStartStateIntPair{s2, endStateNumber})
+ }
+
+ atn.addState(s)
+ }
+
+ // Delay the assignment of loop back and end states until we know all the state
+ // instances have been initialized
+ for _, pair := range loopBackStateNumbers {
+ pair.item0.loopBackState = atn.states[pair.item1]
+ }
+
+ for _, pair := range endStateNumbers {
+ pair.item0.setEndState(atn.states[pair.item1].(*BlockEndState))
+ }
+
+ numNonGreedyStates := a.readInt()
+ for j := 0; j < numNonGreedyStates; j++ {
+ stateNumber := a.readInt()
+
+ atn.states[stateNumber].(DecisionState).setNonGreedy(true)
+ }
+
+ numPrecedenceStates := a.readInt()
+ for j := 0; j < numPrecedenceStates; j++ {
+ stateNumber := a.readInt()
+
+ atn.states[stateNumber].(*RuleStartState).isPrecedenceRule = true
+ }
+}
+
+func (a *ATNDeserializer) readRules(atn *ATN) {
+ nrules := a.readInt()
+
+ if atn.grammarType == ATNTypeLexer {
+ atn.ruleToTokenType = make([]int, nrules)
+ }
+
+ atn.ruleToStartState = make([]*RuleStartState, nrules)
+
+ for i := range atn.ruleToStartState {
+ s := a.readInt()
+ startState := atn.states[s].(*RuleStartState)
+
+ atn.ruleToStartState[i] = startState
+
+ if atn.grammarType == ATNTypeLexer {
+ tokenType := a.readInt()
+
+ atn.ruleToTokenType[i] = tokenType
+ }
+ }
+
+ atn.ruleToStopState = make([]*RuleStopState, nrules)
+
+ for _, state := range atn.states {
+ if s2, ok := state.(*RuleStopState); ok {
+ atn.ruleToStopState[s2.ruleIndex] = s2
+ atn.ruleToStartState[s2.ruleIndex].stopState = s2
+ }
+ }
+}
+
+func (a *ATNDeserializer) readModes(atn *ATN) {
+ nmodes := a.readInt()
+ atn.modeToStartState = make([]*TokensStartState, nmodes)
+
+ for i := range atn.modeToStartState {
+ s := a.readInt()
+
+ atn.modeToStartState[i] = atn.states[s].(*TokensStartState)
+ }
+}
+
+func (a *ATNDeserializer) readSets(atn *ATN, sets []*IntervalSet) []*IntervalSet {
+ m := a.readInt()
+
+ // Preallocate the needed capacity.
+ if cap(sets)-len(sets) < m {
+ isets := make([]*IntervalSet, len(sets), len(sets)+m)
+ copy(isets, sets)
+ sets = isets
+ }
+
+ for i := 0; i < m; i++ {
+ iset := NewIntervalSet()
+
+ sets = append(sets, iset)
+
+ n := a.readInt()
+ containsEOF := a.readInt()
+
+ if containsEOF != 0 {
+ iset.addOne(-1)
+ }
+
+ for j := 0; j < n; j++ {
+ i1 := a.readInt()
+ i2 := a.readInt()
+
+ iset.addRange(i1, i2)
+ }
+ }
+
+ return sets
+}
+
+func (a *ATNDeserializer) readEdges(atn *ATN, sets []*IntervalSet) {
+ nedges := a.readInt()
+
+ for i := 0; i < nedges; i++ {
+ var (
+ src = a.readInt()
+ trg = a.readInt()
+ ttype = a.readInt()
+ arg1 = a.readInt()
+ arg2 = a.readInt()
+ arg3 = a.readInt()
+ trans = a.edgeFactory(atn, ttype, src, trg, arg1, arg2, arg3, sets)
+ srcState = atn.states[src]
+ )
+
+ srcState.AddTransition(trans, -1)
+ }
+
+ // Edges for rule stop states can be derived, so they are not serialized
+ for _, state := range atn.states {
+ for _, t := range state.GetTransitions() {
+ var rt, ok = t.(*RuleTransition)
+
+ if !ok {
+ continue
+ }
+
+ outermostPrecedenceReturn := -1
+
+ if atn.ruleToStartState[rt.getTarget().GetRuleIndex()].isPrecedenceRule {
+ if rt.precedence == 0 {
+ outermostPrecedenceReturn = rt.getTarget().GetRuleIndex()
+ }
+ }
+
+ trans := NewEpsilonTransition(rt.followState, outermostPrecedenceReturn)
+
+ atn.ruleToStopState[rt.getTarget().GetRuleIndex()].AddTransition(trans, -1)
+ }
+ }
+
+ for _, state := range atn.states {
+ if s2, ok := state.(BlockStartState); ok {
+ // We need to know the end state to set its start state
+ if s2.getEndState() == nil {
+ panic("IllegalState")
+ }
+
+ // Block end states can only be associated to a single block start state
+ if s2.getEndState().startState != nil {
+ panic("IllegalState")
+ }
+
+ s2.getEndState().startState = state
+ }
+
+ if s2, ok := state.(*PlusLoopbackState); ok {
+ for _, t := range s2.GetTransitions() {
+ if t2, ok := t.getTarget().(*PlusBlockStartState); ok {
+ t2.loopBackState = state
+ }
+ }
+ } else if s2, ok := state.(*StarLoopbackState); ok {
+ for _, t := range s2.GetTransitions() {
+ if t2, ok := t.getTarget().(*StarLoopEntryState); ok {
+ t2.loopBackState = state
+ }
+ }
+ }
+ }
+}
+
+func (a *ATNDeserializer) readDecisions(atn *ATN) {
+ ndecisions := a.readInt()
+
+ for i := 0; i < ndecisions; i++ {
+ s := a.readInt()
+ decState := atn.states[s].(DecisionState)
+
+ atn.DecisionToState = append(atn.DecisionToState, decState)
+ decState.setDecision(i)
+ }
+}
+
+func (a *ATNDeserializer) readLexerActions(atn *ATN) {
+ if atn.grammarType == ATNTypeLexer {
+ count := a.readInt()
+
+ atn.lexerActions = make([]LexerAction, count)
+
+ for i := range atn.lexerActions {
+ actionType := a.readInt()
+ data1 := a.readInt()
+ data2 := a.readInt()
+ atn.lexerActions[i] = a.lexerActionFactory(actionType, data1, data2)
+ }
+ }
+}
+
+func (a *ATNDeserializer) generateRuleBypassTransitions(atn *ATN) {
+ count := len(atn.ruleToStartState)
+
+ for i := 0; i < count; i++ {
+ atn.ruleToTokenType[i] = atn.maxTokenType + i + 1
+ }
+
+ for i := 0; i < count; i++ {
+ a.generateRuleBypassTransition(atn, i)
+ }
+}
+
+func (a *ATNDeserializer) generateRuleBypassTransition(atn *ATN, idx int) {
+ bypassStart := NewBasicBlockStartState()
+
+ bypassStart.ruleIndex = idx
+ atn.addState(bypassStart)
+
+ bypassStop := NewBlockEndState()
+
+ bypassStop.ruleIndex = idx
+ atn.addState(bypassStop)
+
+ bypassStart.endState = bypassStop
+
+ atn.defineDecisionState(bypassStart.BaseDecisionState)
+
+ bypassStop.startState = bypassStart
+
+ var excludeTransition Transition
+ var endState ATNState
+
+ if atn.ruleToStartState[idx].isPrecedenceRule {
+ // Wrap from the beginning of the rule to the StarLoopEntryState
+ endState = nil
+
+ for i := 0; i < len(atn.states); i++ {
+ state := atn.states[i]
+
+ if a.stateIsEndStateFor(state, idx) != nil {
+ endState = state
+ excludeTransition = state.(*StarLoopEntryState).loopBackState.GetTransitions()[0]
+
+ break
+ }
+ }
+
+ if excludeTransition == nil {
+ panic("Couldn't identify final state of the precedence rule prefix section.")
+ }
+ } else {
+ endState = atn.ruleToStopState[idx]
+ }
+
+ // All non-excluded transitions that currently target end state need to target
+ // blockEnd instead
+ for i := 0; i < len(atn.states); i++ {
+ state := atn.states[i]
+
+ for j := 0; j < len(state.GetTransitions()); j++ {
+ transition := state.GetTransitions()[j]
+
+ if transition == excludeTransition {
+ continue
+ }
+
+ if transition.getTarget() == endState {
+ transition.setTarget(bypassStop)
+ }
+ }
+ }
+
+ // All transitions leaving the rule start state need to leave blockStart instead
+ ruleToStartState := atn.ruleToStartState[idx]
+ count := len(ruleToStartState.GetTransitions())
+
+ for count > 0 {
+ bypassStart.AddTransition(ruleToStartState.GetTransitions()[count-1], -1)
+ ruleToStartState.SetTransitions([]Transition{ruleToStartState.GetTransitions()[len(ruleToStartState.GetTransitions())-1]})
+ }
+
+ // Link the new states
+ atn.ruleToStartState[idx].AddTransition(NewEpsilonTransition(bypassStart, -1), -1)
+ bypassStop.AddTransition(NewEpsilonTransition(endState, -1), -1)
+
+ MatchState := NewBasicState()
+
+ atn.addState(MatchState)
+ MatchState.AddTransition(NewAtomTransition(bypassStop, atn.ruleToTokenType[idx]), -1)
+ bypassStart.AddTransition(NewEpsilonTransition(MatchState, -1), -1)
+}
+
+func (a *ATNDeserializer) stateIsEndStateFor(state ATNState, idx int) ATNState {
+ if state.GetRuleIndex() != idx {
+ return nil
+ }
+
+ if _, ok := state.(*StarLoopEntryState); !ok {
+ return nil
+ }
+
+ maybeLoopEndState := state.GetTransitions()[len(state.GetTransitions())-1].getTarget()
+
+ if _, ok := maybeLoopEndState.(*LoopEndState); !ok {
+ return nil
+ }
+
+ var _, ok = maybeLoopEndState.GetTransitions()[0].getTarget().(*RuleStopState)
+
+ if maybeLoopEndState.(*LoopEndState).epsilonOnlyTransitions && ok {
+ return state
+ }
+
+ return nil
+}
+
+// markPrecedenceDecisions analyzes the StarLoopEntryState states in the
+// specified ATN to set the StarLoopEntryState.precedenceRuleDecision field to
+// the correct value.
+func (a *ATNDeserializer) markPrecedenceDecisions(atn *ATN) {
+ for _, state := range atn.states {
+ if _, ok := state.(*StarLoopEntryState); !ok {
+ continue
+ }
+
+ // We analyze the ATN to determine if a ATN decision state is the
+ // decision for the closure block that determines whether a
+ // precedence rule should continue or complete.
+ if atn.ruleToStartState[state.GetRuleIndex()].isPrecedenceRule {
+ maybeLoopEndState := state.GetTransitions()[len(state.GetTransitions())-1].getTarget()
+
+ if s3, ok := maybeLoopEndState.(*LoopEndState); ok {
+ var _, ok2 = maybeLoopEndState.GetTransitions()[0].getTarget().(*RuleStopState)
+
+ if s3.epsilonOnlyTransitions && ok2 {
+ state.(*StarLoopEntryState).precedenceRuleDecision = true
+ }
+ }
+ }
+ }
+}
+
+func (a *ATNDeserializer) verifyATN(atn *ATN) {
+ if !a.options.VerifyATN() {
+ return
+ }
+
+ // Verify assumptions
+ for _, state := range atn.states {
+ if state == nil {
+ continue
+ }
+
+ a.checkCondition(state.GetEpsilonOnlyTransitions() || len(state.GetTransitions()) <= 1, "")
+
+ switch s2 := state.(type) {
+ case *PlusBlockStartState:
+ a.checkCondition(s2.loopBackState != nil, "")
+
+ case *StarLoopEntryState:
+ a.checkCondition(s2.loopBackState != nil, "")
+ a.checkCondition(len(s2.GetTransitions()) == 2, "")
+
+ switch s2.transitions[0].getTarget().(type) {
+ case *StarBlockStartState:
+ _, ok := s2.transitions[1].getTarget().(*LoopEndState)
+
+ a.checkCondition(ok, "")
+ a.checkCondition(!s2.nonGreedy, "")
+
+ case *LoopEndState:
+ var _, ok = s2.transitions[1].getTarget().(*StarBlockStartState)
+
+ a.checkCondition(ok, "")
+ a.checkCondition(s2.nonGreedy, "")
+
+ default:
+ panic("IllegalState")
+ }
+
+ case *StarLoopbackState:
+ a.checkCondition(len(state.GetTransitions()) == 1, "")
+
+ var _, ok = state.GetTransitions()[0].getTarget().(*StarLoopEntryState)
+
+ a.checkCondition(ok, "")
+
+ case *LoopEndState:
+ a.checkCondition(s2.loopBackState != nil, "")
+
+ case *RuleStartState:
+ a.checkCondition(s2.stopState != nil, "")
+
+ case BlockStartState:
+ a.checkCondition(s2.getEndState() != nil, "")
+
+ case *BlockEndState:
+ a.checkCondition(s2.startState != nil, "")
+
+ case DecisionState:
+ a.checkCondition(len(s2.GetTransitions()) <= 1 || s2.getDecision() >= 0, "")
+
+ default:
+ var _, ok = s2.(*RuleStopState)
+
+ a.checkCondition(len(s2.GetTransitions()) <= 1 || ok, "")
+ }
+ }
+}
+
+func (a *ATNDeserializer) checkCondition(condition bool, message string) {
+ if !condition {
+ if message == "" {
+ message = "IllegalState"
+ }
+
+ panic(message)
+ }
+}
+
+func (a *ATNDeserializer) readInt() int {
+ v := a.data[a.pos]
+
+ a.pos++
+
+ return int(v) // data is 32 bits but int is at least that big
+}
+
+func (a *ATNDeserializer) edgeFactory(atn *ATN, typeIndex, src, trg, arg1, arg2, arg3 int, sets []*IntervalSet) Transition {
+ target := atn.states[trg]
+
+ switch typeIndex {
+ case TransitionEPSILON:
+ return NewEpsilonTransition(target, -1)
+
+ case TransitionRANGE:
+ if arg3 != 0 {
+ return NewRangeTransition(target, TokenEOF, arg2)
+ }
+
+ return NewRangeTransition(target, arg1, arg2)
+
+ case TransitionRULE:
+ return NewRuleTransition(atn.states[arg1], arg2, arg3, target)
+
+ case TransitionPREDICATE:
+ return NewPredicateTransition(target, arg1, arg2, arg3 != 0)
+
+ case TransitionPRECEDENCE:
+ return NewPrecedencePredicateTransition(target, arg1)
+
+ case TransitionATOM:
+ if arg3 != 0 {
+ return NewAtomTransition(target, TokenEOF)
+ }
+
+ return NewAtomTransition(target, arg1)
+
+ case TransitionACTION:
+ return NewActionTransition(target, arg1, arg2, arg3 != 0)
+
+ case TransitionSET:
+ return NewSetTransition(target, sets[arg1])
+
+ case TransitionNOTSET:
+ return NewNotSetTransition(target, sets[arg1])
+
+ case TransitionWILDCARD:
+ return NewWildcardTransition(target)
+ }
+
+ panic("The specified transition type is not valid.")
+}
+
+func (a *ATNDeserializer) stateFactory(typeIndex, ruleIndex int) ATNState {
+ var s ATNState
+
+ switch typeIndex {
+ case ATNStateInvalidType:
+ return nil
+
+ case ATNStateBasic:
+ s = NewBasicState()
+
+ case ATNStateRuleStart:
+ s = NewRuleStartState()
+
+ case ATNStateBlockStart:
+ s = NewBasicBlockStartState()
+
+ case ATNStatePlusBlockStart:
+ s = NewPlusBlockStartState()
+
+ case ATNStateStarBlockStart:
+ s = NewStarBlockStartState()
+
+ case ATNStateTokenStart:
+ s = NewTokensStartState()
+
+ case ATNStateRuleStop:
+ s = NewRuleStopState()
+
+ case ATNStateBlockEnd:
+ s = NewBlockEndState()
+
+ case ATNStateStarLoopBack:
+ s = NewStarLoopbackState()
+
+ case ATNStateStarLoopEntry:
+ s = NewStarLoopEntryState()
+
+ case ATNStatePlusLoopBack:
+ s = NewPlusLoopbackState()
+
+ case ATNStateLoopEnd:
+ s = NewLoopEndState()
+
+ default:
+ panic(fmt.Sprintf("state type %d is invalid", typeIndex))
+ }
+
+ s.SetRuleIndex(ruleIndex)
+
+ return s
+}
+
+func (a *ATNDeserializer) lexerActionFactory(typeIndex, data1, data2 int) LexerAction {
+ switch typeIndex {
+ case LexerActionTypeChannel:
+ return NewLexerChannelAction(data1)
+
+ case LexerActionTypeCustom:
+ return NewLexerCustomAction(data1, data2)
+
+ case LexerActionTypeMode:
+ return NewLexerModeAction(data1)
+
+ case LexerActionTypeMore:
+ return LexerMoreActionINSTANCE
+
+ case LexerActionTypePopMode:
+ return LexerPopModeActionINSTANCE
+
+ case LexerActionTypePushMode:
+ return NewLexerPushModeAction(data1)
+
+ case LexerActionTypeSkip:
+ return LexerSkipActionINSTANCE
+
+ case LexerActionTypeType:
+ return NewLexerTypeAction(data1)
+
+ default:
+ panic(fmt.Sprintf("lexer action %d is invalid", typeIndex))
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_simulator.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_simulator.go
new file mode 100644
index 000000000..d5454d6d5
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_simulator.go
@@ -0,0 +1,50 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+var ATNSimulatorError = NewDFAState(0x7FFFFFFF, NewBaseATNConfigSet(false))
+
+type IATNSimulator interface {
+ SharedContextCache() *PredictionContextCache
+ ATN() *ATN
+ DecisionToDFA() []*DFA
+}
+
+type BaseATNSimulator struct {
+ atn *ATN
+ sharedContextCache *PredictionContextCache
+ decisionToDFA []*DFA
+}
+
+func NewBaseATNSimulator(atn *ATN, sharedContextCache *PredictionContextCache) *BaseATNSimulator {
+ b := new(BaseATNSimulator)
+
+ b.atn = atn
+ b.sharedContextCache = sharedContextCache
+
+ return b
+}
+
+func (b *BaseATNSimulator) getCachedContext(context PredictionContext) PredictionContext {
+ if b.sharedContextCache == nil {
+ return context
+ }
+
+ visited := make(map[PredictionContext]PredictionContext)
+
+ return getCachedBasePredictionContext(context, b.sharedContextCache, visited)
+}
+
+func (b *BaseATNSimulator) SharedContextCache() *PredictionContextCache {
+ return b.sharedContextCache
+}
+
+func (b *BaseATNSimulator) ATN() *ATN {
+ return b.atn
+}
+
+func (b *BaseATNSimulator) DecisionToDFA() []*DFA {
+ return b.decisionToDFA
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_state.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_state.go
new file mode 100644
index 000000000..3835bb2e9
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_state.go
@@ -0,0 +1,392 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import "strconv"
+
+// Constants for serialization.
+const (
+ ATNStateInvalidType = 0
+ ATNStateBasic = 1
+ ATNStateRuleStart = 2
+ ATNStateBlockStart = 3
+ ATNStatePlusBlockStart = 4
+ ATNStateStarBlockStart = 5
+ ATNStateTokenStart = 6
+ ATNStateRuleStop = 7
+ ATNStateBlockEnd = 8
+ ATNStateStarLoopBack = 9
+ ATNStateStarLoopEntry = 10
+ ATNStatePlusLoopBack = 11
+ ATNStateLoopEnd = 12
+
+ ATNStateInvalidStateNumber = -1
+)
+
+var ATNStateInitialNumTransitions = 4
+
+type ATNState interface {
+ GetEpsilonOnlyTransitions() bool
+
+ GetRuleIndex() int
+ SetRuleIndex(int)
+
+ GetNextTokenWithinRule() *IntervalSet
+ SetNextTokenWithinRule(*IntervalSet)
+
+ GetATN() *ATN
+ SetATN(*ATN)
+
+ GetStateType() int
+
+ GetStateNumber() int
+ SetStateNumber(int)
+
+ GetTransitions() []Transition
+ SetTransitions([]Transition)
+ AddTransition(Transition, int)
+
+ String() string
+ hash() int
+}
+
+type BaseATNState struct {
+ // NextTokenWithinRule caches lookahead during parsing. Not used during construction.
+ NextTokenWithinRule *IntervalSet
+
+ // atn is the current ATN.
+ atn *ATN
+
+ epsilonOnlyTransitions bool
+
+ // ruleIndex tracks the Rule index because there are no Rule objects at runtime.
+ ruleIndex int
+
+ stateNumber int
+
+ stateType int
+
+ // Track the transitions emanating from this ATN state.
+ transitions []Transition
+}
+
+func NewBaseATNState() *BaseATNState {
+ return &BaseATNState{stateNumber: ATNStateInvalidStateNumber, stateType: ATNStateInvalidType}
+}
+
+func (as *BaseATNState) GetRuleIndex() int {
+ return as.ruleIndex
+}
+
+func (as *BaseATNState) SetRuleIndex(v int) {
+ as.ruleIndex = v
+}
+func (as *BaseATNState) GetEpsilonOnlyTransitions() bool {
+ return as.epsilonOnlyTransitions
+}
+
+func (as *BaseATNState) GetATN() *ATN {
+ return as.atn
+}
+
+func (as *BaseATNState) SetATN(atn *ATN) {
+ as.atn = atn
+}
+
+func (as *BaseATNState) GetTransitions() []Transition {
+ return as.transitions
+}
+
+func (as *BaseATNState) SetTransitions(t []Transition) {
+ as.transitions = t
+}
+
+func (as *BaseATNState) GetStateType() int {
+ return as.stateType
+}
+
+func (as *BaseATNState) GetStateNumber() int {
+ return as.stateNumber
+}
+
+func (as *BaseATNState) SetStateNumber(stateNumber int) {
+ as.stateNumber = stateNumber
+}
+
+func (as *BaseATNState) GetNextTokenWithinRule() *IntervalSet {
+ return as.NextTokenWithinRule
+}
+
+func (as *BaseATNState) SetNextTokenWithinRule(v *IntervalSet) {
+ as.NextTokenWithinRule = v
+}
+
+func (as *BaseATNState) hash() int {
+ return as.stateNumber
+}
+
+func (as *BaseATNState) String() string {
+ return strconv.Itoa(as.stateNumber)
+}
+
+func (as *BaseATNState) equals(other interface{}) bool {
+ if ot, ok := other.(ATNState); ok {
+ return as.stateNumber == ot.GetStateNumber()
+ }
+
+ return false
+}
+
+func (as *BaseATNState) isNonGreedyExitState() bool {
+ return false
+}
+
+func (as *BaseATNState) AddTransition(trans Transition, index int) {
+ if len(as.transitions) == 0 {
+ as.epsilonOnlyTransitions = trans.getIsEpsilon()
+ } else if as.epsilonOnlyTransitions != trans.getIsEpsilon() {
+ as.epsilonOnlyTransitions = false
+ }
+
+ if index == -1 {
+ as.transitions = append(as.transitions, trans)
+ } else {
+ as.transitions = append(as.transitions[:index], append([]Transition{trans}, as.transitions[index:]...)...)
+ // TODO: as.transitions.splice(index, 1, trans)
+ }
+}
+
+type BasicState struct {
+ *BaseATNState
+}
+
+func NewBasicState() *BasicState {
+ b := NewBaseATNState()
+
+ b.stateType = ATNStateBasic
+
+ return &BasicState{BaseATNState: b}
+}
+
+type DecisionState interface {
+ ATNState
+
+ getDecision() int
+ setDecision(int)
+
+ getNonGreedy() bool
+ setNonGreedy(bool)
+}
+
+type BaseDecisionState struct {
+ *BaseATNState
+ decision int
+ nonGreedy bool
+}
+
+func NewBaseDecisionState() *BaseDecisionState {
+ return &BaseDecisionState{BaseATNState: NewBaseATNState(), decision: -1}
+}
+
+func (s *BaseDecisionState) getDecision() int {
+ return s.decision
+}
+
+func (s *BaseDecisionState) setDecision(b int) {
+ s.decision = b
+}
+
+func (s *BaseDecisionState) getNonGreedy() bool {
+ return s.nonGreedy
+}
+
+func (s *BaseDecisionState) setNonGreedy(b bool) {
+ s.nonGreedy = b
+}
+
+type BlockStartState interface {
+ DecisionState
+
+ getEndState() *BlockEndState
+ setEndState(*BlockEndState)
+}
+
+// BaseBlockStartState is the start of a regular (...) block.
+type BaseBlockStartState struct {
+ *BaseDecisionState
+ endState *BlockEndState
+}
+
+func NewBlockStartState() *BaseBlockStartState {
+ return &BaseBlockStartState{BaseDecisionState: NewBaseDecisionState()}
+}
+
+func (s *BaseBlockStartState) getEndState() *BlockEndState {
+ return s.endState
+}
+
+func (s *BaseBlockStartState) setEndState(b *BlockEndState) {
+ s.endState = b
+}
+
+type BasicBlockStartState struct {
+ *BaseBlockStartState
+}
+
+func NewBasicBlockStartState() *BasicBlockStartState {
+ b := NewBlockStartState()
+
+ b.stateType = ATNStateBlockStart
+
+ return &BasicBlockStartState{BaseBlockStartState: b}
+}
+
+var _ BlockStartState = &BasicBlockStartState{}
+
+// BlockEndState is a terminal node of a simple (a|b|c) block.
+type BlockEndState struct {
+ *BaseATNState
+ startState ATNState
+}
+
+func NewBlockEndState() *BlockEndState {
+ b := NewBaseATNState()
+
+ b.stateType = ATNStateBlockEnd
+
+ return &BlockEndState{BaseATNState: b}
+}
+
+// RuleStopState is the last node in the ATN for a rule, unless that rule is the
+// start symbol. In that case, there is one transition to EOF. Later, we might
+// encode references to all calls to this rule to compute FOLLOW sets for error
+// handling.
+type RuleStopState struct {
+ *BaseATNState
+}
+
+func NewRuleStopState() *RuleStopState {
+ b := NewBaseATNState()
+
+ b.stateType = ATNStateRuleStop
+
+ return &RuleStopState{BaseATNState: b}
+}
+
+type RuleStartState struct {
+ *BaseATNState
+ stopState ATNState
+ isPrecedenceRule bool
+}
+
+func NewRuleStartState() *RuleStartState {
+ b := NewBaseATNState()
+
+ b.stateType = ATNStateRuleStart
+
+ return &RuleStartState{BaseATNState: b}
+}
+
+// PlusLoopbackState is a decision state for A+ and (A|B)+. It has two
+// transitions: one to the loop back to start of the block, and one to exit.
+type PlusLoopbackState struct {
+ *BaseDecisionState
+}
+
+func NewPlusLoopbackState() *PlusLoopbackState {
+ b := NewBaseDecisionState()
+
+ b.stateType = ATNStatePlusLoopBack
+
+ return &PlusLoopbackState{BaseDecisionState: b}
+}
+
+// PlusBlockStartState is the start of a (A|B|...)+ loop. Technically it is a
+// decision state; we don't use it for code generation. Somebody might need it,
+// it is included for completeness. In reality, PlusLoopbackState is the real
+// decision-making node for A+.
+type PlusBlockStartState struct {
+ *BaseBlockStartState
+ loopBackState ATNState
+}
+
+func NewPlusBlockStartState() *PlusBlockStartState {
+ b := NewBlockStartState()
+
+ b.stateType = ATNStatePlusBlockStart
+
+ return &PlusBlockStartState{BaseBlockStartState: b}
+}
+
+var _ BlockStartState = &PlusBlockStartState{}
+
+// StarBlockStartState is the block that begins a closure loop.
+type StarBlockStartState struct {
+ *BaseBlockStartState
+}
+
+func NewStarBlockStartState() *StarBlockStartState {
+ b := NewBlockStartState()
+
+ b.stateType = ATNStateStarBlockStart
+
+ return &StarBlockStartState{BaseBlockStartState: b}
+}
+
+var _ BlockStartState = &StarBlockStartState{}
+
+type StarLoopbackState struct {
+ *BaseATNState
+}
+
+func NewStarLoopbackState() *StarLoopbackState {
+ b := NewBaseATNState()
+
+ b.stateType = ATNStateStarLoopBack
+
+ return &StarLoopbackState{BaseATNState: b}
+}
+
+type StarLoopEntryState struct {
+ *BaseDecisionState
+ loopBackState ATNState
+ precedenceRuleDecision bool
+}
+
+func NewStarLoopEntryState() *StarLoopEntryState {
+ b := NewBaseDecisionState()
+
+ b.stateType = ATNStateStarLoopEntry
+
+ // False precedenceRuleDecision indicates whether s state can benefit from a precedence DFA during SLL decision making.
+ return &StarLoopEntryState{BaseDecisionState: b}
+}
+
+// LoopEndState marks the end of a * or + loop.
+type LoopEndState struct {
+ *BaseATNState
+ loopBackState ATNState
+}
+
+func NewLoopEndState() *LoopEndState {
+ b := NewBaseATNState()
+
+ b.stateType = ATNStateLoopEnd
+
+ return &LoopEndState{BaseATNState: b}
+}
+
+// TokensStartState is the Tokens rule start state linking to each lexer rule start state.
+type TokensStartState struct {
+ *BaseDecisionState
+}
+
+func NewTokensStartState() *TokensStartState {
+ b := NewBaseDecisionState()
+
+ b.stateType = ATNStateTokenStart
+
+ return &TokensStartState{BaseDecisionState: b}
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_type.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_type.go
new file mode 100644
index 000000000..a7b48976b
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/atn_type.go
@@ -0,0 +1,11 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+// Represent the type of recognizer an ATN applies to.
+const (
+ ATNTypeLexer = 0
+ ATNTypeParser = 1
+)
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/char_stream.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/char_stream.go
new file mode 100644
index 000000000..70c1207f7
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/char_stream.go
@@ -0,0 +1,12 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+type CharStream interface {
+ IntStream
+ GetText(int, int) string
+ GetTextFromTokens(start, end Token) string
+ GetTextFromInterval(*Interval) string
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/common_token_factory.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/common_token_factory.go
new file mode 100644
index 000000000..330ff8f31
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/common_token_factory.go
@@ -0,0 +1,56 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+// TokenFactory creates CommonToken objects.
+type TokenFactory interface {
+ Create(source *TokenSourceCharStreamPair, ttype int, text string, channel, start, stop, line, column int) Token
+}
+
+// CommonTokenFactory is the default TokenFactory implementation.
+type CommonTokenFactory struct {
+ // copyText indicates whether CommonToken.setText should be called after
+ // constructing tokens to explicitly set the text. This is useful for cases
+ // where the input stream might not be able to provide arbitrary substrings of
+ // text from the input after the lexer creates a token (e.g. the
+ // implementation of CharStream.GetText in UnbufferedCharStream panics an
+ // UnsupportedOperationException). Explicitly setting the token text allows
+ // Token.GetText to be called at any time regardless of the input stream
+ // implementation.
+ //
+ // The default value is false to avoid the performance and memory overhead of
+ // copying text for every token unless explicitly requested.
+ copyText bool
+}
+
+func NewCommonTokenFactory(copyText bool) *CommonTokenFactory {
+ return &CommonTokenFactory{copyText: copyText}
+}
+
+// CommonTokenFactoryDEFAULT is the default CommonTokenFactory. It does not
+// explicitly copy token text when constructing tokens.
+var CommonTokenFactoryDEFAULT = NewCommonTokenFactory(false)
+
+func (c *CommonTokenFactory) Create(source *TokenSourceCharStreamPair, ttype int, text string, channel, start, stop, line, column int) Token {
+ t := NewCommonToken(source, ttype, channel, start, stop)
+
+ t.line = line
+ t.column = column
+
+ if text != "" {
+ t.SetText(text)
+ } else if c.copyText && source.charStream != nil {
+ t.SetText(source.charStream.GetTextFromInterval(NewInterval(start, stop)))
+ }
+
+ return t
+}
+
+func (c *CommonTokenFactory) createThin(ttype int, text string) Token {
+ t := NewCommonToken(nil, ttype, TokenDefaultChannel, -1, -1)
+ t.SetText(text)
+
+ return t
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/common_token_stream.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/common_token_stream.go
new file mode 100644
index 000000000..c90e9b890
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/common_token_stream.go
@@ -0,0 +1,447 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "strconv"
+)
+
+// CommonTokenStream is an implementation of TokenStream that loads tokens from
+// a TokenSource on-demand and places the tokens in a buffer to provide access
+// to any previous token by index. This token stream ignores the value of
+// Token.getChannel. If your parser requires the token stream filter tokens to
+// only those on a particular channel, such as Token.DEFAULT_CHANNEL or
+// Token.HIDDEN_CHANNEL, use a filtering token stream such a CommonTokenStream.
+type CommonTokenStream struct {
+ channel int
+
+ // fetchedEOF indicates whether the Token.EOF token has been fetched from
+ // tokenSource and added to tokens. This field improves performance for the
+ // following cases:
+ //
+ // consume: The lookahead check in consume to preven consuming the EOF symbol is
+ // optimized by checking the values of fetchedEOF and p instead of calling LA.
+ //
+ // fetch: The check to prevent adding multiple EOF symbols into tokens is
+ // trivial with bt field.
+ fetchedEOF bool
+
+ // index indexs into tokens of the current token (next token to consume).
+ // tokens[p] should be LT(1). It is set to -1 when the stream is first
+ // constructed or when SetTokenSource is called, indicating that the first token
+ // has not yet been fetched from the token source. For additional information,
+ // see the documentation of IntStream for a description of initializing methods.
+ index int
+
+ // tokenSource is the TokenSource from which tokens for the bt stream are
+ // fetched.
+ tokenSource TokenSource
+
+ // tokens is all tokens fetched from the token source. The list is considered a
+ // complete view of the input once fetchedEOF is set to true.
+ tokens []Token
+}
+
+func NewCommonTokenStream(lexer Lexer, channel int) *CommonTokenStream {
+ return &CommonTokenStream{
+ channel: channel,
+ index: -1,
+ tokenSource: lexer,
+ tokens: make([]Token, 0),
+ }
+}
+
+func (c *CommonTokenStream) GetAllTokens() []Token {
+ return c.tokens
+}
+
+func (c *CommonTokenStream) Mark() int {
+ return 0
+}
+
+func (c *CommonTokenStream) Release(marker int) {}
+
+func (c *CommonTokenStream) reset() {
+ c.Seek(0)
+}
+
+func (c *CommonTokenStream) Seek(index int) {
+ c.lazyInit()
+ c.index = c.adjustSeekIndex(index)
+}
+
+func (c *CommonTokenStream) Get(index int) Token {
+ c.lazyInit()
+
+ return c.tokens[index]
+}
+
+func (c *CommonTokenStream) Consume() {
+ SkipEOFCheck := false
+
+ if c.index >= 0 {
+ if c.fetchedEOF {
+ // The last token in tokens is EOF. Skip the check if p indexes any fetched.
+ // token except the last.
+ SkipEOFCheck = c.index < len(c.tokens)-1
+ } else {
+ // No EOF token in tokens. Skip the check if p indexes a fetched token.
+ SkipEOFCheck = c.index < len(c.tokens)
+ }
+ } else {
+ // Not yet initialized
+ SkipEOFCheck = false
+ }
+
+ if !SkipEOFCheck && c.LA(1) == TokenEOF {
+ panic("cannot consume EOF")
+ }
+
+ if c.Sync(c.index + 1) {
+ c.index = c.adjustSeekIndex(c.index + 1)
+ }
+}
+
+// Sync makes sure index i in tokens has a token and returns true if a token is
+// located at index i and otherwise false.
+func (c *CommonTokenStream) Sync(i int) bool {
+ n := i - len(c.tokens) + 1 // TODO: How many more elements do we need?
+
+ if n > 0 {
+ fetched := c.fetch(n)
+ return fetched >= n
+ }
+
+ return true
+}
+
+// fetch adds n elements to buffer and returns the actual number of elements
+// added to the buffer.
+func (c *CommonTokenStream) fetch(n int) int {
+ if c.fetchedEOF {
+ return 0
+ }
+
+ for i := 0; i < n; i++ {
+ t := c.tokenSource.NextToken()
+
+ t.SetTokenIndex(len(c.tokens))
+ c.tokens = append(c.tokens, t)
+
+ if t.GetTokenType() == TokenEOF {
+ c.fetchedEOF = true
+
+ return i + 1
+ }
+ }
+
+ return n
+}
+
+// GetTokens gets all tokens from start to stop inclusive.
+func (c *CommonTokenStream) GetTokens(start int, stop int, types *IntervalSet) []Token {
+ if start < 0 || stop < 0 {
+ return nil
+ }
+
+ c.lazyInit()
+
+ subset := make([]Token, 0)
+
+ if stop >= len(c.tokens) {
+ stop = len(c.tokens) - 1
+ }
+
+ for i := start; i < stop; i++ {
+ t := c.tokens[i]
+
+ if t.GetTokenType() == TokenEOF {
+ break
+ }
+
+ if types == nil || types.contains(t.GetTokenType()) {
+ subset = append(subset, t)
+ }
+ }
+
+ return subset
+}
+
+func (c *CommonTokenStream) LA(i int) int {
+ return c.LT(i).GetTokenType()
+}
+
+func (c *CommonTokenStream) lazyInit() {
+ if c.index == -1 {
+ c.setup()
+ }
+}
+
+func (c *CommonTokenStream) setup() {
+ c.Sync(0)
+ c.index = c.adjustSeekIndex(0)
+}
+
+func (c *CommonTokenStream) GetTokenSource() TokenSource {
+ return c.tokenSource
+}
+
+// SetTokenSource resets the c token stream by setting its token source.
+func (c *CommonTokenStream) SetTokenSource(tokenSource TokenSource) {
+ c.tokenSource = tokenSource
+ c.tokens = make([]Token, 0)
+ c.index = -1
+}
+
+// NextTokenOnChannel returns the index of the next token on channel given a
+// starting index. Returns i if tokens[i] is on channel. Returns -1 if there are
+// no tokens on channel between i and EOF.
+func (c *CommonTokenStream) NextTokenOnChannel(i, channel int) int {
+ c.Sync(i)
+
+ if i >= len(c.tokens) {
+ return -1
+ }
+
+ token := c.tokens[i]
+
+ for token.GetChannel() != c.channel {
+ if token.GetTokenType() == TokenEOF {
+ return -1
+ }
+
+ i++
+ c.Sync(i)
+ token = c.tokens[i]
+ }
+
+ return i
+}
+
+// previousTokenOnChannel returns the index of the previous token on channel
+// given a starting index. Returns i if tokens[i] is on channel. Returns -1 if
+// there are no tokens on channel between i and 0.
+func (c *CommonTokenStream) previousTokenOnChannel(i, channel int) int {
+ for i >= 0 && c.tokens[i].GetChannel() != channel {
+ i--
+ }
+
+ return i
+}
+
+// GetHiddenTokensToRight collects all tokens on a specified channel to the
+// right of the current token up until we see a token on DEFAULT_TOKEN_CHANNEL
+// or EOF. If channel is -1, it finds any non-default channel token.
+func (c *CommonTokenStream) GetHiddenTokensToRight(tokenIndex, channel int) []Token {
+ c.lazyInit()
+
+ if tokenIndex < 0 || tokenIndex >= len(c.tokens) {
+ panic(strconv.Itoa(tokenIndex) + " not in 0.." + strconv.Itoa(len(c.tokens)-1))
+ }
+
+ nextOnChannel := c.NextTokenOnChannel(tokenIndex+1, LexerDefaultTokenChannel)
+ from := tokenIndex + 1
+
+ // If no onchannel to the right, then nextOnChannel == -1, so set to to last token
+ var to int
+
+ if nextOnChannel == -1 {
+ to = len(c.tokens) - 1
+ } else {
+ to = nextOnChannel
+ }
+
+ return c.filterForChannel(from, to, channel)
+}
+
+// GetHiddenTokensToLeft collects all tokens on channel to the left of the
+// current token until we see a token on DEFAULT_TOKEN_CHANNEL. If channel is
+// -1, it finds any non default channel token.
+func (c *CommonTokenStream) GetHiddenTokensToLeft(tokenIndex, channel int) []Token {
+ c.lazyInit()
+
+ if tokenIndex < 0 || tokenIndex >= len(c.tokens) {
+ panic(strconv.Itoa(tokenIndex) + " not in 0.." + strconv.Itoa(len(c.tokens)-1))
+ }
+
+ prevOnChannel := c.previousTokenOnChannel(tokenIndex-1, LexerDefaultTokenChannel)
+
+ if prevOnChannel == tokenIndex-1 {
+ return nil
+ }
+
+ // If there are none on channel to the left and prevOnChannel == -1 then from = 0
+ from := prevOnChannel + 1
+ to := tokenIndex - 1
+
+ return c.filterForChannel(from, to, channel)
+}
+
+func (c *CommonTokenStream) filterForChannel(left, right, channel int) []Token {
+ hidden := make([]Token, 0)
+
+ for i := left; i < right+1; i++ {
+ t := c.tokens[i]
+
+ if channel == -1 {
+ if t.GetChannel() != LexerDefaultTokenChannel {
+ hidden = append(hidden, t)
+ }
+ } else if t.GetChannel() == channel {
+ hidden = append(hidden, t)
+ }
+ }
+
+ if len(hidden) == 0 {
+ return nil
+ }
+
+ return hidden
+}
+
+func (c *CommonTokenStream) GetSourceName() string {
+ return c.tokenSource.GetSourceName()
+}
+
+func (c *CommonTokenStream) Size() int {
+ return len(c.tokens)
+}
+
+func (c *CommonTokenStream) Index() int {
+ return c.index
+}
+
+func (c *CommonTokenStream) GetAllText() string {
+ return c.GetTextFromInterval(nil)
+}
+
+func (c *CommonTokenStream) GetTextFromTokens(start, end Token) string {
+ if start == nil || end == nil {
+ return ""
+ }
+
+ return c.GetTextFromInterval(NewInterval(start.GetTokenIndex(), end.GetTokenIndex()))
+}
+
+func (c *CommonTokenStream) GetTextFromRuleContext(interval RuleContext) string {
+ return c.GetTextFromInterval(interval.GetSourceInterval())
+}
+
+func (c *CommonTokenStream) GetTextFromInterval(interval *Interval) string {
+ c.lazyInit()
+ c.Fill()
+
+ if interval == nil {
+ interval = NewInterval(0, len(c.tokens)-1)
+ }
+
+ start := interval.Start
+ stop := interval.Stop
+
+ if start < 0 || stop < 0 {
+ return ""
+ }
+
+ if stop >= len(c.tokens) {
+ stop = len(c.tokens) - 1
+ }
+
+ s := ""
+
+ for i := start; i < stop+1; i++ {
+ t := c.tokens[i]
+
+ if t.GetTokenType() == TokenEOF {
+ break
+ }
+
+ s += t.GetText()
+ }
+
+ return s
+}
+
+// Fill gets all tokens from the lexer until EOF.
+func (c *CommonTokenStream) Fill() {
+ c.lazyInit()
+
+ for c.fetch(1000) == 1000 {
+ continue
+ }
+}
+
+func (c *CommonTokenStream) adjustSeekIndex(i int) int {
+ return c.NextTokenOnChannel(i, c.channel)
+}
+
+func (c *CommonTokenStream) LB(k int) Token {
+ if k == 0 || c.index-k < 0 {
+ return nil
+ }
+
+ i := c.index
+ n := 1
+
+ // Find k good tokens looking backward
+ for n <= k {
+ // Skip off-channel tokens
+ i = c.previousTokenOnChannel(i-1, c.channel)
+ n++
+ }
+
+ if i < 0 {
+ return nil
+ }
+
+ return c.tokens[i]
+}
+
+func (c *CommonTokenStream) LT(k int) Token {
+ c.lazyInit()
+
+ if k == 0 {
+ return nil
+ }
+
+ if k < 0 {
+ return c.LB(-k)
+ }
+
+ i := c.index
+ n := 1 // We know tokens[n] is valid
+
+ // Find k good tokens
+ for n < k {
+ // Skip off-channel tokens, but make sure to not look past EOF
+ if c.Sync(i + 1) {
+ i = c.NextTokenOnChannel(i+1, c.channel)
+ }
+
+ n++
+ }
+
+ return c.tokens[i]
+}
+
+// getNumberOfOnChannelTokens counts EOF once.
+func (c *CommonTokenStream) getNumberOfOnChannelTokens() int {
+ var n int
+
+ c.Fill()
+
+ for i := 0; i < len(c.tokens); i++ {
+ t := c.tokens[i]
+
+ if t.GetChannel() == c.channel {
+ n++
+ }
+
+ if t.GetTokenType() == TokenEOF {
+ break
+ }
+ }
+
+ return n
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa.go
new file mode 100644
index 000000000..d55a2a87d
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa.go
@@ -0,0 +1,170 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "sort"
+)
+
+type DFA struct {
+ // atnStartState is the ATN state in which this was created
+ atnStartState DecisionState
+
+ decision int
+
+ // states is all the DFA states. Use Map to get the old state back; Set can only
+ // indicate whether it is there.
+ states map[int]*DFAState
+
+ s0 *DFAState
+
+ // precedenceDfa is the backing field for isPrecedenceDfa and setPrecedenceDfa.
+ // True if the DFA is for a precedence decision and false otherwise.
+ precedenceDfa bool
+}
+
+func NewDFA(atnStartState DecisionState, decision int) *DFA {
+ dfa := &DFA{
+ atnStartState: atnStartState,
+ decision: decision,
+ states: make(map[int]*DFAState),
+ }
+ if s, ok := atnStartState.(*StarLoopEntryState); ok && s.precedenceRuleDecision {
+ dfa.precedenceDfa = true
+ dfa.s0 = NewDFAState(-1, NewBaseATNConfigSet(false))
+ dfa.s0.isAcceptState = false
+ dfa.s0.requiresFullContext = false
+ }
+ return dfa
+}
+
+// getPrecedenceStartState gets the start state for the current precedence and
+// returns the start state corresponding to the specified precedence if a start
+// state exists for the specified precedence and nil otherwise. d must be a
+// precedence DFA. See also isPrecedenceDfa.
+func (d *DFA) getPrecedenceStartState(precedence int) *DFAState {
+ if !d.getPrecedenceDfa() {
+ panic("only precedence DFAs may contain a precedence start state")
+ }
+
+ // s0.edges is never nil for a precedence DFA
+ if precedence < 0 || precedence >= len(d.getS0().getEdges()) {
+ return nil
+ }
+
+ return d.getS0().getIthEdge(precedence)
+}
+
+// setPrecedenceStartState sets the start state for the current precedence. d
+// must be a precedence DFA. See also isPrecedenceDfa.
+func (d *DFA) setPrecedenceStartState(precedence int, startState *DFAState) {
+ if !d.getPrecedenceDfa() {
+ panic("only precedence DFAs may contain a precedence start state")
+ }
+
+ if precedence < 0 {
+ return
+ }
+
+ // Synchronization on s0 here is ok. When the DFA is turned into a
+ // precedence DFA, s0 will be initialized once and not updated again. s0.edges
+ // is never nil for a precedence DFA.
+ s0 := d.getS0()
+ if precedence >= s0.numEdges() {
+ edges := append(s0.getEdges(), make([]*DFAState, precedence+1-s0.numEdges())...)
+ s0.setEdges(edges)
+ d.setS0(s0)
+ }
+
+ s0.setIthEdge(precedence, startState)
+}
+
+func (d *DFA) getPrecedenceDfa() bool {
+ return d.precedenceDfa
+}
+
+// setPrecedenceDfa sets whether d is a precedence DFA. If precedenceDfa differs
+// from the current DFA configuration, then d.states is cleared, the initial
+// state s0 is set to a new DFAState with an empty outgoing DFAState.edges to
+// store the start states for individual precedence values if precedenceDfa is
+// true or nil otherwise, and d.precedenceDfa is updated.
+func (d *DFA) setPrecedenceDfa(precedenceDfa bool) {
+ if d.getPrecedenceDfa() != precedenceDfa {
+ d.setStates(make(map[int]*DFAState))
+
+ if precedenceDfa {
+ precedenceState := NewDFAState(-1, NewBaseATNConfigSet(false))
+
+ precedenceState.setEdges(make([]*DFAState, 0))
+ precedenceState.isAcceptState = false
+ precedenceState.requiresFullContext = false
+ d.setS0(precedenceState)
+ } else {
+ d.setS0(nil)
+ }
+
+ d.precedenceDfa = precedenceDfa
+ }
+}
+
+func (d *DFA) getS0() *DFAState {
+ return d.s0
+}
+
+func (d *DFA) setS0(s *DFAState) {
+ d.s0 = s
+}
+
+func (d *DFA) getState(hash int) (*DFAState, bool) {
+ s, ok := d.states[hash]
+ return s, ok
+}
+
+func (d *DFA) setStates(states map[int]*DFAState) {
+ d.states = states
+}
+
+func (d *DFA) setState(hash int, state *DFAState) {
+ d.states[hash] = state
+}
+
+func (d *DFA) numStates() int {
+ return len(d.states)
+}
+
+type dfaStateList []*DFAState
+
+func (d dfaStateList) Len() int { return len(d) }
+func (d dfaStateList) Less(i, j int) bool { return d[i].stateNumber < d[j].stateNumber }
+func (d dfaStateList) Swap(i, j int) { d[i], d[j] = d[j], d[i] }
+
+// sortedStates returns the states in d sorted by their state number.
+func (d *DFA) sortedStates() []*DFAState {
+ vs := make([]*DFAState, 0, len(d.states))
+
+ for _, v := range d.states {
+ vs = append(vs, v)
+ }
+
+ sort.Sort(dfaStateList(vs))
+
+ return vs
+}
+
+func (d *DFA) String(literalNames []string, symbolicNames []string) string {
+ if d.getS0() == nil {
+ return ""
+ }
+
+ return NewDFASerializer(d, literalNames, symbolicNames).String()
+}
+
+func (d *DFA) ToLexerString() string {
+ if d.getS0() == nil {
+ return ""
+ }
+
+ return NewLexerDFASerializer(d).String()
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa_serializer.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa_serializer.go
new file mode 100644
index 000000000..bf2ccc06c
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa_serializer.go
@@ -0,0 +1,158 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+// DFASerializer is a DFA walker that knows how to dump them to serialized
+// strings.
+type DFASerializer struct {
+ dfa *DFA
+ literalNames []string
+ symbolicNames []string
+}
+
+func NewDFASerializer(dfa *DFA, literalNames, symbolicNames []string) *DFASerializer {
+ if literalNames == nil {
+ literalNames = make([]string, 0)
+ }
+
+ if symbolicNames == nil {
+ symbolicNames = make([]string, 0)
+ }
+
+ return &DFASerializer{
+ dfa: dfa,
+ literalNames: literalNames,
+ symbolicNames: symbolicNames,
+ }
+}
+
+func (d *DFASerializer) String() string {
+ if d.dfa.getS0() == nil {
+ return ""
+ }
+
+ buf := ""
+ states := d.dfa.sortedStates()
+
+ for _, s := range states {
+ if s.edges != nil {
+ n := len(s.edges)
+
+ for j := 0; j < n; j++ {
+ t := s.edges[j]
+
+ if t != nil && t.stateNumber != 0x7FFFFFFF {
+ buf += d.GetStateString(s)
+ buf += "-"
+ buf += d.getEdgeLabel(j)
+ buf += "->"
+ buf += d.GetStateString(t)
+ buf += "\n"
+ }
+ }
+ }
+ }
+
+ if len(buf) == 0 {
+ return ""
+ }
+
+ return buf
+}
+
+func (d *DFASerializer) getEdgeLabel(i int) string {
+ if i == 0 {
+ return "EOF"
+ } else if d.literalNames != nil && i-1 < len(d.literalNames) {
+ return d.literalNames[i-1]
+ } else if d.symbolicNames != nil && i-1 < len(d.symbolicNames) {
+ return d.symbolicNames[i-1]
+ }
+
+ return strconv.Itoa(i - 1)
+}
+
+func (d *DFASerializer) GetStateString(s *DFAState) string {
+ var a, b string
+
+ if s.isAcceptState {
+ a = ":"
+ }
+
+ if s.requiresFullContext {
+ b = "^"
+ }
+
+ baseStateStr := a + "s" + strconv.Itoa(s.stateNumber) + b
+
+ if s.isAcceptState {
+ if s.predicates != nil {
+ return baseStateStr + "=>" + fmt.Sprint(s.predicates)
+ }
+
+ return baseStateStr + "=>" + fmt.Sprint(s.prediction)
+ }
+
+ return baseStateStr
+}
+
+type LexerDFASerializer struct {
+ *DFASerializer
+}
+
+func NewLexerDFASerializer(dfa *DFA) *LexerDFASerializer {
+ return &LexerDFASerializer{DFASerializer: NewDFASerializer(dfa, nil, nil)}
+}
+
+func (l *LexerDFASerializer) getEdgeLabel(i int) string {
+ var sb strings.Builder
+ sb.Grow(6)
+ sb.WriteByte('\'')
+ sb.WriteRune(rune(i))
+ sb.WriteByte('\'')
+ return sb.String()
+}
+
+func (l *LexerDFASerializer) String() string {
+ if l.dfa.getS0() == nil {
+ return ""
+ }
+
+ buf := ""
+ states := l.dfa.sortedStates()
+
+ for i := 0; i < len(states); i++ {
+ s := states[i]
+
+ if s.edges != nil {
+ n := len(s.edges)
+
+ for j := 0; j < n; j++ {
+ t := s.edges[j]
+
+ if t != nil && t.stateNumber != 0x7FFFFFFF {
+ buf += l.GetStateString(s)
+ buf += "-"
+ buf += l.getEdgeLabel(j)
+ buf += "->"
+ buf += l.GetStateString(t)
+ buf += "\n"
+ }
+ }
+ }
+ }
+
+ if len(buf) == 0 {
+ return ""
+ }
+
+ return buf
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa_state.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa_state.go
new file mode 100644
index 000000000..970ed1986
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/dfa_state.go
@@ -0,0 +1,171 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+)
+
+// PredPrediction maps a predicate to a predicted alternative.
+type PredPrediction struct {
+ alt int
+ pred SemanticContext
+}
+
+func NewPredPrediction(pred SemanticContext, alt int) *PredPrediction {
+ return &PredPrediction{alt: alt, pred: pred}
+}
+
+func (p *PredPrediction) String() string {
+ return "(" + fmt.Sprint(p.pred) + ", " + fmt.Sprint(p.alt) + ")"
+}
+
+// DFAState represents a set of possible ATN configurations. As Aho, Sethi,
+// Ullman p. 117 says: "The DFA uses its state to keep track of all possible
+// states the ATN can be in after reading each input symbol. That is to say,
+// after reading input a1a2..an, the DFA is in a state that represents the
+// subset T of the states of the ATN that are reachable from the ATN's start
+// state along some path labeled a1a2..an." In conventional NFA-to-DFA
+// conversion, therefore, the subset T would be a bitset representing the set of
+// states the ATN could be in. We need to track the alt predicted by each state
+// as well, however. More importantly, we need to maintain a stack of states,
+// tracking the closure operations as they jump from rule to rule, emulating
+// rule invocations (method calls). I have to add a stack to simulate the proper
+// lookahead sequences for the underlying LL grammar from which the ATN was
+// derived.
+//
+// I use a set of ATNConfig objects, not simple states. An ATNConfig is both a
+// state (ala normal conversion) and a RuleContext describing the chain of rules
+// (if any) followed to arrive at that state.
+//
+// A DFAState may have multiple references to a particular state, but with
+// different ATN contexts (with same or different alts) meaning that state was
+// reached via a different set of rule invocations.
+type DFAState struct {
+ stateNumber int
+ configs ATNConfigSet
+
+ // edges elements point to the target of the symbol. Shift up by 1 so (-1)
+ // Token.EOF maps to the first element.
+ edges []*DFAState
+
+ isAcceptState bool
+
+ // prediction is the ttype we match or alt we predict if the state is accept.
+ // Set to ATN.INVALID_ALT_NUMBER when predicates != nil or
+ // requiresFullContext.
+ prediction int
+
+ lexerActionExecutor *LexerActionExecutor
+
+ // requiresFullContext indicates it was created during an SLL prediction that
+ // discovered a conflict between the configurations in the state. Future
+ // ParserATNSimulator.execATN invocations immediately jump doing
+ // full context prediction if true.
+ requiresFullContext bool
+
+ // predicates is the predicates associated with the ATN configurations of the
+ // DFA state during SLL parsing. When we have predicates, requiresFullContext
+ // is false, since full context prediction evaluates predicates on-the-fly. If
+ // d is
+ // not nil, then prediction is ATN.INVALID_ALT_NUMBER.
+ //
+ // We only use these for non-requiresFullContext but conflicting states. That
+ // means we know from the context (it's $ or we don't dip into outer context)
+ // that it's an ambiguity not a conflict.
+ //
+ // This list is computed by
+ // ParserATNSimulator.predicateDFAState.
+ predicates []*PredPrediction
+}
+
+func NewDFAState(stateNumber int, configs ATNConfigSet) *DFAState {
+ if configs == nil {
+ configs = NewBaseATNConfigSet(false)
+ }
+
+ return &DFAState{configs: configs, stateNumber: stateNumber}
+}
+
+// GetAltSet gets the set of all alts mentioned by all ATN configurations in d.
+func (d *DFAState) GetAltSet() Set {
+ alts := newArray2DHashSet(nil, nil)
+
+ if d.configs != nil {
+ for _, c := range d.configs.GetItems() {
+ alts.Add(c.GetAlt())
+ }
+ }
+
+ if alts.Len() == 0 {
+ return nil
+ }
+
+ return alts
+}
+
+func (d *DFAState) getEdges() []*DFAState {
+ return d.edges
+}
+
+func (d *DFAState) numEdges() int {
+ return len(d.edges)
+}
+
+func (d *DFAState) getIthEdge(i int) *DFAState {
+ return d.edges[i]
+}
+
+func (d *DFAState) setEdges(newEdges []*DFAState) {
+ d.edges = newEdges
+}
+
+func (d *DFAState) setIthEdge(i int, edge *DFAState) {
+ d.edges[i] = edge
+}
+
+func (d *DFAState) setPrediction(v int) {
+ d.prediction = v
+}
+
+// equals returns whether d equals other. Two DFAStates are equal if their ATN
+// configuration sets are the same. This method is used to see if a state
+// already exists.
+//
+// Because the number of alternatives and number of ATN configurations are
+// finite, there is a finite number of DFA states that can be processed. This is
+// necessary to show that the algorithm terminates.
+//
+// Cannot test the DFA state numbers here because in
+// ParserATNSimulator.addDFAState we need to know if any other state exists that
+// has d exact set of ATN configurations. The stateNumber is irrelevant.
+func (d *DFAState) equals(other interface{}) bool {
+ if d == other {
+ return true
+ } else if _, ok := other.(*DFAState); !ok {
+ return false
+ }
+
+ return d.configs.Equals(other.(*DFAState).configs)
+}
+
+func (d *DFAState) String() string {
+ var s string
+ if d.isAcceptState {
+ if d.predicates != nil {
+ s = "=>" + fmt.Sprint(d.predicates)
+ } else {
+ s = "=>" + fmt.Sprint(d.prediction)
+ }
+ }
+
+ return fmt.Sprintf("%d:%s%s", d.stateNumber, fmt.Sprint(d.configs), s)
+}
+
+func (d *DFAState) hash() int {
+ h := murmurInit(7)
+ h = murmurUpdate(h, d.configs.hash())
+ return murmurFinish(h, 1)
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/diagnostic_error_listener.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/diagnostic_error_listener.go
new file mode 100644
index 000000000..1fec43d9d
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/diagnostic_error_listener.go
@@ -0,0 +1,111 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "strconv"
+)
+
+//
+// This implementation of {@link ANTLRErrorListener} can be used to identify
+// certain potential correctness and performance problems in grammars. "reports"
+// are made by calling {@link Parser//NotifyErrorListeners} with the appropriate
+// message.
+//
+//
+//
Ambiguities: These are cases where more than one path through the
+// grammar can Match the input.
+//
Weak context sensitivity: These are cases where full-context
+// prediction resolved an SLL conflict to a unique alternative which equaled the
+// minimum alternative of the SLL conflict.
+//
Strong (forced) context sensitivity: These are cases where the
+// full-context prediction resolved an SLL conflict to a unique alternative,
+// and the minimum alternative of the SLL conflict was found to not be
+// a truly viable alternative. Two-stage parsing cannot be used for inputs where
+// d situation occurs.
+//
+
+type DiagnosticErrorListener struct {
+ *DefaultErrorListener
+
+ exactOnly bool
+}
+
+func NewDiagnosticErrorListener(exactOnly bool) *DiagnosticErrorListener {
+
+ n := new(DiagnosticErrorListener)
+
+ // whether all ambiguities or only exact ambiguities are Reported.
+ n.exactOnly = exactOnly
+ return n
+}
+
+func (d *DiagnosticErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs ATNConfigSet) {
+ if d.exactOnly && !exact {
+ return
+ }
+ msg := "reportAmbiguity d=" +
+ d.getDecisionDescription(recognizer, dfa) +
+ ": ambigAlts=" +
+ d.getConflictingAlts(ambigAlts, configs).String() +
+ ", input='" +
+ recognizer.GetTokenStream().GetTextFromInterval(NewInterval(startIndex, stopIndex)) + "'"
+ recognizer.NotifyErrorListeners(msg, nil, nil)
+}
+
+func (d *DiagnosticErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs ATNConfigSet) {
+
+ msg := "reportAttemptingFullContext d=" +
+ d.getDecisionDescription(recognizer, dfa) +
+ ", input='" +
+ recognizer.GetTokenStream().GetTextFromInterval(NewInterval(startIndex, stopIndex)) + "'"
+ recognizer.NotifyErrorListeners(msg, nil, nil)
+}
+
+func (d *DiagnosticErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs ATNConfigSet) {
+ msg := "reportContextSensitivity d=" +
+ d.getDecisionDescription(recognizer, dfa) +
+ ", input='" +
+ recognizer.GetTokenStream().GetTextFromInterval(NewInterval(startIndex, stopIndex)) + "'"
+ recognizer.NotifyErrorListeners(msg, nil, nil)
+}
+
+func (d *DiagnosticErrorListener) getDecisionDescription(recognizer Parser, dfa *DFA) string {
+ decision := dfa.decision
+ ruleIndex := dfa.atnStartState.GetRuleIndex()
+
+ ruleNames := recognizer.GetRuleNames()
+ if ruleIndex < 0 || ruleIndex >= len(ruleNames) {
+ return strconv.Itoa(decision)
+ }
+ ruleName := ruleNames[ruleIndex]
+ if ruleName == "" {
+ return strconv.Itoa(decision)
+ }
+ return strconv.Itoa(decision) + " (" + ruleName + ")"
+}
+
+//
+// Computes the set of conflicting or ambiguous alternatives from a
+// configuration set, if that information was not already provided by the
+// parser.
+//
+// @param ReportedAlts The set of conflicting or ambiguous alternatives, as
+// Reported by the parser.
+// @param configs The conflicting or ambiguous configuration set.
+// @return Returns {@code ReportedAlts} if it is not {@code nil}, otherwise
+// returns the set of alternatives represented in {@code configs}.
+//
+func (d *DiagnosticErrorListener) getConflictingAlts(ReportedAlts *BitSet, set ATNConfigSet) *BitSet {
+ if ReportedAlts != nil {
+ return ReportedAlts
+ }
+ result := NewBitSet()
+ for _, c := range set.GetItems() {
+ result.add(c.GetAlt())
+ }
+
+ return result
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/error_listener.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/error_listener.go
new file mode 100644
index 000000000..028e1a9d7
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/error_listener.go
@@ -0,0 +1,108 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "os"
+ "strconv"
+)
+
+// Provides an empty default implementation of {@link ANTLRErrorListener}. The
+// default implementation of each method does nothing, but can be overridden as
+// necessary.
+
+type ErrorListener interface {
+ SyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException)
+ ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs ATNConfigSet)
+ ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs ATNConfigSet)
+ ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs ATNConfigSet)
+}
+
+type DefaultErrorListener struct {
+}
+
+func NewDefaultErrorListener() *DefaultErrorListener {
+ return new(DefaultErrorListener)
+}
+
+func (d *DefaultErrorListener) SyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException) {
+}
+
+func (d *DefaultErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs ATNConfigSet) {
+}
+
+func (d *DefaultErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs ATNConfigSet) {
+}
+
+func (d *DefaultErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs ATNConfigSet) {
+}
+
+type ConsoleErrorListener struct {
+ *DefaultErrorListener
+}
+
+func NewConsoleErrorListener() *ConsoleErrorListener {
+ return new(ConsoleErrorListener)
+}
+
+//
+// Provides a default instance of {@link ConsoleErrorListener}.
+//
+var ConsoleErrorListenerINSTANCE = NewConsoleErrorListener()
+
+//
+// {@inheritDoc}
+//
+//
+// This implementation prints messages to {@link System//err} containing the
+// values of {@code line}, {@code charPositionInLine}, and {@code msg} using
+// the following format.
+//
+//
+// line line:charPositionInLinemsg
+//
+//
+func (c *ConsoleErrorListener) SyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException) {
+ fmt.Fprintln(os.Stderr, "line "+strconv.Itoa(line)+":"+strconv.Itoa(column)+" "+msg)
+}
+
+type ProxyErrorListener struct {
+ *DefaultErrorListener
+ delegates []ErrorListener
+}
+
+func NewProxyErrorListener(delegates []ErrorListener) *ProxyErrorListener {
+ if delegates == nil {
+ panic("delegates is not provided")
+ }
+ l := new(ProxyErrorListener)
+ l.delegates = delegates
+ return l
+}
+
+func (p *ProxyErrorListener) SyntaxError(recognizer Recognizer, offendingSymbol interface{}, line, column int, msg string, e RecognitionException) {
+ for _, d := range p.delegates {
+ d.SyntaxError(recognizer, offendingSymbol, line, column, msg, e)
+ }
+}
+
+func (p *ProxyErrorListener) ReportAmbiguity(recognizer Parser, dfa *DFA, startIndex, stopIndex int, exact bool, ambigAlts *BitSet, configs ATNConfigSet) {
+ for _, d := range p.delegates {
+ d.ReportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs)
+ }
+}
+
+func (p *ProxyErrorListener) ReportAttemptingFullContext(recognizer Parser, dfa *DFA, startIndex, stopIndex int, conflictingAlts *BitSet, configs ATNConfigSet) {
+ for _, d := range p.delegates {
+ d.ReportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs)
+ }
+}
+
+func (p *ProxyErrorListener) ReportContextSensitivity(recognizer Parser, dfa *DFA, startIndex, stopIndex, prediction int, configs ATNConfigSet) {
+ for _, d := range p.delegates {
+ d.ReportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs)
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/error_strategy.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/error_strategy.go
new file mode 100644
index 000000000..c4080dbfd
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/error_strategy.go
@@ -0,0 +1,762 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "reflect"
+ "strconv"
+ "strings"
+)
+
+type ErrorStrategy interface {
+ reset(Parser)
+ RecoverInline(Parser) Token
+ Recover(Parser, RecognitionException)
+ Sync(Parser)
+ InErrorRecoveryMode(Parser) bool
+ ReportError(Parser, RecognitionException)
+ ReportMatch(Parser)
+}
+
+// This is the default implementation of {@link ANTLRErrorStrategy} used for
+// error Reporting and recovery in ANTLR parsers.
+//
+type DefaultErrorStrategy struct {
+ errorRecoveryMode bool
+ lastErrorIndex int
+ lastErrorStates *IntervalSet
+}
+
+var _ ErrorStrategy = &DefaultErrorStrategy{}
+
+func NewDefaultErrorStrategy() *DefaultErrorStrategy {
+
+ d := new(DefaultErrorStrategy)
+
+ // Indicates whether the error strategy is currently "recovering from an
+ // error". This is used to suppress Reporting multiple error messages while
+ // attempting to recover from a detected syntax error.
+ //
+ // @see //InErrorRecoveryMode
+ //
+ d.errorRecoveryMode = false
+
+ // The index into the input stream where the last error occurred.
+ // This is used to prevent infinite loops where an error is found
+ // but no token is consumed during recovery...another error is found,
+ // ad nauseum. This is a failsafe mechanism to guarantee that at least
+ // one token/tree node is consumed for two errors.
+ //
+ d.lastErrorIndex = -1
+ d.lastErrorStates = nil
+ return d
+}
+
+//
The default implementation simply calls {@link //endErrorCondition} to
+// ensure that the handler is not in error recovery mode.
+func (d *DefaultErrorStrategy) reset(recognizer Parser) {
+ d.endErrorCondition(recognizer)
+}
+
+//
+// This method is called to enter error recovery mode when a recognition
+// exception is Reported.
+//
+// @param recognizer the parser instance
+//
+func (d *DefaultErrorStrategy) beginErrorCondition(recognizer Parser) {
+ d.errorRecoveryMode = true
+}
+
+func (d *DefaultErrorStrategy) InErrorRecoveryMode(recognizer Parser) bool {
+ return d.errorRecoveryMode
+}
+
+//
+// This method is called to leave error recovery mode after recovering from
+// a recognition exception.
+//
+// @param recognizer
+//
+func (d *DefaultErrorStrategy) endErrorCondition(recognizer Parser) {
+ d.errorRecoveryMode = false
+ d.lastErrorStates = nil
+ d.lastErrorIndex = -1
+}
+
+//
+// {@inheritDoc}
+//
+//
The default implementation simply calls {@link //endErrorCondition}.
The default implementation returns immediately if the handler is already
+// in error recovery mode. Otherwise, it calls {@link //beginErrorCondition}
+// and dispatches the Reporting task based on the runtime type of {@code e}
+// according to the following table.
+//
+//
+//
{@link NoViableAltException}: Dispatches the call to
+// {@link //ReportNoViableAlternative}
+//
{@link InputMisMatchException}: Dispatches the call to
+// {@link //ReportInputMisMatch}
+//
{@link FailedPredicateException}: Dispatches the call to
+// {@link //ReportFailedPredicate}
+//
All other types: calls {@link Parser//NotifyErrorListeners} to Report
+// the exception
+//
+//
+func (d *DefaultErrorStrategy) ReportError(recognizer Parser, e RecognitionException) {
+ // if we've already Reported an error and have not Matched a token
+ // yet successfully, don't Report any errors.
+ if d.InErrorRecoveryMode(recognizer) {
+ return // don't Report spurious errors
+ }
+ d.beginErrorCondition(recognizer)
+
+ switch t := e.(type) {
+ default:
+ fmt.Println("unknown recognition error type: " + reflect.TypeOf(e).Name())
+ // fmt.Println(e.stack)
+ recognizer.NotifyErrorListeners(e.GetMessage(), e.GetOffendingToken(), e)
+ case *NoViableAltException:
+ d.ReportNoViableAlternative(recognizer, t)
+ case *InputMisMatchException:
+ d.ReportInputMisMatch(recognizer, t)
+ case *FailedPredicateException:
+ d.ReportFailedPredicate(recognizer, t)
+ }
+}
+
+// {@inheritDoc}
+//
+//
The default implementation reSynchronizes the parser by consuming tokens
+// until we find one in the reSynchronization set--loosely the set of tokens
+// that can follow the current rule.
+//
+func (d *DefaultErrorStrategy) Recover(recognizer Parser, e RecognitionException) {
+
+ if d.lastErrorIndex == recognizer.GetInputStream().Index() &&
+ d.lastErrorStates != nil && d.lastErrorStates.contains(recognizer.GetState()) {
+ // uh oh, another error at same token index and previously-Visited
+ // state in ATN must be a case where LT(1) is in the recovery
+ // token set so nothing got consumed. Consume a single token
+ // at least to prevent an infinite loop d is a failsafe.
+ recognizer.Consume()
+ }
+ d.lastErrorIndex = recognizer.GetInputStream().Index()
+ if d.lastErrorStates == nil {
+ d.lastErrorStates = NewIntervalSet()
+ }
+ d.lastErrorStates.addOne(recognizer.GetState())
+ followSet := d.getErrorRecoverySet(recognizer)
+ d.consumeUntil(recognizer, followSet)
+}
+
+// The default implementation of {@link ANTLRErrorStrategy//Sync} makes sure
+// that the current lookahead symbol is consistent with what were expecting
+// at d point in the ATN. You can call d anytime but ANTLR only
+// generates code to check before subrules/loops and each iteration.
+//
+//
Implements Jim Idle's magic Sync mechanism in closures and optional
+// subrules. E.g.,
+//
+//
+// a : Sync ( stuff Sync )*
+// Sync : {consume to what can follow Sync}
+//
+//
+// At the start of a sub rule upon error, {@link //Sync} performs single
+// token deletion, if possible. If it can't do that, it bails on the current
+// rule and uses the default error recovery, which consumes until the
+// reSynchronization set of the current rule.
+//
+//
If the sub rule is optional ({@code (...)?}, {@code (...)*}, or block
+// with an empty alternative), then the expected set includes what follows
+// the subrule.
+//
+//
During loop iteration, it consumes until it sees a token that can start a
+// sub rule or what follows loop. Yes, that is pretty aggressive. We opt to
+// stay in the loop as long as possible.
+//
+//
ORIGINS
+//
+//
Previous versions of ANTLR did a poor job of their recovery within loops.
+// A single mismatch token or missing token would force the parser to bail
+// out of the entire rules surrounding the loop. So, for rule
+//
+//
+// classfunc : 'class' ID '{' member* '}'
+//
+//
+// input with an extra token between members would force the parser to
+// consume until it found the next class definition rather than the next
+// member definition of the current class.
+//
+//
This functionality cost a little bit of effort because the parser has to
+// compare token set at the start of the loop and at each iteration. If for
+// some reason speed is suffering for you, you can turn off d
+// functionality by simply overriding d method as a blank { }.
+//
+func (d *DefaultErrorStrategy) Sync(recognizer Parser) {
+ // If already recovering, don't try to Sync
+ if d.InErrorRecoveryMode(recognizer) {
+ return
+ }
+
+ s := recognizer.GetInterpreter().atn.states[recognizer.GetState()]
+ la := recognizer.GetTokenStream().LA(1)
+
+ // try cheaper subset first might get lucky. seems to shave a wee bit off
+ nextTokens := recognizer.GetATN().NextTokens(s, nil)
+ if nextTokens.contains(TokenEpsilon) || nextTokens.contains(la) {
+ return
+ }
+
+ switch s.GetStateType() {
+ case ATNStateBlockStart, ATNStateStarBlockStart, ATNStatePlusBlockStart, ATNStateStarLoopEntry:
+ // Report error and recover if possible
+ if d.SingleTokenDeletion(recognizer) != nil {
+ return
+ }
+ panic(NewInputMisMatchException(recognizer))
+ case ATNStatePlusLoopBack, ATNStateStarLoopBack:
+ d.ReportUnwantedToken(recognizer)
+ expecting := NewIntervalSet()
+ expecting.addSet(recognizer.GetExpectedTokens())
+ whatFollowsLoopIterationOrRule := expecting.addSet(d.getErrorRecoverySet(recognizer))
+ d.consumeUntil(recognizer, whatFollowsLoopIterationOrRule)
+ default:
+ // do nothing if we can't identify the exact kind of ATN state
+ }
+}
+
+// This is called by {@link //ReportError} when the exception is a
+// {@link NoViableAltException}.
+//
+// @see //ReportError
+//
+// @param recognizer the parser instance
+// @param e the recognition exception
+//
+func (d *DefaultErrorStrategy) ReportNoViableAlternative(recognizer Parser, e *NoViableAltException) {
+ tokens := recognizer.GetTokenStream()
+ var input string
+ if tokens != nil {
+ if e.startToken.GetTokenType() == TokenEOF {
+ input = ""
+ } else {
+ input = tokens.GetTextFromTokens(e.startToken, e.offendingToken)
+ }
+ } else {
+ input = ""
+ }
+ msg := "no viable alternative at input " + d.escapeWSAndQuote(input)
+ recognizer.NotifyErrorListeners(msg, e.offendingToken, e)
+}
+
+//
+// This is called by {@link //ReportError} when the exception is an
+// {@link InputMisMatchException}.
+//
+// @see //ReportError
+//
+// @param recognizer the parser instance
+// @param e the recognition exception
+//
+func (this *DefaultErrorStrategy) ReportInputMisMatch(recognizer Parser, e *InputMisMatchException) {
+ msg := "mismatched input " + this.GetTokenErrorDisplay(e.offendingToken) +
+ " expecting " + e.getExpectedTokens().StringVerbose(recognizer.GetLiteralNames(), recognizer.GetSymbolicNames(), false)
+ recognizer.NotifyErrorListeners(msg, e.offendingToken, e)
+}
+
+//
+// This is called by {@link //ReportError} when the exception is a
+// {@link FailedPredicateException}.
+//
+// @see //ReportError
+//
+// @param recognizer the parser instance
+// @param e the recognition exception
+//
+func (d *DefaultErrorStrategy) ReportFailedPredicate(recognizer Parser, e *FailedPredicateException) {
+ ruleName := recognizer.GetRuleNames()[recognizer.GetParserRuleContext().GetRuleIndex()]
+ msg := "rule " + ruleName + " " + e.message
+ recognizer.NotifyErrorListeners(msg, e.offendingToken, e)
+}
+
+// This method is called to Report a syntax error which requires the removal
+// of a token from the input stream. At the time d method is called, the
+// erroneous symbol is current {@code LT(1)} symbol and has not yet been
+// removed from the input stream. When d method returns,
+// {@code recognizer} is in error recovery mode.
+//
+//
This method is called when {@link //singleTokenDeletion} identifies
+// single-token deletion as a viable recovery strategy for a mismatched
+// input error.
+//
+//
The default implementation simply returns if the handler is already in
+// error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to
+// enter error recovery mode, followed by calling
+// {@link Parser//NotifyErrorListeners}.
+//
+// @param recognizer the parser instance
+//
+func (d *DefaultErrorStrategy) ReportUnwantedToken(recognizer Parser) {
+ if d.InErrorRecoveryMode(recognizer) {
+ return
+ }
+ d.beginErrorCondition(recognizer)
+ t := recognizer.GetCurrentToken()
+ tokenName := d.GetTokenErrorDisplay(t)
+ expecting := d.GetExpectedTokens(recognizer)
+ msg := "extraneous input " + tokenName + " expecting " +
+ expecting.StringVerbose(recognizer.GetLiteralNames(), recognizer.GetSymbolicNames(), false)
+ recognizer.NotifyErrorListeners(msg, t, nil)
+}
+
+// This method is called to Report a syntax error which requires the
+// insertion of a missing token into the input stream. At the time d
+// method is called, the missing token has not yet been inserted. When d
+// method returns, {@code recognizer} is in error recovery mode.
+//
+//
This method is called when {@link //singleTokenInsertion} identifies
+// single-token insertion as a viable recovery strategy for a mismatched
+// input error.
+//
+//
The default implementation simply returns if the handler is already in
+// error recovery mode. Otherwise, it calls {@link //beginErrorCondition} to
+// enter error recovery mode, followed by calling
+// {@link Parser//NotifyErrorListeners}.
The default implementation attempts to recover from the mismatched input
+// by using single token insertion and deletion as described below. If the
+// recovery attempt fails, d method panics an
+// {@link InputMisMatchException}.
+//
+//
EXTRA TOKEN (single token deletion)
+//
+//
{@code LA(1)} is not what we are looking for. If {@code LA(2)} has the
+// right token, however, then assume {@code LA(1)} is some extra spurious
+// token and delete it. Then consume and return the next token (which was
+// the {@code LA(2)} token) as the successful result of the Match operation.
+//
+//
This recovery strategy is implemented by {@link
+// //singleTokenDeletion}.
+//
+//
MISSING TOKEN (single token insertion)
+//
+//
If current token (at {@code LA(1)}) is consistent with what could come
+// after the expected {@code LA(1)} token, then assume the token is missing
+// and use the parser's {@link TokenFactory} to create it on the fly. The
+// "insertion" is performed by returning the created token as the successful
+// result of the Match operation.
+//
+//
This recovery strategy is implemented by {@link
+// //singleTokenInsertion}.
+//
+//
EXAMPLE
+//
+//
For example, Input {@code i=(3} is clearly missing the {@code ')'}. When
+// the parser returns from the nested call to {@code expr}, it will have
+// call chain:
+//
+//
+// stat &rarr expr &rarr atom
+//
+//
+// and it will be trying to Match the {@code ')'} at d point in the
+// derivation:
+//
+//
+// => ID '=' '(' INT ')' ('+' atom)* ''
+// ^
+//
+//
+// The attempt to Match {@code ')'} will fail when it sees {@code ''} and
+// call {@link //recoverInline}. To recover, it sees that {@code LA(1)==''}
+// is in the set of tokens that can follow the {@code ')'} token reference
+// in rule {@code atom}. It can assume that you forgot the {@code ')'}.
+//
+func (d *DefaultErrorStrategy) RecoverInline(recognizer Parser) Token {
+ // SINGLE TOKEN DELETION
+ MatchedSymbol := d.SingleTokenDeletion(recognizer)
+ if MatchedSymbol != nil {
+ // we have deleted the extra token.
+ // now, move past ttype token as if all were ok
+ recognizer.Consume()
+ return MatchedSymbol
+ }
+ // SINGLE TOKEN INSERTION
+ if d.SingleTokenInsertion(recognizer) {
+ return d.GetMissingSymbol(recognizer)
+ }
+ // even that didn't work must panic the exception
+ panic(NewInputMisMatchException(recognizer))
+}
+
+//
+// This method implements the single-token insertion inline error recovery
+// strategy. It is called by {@link //recoverInline} if the single-token
+// deletion strategy fails to recover from the mismatched input. If this
+// method returns {@code true}, {@code recognizer} will be in error recovery
+// mode.
+//
+//
This method determines whether or not single-token insertion is viable by
+// checking if the {@code LA(1)} input symbol could be successfully Matched
+// if it were instead the {@code LA(2)} symbol. If d method returns
+// {@code true}, the caller is responsible for creating and inserting a
+// token with the correct type to produce d behavior.
+//
+// @param recognizer the parser instance
+// @return {@code true} if single-token insertion is a viable recovery
+// strategy for the current mismatched input, otherwise {@code false}
+//
+func (d *DefaultErrorStrategy) SingleTokenInsertion(recognizer Parser) bool {
+ currentSymbolType := recognizer.GetTokenStream().LA(1)
+ // if current token is consistent with what could come after current
+ // ATN state, then we know we're missing a token error recovery
+ // is free to conjure up and insert the missing token
+ atn := recognizer.GetInterpreter().atn
+ currentState := atn.states[recognizer.GetState()]
+ next := currentState.GetTransitions()[0].getTarget()
+ expectingAtLL2 := atn.NextTokens(next, recognizer.GetParserRuleContext())
+ if expectingAtLL2.contains(currentSymbolType) {
+ d.ReportMissingToken(recognizer)
+ return true
+ }
+
+ return false
+}
+
+// This method implements the single-token deletion inline error recovery
+// strategy. It is called by {@link //recoverInline} to attempt to recover
+// from mismatched input. If this method returns nil, the parser and error
+// handler state will not have changed. If this method returns non-nil,
+// {@code recognizer} will not be in error recovery mode since the
+// returned token was a successful Match.
+//
+//
If the single-token deletion is successful, d method calls
+// {@link //ReportUnwantedToken} to Report the error, followed by
+// {@link Parser//consume} to actually "delete" the extraneous token. Then,
+// before returning {@link //ReportMatch} is called to signal a successful
+// Match.
+//
+// @param recognizer the parser instance
+// @return the successfully Matched {@link Token} instance if single-token
+// deletion successfully recovers from the mismatched input, otherwise
+// {@code nil}
+//
+func (d *DefaultErrorStrategy) SingleTokenDeletion(recognizer Parser) Token {
+ NextTokenType := recognizer.GetTokenStream().LA(2)
+ expecting := d.GetExpectedTokens(recognizer)
+ if expecting.contains(NextTokenType) {
+ d.ReportUnwantedToken(recognizer)
+ // print("recoverFromMisMatchedToken deleting " \
+ // + str(recognizer.GetTokenStream().LT(1)) \
+ // + " since " + str(recognizer.GetTokenStream().LT(2)) \
+ // + " is what we want", file=sys.stderr)
+ recognizer.Consume() // simply delete extra token
+ // we want to return the token we're actually Matching
+ MatchedSymbol := recognizer.GetCurrentToken()
+ d.ReportMatch(recognizer) // we know current token is correct
+ return MatchedSymbol
+ }
+
+ return nil
+}
+
+// Conjure up a missing token during error recovery.
+//
+// The recognizer attempts to recover from single missing
+// symbols. But, actions might refer to that missing symbol.
+// For example, x=ID {f($x)}. The action clearly assumes
+// that there has been an identifier Matched previously and that
+// $x points at that token. If that token is missing, but
+// the next token in the stream is what we want we assume that
+// d token is missing and we keep going. Because we
+// have to return some token to replace the missing token,
+// we have to conjure one up. This method gives the user control
+// over the tokens returned for missing tokens. Mostly,
+// you will want to create something special for identifier
+// tokens. For literals such as '{' and ',', the default
+// action in the parser or tree parser works. It simply creates
+// a CommonToken of the appropriate type. The text will be the token.
+// If you change what tokens must be created by the lexer,
+// override d method to create the appropriate tokens.
+//
+func (d *DefaultErrorStrategy) GetMissingSymbol(recognizer Parser) Token {
+ currentSymbol := recognizer.GetCurrentToken()
+ expecting := d.GetExpectedTokens(recognizer)
+ expectedTokenType := expecting.first()
+ var tokenText string
+
+ if expectedTokenType == TokenEOF {
+ tokenText = ""
+ } else {
+ ln := recognizer.GetLiteralNames()
+ if expectedTokenType > 0 && expectedTokenType < len(ln) {
+ tokenText = ""
+ } else {
+ tokenText = "" // TODO matches the JS impl
+ }
+ }
+ current := currentSymbol
+ lookback := recognizer.GetTokenStream().LT(-1)
+ if current.GetTokenType() == TokenEOF && lookback != nil {
+ current = lookback
+ }
+
+ tf := recognizer.GetTokenFactory()
+
+ return tf.Create(current.GetSource(), expectedTokenType, tokenText, TokenDefaultChannel, -1, -1, current.GetLine(), current.GetColumn())
+}
+
+func (d *DefaultErrorStrategy) GetExpectedTokens(recognizer Parser) *IntervalSet {
+ return recognizer.GetExpectedTokens()
+}
+
+// How should a token be displayed in an error message? The default
+// is to display just the text, but during development you might
+// want to have a lot of information spit out. Override in that case
+// to use t.String() (which, for CommonToken, dumps everything about
+// the token). This is better than forcing you to override a method in
+// your token objects because you don't have to go modify your lexer
+// so that it creates a NewJava type.
+//
+func (d *DefaultErrorStrategy) GetTokenErrorDisplay(t Token) string {
+ if t == nil {
+ return ""
+ }
+ s := t.GetText()
+ if s == "" {
+ if t.GetTokenType() == TokenEOF {
+ s = ""
+ } else {
+ s = "<" + strconv.Itoa(t.GetTokenType()) + ">"
+ }
+ }
+ return d.escapeWSAndQuote(s)
+}
+
+func (d *DefaultErrorStrategy) escapeWSAndQuote(s string) string {
+ s = strings.Replace(s, "\t", "\\t", -1)
+ s = strings.Replace(s, "\n", "\\n", -1)
+ s = strings.Replace(s, "\r", "\\r", -1)
+ return "'" + s + "'"
+}
+
+// Compute the error recovery set for the current rule. During
+// rule invocation, the parser pushes the set of tokens that can
+// follow that rule reference on the stack d amounts to
+// computing FIRST of what follows the rule reference in the
+// enclosing rule. See LinearApproximator.FIRST().
+// This local follow set only includes tokens
+// from within the rule i.e., the FIRST computation done by
+// ANTLR stops at the end of a rule.
+//
+// EXAMPLE
+//
+// When you find a "no viable alt exception", the input is not
+// consistent with any of the alternatives for rule r. The best
+// thing to do is to consume tokens until you see something that
+// can legally follow a call to r//or* any rule that called r.
+// You don't want the exact set of viable next tokens because the
+// input might just be missing a token--you might consume the
+// rest of the input looking for one of the missing tokens.
+//
+// Consider grammar:
+//
+// a : '[' b ']'
+// | '(' b ')'
+//
+// b : c '^' INT
+// c : ID
+// | INT
+//
+//
+// At each rule invocation, the set of tokens that could follow
+// that rule is pushed on a stack. Here are the various
+// context-sensitive follow sets:
+//
+// FOLLOW(b1_in_a) = FIRST(']') = ']'
+// FOLLOW(b2_in_a) = FIRST(')') = ')'
+// FOLLOW(c_in_b) = FIRST('^') = '^'
+//
+// Upon erroneous input "[]", the call chain is
+//
+// a -> b -> c
+//
+// and, hence, the follow context stack is:
+//
+// depth follow set start of rule execution
+// 0 a (from main())
+// 1 ']' b
+// 2 '^' c
+//
+// Notice that ')' is not included, because b would have to have
+// been called from a different context in rule a for ')' to be
+// included.
+//
+// For error recovery, we cannot consider FOLLOW(c)
+// (context-sensitive or otherwise). We need the combined set of
+// all context-sensitive FOLLOW sets--the set of all tokens that
+// could follow any reference in the call chain. We need to
+// reSync to one of those tokens. Note that FOLLOW(c)='^' and if
+// we reSync'd to that token, we'd consume until EOF. We need to
+// Sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}.
+// In this case, for input "[]", LA(1) is ']' and in the set, so we would
+// not consume anything. After printing an error, rule c would
+// return normally. Rule b would not find the required '^' though.
+// At this point, it gets a mismatched token error and panics an
+// exception (since LA(1) is not in the viable following token
+// set). The rule exception handler tries to recover, but finds
+// the same recovery set and doesn't consume anything. Rule b
+// exits normally returning to rule a. Now it finds the ']' (and
+// with the successful Match exits errorRecovery mode).
+//
+// So, you can see that the parser walks up the call chain looking
+// for the token that was a member of the recovery set.
+//
+// Errors are not generated in errorRecovery mode.
+//
+// ANTLR's error recovery mechanism is based upon original ideas:
+//
+// "Algorithms + Data Structures = Programs" by Niklaus Wirth
+//
+// and
+//
+// "A note on error recovery in recursive descent parsers":
+// http://portal.acm.org/citation.cfm?id=947902.947905
+//
+// Later, Josef Grosch had some good ideas:
+//
+// "Efficient and Comfortable Error Recovery in Recursive Descent
+// Parsers":
+// ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip
+//
+// Like Grosch I implement context-sensitive FOLLOW sets that are combined
+// at run-time upon error to avoid overhead during parsing.
+//
+func (d *DefaultErrorStrategy) getErrorRecoverySet(recognizer Parser) *IntervalSet {
+ atn := recognizer.GetInterpreter().atn
+ ctx := recognizer.GetParserRuleContext()
+ recoverSet := NewIntervalSet()
+ for ctx != nil && ctx.GetInvokingState() >= 0 {
+ // compute what follows who invoked us
+ invokingState := atn.states[ctx.GetInvokingState()]
+ rt := invokingState.GetTransitions()[0]
+ follow := atn.NextTokens(rt.(*RuleTransition).followState, nil)
+ recoverSet.addSet(follow)
+ ctx = ctx.GetParent().(ParserRuleContext)
+ }
+ recoverSet.removeOne(TokenEpsilon)
+ return recoverSet
+}
+
+// Consume tokens until one Matches the given token set.//
+func (d *DefaultErrorStrategy) consumeUntil(recognizer Parser, set *IntervalSet) {
+ ttype := recognizer.GetTokenStream().LA(1)
+ for ttype != TokenEOF && !set.contains(ttype) {
+ recognizer.Consume()
+ ttype = recognizer.GetTokenStream().LA(1)
+ }
+}
+
+//
+// This implementation of {@link ANTLRErrorStrategy} responds to syntax errors
+// by immediately canceling the parse operation with a
+// {@link ParseCancellationException}. The implementation ensures that the
+// {@link ParserRuleContext//exception} field is set for all parse tree nodes
+// that were not completed prior to encountering the error.
+//
+//
+// This error strategy is useful in the following scenarios.
+//
+//
+//
Two-stage parsing: This error strategy allows the first
+// stage of two-stage parsing to immediately terminate if an error is
+// encountered, and immediately fall back to the second stage. In addition to
+// avoiding wasted work by attempting to recover from errors here, the empty
+// implementation of {@link BailErrorStrategy//Sync} improves the performance of
+// the first stage.
+//
Silent validation: When syntax errors are not being
+// Reported or logged, and the parse result is simply ignored if errors occur,
+// the {@link BailErrorStrategy} avoids wasting work on recovering from errors
+// when the result will be ignored either way.
+//
+// @see Parser//setErrorHandler(ANTLRErrorStrategy)
+
+type BailErrorStrategy struct {
+ *DefaultErrorStrategy
+}
+
+var _ ErrorStrategy = &BailErrorStrategy{}
+
+func NewBailErrorStrategy() *BailErrorStrategy {
+
+ b := new(BailErrorStrategy)
+
+ b.DefaultErrorStrategy = NewDefaultErrorStrategy()
+
+ return b
+}
+
+// Instead of recovering from exception {@code e}, re-panic it wrapped
+// in a {@link ParseCancellationException} so it is not caught by the
+// rule func catches. Use {@link Exception//getCause()} to get the
+// original {@link RecognitionException}.
+//
+func (b *BailErrorStrategy) Recover(recognizer Parser, e RecognitionException) {
+ context := recognizer.GetParserRuleContext()
+ for context != nil {
+ context.SetException(e)
+ if parent, ok := context.GetParent().(ParserRuleContext); ok {
+ context = parent
+ } else {
+ context = nil
+ }
+ }
+ panic(NewParseCancellationException()) // TODO we don't emit e properly
+}
+
+// Make sure we don't attempt to recover inline if the parser
+// successfully recovers, it won't panic an exception.
+//
+func (b *BailErrorStrategy) RecoverInline(recognizer Parser) Token {
+ b.Recover(recognizer, NewInputMisMatchException(recognizer))
+
+ return nil
+}
+
+// Make sure we don't attempt to recover from problems in subrules.//
+func (b *BailErrorStrategy) Sync(recognizer Parser) {
+ // pass
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/errors.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/errors.go
new file mode 100644
index 000000000..2ef74926e
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/errors.go
@@ -0,0 +1,241 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+// The root of the ANTLR exception hierarchy. In general, ANTLR tracks just
+// 3 kinds of errors: prediction errors, failed predicate errors, and
+// mismatched input errors. In each case, the parser knows where it is
+// in the input, where it is in the ATN, the rule invocation stack,
+// and what kind of problem occurred.
+
+type RecognitionException interface {
+ GetOffendingToken() Token
+ GetMessage() string
+ GetInputStream() IntStream
+}
+
+type BaseRecognitionException struct {
+ message string
+ recognizer Recognizer
+ offendingToken Token
+ offendingState int
+ ctx RuleContext
+ input IntStream
+}
+
+func NewBaseRecognitionException(message string, recognizer Recognizer, input IntStream, ctx RuleContext) *BaseRecognitionException {
+
+ // todo
+ // Error.call(this)
+ //
+ // if (!!Error.captureStackTrace) {
+ // Error.captureStackTrace(this, RecognitionException)
+ // } else {
+ // stack := NewError().stack
+ // }
+ // TODO may be able to use - "runtime" func Stack(buf []byte, all bool) int
+
+ t := new(BaseRecognitionException)
+
+ t.message = message
+ t.recognizer = recognizer
+ t.input = input
+ t.ctx = ctx
+ // The current {@link Token} when an error occurred. Since not all streams
+ // support accessing symbols by index, we have to track the {@link Token}
+ // instance itself.
+ t.offendingToken = nil
+ // Get the ATN state number the parser was in at the time the error
+ // occurred. For {@link NoViableAltException} and
+ // {@link LexerNoViableAltException} exceptions, this is the
+ // {@link DecisionState} number. For others, it is the state whose outgoing
+ // edge we couldn't Match.
+ t.offendingState = -1
+ if t.recognizer != nil {
+ t.offendingState = t.recognizer.GetState()
+ }
+
+ return t
+}
+
+func (b *BaseRecognitionException) GetMessage() string {
+ return b.message
+}
+
+func (b *BaseRecognitionException) GetOffendingToken() Token {
+ return b.offendingToken
+}
+
+func (b *BaseRecognitionException) GetInputStream() IntStream {
+ return b.input
+}
+
+//
If the state number is not known, b method returns -1.
+
+//
+// Gets the set of input symbols which could potentially follow the
+// previously Matched symbol at the time b exception was panicn.
+//
+//
If the set of expected tokens is not known and could not be computed,
+// b method returns {@code nil}.
+//
+// @return The set of token types that could potentially follow the current
+// state in the ATN, or {@code nil} if the information is not available.
+// /
+func (b *BaseRecognitionException) getExpectedTokens() *IntervalSet {
+ if b.recognizer != nil {
+ return b.recognizer.GetATN().getExpectedTokens(b.offendingState, b.ctx)
+ }
+
+ return nil
+}
+
+func (b *BaseRecognitionException) String() string {
+ return b.message
+}
+
+type LexerNoViableAltException struct {
+ *BaseRecognitionException
+
+ startIndex int
+ deadEndConfigs ATNConfigSet
+}
+
+func NewLexerNoViableAltException(lexer Lexer, input CharStream, startIndex int, deadEndConfigs ATNConfigSet) *LexerNoViableAltException {
+
+ l := new(LexerNoViableAltException)
+
+ l.BaseRecognitionException = NewBaseRecognitionException("", lexer, input, nil)
+
+ l.startIndex = startIndex
+ l.deadEndConfigs = deadEndConfigs
+
+ return l
+}
+
+func (l *LexerNoViableAltException) String() string {
+ symbol := ""
+ if l.startIndex >= 0 && l.startIndex < l.input.Size() {
+ symbol = l.input.(CharStream).GetTextFromInterval(NewInterval(l.startIndex, l.startIndex))
+ }
+ return "LexerNoViableAltException" + symbol
+}
+
+type NoViableAltException struct {
+ *BaseRecognitionException
+
+ startToken Token
+ offendingToken Token
+ ctx ParserRuleContext
+ deadEndConfigs ATNConfigSet
+}
+
+// Indicates that the parser could not decide which of two or more paths
+// to take based upon the remaining input. It tracks the starting token
+// of the offending input and also knows where the parser was
+// in the various paths when the error. Reported by ReportNoViableAlternative()
+//
+func NewNoViableAltException(recognizer Parser, input TokenStream, startToken Token, offendingToken Token, deadEndConfigs ATNConfigSet, ctx ParserRuleContext) *NoViableAltException {
+
+ if ctx == nil {
+ ctx = recognizer.GetParserRuleContext()
+ }
+
+ if offendingToken == nil {
+ offendingToken = recognizer.GetCurrentToken()
+ }
+
+ if startToken == nil {
+ startToken = recognizer.GetCurrentToken()
+ }
+
+ if input == nil {
+ input = recognizer.GetInputStream().(TokenStream)
+ }
+
+ n := new(NoViableAltException)
+ n.BaseRecognitionException = NewBaseRecognitionException("", recognizer, input, ctx)
+
+ // Which configurations did we try at input.Index() that couldn't Match
+ // input.LT(1)?//
+ n.deadEndConfigs = deadEndConfigs
+ // The token object at the start index the input stream might
+ // not be buffering tokens so get a reference to it. (At the
+ // time the error occurred, of course the stream needs to keep a
+ // buffer all of the tokens but later we might not have access to those.)
+ n.startToken = startToken
+ n.offendingToken = offendingToken
+
+ return n
+}
+
+type InputMisMatchException struct {
+ *BaseRecognitionException
+}
+
+// This signifies any kind of mismatched input exceptions such as
+// when the current input does not Match the expected token.
+//
+func NewInputMisMatchException(recognizer Parser) *InputMisMatchException {
+
+ i := new(InputMisMatchException)
+ i.BaseRecognitionException = NewBaseRecognitionException("", recognizer, recognizer.GetInputStream(), recognizer.GetParserRuleContext())
+
+ i.offendingToken = recognizer.GetCurrentToken()
+
+ return i
+
+}
+
+// A semantic predicate failed during validation. Validation of predicates
+// occurs when normally parsing the alternative just like Matching a token.
+// Disambiguating predicate evaluation occurs when we test a predicate during
+// prediction.
+
+type FailedPredicateException struct {
+ *BaseRecognitionException
+
+ ruleIndex int
+ predicateIndex int
+ predicate string
+}
+
+func NewFailedPredicateException(recognizer Parser, predicate string, message string) *FailedPredicateException {
+
+ f := new(FailedPredicateException)
+
+ f.BaseRecognitionException = NewBaseRecognitionException(f.formatMessage(predicate, message), recognizer, recognizer.GetInputStream(), recognizer.GetParserRuleContext())
+
+ s := recognizer.GetInterpreter().atn.states[recognizer.GetState()]
+ trans := s.GetTransitions()[0]
+ if trans2, ok := trans.(*PredicateTransition); ok {
+ f.ruleIndex = trans2.ruleIndex
+ f.predicateIndex = trans2.predIndex
+ } else {
+ f.ruleIndex = 0
+ f.predicateIndex = 0
+ }
+ f.predicate = predicate
+ f.offendingToken = recognizer.GetCurrentToken()
+
+ return f
+}
+
+func (f *FailedPredicateException) formatMessage(predicate, message string) string {
+ if message != "" {
+ return message
+ }
+
+ return "failed predicate: {" + predicate + "}?"
+}
+
+type ParseCancellationException struct {
+}
+
+func NewParseCancellationException() *ParseCancellationException {
+ // Error.call(this)
+ // Error.captureStackTrace(this, ParseCancellationException)
+ return new(ParseCancellationException)
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/file_stream.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/file_stream.go
new file mode 100644
index 000000000..842170c08
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/file_stream.go
@@ -0,0 +1,49 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "bytes"
+ "io"
+ "os"
+)
+
+// This is an InputStream that is loaded from a file all at once
+// when you construct the object.
+
+type FileStream struct {
+ *InputStream
+
+ filename string
+}
+
+func NewFileStream(fileName string) (*FileStream, error) {
+
+ buf := bytes.NewBuffer(nil)
+
+ f, err := os.Open(fileName)
+ if err != nil {
+ return nil, err
+ }
+ defer f.Close()
+ _, err = io.Copy(buf, f)
+ if err != nil {
+ return nil, err
+ }
+
+ fs := new(FileStream)
+
+ fs.filename = fileName
+ s := string(buf.Bytes())
+
+ fs.InputStream = NewInputStream(s)
+
+ return fs, nil
+
+}
+
+func (f *FileStream) GetSourceName() string {
+ return f.filename
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/input_stream.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/input_stream.go
new file mode 100644
index 000000000..5ff270f53
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/input_stream.go
@@ -0,0 +1,113 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+type InputStream struct {
+ name string
+ index int
+ data []rune
+ size int
+}
+
+func NewInputStream(data string) *InputStream {
+
+ is := new(InputStream)
+
+ is.name = ""
+ is.index = 0
+ is.data = []rune(data)
+ is.size = len(is.data) // number of runes
+
+ return is
+}
+
+func (is *InputStream) reset() {
+ is.index = 0
+}
+
+func (is *InputStream) Consume() {
+ if is.index >= is.size {
+ // assert is.LA(1) == TokenEOF
+ panic("cannot consume EOF")
+ }
+ is.index++
+}
+
+func (is *InputStream) LA(offset int) int {
+
+ if offset == 0 {
+ return 0 // nil
+ }
+ if offset < 0 {
+ offset++ // e.g., translate LA(-1) to use offset=0
+ }
+ pos := is.index + offset - 1
+
+ if pos < 0 || pos >= is.size { // invalid
+ return TokenEOF
+ }
+
+ return int(is.data[pos])
+}
+
+func (is *InputStream) LT(offset int) int {
+ return is.LA(offset)
+}
+
+func (is *InputStream) Index() int {
+ return is.index
+}
+
+func (is *InputStream) Size() int {
+ return is.size
+}
+
+// mark/release do nothing we have entire buffer
+func (is *InputStream) Mark() int {
+ return -1
+}
+
+func (is *InputStream) Release(marker int) {
+}
+
+func (is *InputStream) Seek(index int) {
+ if index <= is.index {
+ is.index = index // just jump don't update stream state (line,...)
+ return
+ }
+ // seek forward
+ is.index = intMin(index, is.size)
+}
+
+func (is *InputStream) GetText(start int, stop int) string {
+ if stop >= is.size {
+ stop = is.size - 1
+ }
+ if start >= is.size {
+ return ""
+ }
+
+ return string(is.data[start : stop+1])
+}
+
+func (is *InputStream) GetTextFromTokens(start, stop Token) string {
+ if start != nil && stop != nil {
+ return is.GetTextFromInterval(NewInterval(start.GetTokenIndex(), stop.GetTokenIndex()))
+ }
+
+ return ""
+}
+
+func (is *InputStream) GetTextFromInterval(i *Interval) string {
+ return is.GetText(i.Start, i.Stop)
+}
+
+func (*InputStream) GetSourceName() string {
+ return "Obtained from string"
+}
+
+func (is *InputStream) String() string {
+ return string(is.data)
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/int_stream.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/int_stream.go
new file mode 100644
index 000000000..438e0ea6e
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/int_stream.go
@@ -0,0 +1,16 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+type IntStream interface {
+ Consume()
+ LA(int) int
+ Mark() int
+ Release(marker int)
+ Index() int
+ Seek(index int)
+ Size() int
+ GetSourceName() string
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/interval_set.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/interval_set.go
new file mode 100644
index 000000000..1e9393adb
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/interval_set.go
@@ -0,0 +1,308 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "strconv"
+ "strings"
+)
+
+type Interval struct {
+ Start int
+ Stop int
+}
+
+/* stop is not included! */
+func NewInterval(start, stop int) *Interval {
+ i := new(Interval)
+
+ i.Start = start
+ i.Stop = stop
+ return i
+}
+
+func (i *Interval) Contains(item int) bool {
+ return item >= i.Start && item < i.Stop
+}
+
+func (i *Interval) String() string {
+ if i.Start == i.Stop-1 {
+ return strconv.Itoa(i.Start)
+ }
+
+ return strconv.Itoa(i.Start) + ".." + strconv.Itoa(i.Stop-1)
+}
+
+func (i *Interval) length() int {
+ return i.Stop - i.Start
+}
+
+type IntervalSet struct {
+ intervals []*Interval
+ readOnly bool
+}
+
+func NewIntervalSet() *IntervalSet {
+
+ i := new(IntervalSet)
+
+ i.intervals = nil
+ i.readOnly = false
+
+ return i
+}
+
+func (i *IntervalSet) first() int {
+ if len(i.intervals) == 0 {
+ return TokenInvalidType
+ }
+
+ return i.intervals[0].Start
+}
+
+func (i *IntervalSet) addOne(v int) {
+ i.addInterval(NewInterval(v, v+1))
+}
+
+func (i *IntervalSet) addRange(l, h int) {
+ i.addInterval(NewInterval(l, h+1))
+}
+
+func (i *IntervalSet) addInterval(v *Interval) {
+ if i.intervals == nil {
+ i.intervals = make([]*Interval, 0)
+ i.intervals = append(i.intervals, v)
+ } else {
+ // find insert pos
+ for k, interval := range i.intervals {
+ // distinct range -> insert
+ if v.Stop < interval.Start {
+ i.intervals = append(i.intervals[0:k], append([]*Interval{v}, i.intervals[k:]...)...)
+ return
+ } else if v.Stop == interval.Start {
+ i.intervals[k].Start = v.Start
+ return
+ } else if v.Start <= interval.Stop {
+ i.intervals[k] = NewInterval(intMin(interval.Start, v.Start), intMax(interval.Stop, v.Stop))
+
+ // if not applying to end, merge potential overlaps
+ if k < len(i.intervals)-1 {
+ l := i.intervals[k]
+ r := i.intervals[k+1]
+ // if r contained in l
+ if l.Stop >= r.Stop {
+ i.intervals = append(i.intervals[0:k+1], i.intervals[k+2:]...)
+ } else if l.Stop >= r.Start { // partial overlap
+ i.intervals[k] = NewInterval(l.Start, r.Stop)
+ i.intervals = append(i.intervals[0:k+1], i.intervals[k+2:]...)
+ }
+ }
+ return
+ }
+ }
+ // greater than any exiting
+ i.intervals = append(i.intervals, v)
+ }
+}
+
+func (i *IntervalSet) addSet(other *IntervalSet) *IntervalSet {
+ if other.intervals != nil {
+ for k := 0; k < len(other.intervals); k++ {
+ i2 := other.intervals[k]
+ i.addInterval(NewInterval(i2.Start, i2.Stop))
+ }
+ }
+ return i
+}
+
+func (i *IntervalSet) complement(start int, stop int) *IntervalSet {
+ result := NewIntervalSet()
+ result.addInterval(NewInterval(start, stop+1))
+ for j := 0; j < len(i.intervals); j++ {
+ result.removeRange(i.intervals[j])
+ }
+ return result
+}
+
+func (i *IntervalSet) contains(item int) bool {
+ if i.intervals == nil {
+ return false
+ }
+ for k := 0; k < len(i.intervals); k++ {
+ if i.intervals[k].Contains(item) {
+ return true
+ }
+ }
+ return false
+}
+
+func (i *IntervalSet) length() int {
+ len := 0
+
+ for _, v := range i.intervals {
+ len += v.length()
+ }
+
+ return len
+}
+
+func (i *IntervalSet) removeRange(v *Interval) {
+ if v.Start == v.Stop-1 {
+ i.removeOne(v.Start)
+ } else if i.intervals != nil {
+ k := 0
+ for n := 0; n < len(i.intervals); n++ {
+ ni := i.intervals[k]
+ // intervals are ordered
+ if v.Stop <= ni.Start {
+ return
+ } else if v.Start > ni.Start && v.Stop < ni.Stop {
+ i.intervals[k] = NewInterval(ni.Start, v.Start)
+ x := NewInterval(v.Stop, ni.Stop)
+ // i.intervals.splice(k, 0, x)
+ i.intervals = append(i.intervals[0:k], append([]*Interval{x}, i.intervals[k:]...)...)
+ return
+ } else if v.Start <= ni.Start && v.Stop >= ni.Stop {
+ // i.intervals.splice(k, 1)
+ i.intervals = append(i.intervals[0:k], i.intervals[k+1:]...)
+ k = k - 1 // need another pass
+ } else if v.Start < ni.Stop {
+ i.intervals[k] = NewInterval(ni.Start, v.Start)
+ } else if v.Stop < ni.Stop {
+ i.intervals[k] = NewInterval(v.Stop, ni.Stop)
+ }
+ k++
+ }
+ }
+}
+
+func (i *IntervalSet) removeOne(v int) {
+ if i.intervals != nil {
+ for k := 0; k < len(i.intervals); k++ {
+ ki := i.intervals[k]
+ // intervals i ordered
+ if v < ki.Start {
+ return
+ } else if v == ki.Start && v == ki.Stop-1 {
+ // i.intervals.splice(k, 1)
+ i.intervals = append(i.intervals[0:k], i.intervals[k+1:]...)
+ return
+ } else if v == ki.Start {
+ i.intervals[k] = NewInterval(ki.Start+1, ki.Stop)
+ return
+ } else if v == ki.Stop-1 {
+ i.intervals[k] = NewInterval(ki.Start, ki.Stop-1)
+ return
+ } else if v < ki.Stop-1 {
+ x := NewInterval(ki.Start, v)
+ ki.Start = v + 1
+ // i.intervals.splice(k, 0, x)
+ i.intervals = append(i.intervals[0:k], append([]*Interval{x}, i.intervals[k:]...)...)
+ return
+ }
+ }
+ }
+}
+
+func (i *IntervalSet) String() string {
+ return i.StringVerbose(nil, nil, false)
+}
+
+func (i *IntervalSet) StringVerbose(literalNames []string, symbolicNames []string, elemsAreChar bool) string {
+
+ if i.intervals == nil {
+ return "{}"
+ } else if literalNames != nil || symbolicNames != nil {
+ return i.toTokenString(literalNames, symbolicNames)
+ } else if elemsAreChar {
+ return i.toCharString()
+ }
+
+ return i.toIndexString()
+}
+
+func (i *IntervalSet) toCharString() string {
+ names := make([]string, len(i.intervals))
+
+ var sb strings.Builder
+
+ for j := 0; j < len(i.intervals); j++ {
+ v := i.intervals[j]
+ if v.Stop == v.Start+1 {
+ if v.Start == TokenEOF {
+ names = append(names, "")
+ } else {
+ sb.WriteByte('\'')
+ sb.WriteRune(rune(v.Start))
+ sb.WriteByte('\'')
+ names = append(names, sb.String())
+ sb.Reset()
+ }
+ } else {
+ sb.WriteByte('\'')
+ sb.WriteRune(rune(v.Start))
+ sb.WriteString("'..'")
+ sb.WriteRune(rune(v.Stop - 1))
+ sb.WriteByte('\'')
+ names = append(names, sb.String())
+ sb.Reset()
+ }
+ }
+ if len(names) > 1 {
+ return "{" + strings.Join(names, ", ") + "}"
+ }
+
+ return names[0]
+}
+
+func (i *IntervalSet) toIndexString() string {
+
+ names := make([]string, 0)
+ for j := 0; j < len(i.intervals); j++ {
+ v := i.intervals[j]
+ if v.Stop == v.Start+1 {
+ if v.Start == TokenEOF {
+ names = append(names, "")
+ } else {
+ names = append(names, strconv.Itoa(v.Start))
+ }
+ } else {
+ names = append(names, strconv.Itoa(v.Start)+".."+strconv.Itoa(v.Stop-1))
+ }
+ }
+ if len(names) > 1 {
+ return "{" + strings.Join(names, ", ") + "}"
+ }
+
+ return names[0]
+}
+
+func (i *IntervalSet) toTokenString(literalNames []string, symbolicNames []string) string {
+ names := make([]string, 0)
+ for _, v := range i.intervals {
+ for j := v.Start; j < v.Stop; j++ {
+ names = append(names, i.elementName(literalNames, symbolicNames, j))
+ }
+ }
+ if len(names) > 1 {
+ return "{" + strings.Join(names, ", ") + "}"
+ }
+
+ return names[0]
+}
+
+func (i *IntervalSet) elementName(literalNames []string, symbolicNames []string, a int) string {
+ if a == TokenEOF {
+ return ""
+ } else if a == TokenEpsilon {
+ return ""
+ } else {
+ if a < len(literalNames) && literalNames[a] != "" {
+ return literalNames[a]
+ }
+
+ return symbolicNames[a]
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer.go
new file mode 100644
index 000000000..b04f04572
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer.go
@@ -0,0 +1,418 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "strconv"
+)
+
+// A lexer is recognizer that draws input symbols from a character stream.
+// lexer grammars result in a subclass of this object. A Lexer object
+// uses simplified Match() and error recovery mechanisms in the interest
+// of speed.
+///
+
+type Lexer interface {
+ TokenSource
+ Recognizer
+
+ Emit() Token
+
+ SetChannel(int)
+ PushMode(int)
+ PopMode() int
+ SetType(int)
+ SetMode(int)
+}
+
+type BaseLexer struct {
+ *BaseRecognizer
+
+ Interpreter ILexerATNSimulator
+ TokenStartCharIndex int
+ TokenStartLine int
+ TokenStartColumn int
+ ActionType int
+ Virt Lexer // The most derived lexer implementation. Allows virtual method calls.
+
+ input CharStream
+ factory TokenFactory
+ tokenFactorySourcePair *TokenSourceCharStreamPair
+ token Token
+ hitEOF bool
+ channel int
+ thetype int
+ modeStack IntStack
+ mode int
+ text string
+}
+
+func NewBaseLexer(input CharStream) *BaseLexer {
+
+ lexer := new(BaseLexer)
+
+ lexer.BaseRecognizer = NewBaseRecognizer()
+
+ lexer.input = input
+ lexer.factory = CommonTokenFactoryDEFAULT
+ lexer.tokenFactorySourcePair = &TokenSourceCharStreamPair{lexer, input}
+
+ lexer.Virt = lexer
+
+ lexer.Interpreter = nil // child classes must populate it
+
+ // The goal of all lexer rules/methods is to create a token object.
+ // l is an instance variable as multiple rules may collaborate to
+ // create a single token. NextToken will return l object after
+ // Matching lexer rule(s). If you subclass to allow multiple token
+ // emissions, then set l to the last token to be Matched or
+ // something nonnil so that the auto token emit mechanism will not
+ // emit another token.
+ lexer.token = nil
+
+ // What character index in the stream did the current token start at?
+ // Needed, for example, to get the text for current token. Set at
+ // the start of NextToken.
+ lexer.TokenStartCharIndex = -1
+
+ // The line on which the first character of the token resides///
+ lexer.TokenStartLine = -1
+
+ // The character position of first character within the line///
+ lexer.TokenStartColumn = -1
+
+ // Once we see EOF on char stream, next token will be EOF.
+ // If you have DONE : EOF then you see DONE EOF.
+ lexer.hitEOF = false
+
+ // The channel number for the current token///
+ lexer.channel = TokenDefaultChannel
+
+ // The token type for the current token///
+ lexer.thetype = TokenInvalidType
+
+ lexer.modeStack = make([]int, 0)
+ lexer.mode = LexerDefaultMode
+
+ // You can set the text for the current token to override what is in
+ // the input char buffer. Use setText() or can set l instance var.
+ // /
+ lexer.text = ""
+
+ return lexer
+}
+
+const (
+ LexerDefaultMode = 0
+ LexerMore = -2
+ LexerSkip = -3
+)
+
+const (
+ LexerDefaultTokenChannel = TokenDefaultChannel
+ LexerHidden = TokenHiddenChannel
+ LexerMinCharValue = 0x0000
+ LexerMaxCharValue = 0x10FFFF
+)
+
+func (b *BaseLexer) reset() {
+ // wack Lexer state variables
+ if b.input != nil {
+ b.input.Seek(0) // rewind the input
+ }
+ b.token = nil
+ b.thetype = TokenInvalidType
+ b.channel = TokenDefaultChannel
+ b.TokenStartCharIndex = -1
+ b.TokenStartColumn = -1
+ b.TokenStartLine = -1
+ b.text = ""
+
+ b.hitEOF = false
+ b.mode = LexerDefaultMode
+ b.modeStack = make([]int, 0)
+
+ b.Interpreter.reset()
+}
+
+func (b *BaseLexer) GetInterpreter() ILexerATNSimulator {
+ return b.Interpreter
+}
+
+func (b *BaseLexer) GetInputStream() CharStream {
+ return b.input
+}
+
+func (b *BaseLexer) GetSourceName() string {
+ return b.GrammarFileName
+}
+
+func (b *BaseLexer) SetChannel(v int) {
+ b.channel = v
+}
+
+func (b *BaseLexer) GetTokenFactory() TokenFactory {
+ return b.factory
+}
+
+func (b *BaseLexer) setTokenFactory(f TokenFactory) {
+ b.factory = f
+}
+
+func (b *BaseLexer) safeMatch() (ret int) {
+ defer func() {
+ if e := recover(); e != nil {
+ if re, ok := e.(RecognitionException); ok {
+ b.notifyListeners(re) // Report error
+ b.Recover(re)
+ ret = LexerSkip // default
+ }
+ }
+ }()
+
+ return b.Interpreter.Match(b.input, b.mode)
+}
+
+// Return a token from l source i.e., Match a token on the char stream.
+func (b *BaseLexer) NextToken() Token {
+ if b.input == nil {
+ panic("NextToken requires a non-nil input stream.")
+ }
+
+ tokenStartMarker := b.input.Mark()
+
+ // previously in finally block
+ defer func() {
+ // make sure we release marker after Match or
+ // unbuffered char stream will keep buffering
+ b.input.Release(tokenStartMarker)
+ }()
+
+ for {
+ if b.hitEOF {
+ b.EmitEOF()
+ return b.token
+ }
+ b.token = nil
+ b.channel = TokenDefaultChannel
+ b.TokenStartCharIndex = b.input.Index()
+ b.TokenStartColumn = b.Interpreter.GetCharPositionInLine()
+ b.TokenStartLine = b.Interpreter.GetLine()
+ b.text = ""
+ continueOuter := false
+ for {
+ b.thetype = TokenInvalidType
+ ttype := LexerSkip
+
+ ttype = b.safeMatch()
+
+ if b.input.LA(1) == TokenEOF {
+ b.hitEOF = true
+ }
+ if b.thetype == TokenInvalidType {
+ b.thetype = ttype
+ }
+ if b.thetype == LexerSkip {
+ continueOuter = true
+ break
+ }
+ if b.thetype != LexerMore {
+ break
+ }
+ }
+
+ if continueOuter {
+ continue
+ }
+ if b.token == nil {
+ b.Virt.Emit()
+ }
+ return b.token
+ }
+
+ return nil
+}
+
+// Instruct the lexer to Skip creating a token for current lexer rule
+// and look for another token. NextToken() knows to keep looking when
+// a lexer rule finishes with token set to SKIPTOKEN. Recall that
+// if token==nil at end of any token rule, it creates one for you
+// and emits it.
+// /
+func (b *BaseLexer) Skip() {
+ b.thetype = LexerSkip
+}
+
+func (b *BaseLexer) More() {
+ b.thetype = LexerMore
+}
+
+func (b *BaseLexer) SetMode(m int) {
+ b.mode = m
+}
+
+func (b *BaseLexer) PushMode(m int) {
+ if LexerATNSimulatorDebug {
+ fmt.Println("pushMode " + strconv.Itoa(m))
+ }
+ b.modeStack.Push(b.mode)
+ b.mode = m
+}
+
+func (b *BaseLexer) PopMode() int {
+ if len(b.modeStack) == 0 {
+ panic("Empty Stack")
+ }
+ if LexerATNSimulatorDebug {
+ fmt.Println("popMode back to " + fmt.Sprint(b.modeStack[0:len(b.modeStack)-1]))
+ }
+ i, _ := b.modeStack.Pop()
+ b.mode = i
+ return b.mode
+}
+
+func (b *BaseLexer) inputStream() CharStream {
+ return b.input
+}
+
+// SetInputStream resets the lexer input stream and associated lexer state.
+func (b *BaseLexer) SetInputStream(input CharStream) {
+ b.input = nil
+ b.tokenFactorySourcePair = &TokenSourceCharStreamPair{b, b.input}
+ b.reset()
+ b.input = input
+ b.tokenFactorySourcePair = &TokenSourceCharStreamPair{b, b.input}
+}
+
+func (b *BaseLexer) GetTokenSourceCharStreamPair() *TokenSourceCharStreamPair {
+ return b.tokenFactorySourcePair
+}
+
+// By default does not support multiple emits per NextToken invocation
+// for efficiency reasons. Subclass and override l method, NextToken,
+// and GetToken (to push tokens into a list and pull from that list
+// rather than a single variable as l implementation does).
+// /
+func (b *BaseLexer) EmitToken(token Token) {
+ b.token = token
+}
+
+// The standard method called to automatically emit a token at the
+// outermost lexical rule. The token object should point into the
+// char buffer start..stop. If there is a text override in 'text',
+// use that to set the token's text. Override l method to emit
+// custom Token objects or provide a Newfactory.
+// /
+func (b *BaseLexer) Emit() Token {
+ t := b.factory.Create(b.tokenFactorySourcePair, b.thetype, b.text, b.channel, b.TokenStartCharIndex, b.GetCharIndex()-1, b.TokenStartLine, b.TokenStartColumn)
+ b.EmitToken(t)
+ return t
+}
+
+func (b *BaseLexer) EmitEOF() Token {
+ cpos := b.GetCharPositionInLine()
+ lpos := b.GetLine()
+ eof := b.factory.Create(b.tokenFactorySourcePair, TokenEOF, "", TokenDefaultChannel, b.input.Index(), b.input.Index()-1, lpos, cpos)
+ b.EmitToken(eof)
+ return eof
+}
+
+func (b *BaseLexer) GetCharPositionInLine() int {
+ return b.Interpreter.GetCharPositionInLine()
+}
+
+func (b *BaseLexer) GetLine() int {
+ return b.Interpreter.GetLine()
+}
+
+func (b *BaseLexer) GetType() int {
+ return b.thetype
+}
+
+func (b *BaseLexer) SetType(t int) {
+ b.thetype = t
+}
+
+// What is the index of the current character of lookahead?///
+func (b *BaseLexer) GetCharIndex() int {
+ return b.input.Index()
+}
+
+// Return the text Matched so far for the current token or any text override.
+//Set the complete text of l token it wipes any previous changes to the text.
+func (b *BaseLexer) GetText() string {
+ if b.text != "" {
+ return b.text
+ }
+
+ return b.Interpreter.GetText(b.input)
+}
+
+func (b *BaseLexer) SetText(text string) {
+ b.text = text
+}
+
+func (b *BaseLexer) GetATN() *ATN {
+ return b.Interpreter.ATN()
+}
+
+// Return a list of all Token objects in input char stream.
+// Forces load of all tokens. Does not include EOF token.
+// /
+func (b *BaseLexer) GetAllTokens() []Token {
+ vl := b.Virt
+ tokens := make([]Token, 0)
+ t := vl.NextToken()
+ for t.GetTokenType() != TokenEOF {
+ tokens = append(tokens, t)
+ t = vl.NextToken()
+ }
+ return tokens
+}
+
+func (b *BaseLexer) notifyListeners(e RecognitionException) {
+ start := b.TokenStartCharIndex
+ stop := b.input.Index()
+ text := b.input.GetTextFromInterval(NewInterval(start, stop))
+ msg := "token recognition error at: '" + text + "'"
+ listener := b.GetErrorListenerDispatch()
+ listener.SyntaxError(b, nil, b.TokenStartLine, b.TokenStartColumn, msg, e)
+}
+
+func (b *BaseLexer) getErrorDisplayForChar(c rune) string {
+ if c == TokenEOF {
+ return ""
+ } else if c == '\n' {
+ return "\\n"
+ } else if c == '\t' {
+ return "\\t"
+ } else if c == '\r' {
+ return "\\r"
+ } else {
+ return string(c)
+ }
+}
+
+func (b *BaseLexer) getCharErrorDisplay(c rune) string {
+ return "'" + b.getErrorDisplayForChar(c) + "'"
+}
+
+// Lexers can normally Match any char in it's vocabulary after Matching
+// a token, so do the easy thing and just kill a character and hope
+// it all works out. You can instead use the rule invocation stack
+// to do sophisticated error recovery if you are in a fragment rule.
+// /
+func (b *BaseLexer) Recover(re RecognitionException) {
+ if b.input.LA(1) != TokenEOF {
+ if _, ok := re.(*LexerNoViableAltException); ok {
+ // Skip a char and try again
+ b.Interpreter.Consume(b.input)
+ } else {
+ // TODO: Do we lose character or line position information?
+ b.input.Consume()
+ }
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_action.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_action.go
new file mode 100644
index 000000000..5a325be13
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_action.go
@@ -0,0 +1,430 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import "strconv"
+
+const (
+ LexerActionTypeChannel = 0 //The type of a {@link LexerChannelAction} action.
+ LexerActionTypeCustom = 1 //The type of a {@link LexerCustomAction} action.
+ LexerActionTypeMode = 2 //The type of a {@link LexerModeAction} action.
+ LexerActionTypeMore = 3 //The type of a {@link LexerMoreAction} action.
+ LexerActionTypePopMode = 4 //The type of a {@link LexerPopModeAction} action.
+ LexerActionTypePushMode = 5 //The type of a {@link LexerPushModeAction} action.
+ LexerActionTypeSkip = 6 //The type of a {@link LexerSkipAction} action.
+ LexerActionTypeType = 7 //The type of a {@link LexerTypeAction} action.
+)
+
+type LexerAction interface {
+ getActionType() int
+ getIsPositionDependent() bool
+ execute(lexer Lexer)
+ hash() int
+ equals(other LexerAction) bool
+}
+
+type BaseLexerAction struct {
+ actionType int
+ isPositionDependent bool
+}
+
+func NewBaseLexerAction(action int) *BaseLexerAction {
+ la := new(BaseLexerAction)
+
+ la.actionType = action
+ la.isPositionDependent = false
+
+ return la
+}
+
+func (b *BaseLexerAction) execute(lexer Lexer) {
+ panic("Not implemented")
+}
+
+func (b *BaseLexerAction) getActionType() int {
+ return b.actionType
+}
+
+func (b *BaseLexerAction) getIsPositionDependent() bool {
+ return b.isPositionDependent
+}
+
+func (b *BaseLexerAction) hash() int {
+ return b.actionType
+}
+
+func (b *BaseLexerAction) equals(other LexerAction) bool {
+ return b == other
+}
+
+//
+// Implements the {@code Skip} lexer action by calling {@link Lexer//Skip}.
+//
+//
The {@code Skip} command does not have any parameters, so l action is
+// implemented as a singleton instance exposed by {@link //INSTANCE}.
+type LexerSkipAction struct {
+ *BaseLexerAction
+}
+
+func NewLexerSkipAction() *LexerSkipAction {
+ la := new(LexerSkipAction)
+ la.BaseLexerAction = NewBaseLexerAction(LexerActionTypeSkip)
+ return la
+}
+
+// Provides a singleton instance of l parameterless lexer action.
+var LexerSkipActionINSTANCE = NewLexerSkipAction()
+
+func (l *LexerSkipAction) execute(lexer Lexer) {
+ lexer.Skip()
+}
+
+func (l *LexerSkipAction) String() string {
+ return "skip"
+}
+
+// Implements the {@code type} lexer action by calling {@link Lexer//setType}
+// with the assigned type.
+type LexerTypeAction struct {
+ *BaseLexerAction
+
+ thetype int
+}
+
+func NewLexerTypeAction(thetype int) *LexerTypeAction {
+ l := new(LexerTypeAction)
+ l.BaseLexerAction = NewBaseLexerAction(LexerActionTypeType)
+ l.thetype = thetype
+ return l
+}
+
+func (l *LexerTypeAction) execute(lexer Lexer) {
+ lexer.SetType(l.thetype)
+}
+
+func (l *LexerTypeAction) hash() int {
+ h := murmurInit(0)
+ h = murmurUpdate(h, l.actionType)
+ h = murmurUpdate(h, l.thetype)
+ return murmurFinish(h, 2)
+}
+
+func (l *LexerTypeAction) equals(other LexerAction) bool {
+ if l == other {
+ return true
+ } else if _, ok := other.(*LexerTypeAction); !ok {
+ return false
+ } else {
+ return l.thetype == other.(*LexerTypeAction).thetype
+ }
+}
+
+func (l *LexerTypeAction) String() string {
+ return "actionType(" + strconv.Itoa(l.thetype) + ")"
+}
+
+// Implements the {@code pushMode} lexer action by calling
+// {@link Lexer//pushMode} with the assigned mode.
+type LexerPushModeAction struct {
+ *BaseLexerAction
+
+ mode int
+}
+
+func NewLexerPushModeAction(mode int) *LexerPushModeAction {
+
+ l := new(LexerPushModeAction)
+ l.BaseLexerAction = NewBaseLexerAction(LexerActionTypePushMode)
+
+ l.mode = mode
+ return l
+}
+
+//
This action is implemented by calling {@link Lexer//pushMode} with the
+// value provided by {@link //getMode}.
+func (l *LexerPushModeAction) execute(lexer Lexer) {
+ lexer.PushMode(l.mode)
+}
+
+func (l *LexerPushModeAction) hash() int {
+ h := murmurInit(0)
+ h = murmurUpdate(h, l.actionType)
+ h = murmurUpdate(h, l.mode)
+ return murmurFinish(h, 2)
+}
+
+func (l *LexerPushModeAction) equals(other LexerAction) bool {
+ if l == other {
+ return true
+ } else if _, ok := other.(*LexerPushModeAction); !ok {
+ return false
+ } else {
+ return l.mode == other.(*LexerPushModeAction).mode
+ }
+}
+
+func (l *LexerPushModeAction) String() string {
+ return "pushMode(" + strconv.Itoa(l.mode) + ")"
+}
+
+// Implements the {@code popMode} lexer action by calling {@link Lexer//popMode}.
+//
+//
The {@code popMode} command does not have any parameters, so l action is
+// implemented as a singleton instance exposed by {@link //INSTANCE}.
This action is implemented by calling {@link Lexer//mode} with the
+// value provided by {@link //getMode}.
+func (l *LexerModeAction) execute(lexer Lexer) {
+ lexer.SetMode(l.mode)
+}
+
+func (l *LexerModeAction) hash() int {
+ h := murmurInit(0)
+ h = murmurUpdate(h, l.actionType)
+ h = murmurUpdate(h, l.mode)
+ return murmurFinish(h, 2)
+}
+
+func (l *LexerModeAction) equals(other LexerAction) bool {
+ if l == other {
+ return true
+ } else if _, ok := other.(*LexerModeAction); !ok {
+ return false
+ } else {
+ return l.mode == other.(*LexerModeAction).mode
+ }
+}
+
+func (l *LexerModeAction) String() string {
+ return "mode(" + strconv.Itoa(l.mode) + ")"
+}
+
+// Executes a custom lexer action by calling {@link Recognizer//action} with the
+// rule and action indexes assigned to the custom action. The implementation of
+// a custom action is added to the generated code for the lexer in an override
+// of {@link Recognizer//action} when the grammar is compiled.
+//
+//
This class may represent embedded actions created with the {...}
+// syntax in ANTLR 4, as well as actions created for lexer commands where the
+// command argument could not be evaluated when the grammar was compiled.
+
+// Constructs a custom lexer action with the specified rule and action
+// indexes.
+//
+// @param ruleIndex The rule index to use for calls to
+// {@link Recognizer//action}.
+// @param actionIndex The action index to use for calls to
+// {@link Recognizer//action}.
+
+type LexerCustomAction struct {
+ *BaseLexerAction
+ ruleIndex, actionIndex int
+}
+
+func NewLexerCustomAction(ruleIndex, actionIndex int) *LexerCustomAction {
+ l := new(LexerCustomAction)
+ l.BaseLexerAction = NewBaseLexerAction(LexerActionTypeCustom)
+ l.ruleIndex = ruleIndex
+ l.actionIndex = actionIndex
+ l.isPositionDependent = true
+ return l
+}
+
+//
Custom actions are implemented by calling {@link Lexer//action} with the
+// appropriate rule and action indexes.
+func (l *LexerCustomAction) execute(lexer Lexer) {
+ lexer.Action(nil, l.ruleIndex, l.actionIndex)
+}
+
+func (l *LexerCustomAction) hash() int {
+ h := murmurInit(0)
+ h = murmurUpdate(h, l.actionType)
+ h = murmurUpdate(h, l.ruleIndex)
+ h = murmurUpdate(h, l.actionIndex)
+ return murmurFinish(h, 3)
+}
+
+func (l *LexerCustomAction) equals(other LexerAction) bool {
+ if l == other {
+ return true
+ } else if _, ok := other.(*LexerCustomAction); !ok {
+ return false
+ } else {
+ return l.ruleIndex == other.(*LexerCustomAction).ruleIndex && l.actionIndex == other.(*LexerCustomAction).actionIndex
+ }
+}
+
+// Implements the {@code channel} lexer action by calling
+// {@link Lexer//setChannel} with the assigned channel.
+// Constructs a New{@code channel} action with the specified channel value.
+// @param channel The channel value to pass to {@link Lexer//setChannel}.
+type LexerChannelAction struct {
+ *BaseLexerAction
+
+ channel int
+}
+
+func NewLexerChannelAction(channel int) *LexerChannelAction {
+ l := new(LexerChannelAction)
+ l.BaseLexerAction = NewBaseLexerAction(LexerActionTypeChannel)
+ l.channel = channel
+ return l
+}
+
+//
This action is implemented by calling {@link Lexer//setChannel} with the
+// value provided by {@link //getChannel}.
+func (l *LexerChannelAction) execute(lexer Lexer) {
+ lexer.SetChannel(l.channel)
+}
+
+func (l *LexerChannelAction) hash() int {
+ h := murmurInit(0)
+ h = murmurUpdate(h, l.actionType)
+ h = murmurUpdate(h, l.channel)
+ return murmurFinish(h, 2)
+}
+
+func (l *LexerChannelAction) equals(other LexerAction) bool {
+ if l == other {
+ return true
+ } else if _, ok := other.(*LexerChannelAction); !ok {
+ return false
+ } else {
+ return l.channel == other.(*LexerChannelAction).channel
+ }
+}
+
+func (l *LexerChannelAction) String() string {
+ return "channel(" + strconv.Itoa(l.channel) + ")"
+}
+
+// This implementation of {@link LexerAction} is used for tracking input offsets
+// for position-dependent actions within a {@link LexerActionExecutor}.
+//
+//
This action is not serialized as part of the ATN, and is only required for
+// position-dependent lexer actions which appear at a location other than the
+// end of a rule. For more information about DFA optimizations employed for
+// lexer actions, see {@link LexerActionExecutor//append} and
+// {@link LexerActionExecutor//fixOffsetBeforeMatch}.
+
+// Constructs a Newindexed custom action by associating a character offset
+// with a {@link LexerAction}.
+//
+//
Note: This class is only required for lexer actions for which
+// {@link LexerAction//isPositionDependent} returns {@code true}.
+//
+// @param offset The offset into the input {@link CharStream}, relative to
+// the token start index, at which the specified lexer action should be
+// executed.
+// @param action The lexer action to execute at a particular offset in the
+// input {@link CharStream}.
+type LexerIndexedCustomAction struct {
+ *BaseLexerAction
+
+ offset int
+ lexerAction LexerAction
+ isPositionDependent bool
+}
+
+func NewLexerIndexedCustomAction(offset int, lexerAction LexerAction) *LexerIndexedCustomAction {
+
+ l := new(LexerIndexedCustomAction)
+ l.BaseLexerAction = NewBaseLexerAction(lexerAction.getActionType())
+
+ l.offset = offset
+ l.lexerAction = lexerAction
+ l.isPositionDependent = true
+
+ return l
+}
+
+//
This method calls {@link //execute} on the result of {@link //getAction}
+// using the provided {@code lexer}.
+func (l *LexerIndexedCustomAction) execute(lexer Lexer) {
+ // assume the input stream position was properly set by the calling code
+ l.lexerAction.execute(lexer)
+}
+
+func (l *LexerIndexedCustomAction) hash() int {
+ h := murmurInit(0)
+ h = murmurUpdate(h, l.offset)
+ h = murmurUpdate(h, l.lexerAction.hash())
+ return murmurFinish(h, 2)
+}
+
+func (l *LexerIndexedCustomAction) equals(other LexerAction) bool {
+ if l == other {
+ return true
+ } else if _, ok := other.(*LexerIndexedCustomAction); !ok {
+ return false
+ } else {
+ return l.offset == other.(*LexerIndexedCustomAction).offset && l.lexerAction == other.(*LexerIndexedCustomAction).lexerAction
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_action_executor.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_action_executor.go
new file mode 100644
index 000000000..056941dd6
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_action_executor.go
@@ -0,0 +1,173 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+// Represents an executor for a sequence of lexer actions which traversed during
+// the Matching operation of a lexer rule (token).
+//
+//
The executor tracks position information for position-dependent lexer actions
+// efficiently, ensuring that actions appearing only at the end of the rule do
+// not cause bloating of the {@link DFA} created for the lexer.
+
+type LexerActionExecutor struct {
+ lexerActions []LexerAction
+ cachedHash int
+}
+
+func NewLexerActionExecutor(lexerActions []LexerAction) *LexerActionExecutor {
+
+ if lexerActions == nil {
+ lexerActions = make([]LexerAction, 0)
+ }
+
+ l := new(LexerActionExecutor)
+
+ l.lexerActions = lexerActions
+
+ // Caches the result of {@link //hashCode} since the hash code is an element
+ // of the performance-critical {@link LexerATNConfig//hashCode} operation.
+ l.cachedHash = murmurInit(57)
+ for _, a := range lexerActions {
+ l.cachedHash = murmurUpdate(l.cachedHash, a.hash())
+ }
+
+ return l
+}
+
+// Creates a {@link LexerActionExecutor} which executes the actions for
+// the input {@code lexerActionExecutor} followed by a specified
+// {@code lexerAction}.
+//
+// @param lexerActionExecutor The executor for actions already traversed by
+// the lexer while Matching a token within a particular
+// {@link LexerATNConfig}. If this is {@code nil}, the method behaves as
+// though it were an empty executor.
+// @param lexerAction The lexer action to execute after the actions
+// specified in {@code lexerActionExecutor}.
+//
+// @return A {@link LexerActionExecutor} for executing the combine actions
+// of {@code lexerActionExecutor} and {@code lexerAction}.
+func LexerActionExecutorappend(lexerActionExecutor *LexerActionExecutor, lexerAction LexerAction) *LexerActionExecutor {
+ if lexerActionExecutor == nil {
+ return NewLexerActionExecutor([]LexerAction{lexerAction})
+ }
+
+ return NewLexerActionExecutor(append(lexerActionExecutor.lexerActions, lexerAction))
+}
+
+// Creates a {@link LexerActionExecutor} which encodes the current offset
+// for position-dependent lexer actions.
+//
+//
Normally, when the executor encounters lexer actions where
+// {@link LexerAction//isPositionDependent} returns {@code true}, it calls
+// {@link IntStream//seek} on the input {@link CharStream} to set the input
+// position to the end of the current token. This behavior provides
+// for efficient DFA representation of lexer actions which appear at the end
+// of a lexer rule, even when the lexer rule Matches a variable number of
+// characters.
+//
+//
Prior to traversing a Match transition in the ATN, the current offset
+// from the token start index is assigned to all position-dependent lexer
+// actions which have not already been assigned a fixed offset. By storing
+// the offsets relative to the token start index, the DFA representation of
+// lexer actions which appear in the middle of tokens remains efficient due
+// to sharing among tokens of the same length, regardless of their absolute
+// position in the input stream.
+//
+//
If the current executor already has offsets assigned to all
+// position-dependent lexer actions, the method returns {@code this}.
+//
+// @param offset The current offset to assign to all position-dependent
+// lexer actions which do not already have offsets assigned.
+//
+// @return A {@link LexerActionExecutor} which stores input stream offsets
+// for all position-dependent lexer actions.
+// /
+func (l *LexerActionExecutor) fixOffsetBeforeMatch(offset int) *LexerActionExecutor {
+ var updatedLexerActions []LexerAction
+ for i := 0; i < len(l.lexerActions); i++ {
+ _, ok := l.lexerActions[i].(*LexerIndexedCustomAction)
+ if l.lexerActions[i].getIsPositionDependent() && !ok {
+ if updatedLexerActions == nil {
+ updatedLexerActions = make([]LexerAction, 0)
+
+ for _, a := range l.lexerActions {
+ updatedLexerActions = append(updatedLexerActions, a)
+ }
+ }
+
+ updatedLexerActions[i] = NewLexerIndexedCustomAction(offset, l.lexerActions[i])
+ }
+ }
+ if updatedLexerActions == nil {
+ return l
+ }
+
+ return NewLexerActionExecutor(updatedLexerActions)
+}
+
+// Execute the actions encapsulated by l executor within the context of a
+// particular {@link Lexer}.
+//
+//
This method calls {@link IntStream//seek} to set the position of the
+// {@code input} {@link CharStream} prior to calling
+// {@link LexerAction//execute} on a position-dependent action. Before the
+// method returns, the input position will be restored to the same position
+// it was in when the method was invoked.
+//
+// @param lexer The lexer instance.
+// @param input The input stream which is the source for the current token.
+// When l method is called, the current {@link IntStream//index} for
+// {@code input} should be the start of the following token, i.e. 1
+// character past the end of the current token.
+// @param startIndex The token start index. This value may be passed to
+// {@link IntStream//seek} to set the {@code input} position to the beginning
+// of the token.
+// /
+func (l *LexerActionExecutor) execute(lexer Lexer, input CharStream, startIndex int) {
+ requiresSeek := false
+ stopIndex := input.Index()
+
+ defer func() {
+ if requiresSeek {
+ input.Seek(stopIndex)
+ }
+ }()
+
+ for i := 0; i < len(l.lexerActions); i++ {
+ lexerAction := l.lexerActions[i]
+ if la, ok := lexerAction.(*LexerIndexedCustomAction); ok {
+ offset := la.offset
+ input.Seek(startIndex + offset)
+ lexerAction = la.lexerAction
+ requiresSeek = (startIndex + offset) != stopIndex
+ } else if lexerAction.getIsPositionDependent() {
+ input.Seek(stopIndex)
+ requiresSeek = false
+ }
+ lexerAction.execute(lexer)
+ }
+}
+
+func (l *LexerActionExecutor) hash() int {
+ if l == nil {
+ return 61
+ }
+ return l.cachedHash
+}
+
+func (l *LexerActionExecutor) equals(other interface{}) bool {
+ if l == other {
+ return true
+ }
+ othert, ok := other.(*LexerActionExecutor)
+ if !ok {
+ return false
+ }
+ if othert == nil {
+ return false
+ }
+ return l.cachedHash == othert.cachedHash && &l.lexerActions == &othert.lexerActions
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_atn_simulator.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_atn_simulator.go
new file mode 100644
index 000000000..dc05153ea
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/lexer_atn_simulator.go
@@ -0,0 +1,679 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+var (
+ LexerATNSimulatorDebug = false
+ LexerATNSimulatorDFADebug = false
+
+ LexerATNSimulatorMinDFAEdge = 0
+ LexerATNSimulatorMaxDFAEdge = 127 // forces unicode to stay in ATN
+
+ LexerATNSimulatorMatchCalls = 0
+)
+
+type ILexerATNSimulator interface {
+ IATNSimulator
+
+ reset()
+ Match(input CharStream, mode int) int
+ GetCharPositionInLine() int
+ GetLine() int
+ GetText(input CharStream) string
+ Consume(input CharStream)
+}
+
+type LexerATNSimulator struct {
+ *BaseATNSimulator
+
+ recog Lexer
+ predictionMode int
+ mergeCache DoubleDict
+ startIndex int
+ Line int
+ CharPositionInLine int
+ mode int
+ prevAccept *SimState
+ MatchCalls int
+}
+
+func NewLexerATNSimulator(recog Lexer, atn *ATN, decisionToDFA []*DFA, sharedContextCache *PredictionContextCache) *LexerATNSimulator {
+ l := new(LexerATNSimulator)
+
+ l.BaseATNSimulator = NewBaseATNSimulator(atn, sharedContextCache)
+
+ l.decisionToDFA = decisionToDFA
+ l.recog = recog
+ // The current token's starting index into the character stream.
+ // Shared across DFA to ATN simulation in case the ATN fails and the
+ // DFA did not have a previous accept state. In l case, we use the
+ // ATN-generated exception object.
+ l.startIndex = -1
+ // line number 1..n within the input///
+ l.Line = 1
+ // The index of the character relative to the beginning of the line
+ // 0..n-1///
+ l.CharPositionInLine = 0
+ l.mode = LexerDefaultMode
+ // Used during DFA/ATN exec to record the most recent accept configuration
+ // info
+ l.prevAccept = NewSimState()
+ // done
+ return l
+}
+
+func (l *LexerATNSimulator) copyState(simulator *LexerATNSimulator) {
+ l.CharPositionInLine = simulator.CharPositionInLine
+ l.Line = simulator.Line
+ l.mode = simulator.mode
+ l.startIndex = simulator.startIndex
+}
+
+func (l *LexerATNSimulator) Match(input CharStream, mode int) int {
+ l.MatchCalls++
+ l.mode = mode
+ mark := input.Mark()
+
+ defer func() {
+ input.Release(mark)
+ }()
+
+ l.startIndex = input.Index()
+ l.prevAccept.reset()
+
+ dfa := l.decisionToDFA[mode]
+
+ var s0 *DFAState
+ l.atn.stateMu.RLock()
+ s0 = dfa.getS0()
+ l.atn.stateMu.RUnlock()
+
+ if s0 == nil {
+ return l.MatchATN(input)
+ }
+
+ return l.execATN(input, s0)
+}
+
+func (l *LexerATNSimulator) reset() {
+ l.prevAccept.reset()
+ l.startIndex = -1
+ l.Line = 1
+ l.CharPositionInLine = 0
+ l.mode = LexerDefaultMode
+}
+
+func (l *LexerATNSimulator) MatchATN(input CharStream) int {
+ startState := l.atn.modeToStartState[l.mode]
+
+ if LexerATNSimulatorDebug {
+ fmt.Println("MatchATN mode " + strconv.Itoa(l.mode) + " start: " + startState.String())
+ }
+ oldMode := l.mode
+ s0Closure := l.computeStartState(input, startState)
+ suppressEdge := s0Closure.hasSemanticContext
+ s0Closure.hasSemanticContext = false
+
+ next := l.addDFAState(s0Closure, suppressEdge)
+
+ predict := l.execATN(input, next)
+
+ if LexerATNSimulatorDebug {
+ fmt.Println("DFA after MatchATN: " + l.decisionToDFA[oldMode].ToLexerString())
+ }
+ return predict
+}
+
+func (l *LexerATNSimulator) execATN(input CharStream, ds0 *DFAState) int {
+
+ if LexerATNSimulatorDebug {
+ fmt.Println("start state closure=" + ds0.configs.String())
+ }
+ if ds0.isAcceptState {
+ // allow zero-length tokens
+ l.captureSimState(l.prevAccept, input, ds0)
+ }
+ t := input.LA(1)
+ s := ds0 // s is current/from DFA state
+
+ for { // while more work
+ if LexerATNSimulatorDebug {
+ fmt.Println("execATN loop starting closure: " + s.configs.String())
+ }
+
+ // As we move src->trg, src->trg, we keep track of the previous trg to
+ // avoid looking up the DFA state again, which is expensive.
+ // If the previous target was already part of the DFA, we might
+ // be able to avoid doing a reach operation upon t. If s!=nil,
+ // it means that semantic predicates didn't prevent us from
+ // creating a DFA state. Once we know s!=nil, we check to see if
+ // the DFA state has an edge already for t. If so, we can just reuse
+ // it's configuration set there's no point in re-computing it.
+ // This is kind of like doing DFA simulation within the ATN
+ // simulation because DFA simulation is really just a way to avoid
+ // computing reach/closure sets. Technically, once we know that
+ // we have a previously added DFA state, we could jump over to
+ // the DFA simulator. But, that would mean popping back and forth
+ // a lot and making things more complicated algorithmically.
+ // This optimization makes a lot of sense for loops within DFA.
+ // A character will take us back to an existing DFA state
+ // that already has lots of edges out of it. e.g., .* in comments.
+ target := l.getExistingTargetState(s, t)
+ if target == nil {
+ target = l.computeTargetState(input, s, t)
+ // print("Computed:" + str(target))
+ }
+ if target == ATNSimulatorError {
+ break
+ }
+ // If l is a consumable input element, make sure to consume before
+ // capturing the accept state so the input index, line, and char
+ // position accurately reflect the state of the interpreter at the
+ // end of the token.
+ if t != TokenEOF {
+ l.Consume(input)
+ }
+ if target.isAcceptState {
+ l.captureSimState(l.prevAccept, input, target)
+ if t == TokenEOF {
+ break
+ }
+ }
+ t = input.LA(1)
+ s = target // flip current DFA target becomes Newsrc/from state
+ }
+
+ return l.failOrAccept(l.prevAccept, input, s.configs, t)
+}
+
+// Get an existing target state for an edge in the DFA. If the target state
+// for the edge has not yet been computed or is otherwise not available,
+// l method returns {@code nil}.
+//
+// @param s The current DFA state
+// @param t The next input symbol
+// @return The existing target DFA state for the given input symbol
+// {@code t}, or {@code nil} if the target state for l edge is not
+// already cached
+func (l *LexerATNSimulator) getExistingTargetState(s *DFAState, t int) *DFAState {
+ if t < LexerATNSimulatorMinDFAEdge || t > LexerATNSimulatorMaxDFAEdge {
+ return nil
+ }
+
+ l.atn.edgeMu.RLock()
+ defer l.atn.edgeMu.RUnlock()
+ if s.getEdges() == nil {
+ return nil
+ }
+ target := s.getIthEdge(t - LexerATNSimulatorMinDFAEdge)
+ if LexerATNSimulatorDebug && target != nil {
+ fmt.Println("reuse state " + strconv.Itoa(s.stateNumber) + " edge to " + strconv.Itoa(target.stateNumber))
+ }
+ return target
+}
+
+// Compute a target state for an edge in the DFA, and attempt to add the
+// computed state and corresponding edge to the DFA.
+//
+// @param input The input stream
+// @param s The current DFA state
+// @param t The next input symbol
+//
+// @return The computed target DFA state for the given input symbol
+// {@code t}. If {@code t} does not lead to a valid DFA state, l method
+// returns {@link //ERROR}.
+func (l *LexerATNSimulator) computeTargetState(input CharStream, s *DFAState, t int) *DFAState {
+ reach := NewOrderedATNConfigSet()
+
+ // if we don't find an existing DFA state
+ // Fill reach starting from closure, following t transitions
+ l.getReachableConfigSet(input, s.configs, reach.BaseATNConfigSet, t)
+
+ if len(reach.configs) == 0 { // we got nowhere on t from s
+ if !reach.hasSemanticContext {
+ // we got nowhere on t, don't panic out l knowledge it'd
+ // cause a failover from DFA later.
+ l.addDFAEdge(s, t, ATNSimulatorError, nil)
+ }
+ // stop when we can't Match any more char
+ return ATNSimulatorError
+ }
+ // Add an edge from s to target DFA found/created for reach
+ return l.addDFAEdge(s, t, nil, reach.BaseATNConfigSet)
+}
+
+func (l *LexerATNSimulator) failOrAccept(prevAccept *SimState, input CharStream, reach ATNConfigSet, t int) int {
+ if l.prevAccept.dfaState != nil {
+ lexerActionExecutor := prevAccept.dfaState.lexerActionExecutor
+ l.accept(input, lexerActionExecutor, l.startIndex, prevAccept.index, prevAccept.line, prevAccept.column)
+ return prevAccept.dfaState.prediction
+ }
+
+ // if no accept and EOF is first char, return EOF
+ if t == TokenEOF && input.Index() == l.startIndex {
+ return TokenEOF
+ }
+
+ panic(NewLexerNoViableAltException(l.recog, input, l.startIndex, reach))
+}
+
+// Given a starting configuration set, figure out all ATN configurations
+// we can reach upon input {@code t}. Parameter {@code reach} is a return
+// parameter.
+func (l *LexerATNSimulator) getReachableConfigSet(input CharStream, closure ATNConfigSet, reach ATNConfigSet, t int) {
+ // l is used to Skip processing for configs which have a lower priority
+ // than a config that already reached an accept state for the same rule
+ SkipAlt := ATNInvalidAltNumber
+
+ for _, cfg := range closure.GetItems() {
+ currentAltReachedAcceptState := (cfg.GetAlt() == SkipAlt)
+ if currentAltReachedAcceptState && cfg.(*LexerATNConfig).passedThroughNonGreedyDecision {
+ continue
+ }
+
+ if LexerATNSimulatorDebug {
+
+ fmt.Printf("testing %s at %s\n", l.GetTokenName(t), cfg.String()) // l.recog, true))
+ }
+
+ for _, trans := range cfg.GetState().GetTransitions() {
+ target := l.getReachableTarget(trans, t)
+ if target != nil {
+ lexerActionExecutor := cfg.(*LexerATNConfig).lexerActionExecutor
+ if lexerActionExecutor != nil {
+ lexerActionExecutor = lexerActionExecutor.fixOffsetBeforeMatch(input.Index() - l.startIndex)
+ }
+ treatEOFAsEpsilon := (t == TokenEOF)
+ config := NewLexerATNConfig3(cfg.(*LexerATNConfig), target, lexerActionExecutor)
+ if l.closure(input, config, reach,
+ currentAltReachedAcceptState, true, treatEOFAsEpsilon) {
+ // any remaining configs for l alt have a lower priority
+ // than the one that just reached an accept state.
+ SkipAlt = cfg.GetAlt()
+ }
+ }
+ }
+ }
+}
+
+func (l *LexerATNSimulator) accept(input CharStream, lexerActionExecutor *LexerActionExecutor, startIndex, index, line, charPos int) {
+ if LexerATNSimulatorDebug {
+ fmt.Printf("ACTION %v\n", lexerActionExecutor)
+ }
+ // seek to after last char in token
+ input.Seek(index)
+ l.Line = line
+ l.CharPositionInLine = charPos
+ if lexerActionExecutor != nil && l.recog != nil {
+ lexerActionExecutor.execute(l.recog, input, startIndex)
+ }
+}
+
+func (l *LexerATNSimulator) getReachableTarget(trans Transition, t int) ATNState {
+ if trans.Matches(t, 0, LexerMaxCharValue) {
+ return trans.getTarget()
+ }
+
+ return nil
+}
+
+func (l *LexerATNSimulator) computeStartState(input CharStream, p ATNState) *OrderedATNConfigSet {
+ configs := NewOrderedATNConfigSet()
+ for i := 0; i < len(p.GetTransitions()); i++ {
+ target := p.GetTransitions()[i].getTarget()
+ cfg := NewLexerATNConfig6(target, i+1, BasePredictionContextEMPTY)
+ l.closure(input, cfg, configs, false, false, false)
+ }
+
+ return configs
+}
+
+// Since the alternatives within any lexer decision are ordered by
+// preference, l method stops pursuing the closure as soon as an accept
+// state is reached. After the first accept state is reached by depth-first
+// search from {@code config}, all other (potentially reachable) states for
+// l rule would have a lower priority.
+//
+// @return {@code true} if an accept state is reached, otherwise
+// {@code false}.
+func (l *LexerATNSimulator) closure(input CharStream, config *LexerATNConfig, configs ATNConfigSet,
+ currentAltReachedAcceptState, speculative, treatEOFAsEpsilon bool) bool {
+
+ if LexerATNSimulatorDebug {
+ fmt.Println("closure(" + config.String() + ")") // config.String(l.recog, true) + ")")
+ }
+
+ _, ok := config.state.(*RuleStopState)
+ if ok {
+
+ if LexerATNSimulatorDebug {
+ if l.recog != nil {
+ fmt.Printf("closure at %s rule stop %s\n", l.recog.GetRuleNames()[config.state.GetRuleIndex()], config)
+ } else {
+ fmt.Printf("closure at rule stop %s\n", config)
+ }
+ }
+
+ if config.context == nil || config.context.hasEmptyPath() {
+ if config.context == nil || config.context.isEmpty() {
+ configs.Add(config, nil)
+ return true
+ }
+
+ configs.Add(NewLexerATNConfig2(config, config.state, BasePredictionContextEMPTY), nil)
+ currentAltReachedAcceptState = true
+ }
+ if config.context != nil && !config.context.isEmpty() {
+ for i := 0; i < config.context.length(); i++ {
+ if config.context.getReturnState(i) != BasePredictionContextEmptyReturnState {
+ newContext := config.context.GetParent(i) // "pop" return state
+ returnState := l.atn.states[config.context.getReturnState(i)]
+ cfg := NewLexerATNConfig2(config, returnState, newContext)
+ currentAltReachedAcceptState = l.closure(input, cfg, configs, currentAltReachedAcceptState, speculative, treatEOFAsEpsilon)
+ }
+ }
+ }
+ return currentAltReachedAcceptState
+ }
+ // optimization
+ if !config.state.GetEpsilonOnlyTransitions() {
+ if !currentAltReachedAcceptState || !config.passedThroughNonGreedyDecision {
+ configs.Add(config, nil)
+ }
+ }
+ for j := 0; j < len(config.state.GetTransitions()); j++ {
+ trans := config.state.GetTransitions()[j]
+ cfg := l.getEpsilonTarget(input, config, trans, configs, speculative, treatEOFAsEpsilon)
+ if cfg != nil {
+ currentAltReachedAcceptState = l.closure(input, cfg, configs,
+ currentAltReachedAcceptState, speculative, treatEOFAsEpsilon)
+ }
+ }
+ return currentAltReachedAcceptState
+}
+
+// side-effect: can alter configs.hasSemanticContext
+func (l *LexerATNSimulator) getEpsilonTarget(input CharStream, config *LexerATNConfig, trans Transition,
+ configs ATNConfigSet, speculative, treatEOFAsEpsilon bool) *LexerATNConfig {
+
+ var cfg *LexerATNConfig
+
+ if trans.getSerializationType() == TransitionRULE {
+
+ rt := trans.(*RuleTransition)
+ newContext := SingletonBasePredictionContextCreate(config.context, rt.followState.GetStateNumber())
+ cfg = NewLexerATNConfig2(config, trans.getTarget(), newContext)
+
+ } else if trans.getSerializationType() == TransitionPRECEDENCE {
+ panic("Precedence predicates are not supported in lexers.")
+ } else if trans.getSerializationType() == TransitionPREDICATE {
+ // Track traversing semantic predicates. If we traverse,
+ // we cannot add a DFA state for l "reach" computation
+ // because the DFA would not test the predicate again in the
+ // future. Rather than creating collections of semantic predicates
+ // like v3 and testing them on prediction, v4 will test them on the
+ // fly all the time using the ATN not the DFA. This is slower but
+ // semantically it's not used that often. One of the key elements to
+ // l predicate mechanism is not adding DFA states that see
+ // predicates immediately afterwards in the ATN. For example,
+
+ // a : ID {p1}? | ID {p2}?
+
+ // should create the start state for rule 'a' (to save start state
+ // competition), but should not create target of ID state. The
+ // collection of ATN states the following ID references includes
+ // states reached by traversing predicates. Since l is when we
+ // test them, we cannot cash the DFA state target of ID.
+
+ pt := trans.(*PredicateTransition)
+
+ if LexerATNSimulatorDebug {
+ fmt.Println("EVAL rule " + strconv.Itoa(trans.(*PredicateTransition).ruleIndex) + ":" + strconv.Itoa(pt.predIndex))
+ }
+ configs.SetHasSemanticContext(true)
+ if l.evaluatePredicate(input, pt.ruleIndex, pt.predIndex, speculative) {
+ cfg = NewLexerATNConfig4(config, trans.getTarget())
+ }
+ } else if trans.getSerializationType() == TransitionACTION {
+ if config.context == nil || config.context.hasEmptyPath() {
+ // execute actions anywhere in the start rule for a token.
+ //
+ // TODO: if the entry rule is invoked recursively, some
+ // actions may be executed during the recursive call. The
+ // problem can appear when hasEmptyPath() is true but
+ // isEmpty() is false. In l case, the config needs to be
+ // split into two contexts - one with just the empty path
+ // and another with everything but the empty path.
+ // Unfortunately, the current algorithm does not allow
+ // getEpsilonTarget to return two configurations, so
+ // additional modifications are needed before we can support
+ // the split operation.
+ lexerActionExecutor := LexerActionExecutorappend(config.lexerActionExecutor, l.atn.lexerActions[trans.(*ActionTransition).actionIndex])
+ cfg = NewLexerATNConfig3(config, trans.getTarget(), lexerActionExecutor)
+ } else {
+ // ignore actions in referenced rules
+ cfg = NewLexerATNConfig4(config, trans.getTarget())
+ }
+ } else if trans.getSerializationType() == TransitionEPSILON {
+ cfg = NewLexerATNConfig4(config, trans.getTarget())
+ } else if trans.getSerializationType() == TransitionATOM ||
+ trans.getSerializationType() == TransitionRANGE ||
+ trans.getSerializationType() == TransitionSET {
+ if treatEOFAsEpsilon {
+ if trans.Matches(TokenEOF, 0, LexerMaxCharValue) {
+ cfg = NewLexerATNConfig4(config, trans.getTarget())
+ }
+ }
+ }
+ return cfg
+}
+
+// Evaluate a predicate specified in the lexer.
+//
+//
If {@code speculative} is {@code true}, l method was called before
+// {@link //consume} for the Matched character. This method should call
+// {@link //consume} before evaluating the predicate to ensure position
+// sensitive values, including {@link Lexer//GetText}, {@link Lexer//GetLine},
+// and {@link Lexer//getcolumn}, properly reflect the current
+// lexer state. This method should restore {@code input} and the simulator
+// to the original state before returning (i.e. undo the actions made by the
+// call to {@link //consume}.
+//
+// @param input The input stream.
+// @param ruleIndex The rule containing the predicate.
+// @param predIndex The index of the predicate within the rule.
+// @param speculative {@code true} if the current index in {@code input} is
+// one character before the predicate's location.
+//
+// @return {@code true} if the specified predicate evaluates to
+// {@code true}.
+// /
+func (l *LexerATNSimulator) evaluatePredicate(input CharStream, ruleIndex, predIndex int, speculative bool) bool {
+ // assume true if no recognizer was provided
+ if l.recog == nil {
+ return true
+ }
+ if !speculative {
+ return l.recog.Sempred(nil, ruleIndex, predIndex)
+ }
+ savedcolumn := l.CharPositionInLine
+ savedLine := l.Line
+ index := input.Index()
+ marker := input.Mark()
+
+ defer func() {
+ l.CharPositionInLine = savedcolumn
+ l.Line = savedLine
+ input.Seek(index)
+ input.Release(marker)
+ }()
+
+ l.Consume(input)
+ return l.recog.Sempred(nil, ruleIndex, predIndex)
+}
+
+func (l *LexerATNSimulator) captureSimState(settings *SimState, input CharStream, dfaState *DFAState) {
+ settings.index = input.Index()
+ settings.line = l.Line
+ settings.column = l.CharPositionInLine
+ settings.dfaState = dfaState
+}
+
+func (l *LexerATNSimulator) addDFAEdge(from *DFAState, tk int, to *DFAState, cfgs ATNConfigSet) *DFAState {
+ if to == nil && cfgs != nil {
+ // leading to l call, ATNConfigSet.hasSemanticContext is used as a
+ // marker indicating dynamic predicate evaluation makes l edge
+ // dependent on the specific input sequence, so the static edge in the
+ // DFA should be omitted. The target DFAState is still created since
+ // execATN has the ability to reSynchronize with the DFA state cache
+ // following the predicate evaluation step.
+ //
+ // TJP notes: next time through the DFA, we see a pred again and eval.
+ // If that gets us to a previously created (but dangling) DFA
+ // state, we can continue in pure DFA mode from there.
+ // /
+ suppressEdge := cfgs.HasSemanticContext()
+ cfgs.SetHasSemanticContext(false)
+
+ to = l.addDFAState(cfgs, true)
+
+ if suppressEdge {
+ return to
+ }
+ }
+ // add the edge
+ if tk < LexerATNSimulatorMinDFAEdge || tk > LexerATNSimulatorMaxDFAEdge {
+ // Only track edges within the DFA bounds
+ return to
+ }
+ if LexerATNSimulatorDebug {
+ fmt.Println("EDGE " + from.String() + " -> " + to.String() + " upon " + strconv.Itoa(tk))
+ }
+ l.atn.edgeMu.Lock()
+ defer l.atn.edgeMu.Unlock()
+ if from.getEdges() == nil {
+ // make room for tokens 1..n and -1 masquerading as index 0
+ from.setEdges(make([]*DFAState, LexerATNSimulatorMaxDFAEdge-LexerATNSimulatorMinDFAEdge+1))
+ }
+ from.setIthEdge(tk-LexerATNSimulatorMinDFAEdge, to) // connect
+
+ return to
+}
+
+// Add a NewDFA state if there isn't one with l set of
+// configurations already. This method also detects the first
+// configuration containing an ATN rule stop state. Later, when
+// traversing the DFA, we will know which rule to accept.
+func (l *LexerATNSimulator) addDFAState(configs ATNConfigSet, suppressEdge bool) *DFAState {
+
+ proposed := NewDFAState(-1, configs)
+ var firstConfigWithRuleStopState ATNConfig
+
+ for _, cfg := range configs.GetItems() {
+
+ _, ok := cfg.GetState().(*RuleStopState)
+
+ if ok {
+ firstConfigWithRuleStopState = cfg
+ break
+ }
+ }
+ if firstConfigWithRuleStopState != nil {
+ proposed.isAcceptState = true
+ proposed.lexerActionExecutor = firstConfigWithRuleStopState.(*LexerATNConfig).lexerActionExecutor
+ proposed.setPrediction(l.atn.ruleToTokenType[firstConfigWithRuleStopState.GetState().GetRuleIndex()])
+ }
+ hash := proposed.hash()
+ dfa := l.decisionToDFA[l.mode]
+
+ l.atn.stateMu.Lock()
+ defer l.atn.stateMu.Unlock()
+ existing, ok := dfa.getState(hash)
+ if ok {
+ proposed = existing
+ } else {
+ proposed.stateNumber = dfa.numStates()
+ configs.SetReadOnly(true)
+ proposed.configs = configs
+ dfa.setState(hash, proposed)
+ }
+ if !suppressEdge {
+ dfa.setS0(proposed)
+ }
+ return proposed
+}
+
+func (l *LexerATNSimulator) getDFA(mode int) *DFA {
+ return l.decisionToDFA[mode]
+}
+
+// Get the text Matched so far for the current token.
+func (l *LexerATNSimulator) GetText(input CharStream) string {
+ // index is first lookahead char, don't include.
+ return input.GetTextFromInterval(NewInterval(l.startIndex, input.Index()-1))
+}
+
+func (l *LexerATNSimulator) Consume(input CharStream) {
+ curChar := input.LA(1)
+ if curChar == int('\n') {
+ l.Line++
+ l.CharPositionInLine = 0
+ } else {
+ l.CharPositionInLine++
+ }
+ input.Consume()
+}
+
+func (l *LexerATNSimulator) GetCharPositionInLine() int {
+ return l.CharPositionInLine
+}
+
+func (l *LexerATNSimulator) GetLine() int {
+ return l.Line
+}
+
+func (l *LexerATNSimulator) GetTokenName(tt int) string {
+ if tt == -1 {
+ return "EOF"
+ }
+
+ var sb strings.Builder
+ sb.Grow(6)
+ sb.WriteByte('\'')
+ sb.WriteRune(rune(tt))
+ sb.WriteByte('\'')
+
+ return sb.String()
+}
+
+func resetSimState(sim *SimState) {
+ sim.index = -1
+ sim.line = 0
+ sim.column = -1
+ sim.dfaState = nil
+}
+
+type SimState struct {
+ index int
+ line int
+ column int
+ dfaState *DFAState
+}
+
+func NewSimState() *SimState {
+ s := new(SimState)
+ resetSimState(s)
+ return s
+}
+
+func (s *SimState) reset() {
+ resetSimState(s)
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/ll1_analyzer.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/ll1_analyzer.go
new file mode 100644
index 000000000..6ffb37de6
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/ll1_analyzer.go
@@ -0,0 +1,212 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+type LL1Analyzer struct {
+ atn *ATN
+}
+
+func NewLL1Analyzer(atn *ATN) *LL1Analyzer {
+ la := new(LL1Analyzer)
+ la.atn = atn
+ return la
+}
+
+//* Special value added to the lookahead sets to indicate that we hit
+// a predicate during analysis if {@code seeThruPreds==false}.
+///
+const (
+ LL1AnalyzerHitPred = TokenInvalidType
+)
+
+//*
+// Calculates the SLL(1) expected lookahead set for each outgoing transition
+// of an {@link ATNState}. The returned array has one element for each
+// outgoing transition in {@code s}. If the closure from transition
+// i leads to a semantic predicate before Matching a symbol, the
+// element at index i of the result will be {@code nil}.
+//
+// @param s the ATN state
+// @return the expected symbols for each outgoing transition of {@code s}.
+func (la *LL1Analyzer) getDecisionLookahead(s ATNState) []*IntervalSet {
+ if s == nil {
+ return nil
+ }
+ count := len(s.GetTransitions())
+ look := make([]*IntervalSet, count)
+ for alt := 0; alt < count; alt++ {
+ look[alt] = NewIntervalSet()
+ lookBusy := newArray2DHashSet(nil, nil)
+ seeThruPreds := false // fail to get lookahead upon pred
+ la.look1(s.GetTransitions()[alt].getTarget(), nil, BasePredictionContextEMPTY, look[alt], lookBusy, NewBitSet(), seeThruPreds, false)
+ // Wipe out lookahead for la alternative if we found nothing
+ // or we had a predicate when we !seeThruPreds
+ if look[alt].length() == 0 || look[alt].contains(LL1AnalyzerHitPred) {
+ look[alt] = nil
+ }
+ }
+ return look
+}
+
+//*
+// Compute set of tokens that can follow {@code s} in the ATN in the
+// specified {@code ctx}.
+//
+//
If {@code ctx} is {@code nil} and the end of the rule containing
+// {@code s} is reached, {@link Token//EPSILON} is added to the result set.
+// If {@code ctx} is not {@code nil} and the end of the outermost rule is
+// reached, {@link Token//EOF} is added to the result set.
+//
+// @param s the ATN state
+// @param stopState the ATN state to stop at. This can be a
+// {@link BlockEndState} to detect epsilon paths through a closure.
+// @param ctx the complete parser context, or {@code nil} if the context
+// should be ignored
+//
+// @return The set of tokens that can follow {@code s} in the ATN in the
+// specified {@code ctx}.
+///
+func (la *LL1Analyzer) Look(s, stopState ATNState, ctx RuleContext) *IntervalSet {
+ r := NewIntervalSet()
+ seeThruPreds := true // ignore preds get all lookahead
+ var lookContext PredictionContext
+ if ctx != nil {
+ lookContext = predictionContextFromRuleContext(s.GetATN(), ctx)
+ }
+ la.look1(s, stopState, lookContext, r, newArray2DHashSet(nil, nil), NewBitSet(), seeThruPreds, true)
+ return r
+}
+
+//*
+// Compute set of tokens that can follow {@code s} in the ATN in the
+// specified {@code ctx}.
+//
+//
If {@code ctx} is {@code nil} and {@code stopState} or the end of the
+// rule containing {@code s} is reached, {@link Token//EPSILON} is added to
+// the result set. If {@code ctx} is not {@code nil} and {@code addEOF} is
+// {@code true} and {@code stopState} or the end of the outermost rule is
+// reached, {@link Token//EOF} is added to the result set.
+//
+// @param s the ATN state.
+// @param stopState the ATN state to stop at. This can be a
+// {@link BlockEndState} to detect epsilon paths through a closure.
+// @param ctx The outer context, or {@code nil} if the outer context should
+// not be used.
+// @param look The result lookahead set.
+// @param lookBusy A set used for preventing epsilon closures in the ATN
+// from causing a stack overflow. Outside code should pass
+// {@code NewSet} for la argument.
+// @param calledRuleStack A set used for preventing left recursion in the
+// ATN from causing a stack overflow. Outside code should pass
+// {@code NewBitSet()} for la argument.
+// @param seeThruPreds {@code true} to true semantic predicates as
+// implicitly {@code true} and "see through them", otherwise {@code false}
+// to treat semantic predicates as opaque and add {@link //HitPred} to the
+// result if one is encountered.
+// @param addEOF Add {@link Token//EOF} to the result if the end of the
+// outermost context is reached. This parameter has no effect if {@code ctx}
+// is {@code nil}.
+
+func (la *LL1Analyzer) look2(s, stopState ATNState, ctx PredictionContext, look *IntervalSet, lookBusy Set, calledRuleStack *BitSet, seeThruPreds, addEOF bool, i int) {
+
+ returnState := la.atn.states[ctx.getReturnState(i)]
+ la.look1(returnState, stopState, ctx.GetParent(i), look, lookBusy, calledRuleStack, seeThruPreds, addEOF)
+
+}
+
+func (la *LL1Analyzer) look1(s, stopState ATNState, ctx PredictionContext, look *IntervalSet, lookBusy Set, calledRuleStack *BitSet, seeThruPreds, addEOF bool) {
+
+ c := NewBaseATNConfig6(s, 0, ctx)
+
+ if lookBusy.Contains(c) {
+ return
+ }
+
+ lookBusy.Add(c)
+
+ if s == stopState {
+ if ctx == nil {
+ look.addOne(TokenEpsilon)
+ return
+ } else if ctx.isEmpty() && addEOF {
+ look.addOne(TokenEOF)
+ return
+ }
+ }
+
+ _, ok := s.(*RuleStopState)
+
+ if ok {
+ if ctx == nil {
+ look.addOne(TokenEpsilon)
+ return
+ } else if ctx.isEmpty() && addEOF {
+ look.addOne(TokenEOF)
+ return
+ }
+
+ if ctx != BasePredictionContextEMPTY {
+ removed := calledRuleStack.contains(s.GetRuleIndex())
+ defer func() {
+ if removed {
+ calledRuleStack.add(s.GetRuleIndex())
+ }
+ }()
+ calledRuleStack.remove(s.GetRuleIndex())
+ // run thru all possible stack tops in ctx
+ for i := 0; i < ctx.length(); i++ {
+ returnState := la.atn.states[ctx.getReturnState(i)]
+ la.look2(returnState, stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF, i)
+ }
+ return
+ }
+ }
+
+ n := len(s.GetTransitions())
+
+ for i := 0; i < n; i++ {
+ t := s.GetTransitions()[i]
+
+ if t1, ok := t.(*RuleTransition); ok {
+ if calledRuleStack.contains(t1.getTarget().GetRuleIndex()) {
+ continue
+ }
+
+ newContext := SingletonBasePredictionContextCreate(ctx, t1.followState.GetStateNumber())
+ la.look3(stopState, newContext, look, lookBusy, calledRuleStack, seeThruPreds, addEOF, t1)
+ } else if t2, ok := t.(AbstractPredicateTransition); ok {
+ if seeThruPreds {
+ la.look1(t2.getTarget(), stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF)
+ } else {
+ look.addOne(LL1AnalyzerHitPred)
+ }
+ } else if t.getIsEpsilon() {
+ la.look1(t.getTarget(), stopState, ctx, look, lookBusy, calledRuleStack, seeThruPreds, addEOF)
+ } else if _, ok := t.(*WildcardTransition); ok {
+ look.addRange(TokenMinUserTokenType, la.atn.maxTokenType)
+ } else {
+ set := t.getLabel()
+ if set != nil {
+ if _, ok := t.(*NotSetTransition); ok {
+ set = set.complement(TokenMinUserTokenType, la.atn.maxTokenType)
+ }
+ look.addSet(set)
+ }
+ }
+ }
+}
+
+func (la *LL1Analyzer) look3(stopState ATNState, ctx PredictionContext, look *IntervalSet, lookBusy Set, calledRuleStack *BitSet, seeThruPreds, addEOF bool, t1 *RuleTransition) {
+
+ newContext := SingletonBasePredictionContextCreate(ctx, t1.followState.GetStateNumber())
+
+ defer func() {
+ calledRuleStack.remove(t1.getTarget().GetRuleIndex())
+ }()
+
+ calledRuleStack.add(t1.getTarget().GetRuleIndex())
+ la.look1(t1.getTarget(), stopState, newContext, look, lookBusy, calledRuleStack, seeThruPreds, addEOF)
+
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser.go
new file mode 100644
index 000000000..2ab2f5605
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser.go
@@ -0,0 +1,718 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "strconv"
+)
+
+type Parser interface {
+ Recognizer
+
+ GetInterpreter() *ParserATNSimulator
+
+ GetTokenStream() TokenStream
+ GetTokenFactory() TokenFactory
+ GetParserRuleContext() ParserRuleContext
+ SetParserRuleContext(ParserRuleContext)
+ Consume() Token
+ GetParseListeners() []ParseTreeListener
+
+ GetErrorHandler() ErrorStrategy
+ SetErrorHandler(ErrorStrategy)
+ GetInputStream() IntStream
+ GetCurrentToken() Token
+ GetExpectedTokens() *IntervalSet
+ NotifyErrorListeners(string, Token, RecognitionException)
+ IsExpectedToken(int) bool
+ GetPrecedence() int
+ GetRuleInvocationStack(ParserRuleContext) []string
+}
+
+type BaseParser struct {
+ *BaseRecognizer
+
+ Interpreter *ParserATNSimulator
+ BuildParseTrees bool
+
+ input TokenStream
+ errHandler ErrorStrategy
+ precedenceStack IntStack
+ ctx ParserRuleContext
+
+ tracer *TraceListener
+ parseListeners []ParseTreeListener
+ _SyntaxErrors int
+}
+
+// p.is all the parsing support code essentially most of it is error
+// recovery stuff.//
+func NewBaseParser(input TokenStream) *BaseParser {
+
+ p := new(BaseParser)
+
+ p.BaseRecognizer = NewBaseRecognizer()
+
+ // The input stream.
+ p.input = nil
+ // The error handling strategy for the parser. The default value is a new
+ // instance of {@link DefaultErrorStrategy}.
+ p.errHandler = NewDefaultErrorStrategy()
+ p.precedenceStack = make([]int, 0)
+ p.precedenceStack.Push(0)
+ // The {@link ParserRuleContext} object for the currently executing rule.
+ // p.is always non-nil during the parsing process.
+ p.ctx = nil
+ // Specifies whether or not the parser should construct a parse tree during
+ // the parsing process. The default value is {@code true}.
+ p.BuildParseTrees = true
+ // When {@link //setTrace}{@code (true)} is called, a reference to the
+ // {@link TraceListener} is stored here so it can be easily removed in a
+ // later call to {@link //setTrace}{@code (false)}. The listener itself is
+ // implemented as a parser listener so p.field is not directly used by
+ // other parser methods.
+ p.tracer = nil
+ // The list of {@link ParseTreeListener} listeners registered to receive
+ // events during the parse.
+ p.parseListeners = nil
+ // The number of syntax errors Reported during parsing. p.value is
+ // incremented each time {@link //NotifyErrorListeners} is called.
+ p._SyntaxErrors = 0
+ p.SetInputStream(input)
+
+ return p
+}
+
+// p.field maps from the serialized ATN string to the deserialized {@link
+// ATN} with
+// bypass alternatives.
+//
+// @see ATNDeserializationOptions//isGenerateRuleBypassTransitions()
+//
+var bypassAltsAtnCache = make(map[string]int)
+
+// reset the parser's state//
+func (p *BaseParser) reset() {
+ if p.input != nil {
+ p.input.Seek(0)
+ }
+ p.errHandler.reset(p)
+ p.ctx = nil
+ p._SyntaxErrors = 0
+ p.SetTrace(nil)
+ p.precedenceStack = make([]int, 0)
+ p.precedenceStack.Push(0)
+ if p.Interpreter != nil {
+ p.Interpreter.reset()
+ }
+}
+
+func (p *BaseParser) GetErrorHandler() ErrorStrategy {
+ return p.errHandler
+}
+
+func (p *BaseParser) SetErrorHandler(e ErrorStrategy) {
+ p.errHandler = e
+}
+
+// Match current input symbol against {@code ttype}. If the symbol type
+// Matches, {@link ANTLRErrorStrategy//ReportMatch} and {@link //consume} are
+// called to complete the Match process.
+//
+//
If the symbol type does not Match,
+// {@link ANTLRErrorStrategy//recoverInline} is called on the current error
+// strategy to attempt recovery. If {@link //getBuildParseTree} is
+// {@code true} and the token index of the symbol returned by
+// {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to
+// the parse tree by calling {@link ParserRuleContext//addErrorNode}.
+//
+// @param ttype the token type to Match
+// @return the Matched symbol
+// @panics RecognitionException if the current input symbol did not Match
+// {@code ttype} and the error strategy could not recover from the
+// mismatched symbol
+
+func (p *BaseParser) Match(ttype int) Token {
+
+ t := p.GetCurrentToken()
+
+ if t.GetTokenType() == ttype {
+ p.errHandler.ReportMatch(p)
+ p.Consume()
+ } else {
+ t = p.errHandler.RecoverInline(p)
+ if p.BuildParseTrees && t.GetTokenIndex() == -1 {
+ // we must have conjured up a Newtoken during single token
+ // insertion
+ // if it's not the current symbol
+ p.ctx.AddErrorNode(t)
+ }
+ }
+
+ return t
+}
+
+// Match current input symbol as a wildcard. If the symbol type Matches
+// (i.e. has a value greater than 0), {@link ANTLRErrorStrategy//ReportMatch}
+// and {@link //consume} are called to complete the Match process.
+//
+//
If the symbol type does not Match,
+// {@link ANTLRErrorStrategy//recoverInline} is called on the current error
+// strategy to attempt recovery. If {@link //getBuildParseTree} is
+// {@code true} and the token index of the symbol returned by
+// {@link ANTLRErrorStrategy//recoverInline} is -1, the symbol is added to
+// the parse tree by calling {@link ParserRuleContext//addErrorNode}.
+//
+// @return the Matched symbol
+// @panics RecognitionException if the current input symbol did not Match
+// a wildcard and the error strategy could not recover from the mismatched
+// symbol
+
+func (p *BaseParser) MatchWildcard() Token {
+ t := p.GetCurrentToken()
+ if t.GetTokenType() > 0 {
+ p.errHandler.ReportMatch(p)
+ p.Consume()
+ } else {
+ t = p.errHandler.RecoverInline(p)
+ if p.BuildParseTrees && t.GetTokenIndex() == -1 {
+ // we must have conjured up a Newtoken during single token
+ // insertion
+ // if it's not the current symbol
+ p.ctx.AddErrorNode(t)
+ }
+ }
+ return t
+}
+
+func (p *BaseParser) GetParserRuleContext() ParserRuleContext {
+ return p.ctx
+}
+
+func (p *BaseParser) SetParserRuleContext(v ParserRuleContext) {
+ p.ctx = v
+}
+
+func (p *BaseParser) GetParseListeners() []ParseTreeListener {
+ if p.parseListeners == nil {
+ return make([]ParseTreeListener, 0)
+ }
+ return p.parseListeners
+}
+
+// Registers {@code listener} to receive events during the parsing process.
+//
+//
To support output-preserving grammar transformations (including but not
+// limited to left-recursion removal, automated left-factoring, and
+// optimized code generation), calls to listener methods during the parse
+// may differ substantially from calls made by
+// {@link ParseTreeWalker//DEFAULT} used after the parse is complete. In
+// particular, rule entry and exit events may occur in a different order
+// during the parse than after the parser. In addition, calls to certain
+// rule entry methods may be omitted.
+//
+//
With the following specific exceptions, calls to listener events are
+// deterministic, i.e. for identical input the calls to listener
+// methods will be the same.
+//
+//
+//
Alterations to the grammar used to generate code may change the
+// behavior of the listener calls.
+//
Alterations to the command line options passed to ANTLR 4 when
+// generating the parser may change the behavior of the listener calls.
+//
Changing the version of the ANTLR Tool used to generate the parser
+// may change the behavior of the listener calls.
+//
+//
+// @param listener the listener to add
+//
+// @panics nilPointerException if {@code} listener is {@code nil}
+//
+func (p *BaseParser) AddParseListener(listener ParseTreeListener) {
+ if listener == nil {
+ panic("listener")
+ }
+ if p.parseListeners == nil {
+ p.parseListeners = make([]ParseTreeListener, 0)
+ }
+ p.parseListeners = append(p.parseListeners, listener)
+}
+
+//
+// Remove {@code listener} from the list of parse listeners.
+//
+//
If {@code listener} is {@code nil} or has not been added as a parse
+// listener, p.method does nothing.
+// @param listener the listener to remove
+//
+func (p *BaseParser) RemoveParseListener(listener ParseTreeListener) {
+
+ if p.parseListeners != nil {
+
+ idx := -1
+ for i, v := range p.parseListeners {
+ if v == listener {
+ idx = i
+ break
+ }
+ }
+
+ if idx == -1 {
+ return
+ }
+
+ // remove the listener from the slice
+ p.parseListeners = append(p.parseListeners[0:idx], p.parseListeners[idx+1:]...)
+
+ if len(p.parseListeners) == 0 {
+ p.parseListeners = nil
+ }
+ }
+}
+
+// Remove all parse listeners.
+func (p *BaseParser) removeParseListeners() {
+ p.parseListeners = nil
+}
+
+// Notify any parse listeners of an enter rule event.
+func (p *BaseParser) TriggerEnterRuleEvent() {
+ if p.parseListeners != nil {
+ ctx := p.ctx
+ for _, listener := range p.parseListeners {
+ listener.EnterEveryRule(ctx)
+ ctx.EnterRule(listener)
+ }
+ }
+}
+
+//
+// Notify any parse listeners of an exit rule event.
+//
+// @see //addParseListener
+//
+func (p *BaseParser) TriggerExitRuleEvent() {
+ if p.parseListeners != nil {
+ // reverse order walk of listeners
+ ctx := p.ctx
+ l := len(p.parseListeners) - 1
+
+ for i := range p.parseListeners {
+ listener := p.parseListeners[l-i]
+ ctx.ExitRule(listener)
+ listener.ExitEveryRule(ctx)
+ }
+ }
+}
+
+func (p *BaseParser) GetInterpreter() *ParserATNSimulator {
+ return p.Interpreter
+}
+
+func (p *BaseParser) GetATN() *ATN {
+ return p.Interpreter.atn
+}
+
+func (p *BaseParser) GetTokenFactory() TokenFactory {
+ return p.input.GetTokenSource().GetTokenFactory()
+}
+
+// Tell our token source and error strategy about a Newway to create tokens.//
+func (p *BaseParser) setTokenFactory(factory TokenFactory) {
+ p.input.GetTokenSource().setTokenFactory(factory)
+}
+
+// The ATN with bypass alternatives is expensive to create so we create it
+// lazily.
+//
+// @panics UnsupportedOperationException if the current parser does not
+// implement the {@link //getSerializedATN()} method.
+//
+func (p *BaseParser) GetATNWithBypassAlts() {
+
+ // TODO
+ panic("Not implemented!")
+
+ // serializedAtn := p.getSerializedATN()
+ // if (serializedAtn == nil) {
+ // panic("The current parser does not support an ATN with bypass alternatives.")
+ // }
+ // result := p.bypassAltsAtnCache[serializedAtn]
+ // if (result == nil) {
+ // deserializationOptions := NewATNDeserializationOptions(nil)
+ // deserializationOptions.generateRuleBypassTransitions = true
+ // result = NewATNDeserializer(deserializationOptions).deserialize(serializedAtn)
+ // p.bypassAltsAtnCache[serializedAtn] = result
+ // }
+ // return result
+}
+
+// The preferred method of getting a tree pattern. For example, here's a
+// sample use:
+//
+//
+// ParseTree t = parser.expr()
+// ParseTreePattern p = parser.compileParseTreePattern("<ID>+0",
+// MyParser.RULE_expr)
+// ParseTreeMatch m = p.Match(t)
+// String id = m.Get("ID")
+//
+
+func (p *BaseParser) compileParseTreePattern(pattern, patternRuleIndex, lexer Lexer) {
+
+ panic("NewParseTreePatternMatcher not implemented!")
+ //
+ // if (lexer == nil) {
+ // if (p.GetTokenStream() != nil) {
+ // tokenSource := p.GetTokenStream().GetTokenSource()
+ // if _, ok := tokenSource.(ILexer); ok {
+ // lexer = tokenSource
+ // }
+ // }
+ // }
+ // if (lexer == nil) {
+ // panic("Parser can't discover a lexer to use")
+ // }
+
+ // m := NewParseTreePatternMatcher(lexer, p)
+ // return m.compile(pattern, patternRuleIndex)
+}
+
+func (p *BaseParser) GetInputStream() IntStream {
+ return p.GetTokenStream()
+}
+
+func (p *BaseParser) SetInputStream(input TokenStream) {
+ p.SetTokenStream(input)
+}
+
+func (p *BaseParser) GetTokenStream() TokenStream {
+ return p.input
+}
+
+// Set the token stream and reset the parser.//
+func (p *BaseParser) SetTokenStream(input TokenStream) {
+ p.input = nil
+ p.reset()
+ p.input = input
+}
+
+// Match needs to return the current input symbol, which gets put
+// into the label for the associated token ref e.g., x=ID.
+//
+func (p *BaseParser) GetCurrentToken() Token {
+ return p.input.LT(1)
+}
+
+func (p *BaseParser) NotifyErrorListeners(msg string, offendingToken Token, err RecognitionException) {
+ if offendingToken == nil {
+ offendingToken = p.GetCurrentToken()
+ }
+ p._SyntaxErrors++
+ line := offendingToken.GetLine()
+ column := offendingToken.GetColumn()
+ listener := p.GetErrorListenerDispatch()
+ listener.SyntaxError(p, offendingToken, line, column, msg, err)
+}
+
+func (p *BaseParser) Consume() Token {
+ o := p.GetCurrentToken()
+ if o.GetTokenType() != TokenEOF {
+ p.GetInputStream().Consume()
+ }
+ hasListener := p.parseListeners != nil && len(p.parseListeners) > 0
+ if p.BuildParseTrees || hasListener {
+ if p.errHandler.InErrorRecoveryMode(p) {
+ node := p.ctx.AddErrorNode(o)
+ if p.parseListeners != nil {
+ for _, l := range p.parseListeners {
+ l.VisitErrorNode(node)
+ }
+ }
+
+ } else {
+ node := p.ctx.AddTokenNode(o)
+ if p.parseListeners != nil {
+ for _, l := range p.parseListeners {
+ l.VisitTerminal(node)
+ }
+ }
+ }
+ // node.invokingState = p.state
+ }
+
+ return o
+}
+
+func (p *BaseParser) addContextToParseTree() {
+ // add current context to parent if we have a parent
+ if p.ctx.GetParent() != nil {
+ p.ctx.GetParent().(ParserRuleContext).AddChild(p.ctx)
+ }
+}
+
+func (p *BaseParser) EnterRule(localctx ParserRuleContext, state, ruleIndex int) {
+ p.SetState(state)
+ p.ctx = localctx
+ p.ctx.SetStart(p.input.LT(1))
+ if p.BuildParseTrees {
+ p.addContextToParseTree()
+ }
+ if p.parseListeners != nil {
+ p.TriggerEnterRuleEvent()
+ }
+}
+
+func (p *BaseParser) ExitRule() {
+ p.ctx.SetStop(p.input.LT(-1))
+ // trigger event on ctx, before it reverts to parent
+ if p.parseListeners != nil {
+ p.TriggerExitRuleEvent()
+ }
+ p.SetState(p.ctx.GetInvokingState())
+ if p.ctx.GetParent() != nil {
+ p.ctx = p.ctx.GetParent().(ParserRuleContext)
+ } else {
+ p.ctx = nil
+ }
+}
+
+func (p *BaseParser) EnterOuterAlt(localctx ParserRuleContext, altNum int) {
+ localctx.SetAltNumber(altNum)
+ // if we have Newlocalctx, make sure we replace existing ctx
+ // that is previous child of parse tree
+ if p.BuildParseTrees && p.ctx != localctx {
+ if p.ctx.GetParent() != nil {
+ p.ctx.GetParent().(ParserRuleContext).RemoveLastChild()
+ p.ctx.GetParent().(ParserRuleContext).AddChild(localctx)
+ }
+ }
+ p.ctx = localctx
+}
+
+// Get the precedence level for the top-most precedence rule.
+//
+// @return The precedence level for the top-most precedence rule, or -1 if
+// the parser context is not nested within a precedence rule.
+
+func (p *BaseParser) GetPrecedence() int {
+ if len(p.precedenceStack) == 0 {
+ return -1
+ }
+
+ return p.precedenceStack[len(p.precedenceStack)-1]
+}
+
+func (p *BaseParser) EnterRecursionRule(localctx ParserRuleContext, state, ruleIndex, precedence int) {
+ p.SetState(state)
+ p.precedenceStack.Push(precedence)
+ p.ctx = localctx
+ p.ctx.SetStart(p.input.LT(1))
+ if p.parseListeners != nil {
+ p.TriggerEnterRuleEvent() // simulates rule entry for
+ // left-recursive rules
+ }
+}
+
+//
+// Like {@link //EnterRule} but for recursive rules.
+
+func (p *BaseParser) PushNewRecursionContext(localctx ParserRuleContext, state, ruleIndex int) {
+ previous := p.ctx
+ previous.SetParent(localctx)
+ previous.SetInvokingState(state)
+ previous.SetStop(p.input.LT(-1))
+
+ p.ctx = localctx
+ p.ctx.SetStart(previous.GetStart())
+ if p.BuildParseTrees {
+ p.ctx.AddChild(previous)
+ }
+ if p.parseListeners != nil {
+ p.TriggerEnterRuleEvent() // simulates rule entry for
+ // left-recursive rules
+ }
+}
+
+func (p *BaseParser) UnrollRecursionContexts(parentCtx ParserRuleContext) {
+ p.precedenceStack.Pop()
+ p.ctx.SetStop(p.input.LT(-1))
+ retCtx := p.ctx // save current ctx (return value)
+ // unroll so ctx is as it was before call to recursive method
+ if p.parseListeners != nil {
+ for p.ctx != parentCtx {
+ p.TriggerExitRuleEvent()
+ p.ctx = p.ctx.GetParent().(ParserRuleContext)
+ }
+ } else {
+ p.ctx = parentCtx
+ }
+ // hook into tree
+ retCtx.SetParent(parentCtx)
+ if p.BuildParseTrees && parentCtx != nil {
+ // add return ctx into invoking rule's tree
+ parentCtx.AddChild(retCtx)
+ }
+}
+
+func (p *BaseParser) GetInvokingContext(ruleIndex int) ParserRuleContext {
+ ctx := p.ctx
+ for ctx != nil {
+ if ctx.GetRuleIndex() == ruleIndex {
+ return ctx
+ }
+ ctx = ctx.GetParent().(ParserRuleContext)
+ }
+ return nil
+}
+
+func (p *BaseParser) Precpred(localctx RuleContext, precedence int) bool {
+ return precedence >= p.precedenceStack[len(p.precedenceStack)-1]
+}
+
+func (p *BaseParser) inContext(context ParserRuleContext) bool {
+ // TODO: useful in parser?
+ return false
+}
+
+//
+// Checks whether or not {@code symbol} can follow the current state in the
+// ATN. The behavior of p.method is equivalent to the following, but is
+// implemented such that the complete context-sensitive follow set does not
+// need to be explicitly constructed.
+//
+//
+//
+// @param symbol the symbol type to check
+// @return {@code true} if {@code symbol} can follow the current state in
+// the ATN, otherwise {@code false}.
+
+func (p *BaseParser) IsExpectedToken(symbol int) bool {
+ atn := p.Interpreter.atn
+ ctx := p.ctx
+ s := atn.states[p.state]
+ following := atn.NextTokens(s, nil)
+ if following.contains(symbol) {
+ return true
+ }
+ if !following.contains(TokenEpsilon) {
+ return false
+ }
+ for ctx != nil && ctx.GetInvokingState() >= 0 && following.contains(TokenEpsilon) {
+ invokingState := atn.states[ctx.GetInvokingState()]
+ rt := invokingState.GetTransitions()[0]
+ following = atn.NextTokens(rt.(*RuleTransition).followState, nil)
+ if following.contains(symbol) {
+ return true
+ }
+ ctx = ctx.GetParent().(ParserRuleContext)
+ }
+ if following.contains(TokenEpsilon) && symbol == TokenEOF {
+ return true
+ }
+
+ return false
+}
+
+// Computes the set of input symbols which could follow the current parser
+// state and context, as given by {@link //GetState} and {@link //GetContext},
+// respectively.
+//
+// @see ATN//getExpectedTokens(int, RuleContext)
+//
+func (p *BaseParser) GetExpectedTokens() *IntervalSet {
+ return p.Interpreter.atn.getExpectedTokens(p.state, p.ctx)
+}
+
+func (p *BaseParser) GetExpectedTokensWithinCurrentRule() *IntervalSet {
+ atn := p.Interpreter.atn
+ s := atn.states[p.state]
+ return atn.NextTokens(s, nil)
+}
+
+// Get a rule's index (i.e., {@code RULE_ruleName} field) or -1 if not found.//
+func (p *BaseParser) GetRuleIndex(ruleName string) int {
+ var ruleIndex, ok = p.GetRuleIndexMap()[ruleName]
+ if ok {
+ return ruleIndex
+ }
+
+ return -1
+}
+
+// Return List<String> of the rule names in your parser instance
+// leading up to a call to the current rule. You could override if
+// you want more details such as the file/line info of where
+// in the ATN a rule is invoked.
+//
+// this very useful for error messages.
+
+func (p *BaseParser) GetRuleInvocationStack(c ParserRuleContext) []string {
+ if c == nil {
+ c = p.ctx
+ }
+ stack := make([]string, 0)
+ for c != nil {
+ // compute what follows who invoked us
+ ruleIndex := c.GetRuleIndex()
+ if ruleIndex < 0 {
+ stack = append(stack, "n/a")
+ } else {
+ stack = append(stack, p.GetRuleNames()[ruleIndex])
+ }
+
+ vp := c.GetParent()
+
+ if vp == nil {
+ break
+ }
+
+ c = vp.(ParserRuleContext)
+ }
+ return stack
+}
+
+// For debugging and other purposes.//
+func (p *BaseParser) GetDFAStrings() string {
+ return fmt.Sprint(p.Interpreter.decisionToDFA)
+}
+
+// For debugging and other purposes.//
+func (p *BaseParser) DumpDFA() {
+ seenOne := false
+ for _, dfa := range p.Interpreter.decisionToDFA {
+ if dfa.numStates() > 0 {
+ if seenOne {
+ fmt.Println()
+ }
+ fmt.Println("Decision " + strconv.Itoa(dfa.decision) + ":")
+ fmt.Print(dfa.String(p.LiteralNames, p.SymbolicNames))
+ seenOne = true
+ }
+ }
+}
+
+func (p *BaseParser) GetSourceName() string {
+ return p.GrammarFileName
+}
+
+// During a parse is sometimes useful to listen in on the rule entry and exit
+// events as well as token Matches. p.is for quick and dirty debugging.
+//
+func (p *BaseParser) SetTrace(trace *TraceListener) {
+ if trace == nil {
+ p.RemoveParseListener(p.tracer)
+ p.tracer = nil
+ } else {
+ if p.tracer != nil {
+ p.RemoveParseListener(p.tracer)
+ }
+ p.tracer = NewTraceListener(p)
+ p.AddParseListener(p.tracer)
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser_atn_simulator.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser_atn_simulator.go
new file mode 100644
index 000000000..888d51297
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser_atn_simulator.go
@@ -0,0 +1,1544 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "strconv"
+ "strings"
+)
+
+var (
+ ParserATNSimulatorDebug = false
+ ParserATNSimulatorListATNDecisions = false
+ ParserATNSimulatorDFADebug = false
+ ParserATNSimulatorRetryDebug = false
+ TurnOffLRLoopEntryBranchOpt = false
+)
+
+type ParserATNSimulator struct {
+ *BaseATNSimulator
+
+ parser Parser
+ predictionMode int
+ input TokenStream
+ startIndex int
+ dfa *DFA
+ mergeCache *DoubleDict
+ outerContext ParserRuleContext
+}
+
+func NewParserATNSimulator(parser Parser, atn *ATN, decisionToDFA []*DFA, sharedContextCache *PredictionContextCache) *ParserATNSimulator {
+
+ p := new(ParserATNSimulator)
+
+ p.BaseATNSimulator = NewBaseATNSimulator(atn, sharedContextCache)
+
+ p.parser = parser
+ p.decisionToDFA = decisionToDFA
+ // SLL, LL, or LL + exact ambig detection?//
+ p.predictionMode = PredictionModeLL
+ // LAME globals to avoid parameters!!!!! I need these down deep in predTransition
+ p.input = nil
+ p.startIndex = 0
+ p.outerContext = nil
+ p.dfa = nil
+ // Each prediction operation uses a cache for merge of prediction contexts.
+ // Don't keep around as it wastes huge amounts of memory. DoubleKeyMap
+ // isn't Synchronized but we're ok since two threads shouldn't reuse same
+ // parser/atnsim object because it can only handle one input at a time.
+ // This maps graphs a and b to merged result c. (a,b)&rarrc. We can avoid
+ // the merge if we ever see a and b again. Note that (b,a)&rarrc should
+ // also be examined during cache lookup.
+ //
+ p.mergeCache = nil
+
+ return p
+}
+
+func (p *ParserATNSimulator) GetPredictionMode() int {
+ return p.predictionMode
+}
+
+func (p *ParserATNSimulator) SetPredictionMode(v int) {
+ p.predictionMode = v
+}
+
+func (p *ParserATNSimulator) reset() {
+}
+
+func (p *ParserATNSimulator) AdaptivePredict(input TokenStream, decision int, outerContext ParserRuleContext) int {
+ if ParserATNSimulatorDebug || ParserATNSimulatorListATNDecisions {
+ fmt.Println("AdaptivePredict decision " + strconv.Itoa(decision) +
+ " exec LA(1)==" + p.getLookaheadName(input) +
+ " line " + strconv.Itoa(input.LT(1).GetLine()) + ":" +
+ strconv.Itoa(input.LT(1).GetColumn()))
+ }
+
+ p.input = input
+ p.startIndex = input.Index()
+ p.outerContext = outerContext
+
+ dfa := p.decisionToDFA[decision]
+ p.dfa = dfa
+ m := input.Mark()
+ index := input.Index()
+
+ defer func() {
+ p.dfa = nil
+ p.mergeCache = nil // wack cache after each prediction
+ input.Seek(index)
+ input.Release(m)
+ }()
+
+ // Now we are certain to have a specific decision's DFA
+ // But, do we still need an initial state?
+ var s0 *DFAState
+ p.atn.stateMu.RLock()
+ if dfa.getPrecedenceDfa() {
+ p.atn.edgeMu.RLock()
+ // the start state for a precedence DFA depends on the current
+ // parser precedence, and is provided by a DFA method.
+ s0 = dfa.getPrecedenceStartState(p.parser.GetPrecedence())
+ p.atn.edgeMu.RUnlock()
+ } else {
+ // the start state for a "regular" DFA is just s0
+ s0 = dfa.getS0()
+ }
+ p.atn.stateMu.RUnlock()
+
+ if s0 == nil {
+ if outerContext == nil {
+ outerContext = RuleContextEmpty
+ }
+ if ParserATNSimulatorDebug || ParserATNSimulatorListATNDecisions {
+ fmt.Println("predictATN decision " + strconv.Itoa(dfa.decision) +
+ " exec LA(1)==" + p.getLookaheadName(input) +
+ ", outerContext=" + outerContext.String(p.parser.GetRuleNames(), nil))
+ }
+ fullCtx := false
+ s0Closure := p.computeStartState(dfa.atnStartState, RuleContextEmpty, fullCtx)
+
+ p.atn.stateMu.Lock()
+ if dfa.getPrecedenceDfa() {
+ // If p is a precedence DFA, we use applyPrecedenceFilter
+ // to convert the computed start state to a precedence start
+ // state. We then use DFA.setPrecedenceStartState to set the
+ // appropriate start state for the precedence level rather
+ // than simply setting DFA.s0.
+ //
+ dfa.s0.configs = s0Closure
+ s0Closure = p.applyPrecedenceFilter(s0Closure)
+ s0 = p.addDFAState(dfa, NewDFAState(-1, s0Closure))
+ p.atn.edgeMu.Lock()
+ dfa.setPrecedenceStartState(p.parser.GetPrecedence(), s0)
+ p.atn.edgeMu.Unlock()
+ } else {
+ s0 = p.addDFAState(dfa, NewDFAState(-1, s0Closure))
+ dfa.setS0(s0)
+ }
+ p.atn.stateMu.Unlock()
+ }
+
+ alt := p.execATN(dfa, s0, input, index, outerContext)
+ if ParserATNSimulatorDebug {
+ fmt.Println("DFA after predictATN: " + dfa.String(p.parser.GetLiteralNames(), nil))
+ }
+ return alt
+
+}
+
+// Performs ATN simulation to compute a predicted alternative based
+// upon the remaining input, but also updates the DFA cache to avoid
+// having to traverse the ATN again for the same input sequence.
+
+// There are some key conditions we're looking for after computing a new
+// set of ATN configs (proposed DFA state):
+// if the set is empty, there is no viable alternative for current symbol
+// does the state uniquely predict an alternative?
+// does the state have a conflict that would prevent us from
+// putting it on the work list?
+
+// We also have some key operations to do:
+// add an edge from previous DFA state to potentially NewDFA state, D,
+// upon current symbol but only if adding to work list, which means in all
+// cases except no viable alternative (and possibly non-greedy decisions?)
+// collecting predicates and adding semantic context to DFA accept states
+// adding rule context to context-sensitive DFA accept states
+// consuming an input symbol
+// Reporting a conflict
+// Reporting an ambiguity
+// Reporting a context sensitivity
+// Reporting insufficient predicates
+
+// cover these cases:
+// dead end
+// single alt
+// single alt + preds
+// conflict
+// conflict + preds
+//
+func (p *ParserATNSimulator) execATN(dfa *DFA, s0 *DFAState, input TokenStream, startIndex int, outerContext ParserRuleContext) int {
+
+ if ParserATNSimulatorDebug || ParserATNSimulatorListATNDecisions {
+ fmt.Println("execATN decision " + strconv.Itoa(dfa.decision) +
+ " exec LA(1)==" + p.getLookaheadName(input) +
+ " line " + strconv.Itoa(input.LT(1).GetLine()) + ":" + strconv.Itoa(input.LT(1).GetColumn()))
+ }
+
+ previousD := s0
+
+ if ParserATNSimulatorDebug {
+ fmt.Println("s0 = " + s0.String())
+ }
+ t := input.LA(1)
+ for { // for more work
+ D := p.getExistingTargetState(previousD, t)
+ if D == nil {
+ D = p.computeTargetState(dfa, previousD, t)
+ }
+ if D == ATNSimulatorError {
+ // if any configs in previous dipped into outer context, that
+ // means that input up to t actually finished entry rule
+ // at least for SLL decision. Full LL doesn't dip into outer
+ // so don't need special case.
+ // We will get an error no matter what so delay until after
+ // decision better error message. Also, no reachable target
+ // ATN states in SLL implies LL will also get nowhere.
+ // If conflict in states that dip out, choose min since we
+ // will get error no matter what.
+ e := p.noViableAlt(input, outerContext, previousD.configs, startIndex)
+ input.Seek(startIndex)
+ alt := p.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previousD.configs, outerContext)
+ if alt != ATNInvalidAltNumber {
+ return alt
+ }
+
+ panic(e)
+ }
+ if D.requiresFullContext && p.predictionMode != PredictionModeSLL {
+ // IF PREDS, MIGHT RESOLVE TO SINGLE ALT => SLL (or syntax error)
+ conflictingAlts := D.configs.GetConflictingAlts()
+ if D.predicates != nil {
+ if ParserATNSimulatorDebug {
+ fmt.Println("DFA state has preds in DFA sim LL failover")
+ }
+ conflictIndex := input.Index()
+ if conflictIndex != startIndex {
+ input.Seek(startIndex)
+ }
+ conflictingAlts = p.evalSemanticContext(D.predicates, outerContext, true)
+ if conflictingAlts.length() == 1 {
+ if ParserATNSimulatorDebug {
+ fmt.Println("Full LL avoided")
+ }
+ return conflictingAlts.minValue()
+ }
+ if conflictIndex != startIndex {
+ // restore the index so Reporting the fallback to full
+ // context occurs with the index at the correct spot
+ input.Seek(conflictIndex)
+ }
+ }
+ if ParserATNSimulatorDFADebug {
+ fmt.Println("ctx sensitive state " + outerContext.String(nil, nil) + " in " + D.String())
+ }
+ fullCtx := true
+ s0Closure := p.computeStartState(dfa.atnStartState, outerContext, fullCtx)
+ p.ReportAttemptingFullContext(dfa, conflictingAlts, D.configs, startIndex, input.Index())
+ alt := p.execATNWithFullContext(dfa, D, s0Closure, input, startIndex, outerContext)
+ return alt
+ }
+ if D.isAcceptState {
+ if D.predicates == nil {
+ return D.prediction
+ }
+ stopIndex := input.Index()
+ input.Seek(startIndex)
+ alts := p.evalSemanticContext(D.predicates, outerContext, true)
+
+ switch alts.length() {
+ case 0:
+ panic(p.noViableAlt(input, outerContext, D.configs, startIndex))
+ case 1:
+ return alts.minValue()
+ default:
+ // Report ambiguity after predicate evaluation to make sure the correct set of ambig alts is Reported.
+ p.ReportAmbiguity(dfa, D, startIndex, stopIndex, false, alts, D.configs)
+ return alts.minValue()
+ }
+ }
+ previousD = D
+
+ if t != TokenEOF {
+ input.Consume()
+ t = input.LA(1)
+ }
+ }
+
+ panic("Should not have reached p state")
+}
+
+// Get an existing target state for an edge in the DFA. If the target state
+// for the edge has not yet been computed or is otherwise not available,
+// p method returns {@code nil}.
+//
+// @param previousD The current DFA state
+// @param t The next input symbol
+// @return The existing target DFA state for the given input symbol
+// {@code t}, or {@code nil} if the target state for p edge is not
+// already cached
+
+func (p *ParserATNSimulator) getExistingTargetState(previousD *DFAState, t int) *DFAState {
+ if t+1 < 0 {
+ return nil
+ }
+
+ p.atn.edgeMu.RLock()
+ defer p.atn.edgeMu.RUnlock()
+ edges := previousD.getEdges()
+ if edges == nil || t+1 >= len(edges) {
+ return nil
+ }
+ return previousD.getIthEdge(t + 1)
+}
+
+// Compute a target state for an edge in the DFA, and attempt to add the
+// computed state and corresponding edge to the DFA.
+//
+// @param dfa The DFA
+// @param previousD The current DFA state
+// @param t The next input symbol
+//
+// @return The computed target DFA state for the given input symbol
+// {@code t}. If {@code t} does not lead to a valid DFA state, p method
+// returns {@link //ERROR}.
+
+func (p *ParserATNSimulator) computeTargetState(dfa *DFA, previousD *DFAState, t int) *DFAState {
+ reach := p.computeReachSet(previousD.configs, t, false)
+
+ if reach == nil {
+ p.addDFAEdge(dfa, previousD, t, ATNSimulatorError)
+ return ATNSimulatorError
+ }
+ // create Newtarget state we'll add to DFA after it's complete
+ D := NewDFAState(-1, reach)
+
+ predictedAlt := p.getUniqueAlt(reach)
+
+ if ParserATNSimulatorDebug {
+ altSubSets := PredictionModegetConflictingAltSubsets(reach)
+ fmt.Println("SLL altSubSets=" + fmt.Sprint(altSubSets) +
+ ", previous=" + previousD.configs.String() +
+ ", configs=" + reach.String() +
+ ", predict=" + strconv.Itoa(predictedAlt) +
+ ", allSubsetsConflict=" +
+ fmt.Sprint(PredictionModeallSubsetsConflict(altSubSets)) +
+ ", conflictingAlts=" + p.getConflictingAlts(reach).String())
+ }
+ if predictedAlt != ATNInvalidAltNumber {
+ // NO CONFLICT, UNIQUELY PREDICTED ALT
+ D.isAcceptState = true
+ D.configs.SetUniqueAlt(predictedAlt)
+ D.setPrediction(predictedAlt)
+ } else if PredictionModehasSLLConflictTerminatingPrediction(p.predictionMode, reach) {
+ // MORE THAN ONE VIABLE ALTERNATIVE
+ D.configs.SetConflictingAlts(p.getConflictingAlts(reach))
+ D.requiresFullContext = true
+ // in SLL-only mode, we will stop at p state and return the minimum alt
+ D.isAcceptState = true
+ D.setPrediction(D.configs.GetConflictingAlts().minValue())
+ }
+ if D.isAcceptState && D.configs.HasSemanticContext() {
+ p.predicateDFAState(D, p.atn.getDecisionState(dfa.decision))
+ if D.predicates != nil {
+ D.setPrediction(ATNInvalidAltNumber)
+ }
+ }
+ // all adds to dfa are done after we've created full D state
+ D = p.addDFAEdge(dfa, previousD, t, D)
+ return D
+}
+
+func (p *ParserATNSimulator) predicateDFAState(dfaState *DFAState, decisionState DecisionState) {
+ // We need to test all predicates, even in DFA states that
+ // uniquely predict alternative.
+ nalts := len(decisionState.GetTransitions())
+ // Update DFA so reach becomes accept state with (predicate,alt)
+ // pairs if preds found for conflicting alts
+ altsToCollectPredsFrom := p.getConflictingAltsOrUniqueAlt(dfaState.configs)
+ altToPred := p.getPredsForAmbigAlts(altsToCollectPredsFrom, dfaState.configs, nalts)
+ if altToPred != nil {
+ dfaState.predicates = p.getPredicatePredictions(altsToCollectPredsFrom, altToPred)
+ dfaState.setPrediction(ATNInvalidAltNumber) // make sure we use preds
+ } else {
+ // There are preds in configs but they might go away
+ // when OR'd together like {p}? || NONE == NONE. If neither
+ // alt has preds, resolve to min alt
+ dfaState.setPrediction(altsToCollectPredsFrom.minValue())
+ }
+}
+
+// comes back with reach.uniqueAlt set to a valid alt
+func (p *ParserATNSimulator) execATNWithFullContext(dfa *DFA, D *DFAState, s0 ATNConfigSet, input TokenStream, startIndex int, outerContext ParserRuleContext) int {
+
+ if ParserATNSimulatorDebug || ParserATNSimulatorListATNDecisions {
+ fmt.Println("execATNWithFullContext " + s0.String())
+ }
+
+ fullCtx := true
+ foundExactAmbig := false
+ var reach ATNConfigSet
+ previous := s0
+ input.Seek(startIndex)
+ t := input.LA(1)
+ predictedAlt := -1
+
+ for { // for more work
+ reach = p.computeReachSet(previous, t, fullCtx)
+ if reach == nil {
+ // if any configs in previous dipped into outer context, that
+ // means that input up to t actually finished entry rule
+ // at least for LL decision. Full LL doesn't dip into outer
+ // so don't need special case.
+ // We will get an error no matter what so delay until after
+ // decision better error message. Also, no reachable target
+ // ATN states in SLL implies LL will also get nowhere.
+ // If conflict in states that dip out, choose min since we
+ // will get error no matter what.
+ e := p.noViableAlt(input, outerContext, previous, startIndex)
+ input.Seek(startIndex)
+ alt := p.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(previous, outerContext)
+ if alt != ATNInvalidAltNumber {
+ return alt
+ }
+
+ panic(e)
+ }
+ altSubSets := PredictionModegetConflictingAltSubsets(reach)
+ if ParserATNSimulatorDebug {
+ fmt.Println("LL altSubSets=" + fmt.Sprint(altSubSets) + ", predict=" +
+ strconv.Itoa(PredictionModegetUniqueAlt(altSubSets)) + ", resolvesToJustOneViableAlt=" +
+ fmt.Sprint(PredictionModeresolvesToJustOneViableAlt(altSubSets)))
+ }
+ reach.SetUniqueAlt(p.getUniqueAlt(reach))
+ // unique prediction?
+ if reach.GetUniqueAlt() != ATNInvalidAltNumber {
+ predictedAlt = reach.GetUniqueAlt()
+ break
+ }
+ if p.predictionMode != PredictionModeLLExactAmbigDetection {
+ predictedAlt = PredictionModeresolvesToJustOneViableAlt(altSubSets)
+ if predictedAlt != ATNInvalidAltNumber {
+ break
+ }
+ } else {
+ // In exact ambiguity mode, we never try to terminate early.
+ // Just keeps scarfing until we know what the conflict is
+ if PredictionModeallSubsetsConflict(altSubSets) && PredictionModeallSubsetsEqual(altSubSets) {
+ foundExactAmbig = true
+ predictedAlt = PredictionModegetSingleViableAlt(altSubSets)
+ break
+ }
+ // else there are multiple non-conflicting subsets or
+ // we're not sure what the ambiguity is yet.
+ // So, keep going.
+ }
+ previous = reach
+ if t != TokenEOF {
+ input.Consume()
+ t = input.LA(1)
+ }
+ }
+ // If the configuration set uniquely predicts an alternative,
+ // without conflict, then we know that it's a full LL decision
+ // not SLL.
+ if reach.GetUniqueAlt() != ATNInvalidAltNumber {
+ p.ReportContextSensitivity(dfa, predictedAlt, reach, startIndex, input.Index())
+ return predictedAlt
+ }
+ // We do not check predicates here because we have checked them
+ // on-the-fly when doing full context prediction.
+
+ //
+ // In non-exact ambiguity detection mode, we might actually be able to
+ // detect an exact ambiguity, but I'm not going to spend the cycles
+ // needed to check. We only emit ambiguity warnings in exact ambiguity
+ // mode.
+ //
+ // For example, we might know that we have conflicting configurations.
+ // But, that does not mean that there is no way forward without a
+ // conflict. It's possible to have nonconflicting alt subsets as in:
+
+ // altSubSets=[{1, 2}, {1, 2}, {1}, {1, 2}]
+
+ // from
+ //
+ // [(17,1,[5 $]), (13,1,[5 10 $]), (21,1,[5 10 $]), (11,1,[$]),
+ // (13,2,[5 10 $]), (21,2,[5 10 $]), (11,2,[$])]
+ //
+ // In p case, (17,1,[5 $]) indicates there is some next sequence that
+ // would resolve p without conflict to alternative 1. Any other viable
+ // next sequence, however, is associated with a conflict. We stop
+ // looking for input because no amount of further lookahead will alter
+ // the fact that we should predict alternative 1. We just can't say for
+ // sure that there is an ambiguity without looking further.
+
+ p.ReportAmbiguity(dfa, D, startIndex, input.Index(), foundExactAmbig, reach.Alts(), reach)
+
+ return predictedAlt
+}
+
+func (p *ParserATNSimulator) computeReachSet(closure ATNConfigSet, t int, fullCtx bool) ATNConfigSet {
+ if ParserATNSimulatorDebug {
+ fmt.Println("in computeReachSet, starting closure: " + closure.String())
+ }
+ if p.mergeCache == nil {
+ p.mergeCache = NewDoubleDict()
+ }
+ intermediate := NewBaseATNConfigSet(fullCtx)
+
+ // Configurations already in a rule stop state indicate reaching the end
+ // of the decision rule (local context) or end of the start rule (full
+ // context). Once reached, these configurations are never updated by a
+ // closure operation, so they are handled separately for the performance
+ // advantage of having a smaller intermediate set when calling closure.
+ //
+ // For full-context reach operations, separate handling is required to
+ // ensure that the alternative Matching the longest overall sequence is
+ // chosen when multiple such configurations can Match the input.
+
+ var skippedStopStates []*BaseATNConfig
+
+ // First figure out where we can reach on input t
+ for _, c := range closure.GetItems() {
+ if ParserATNSimulatorDebug {
+ fmt.Println("testing " + p.GetTokenName(t) + " at " + c.String())
+ }
+
+ if _, ok := c.GetState().(*RuleStopState); ok {
+ if fullCtx || t == TokenEOF {
+ skippedStopStates = append(skippedStopStates, c.(*BaseATNConfig))
+ if ParserATNSimulatorDebug {
+ fmt.Println("added " + c.String() + " to SkippedStopStates")
+ }
+ }
+ continue
+ }
+
+ for _, trans := range c.GetState().GetTransitions() {
+ target := p.getReachableTarget(trans, t)
+ if target != nil {
+ cfg := NewBaseATNConfig4(c, target)
+ intermediate.Add(cfg, p.mergeCache)
+ if ParserATNSimulatorDebug {
+ fmt.Println("added " + cfg.String() + " to intermediate")
+ }
+ }
+ }
+ }
+
+ // Now figure out where the reach operation can take us...
+ var reach ATNConfigSet
+
+ // This block optimizes the reach operation for intermediate sets which
+ // trivially indicate a termination state for the overall
+ // AdaptivePredict operation.
+ //
+ // The conditions assume that intermediate
+ // contains all configurations relevant to the reach set, but p
+ // condition is not true when one or more configurations have been
+ // withheld in SkippedStopStates, or when the current symbol is EOF.
+ //
+ if skippedStopStates == nil && t != TokenEOF {
+ if len(intermediate.configs) == 1 {
+ // Don't pursue the closure if there is just one state.
+ // It can only have one alternative just add to result
+ // Also don't pursue the closure if there is unique alternative
+ // among the configurations.
+ reach = intermediate
+ } else if p.getUniqueAlt(intermediate) != ATNInvalidAltNumber {
+ // Also don't pursue the closure if there is unique alternative
+ // among the configurations.
+ reach = intermediate
+ }
+ }
+ // If the reach set could not be trivially determined, perform a closure
+ // operation on the intermediate set to compute its initial value.
+ //
+ if reach == nil {
+ reach = NewBaseATNConfigSet(fullCtx)
+ closureBusy := newArray2DHashSet(nil, nil)
+ treatEOFAsEpsilon := t == TokenEOF
+ amount := len(intermediate.configs)
+ for k := 0; k < amount; k++ {
+ p.closure(intermediate.configs[k], reach, closureBusy, false, fullCtx, treatEOFAsEpsilon)
+ }
+ }
+ if t == TokenEOF {
+ // After consuming EOF no additional input is possible, so we are
+ // only interested in configurations which reached the end of the
+ // decision rule (local context) or end of the start rule (full
+ // context). Update reach to contain only these configurations. This
+ // handles both explicit EOF transitions in the grammar and implicit
+ // EOF transitions following the end of the decision or start rule.
+ //
+ // When reach==intermediate, no closure operation was performed. In
+ // p case, removeAllConfigsNotInRuleStopState needs to check for
+ // reachable rule stop states as well as configurations already in
+ // a rule stop state.
+ //
+ // This is handled before the configurations in SkippedStopStates,
+ // because any configurations potentially added from that list are
+ // already guaranteed to meet p condition whether or not it's
+ // required.
+ //
+ reach = p.removeAllConfigsNotInRuleStopState(reach, reach == intermediate)
+ }
+ // If SkippedStopStates!=nil, then it contains at least one
+ // configuration. For full-context reach operations, these
+ // configurations reached the end of the start rule, in which case we
+ // only add them back to reach if no configuration during the current
+ // closure operation reached such a state. This ensures AdaptivePredict
+ // chooses an alternative Matching the longest overall sequence when
+ // multiple alternatives are viable.
+ //
+ if skippedStopStates != nil && ((!fullCtx) || (!PredictionModehasConfigInRuleStopState(reach))) {
+ for l := 0; l < len(skippedStopStates); l++ {
+ reach.Add(skippedStopStates[l], p.mergeCache)
+ }
+ }
+ if len(reach.GetItems()) == 0 {
+ return nil
+ }
+
+ return reach
+}
+
+//
+// Return a configuration set containing only the configurations from
+// {@code configs} which are in a {@link RuleStopState}. If all
+// configurations in {@code configs} are already in a rule stop state, p
+// method simply returns {@code configs}.
+//
+//
When {@code lookToEndOfRule} is true, p method uses
+// {@link ATN//NextTokens} for each configuration in {@code configs} which is
+// not already in a rule stop state to see if a rule stop state is reachable
+// from the configuration via epsilon-only transitions.
+//
+// @param configs the configuration set to update
+// @param lookToEndOfRule when true, p method checks for rule stop states
+// reachable by epsilon-only transitions from each configuration in
+// {@code configs}.
+//
+// @return {@code configs} if all configurations in {@code configs} are in a
+// rule stop state, otherwise return a Newconfiguration set containing only
+// the configurations from {@code configs} which are in a rule stop state
+//
+func (p *ParserATNSimulator) removeAllConfigsNotInRuleStopState(configs ATNConfigSet, lookToEndOfRule bool) ATNConfigSet {
+ if PredictionModeallConfigsInRuleStopStates(configs) {
+ return configs
+ }
+ result := NewBaseATNConfigSet(configs.FullContext())
+ for _, config := range configs.GetItems() {
+ if _, ok := config.GetState().(*RuleStopState); ok {
+ result.Add(config, p.mergeCache)
+ continue
+ }
+ if lookToEndOfRule && config.GetState().GetEpsilonOnlyTransitions() {
+ NextTokens := p.atn.NextTokens(config.GetState(), nil)
+ if NextTokens.contains(TokenEpsilon) {
+ endOfRuleState := p.atn.ruleToStopState[config.GetState().GetRuleIndex()]
+ result.Add(NewBaseATNConfig4(config, endOfRuleState), p.mergeCache)
+ }
+ }
+ }
+ return result
+}
+
+func (p *ParserATNSimulator) computeStartState(a ATNState, ctx RuleContext, fullCtx bool) ATNConfigSet {
+ // always at least the implicit call to start rule
+ initialContext := predictionContextFromRuleContext(p.atn, ctx)
+ configs := NewBaseATNConfigSet(fullCtx)
+ for i := 0; i < len(a.GetTransitions()); i++ {
+ target := a.GetTransitions()[i].getTarget()
+ c := NewBaseATNConfig6(target, i+1, initialContext)
+ closureBusy := newArray2DHashSet(nil, nil)
+ p.closure(c, configs, closureBusy, true, fullCtx, false)
+ }
+ return configs
+}
+
+//
+// This method transforms the start state computed by
+// {@link //computeStartState} to the special start state used by a
+// precedence DFA for a particular precedence value. The transformation
+// process applies the following changes to the start state's configuration
+// set.
+//
+//
+//
Evaluate the precedence predicates for each configuration using
+// {@link SemanticContext//evalPrecedence}.
+//
Remove all configurations which predict an alternative greater than
+// 1, for which another configuration that predicts alternative 1 is in the
+// same ATN state with the same prediction context. This transformation is
+// valid for the following reasons:
+//
+//
The closure block cannot contain any epsilon transitions which bypass
+// the body of the closure, so all states reachable via alternative 1 are
+// part of the precedence alternatives of the transformed left-recursive
+// rule.
+//
The "primary" portion of a left recursive rule cannot contain an
+// epsilon transition, so the only way an alternative other than 1 can exist
+// in a state that is also reachable via alternative 1 is by nesting calls
+// to the left-recursive rule, with the outer calls not being at the
+// preferred precedence level.
+//
+//
+//
+//
+//
+// The prediction context must be considered by p filter to address
+// situations like the following.
+//
+// If the above grammar, the ATN state immediately before the token
+// reference {@code 'a'} in {@code letterA} is reachable from the left edge
+// of both the primary and closure blocks of the left-recursive rule
+// {@code statement}. The prediction context associated with each of these
+// configurations distinguishes between them, and prevents the alternative
+// which stepped out to {@code prog} (and then back in to {@code statement}
+// from being eliminated by the filter.
+//
+//
+// @param configs The configuration set computed by
+// {@link //computeStartState} as the start state for the DFA.
+// @return The transformed configuration set representing the start state
+// for a precedence DFA at a particular precedence level (determined by
+// calling {@link Parser//getPrecedence}).
+//
+func (p *ParserATNSimulator) applyPrecedenceFilter(configs ATNConfigSet) ATNConfigSet {
+
+ statesFromAlt1 := make(map[int]PredictionContext)
+ configSet := NewBaseATNConfigSet(configs.FullContext())
+
+ for _, config := range configs.GetItems() {
+ // handle alt 1 first
+ if config.GetAlt() != 1 {
+ continue
+ }
+ updatedContext := config.GetSemanticContext().evalPrecedence(p.parser, p.outerContext)
+ if updatedContext == nil {
+ // the configuration was eliminated
+ continue
+ }
+ statesFromAlt1[config.GetState().GetStateNumber()] = config.GetContext()
+ if updatedContext != config.GetSemanticContext() {
+ configSet.Add(NewBaseATNConfig2(config, updatedContext), p.mergeCache)
+ } else {
+ configSet.Add(config, p.mergeCache)
+ }
+ }
+ for _, config := range configs.GetItems() {
+
+ if config.GetAlt() == 1 {
+ // already handled
+ continue
+ }
+ // In the future, p elimination step could be updated to also
+ // filter the prediction context for alternatives predicting alt>1
+ // (basically a graph subtraction algorithm).
+ if !config.getPrecedenceFilterSuppressed() {
+ context := statesFromAlt1[config.GetState().GetStateNumber()]
+ if context != nil && context.equals(config.GetContext()) {
+ // eliminated
+ continue
+ }
+ }
+ configSet.Add(config, p.mergeCache)
+ }
+ return configSet
+}
+
+func (p *ParserATNSimulator) getReachableTarget(trans Transition, ttype int) ATNState {
+ if trans.Matches(ttype, 0, p.atn.maxTokenType) {
+ return trans.getTarget()
+ }
+
+ return nil
+}
+
+func (p *ParserATNSimulator) getPredsForAmbigAlts(ambigAlts *BitSet, configs ATNConfigSet, nalts int) []SemanticContext {
+
+ altToPred := make([]SemanticContext, nalts+1)
+ for _, c := range configs.GetItems() {
+ if ambigAlts.contains(c.GetAlt()) {
+ altToPred[c.GetAlt()] = SemanticContextorContext(altToPred[c.GetAlt()], c.GetSemanticContext())
+ }
+ }
+ nPredAlts := 0
+ for i := 1; i <= nalts; i++ {
+ pred := altToPred[i]
+ if pred == nil {
+ altToPred[i] = SemanticContextNone
+ } else if pred != SemanticContextNone {
+ nPredAlts++
+ }
+ }
+ // nonambig alts are nil in altToPred
+ if nPredAlts == 0 {
+ altToPred = nil
+ }
+ if ParserATNSimulatorDebug {
+ fmt.Println("getPredsForAmbigAlts result " + fmt.Sprint(altToPred))
+ }
+ return altToPred
+}
+
+func (p *ParserATNSimulator) getPredicatePredictions(ambigAlts *BitSet, altToPred []SemanticContext) []*PredPrediction {
+ pairs := make([]*PredPrediction, 0)
+ containsPredicate := false
+ for i := 1; i < len(altToPred); i++ {
+ pred := altToPred[i]
+ // unpredicated is indicated by SemanticContextNONE
+ if ambigAlts != nil && ambigAlts.contains(i) {
+ pairs = append(pairs, NewPredPrediction(pred, i))
+ }
+ if pred != SemanticContextNone {
+ containsPredicate = true
+ }
+ }
+ if !containsPredicate {
+ return nil
+ }
+ return pairs
+}
+
+//
+// This method is used to improve the localization of error messages by
+// choosing an alternative rather than panicing a
+// {@link NoViableAltException} in particular prediction scenarios where the
+// {@link //ERROR} state was reached during ATN simulation.
+//
+//
+// The default implementation of p method uses the following
+// algorithm to identify an ATN configuration which successfully parsed the
+// decision entry rule. Choosing such an alternative ensures that the
+// {@link ParserRuleContext} returned by the calling rule will be complete
+// and valid, and the syntax error will be Reported later at a more
+// localized location.
+//
+//
+//
If a syntactically valid path or paths reach the end of the decision rule and
+// they are semantically valid if predicated, return the min associated alt.
+//
Else, if a semantically invalid but syntactically valid path exist
+// or paths exist, return the minimum associated alt.
+//
+// In some scenarios, the algorithm described above could predict an
+// alternative which will result in a {@link FailedPredicateException} in
+// the parser. Specifically, p could occur if the only configuration
+// capable of successfully parsing to the end of the decision rule is
+// blocked by a semantic predicate. By choosing p alternative within
+// {@link //AdaptivePredict} instead of panicing a
+// {@link NoViableAltException}, the resulting
+// {@link FailedPredicateException} in the parser will identify the specific
+// predicate which is preventing the parser from successfully parsing the
+// decision rule, which helps developers identify and correct logic errors
+// in semantic predicates.
+//
+//
+// @param configs The ATN configurations which were valid immediately before
+// the {@link //ERROR} state was reached
+// @param outerContext The is the \gamma_0 initial parser context from the paper
+// or the parser stack at the instant before prediction commences.
+//
+// @return The value to return from {@link //AdaptivePredict}, or
+// {@link ATN//INVALID_ALT_NUMBER} if a suitable alternative was not
+// identified and {@link //AdaptivePredict} should Report an error instead.
+//
+func (p *ParserATNSimulator) getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(configs ATNConfigSet, outerContext ParserRuleContext) int {
+ cfgs := p.splitAccordingToSemanticValidity(configs, outerContext)
+ semValidConfigs := cfgs[0]
+ semInvalidConfigs := cfgs[1]
+ alt := p.GetAltThatFinishedDecisionEntryRule(semValidConfigs)
+ if alt != ATNInvalidAltNumber { // semantically/syntactically viable path exists
+ return alt
+ }
+ // Is there a syntactically valid path with a failed pred?
+ if len(semInvalidConfigs.GetItems()) > 0 {
+ alt = p.GetAltThatFinishedDecisionEntryRule(semInvalidConfigs)
+ if alt != ATNInvalidAltNumber { // syntactically viable path exists
+ return alt
+ }
+ }
+ return ATNInvalidAltNumber
+}
+
+func (p *ParserATNSimulator) GetAltThatFinishedDecisionEntryRule(configs ATNConfigSet) int {
+ alts := NewIntervalSet()
+
+ for _, c := range configs.GetItems() {
+ _, ok := c.GetState().(*RuleStopState)
+
+ if c.GetReachesIntoOuterContext() > 0 || (ok && c.GetContext().hasEmptyPath()) {
+ alts.addOne(c.GetAlt())
+ }
+ }
+ if alts.length() == 0 {
+ return ATNInvalidAltNumber
+ }
+
+ return alts.first()
+}
+
+// Walk the list of configurations and split them according to
+// those that have preds evaluating to true/false. If no pred, assume
+// true pred and include in succeeded set. Returns Pair of sets.
+//
+// Create a NewSet so as not to alter the incoming parameter.
+//
+// Assumption: the input stream has been restored to the starting point
+// prediction, which is where predicates need to evaluate.
+
+type ATNConfigSetPair struct {
+ item0, item1 ATNConfigSet
+}
+
+func (p *ParserATNSimulator) splitAccordingToSemanticValidity(configs ATNConfigSet, outerContext ParserRuleContext) []ATNConfigSet {
+ succeeded := NewBaseATNConfigSet(configs.FullContext())
+ failed := NewBaseATNConfigSet(configs.FullContext())
+
+ for _, c := range configs.GetItems() {
+ if c.GetSemanticContext() != SemanticContextNone {
+ predicateEvaluationResult := c.GetSemanticContext().evaluate(p.parser, outerContext)
+ if predicateEvaluationResult {
+ succeeded.Add(c, nil)
+ } else {
+ failed.Add(c, nil)
+ }
+ } else {
+ succeeded.Add(c, nil)
+ }
+ }
+ return []ATNConfigSet{succeeded, failed}
+}
+
+// Look through a list of predicate/alt pairs, returning alts for the
+// pairs that win. A {@code NONE} predicate indicates an alt containing an
+// unpredicated config which behaves as "always true." If !complete
+// then we stop at the first predicate that evaluates to true. This
+// includes pairs with nil predicates.
+//
+func (p *ParserATNSimulator) evalSemanticContext(predPredictions []*PredPrediction, outerContext ParserRuleContext, complete bool) *BitSet {
+ predictions := NewBitSet()
+ for i := 0; i < len(predPredictions); i++ {
+ pair := predPredictions[i]
+ if pair.pred == SemanticContextNone {
+ predictions.add(pair.alt)
+ if !complete {
+ break
+ }
+ continue
+ }
+
+ predicateEvaluationResult := pair.pred.evaluate(p.parser, outerContext)
+ if ParserATNSimulatorDebug || ParserATNSimulatorDFADebug {
+ fmt.Println("eval pred " + pair.String() + "=" + fmt.Sprint(predicateEvaluationResult))
+ }
+ if predicateEvaluationResult {
+ if ParserATNSimulatorDebug || ParserATNSimulatorDFADebug {
+ fmt.Println("PREDICT " + fmt.Sprint(pair.alt))
+ }
+ predictions.add(pair.alt)
+ if !complete {
+ break
+ }
+ }
+ }
+ return predictions
+}
+
+func (p *ParserATNSimulator) closure(config ATNConfig, configs ATNConfigSet, closureBusy Set, collectPredicates, fullCtx, treatEOFAsEpsilon bool) {
+ initialDepth := 0
+ p.closureCheckingStopState(config, configs, closureBusy, collectPredicates,
+ fullCtx, initialDepth, treatEOFAsEpsilon)
+}
+
+func (p *ParserATNSimulator) closureCheckingStopState(config ATNConfig, configs ATNConfigSet, closureBusy Set, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) {
+ if ParserATNSimulatorDebug {
+ fmt.Println("closure(" + config.String() + ")")
+ fmt.Println("configs(" + configs.String() + ")")
+ if config.GetReachesIntoOuterContext() > 50 {
+ panic("problem")
+ }
+ }
+
+ if _, ok := config.GetState().(*RuleStopState); ok {
+ // We hit rule end. If we have context info, use it
+ // run thru all possible stack tops in ctx
+ if !config.GetContext().isEmpty() {
+ for i := 0; i < config.GetContext().length(); i++ {
+ if config.GetContext().getReturnState(i) == BasePredictionContextEmptyReturnState {
+ if fullCtx {
+ configs.Add(NewBaseATNConfig1(config, config.GetState(), BasePredictionContextEMPTY), p.mergeCache)
+ continue
+ } else {
+ // we have no context info, just chase follow links (if greedy)
+ if ParserATNSimulatorDebug {
+ fmt.Println("FALLING off rule " + p.getRuleName(config.GetState().GetRuleIndex()))
+ }
+ p.closureWork(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon)
+ }
+ continue
+ }
+ returnState := p.atn.states[config.GetContext().getReturnState(i)]
+ newContext := config.GetContext().GetParent(i) // "pop" return state
+
+ c := NewBaseATNConfig5(returnState, config.GetAlt(), newContext, config.GetSemanticContext())
+ // While we have context to pop back from, we may have
+ // gotten that context AFTER having falling off a rule.
+ // Make sure we track that we are now out of context.
+ c.SetReachesIntoOuterContext(config.GetReachesIntoOuterContext())
+ p.closureCheckingStopState(c, configs, closureBusy, collectPredicates, fullCtx, depth-1, treatEOFAsEpsilon)
+ }
+ return
+ } else if fullCtx {
+ // reached end of start rule
+ configs.Add(config, p.mergeCache)
+ return
+ } else {
+ // else if we have no context info, just chase follow links (if greedy)
+ if ParserATNSimulatorDebug {
+ fmt.Println("FALLING off rule " + p.getRuleName(config.GetState().GetRuleIndex()))
+ }
+ }
+ }
+ p.closureWork(config, configs, closureBusy, collectPredicates, fullCtx, depth, treatEOFAsEpsilon)
+}
+
+// Do the actual work of walking epsilon edges//
+func (p *ParserATNSimulator) closureWork(config ATNConfig, configs ATNConfigSet, closureBusy Set, collectPredicates, fullCtx bool, depth int, treatEOFAsEpsilon bool) {
+ state := config.GetState()
+ // optimization
+ if !state.GetEpsilonOnlyTransitions() {
+ configs.Add(config, p.mergeCache)
+ // make sure to not return here, because EOF transitions can act as
+ // both epsilon transitions and non-epsilon transitions.
+ }
+ for i := 0; i < len(state.GetTransitions()); i++ {
+ if i == 0 && p.canDropLoopEntryEdgeInLeftRecursiveRule(config) {
+ continue
+ }
+
+ t := state.GetTransitions()[i]
+ _, ok := t.(*ActionTransition)
+ continueCollecting := collectPredicates && !ok
+ c := p.getEpsilonTarget(config, t, continueCollecting, depth == 0, fullCtx, treatEOFAsEpsilon)
+ if ci, ok := c.(*BaseATNConfig); ok && ci != nil {
+ newDepth := depth
+
+ if _, ok := config.GetState().(*RuleStopState); ok {
+ // target fell off end of rule mark resulting c as having dipped into outer context
+ // We can't get here if incoming config was rule stop and we had context
+ // track how far we dip into outer context. Might
+ // come in handy and we avoid evaluating context dependent
+ // preds if p is > 0.
+
+ if p.dfa != nil && p.dfa.getPrecedenceDfa() {
+ if t.(*EpsilonTransition).outermostPrecedenceReturn == p.dfa.atnStartState.GetRuleIndex() {
+ c.setPrecedenceFilterSuppressed(true)
+ }
+ }
+
+ c.SetReachesIntoOuterContext(c.GetReachesIntoOuterContext() + 1)
+
+ if closureBusy.Add(c) != c {
+ // avoid infinite recursion for right-recursive rules
+ continue
+ }
+
+ configs.SetDipsIntoOuterContext(true) // TODO: can remove? only care when we add to set per middle of p method
+ newDepth--
+ if ParserATNSimulatorDebug {
+ fmt.Println("dips into outer ctx: " + c.String())
+ }
+ } else {
+ if !t.getIsEpsilon() && closureBusy.Add(c) != c {
+ // avoid infinite recursion for EOF* and EOF+
+ continue
+ }
+ if _, ok := t.(*RuleTransition); ok {
+ // latch when newDepth goes negative - once we step out of the entry context we can't return
+ if newDepth >= 0 {
+ newDepth++
+ }
+ }
+ }
+ p.closureCheckingStopState(c, configs, closureBusy, continueCollecting, fullCtx, newDepth, treatEOFAsEpsilon)
+ }
+ }
+}
+
+func (p *ParserATNSimulator) canDropLoopEntryEdgeInLeftRecursiveRule(config ATNConfig) bool {
+ if TurnOffLRLoopEntryBranchOpt {
+ return false
+ }
+
+ _p := config.GetState()
+
+ // First check to see if we are in StarLoopEntryState generated during
+ // left-recursion elimination. For efficiency, also check if
+ // the context has an empty stack case. If so, it would mean
+ // global FOLLOW so we can't perform optimization
+ if startLoop, ok := _p.(StarLoopEntryState); !ok || !startLoop.precedenceRuleDecision || config.GetContext().isEmpty() || config.GetContext().hasEmptyPath() {
+ return false
+ }
+
+ // Require all return states to return back to the same rule
+ // that p is in.
+ numCtxs := config.GetContext().length()
+ for i := 0; i < numCtxs; i++ {
+ returnState := p.atn.states[config.GetContext().getReturnState(i)]
+ if returnState.GetRuleIndex() != _p.GetRuleIndex() {
+ return false
+ }
+ }
+
+ decisionStartState := _p.(BlockStartState).GetTransitions()[0].getTarget().(BlockStartState)
+ blockEndStateNum := decisionStartState.getEndState().stateNumber
+ blockEndState := p.atn.states[blockEndStateNum].(*BlockEndState)
+
+ // Verify that the top of each stack context leads to loop entry/exit
+ // state through epsilon edges and w/o leaving rule.
+
+ for i := 0; i < numCtxs; i++ { // for each stack context
+ returnStateNumber := config.GetContext().getReturnState(i)
+ returnState := p.atn.states[returnStateNumber]
+
+ // all states must have single outgoing epsilon edge
+ if len(returnState.GetTransitions()) != 1 || !returnState.GetTransitions()[0].getIsEpsilon() {
+ return false
+ }
+
+ // Look for prefix op case like 'not expr', (' type ')' expr
+ returnStateTarget := returnState.GetTransitions()[0].getTarget()
+ if returnState.GetStateType() == ATNStateBlockEnd && returnStateTarget == _p {
+ continue
+ }
+
+ // Look for 'expr op expr' or case where expr's return state is block end
+ // of (...)* internal block; the block end points to loop back
+ // which points to p but we don't need to check that
+ if returnState == blockEndState {
+ continue
+ }
+
+ // Look for ternary expr ? expr : expr. The return state points at block end,
+ // which points at loop entry state
+ if returnStateTarget == blockEndState {
+ continue
+ }
+
+ // Look for complex prefix 'between expr and expr' case where 2nd expr's
+ // return state points at block end state of (...)* internal block
+ if returnStateTarget.GetStateType() == ATNStateBlockEnd &&
+ len(returnStateTarget.GetTransitions()) == 1 &&
+ returnStateTarget.GetTransitions()[0].getIsEpsilon() &&
+ returnStateTarget.GetTransitions()[0].getTarget() == _p {
+ continue
+ }
+
+ // anything else ain't conforming
+ return false
+ }
+
+ return true
+}
+
+func (p *ParserATNSimulator) getRuleName(index int) string {
+ if p.parser != nil && index >= 0 {
+ return p.parser.GetRuleNames()[index]
+ }
+ var sb strings.Builder
+ sb.Grow(32)
+
+ sb.WriteString("')
+ return sb.String()
+}
+
+func (p *ParserATNSimulator) getEpsilonTarget(config ATNConfig, t Transition, collectPredicates, inContext, fullCtx, treatEOFAsEpsilon bool) ATNConfig {
+
+ switch t.getSerializationType() {
+ case TransitionRULE:
+ return p.ruleTransition(config, t.(*RuleTransition))
+ case TransitionPRECEDENCE:
+ return p.precedenceTransition(config, t.(*PrecedencePredicateTransition), collectPredicates, inContext, fullCtx)
+ case TransitionPREDICATE:
+ return p.predTransition(config, t.(*PredicateTransition), collectPredicates, inContext, fullCtx)
+ case TransitionACTION:
+ return p.actionTransition(config, t.(*ActionTransition))
+ case TransitionEPSILON:
+ return NewBaseATNConfig4(config, t.getTarget())
+ case TransitionATOM, TransitionRANGE, TransitionSET:
+ // EOF transitions act like epsilon transitions after the first EOF
+ // transition is traversed
+ if treatEOFAsEpsilon {
+ if t.Matches(TokenEOF, 0, 1) {
+ return NewBaseATNConfig4(config, t.getTarget())
+ }
+ }
+ return nil
+ default:
+ return nil
+ }
+}
+
+func (p *ParserATNSimulator) actionTransition(config ATNConfig, t *ActionTransition) *BaseATNConfig {
+ if ParserATNSimulatorDebug {
+ fmt.Println("ACTION edge " + strconv.Itoa(t.ruleIndex) + ":" + strconv.Itoa(t.actionIndex))
+ }
+ return NewBaseATNConfig4(config, t.getTarget())
+}
+
+func (p *ParserATNSimulator) precedenceTransition(config ATNConfig,
+ pt *PrecedencePredicateTransition, collectPredicates, inContext, fullCtx bool) *BaseATNConfig {
+
+ if ParserATNSimulatorDebug {
+ fmt.Println("PRED (collectPredicates=" + fmt.Sprint(collectPredicates) + ") " +
+ strconv.Itoa(pt.precedence) + ">=_p, ctx dependent=true")
+ if p.parser != nil {
+ fmt.Println("context surrounding pred is " + fmt.Sprint(p.parser.GetRuleInvocationStack(nil)))
+ }
+ }
+ var c *BaseATNConfig
+ if collectPredicates && inContext {
+ if fullCtx {
+ // In full context mode, we can evaluate predicates on-the-fly
+ // during closure, which dramatically reduces the size of
+ // the config sets. It also obviates the need to test predicates
+ // later during conflict resolution.
+ currentPosition := p.input.Index()
+ p.input.Seek(p.startIndex)
+ predSucceeds := pt.getPredicate().evaluate(p.parser, p.outerContext)
+ p.input.Seek(currentPosition)
+ if predSucceeds {
+ c = NewBaseATNConfig4(config, pt.getTarget()) // no pred context
+ }
+ } else {
+ newSemCtx := SemanticContextandContext(config.GetSemanticContext(), pt.getPredicate())
+ c = NewBaseATNConfig3(config, pt.getTarget(), newSemCtx)
+ }
+ } else {
+ c = NewBaseATNConfig4(config, pt.getTarget())
+ }
+ if ParserATNSimulatorDebug {
+ fmt.Println("config from pred transition=" + c.String())
+ }
+ return c
+}
+
+func (p *ParserATNSimulator) predTransition(config ATNConfig, pt *PredicateTransition, collectPredicates, inContext, fullCtx bool) *BaseATNConfig {
+
+ if ParserATNSimulatorDebug {
+ fmt.Println("PRED (collectPredicates=" + fmt.Sprint(collectPredicates) + ") " + strconv.Itoa(pt.ruleIndex) +
+ ":" + strconv.Itoa(pt.predIndex) + ", ctx dependent=" + fmt.Sprint(pt.isCtxDependent))
+ if p.parser != nil {
+ fmt.Println("context surrounding pred is " + fmt.Sprint(p.parser.GetRuleInvocationStack(nil)))
+ }
+ }
+ var c *BaseATNConfig
+ if collectPredicates && (!pt.isCtxDependent || inContext) {
+ if fullCtx {
+ // In full context mode, we can evaluate predicates on-the-fly
+ // during closure, which dramatically reduces the size of
+ // the config sets. It also obviates the need to test predicates
+ // later during conflict resolution.
+ currentPosition := p.input.Index()
+ p.input.Seek(p.startIndex)
+ predSucceeds := pt.getPredicate().evaluate(p.parser, p.outerContext)
+ p.input.Seek(currentPosition)
+ if predSucceeds {
+ c = NewBaseATNConfig4(config, pt.getTarget()) // no pred context
+ }
+ } else {
+ newSemCtx := SemanticContextandContext(config.GetSemanticContext(), pt.getPredicate())
+ c = NewBaseATNConfig3(config, pt.getTarget(), newSemCtx)
+ }
+ } else {
+ c = NewBaseATNConfig4(config, pt.getTarget())
+ }
+ if ParserATNSimulatorDebug {
+ fmt.Println("config from pred transition=" + c.String())
+ }
+ return c
+}
+
+func (p *ParserATNSimulator) ruleTransition(config ATNConfig, t *RuleTransition) *BaseATNConfig {
+ if ParserATNSimulatorDebug {
+ fmt.Println("CALL rule " + p.getRuleName(t.getTarget().GetRuleIndex()) + ", ctx=" + config.GetContext().String())
+ }
+ returnState := t.followState
+ newContext := SingletonBasePredictionContextCreate(config.GetContext(), returnState.GetStateNumber())
+ return NewBaseATNConfig1(config, t.getTarget(), newContext)
+}
+
+func (p *ParserATNSimulator) getConflictingAlts(configs ATNConfigSet) *BitSet {
+ altsets := PredictionModegetConflictingAltSubsets(configs)
+ return PredictionModeGetAlts(altsets)
+}
+
+// Sam pointed out a problem with the previous definition, v3, of
+// ambiguous states. If we have another state associated with conflicting
+// alternatives, we should keep going. For example, the following grammar
+//
+// s : (ID | ID ID?) ''
+//
+// When the ATN simulation reaches the state before '', it has a DFA
+// state that looks like: [12|1|[], 6|2|[], 12|2|[]]. Naturally
+// 12|1|[] and 12|2|[] conflict, but we cannot stop processing p node
+// because alternative to has another way to continue, via [6|2|[]].
+// The key is that we have a single state that has config's only associated
+// with a single alternative, 2, and crucially the state transitions
+// among the configurations are all non-epsilon transitions. That means
+// we don't consider any conflicts that include alternative 2. So, we
+// ignore the conflict between alts 1 and 2. We ignore a set of
+// conflicting alts when there is an intersection with an alternative
+// associated with a single alt state in the state&rarrconfig-list map.
+//
+// It's also the case that we might have two conflicting configurations but
+// also a 3rd nonconflicting configuration for a different alternative:
+// [1|1|[], 1|2|[], 8|3|[]]. This can come about from grammar:
+//
+// a : A | A | A B
+//
+// After Matching input A, we reach the stop state for rule A, state 1.
+// State 8 is the state right before B. Clearly alternatives 1 and 2
+// conflict and no amount of further lookahead will separate the two.
+// However, alternative 3 will be able to continue and so we do not
+// stop working on p state. In the previous example, we're concerned
+// with states associated with the conflicting alternatives. Here alt
+// 3 is not associated with the conflicting configs, but since we can continue
+// looking for input reasonably, I don't declare the state done. We
+// ignore a set of conflicting alts when we have an alternative
+// that we still need to pursue.
+//
+
+func (p *ParserATNSimulator) getConflictingAltsOrUniqueAlt(configs ATNConfigSet) *BitSet {
+ var conflictingAlts *BitSet
+ if configs.GetUniqueAlt() != ATNInvalidAltNumber {
+ conflictingAlts = NewBitSet()
+ conflictingAlts.add(configs.GetUniqueAlt())
+ } else {
+ conflictingAlts = configs.GetConflictingAlts()
+ }
+ return conflictingAlts
+}
+
+func (p *ParserATNSimulator) GetTokenName(t int) string {
+ if t == TokenEOF {
+ return "EOF"
+ }
+
+ if p.parser != nil && p.parser.GetLiteralNames() != nil {
+ if t >= len(p.parser.GetLiteralNames()) {
+ fmt.Println(strconv.Itoa(t) + " ttype out of range: " + strings.Join(p.parser.GetLiteralNames(), ","))
+ // fmt.Println(p.parser.GetInputStream().(TokenStream).GetAllText()) // p seems incorrect
+ } else {
+ return p.parser.GetLiteralNames()[t] + "<" + strconv.Itoa(t) + ">"
+ }
+ }
+
+ return strconv.Itoa(t)
+}
+
+func (p *ParserATNSimulator) getLookaheadName(input TokenStream) string {
+ return p.GetTokenName(input.LA(1))
+}
+
+// Used for debugging in AdaptivePredict around execATN but I cut
+// it out for clarity now that alg. works well. We can leave p
+// "dead" code for a bit.
+//
+func (p *ParserATNSimulator) dumpDeadEndConfigs(nvae *NoViableAltException) {
+
+ panic("Not implemented")
+
+ // fmt.Println("dead end configs: ")
+ // var decs = nvae.deadEndConfigs
+ //
+ // for i:=0; i0) {
+ // var t = c.state.GetTransitions()[0]
+ // if t2, ok := t.(*AtomTransition); ok {
+ // trans = "Atom "+ p.GetTokenName(t2.label)
+ // } else if t3, ok := t.(SetTransition); ok {
+ // _, ok := t.(*NotSetTransition)
+ //
+ // var s string
+ // if (ok){
+ // s = "~"
+ // }
+ //
+ // trans = s + "Set " + t3.set
+ // }
+ // }
+ // fmt.Errorf(c.String(p.parser, true) + ":" + trans)
+ // }
+}
+
+func (p *ParserATNSimulator) noViableAlt(input TokenStream, outerContext ParserRuleContext, configs ATNConfigSet, startIndex int) *NoViableAltException {
+ return NewNoViableAltException(p.parser, input, input.Get(startIndex), input.LT(1), configs, outerContext)
+}
+
+func (p *ParserATNSimulator) getUniqueAlt(configs ATNConfigSet) int {
+ alt := ATNInvalidAltNumber
+ for _, c := range configs.GetItems() {
+ if alt == ATNInvalidAltNumber {
+ alt = c.GetAlt() // found first alt
+ } else if c.GetAlt() != alt {
+ return ATNInvalidAltNumber
+ }
+ }
+ return alt
+}
+
+//
+// Add an edge to the DFA, if possible. This method calls
+// {@link //addDFAState} to ensure the {@code to} state is present in the
+// DFA. If {@code from} is {@code nil}, or if {@code t} is outside the
+// range of edges that can be represented in the DFA tables, p method
+// returns without adding the edge to the DFA.
+//
+//
If {@code to} is {@code nil}, p method returns {@code nil}.
+// Otherwise, p method returns the {@link DFAState} returned by calling
+// {@link //addDFAState} for the {@code to} state.
+//
+// @param dfa The DFA
+// @param from The source state for the edge
+// @param t The input symbol
+// @param to The target state for the edge
+//
+// @return If {@code to} is {@code nil}, p method returns {@code nil}
+// otherwise p method returns the result of calling {@link //addDFAState}
+// on {@code to}
+//
+func (p *ParserATNSimulator) addDFAEdge(dfa *DFA, from *DFAState, t int, to *DFAState) *DFAState {
+ if ParserATNSimulatorDebug {
+ fmt.Println("EDGE " + from.String() + " -> " + to.String() + " upon " + p.GetTokenName(t))
+ }
+ if to == nil {
+ return nil
+ }
+ p.atn.stateMu.Lock()
+ to = p.addDFAState(dfa, to) // used existing if possible not incoming
+ p.atn.stateMu.Unlock()
+ if from == nil || t < -1 || t > p.atn.maxTokenType {
+ return to
+ }
+ p.atn.edgeMu.Lock()
+ if from.getEdges() == nil {
+ from.setEdges(make([]*DFAState, p.atn.maxTokenType+1+1))
+ }
+ from.setIthEdge(t+1, to) // connect
+ p.atn.edgeMu.Unlock()
+
+ if ParserATNSimulatorDebug {
+ var names []string
+ if p.parser != nil {
+ names = p.parser.GetLiteralNames()
+ }
+
+ fmt.Println("DFA=\n" + dfa.String(names, nil))
+ }
+ return to
+}
+
+//
+// Add state {@code D} to the DFA if it is not already present, and return
+// the actual instance stored in the DFA. If a state equivalent to {@code D}
+// is already in the DFA, the existing state is returned. Otherwise p
+// method returns {@code D} after adding it to the DFA.
+//
+//
If {@code D} is {@link //ERROR}, p method returns {@link //ERROR} and
+// does not change the DFA.
+//
+// @param dfa The dfa
+// @param D The DFA state to add
+// @return The state stored in the DFA. This will be either the existing
+// state if {@code D} is already in the DFA, or {@code D} itself if the
+// state was not already present.
+//
+func (p *ParserATNSimulator) addDFAState(dfa *DFA, d *DFAState) *DFAState {
+ if d == ATNSimulatorError {
+ return d
+ }
+ hash := d.hash()
+ existing, ok := dfa.getState(hash)
+ if ok {
+ return existing
+ }
+ d.stateNumber = dfa.numStates()
+ if !d.configs.ReadOnly() {
+ d.configs.OptimizeConfigs(p.BaseATNSimulator)
+ d.configs.SetReadOnly(true)
+ }
+ dfa.setState(hash, d)
+ if ParserATNSimulatorDebug {
+ fmt.Println("adding NewDFA state: " + d.String())
+ }
+ return d
+}
+
+func (p *ParserATNSimulator) ReportAttemptingFullContext(dfa *DFA, conflictingAlts *BitSet, configs ATNConfigSet, startIndex, stopIndex int) {
+ if ParserATNSimulatorDebug || ParserATNSimulatorRetryDebug {
+ interval := NewInterval(startIndex, stopIndex+1)
+ fmt.Println("ReportAttemptingFullContext decision=" + strconv.Itoa(dfa.decision) + ":" + configs.String() +
+ ", input=" + p.parser.GetTokenStream().GetTextFromInterval(interval))
+ }
+ if p.parser != nil {
+ p.parser.GetErrorListenerDispatch().ReportAttemptingFullContext(p.parser, dfa, startIndex, stopIndex, conflictingAlts, configs)
+ }
+}
+
+func (p *ParserATNSimulator) ReportContextSensitivity(dfa *DFA, prediction int, configs ATNConfigSet, startIndex, stopIndex int) {
+ if ParserATNSimulatorDebug || ParserATNSimulatorRetryDebug {
+ interval := NewInterval(startIndex, stopIndex+1)
+ fmt.Println("ReportContextSensitivity decision=" + strconv.Itoa(dfa.decision) + ":" + configs.String() +
+ ", input=" + p.parser.GetTokenStream().GetTextFromInterval(interval))
+ }
+ if p.parser != nil {
+ p.parser.GetErrorListenerDispatch().ReportContextSensitivity(p.parser, dfa, startIndex, stopIndex, prediction, configs)
+ }
+}
+
+// If context sensitive parsing, we know it's ambiguity not conflict//
+func (p *ParserATNSimulator) ReportAmbiguity(dfa *DFA, D *DFAState, startIndex, stopIndex int,
+ exact bool, ambigAlts *BitSet, configs ATNConfigSet) {
+ if ParserATNSimulatorDebug || ParserATNSimulatorRetryDebug {
+ interval := NewInterval(startIndex, stopIndex+1)
+ fmt.Println("ReportAmbiguity " + ambigAlts.String() + ":" + configs.String() +
+ ", input=" + p.parser.GetTokenStream().GetTextFromInterval(interval))
+ }
+ if p.parser != nil {
+ p.parser.GetErrorListenerDispatch().ReportAmbiguity(p.parser, dfa, startIndex, stopIndex, exact, ambigAlts, configs)
+ }
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser_rule_context.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser_rule_context.go
new file mode 100644
index 000000000..49cd10c5f
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/parser_rule_context.go
@@ -0,0 +1,362 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "reflect"
+ "strconv"
+)
+
+type ParserRuleContext interface {
+ RuleContext
+
+ SetException(RecognitionException)
+
+ AddTokenNode(token Token) *TerminalNodeImpl
+ AddErrorNode(badToken Token) *ErrorNodeImpl
+
+ EnterRule(listener ParseTreeListener)
+ ExitRule(listener ParseTreeListener)
+
+ SetStart(Token)
+ GetStart() Token
+
+ SetStop(Token)
+ GetStop() Token
+
+ AddChild(child RuleContext) RuleContext
+ RemoveLastChild()
+}
+
+type BaseParserRuleContext struct {
+ *BaseRuleContext
+
+ start, stop Token
+ exception RecognitionException
+ children []Tree
+}
+
+func NewBaseParserRuleContext(parent ParserRuleContext, invokingStateNumber int) *BaseParserRuleContext {
+ prc := new(BaseParserRuleContext)
+
+ prc.BaseRuleContext = NewBaseRuleContext(parent, invokingStateNumber)
+
+ prc.RuleIndex = -1
+ // * If we are debugging or building a parse tree for a Visitor,
+ // we need to track all of the tokens and rule invocations associated
+ // with prc rule's context. This is empty for parsing w/o tree constr.
+ // operation because we don't the need to track the details about
+ // how we parse prc rule.
+ // /
+ prc.children = nil
+ prc.start = nil
+ prc.stop = nil
+ // The exception that forced prc rule to return. If the rule successfully
+ // completed, prc is {@code nil}.
+ prc.exception = nil
+
+ return prc
+}
+
+func (prc *BaseParserRuleContext) SetException(e RecognitionException) {
+ prc.exception = e
+}
+
+func (prc *BaseParserRuleContext) GetChildren() []Tree {
+ return prc.children
+}
+
+func (prc *BaseParserRuleContext) CopyFrom(ctx *BaseParserRuleContext) {
+ // from RuleContext
+ prc.parentCtx = ctx.parentCtx
+ prc.invokingState = ctx.invokingState
+ prc.children = nil
+ prc.start = ctx.start
+ prc.stop = ctx.stop
+}
+
+func (prc *BaseParserRuleContext) GetText() string {
+ if prc.GetChildCount() == 0 {
+ return ""
+ }
+
+ var s string
+ for _, child := range prc.children {
+ s += child.(ParseTree).GetText()
+ }
+
+ return s
+}
+
+// Double dispatch methods for listeners
+func (prc *BaseParserRuleContext) EnterRule(listener ParseTreeListener) {
+}
+
+func (prc *BaseParserRuleContext) ExitRule(listener ParseTreeListener) {
+}
+
+// * Does not set parent link other add methods do that///
+func (prc *BaseParserRuleContext) addTerminalNodeChild(child TerminalNode) TerminalNode {
+ if prc.children == nil {
+ prc.children = make([]Tree, 0)
+ }
+ if child == nil {
+ panic("Child may not be null")
+ }
+ prc.children = append(prc.children, child)
+ return child
+}
+
+func (prc *BaseParserRuleContext) AddChild(child RuleContext) RuleContext {
+ if prc.children == nil {
+ prc.children = make([]Tree, 0)
+ }
+ if child == nil {
+ panic("Child may not be null")
+ }
+ prc.children = append(prc.children, child)
+ return child
+}
+
+// * Used by EnterOuterAlt to toss out a RuleContext previously added as
+// we entered a rule. If we have // label, we will need to remove
+// generic ruleContext object.
+// /
+func (prc *BaseParserRuleContext) RemoveLastChild() {
+ if prc.children != nil && len(prc.children) > 0 {
+ prc.children = prc.children[0 : len(prc.children)-1]
+ }
+}
+
+func (prc *BaseParserRuleContext) AddTokenNode(token Token) *TerminalNodeImpl {
+
+ node := NewTerminalNodeImpl(token)
+ prc.addTerminalNodeChild(node)
+ node.parentCtx = prc
+ return node
+
+}
+
+func (prc *BaseParserRuleContext) AddErrorNode(badToken Token) *ErrorNodeImpl {
+ node := NewErrorNodeImpl(badToken)
+ prc.addTerminalNodeChild(node)
+ node.parentCtx = prc
+ return node
+}
+
+func (prc *BaseParserRuleContext) GetChild(i int) Tree {
+ if prc.children != nil && len(prc.children) >= i {
+ return prc.children[i]
+ }
+
+ return nil
+}
+
+func (prc *BaseParserRuleContext) GetChildOfType(i int, childType reflect.Type) RuleContext {
+ if childType == nil {
+ return prc.GetChild(i).(RuleContext)
+ }
+
+ for j := 0; j < len(prc.children); j++ {
+ child := prc.children[j]
+ if reflect.TypeOf(child) == childType {
+ if i == 0 {
+ return child.(RuleContext)
+ }
+
+ i--
+ }
+ }
+
+ return nil
+}
+
+func (prc *BaseParserRuleContext) ToStringTree(ruleNames []string, recog Recognizer) string {
+ return TreesStringTree(prc, ruleNames, recog)
+}
+
+func (prc *BaseParserRuleContext) GetRuleContext() RuleContext {
+ return prc
+}
+
+func (prc *BaseParserRuleContext) Accept(visitor ParseTreeVisitor) interface{} {
+ return visitor.VisitChildren(prc)
+}
+
+func (prc *BaseParserRuleContext) SetStart(t Token) {
+ prc.start = t
+}
+
+func (prc *BaseParserRuleContext) GetStart() Token {
+ return prc.start
+}
+
+func (prc *BaseParserRuleContext) SetStop(t Token) {
+ prc.stop = t
+}
+
+func (prc *BaseParserRuleContext) GetStop() Token {
+ return prc.stop
+}
+
+func (prc *BaseParserRuleContext) GetToken(ttype int, i int) TerminalNode {
+
+ for j := 0; j < len(prc.children); j++ {
+ child := prc.children[j]
+ if c2, ok := child.(TerminalNode); ok {
+ if c2.GetSymbol().GetTokenType() == ttype {
+ if i == 0 {
+ return c2
+ }
+
+ i--
+ }
+ }
+ }
+ return nil
+}
+
+func (prc *BaseParserRuleContext) GetTokens(ttype int) []TerminalNode {
+ if prc.children == nil {
+ return make([]TerminalNode, 0)
+ }
+
+ tokens := make([]TerminalNode, 0)
+
+ for j := 0; j < len(prc.children); j++ {
+ child := prc.children[j]
+ if tchild, ok := child.(TerminalNode); ok {
+ if tchild.GetSymbol().GetTokenType() == ttype {
+ tokens = append(tokens, tchild)
+ }
+ }
+ }
+
+ return tokens
+}
+
+func (prc *BaseParserRuleContext) GetPayload() interface{} {
+ return prc
+}
+
+func (prc *BaseParserRuleContext) getChild(ctxType reflect.Type, i int) RuleContext {
+ if prc.children == nil || i < 0 || i >= len(prc.children) {
+ return nil
+ }
+
+ j := -1 // what element have we found with ctxType?
+ for _, o := range prc.children {
+
+ childType := reflect.TypeOf(o)
+
+ if childType.Implements(ctxType) {
+ j++
+ if j == i {
+ return o.(RuleContext)
+ }
+ }
+ }
+ return nil
+}
+
+// Go lacks generics, so it's not possible for us to return the child with the correct type, but we do
+// check for convertibility
+
+func (prc *BaseParserRuleContext) GetTypedRuleContext(ctxType reflect.Type, i int) RuleContext {
+ return prc.getChild(ctxType, i)
+}
+
+func (prc *BaseParserRuleContext) GetTypedRuleContexts(ctxType reflect.Type) []RuleContext {
+ if prc.children == nil {
+ return make([]RuleContext, 0)
+ }
+
+ contexts := make([]RuleContext, 0)
+
+ for _, child := range prc.children {
+ childType := reflect.TypeOf(child)
+
+ if childType.ConvertibleTo(ctxType) {
+ contexts = append(contexts, child.(RuleContext))
+ }
+ }
+ return contexts
+}
+
+func (prc *BaseParserRuleContext) GetChildCount() int {
+ if prc.children == nil {
+ return 0
+ }
+
+ return len(prc.children)
+}
+
+func (prc *BaseParserRuleContext) GetSourceInterval() *Interval {
+ if prc.start == nil || prc.stop == nil {
+ return TreeInvalidInterval
+ }
+
+ return NewInterval(prc.start.GetTokenIndex(), prc.stop.GetTokenIndex())
+}
+
+//need to manage circular dependencies, so export now
+
+// Print out a whole tree, not just a node, in LISP format
+// (root child1 .. childN). Print just a node if b is a leaf.
+//
+
+func (prc *BaseParserRuleContext) String(ruleNames []string, stop RuleContext) string {
+
+ var p ParserRuleContext = prc
+ s := "["
+ for p != nil && p != stop {
+ if ruleNames == nil {
+ if !p.IsEmpty() {
+ s += strconv.Itoa(p.GetInvokingState())
+ }
+ } else {
+ ri := p.GetRuleIndex()
+ var ruleName string
+ if ri >= 0 && ri < len(ruleNames) {
+ ruleName = ruleNames[ri]
+ } else {
+ ruleName = strconv.Itoa(ri)
+ }
+ s += ruleName
+ }
+ if p.GetParent() != nil && (ruleNames != nil || !p.GetParent().(ParserRuleContext).IsEmpty()) {
+ s += " "
+ }
+ pi := p.GetParent()
+ if pi != nil {
+ p = pi.(ParserRuleContext)
+ } else {
+ p = nil
+ }
+ }
+ s += "]"
+ return s
+}
+
+var RuleContextEmpty = NewBaseParserRuleContext(nil, -1)
+
+type InterpreterRuleContext interface {
+ ParserRuleContext
+}
+
+type BaseInterpreterRuleContext struct {
+ *BaseParserRuleContext
+}
+
+func NewBaseInterpreterRuleContext(parent BaseInterpreterRuleContext, invokingStateNumber, ruleIndex int) *BaseInterpreterRuleContext {
+
+ prc := new(BaseInterpreterRuleContext)
+
+ prc.BaseParserRuleContext = NewBaseParserRuleContext(parent, invokingStateNumber)
+
+ prc.RuleIndex = ruleIndex
+
+ return prc
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/prediction_context.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/prediction_context.go
new file mode 100644
index 000000000..9fdfd52b2
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/prediction_context.go
@@ -0,0 +1,751 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "strconv"
+)
+
+// Represents {@code $} in local context prediction, which means wildcard.
+// {@code//+x =//}.
+// /
+const (
+ BasePredictionContextEmptyReturnState = 0x7FFFFFFF
+)
+
+// Represents {@code $} in an array in full context mode, when {@code $}
+// doesn't mean wildcard: {@code $ + x = [$,x]}. Here,
+// {@code $} = {@link //EmptyReturnState}.
+// /
+
+var (
+ BasePredictionContextglobalNodeCount = 1
+ BasePredictionContextid = BasePredictionContextglobalNodeCount
+)
+
+type PredictionContext interface {
+ hash() int
+ GetParent(int) PredictionContext
+ getReturnState(int) int
+ equals(PredictionContext) bool
+ length() int
+ isEmpty() bool
+ hasEmptyPath() bool
+ String() string
+}
+
+type BasePredictionContext struct {
+ cachedHash int
+}
+
+func NewBasePredictionContext(cachedHash int) *BasePredictionContext {
+ pc := new(BasePredictionContext)
+ pc.cachedHash = cachedHash
+
+ return pc
+}
+
+func (b *BasePredictionContext) isEmpty() bool {
+ return false
+}
+
+func calculateHash(parent PredictionContext, returnState int) int {
+ h := murmurInit(1)
+ h = murmurUpdate(h, parent.hash())
+ h = murmurUpdate(h, returnState)
+ return murmurFinish(h, 2)
+}
+
+var _emptyPredictionContextHash int
+
+func init() {
+ _emptyPredictionContextHash = murmurInit(1)
+ _emptyPredictionContextHash = murmurFinish(_emptyPredictionContextHash, 0)
+}
+
+func calculateEmptyHash() int {
+ return _emptyPredictionContextHash
+}
+
+// Used to cache {@link BasePredictionContext} objects. Its used for the shared
+// context cash associated with contexts in DFA states. This cache
+// can be used for both lexers and parsers.
+
+type PredictionContextCache struct {
+ cache map[PredictionContext]PredictionContext
+}
+
+func NewPredictionContextCache() *PredictionContextCache {
+ t := new(PredictionContextCache)
+ t.cache = make(map[PredictionContext]PredictionContext)
+ return t
+}
+
+// Add a context to the cache and return it. If the context already exists,
+// return that one instead and do not add a Newcontext to the cache.
+// Protect shared cache from unsafe thread access.
+//
+func (p *PredictionContextCache) add(ctx PredictionContext) PredictionContext {
+ if ctx == BasePredictionContextEMPTY {
+ return BasePredictionContextEMPTY
+ }
+ existing := p.cache[ctx]
+ if existing != nil {
+ return existing
+ }
+ p.cache[ctx] = ctx
+ return ctx
+}
+
+func (p *PredictionContextCache) Get(ctx PredictionContext) PredictionContext {
+ return p.cache[ctx]
+}
+
+func (p *PredictionContextCache) length() int {
+ return len(p.cache)
+}
+
+type SingletonPredictionContext interface {
+ PredictionContext
+}
+
+type BaseSingletonPredictionContext struct {
+ *BasePredictionContext
+
+ parentCtx PredictionContext
+ returnState int
+}
+
+func NewBaseSingletonPredictionContext(parent PredictionContext, returnState int) *BaseSingletonPredictionContext {
+ var cachedHash int
+ if parent != nil {
+ cachedHash = calculateHash(parent, returnState)
+ } else {
+ cachedHash = calculateEmptyHash()
+ }
+
+ s := new(BaseSingletonPredictionContext)
+ s.BasePredictionContext = NewBasePredictionContext(cachedHash)
+
+ s.parentCtx = parent
+ s.returnState = returnState
+
+ return s
+}
+
+func SingletonBasePredictionContextCreate(parent PredictionContext, returnState int) PredictionContext {
+ if returnState == BasePredictionContextEmptyReturnState && parent == nil {
+ // someone can pass in the bits of an array ctx that mean $
+ return BasePredictionContextEMPTY
+ }
+
+ return NewBaseSingletonPredictionContext(parent, returnState)
+}
+
+func (b *BaseSingletonPredictionContext) length() int {
+ return 1
+}
+
+func (b *BaseSingletonPredictionContext) GetParent(index int) PredictionContext {
+ return b.parentCtx
+}
+
+func (b *BaseSingletonPredictionContext) getReturnState(index int) int {
+ return b.returnState
+}
+
+func (b *BaseSingletonPredictionContext) hasEmptyPath() bool {
+ return b.returnState == BasePredictionContextEmptyReturnState
+}
+
+func (b *BaseSingletonPredictionContext) equals(other PredictionContext) bool {
+ if b == other {
+ return true
+ } else if _, ok := other.(*BaseSingletonPredictionContext); !ok {
+ return false
+ } else if b.hash() != other.hash() {
+ return false // can't be same if hash is different
+ }
+
+ otherP := other.(*BaseSingletonPredictionContext)
+
+ if b.returnState != other.getReturnState(0) {
+ return false
+ } else if b.parentCtx == nil {
+ return otherP.parentCtx == nil
+ }
+
+ return b.parentCtx.equals(otherP.parentCtx)
+}
+
+func (b *BaseSingletonPredictionContext) hash() int {
+ return b.cachedHash
+}
+
+func (b *BaseSingletonPredictionContext) String() string {
+ var up string
+
+ if b.parentCtx == nil {
+ up = ""
+ } else {
+ up = b.parentCtx.String()
+ }
+
+ if len(up) == 0 {
+ if b.returnState == BasePredictionContextEmptyReturnState {
+ return "$"
+ }
+
+ return strconv.Itoa(b.returnState)
+ }
+
+ return strconv.Itoa(b.returnState) + " " + up
+}
+
+var BasePredictionContextEMPTY = NewEmptyPredictionContext()
+
+type EmptyPredictionContext struct {
+ *BaseSingletonPredictionContext
+}
+
+func NewEmptyPredictionContext() *EmptyPredictionContext {
+
+ p := new(EmptyPredictionContext)
+
+ p.BaseSingletonPredictionContext = NewBaseSingletonPredictionContext(nil, BasePredictionContextEmptyReturnState)
+
+ return p
+}
+
+func (e *EmptyPredictionContext) isEmpty() bool {
+ return true
+}
+
+func (e *EmptyPredictionContext) GetParent(index int) PredictionContext {
+ return nil
+}
+
+func (e *EmptyPredictionContext) getReturnState(index int) int {
+ return e.returnState
+}
+
+func (e *EmptyPredictionContext) equals(other PredictionContext) bool {
+ return e == other
+}
+
+func (e *EmptyPredictionContext) String() string {
+ return "$"
+}
+
+type ArrayPredictionContext struct {
+ *BasePredictionContext
+
+ parents []PredictionContext
+ returnStates []int
+}
+
+func NewArrayPredictionContext(parents []PredictionContext, returnStates []int) *ArrayPredictionContext {
+ // Parent can be nil only if full ctx mode and we make an array
+ // from {@link //EMPTY} and non-empty. We merge {@link //EMPTY} by using
+ // nil parent and
+ // returnState == {@link //EmptyReturnState}.
+ hash := murmurInit(1)
+
+ for _, parent := range parents {
+ hash = murmurUpdate(hash, parent.hash())
+ }
+
+ for _, returnState := range returnStates {
+ hash = murmurUpdate(hash, returnState)
+ }
+
+ hash = murmurFinish(hash, len(parents)<<1)
+
+ c := new(ArrayPredictionContext)
+ c.BasePredictionContext = NewBasePredictionContext(hash)
+
+ c.parents = parents
+ c.returnStates = returnStates
+
+ return c
+}
+
+func (a *ArrayPredictionContext) GetReturnStates() []int {
+ return a.returnStates
+}
+
+func (a *ArrayPredictionContext) hasEmptyPath() bool {
+ return a.getReturnState(a.length()-1) == BasePredictionContextEmptyReturnState
+}
+
+func (a *ArrayPredictionContext) isEmpty() bool {
+ // since EmptyReturnState can only appear in the last position, we
+ // don't need to verify that size==1
+ return a.returnStates[0] == BasePredictionContextEmptyReturnState
+}
+
+func (a *ArrayPredictionContext) length() int {
+ return len(a.returnStates)
+}
+
+func (a *ArrayPredictionContext) GetParent(index int) PredictionContext {
+ return a.parents[index]
+}
+
+func (a *ArrayPredictionContext) getReturnState(index int) int {
+ return a.returnStates[index]
+}
+
+func (a *ArrayPredictionContext) equals(other PredictionContext) bool {
+ if _, ok := other.(*ArrayPredictionContext); !ok {
+ return false
+ } else if a.cachedHash != other.hash() {
+ return false // can't be same if hash is different
+ } else {
+ otherP := other.(*ArrayPredictionContext)
+ return &a.returnStates == &otherP.returnStates && &a.parents == &otherP.parents
+ }
+}
+
+func (a *ArrayPredictionContext) hash() int {
+ return a.BasePredictionContext.cachedHash
+}
+
+func (a *ArrayPredictionContext) String() string {
+ if a.isEmpty() {
+ return "[]"
+ }
+
+ s := "["
+ for i := 0; i < len(a.returnStates); i++ {
+ if i > 0 {
+ s = s + ", "
+ }
+ if a.returnStates[i] == BasePredictionContextEmptyReturnState {
+ s = s + "$"
+ continue
+ }
+ s = s + strconv.Itoa(a.returnStates[i])
+ if a.parents[i] != nil {
+ s = s + " " + a.parents[i].String()
+ } else {
+ s = s + "nil"
+ }
+ }
+
+ return s + "]"
+}
+
+// Convert a {@link RuleContext} tree to a {@link BasePredictionContext} graph.
+// Return {@link //EMPTY} if {@code outerContext} is empty or nil.
+// /
+func predictionContextFromRuleContext(a *ATN, outerContext RuleContext) PredictionContext {
+ if outerContext == nil {
+ outerContext = RuleContextEmpty
+ }
+ // if we are in RuleContext of start rule, s, then BasePredictionContext
+ // is EMPTY. Nobody called us. (if we are empty, return empty)
+ if outerContext.GetParent() == nil || outerContext == RuleContextEmpty {
+ return BasePredictionContextEMPTY
+ }
+ // If we have a parent, convert it to a BasePredictionContext graph
+ parent := predictionContextFromRuleContext(a, outerContext.GetParent().(RuleContext))
+ state := a.states[outerContext.GetInvokingState()]
+ transition := state.GetTransitions()[0]
+
+ return SingletonBasePredictionContextCreate(parent, transition.(*RuleTransition).followState.GetStateNumber())
+}
+
+func merge(a, b PredictionContext, rootIsWildcard bool, mergeCache *DoubleDict) PredictionContext {
+ // share same graph if both same
+ if a == b {
+ return a
+ }
+
+ ac, ok1 := a.(*BaseSingletonPredictionContext)
+ bc, ok2 := b.(*BaseSingletonPredictionContext)
+
+ if ok1 && ok2 {
+ return mergeSingletons(ac, bc, rootIsWildcard, mergeCache)
+ }
+ // At least one of a or b is array
+ // If one is $ and rootIsWildcard, return $ as// wildcard
+ if rootIsWildcard {
+ if _, ok := a.(*EmptyPredictionContext); ok {
+ return a
+ }
+ if _, ok := b.(*EmptyPredictionContext); ok {
+ return b
+ }
+ }
+ // convert singleton so both are arrays to normalize
+ if _, ok := a.(*BaseSingletonPredictionContext); ok {
+ a = NewArrayPredictionContext([]PredictionContext{a.GetParent(0)}, []int{a.getReturnState(0)})
+ }
+ if _, ok := b.(*BaseSingletonPredictionContext); ok {
+ b = NewArrayPredictionContext([]PredictionContext{b.GetParent(0)}, []int{b.getReturnState(0)})
+ }
+ return mergeArrays(a.(*ArrayPredictionContext), b.(*ArrayPredictionContext), rootIsWildcard, mergeCache)
+}
+
+//
+// Merge two {@link SingletonBasePredictionContext} instances.
+//
+//
Stack tops equal, parents merge is same return left graph.
+//
+//
+//
Same stack top, parents differ merge parents giving array node, then
+// remainders of those graphs. A Newroot node is created to point to the
+// merged parents.
+//
+//
+//
Different stack tops pointing to same parent. Make array node for the
+// root where both element in the root point to the same (original)
+// parent.
+//
+//
+//
Different stack tops pointing to different parents. Make array node for
+// the root where each element points to the corresponding original
+// parent.
+//
+//
+// @param a the first {@link SingletonBasePredictionContext}
+// @param b the second {@link SingletonBasePredictionContext}
+// @param rootIsWildcard {@code true} if this is a local-context merge,
+// otherwise false to indicate a full-context merge
+// @param mergeCache
+// /
+func mergeSingletons(a, b *BaseSingletonPredictionContext, rootIsWildcard bool, mergeCache *DoubleDict) PredictionContext {
+ if mergeCache != nil {
+ previous := mergeCache.Get(a.hash(), b.hash())
+ if previous != nil {
+ return previous.(PredictionContext)
+ }
+ previous = mergeCache.Get(b.hash(), a.hash())
+ if previous != nil {
+ return previous.(PredictionContext)
+ }
+ }
+
+ rootMerge := mergeRoot(a, b, rootIsWildcard)
+ if rootMerge != nil {
+ if mergeCache != nil {
+ mergeCache.set(a.hash(), b.hash(), rootMerge)
+ }
+ return rootMerge
+ }
+ if a.returnState == b.returnState {
+ parent := merge(a.parentCtx, b.parentCtx, rootIsWildcard, mergeCache)
+ // if parent is same as existing a or b parent or reduced to a parent,
+ // return it
+ if parent == a.parentCtx {
+ return a // ax + bx = ax, if a=b
+ }
+ if parent == b.parentCtx {
+ return b // ax + bx = bx, if a=b
+ }
+ // else: ax + ay = a'[x,y]
+ // merge parents x and y, giving array node with x,y then remainders
+ // of those graphs. dup a, a' points at merged array
+ // Newjoined parent so create Newsingleton pointing to it, a'
+ spc := SingletonBasePredictionContextCreate(parent, a.returnState)
+ if mergeCache != nil {
+ mergeCache.set(a.hash(), b.hash(), spc)
+ }
+ return spc
+ }
+ // a != b payloads differ
+ // see if we can collapse parents due to $+x parents if local ctx
+ var singleParent PredictionContext
+ if a == b || (a.parentCtx != nil && a.parentCtx == b.parentCtx) { // ax +
+ // bx =
+ // [a,b]x
+ singleParent = a.parentCtx
+ }
+ if singleParent != nil { // parents are same
+ // sort payloads and use same parent
+ payloads := []int{a.returnState, b.returnState}
+ if a.returnState > b.returnState {
+ payloads[0] = b.returnState
+ payloads[1] = a.returnState
+ }
+ parents := []PredictionContext{singleParent, singleParent}
+ apc := NewArrayPredictionContext(parents, payloads)
+ if mergeCache != nil {
+ mergeCache.set(a.hash(), b.hash(), apc)
+ }
+ return apc
+ }
+ // parents differ and can't merge them. Just pack together
+ // into array can't merge.
+ // ax + by = [ax,by]
+ payloads := []int{a.returnState, b.returnState}
+ parents := []PredictionContext{a.parentCtx, b.parentCtx}
+ if a.returnState > b.returnState { // sort by payload
+ payloads[0] = b.returnState
+ payloads[1] = a.returnState
+ parents = []PredictionContext{b.parentCtx, a.parentCtx}
+ }
+ apc := NewArrayPredictionContext(parents, payloads)
+ if mergeCache != nil {
+ mergeCache.set(a.hash(), b.hash(), apc)
+ }
+ return apc
+}
+
+//
+// Handle case where at least one of {@code a} or {@code b} is
+// {@link //EMPTY}. In the following diagrams, the symbol {@code $} is used
+// to represent {@link //EMPTY}.
+//
+//
Local-Context Merges
+//
+//
These local-context merge operations are used when {@code rootIsWildcard}
+// is true.
+//
+//
{@link //EMPTY} is superset of any graph return {@link //EMPTY}.
+//
+//
+//
{@link //EMPTY} and anything is {@code //EMPTY}, so merged parent is
+// {@code //EMPTY} return left graph.
+//
+//
+//
Special case of last merge if local context.
+//
+//
+//
Full-Context Merges
+//
+//
These full-context merge operations are used when {@code rootIsWildcard}
+// is false.
+//
+//
+//
+//
Must keep all contexts {@link //EMPTY} in array is a special value (and
+// nil parent).
+//
+//
+//
+//
+// @param a the first {@link SingletonBasePredictionContext}
+// @param b the second {@link SingletonBasePredictionContext}
+// @param rootIsWildcard {@code true} if this is a local-context merge,
+// otherwise false to indicate a full-context merge
+// /
+func mergeRoot(a, b SingletonPredictionContext, rootIsWildcard bool) PredictionContext {
+ if rootIsWildcard {
+ if a == BasePredictionContextEMPTY {
+ return BasePredictionContextEMPTY // // + b =//
+ }
+ if b == BasePredictionContextEMPTY {
+ return BasePredictionContextEMPTY // a +// =//
+ }
+ } else {
+ if a == BasePredictionContextEMPTY && b == BasePredictionContextEMPTY {
+ return BasePredictionContextEMPTY // $ + $ = $
+ } else if a == BasePredictionContextEMPTY { // $ + x = [$,x]
+ payloads := []int{b.getReturnState(-1), BasePredictionContextEmptyReturnState}
+ parents := []PredictionContext{b.GetParent(-1), nil}
+ return NewArrayPredictionContext(parents, payloads)
+ } else if b == BasePredictionContextEMPTY { // x + $ = [$,x] ($ is always first if present)
+ payloads := []int{a.getReturnState(-1), BasePredictionContextEmptyReturnState}
+ parents := []PredictionContext{a.GetParent(-1), nil}
+ return NewArrayPredictionContext(parents, payloads)
+ }
+ }
+ return nil
+}
+
+//
+// Merge two {@link ArrayBasePredictionContext} instances.
+//
+//
Different tops, different parents.
+//
+//
+//
Shared top, same parents.
+//
+//
+//
Shared top, different parents.
+//
+//
+//
Shared top, all shared parents.
+//
+//
+//
Equal tops, merge parents and reduce top to
+// {@link SingletonBasePredictionContext}.
+//
+// /
+func mergeArrays(a, b *ArrayPredictionContext, rootIsWildcard bool, mergeCache *DoubleDict) PredictionContext {
+ if mergeCache != nil {
+ previous := mergeCache.Get(a.hash(), b.hash())
+ if previous != nil {
+ return previous.(PredictionContext)
+ }
+ previous = mergeCache.Get(b.hash(), a.hash())
+ if previous != nil {
+ return previous.(PredictionContext)
+ }
+ }
+ // merge sorted payloads a + b => M
+ i := 0 // walks a
+ j := 0 // walks b
+ k := 0 // walks target M array
+
+ mergedReturnStates := make([]int, len(a.returnStates)+len(b.returnStates))
+ mergedParents := make([]PredictionContext, len(a.returnStates)+len(b.returnStates))
+ // walk and merge to yield mergedParents, mergedReturnStates
+ for i < len(a.returnStates) && j < len(b.returnStates) {
+ aParent := a.parents[i]
+ bParent := b.parents[j]
+ if a.returnStates[i] == b.returnStates[j] {
+ // same payload (stack tops are equal), must yield merged singleton
+ payload := a.returnStates[i]
+ // $+$ = $
+ bothDollars := payload == BasePredictionContextEmptyReturnState && aParent == nil && bParent == nil
+ axAX := (aParent != nil && bParent != nil && aParent == bParent) // ax+ax
+ // ->
+ // ax
+ if bothDollars || axAX {
+ mergedParents[k] = aParent // choose left
+ mergedReturnStates[k] = payload
+ } else { // ax+ay -> a'[x,y]
+ mergedParent := merge(aParent, bParent, rootIsWildcard, mergeCache)
+ mergedParents[k] = mergedParent
+ mergedReturnStates[k] = payload
+ }
+ i++ // hop over left one as usual
+ j++ // but also Skip one in right side since we merge
+ } else if a.returnStates[i] < b.returnStates[j] { // copy a[i] to M
+ mergedParents[k] = aParent
+ mergedReturnStates[k] = a.returnStates[i]
+ i++
+ } else { // b > a, copy b[j] to M
+ mergedParents[k] = bParent
+ mergedReturnStates[k] = b.returnStates[j]
+ j++
+ }
+ k++
+ }
+ // copy over any payloads remaining in either array
+ if i < len(a.returnStates) {
+ for p := i; p < len(a.returnStates); p++ {
+ mergedParents[k] = a.parents[p]
+ mergedReturnStates[k] = a.returnStates[p]
+ k++
+ }
+ } else {
+ for p := j; p < len(b.returnStates); p++ {
+ mergedParents[k] = b.parents[p]
+ mergedReturnStates[k] = b.returnStates[p]
+ k++
+ }
+ }
+ // trim merged if we combined a few that had same stack tops
+ if k < len(mergedParents) { // write index < last position trim
+ if k == 1 { // for just one merged element, return singleton top
+ pc := SingletonBasePredictionContextCreate(mergedParents[0], mergedReturnStates[0])
+ if mergeCache != nil {
+ mergeCache.set(a.hash(), b.hash(), pc)
+ }
+ return pc
+ }
+ mergedParents = mergedParents[0:k]
+ mergedReturnStates = mergedReturnStates[0:k]
+ }
+
+ M := NewArrayPredictionContext(mergedParents, mergedReturnStates)
+
+ // if we created same array as a or b, return that instead
+ // TODO: track whether this is possible above during merge sort for speed
+ if M == a {
+ if mergeCache != nil {
+ mergeCache.set(a.hash(), b.hash(), a)
+ }
+ return a
+ }
+ if M == b {
+ if mergeCache != nil {
+ mergeCache.set(a.hash(), b.hash(), b)
+ }
+ return b
+ }
+ combineCommonParents(mergedParents)
+
+ if mergeCache != nil {
+ mergeCache.set(a.hash(), b.hash(), M)
+ }
+ return M
+}
+
+//
+// Make pass over all M {@code parents} merge any {@code equals()}
+// ones.
+// /
+func combineCommonParents(parents []PredictionContext) {
+ uniqueParents := make(map[PredictionContext]PredictionContext)
+
+ for p := 0; p < len(parents); p++ {
+ parent := parents[p]
+ if uniqueParents[parent] == nil {
+ uniqueParents[parent] = parent
+ }
+ }
+ for q := 0; q < len(parents); q++ {
+ parents[q] = uniqueParents[parents[q]]
+ }
+}
+
+func getCachedBasePredictionContext(context PredictionContext, contextCache *PredictionContextCache, visited map[PredictionContext]PredictionContext) PredictionContext {
+
+ if context.isEmpty() {
+ return context
+ }
+ existing := visited[context]
+ if existing != nil {
+ return existing
+ }
+ existing = contextCache.Get(context)
+ if existing != nil {
+ visited[context] = existing
+ return existing
+ }
+ changed := false
+ parents := make([]PredictionContext, context.length())
+ for i := 0; i < len(parents); i++ {
+ parent := getCachedBasePredictionContext(context.GetParent(i), contextCache, visited)
+ if changed || parent != context.GetParent(i) {
+ if !changed {
+ parents = make([]PredictionContext, context.length())
+ for j := 0; j < context.length(); j++ {
+ parents[j] = context.GetParent(j)
+ }
+ changed = true
+ }
+ parents[i] = parent
+ }
+ }
+ if !changed {
+ contextCache.add(context)
+ visited[context] = context
+ return context
+ }
+ var updated PredictionContext
+ if len(parents) == 0 {
+ updated = BasePredictionContextEMPTY
+ } else if len(parents) == 1 {
+ updated = SingletonBasePredictionContextCreate(parents[0], context.getReturnState(0))
+ } else {
+ updated = NewArrayPredictionContext(parents, context.(*ArrayPredictionContext).GetReturnStates())
+ }
+ contextCache.add(updated)
+ visited[updated] = updated
+ visited[context] = updated
+
+ return updated
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/prediction_mode.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/prediction_mode.go
new file mode 100644
index 000000000..15718f912
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/prediction_mode.go
@@ -0,0 +1,553 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+// This enumeration defines the prediction modes available in ANTLR 4 along with
+// utility methods for analyzing configuration sets for conflicts and/or
+// ambiguities.
+
+const (
+ //
+ // The SLL(*) prediction mode. This prediction mode ignores the current
+ // parser context when making predictions. This is the fastest prediction
+ // mode, and provides correct results for many grammars. This prediction
+ // mode is more powerful than the prediction mode provided by ANTLR 3, but
+ // may result in syntax errors for grammar and input combinations which are
+ // not SLL.
+ //
+ //
+ // When using this prediction mode, the parser will either return a correct
+ // parse tree (i.e. the same parse tree that would be returned with the
+ // {@link //LL} prediction mode), or it will Report a syntax error. If a
+ // syntax error is encountered when using the {@link //SLL} prediction mode,
+ // it may be due to either an actual syntax error in the input or indicate
+ // that the particular combination of grammar and input requires the more
+ // powerful {@link //LL} prediction abilities to complete successfully.
+ //
+ //
+ // This prediction mode does not provide any guarantees for prediction
+ // behavior for syntactically-incorrect inputs.
+ //
+ PredictionModeSLL = 0
+ //
+ // The LL(*) prediction mode. This prediction mode allows the current parser
+ // context to be used for resolving SLL conflicts that occur during
+ // prediction. This is the fastest prediction mode that guarantees correct
+ // parse results for all combinations of grammars with syntactically correct
+ // inputs.
+ //
+ //
+ // When using this prediction mode, the parser will make correct decisions
+ // for all syntactically-correct grammar and input combinations. However, in
+ // cases where the grammar is truly ambiguous this prediction mode might not
+ // Report a precise answer for exactly which alternatives are
+ // ambiguous.
+ //
+ //
+ // This prediction mode does not provide any guarantees for prediction
+ // behavior for syntactically-incorrect inputs.
+ //
+ PredictionModeLL = 1
+ //
+ // The LL(*) prediction mode with exact ambiguity detection. In addition to
+ // the correctness guarantees provided by the {@link //LL} prediction mode,
+ // this prediction mode instructs the prediction algorithm to determine the
+ // complete and exact set of ambiguous alternatives for every ambiguous
+ // decision encountered while parsing.
+ //
+ //
+ // This prediction mode may be used for diagnosing ambiguities during
+ // grammar development. Due to the performance overhead of calculating sets
+ // of ambiguous alternatives, this prediction mode should be avoided when
+ // the exact results are not necessary.
+ //
+ //
+ // This prediction mode does not provide any guarantees for prediction
+ // behavior for syntactically-incorrect inputs.
+// This method computes the SLL prediction termination condition for both of
+// the following cases.
+//
+//
+//
The usual SLL+LL fallback upon SLL conflict
+//
Pure SLL without LL fallback
+//
+//
+//
COMBINED SLL+LL PARSING
+//
+//
When LL-fallback is enabled upon SLL conflict, correct predictions are
+// ensured regardless of how the termination condition is computed by this
+// method. Due to the substantially higher cost of LL prediction, the
+// prediction should only fall back to LL when the additional lookahead
+// cannot lead to a unique SLL prediction.
+//
+//
Assuming combined SLL+LL parsing, an SLL configuration set with only
+// conflicting subsets should fall back to full LL, even if the
+// configuration sets don't resolve to the same alternative (e.g.
+// {@code {1,2}} and {@code {3,4}}. If there is at least one non-conflicting
+// configuration, SLL could continue with the hopes that more lookahead will
+// resolve via one of those non-conflicting configurations.
+//
+//
Here's the prediction termination rule them: SLL (for SLL+LL parsing)
+// stops when it sees only conflicting configuration subsets. In contrast,
+// full LL keeps going when there is uncertainty.
+//
+//
HEURISTIC
+//
+//
As a heuristic, we stop prediction when we see any conflicting subset
+// unless we see a state that only has one alternative associated with it.
+// The single-alt-state thing lets prediction continue upon rules like
+// (otherwise, it would admit defeat too soon):
+//
+//
{@code [12|1|[], 6|2|[], 12|2|[]]. s : (ID | ID ID?) '' }
+//
+//
When the ATN simulation reaches the state before {@code ''}, it has a
+// DFA state that looks like: {@code [12|1|[], 6|2|[], 12|2|[]]}. Naturally
+// {@code 12|1|[]} and {@code 12|2|[]} conflict, but we cannot stop
+// processing this node because alternative to has another way to continue,
+// via {@code [6|2|[]]}.
+//
+//
It also let's us continue for this rule:
+//
+//
{@code [1|1|[], 1|2|[], 8|3|[]] a : A | A | A B }
+//
+//
After Matching input A, we reach the stop state for rule A, state 1.
+// State 8 is the state right before B. Clearly alternatives 1 and 2
+// conflict and no amount of further lookahead will separate the two.
+// However, alternative 3 will be able to continue and so we do not stop
+// working on this state. In the previous example, we're concerned with
+// states associated with the conflicting alternatives. Here alt 3 is not
+// associated with the conflicting configs, but since we can continue
+// looking for input reasonably, don't declare the state done.
+//
+//
PURE SLL PARSING
+//
+//
To handle pure SLL parsing, all we have to do is make sure that we
+// combine stack contexts for configurations that differ only by semantic
+// predicate. From there, we can do the usual SLL termination heuristic.
+//
+//
PREDICATES IN SLL+LL PARSING
+//
+//
SLL decisions don't evaluate predicates until after they reach DFA stop
+// states because they need to create the DFA cache that works in all
+// semantic situations. In contrast, full LL evaluates predicates collected
+// during start state computation so it can ignore predicates thereafter.
+// This means that SLL termination detection can totally ignore semantic
+// predicates.
+//
+//
Implementation-wise, {@link ATNConfigSet} combines stack contexts but not
+// semantic predicate contexts so we might see two configurations like the
+// following.
+//
+//
{@code (s, 1, x, {}), (s, 1, x', {p})}
+//
+//
Before testing these configurations against others, we have to merge
+// {@code x} and {@code x'} (without modifying the existing configurations).
+// For example, we test {@code (x+x')==x''} when looking for conflicts in
+// the following configurations.
If the configuration set has predicates (as indicated by
+// {@link ATNConfigSet//hasSemanticContext}), this algorithm makes a copy of
+// the configurations to strip out all of the predicates so that a standard
+// {@link ATNConfigSet} will merge everything ignoring predicates.
+//
+func PredictionModehasSLLConflictTerminatingPrediction(mode int, configs ATNConfigSet) bool {
+ // Configs in rule stop states indicate reaching the end of the decision
+ // rule (local context) or end of start rule (full context). If all
+ // configs meet this condition, then none of the configurations is able
+ // to Match additional input so we terminate prediction.
+ //
+ if PredictionModeallConfigsInRuleStopStates(configs) {
+ return true
+ }
+ // pure SLL mode parsing
+ if mode == PredictionModeSLL {
+ // Don't bother with combining configs from different semantic
+ // contexts if we can fail over to full LL costs more time
+ // since we'll often fail over anyway.
+ if configs.HasSemanticContext() {
+ // dup configs, tossing out semantic predicates
+ dup := NewBaseATNConfigSet(false)
+ for _, c := range configs.GetItems() {
+
+ // NewBaseATNConfig({semanticContext:}, c)
+ c = NewBaseATNConfig2(c, SemanticContextNone)
+ dup.Add(c, nil)
+ }
+ configs = dup
+ }
+ // now we have combined contexts for configs with dissimilar preds
+ }
+ // pure SLL or combined SLL+LL mode parsing
+ altsets := PredictionModegetConflictingAltSubsets(configs)
+ return PredictionModehasConflictingAltSet(altsets) && !PredictionModehasStateAssociatedWithOneAlt(configs)
+}
+
+// Checks if any configuration in {@code configs} is in a
+// {@link RuleStopState}. Configurations meeting this condition have reached
+// the end of the decision rule (local context) or end of start rule (full
+// context).
+//
+// @param configs the configuration set to test
+// @return {@code true} if any configuration in {@code configs} is in a
+// {@link RuleStopState}, otherwise {@code false}
+func PredictionModehasConfigInRuleStopState(configs ATNConfigSet) bool {
+ for _, c := range configs.GetItems() {
+ if _, ok := c.GetState().(*RuleStopState); ok {
+ return true
+ }
+ }
+ return false
+}
+
+// Checks if all configurations in {@code configs} are in a
+// {@link RuleStopState}. Configurations meeting this condition have reached
+// the end of the decision rule (local context) or end of start rule (full
+// context).
+//
+// @param configs the configuration set to test
+// @return {@code true} if all configurations in {@code configs} are in a
+// {@link RuleStopState}, otherwise {@code false}
+func PredictionModeallConfigsInRuleStopStates(configs ATNConfigSet) bool {
+
+ for _, c := range configs.GetItems() {
+ if _, ok := c.GetState().(*RuleStopState); !ok {
+ return false
+ }
+ }
+ return true
+}
+
+//
+// Full LL prediction termination.
+//
+//
Can we stop looking ahead during ATN simulation or is there some
+// uncertainty as to which alternative we will ultimately pick, after
+// consuming more input? Even if there are partial conflicts, we might know
+// that everything is going to resolve to the same minimum alternative. That
+// means we can stop since no more lookahead will change that fact. On the
+// other hand, there might be multiple conflicts that resolve to different
+// minimums. That means we need more look ahead to decide which of those
+// alternatives we should predict.
+//
+//
The basic idea is to split the set of configurations {@code C}, into
+// conflicting subsets {@code (s, _, ctx, _)} and singleton subsets with
+// non-conflicting configurations. Two configurations conflict if they have
+// identical {@link ATNConfig//state} and {@link ATNConfig//context} values
+// but different {@link ATNConfig//alt} value, e.g. {@code (s, i, ctx, _)}
+// and {@code (s, j, ctx, _)} for {@code i!=j}.
+//
+//
Reduce these configuration subsets to the set of possible alternatives.
+// You can compute the alternative subsets in one pass as follows:
+//
+//
{@code A_s,ctx = {i | (s, i, ctx, _)}} for each configuration in
+// {@code C} holding {@code s} and {@code ctx} fixed.
+//
+//
Or in pseudo-code, for each configuration {@code c} in {@code C}:
+//
+//
+// map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not
+// alt and not pred
+//
+//
+//
The values in {@code map} are the set of {@code A_s,ctx} sets.
+//
+//
If {@code |A_s,ctx|=1} then there is no conflict associated with
+// {@code s} and {@code ctx}.
+//
+//
Reduce the subsets to singletons by choosing a minimum of each subset. If
+// the union of these alternative subsets is a singleton, then no amount of
+// more lookahead will help us. We will always pick that alternative. If,
+// however, there is more than one alternative, then we are uncertain which
+// alternative to predict and must continue looking for resolution. We may
+// or may not discover an ambiguity in the future, even if there are no
+// conflicting subsets this round.
+//
+//
The biggest sin is to terminate early because it means we've made a
+// decision but were uncertain as to the eventual outcome. We haven't used
+// enough lookahead. On the other hand, announcing a conflict too late is no
+// big deal you will still have the conflict. It's just inefficient. It
+// might even look until the end of file.
+//
+//
No special consideration for semantic predicates is required because
+// predicates are evaluated on-the-fly for full LL prediction, ensuring that
+// no configuration contains a semantic context during the termination
+// check.
+//
+//
CONFLICTING CONFIGS
+//
+//
Two configurations {@code (s, i, x)} and {@code (s, j, x')}, conflict
+// when {@code i!=j} but {@code x=x'}. Because we merge all
+// {@code (s, i, _)} configurations together, that means that there are at
+// most {@code n} configurations associated with state {@code s} for
+// {@code n} possible alternatives in the decision. The merged stacks
+// complicate the comparison of configuration contexts {@code x} and
+// {@code x'}. Sam checks to see if one is a subset of the other by calling
+// merge and checking to see if the merged result is either {@code x} or
+// {@code x'}. If the {@code x} associated with lowest alternative {@code i}
+// is the superset, then {@code i} is the only possible prediction since the
+// others resolve to {@code min(i)} as well. However, if {@code x} is
+// associated with {@code j>i} then at least one stack configuration for
+// {@code j} is not in conflict with alternative {@code i}. The algorithm
+// should keep going, looking for more lookahead due to the uncertainty.
+//
+//
For simplicity, I'm doing a equality check between {@code x} and
+// {@code x'} that lets the algorithm continue to consume lookahead longer
+// than necessary. The reason I like the equality is of course the
+// simplicity but also because that is the test you need to detect the
+// alternatives that are actually in conflict.
+//
+//
CONTINUE/STOP RULE
+//
+//
Continue if union of resolved alternative sets from non-conflicting and
+// conflicting alternative subsets has more than one alternative. We are
+// uncertain about which alternative to predict.
+//
+//
The complete set of alternatives, {@code [i for (_,i,_)]}, tells us which
+// alternatives are still in the running for the amount of input we've
+// consumed at this point. The conflicting sets let us to strip away
+// configurations that won't lead to more states because we resolve
+// conflicts to the configuration with a minimum alternate for the
+// conflicting set.
+//
+//
CASES
+//
+//
+//
+//
no conflicts and more than 1 alternative in set => continue
If all states Report the same conflicting set of alternatives, then we
+// know we have the exact ambiguity set.
+//
+//
|A_i|>1 and
+// A_i = A_j for all i, j.
+//
+//
In other words, we continue examining lookahead until all {@code A_i}
+// have more than one alternative and all {@code A_i} are the same. If
+// {@code A={{1,2}, {1,3}}}, then regular LL prediction would terminate
+// because the resolved set is {@code {1}}. To determine what the real
+// ambiguity is, we have to know whether the ambiguity is between one and
+// two or one and three so we keep going. We can only stop prediction when
+// we need exact ambiguity detection when the sets look like
+// {@code A={{1,2}}} or {@code {{1,2},{1,2}}}, etc...
+//
+func PredictionModeresolvesToJustOneViableAlt(altsets []*BitSet) int {
+ return PredictionModegetSingleViableAlt(altsets)
+}
+
+//
+// Determines if every alternative subset in {@code altsets} contains more
+// than one alternative.
+//
+// @param altsets a collection of alternative subsets
+// @return {@code true} if every {@link BitSet} in {@code altsets} has
+// {@link BitSet//cardinality cardinality} > 1, otherwise {@code false}
+//
+func PredictionModeallSubsetsConflict(altsets []*BitSet) bool {
+ return !PredictionModehasNonConflictingAltSet(altsets)
+}
+
+//
+// Determines if any single alternative subset in {@code altsets} contains
+// exactly one alternative.
+//
+// @param altsets a collection of alternative subsets
+// @return {@code true} if {@code altsets} contains a {@link BitSet} with
+// {@link BitSet//cardinality cardinality} 1, otherwise {@code false}
+//
+func PredictionModehasNonConflictingAltSet(altsets []*BitSet) bool {
+ for i := 0; i < len(altsets); i++ {
+ alts := altsets[i]
+ if alts.length() == 1 {
+ return true
+ }
+ }
+ return false
+}
+
+//
+// Determines if any single alternative subset in {@code altsets} contains
+// more than one alternative.
+//
+// @param altsets a collection of alternative subsets
+// @return {@code true} if {@code altsets} contains a {@link BitSet} with
+// {@link BitSet//cardinality cardinality} > 1, otherwise {@code false}
+//
+func PredictionModehasConflictingAltSet(altsets []*BitSet) bool {
+ for i := 0; i < len(altsets); i++ {
+ alts := altsets[i]
+ if alts.length() > 1 {
+ return true
+ }
+ }
+ return false
+}
+
+//
+// Determines if every alternative subset in {@code altsets} is equivalent.
+//
+// @param altsets a collection of alternative subsets
+// @return {@code true} if every member of {@code altsets} is equal to the
+// others, otherwise {@code false}
+//
+func PredictionModeallSubsetsEqual(altsets []*BitSet) bool {
+ var first *BitSet
+
+ for i := 0; i < len(altsets); i++ {
+ alts := altsets[i]
+ if first == nil {
+ first = alts
+ } else if alts != first {
+ return false
+ }
+ }
+
+ return true
+}
+
+//
+// Returns the unique alternative predicted by all alternative subsets in
+// {@code altsets}. If no such alternative exists, this method returns
+// {@link ATN//INVALID_ALT_NUMBER}.
+//
+// @param altsets a collection of alternative subsets
+//
+func PredictionModegetUniqueAlt(altsets []*BitSet) int {
+ all := PredictionModeGetAlts(altsets)
+ if all.length() == 1 {
+ return all.minValue()
+ }
+
+ return ATNInvalidAltNumber
+}
+
+// Gets the complete set of represented alternatives for a collection of
+// alternative subsets. This method returns the union of each {@link BitSet}
+// in {@code altsets}.
+//
+// @param altsets a collection of alternative subsets
+// @return the set of represented alternatives in {@code altsets}
+//
+func PredictionModeGetAlts(altsets []*BitSet) *BitSet {
+ all := NewBitSet()
+ for _, alts := range altsets {
+ all.or(alts)
+ }
+ return all
+}
+
+//
+// This func gets the conflicting alt subsets from a configuration set.
+// For each configuration {@code c} in {@code configs}:
+//
+//
+// map[c] U= c.{@link ATNConfig//alt alt} // map hash/equals uses s and x, not
+// alt and not pred
+//
+//
+func PredictionModegetConflictingAltSubsets(configs ATNConfigSet) []*BitSet {
+ configToAlts := make(map[int]*BitSet)
+
+ for _, c := range configs.GetItems() {
+ key := 31 * c.GetState().GetStateNumber() + c.GetContext().hash()
+
+ alts, ok := configToAlts[key]
+ if !ok {
+ alts = NewBitSet()
+ configToAlts[key] = alts
+ }
+ alts.add(c.GetAlt())
+ }
+
+ values := make([]*BitSet, 0, 10)
+ for _, v := range configToAlts {
+ values = append(values, v)
+ }
+ return values
+}
+
+//
+// Get a map from state to alt subset from a configuration set. For each
+// configuration {@code c} in {@code configs}:
+//
+//
+//
+func PredictionModeGetStateToAltMap(configs ATNConfigSet) *AltDict {
+ m := NewAltDict()
+
+ for _, c := range configs.GetItems() {
+ alts := m.Get(c.GetState().String())
+ if alts == nil {
+ alts = NewBitSet()
+ m.put(c.GetState().String(), alts)
+ }
+ alts.(*BitSet).add(c.GetAlt())
+ }
+ return m
+}
+
+func PredictionModehasStateAssociatedWithOneAlt(configs ATNConfigSet) bool {
+ values := PredictionModeGetStateToAltMap(configs).values()
+ for i := 0; i < len(values); i++ {
+ if values[i].(*BitSet).length() == 1 {
+ return true
+ }
+ }
+ return false
+}
+
+func PredictionModegetSingleViableAlt(altsets []*BitSet) int {
+ result := ATNInvalidAltNumber
+
+ for i := 0; i < len(altsets); i++ {
+ alts := altsets[i]
+ minAlt := alts.minValue()
+ if result == ATNInvalidAltNumber {
+ result = minAlt
+ } else if result != minAlt { // more than 1 viable alt
+ return ATNInvalidAltNumber
+ }
+ }
+ return result
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/recognizer.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/recognizer.go
new file mode 100644
index 000000000..93efcf355
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/recognizer.go
@@ -0,0 +1,217 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "strings"
+
+ "strconv"
+)
+
+type Recognizer interface {
+ GetLiteralNames() []string
+ GetSymbolicNames() []string
+ GetRuleNames() []string
+
+ Sempred(RuleContext, int, int) bool
+ Precpred(RuleContext, int) bool
+
+ GetState() int
+ SetState(int)
+ Action(RuleContext, int, int)
+ AddErrorListener(ErrorListener)
+ RemoveErrorListeners()
+ GetATN() *ATN
+ GetErrorListenerDispatch() ErrorListener
+}
+
+type BaseRecognizer struct {
+ listeners []ErrorListener
+ state int
+
+ RuleNames []string
+ LiteralNames []string
+ SymbolicNames []string
+ GrammarFileName string
+}
+
+func NewBaseRecognizer() *BaseRecognizer {
+ rec := new(BaseRecognizer)
+ rec.listeners = []ErrorListener{ConsoleErrorListenerINSTANCE}
+ rec.state = -1
+ return rec
+}
+
+var tokenTypeMapCache = make(map[string]int)
+var ruleIndexMapCache = make(map[string]int)
+
+func (b *BaseRecognizer) checkVersion(toolVersion string) {
+ runtimeVersion := "4.10.1"
+ if runtimeVersion != toolVersion {
+ fmt.Println("ANTLR runtime and generated code versions disagree: " + runtimeVersion + "!=" + toolVersion)
+ }
+}
+
+func (b *BaseRecognizer) Action(context RuleContext, ruleIndex, actionIndex int) {
+ panic("action not implemented on Recognizer!")
+}
+
+func (b *BaseRecognizer) AddErrorListener(listener ErrorListener) {
+ b.listeners = append(b.listeners, listener)
+}
+
+func (b *BaseRecognizer) RemoveErrorListeners() {
+ b.listeners = make([]ErrorListener, 0)
+}
+
+func (b *BaseRecognizer) GetRuleNames() []string {
+ return b.RuleNames
+}
+
+func (b *BaseRecognizer) GetTokenNames() []string {
+ return b.LiteralNames
+}
+
+func (b *BaseRecognizer) GetSymbolicNames() []string {
+ return b.SymbolicNames
+}
+
+func (b *BaseRecognizer) GetLiteralNames() []string {
+ return b.LiteralNames
+}
+
+func (b *BaseRecognizer) GetState() int {
+ return b.state
+}
+
+func (b *BaseRecognizer) SetState(v int) {
+ b.state = v
+}
+
+//func (b *Recognizer) GetTokenTypeMap() {
+// var tokenNames = b.GetTokenNames()
+// if (tokenNames==nil) {
+// panic("The current recognizer does not provide a list of token names.")
+// }
+// var result = tokenTypeMapCache[tokenNames]
+// if(result==nil) {
+// result = tokenNames.reduce(function(o, k, i) { o[k] = i })
+// result.EOF = TokenEOF
+// tokenTypeMapCache[tokenNames] = result
+// }
+// return result
+//}
+
+// Get a map from rule names to rule indexes.
+//
+//
Used for XPath and tree pattern compilation.
+//
+func (b *BaseRecognizer) GetRuleIndexMap() map[string]int {
+
+ panic("Method not defined!")
+ // var ruleNames = b.GetRuleNames()
+ // if (ruleNames==nil) {
+ // panic("The current recognizer does not provide a list of rule names.")
+ // }
+ //
+ // var result = ruleIndexMapCache[ruleNames]
+ // if(result==nil) {
+ // result = ruleNames.reduce(function(o, k, i) { o[k] = i })
+ // ruleIndexMapCache[ruleNames] = result
+ // }
+ // return result
+}
+
+func (b *BaseRecognizer) GetTokenType(tokenName string) int {
+ panic("Method not defined!")
+ // var ttype = b.GetTokenTypeMap()[tokenName]
+ // if (ttype !=nil) {
+ // return ttype
+ // } else {
+ // return TokenInvalidType
+ // }
+}
+
+//func (b *Recognizer) GetTokenTypeMap() map[string]int {
+// Vocabulary vocabulary = getVocabulary()
+//
+// Synchronized (tokenTypeMapCache) {
+// Map result = tokenTypeMapCache.Get(vocabulary)
+// if (result == null) {
+// result = new HashMap()
+// for (int i = 0; i < GetATN().maxTokenType; i++) {
+// String literalName = vocabulary.getLiteralName(i)
+// if (literalName != null) {
+// result.put(literalName, i)
+// }
+//
+// String symbolicName = vocabulary.GetSymbolicName(i)
+// if (symbolicName != null) {
+// result.put(symbolicName, i)
+// }
+// }
+//
+// result.put("EOF", Token.EOF)
+// result = Collections.unmodifiableMap(result)
+// tokenTypeMapCache.put(vocabulary, result)
+// }
+//
+// return result
+// }
+//}
+
+// What is the error header, normally line/character position information?//
+func (b *BaseRecognizer) GetErrorHeader(e RecognitionException) string {
+ line := e.GetOffendingToken().GetLine()
+ column := e.GetOffendingToken().GetColumn()
+ return "line " + strconv.Itoa(line) + ":" + strconv.Itoa(column)
+}
+
+// How should a token be displayed in an error message? The default
+// is to display just the text, but during development you might
+// want to have a lot of information spit out. Override in that case
+// to use t.String() (which, for CommonToken, dumps everything about
+// the token). This is better than forcing you to override a method in
+// your token objects because you don't have to go modify your lexer
+// so that it creates a NewJava type.
+//
+// @deprecated This method is not called by the ANTLR 4 Runtime. Specific
+// implementations of {@link ANTLRErrorStrategy} may provide a similar
+// feature when necessary. For example, see
+// {@link DefaultErrorStrategy//GetTokenErrorDisplay}.
+//
+func (b *BaseRecognizer) GetTokenErrorDisplay(t Token) string {
+ if t == nil {
+ return ""
+ }
+ s := t.GetText()
+ if s == "" {
+ if t.GetTokenType() == TokenEOF {
+ s = ""
+ } else {
+ s = "<" + strconv.Itoa(t.GetTokenType()) + ">"
+ }
+ }
+ s = strings.Replace(s, "\t", "\\t", -1)
+ s = strings.Replace(s, "\n", "\\n", -1)
+ s = strings.Replace(s, "\r", "\\r", -1)
+
+ return "'" + s + "'"
+}
+
+func (b *BaseRecognizer) GetErrorListenerDispatch() ErrorListener {
+ return NewProxyErrorListener(b.listeners)
+}
+
+// subclass needs to override these if there are sempreds or actions
+// that the ATN interp needs to execute
+func (b *BaseRecognizer) Sempred(localctx RuleContext, ruleIndex int, actionIndex int) bool {
+ return true
+}
+
+func (b *BaseRecognizer) Precpred(localctx RuleContext, precedence int) bool {
+ return true
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/rule_context.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/rule_context.go
new file mode 100644
index 000000000..600cf8c06
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/rule_context.go
@@ -0,0 +1,114 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+// A rule context is a record of a single rule invocation. It knows
+// which context invoked it, if any. If there is no parent context, then
+// naturally the invoking state is not valid. The parent link
+// provides a chain upwards from the current rule invocation to the root
+// of the invocation tree, forming a stack. We actually carry no
+// information about the rule associated with b context (except
+// when parsing). We keep only the state number of the invoking state from
+// the ATN submachine that invoked b. Contrast b with the s
+// pointer inside ParserRuleContext that tracks the current state
+// being "executed" for the current rule.
+//
+// The parent contexts are useful for computing lookahead sets and
+// getting error information.
+//
+// These objects are used during parsing and prediction.
+// For the special case of parsers, we use the subclass
+// ParserRuleContext.
+//
+// @see ParserRuleContext
+//
+
+type RuleContext interface {
+ RuleNode
+
+ GetInvokingState() int
+ SetInvokingState(int)
+
+ GetRuleIndex() int
+ IsEmpty() bool
+
+ GetAltNumber() int
+ SetAltNumber(altNumber int)
+
+ String([]string, RuleContext) string
+}
+
+type BaseRuleContext struct {
+ parentCtx RuleContext
+ invokingState int
+ RuleIndex int
+}
+
+func NewBaseRuleContext(parent RuleContext, invokingState int) *BaseRuleContext {
+
+ rn := new(BaseRuleContext)
+
+ // What context invoked b rule?
+ rn.parentCtx = parent
+
+ // What state invoked the rule associated with b context?
+ // The "return address" is the followState of invokingState
+ // If parent is nil, b should be -1.
+ if parent == nil {
+ rn.invokingState = -1
+ } else {
+ rn.invokingState = invokingState
+ }
+
+ return rn
+}
+
+func (b *BaseRuleContext) GetBaseRuleContext() *BaseRuleContext {
+ return b
+}
+
+func (b *BaseRuleContext) SetParent(v Tree) {
+ if v == nil {
+ b.parentCtx = nil
+ } else {
+ b.parentCtx = v.(RuleContext)
+ }
+}
+
+func (b *BaseRuleContext) GetInvokingState() int {
+ return b.invokingState
+}
+
+func (b *BaseRuleContext) SetInvokingState(t int) {
+ b.invokingState = t
+}
+
+func (b *BaseRuleContext) GetRuleIndex() int {
+ return b.RuleIndex
+}
+
+func (b *BaseRuleContext) GetAltNumber() int {
+ return ATNInvalidAltNumber
+}
+
+func (b *BaseRuleContext) SetAltNumber(altNumber int) {}
+
+// A context is empty if there is no invoking state meaning nobody call
+// current context.
+func (b *BaseRuleContext) IsEmpty() bool {
+ return b.invokingState == -1
+}
+
+// Return the combined text of all child nodes. This method only considers
+// tokens which have been added to the parse tree.
+//
+// Since tokens on hidden channels (e.g. whitespace or comments) are not
+// added to the parse trees, they will not appear in the output of b
+// method.
+//
+
+func (b *BaseRuleContext) GetParent() Tree {
+ return b.parentCtx
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/semantic_context.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/semantic_context.go
new file mode 100644
index 000000000..9ada43077
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/semantic_context.go
@@ -0,0 +1,466 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "fmt"
+ "strconv"
+)
+
+// A tree structure used to record the semantic context in which
+// an ATN configuration is valid. It's either a single predicate,
+// a conjunction {@code p1&&p2}, or a sum of products {@code p1||p2}.
+//
+//
I have scoped the {@link AND}, {@link OR}, and {@link Predicate} subclasses of
+// {@link SemanticContext} within the scope of this outer class.
+//
+
+type SemanticContext interface {
+ comparable
+
+ evaluate(parser Recognizer, outerContext RuleContext) bool
+ evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext
+
+ hash() int
+ String() string
+}
+
+func SemanticContextandContext(a, b SemanticContext) SemanticContext {
+ if a == nil || a == SemanticContextNone {
+ return b
+ }
+ if b == nil || b == SemanticContextNone {
+ return a
+ }
+ result := NewAND(a, b)
+ if len(result.opnds) == 1 {
+ return result.opnds[0]
+ }
+
+ return result
+}
+
+func SemanticContextorContext(a, b SemanticContext) SemanticContext {
+ if a == nil {
+ return b
+ }
+ if b == nil {
+ return a
+ }
+ if a == SemanticContextNone || b == SemanticContextNone {
+ return SemanticContextNone
+ }
+ result := NewOR(a, b)
+ if len(result.opnds) == 1 {
+ return result.opnds[0]
+ }
+
+ return result
+}
+
+type Predicate struct {
+ ruleIndex int
+ predIndex int
+ isCtxDependent bool
+}
+
+func NewPredicate(ruleIndex, predIndex int, isCtxDependent bool) *Predicate {
+ p := new(Predicate)
+
+ p.ruleIndex = ruleIndex
+ p.predIndex = predIndex
+ p.isCtxDependent = isCtxDependent // e.g., $i ref in pred
+ return p
+}
+
+//The default {@link SemanticContext}, which is semantically equivalent to
+//a predicate of the form {@code {true}?}.
+
+var SemanticContextNone SemanticContext = NewPredicate(-1, -1, false)
+
+func (p *Predicate) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext {
+ return p
+}
+
+func (p *Predicate) evaluate(parser Recognizer, outerContext RuleContext) bool {
+
+ var localctx RuleContext
+
+ if p.isCtxDependent {
+ localctx = outerContext
+ }
+
+ return parser.Sempred(localctx, p.ruleIndex, p.predIndex)
+}
+
+func (p *Predicate) equals(other interface{}) bool {
+ if p == other {
+ return true
+ } else if _, ok := other.(*Predicate); !ok {
+ return false
+ } else {
+ return p.ruleIndex == other.(*Predicate).ruleIndex &&
+ p.predIndex == other.(*Predicate).predIndex &&
+ p.isCtxDependent == other.(*Predicate).isCtxDependent
+ }
+}
+
+func (p *Predicate) hash() int {
+ h := murmurInit(0)
+ h = murmurUpdate(h, p.ruleIndex)
+ h = murmurUpdate(h, p.predIndex)
+ if p.isCtxDependent {
+ h = murmurUpdate(h, 1)
+ } else {
+ h = murmurUpdate(h, 0)
+ }
+ return murmurFinish(h, 3)
+}
+
+func (p *Predicate) String() string {
+ return "{" + strconv.Itoa(p.ruleIndex) + ":" + strconv.Itoa(p.predIndex) + "}?"
+}
+
+type PrecedencePredicate struct {
+ precedence int
+}
+
+func NewPrecedencePredicate(precedence int) *PrecedencePredicate {
+
+ p := new(PrecedencePredicate)
+ p.precedence = precedence
+
+ return p
+}
+
+func (p *PrecedencePredicate) evaluate(parser Recognizer, outerContext RuleContext) bool {
+ return parser.Precpred(outerContext, p.precedence)
+}
+
+func (p *PrecedencePredicate) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext {
+ if parser.Precpred(outerContext, p.precedence) {
+ return SemanticContextNone
+ }
+
+ return nil
+}
+
+func (p *PrecedencePredicate) compareTo(other *PrecedencePredicate) int {
+ return p.precedence - other.precedence
+}
+
+func (p *PrecedencePredicate) equals(other interface{}) bool {
+ if p == other {
+ return true
+ } else if _, ok := other.(*PrecedencePredicate); !ok {
+ return false
+ } else {
+ return p.precedence == other.(*PrecedencePredicate).precedence
+ }
+}
+
+func (p *PrecedencePredicate) hash() int {
+ h := uint32(1)
+ h = 31*h + uint32(p.precedence)
+ return int(h)
+}
+
+func (p *PrecedencePredicate) String() string {
+ return "{" + strconv.Itoa(p.precedence) + ">=prec}?"
+}
+
+func PrecedencePredicatefilterPrecedencePredicates(set Set) []*PrecedencePredicate {
+ result := make([]*PrecedencePredicate, 0)
+
+ set.Each(func(v interface{}) bool {
+ if c2, ok := v.(*PrecedencePredicate); ok {
+ result = append(result, c2)
+ }
+ return true
+ })
+
+ return result
+}
+
+// A semantic context which is true whenever none of the contained contexts
+// is false.`
+
+type AND struct {
+ opnds []SemanticContext
+}
+
+func NewAND(a, b SemanticContext) *AND {
+
+ operands := newArray2DHashSet(nil, nil)
+ if aa, ok := a.(*AND); ok {
+ for _, o := range aa.opnds {
+ operands.Add(o)
+ }
+ } else {
+ operands.Add(a)
+ }
+
+ if ba, ok := b.(*AND); ok {
+ for _, o := range ba.opnds {
+ operands.Add(o)
+ }
+ } else {
+ operands.Add(b)
+ }
+ precedencePredicates := PrecedencePredicatefilterPrecedencePredicates(operands)
+ if len(precedencePredicates) > 0 {
+ // interested in the transition with the lowest precedence
+ var reduced *PrecedencePredicate
+
+ for _, p := range precedencePredicates {
+ if reduced == nil || p.precedence < reduced.precedence {
+ reduced = p
+ }
+ }
+
+ operands.Add(reduced)
+ }
+
+ vs := operands.Values()
+ opnds := make([]SemanticContext, len(vs))
+ for i, v := range vs {
+ opnds[i] = v.(SemanticContext)
+ }
+
+ and := new(AND)
+ and.opnds = opnds
+
+ return and
+}
+
+func (a *AND) equals(other interface{}) bool {
+ if a == other {
+ return true
+ } else if _, ok := other.(*AND); !ok {
+ return false
+ } else {
+ for i, v := range other.(*AND).opnds {
+ if !a.opnds[i].equals(v) {
+ return false
+ }
+ }
+ return true
+ }
+}
+
+//
+// {@inheritDoc}
+//
+//
+// The evaluation of predicates by a context is short-circuiting, but
+// unordered.
+//
+func (a *AND) evaluate(parser Recognizer, outerContext RuleContext) bool {
+ for i := 0; i < len(a.opnds); i++ {
+ if !a.opnds[i].evaluate(parser, outerContext) {
+ return false
+ }
+ }
+ return true
+}
+
+func (a *AND) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext {
+ differs := false
+ operands := make([]SemanticContext, 0)
+
+ for i := 0; i < len(a.opnds); i++ {
+ context := a.opnds[i]
+ evaluated := context.evalPrecedence(parser, outerContext)
+ differs = differs || (evaluated != context)
+ if evaluated == nil {
+ // The AND context is false if any element is false
+ return nil
+ } else if evaluated != SemanticContextNone {
+ // Reduce the result by Skipping true elements
+ operands = append(operands, evaluated)
+ }
+ }
+ if !differs {
+ return a
+ }
+
+ if len(operands) == 0 {
+ // all elements were true, so the AND context is true
+ return SemanticContextNone
+ }
+
+ var result SemanticContext
+
+ for _, o := range operands {
+ if result == nil {
+ result = o
+ } else {
+ result = SemanticContextandContext(result, o)
+ }
+ }
+
+ return result
+}
+
+func (a *AND) hash() int {
+ h := murmurInit(37) // Init with a value different from OR
+ for _, op := range a.opnds {
+ h = murmurUpdate(h, op.hash())
+ }
+ return murmurFinish(h, len(a.opnds))
+}
+
+func (a *OR) hash() int {
+ h := murmurInit(41) // Init with a value different from AND
+ for _, op := range a.opnds {
+ h = murmurUpdate(h, op.hash())
+ }
+ return murmurFinish(h, len(a.opnds))
+}
+
+func (a *AND) String() string {
+ s := ""
+
+ for _, o := range a.opnds {
+ s += "&& " + fmt.Sprint(o)
+ }
+
+ if len(s) > 3 {
+ return s[0:3]
+ }
+
+ return s
+}
+
+//
+// A semantic context which is true whenever at least one of the contained
+// contexts is true.
+//
+
+type OR struct {
+ opnds []SemanticContext
+}
+
+func NewOR(a, b SemanticContext) *OR {
+
+ operands := newArray2DHashSet(nil, nil)
+ if aa, ok := a.(*OR); ok {
+ for _, o := range aa.opnds {
+ operands.Add(o)
+ }
+ } else {
+ operands.Add(a)
+ }
+
+ if ba, ok := b.(*OR); ok {
+ for _, o := range ba.opnds {
+ operands.Add(o)
+ }
+ } else {
+ operands.Add(b)
+ }
+ precedencePredicates := PrecedencePredicatefilterPrecedencePredicates(operands)
+ if len(precedencePredicates) > 0 {
+ // interested in the transition with the lowest precedence
+ var reduced *PrecedencePredicate
+
+ for _, p := range precedencePredicates {
+ if reduced == nil || p.precedence > reduced.precedence {
+ reduced = p
+ }
+ }
+
+ operands.Add(reduced)
+ }
+
+ vs := operands.Values()
+
+ opnds := make([]SemanticContext, len(vs))
+ for i, v := range vs {
+ opnds[i] = v.(SemanticContext)
+ }
+
+ o := new(OR)
+ o.opnds = opnds
+
+ return o
+}
+
+func (o *OR) equals(other interface{}) bool {
+ if o == other {
+ return true
+ } else if _, ok := other.(*OR); !ok {
+ return false
+ } else {
+ for i, v := range other.(*OR).opnds {
+ if !o.opnds[i].equals(v) {
+ return false
+ }
+ }
+ return true
+ }
+}
+
+//
+// The evaluation of predicates by o context is short-circuiting, but
+// unordered.
+//
+func (o *OR) evaluate(parser Recognizer, outerContext RuleContext) bool {
+ for i := 0; i < len(o.opnds); i++ {
+ if o.opnds[i].evaluate(parser, outerContext) {
+ return true
+ }
+ }
+ return false
+}
+
+func (o *OR) evalPrecedence(parser Recognizer, outerContext RuleContext) SemanticContext {
+ differs := false
+ operands := make([]SemanticContext, 0)
+ for i := 0; i < len(o.opnds); i++ {
+ context := o.opnds[i]
+ evaluated := context.evalPrecedence(parser, outerContext)
+ differs = differs || (evaluated != context)
+ if evaluated == SemanticContextNone {
+ // The OR context is true if any element is true
+ return SemanticContextNone
+ } else if evaluated != nil {
+ // Reduce the result by Skipping false elements
+ operands = append(operands, evaluated)
+ }
+ }
+ if !differs {
+ return o
+ }
+ if len(operands) == 0 {
+ // all elements were false, so the OR context is false
+ return nil
+ }
+ var result SemanticContext
+
+ for _, o := range operands {
+ if result == nil {
+ result = o
+ } else {
+ result = SemanticContextorContext(result, o)
+ }
+ }
+
+ return result
+}
+
+func (o *OR) String() string {
+ s := ""
+
+ for _, o := range o.opnds {
+ s += "|| " + fmt.Sprint(o)
+ }
+
+ if len(s) > 3 {
+ return s[0:3]
+ }
+
+ return s
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/token.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/token.go
new file mode 100644
index 000000000..2d8e99095
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/token.go
@@ -0,0 +1,210 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+import (
+ "strconv"
+ "strings"
+)
+
+type TokenSourceCharStreamPair struct {
+ tokenSource TokenSource
+ charStream CharStream
+}
+
+// A token has properties: text, type, line, character position in the line
+// (so we can ignore tabs), token channel, index, and source from which
+// we obtained this token.
+
+type Token interface {
+ GetSource() *TokenSourceCharStreamPair
+ GetTokenType() int
+ GetChannel() int
+ GetStart() int
+ GetStop() int
+ GetLine() int
+ GetColumn() int
+
+ GetText() string
+ SetText(s string)
+
+ GetTokenIndex() int
+ SetTokenIndex(v int)
+
+ GetTokenSource() TokenSource
+ GetInputStream() CharStream
+}
+
+type BaseToken struct {
+ source *TokenSourceCharStreamPair
+ tokenType int // token type of the token
+ channel int // The parser ignores everything not on DEFAULT_CHANNEL
+ start int // optional return -1 if not implemented.
+ stop int // optional return -1 if not implemented.
+ tokenIndex int // from 0..n-1 of the token object in the input stream
+ line int // line=1..n of the 1st character
+ column int // beginning of the line at which it occurs, 0..n-1
+ text string // text of the token.
+ readOnly bool
+}
+
+const (
+ TokenInvalidType = 0
+
+ // During lookahead operations, this "token" signifies we hit rule end ATN state
+ // and did not follow it despite needing to.
+ TokenEpsilon = -2
+
+ TokenMinUserTokenType = 1
+
+ TokenEOF = -1
+
+ // All tokens go to the parser (unless Skip() is called in that rule)
+ // on a particular "channel". The parser tunes to a particular channel
+ // so that whitespace etc... can go to the parser on a "hidden" channel.
+
+ TokenDefaultChannel = 0
+
+ // Anything on different channel than DEFAULT_CHANNEL is not parsed
+ // by parser.
+
+ TokenHiddenChannel = 1
+)
+
+func (b *BaseToken) GetChannel() int {
+ return b.channel
+}
+
+func (b *BaseToken) GetStart() int {
+ return b.start
+}
+
+func (b *BaseToken) GetStop() int {
+ return b.stop
+}
+
+func (b *BaseToken) GetLine() int {
+ return b.line
+}
+
+func (b *BaseToken) GetColumn() int {
+ return b.column
+}
+
+func (b *BaseToken) GetTokenType() int {
+ return b.tokenType
+}
+
+func (b *BaseToken) GetSource() *TokenSourceCharStreamPair {
+ return b.source
+}
+
+func (b *BaseToken) GetTokenIndex() int {
+ return b.tokenIndex
+}
+
+func (b *BaseToken) SetTokenIndex(v int) {
+ b.tokenIndex = v
+}
+
+func (b *BaseToken) GetTokenSource() TokenSource {
+ return b.source.tokenSource
+}
+
+func (b *BaseToken) GetInputStream() CharStream {
+ return b.source.charStream
+}
+
+type CommonToken struct {
+ *BaseToken
+}
+
+func NewCommonToken(source *TokenSourceCharStreamPair, tokenType, channel, start, stop int) *CommonToken {
+
+ t := new(CommonToken)
+
+ t.BaseToken = new(BaseToken)
+
+ t.source = source
+ t.tokenType = tokenType
+ t.channel = channel
+ t.start = start
+ t.stop = stop
+ t.tokenIndex = -1
+ if t.source.tokenSource != nil {
+ t.line = source.tokenSource.GetLine()
+ t.column = source.tokenSource.GetCharPositionInLine()
+ } else {
+ t.column = -1
+ }
+ return t
+}
+
+// An empty {@link Pair} which is used as the default value of
+// {@link //source} for tokens that do not have a source.
+
+//CommonToken.EMPTY_SOURCE = [ nil, nil ]
+
+// Constructs a New{@link CommonToken} as a copy of another {@link Token}.
+//
+//
+// If {@code oldToken} is also a {@link CommonToken} instance, the newly
+// constructed token will share a reference to the {@link //text} field and
+// the {@link Pair} stored in {@link //source}. Otherwise, {@link //text} will
+// be assigned the result of calling {@link //GetText}, and {@link //source}
+// will be constructed from the result of {@link Token//GetTokenSource} and
+// {@link Token//GetInputStream}.
+//
+// @param oldToken The token to copy.
+//
+func (c *CommonToken) clone() *CommonToken {
+ t := NewCommonToken(c.source, c.tokenType, c.channel, c.start, c.stop)
+ t.tokenIndex = c.GetTokenIndex()
+ t.line = c.GetLine()
+ t.column = c.GetColumn()
+ t.text = c.GetText()
+ return t
+}
+
+func (c *CommonToken) GetText() string {
+ if c.text != "" {
+ return c.text
+ }
+ input := c.GetInputStream()
+ if input == nil {
+ return ""
+ }
+ n := input.Size()
+ if c.start < n && c.stop < n {
+ return input.GetTextFromInterval(NewInterval(c.start, c.stop))
+ }
+ return ""
+}
+
+func (c *CommonToken) SetText(text string) {
+ c.text = text
+}
+
+func (c *CommonToken) String() string {
+ txt := c.GetText()
+ if txt != "" {
+ txt = strings.Replace(txt, "\n", "\\n", -1)
+ txt = strings.Replace(txt, "\r", "\\r", -1)
+ txt = strings.Replace(txt, "\t", "\\t", -1)
+ } else {
+ txt = ""
+ }
+
+ var ch string
+ if c.channel > 0 {
+ ch = ",channel=" + strconv.Itoa(c.channel)
+ } else {
+ ch = ""
+ }
+
+ return "[@" + strconv.Itoa(c.tokenIndex) + "," + strconv.Itoa(c.start) + ":" + strconv.Itoa(c.stop) + "='" +
+ txt + "',<" + strconv.Itoa(c.tokenType) + ">" +
+ ch + "," + strconv.Itoa(c.line) + ":" + strconv.Itoa(c.column) + "]"
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/token_source.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/token_source.go
new file mode 100644
index 000000000..e023978fe
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/token_source.go
@@ -0,0 +1,17 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+type TokenSource interface {
+ NextToken() Token
+ Skip()
+ More()
+ GetLine() int
+ GetCharPositionInLine() int
+ GetInputStream() CharStream
+ GetSourceName() string
+ setTokenFactory(factory TokenFactory)
+ GetTokenFactory() TokenFactory
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/token_stream.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/token_stream.go
new file mode 100644
index 000000000..df92c8147
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/token_stream.go
@@ -0,0 +1,20 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+
+package antlr
+
+type TokenStream interface {
+ IntStream
+
+ LT(k int) Token
+
+ Get(index int) Token
+ GetTokenSource() TokenSource
+ SetTokenSource(TokenSource)
+
+ GetAllText() string
+ GetTextFromInterval(*Interval) string
+ GetTextFromRuleContext(RuleContext) string
+ GetTextFromTokens(Token, Token) string
+}
diff --git a/vendor/github.com/antlr/antlr4/runtime/Go/antlr/tokenstream_rewriter.go b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/tokenstream_rewriter.go
new file mode 100644
index 000000000..96a03f02a
--- /dev/null
+++ b/vendor/github.com/antlr/antlr4/runtime/Go/antlr/tokenstream_rewriter.go
@@ -0,0 +1,649 @@
+// Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
+// Use of this file is governed by the BSD 3-clause license that
+// can be found in the LICENSE.txt file in the project root.
+package antlr
+
+import (
+"bytes"
+"fmt"
+)
+
+
+//
+// Useful for rewriting out a buffered input token stream after doing some
+// augmentation or other manipulations on it.
+
+//
+// You can insert stuff, replace, and delete chunks. Note that the operations
+// are done lazily--only if you convert the buffer to a {@link String} with
+// {@link TokenStream#getText()}. This is very efficient because you are not
+// moving data around all the time. As the buffer of tokens is converted to
+// strings, the {@link #getText()} method(s) scan the input token stream and
+// check to see if there is an operation at the current index. If so, the
+// operation is done and then normal {@link String} rendering continues on the
+// buffer. This is like having multiple Turing machine instruction streams
+// (programs) operating on a single input tape. :)
+//
+
+// This rewriter makes no modifications to the token stream. It does not ask the
+// stream to fill itself up nor does it advance the input cursor. The token
+// stream {@link TokenStream#index()} will return the same value before and
+// after any {@link #getText()} call.
+
+//
+// The rewriter only works on tokens that you have in the buffer and ignores the
+// current input cursor. If you are buffering tokens on-demand, calling
+// {@link #getText()} halfway through the input will only do rewrites for those
+// tokens in the first half of the file.
+
+//
+// Since the operations are done lazily at {@link #getText}-time, operations do
+// not screw up the token index values. That is, an insert operation at token
+// index {@code i} does not change the index values for tokens
+// {@code i}+1..n-1.
+
+//
+// Because operations never actually alter the buffer, you may always get the
+// original token stream back without undoing anything. Since the instructions
+// are queued up, you can easily simulate transactions and roll back any changes
+// if there is an error just by removing instructions. For example,
+
+//
+// CharStream input = new ANTLRFileStream("input");
+// TLexer lex = new TLexer(input);
+// CommonTokenStream tokens = new CommonTokenStream(lex);
+// T parser = new T(tokens);
+// TokenStreamRewriter rewriter = new TokenStreamRewriter(tokens);
+// parser.startRule();
+//
+
+//
+// Then in the rules, you can execute (assuming rewriter is visible):
+
+//
+// Token t,u;
+// ...
+// rewriter.insertAfter(t, "text to put after t");}
+// rewriter.insertAfter(u, "text after u");}
+// System.out.println(rewriter.getText());
+//
+
+//
+// You can also have multiple "instruction streams" and get multiple rewrites
+// from a single pass over the input. Just name the instruction streams and use
+// that name again when printing the buffer. This could be useful for generating
+// a C file and also its header file--all from the same buffer:
+
+//
+// rewriter.insertAfter("pass1", t, "text to put after t");}
+// rewriter.insertAfter("pass2", u, "text after u");}
+// System.out.println(rewriter.getText("pass1"));
+// System.out.println(rewriter.getText("pass2"));
+//
+
+//
+// If you don't use named rewrite streams, a "default" stream is used as the
+// first example shows.
+
+
+
+const(
+ Default_Program_Name = "default"
+ Program_Init_Size = 100
+ Min_Token_Index = 0
+)
+
+// Define the rewrite operation hierarchy
+
+type RewriteOperation interface {
+ // Execute the rewrite operation by possibly adding to the buffer.
+ // Return the index of the next token to operate on.
+ Execute(buffer *bytes.Buffer) int
+ String() string
+ GetInstructionIndex() int
+ GetIndex() int
+ GetText() string
+ GetOpName() string
+ GetTokens() TokenStream
+ SetInstructionIndex(val int)
+ SetIndex(int)
+ SetText(string)
+ SetOpName(string)
+ SetTokens(TokenStream)
+}
+
+type BaseRewriteOperation struct {
+ //Current index of rewrites list
+ instruction_index int
+ //Token buffer index
+ index int
+ //Substitution text
+ text string
+ //Actual operation name
+ op_name string
+ //Pointer to token steam
+ tokens TokenStream
+}
+
+func (op *BaseRewriteOperation)GetInstructionIndex() int{
+ return op.instruction_index
+}
+
+func (op *BaseRewriteOperation)GetIndex() int{
+ return op.index
+}
+
+func (op *BaseRewriteOperation)GetText() string{
+ return op.text
+}
+
+func (op *BaseRewriteOperation)GetOpName() string{
+ return op.op_name
+}
+
+func (op *BaseRewriteOperation)GetTokens() TokenStream{
+ return op.tokens
+}
+
+func (op *BaseRewriteOperation)SetInstructionIndex(val int){
+ op.instruction_index = val
+}
+
+func (op *BaseRewriteOperation)SetIndex(val int) {
+ op.index = val
+}
+
+func (op *BaseRewriteOperation)SetText(val string){
+ op.text = val
+}
+
+func (op *BaseRewriteOperation)SetOpName(val string){
+ op.op_name = val
+}
+
+func (op *BaseRewriteOperation)SetTokens(val TokenStream) {
+ op.tokens = val
+}
+
+
+func (op *BaseRewriteOperation) Execute(buffer *bytes.Buffer) int{
+ return op.index
+}
+
+func (op *BaseRewriteOperation) String() string {
+ return fmt.Sprintf("<%s@%d:\"%s\">",
+ op.op_name,
+ op.tokens.Get(op.GetIndex()),
+ op.text,
+ )
+
+}
+
+
+type InsertBeforeOp struct {
+ BaseRewriteOperation
+}
+
+func NewInsertBeforeOp(index int, text string, stream TokenStream) *InsertBeforeOp{
+ return &InsertBeforeOp{BaseRewriteOperation:BaseRewriteOperation{
+ index:index,
+ text:text,
+ op_name:"InsertBeforeOp",
+ tokens:stream,
+ }}
+}
+
+func (op *InsertBeforeOp) Execute(buffer *bytes.Buffer) int{
+ buffer.WriteString(op.text)
+ if op.tokens.Get(op.index).GetTokenType() != TokenEOF{
+ buffer.WriteString(op.tokens.Get(op.index).GetText())
+ }
+ return op.index+1
+}
+
+func (op *InsertBeforeOp) String() string {
+ return op.BaseRewriteOperation.String()
+}
+
+// Distinguish between insert after/before to do the "insert afters"
+// first and then the "insert befores" at same index. Implementation
+// of "insert after" is "insert before index+1".
+
+type InsertAfterOp struct {
+ BaseRewriteOperation
+}
+
+func NewInsertAfterOp(index int, text string, stream TokenStream) *InsertAfterOp{
+ return &InsertAfterOp{BaseRewriteOperation:BaseRewriteOperation{
+ index:index+1,
+ text:text,
+ tokens:stream,
+ }}
+}
+
+func (op *InsertAfterOp) Execute(buffer *bytes.Buffer) int {
+ buffer.WriteString(op.text)
+ if op.tokens.Get(op.index).GetTokenType() != TokenEOF{
+ buffer.WriteString(op.tokens.Get(op.index).GetText())
+ }
+ return op.index+1
+}
+
+func (op *InsertAfterOp) String() string {
+ return op.BaseRewriteOperation.String()
+}
+
+// I'm going to try replacing range from x..y with (y-x)+1 ReplaceOp
+// instructions.
+type ReplaceOp struct{
+ BaseRewriteOperation
+ LastIndex int
+}
+
+func NewReplaceOp(from, to int, text string, stream TokenStream)*ReplaceOp {
+ return &ReplaceOp{
+ BaseRewriteOperation:BaseRewriteOperation{
+ index:from,
+ text:text,
+ op_name:"ReplaceOp",
+ tokens:stream,
+ },
+ LastIndex:to,
+ }
+}
+
+func (op *ReplaceOp)Execute(buffer *bytes.Buffer) int{
+ if op.text != ""{
+ buffer.WriteString(op.text)
+ }
+ return op.LastIndex +1
+}
+
+func (op *ReplaceOp) String() string {
+ if op.text == "" {
+ return fmt.Sprintf("",
+ op.tokens.Get(op.index), op.tokens.Get(op.LastIndex))
+ }
+ return fmt.Sprintf("",
+ op.tokens.Get(op.index), op.tokens.Get(op.LastIndex), op.text)
+}
+
+
+type TokenStreamRewriter struct {
+ //Our source stream
+ tokens TokenStream
+ // You may have multiple, named streams of rewrite operations.
+ // I'm calling these things "programs."
+ // Maps String (name) → rewrite (List)
+ programs map[string][]RewriteOperation
+ last_rewrite_token_indexes map[string]int
+}
+
+func NewTokenStreamRewriter(tokens TokenStream) *TokenStreamRewriter{
+ return &TokenStreamRewriter{
+ tokens: tokens,
+ programs: map[string][]RewriteOperation{
+ Default_Program_Name:make([]RewriteOperation,0, Program_Init_Size),
+ },
+ last_rewrite_token_indexes: map[string]int{},
+ }
+}
+
+func (tsr *TokenStreamRewriter) GetTokenStream() TokenStream{
+ return tsr.tokens
+}
+
+// Rollback the instruction stream for a program so that
+// the indicated instruction (via instructionIndex) is no
+// longer in the stream. UNTESTED!
+func (tsr *TokenStreamRewriter) Rollback(program_name string, instruction_index int){
+ is, ok := tsr.programs[program_name]
+ if ok{
+ tsr.programs[program_name] = is[Min_Token_Index:instruction_index]
+ }
+}
+
+func (tsr *TokenStreamRewriter) RollbackDefault(instruction_index int){
+ tsr.Rollback(Default_Program_Name, instruction_index)
+}
+//Reset the program so that no instructions exist
+func (tsr *TokenStreamRewriter) DeleteProgram(program_name string){
+ tsr.Rollback(program_name, Min_Token_Index) //TODO: double test on that cause lower bound is not included
+}
+
+func (tsr *TokenStreamRewriter) DeleteProgramDefault(){
+ tsr.DeleteProgram(Default_Program_Name)
+}
+
+func (tsr *TokenStreamRewriter) InsertAfter(program_name string, index int, text string){
+ // to insert after, just insert before next index (even if past end)
+ var op RewriteOperation = NewInsertAfterOp(index, text, tsr.tokens)
+ rewrites := tsr.GetProgram(program_name)
+ op.SetInstructionIndex(len(rewrites))
+ tsr.AddToProgram(program_name, op)
+}
+
+func (tsr *TokenStreamRewriter) InsertAfterDefault(index int, text string){
+ tsr.InsertAfter(Default_Program_Name, index, text)
+}
+
+func (tsr *TokenStreamRewriter) InsertAfterToken(program_name string, token Token, text string){
+ tsr.InsertAfter(program_name, token.GetTokenIndex(), text)
+}
+
+func (tsr* TokenStreamRewriter) InsertBefore(program_name string, index int, text string){
+ var op RewriteOperation = NewInsertBeforeOp(index, text, tsr.tokens)
+ rewrites := tsr.GetProgram(program_name)
+ op.SetInstructionIndex(len(rewrites))
+ tsr.AddToProgram(program_name, op)
+}
+
+func (tsr *TokenStreamRewriter) InsertBeforeDefault(index int, text string){
+ tsr.InsertBefore(Default_Program_Name, index, text)
+}
+
+func (tsr *TokenStreamRewriter) InsertBeforeToken(program_name string,token Token, text string){
+ tsr.InsertBefore(program_name, token.GetTokenIndex(), text)
+}
+
+func (tsr *TokenStreamRewriter) Replace(program_name string, from, to int, text string){
+ if from > to || from < 0 || to < 0 || to >= tsr.tokens.Size(){
+ panic(fmt.Sprintf("replace: range invalid: %d..%d(size=%d)",
+ from, to, tsr.tokens.Size()))
+ }
+ var op RewriteOperation = NewReplaceOp(from, to, text, tsr.tokens)
+ rewrites := tsr.GetProgram(program_name)
+ op.SetInstructionIndex(len(rewrites))
+ tsr.AddToProgram(program_name, op)
+}
+
+func (tsr *TokenStreamRewriter)ReplaceDefault(from, to int, text string) {
+ tsr.Replace(Default_Program_Name, from, to, text)
+}
+
+func (tsr *TokenStreamRewriter)ReplaceDefaultPos(index int, text string){
+ tsr.ReplaceDefault(index, index, text)
+}
+
+func (tsr *TokenStreamRewriter)ReplaceToken(program_name string, from, to Token, text string){
+ tsr.Replace(program_name, from.GetTokenIndex(), to.GetTokenIndex(), text)
+}
+
+func (tsr *TokenStreamRewriter)ReplaceTokenDefault(from, to Token, text string){
+ tsr.ReplaceToken(Default_Program_Name, from, to, text)
+}
+
+func (tsr *TokenStreamRewriter)ReplaceTokenDefaultPos(index Token, text string){
+ tsr.ReplaceTokenDefault(index, index, text)
+}
+
+func (tsr *TokenStreamRewriter)Delete(program_name string, from, to int){
+ tsr.Replace(program_name, from, to, "" )
+}
+
+func (tsr *TokenStreamRewriter)DeleteDefault(from, to int){
+ tsr.Delete(Default_Program_Name, from, to)
+}
+
+func (tsr *TokenStreamRewriter)DeleteDefaultPos(index int){
+ tsr.DeleteDefault(index,index)
+}
+
+func (tsr *TokenStreamRewriter)DeleteToken(program_name string, from, to Token) {
+ tsr.ReplaceToken(program_name, from, to, "")
+}
+
+func (tsr *TokenStreamRewriter)DeleteTokenDefault(from,to Token){
+ tsr.DeleteToken(Default_Program_Name, from, to)
+}
+
+func (tsr *TokenStreamRewriter)GetLastRewriteTokenIndex(program_name string)int {
+ i, ok := tsr.last_rewrite_token_indexes[program_name]
+ if !ok{
+ return -1
+ }
+ return i
+}
+
+func (tsr *TokenStreamRewriter)GetLastRewriteTokenIndexDefault()int{
+ return tsr.GetLastRewriteTokenIndex(Default_Program_Name)
+}
+
+func (tsr *TokenStreamRewriter)SetLastRewriteTokenIndex(program_name string, i int){
+ tsr.last_rewrite_token_indexes[program_name] = i
+}
+
+func (tsr *TokenStreamRewriter)InitializeProgram(name string)[]RewriteOperation{
+ is := make([]RewriteOperation, 0, Program_Init_Size)
+ tsr.programs[name] = is
+ return is
+}
+
+func (tsr *TokenStreamRewriter)AddToProgram(name string, op RewriteOperation){
+ is := tsr.GetProgram(name)
+ is = append(is, op)
+ tsr.programs[name] = is
+}
+
+func (tsr *TokenStreamRewriter)GetProgram(name string) []RewriteOperation {
+ is, ok := tsr.programs[name]
+ if !ok{
+ is = tsr.InitializeProgram(name)
+ }
+ return is
+}
+// Return the text from the original tokens altered per the
+// instructions given to this rewriter.
+func (tsr *TokenStreamRewriter)GetTextDefault() string{
+ return tsr.GetText(
+ Default_Program_Name,
+ NewInterval(0, tsr.tokens.Size()-1))
+}
+// Return the text from the original tokens altered per the
+// instructions given to this rewriter.
+func (tsr *TokenStreamRewriter)GetText(program_name string, interval *Interval) string {
+ rewrites := tsr.programs[program_name]
+ start := interval.Start
+ stop := interval.Stop
+ // ensure start/end are in range
+ stop = min(stop, tsr.tokens.Size()-1)
+ start = max(start,0)
+ if rewrites == nil || len(rewrites) == 0{
+ return tsr.tokens.GetTextFromInterval(interval) // no instructions to execute
+ }
+ buf := bytes.Buffer{}
+ // First, optimize instruction stream
+ indexToOp := reduceToSingleOperationPerIndex(rewrites)
+ // Walk buffer, executing instructions and emitting tokens
+ for i:=start; i<=stop && i= tsr.tokens.Size()-1 {buf.WriteString(op.GetText())}
+ }
+ }
+ return buf.String()
+}
+
+// We need to combine operations and report invalid operations (like
+// overlapping replaces that are not completed nested). Inserts to
+// same index need to be combined etc... Here are the cases:
+//
+// I.i.u I.j.v leave alone, nonoverlapping
+// I.i.u I.i.v combine: Iivu
+//
+// R.i-j.u R.x-y.v | i-j in x-y delete first R
+// R.i-j.u R.i-j.v delete first R
+// R.i-j.u R.x-y.v | x-y in i-j ERROR
+// R.i-j.u R.x-y.v | boundaries overlap ERROR
+//
+// Delete special case of replace (text==null):
+// D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right)
+//
+// I.i.u R.x-y.v | i in (x+1)-y delete I (since insert before
+// we're not deleting i)
+// I.i.u R.x-y.v | i not in (x+1)-y leave alone, nonoverlapping
+// R.x-y.v I.i.u | i in x-y ERROR
+// R.x-y.v I.x.u R.x-y.uv (combine, delete I)
+// R.x-y.v I.i.u | i not in x-y leave alone, nonoverlapping
+//
+// I.i.u = insert u before op @ index i
+// R.x-y.u = replace x-y indexed tokens with u
+//
+// First we need to examine replaces. For any replace op:
+//
+// 1. wipe out any insertions before op within that range.
+// 2. Drop any replace op before that is contained completely within
+// that range.
+// 3. Throw exception upon boundary overlap with any previous replace.
+//
+// Then we can deal with inserts:
+//
+// 1. for any inserts to same index, combine even if not adjacent.
+// 2. for any prior replace with same left boundary, combine this
+// insert with replace and delete this replace.
+// 3. throw exception if index in same range as previous replace
+//
+// Don't actually delete; make op null in list. Easier to walk list.
+// Later we can throw as we add to index → op map.
+//
+// Note that I.2 R.2-2 will wipe out I.2 even though, technically, the
+// inserted stuff would be before the replace range. But, if you
+// add tokens in front of a method body '{' and then delete the method
+// body, I think the stuff before the '{' you added should disappear too.
+//
+// Return a map from token index to operation.
+//
+func reduceToSingleOperationPerIndex(rewrites []RewriteOperation) map[int]RewriteOperation{
+ // WALK REPLACES
+ for i:=0; i < len(rewrites); i++{
+ op := rewrites[i]
+ if op == nil{continue}
+ rop, ok := op.(*ReplaceOp)
+ if !ok{continue}
+ // Wipe prior inserts within range
+ for j:=0; j rop.index && iop.index <=rop.LastIndex{
+ // delete insert as it's a no-op.
+ rewrites[iop.instruction_index] = nil
+ }
+ }
+ }
+ // Drop any prior replaces contained within
+ for j:=0; j=rop.index && prevop.LastIndex <= rop.LastIndex{
+ // delete replace as it's a no-op.
+ rewrites[prevop.instruction_index] = nil
+ continue
+ }
+ // throw exception unless disjoint or identical
+ disjoint := prevop.LastIndex < rop.index || prevop.index > rop.LastIndex
+ // Delete special case of replace (text==null):
+ // D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right)
+ if prevop.text == "" && rop.text == "" && !disjoint{
+ rewrites[prevop.instruction_index] = nil
+ rop.index = min(prevop.index, rop.index)
+ rop.LastIndex = max(prevop.LastIndex, rop.LastIndex)
+ println("new rop" + rop.String()) //TODO: remove console write, taken from Java version
+ }else if !disjoint{
+ panic("replace op boundaries of " + rop.String() + " overlap with previous " + prevop.String())
+ }
+ }
+ }
+ }
+ // WALK INSERTS
+ for i:=0; i < len(rewrites); i++ {
+ op := rewrites[i]
+ if op == nil{continue}
+ //hack to replicate inheritance in composition
+ _, iok := rewrites[i].(*InsertBeforeOp)
+ _, aok := rewrites[i].(*InsertAfterOp)
+ if !iok && !aok{continue}
+ iop := rewrites[i]
+ // combine current insert with prior if any at same index
+ // deviating a bit from TokenStreamRewriter.java - hard to incorporate inheritance logic
+ for j:=0; j= rop.index && iop.GetIndex() <= rop.LastIndex{
+ panic("insert op "+iop.String()+" within boundaries of previous "+rop.String())
+ }
+ }
+ }
+ }
+ m := map[int]RewriteOperation{}
+ for i:=0; i < len(rewrites); i++{
+ op := rewrites[i]
+ if op == nil {continue}
+ if _, ok := m[op.GetIndex()]; ok{
+ panic("should only be one op per index")
+ }
+ m[op.GetIndex()] = op
+ }
+ return m
+}
+
+
+/*
+ Quick fixing Go lack of overloads
+ */
+
+func max(a,b int)int{
+ if a>b{
+ return a
+ }else {
+ return b
+ }
+}
+func min(a,b int)int{
+ if aThis is a one way link. It emanates from a state (usually via a list of
+// transitions) and has a target state.
+//
+//
Since we never have to change the ATN transitions once we construct it,
+// the states. We'll use the term Edge for the DFA to distinguish them from
+// ATN transitions.