planetscale 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +24 -0
- data/.github/workflows/gem-push.yml +38 -0
- data/.github/workflows/licensed.yml +43 -0
- data/.gitignore +10 -0
- data/.licensed.yml +9 -0
- data/.licenses/go/github.com/armon/circbuf.dep.yml +31 -0
- data/.licenses/go/github.com/gorilla/mux.dep.yml +41 -0
- data/.licenses/go/github.com/hashicorp/go-cleanhttp.dep.yml +375 -0
- data/.licenses/go/github.com/mitchellh/go-homedir.dep.yml +32 -0
- data/.licenses/go/github.com/pkg/errors.dep.yml +36 -0
- data/.licenses/go/github.com/planetscale/planetscale-go/planetscale.dep.yml +160 -0
- data/.licenses/go/github.com/planetscale/sql-proxy/proxy.dep.yml +180 -0
- data/.licenses/go/go.uber.org/atomic.dep.yml +31 -0
- data/.licenses/go/go.uber.org/multierr.dep.yml +30 -0
- data/.licenses/go/go.uber.org/zap.dep.yml +30 -0
- data/.licenses/go/go.uber.org/zap/buffer.dep.yml +30 -0
- data/.licenses/go/go.uber.org/zap/internal/bufferpool.dep.yml +30 -0
- data/.licenses/go/go.uber.org/zap/internal/color.dep.yml +30 -0
- data/.licenses/go/go.uber.org/zap/internal/exit.dep.yml +31 -0
- data/.licenses/go/go.uber.org/zap/zapcore.dep.yml +31 -0
- data/.licenses/go/golang.org/x/net/context/ctxhttp.dep.yml +63 -0
- data/.licenses/go/golang.org/x/oauth2.dep.yml +44 -0
- data/.licenses/go/golang.org/x/oauth2/internal.dep.yml +38 -0
- data/.ruby_version +1 -0
- data/Gemfile +8 -0
- data/LICENSE +201 -0
- data/README.md +88 -0
- data/Rakefile +10 -0
- data/bin/console +15 -0
- data/bin/setup +17 -0
- data/controller.go +255 -0
- data/go.mod +16 -0
- data/go.sum +428 -0
- data/lib/generators/planetscale/install_generator.rb +58 -0
- data/lib/planetscale.rb +137 -0
- data/lib/planetscale/version.rb +5 -0
- data/planetscale.gemspec +44 -0
- data/proxy.go +128 -0
- data/vendor/github.com/armon/circbuf/.gitignore +22 -0
- data/vendor/github.com/armon/circbuf/LICENSE +20 -0
- data/vendor/github.com/armon/circbuf/README.md +28 -0
- data/vendor/github.com/armon/circbuf/circbuf.go +92 -0
- data/vendor/github.com/armon/circbuf/go.mod +1 -0
- data/vendor/github.com/golang/protobuf/AUTHORS +3 -0
- data/vendor/github.com/golang/protobuf/CONTRIBUTORS +3 -0
- data/vendor/github.com/golang/protobuf/LICENSE +28 -0
- data/vendor/github.com/golang/protobuf/proto/buffer.go +324 -0
- data/vendor/github.com/golang/protobuf/proto/defaults.go +63 -0
- data/vendor/github.com/golang/protobuf/proto/deprecated.go +113 -0
- data/vendor/github.com/golang/protobuf/proto/discard.go +58 -0
- data/vendor/github.com/golang/protobuf/proto/extensions.go +356 -0
- data/vendor/github.com/golang/protobuf/proto/properties.go +306 -0
- data/vendor/github.com/golang/protobuf/proto/proto.go +167 -0
- data/vendor/github.com/golang/protobuf/proto/registry.go +317 -0
- data/vendor/github.com/golang/protobuf/proto/text_decode.go +801 -0
- data/vendor/github.com/golang/protobuf/proto/text_encode.go +560 -0
- data/vendor/github.com/golang/protobuf/proto/wire.go +78 -0
- data/vendor/github.com/golang/protobuf/proto/wrappers.go +34 -0
- data/vendor/github.com/gorilla/mux/AUTHORS +8 -0
- data/vendor/github.com/gorilla/mux/LICENSE +27 -0
- data/vendor/github.com/gorilla/mux/README.md +805 -0
- data/vendor/github.com/gorilla/mux/doc.go +306 -0
- data/vendor/github.com/gorilla/mux/go.mod +3 -0
- data/vendor/github.com/gorilla/mux/middleware.go +74 -0
- data/vendor/github.com/gorilla/mux/mux.go +606 -0
- data/vendor/github.com/gorilla/mux/regexp.go +388 -0
- data/vendor/github.com/gorilla/mux/route.go +736 -0
- data/vendor/github.com/gorilla/mux/test_helpers.go +19 -0
- data/vendor/github.com/hashicorp/go-cleanhttp/LICENSE +363 -0
- data/vendor/github.com/hashicorp/go-cleanhttp/README.md +30 -0
- data/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go +58 -0
- data/vendor/github.com/hashicorp/go-cleanhttp/doc.go +20 -0
- data/vendor/github.com/hashicorp/go-cleanhttp/go.mod +3 -0
- data/vendor/github.com/hashicorp/go-cleanhttp/handlers.go +48 -0
- data/vendor/github.com/mitchellh/go-homedir/LICENSE +21 -0
- data/vendor/github.com/mitchellh/go-homedir/README.md +14 -0
- data/vendor/github.com/mitchellh/go-homedir/go.mod +1 -0
- data/vendor/github.com/mitchellh/go-homedir/homedir.go +167 -0
- data/vendor/github.com/pkg/errors/.gitignore +24 -0
- data/vendor/github.com/pkg/errors/.travis.yml +10 -0
- data/vendor/github.com/pkg/errors/LICENSE +23 -0
- data/vendor/github.com/pkg/errors/Makefile +44 -0
- data/vendor/github.com/pkg/errors/README.md +59 -0
- data/vendor/github.com/pkg/errors/appveyor.yml +32 -0
- data/vendor/github.com/pkg/errors/errors.go +288 -0
- data/vendor/github.com/pkg/errors/go113.go +38 -0
- data/vendor/github.com/pkg/errors/stack.go +177 -0
- data/vendor/github.com/planetscale/planetscale-go/planetscale/backups.go +139 -0
- data/vendor/github.com/planetscale/planetscale-go/planetscale/branches.go +258 -0
- data/vendor/github.com/planetscale/planetscale-go/planetscale/certs.go +142 -0
- data/vendor/github.com/planetscale/planetscale-go/planetscale/client.go +305 -0
- data/vendor/github.com/planetscale/planetscale-go/planetscale/databases.go +131 -0
- data/vendor/github.com/planetscale/planetscale-go/planetscale/deploy_requests.go +368 -0
- data/vendor/github.com/planetscale/planetscale-go/planetscale/organizations.go +78 -0
- data/vendor/github.com/planetscale/planetscale-go/planetscale/service_tokens.go +163 -0
- data/vendor/github.com/planetscale/sql-proxy/proxy/client.go +467 -0
- data/vendor/github.com/planetscale/sql-proxy/proxy/tls_cache.go +73 -0
- data/vendor/go.uber.org/atomic/.codecov.yml +19 -0
- data/vendor/go.uber.org/atomic/.gitignore +12 -0
- data/vendor/go.uber.org/atomic/.travis.yml +27 -0
- data/vendor/go.uber.org/atomic/CHANGELOG.md +76 -0
- data/vendor/go.uber.org/atomic/LICENSE.txt +19 -0
- data/vendor/go.uber.org/atomic/Makefile +78 -0
- data/vendor/go.uber.org/atomic/README.md +63 -0
- data/vendor/go.uber.org/atomic/bool.go +81 -0
- data/vendor/go.uber.org/atomic/bool_ext.go +53 -0
- data/vendor/go.uber.org/atomic/doc.go +23 -0
- data/vendor/go.uber.org/atomic/duration.go +82 -0
- data/vendor/go.uber.org/atomic/duration_ext.go +40 -0
- data/vendor/go.uber.org/atomic/error.go +51 -0
- data/vendor/go.uber.org/atomic/error_ext.go +39 -0
- data/vendor/go.uber.org/atomic/float64.go +76 -0
- data/vendor/go.uber.org/atomic/float64_ext.go +47 -0
- data/vendor/go.uber.org/atomic/gen.go +26 -0
- data/vendor/go.uber.org/atomic/go.mod +8 -0
- data/vendor/go.uber.org/atomic/go.sum +9 -0
- data/vendor/go.uber.org/atomic/int32.go +102 -0
- data/vendor/go.uber.org/atomic/int64.go +102 -0
- data/vendor/go.uber.org/atomic/nocmp.go +35 -0
- data/vendor/go.uber.org/atomic/string.go +54 -0
- data/vendor/go.uber.org/atomic/string_ext.go +43 -0
- data/vendor/go.uber.org/atomic/uint32.go +102 -0
- data/vendor/go.uber.org/atomic/uint64.go +102 -0
- data/vendor/go.uber.org/atomic/value.go +31 -0
- data/vendor/go.uber.org/multierr/.codecov.yml +15 -0
- data/vendor/go.uber.org/multierr/.gitignore +4 -0
- data/vendor/go.uber.org/multierr/.travis.yml +23 -0
- data/vendor/go.uber.org/multierr/CHANGELOG.md +60 -0
- data/vendor/go.uber.org/multierr/LICENSE.txt +19 -0
- data/vendor/go.uber.org/multierr/Makefile +42 -0
- data/vendor/go.uber.org/multierr/README.md +23 -0
- data/vendor/go.uber.org/multierr/error.go +449 -0
- data/vendor/go.uber.org/multierr/glide.yaml +8 -0
- data/vendor/go.uber.org/multierr/go.mod +8 -0
- data/vendor/go.uber.org/multierr/go.sum +11 -0
- data/vendor/go.uber.org/multierr/go113.go +52 -0
- data/vendor/go.uber.org/zap/.codecov.yml +17 -0
- data/vendor/go.uber.org/zap/.gitignore +32 -0
- data/vendor/go.uber.org/zap/.readme.tmpl +109 -0
- data/vendor/go.uber.org/zap/.travis.yml +23 -0
- data/vendor/go.uber.org/zap/CHANGELOG.md +432 -0
- data/vendor/go.uber.org/zap/CODE_OF_CONDUCT.md +75 -0
- data/vendor/go.uber.org/zap/CONTRIBUTING.md +81 -0
- data/vendor/go.uber.org/zap/FAQ.md +156 -0
- data/vendor/go.uber.org/zap/LICENSE.txt +19 -0
- data/vendor/go.uber.org/zap/Makefile +63 -0
- data/vendor/go.uber.org/zap/README.md +134 -0
- data/vendor/go.uber.org/zap/array.go +320 -0
- data/vendor/go.uber.org/zap/buffer/buffer.go +123 -0
- data/vendor/go.uber.org/zap/buffer/pool.go +49 -0
- data/vendor/go.uber.org/zap/checklicense.sh +17 -0
- data/vendor/go.uber.org/zap/config.go +264 -0
- data/vendor/go.uber.org/zap/doc.go +113 -0
- data/vendor/go.uber.org/zap/encoder.go +79 -0
- data/vendor/go.uber.org/zap/error.go +80 -0
- data/vendor/go.uber.org/zap/field.go +539 -0
- data/vendor/go.uber.org/zap/flag.go +39 -0
- data/vendor/go.uber.org/zap/glide.yaml +34 -0
- data/vendor/go.uber.org/zap/global.go +168 -0
- data/vendor/go.uber.org/zap/global_go112.go +26 -0
- data/vendor/go.uber.org/zap/global_prego112.go +26 -0
- data/vendor/go.uber.org/zap/go.mod +13 -0
- data/vendor/go.uber.org/zap/go.sum +56 -0
- data/vendor/go.uber.org/zap/http_handler.go +81 -0
- data/vendor/go.uber.org/zap/internal/bufferpool/bufferpool.go +31 -0
- data/vendor/go.uber.org/zap/internal/color/color.go +44 -0
- data/vendor/go.uber.org/zap/internal/exit/exit.go +64 -0
- data/vendor/go.uber.org/zap/level.go +132 -0
- data/vendor/go.uber.org/zap/logger.go +344 -0
- data/vendor/go.uber.org/zap/options.go +140 -0
- data/vendor/go.uber.org/zap/sink.go +161 -0
- data/vendor/go.uber.org/zap/stacktrace.go +85 -0
- data/vendor/go.uber.org/zap/sugar.go +304 -0
- data/vendor/go.uber.org/zap/time.go +27 -0
- data/vendor/go.uber.org/zap/writer.go +99 -0
- data/vendor/go.uber.org/zap/zapcore/console_encoder.go +161 -0
- data/vendor/go.uber.org/zap/zapcore/core.go +113 -0
- data/vendor/go.uber.org/zap/zapcore/doc.go +24 -0
- data/vendor/go.uber.org/zap/zapcore/encoder.go +443 -0
- data/vendor/go.uber.org/zap/zapcore/entry.go +264 -0
- data/vendor/go.uber.org/zap/zapcore/error.go +115 -0
- data/vendor/go.uber.org/zap/zapcore/field.go +227 -0
- data/vendor/go.uber.org/zap/zapcore/hook.go +68 -0
- data/vendor/go.uber.org/zap/zapcore/increase_level.go +66 -0
- data/vendor/go.uber.org/zap/zapcore/json_encoder.go +534 -0
- data/vendor/go.uber.org/zap/zapcore/level.go +175 -0
- data/vendor/go.uber.org/zap/zapcore/level_strings.go +46 -0
- data/vendor/go.uber.org/zap/zapcore/marshaler.go +61 -0
- data/vendor/go.uber.org/zap/zapcore/memory_encoder.go +179 -0
- data/vendor/go.uber.org/zap/zapcore/sampler.go +208 -0
- data/vendor/go.uber.org/zap/zapcore/tee.go +81 -0
- data/vendor/go.uber.org/zap/zapcore/write_syncer.go +123 -0
- data/vendor/golang.org/x/net/AUTHORS +3 -0
- data/vendor/golang.org/x/net/CONTRIBUTORS +3 -0
- data/vendor/golang.org/x/net/LICENSE +27 -0
- data/vendor/golang.org/x/net/PATENTS +22 -0
- data/vendor/golang.org/x/net/context/context.go +56 -0
- data/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go +71 -0
- data/vendor/golang.org/x/net/context/go17.go +73 -0
- data/vendor/golang.org/x/net/context/go19.go +21 -0
- data/vendor/golang.org/x/net/context/pre_go17.go +301 -0
- data/vendor/golang.org/x/net/context/pre_go19.go +110 -0
- data/vendor/golang.org/x/oauth2/.travis.yml +13 -0
- data/vendor/golang.org/x/oauth2/AUTHORS +3 -0
- data/vendor/golang.org/x/oauth2/CONTRIBUTING.md +26 -0
- data/vendor/golang.org/x/oauth2/CONTRIBUTORS +3 -0
- data/vendor/golang.org/x/oauth2/LICENSE +27 -0
- data/vendor/golang.org/x/oauth2/README.md +36 -0
- data/vendor/golang.org/x/oauth2/go.mod +9 -0
- data/vendor/golang.org/x/oauth2/go.sum +361 -0
- data/vendor/golang.org/x/oauth2/internal/client_appengine.go +14 -0
- data/vendor/golang.org/x/oauth2/internal/doc.go +6 -0
- data/vendor/golang.org/x/oauth2/internal/oauth2.go +37 -0
- data/vendor/golang.org/x/oauth2/internal/token.go +294 -0
- data/vendor/golang.org/x/oauth2/internal/transport.go +33 -0
- data/vendor/golang.org/x/oauth2/oauth2.go +381 -0
- data/vendor/golang.org/x/oauth2/token.go +178 -0
- data/vendor/golang.org/x/oauth2/transport.go +89 -0
- data/vendor/google.golang.org/appengine/LICENSE +202 -0
- data/vendor/google.golang.org/appengine/internal/api.go +678 -0
- data/vendor/google.golang.org/appengine/internal/api_classic.go +169 -0
- data/vendor/google.golang.org/appengine/internal/api_common.go +123 -0
- data/vendor/google.golang.org/appengine/internal/app_id.go +28 -0
- data/vendor/google.golang.org/appengine/internal/base/api_base.pb.go +308 -0
- data/vendor/google.golang.org/appengine/internal/base/api_base.proto +33 -0
- data/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.pb.go +4367 -0
- data/vendor/google.golang.org/appengine/internal/datastore/datastore_v3.proto +551 -0
- data/vendor/google.golang.org/appengine/internal/identity.go +55 -0
- data/vendor/google.golang.org/appengine/internal/identity_classic.go +61 -0
- data/vendor/google.golang.org/appengine/internal/identity_flex.go +11 -0
- data/vendor/google.golang.org/appengine/internal/identity_vm.go +134 -0
- data/vendor/google.golang.org/appengine/internal/internal.go +110 -0
- data/vendor/google.golang.org/appengine/internal/log/log_service.pb.go +1313 -0
- data/vendor/google.golang.org/appengine/internal/log/log_service.proto +150 -0
- data/vendor/google.golang.org/appengine/internal/main.go +16 -0
- data/vendor/google.golang.org/appengine/internal/main_common.go +7 -0
- data/vendor/google.golang.org/appengine/internal/main_vm.go +69 -0
- data/vendor/google.golang.org/appengine/internal/metadata.go +60 -0
- data/vendor/google.golang.org/appengine/internal/net.go +56 -0
- data/vendor/google.golang.org/appengine/internal/regen.sh +40 -0
- data/vendor/google.golang.org/appengine/internal/remote_api/remote_api.pb.go +361 -0
- data/vendor/google.golang.org/appengine/internal/remote_api/remote_api.proto +44 -0
- data/vendor/google.golang.org/appengine/internal/transaction.go +115 -0
- data/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.pb.go +527 -0
- data/vendor/google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto +64 -0
- data/vendor/google.golang.org/appengine/urlfetch/urlfetch.go +210 -0
- data/vendor/google.golang.org/protobuf/AUTHORS +3 -0
- data/vendor/google.golang.org/protobuf/CONTRIBUTORS +3 -0
- data/vendor/google.golang.org/protobuf/LICENSE +27 -0
- data/vendor/google.golang.org/protobuf/PATENTS +22 -0
- data/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +773 -0
- data/vendor/google.golang.org/protobuf/encoding/prototext/doc.go +7 -0
- data/vendor/google.golang.org/protobuf/encoding/prototext/encode.go +371 -0
- data/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +538 -0
- data/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +318 -0
- data/vendor/google.golang.org/protobuf/internal/descopts/options.go +29 -0
- data/vendor/google.golang.org/protobuf/internal/detrand/rand.go +69 -0
- data/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go +213 -0
- data/vendor/google.golang.org/protobuf/internal/encoding/messageset/messageset.go +241 -0
- data/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go +207 -0
- data/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +665 -0
- data/vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go +190 -0
- data/vendor/google.golang.org/protobuf/internal/encoding/text/decode_string.go +161 -0
- data/vendor/google.golang.org/protobuf/internal/encoding/text/decode_token.go +373 -0
- data/vendor/google.golang.org/protobuf/internal/encoding/text/doc.go +29 -0
- data/vendor/google.golang.org/protobuf/internal/encoding/text/encode.go +265 -0
- data/vendor/google.golang.org/protobuf/internal/errors/errors.go +89 -0
- data/vendor/google.golang.org/protobuf/internal/errors/is_go112.go +39 -0
- data/vendor/google.golang.org/protobuf/internal/errors/is_go113.go +12 -0
- data/vendor/google.golang.org/protobuf/internal/filedesc/build.go +158 -0
- data/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +631 -0
- data/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go +471 -0
- data/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go +704 -0
- data/vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go +450 -0
- data/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go +356 -0
- data/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go +107 -0
- data/vendor/google.golang.org/protobuf/internal/filetype/build.go +297 -0
- data/vendor/google.golang.org/protobuf/internal/flags/flags.go +24 -0
- data/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go +9 -0
- data/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go +9 -0
- data/vendor/google.golang.org/protobuf/internal/genid/any_gen.go +34 -0
- data/vendor/google.golang.org/protobuf/internal/genid/api_gen.go +106 -0
- data/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +829 -0
- data/vendor/google.golang.org/protobuf/internal/genid/doc.go +11 -0
- data/vendor/google.golang.org/protobuf/internal/genid/duration_gen.go +34 -0
- data/vendor/google.golang.org/protobuf/internal/genid/empty_gen.go +19 -0
- data/vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.go +31 -0
- data/vendor/google.golang.org/protobuf/internal/genid/goname.go +25 -0
- data/vendor/google.golang.org/protobuf/internal/genid/map_entry.go +16 -0
- data/vendor/google.golang.org/protobuf/internal/genid/source_context_gen.go +31 -0
- data/vendor/google.golang.org/protobuf/internal/genid/struct_gen.go +116 -0
- data/vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.go +34 -0
- data/vendor/google.golang.org/protobuf/internal/genid/type_gen.go +184 -0
- data/vendor/google.golang.org/protobuf/internal/genid/wrappers.go +13 -0
- data/vendor/google.golang.org/protobuf/internal/genid/wrappers_gen.go +175 -0
- data/vendor/google.golang.org/protobuf/internal/impl/api_export.go +177 -0
- data/vendor/google.golang.org/protobuf/internal/impl/checkinit.go +141 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go +223 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_field.go +830 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go +5637 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +388 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_map_go111.go +37 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_map_go112.go +11 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_message.go +217 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go +123 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_reflect.go +209 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_tables.go +557 -0
- data/vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go +17 -0
- data/vendor/google.golang.org/protobuf/internal/impl/convert.go +496 -0
- data/vendor/google.golang.org/protobuf/internal/impl/convert_list.go +141 -0
- data/vendor/google.golang.org/protobuf/internal/impl/convert_map.go +121 -0
- data/vendor/google.golang.org/protobuf/internal/impl/decode.go +276 -0
- data/vendor/google.golang.org/protobuf/internal/impl/encode.go +201 -0
- data/vendor/google.golang.org/protobuf/internal/impl/enum.go +21 -0
- data/vendor/google.golang.org/protobuf/internal/impl/extension.go +156 -0
- data/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go +219 -0
- data/vendor/google.golang.org/protobuf/internal/impl/legacy_export.go +92 -0
- data/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go +176 -0
- data/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go +81 -0
- data/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go +558 -0
- data/vendor/google.golang.org/protobuf/internal/impl/merge.go +176 -0
- data/vendor/google.golang.org/protobuf/internal/impl/merge_gen.go +209 -0
- data/vendor/google.golang.org/protobuf/internal/impl/message.go +276 -0
- data/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go +465 -0
- data/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go +543 -0
- data/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go +249 -0
- data/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go +178 -0
- data/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +174 -0
- data/vendor/google.golang.org/protobuf/internal/impl/validate.go +576 -0
- data/vendor/google.golang.org/protobuf/internal/impl/weak.go +74 -0
- data/vendor/google.golang.org/protobuf/internal/order/order.go +89 -0
- data/vendor/google.golang.org/protobuf/internal/order/range.go +115 -0
- data/vendor/google.golang.org/protobuf/internal/pragma/pragma.go +29 -0
- data/vendor/google.golang.org/protobuf/internal/set/ints.go +58 -0
- data/vendor/google.golang.org/protobuf/internal/strs/strings.go +196 -0
- data/vendor/google.golang.org/protobuf/internal/strs/strings_pure.go +27 -0
- data/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go +94 -0
- data/vendor/google.golang.org/protobuf/internal/version/version.go +79 -0
- data/vendor/google.golang.org/protobuf/proto/checkinit.go +71 -0
- data/vendor/google.golang.org/protobuf/proto/decode.go +278 -0
- data/vendor/google.golang.org/protobuf/proto/decode_gen.go +603 -0
- data/vendor/google.golang.org/protobuf/proto/doc.go +94 -0
- data/vendor/google.golang.org/protobuf/proto/encode.go +319 -0
- data/vendor/google.golang.org/protobuf/proto/encode_gen.go +97 -0
- data/vendor/google.golang.org/protobuf/proto/equal.go +167 -0
- data/vendor/google.golang.org/protobuf/proto/extension.go +92 -0
- data/vendor/google.golang.org/protobuf/proto/merge.go +139 -0
- data/vendor/google.golang.org/protobuf/proto/messageset.go +93 -0
- data/vendor/google.golang.org/protobuf/proto/proto.go +43 -0
- data/vendor/google.golang.org/protobuf/proto/proto_methods.go +19 -0
- data/vendor/google.golang.org/protobuf/proto/proto_reflect.go +19 -0
- data/vendor/google.golang.org/protobuf/proto/reset.go +43 -0
- data/vendor/google.golang.org/protobuf/proto/size.go +97 -0
- data/vendor/google.golang.org/protobuf/proto/size_gen.go +55 -0
- data/vendor/google.golang.org/protobuf/proto/wrappers.go +29 -0
- data/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go +276 -0
- data/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go +248 -0
- data/vendor/google.golang.org/protobuf/reflect/protodesc/desc_resolve.go +286 -0
- data/vendor/google.golang.org/protobuf/reflect/protodesc/desc_validate.go +374 -0
- data/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go +252 -0
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go +77 -0
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go +504 -0
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/source.go +128 -0
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +461 -0
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go +665 -0
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go +285 -0
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/value_pure.go +59 -0
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go +411 -0
- data/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go +98 -0
- data/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go +869 -0
- data/vendor/google.golang.org/protobuf/runtime/protoiface/legacy.go +15 -0
- data/vendor/google.golang.org/protobuf/runtime/protoiface/methods.go +167 -0
- data/vendor/google.golang.org/protobuf/runtime/protoimpl/impl.go +44 -0
- data/vendor/google.golang.org/protobuf/runtime/protoimpl/version.go +56 -0
- data/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +4039 -0
- data/vendor/modules.txt +79 -0
- metadata +495 -0
@@ -0,0 +1,665 @@
|
|
1
|
+
// Copyright 2018 The Go Authors. All rights reserved.
|
2
|
+
// Use of this source code is governed by a BSD-style
|
3
|
+
// license that can be found in the LICENSE file.
|
4
|
+
|
5
|
+
package protoreflect
|
6
|
+
|
7
|
+
// Descriptor provides a set of accessors that are common to every descriptor.
|
8
|
+
// Each descriptor type wraps the equivalent google.protobuf.XXXDescriptorProto,
|
9
|
+
// but provides efficient lookup and immutability.
|
10
|
+
//
|
11
|
+
// Each descriptor is comparable. Equality implies that the two types are
|
12
|
+
// exactly identical. However, it is possible for the same semantically
|
13
|
+
// identical proto type to be represented by multiple type descriptors.
|
14
|
+
//
|
15
|
+
// For example, suppose we have t1 and t2 which are both MessageDescriptors.
|
16
|
+
// If t1 == t2, then the types are definitely equal and all accessors return
|
17
|
+
// the same information. However, if t1 != t2, then it is still possible that
|
18
|
+
// they still represent the same proto type (e.g., t1.FullName == t2.FullName).
|
19
|
+
// This can occur if a descriptor type is created dynamically, or multiple
|
20
|
+
// versions of the same proto type are accidentally linked into the Go binary.
|
21
|
+
type Descriptor interface {
|
22
|
+
// ParentFile returns the parent file descriptor that this descriptor
|
23
|
+
// is declared within. The parent file for the file descriptor is itself.
|
24
|
+
//
|
25
|
+
// Support for this functionality is optional and may return nil.
|
26
|
+
ParentFile() FileDescriptor
|
27
|
+
|
28
|
+
// Parent returns the parent containing this descriptor declaration.
|
29
|
+
// The following shows the mapping from child type to possible parent types:
|
30
|
+
//
|
31
|
+
// ╔═════════════════════╤═══════════════════════════════════╗
|
32
|
+
// ║ Child type │ Possible parent types ║
|
33
|
+
// ╠═════════════════════╪═══════════════════════════════════╣
|
34
|
+
// ║ FileDescriptor │ nil ║
|
35
|
+
// ║ MessageDescriptor │ FileDescriptor, MessageDescriptor ║
|
36
|
+
// ║ FieldDescriptor │ FileDescriptor, MessageDescriptor ║
|
37
|
+
// ║ OneofDescriptor │ MessageDescriptor ║
|
38
|
+
// ║ EnumDescriptor │ FileDescriptor, MessageDescriptor ║
|
39
|
+
// ║ EnumValueDescriptor │ EnumDescriptor ║
|
40
|
+
// ║ ServiceDescriptor │ FileDescriptor ║
|
41
|
+
// ║ MethodDescriptor │ ServiceDescriptor ║
|
42
|
+
// ╚═════════════════════╧═══════════════════════════════════╝
|
43
|
+
//
|
44
|
+
// Support for this functionality is optional and may return nil.
|
45
|
+
Parent() Descriptor
|
46
|
+
|
47
|
+
// Index returns the index of this descriptor within its parent.
|
48
|
+
// It returns 0 if the descriptor does not have a parent or if the parent
|
49
|
+
// is unknown.
|
50
|
+
Index() int
|
51
|
+
|
52
|
+
// Syntax is the protobuf syntax.
|
53
|
+
Syntax() Syntax // e.g., Proto2 or Proto3
|
54
|
+
|
55
|
+
// Name is the short name of the declaration (i.e., FullName.Name).
|
56
|
+
Name() Name // e.g., "Any"
|
57
|
+
|
58
|
+
// FullName is the fully-qualified name of the declaration.
|
59
|
+
//
|
60
|
+
// The FullName is a concatenation of the full name of the type that this
|
61
|
+
// type is declared within and the declaration name. For example,
|
62
|
+
// field "foo_field" in message "proto.package.MyMessage" is
|
63
|
+
// uniquely identified as "proto.package.MyMessage.foo_field".
|
64
|
+
// Enum values are an exception to the rule (see EnumValueDescriptor).
|
65
|
+
FullName() FullName // e.g., "google.protobuf.Any"
|
66
|
+
|
67
|
+
// IsPlaceholder reports whether type information is missing since a
|
68
|
+
// dependency is not resolved, in which case only name information is known.
|
69
|
+
//
|
70
|
+
// Placeholder types may only be returned by the following accessors
|
71
|
+
// as a result of unresolved dependencies or weak imports:
|
72
|
+
//
|
73
|
+
// ╔═══════════════════════════════════╤═════════════════════╗
|
74
|
+
// ║ Accessor │ Descriptor ║
|
75
|
+
// ╠═══════════════════════════════════╪═════════════════════╣
|
76
|
+
// ║ FileImports.FileDescriptor │ FileDescriptor ║
|
77
|
+
// ║ FieldDescriptor.Enum │ EnumDescriptor ║
|
78
|
+
// ║ FieldDescriptor.Message │ MessageDescriptor ║
|
79
|
+
// ║ FieldDescriptor.DefaultEnumValue │ EnumValueDescriptor ║
|
80
|
+
// ║ FieldDescriptor.ContainingMessage │ MessageDescriptor ║
|
81
|
+
// ║ MethodDescriptor.Input │ MessageDescriptor ║
|
82
|
+
// ║ MethodDescriptor.Output │ MessageDescriptor ║
|
83
|
+
// ╚═══════════════════════════════════╧═════════════════════╝
|
84
|
+
//
|
85
|
+
// If true, only Name and FullName are valid.
|
86
|
+
// For FileDescriptor, the Path is also valid.
|
87
|
+
IsPlaceholder() bool
|
88
|
+
|
89
|
+
// Options returns the descriptor options. The caller must not modify
|
90
|
+
// the returned value.
|
91
|
+
//
|
92
|
+
// To avoid a dependency cycle, this function returns a proto.Message value.
|
93
|
+
// The proto message type returned for each descriptor type is as follows:
|
94
|
+
// ╔═════════════════════╤══════════════════════════════════════════╗
|
95
|
+
// ║ Go type │ Protobuf message type ║
|
96
|
+
// ╠═════════════════════╪══════════════════════════════════════════╣
|
97
|
+
// ║ FileDescriptor │ google.protobuf.FileOptions ║
|
98
|
+
// ║ EnumDescriptor │ google.protobuf.EnumOptions ║
|
99
|
+
// ║ EnumValueDescriptor │ google.protobuf.EnumValueOptions ║
|
100
|
+
// ║ MessageDescriptor │ google.protobuf.MessageOptions ║
|
101
|
+
// ║ FieldDescriptor │ google.protobuf.FieldOptions ║
|
102
|
+
// ║ OneofDescriptor │ google.protobuf.OneofOptions ║
|
103
|
+
// ║ ServiceDescriptor │ google.protobuf.ServiceOptions ║
|
104
|
+
// ║ MethodDescriptor │ google.protobuf.MethodOptions ║
|
105
|
+
// ╚═════════════════════╧══════════════════════════════════════════╝
|
106
|
+
//
|
107
|
+
// This method returns a typed nil-pointer if no options are present.
|
108
|
+
// The caller must import the descriptorpb package to use this.
|
109
|
+
Options() ProtoMessage
|
110
|
+
|
111
|
+
doNotImplement
|
112
|
+
}
|
113
|
+
|
114
|
+
// FileDescriptor describes the types in a complete proto file and
|
115
|
+
// corresponds with the google.protobuf.FileDescriptorProto message.
|
116
|
+
//
|
117
|
+
// Top-level declarations:
|
118
|
+
// EnumDescriptor, MessageDescriptor, FieldDescriptor, and/or ServiceDescriptor.
|
119
|
+
type FileDescriptor interface {
|
120
|
+
Descriptor // Descriptor.FullName is identical to Package
|
121
|
+
|
122
|
+
// Path returns the file name, relative to the source tree root.
|
123
|
+
Path() string // e.g., "path/to/file.proto"
|
124
|
+
// Package returns the protobuf package namespace.
|
125
|
+
Package() FullName // e.g., "google.protobuf"
|
126
|
+
|
127
|
+
// Imports is a list of imported proto files.
|
128
|
+
Imports() FileImports
|
129
|
+
|
130
|
+
// Enums is a list of the top-level enum declarations.
|
131
|
+
Enums() EnumDescriptors
|
132
|
+
// Messages is a list of the top-level message declarations.
|
133
|
+
Messages() MessageDescriptors
|
134
|
+
// Extensions is a list of the top-level extension declarations.
|
135
|
+
Extensions() ExtensionDescriptors
|
136
|
+
// Services is a list of the top-level service declarations.
|
137
|
+
Services() ServiceDescriptors
|
138
|
+
|
139
|
+
// SourceLocations is a list of source locations.
|
140
|
+
SourceLocations() SourceLocations
|
141
|
+
|
142
|
+
isFileDescriptor
|
143
|
+
}
|
144
|
+
type isFileDescriptor interface{ ProtoType(FileDescriptor) }
|
145
|
+
|
146
|
+
// FileImports is a list of file imports.
|
147
|
+
type FileImports interface {
|
148
|
+
// Len reports the number of files imported by this proto file.
|
149
|
+
Len() int
|
150
|
+
// Get returns the ith FileImport. It panics if out of bounds.
|
151
|
+
Get(i int) FileImport
|
152
|
+
|
153
|
+
doNotImplement
|
154
|
+
}
|
155
|
+
|
156
|
+
// FileImport is the declaration for a proto file import.
|
157
|
+
type FileImport struct {
|
158
|
+
// FileDescriptor is the file type for the given import.
|
159
|
+
// It is a placeholder descriptor if IsWeak is set or if a dependency has
|
160
|
+
// not been regenerated to implement the new reflection APIs.
|
161
|
+
FileDescriptor
|
162
|
+
|
163
|
+
// IsPublic reports whether this is a public import, which causes this file
|
164
|
+
// to alias declarations within the imported file. The intended use cases
|
165
|
+
// for this feature is the ability to move proto files without breaking
|
166
|
+
// existing dependencies.
|
167
|
+
//
|
168
|
+
// The current file and the imported file must be within proto package.
|
169
|
+
IsPublic bool
|
170
|
+
|
171
|
+
// IsWeak reports whether this is a weak import, which does not impose
|
172
|
+
// a direct dependency on the target file.
|
173
|
+
//
|
174
|
+
// Weak imports are a legacy proto1 feature. Equivalent behavior is
|
175
|
+
// achieved using proto2 extension fields or proto3 Any messages.
|
176
|
+
IsWeak bool
|
177
|
+
}
|
178
|
+
|
179
|
+
// MessageDescriptor describes a message and
|
180
|
+
// corresponds with the google.protobuf.DescriptorProto message.
|
181
|
+
//
|
182
|
+
// Nested declarations:
|
183
|
+
// FieldDescriptor, OneofDescriptor, FieldDescriptor, EnumDescriptor,
|
184
|
+
// and/or MessageDescriptor.
|
185
|
+
type MessageDescriptor interface {
|
186
|
+
Descriptor
|
187
|
+
|
188
|
+
// IsMapEntry indicates that this is an auto-generated message type to
|
189
|
+
// represent the entry type for a map field.
|
190
|
+
//
|
191
|
+
// Map entry messages have only two fields:
|
192
|
+
// • a "key" field with a field number of 1
|
193
|
+
// • a "value" field with a field number of 2
|
194
|
+
// The key and value types are determined by these two fields.
|
195
|
+
//
|
196
|
+
// If IsMapEntry is true, it implies that FieldDescriptor.IsMap is true
|
197
|
+
// for some field with this message type.
|
198
|
+
IsMapEntry() bool
|
199
|
+
|
200
|
+
// Fields is a list of nested field declarations.
|
201
|
+
Fields() FieldDescriptors
|
202
|
+
// Oneofs is a list of nested oneof declarations.
|
203
|
+
Oneofs() OneofDescriptors
|
204
|
+
|
205
|
+
// ReservedNames is a list of reserved field names.
|
206
|
+
ReservedNames() Names
|
207
|
+
// ReservedRanges is a list of reserved ranges of field numbers.
|
208
|
+
ReservedRanges() FieldRanges
|
209
|
+
// RequiredNumbers is a list of required field numbers.
|
210
|
+
// In Proto3, it is always an empty list.
|
211
|
+
RequiredNumbers() FieldNumbers
|
212
|
+
// ExtensionRanges is the field ranges used for extension fields.
|
213
|
+
// In Proto3, it is always an empty ranges.
|
214
|
+
ExtensionRanges() FieldRanges
|
215
|
+
// ExtensionRangeOptions returns the ith extension range options.
|
216
|
+
//
|
217
|
+
// To avoid a dependency cycle, this method returns a proto.Message value,
|
218
|
+
// which always contains a google.protobuf.ExtensionRangeOptions message.
|
219
|
+
// This method returns a typed nil-pointer if no options are present.
|
220
|
+
// The caller must import the descriptorpb package to use this.
|
221
|
+
ExtensionRangeOptions(i int) ProtoMessage
|
222
|
+
|
223
|
+
// Enums is a list of nested enum declarations.
|
224
|
+
Enums() EnumDescriptors
|
225
|
+
// Messages is a list of nested message declarations.
|
226
|
+
Messages() MessageDescriptors
|
227
|
+
// Extensions is a list of nested extension declarations.
|
228
|
+
Extensions() ExtensionDescriptors
|
229
|
+
|
230
|
+
isMessageDescriptor
|
231
|
+
}
|
232
|
+
type isMessageDescriptor interface{ ProtoType(MessageDescriptor) }
|
233
|
+
|
234
|
+
// MessageType encapsulates a MessageDescriptor with a concrete Go implementation.
|
235
|
+
// It is recommended that implementations of this interface also implement the
|
236
|
+
// MessageFieldTypes interface.
|
237
|
+
type MessageType interface {
|
238
|
+
// New returns a newly allocated empty message.
|
239
|
+
// It may return nil for synthetic messages representing a map entry.
|
240
|
+
New() Message
|
241
|
+
|
242
|
+
// Zero returns an empty, read-only message.
|
243
|
+
// It may return nil for synthetic messages representing a map entry.
|
244
|
+
Zero() Message
|
245
|
+
|
246
|
+
// Descriptor returns the message descriptor.
|
247
|
+
//
|
248
|
+
// Invariant: t.Descriptor() == t.New().Descriptor()
|
249
|
+
Descriptor() MessageDescriptor
|
250
|
+
}
|
251
|
+
|
252
|
+
// MessageFieldTypes extends a MessageType by providing type information
|
253
|
+
// regarding enums and messages referenced by the message fields.
|
254
|
+
type MessageFieldTypes interface {
|
255
|
+
MessageType
|
256
|
+
|
257
|
+
// Enum returns the EnumType for the ith field in Descriptor.Fields.
|
258
|
+
// It returns nil if the ith field is not an enum kind.
|
259
|
+
// It panics if out of bounds.
|
260
|
+
//
|
261
|
+
// Invariant: mt.Enum(i).Descriptor() == mt.Descriptor().Fields(i).Enum()
|
262
|
+
Enum(i int) EnumType
|
263
|
+
|
264
|
+
// Message returns the MessageType for the ith field in Descriptor.Fields.
|
265
|
+
// It returns nil if the ith field is not a message or group kind.
|
266
|
+
// It panics if out of bounds.
|
267
|
+
//
|
268
|
+
// Invariant: mt.Message(i).Descriptor() == mt.Descriptor().Fields(i).Message()
|
269
|
+
Message(i int) MessageType
|
270
|
+
}
|
271
|
+
|
272
|
+
// MessageDescriptors is a list of message declarations.
|
273
|
+
type MessageDescriptors interface {
|
274
|
+
// Len reports the number of messages.
|
275
|
+
Len() int
|
276
|
+
// Get returns the ith MessageDescriptor. It panics if out of bounds.
|
277
|
+
Get(i int) MessageDescriptor
|
278
|
+
// ByName returns the MessageDescriptor for a message named s.
|
279
|
+
// It returns nil if not found.
|
280
|
+
ByName(s Name) MessageDescriptor
|
281
|
+
|
282
|
+
doNotImplement
|
283
|
+
}
|
284
|
+
|
285
|
+
// FieldDescriptor describes a field within a message and
|
286
|
+
// corresponds with the google.protobuf.FieldDescriptorProto message.
|
287
|
+
//
|
288
|
+
// It is used for both normal fields defined within the parent message
|
289
|
+
// (e.g., MessageDescriptor.Fields) and fields that extend some remote message
|
290
|
+
// (e.g., FileDescriptor.Extensions or MessageDescriptor.Extensions).
|
291
|
+
type FieldDescriptor interface {
|
292
|
+
Descriptor
|
293
|
+
|
294
|
+
// Number reports the unique number for this field.
|
295
|
+
Number() FieldNumber
|
296
|
+
// Cardinality reports the cardinality for this field.
|
297
|
+
Cardinality() Cardinality
|
298
|
+
// Kind reports the basic kind for this field.
|
299
|
+
Kind() Kind
|
300
|
+
|
301
|
+
// HasJSONName reports whether this field has an explicitly set JSON name.
|
302
|
+
HasJSONName() bool
|
303
|
+
|
304
|
+
// JSONName reports the name used for JSON serialization.
|
305
|
+
// It is usually the camel-cased form of the field name.
|
306
|
+
// Extension fields are represented by the full name surrounded by brackets.
|
307
|
+
JSONName() string
|
308
|
+
|
309
|
+
// TextName reports the name used for text serialization.
|
310
|
+
// It is usually the name of the field, except that groups use the name
|
311
|
+
// of the inlined message, and extension fields are represented by the
|
312
|
+
// full name surrounded by brackets.
|
313
|
+
TextName() string
|
314
|
+
|
315
|
+
// HasPresence reports whether the field distinguishes between unpopulated
|
316
|
+
// and default values.
|
317
|
+
HasPresence() bool
|
318
|
+
|
319
|
+
// IsExtension reports whether this is an extension field. If false,
|
320
|
+
// then Parent and ContainingMessage refer to the same message.
|
321
|
+
// Otherwise, ContainingMessage and Parent likely differ.
|
322
|
+
IsExtension() bool
|
323
|
+
|
324
|
+
// HasOptionalKeyword reports whether the "optional" keyword was explicitly
|
325
|
+
// specified in the source .proto file.
|
326
|
+
HasOptionalKeyword() bool
|
327
|
+
|
328
|
+
// IsWeak reports whether this is a weak field, which does not impose a
|
329
|
+
// direct dependency on the target type.
|
330
|
+
// If true, then Message returns a placeholder type.
|
331
|
+
IsWeak() bool
|
332
|
+
|
333
|
+
// IsPacked reports whether repeated primitive numeric kinds should be
|
334
|
+
// serialized using a packed encoding.
|
335
|
+
// If true, then it implies Cardinality is Repeated.
|
336
|
+
IsPacked() bool
|
337
|
+
|
338
|
+
// IsList reports whether this field represents a list,
|
339
|
+
// where the value type for the associated field is a List.
|
340
|
+
// It is equivalent to checking whether Cardinality is Repeated and
|
341
|
+
// that IsMap reports false.
|
342
|
+
IsList() bool
|
343
|
+
|
344
|
+
// IsMap reports whether this field represents a map,
|
345
|
+
// where the value type for the associated field is a Map.
|
346
|
+
// It is equivalent to checking whether Cardinality is Repeated,
|
347
|
+
// that the Kind is MessageKind, and that Message.IsMapEntry reports true.
|
348
|
+
IsMap() bool
|
349
|
+
|
350
|
+
// MapKey returns the field descriptor for the key in the map entry.
|
351
|
+
// It returns nil if IsMap reports false.
|
352
|
+
MapKey() FieldDescriptor
|
353
|
+
|
354
|
+
// MapValue returns the field descriptor for the value in the map entry.
|
355
|
+
// It returns nil if IsMap reports false.
|
356
|
+
MapValue() FieldDescriptor
|
357
|
+
|
358
|
+
// HasDefault reports whether this field has a default value.
|
359
|
+
HasDefault() bool
|
360
|
+
|
361
|
+
// Default returns the default value for scalar fields.
|
362
|
+
// For proto2, it is the default value as specified in the proto file,
|
363
|
+
// or the zero value if unspecified.
|
364
|
+
// For proto3, it is always the zero value of the scalar.
|
365
|
+
// The Value type is determined by the Kind.
|
366
|
+
Default() Value
|
367
|
+
|
368
|
+
// DefaultEnumValue returns the enum value descriptor for the default value
|
369
|
+
// of an enum field, and is nil for any other kind of field.
|
370
|
+
DefaultEnumValue() EnumValueDescriptor
|
371
|
+
|
372
|
+
// ContainingOneof is the containing oneof that this field belongs to,
|
373
|
+
// and is nil if this field is not part of a oneof.
|
374
|
+
ContainingOneof() OneofDescriptor
|
375
|
+
|
376
|
+
// ContainingMessage is the containing message that this field belongs to.
|
377
|
+
// For extension fields, this may not necessarily be the parent message
|
378
|
+
// that the field is declared within.
|
379
|
+
ContainingMessage() MessageDescriptor
|
380
|
+
|
381
|
+
// Enum is the enum descriptor if Kind is EnumKind.
|
382
|
+
// It returns nil for any other Kind.
|
383
|
+
Enum() EnumDescriptor
|
384
|
+
|
385
|
+
// Message is the message descriptor if Kind is
|
386
|
+
// MessageKind or GroupKind. It returns nil for any other Kind.
|
387
|
+
Message() MessageDescriptor
|
388
|
+
|
389
|
+
isFieldDescriptor
|
390
|
+
}
|
391
|
+
type isFieldDescriptor interface{ ProtoType(FieldDescriptor) }
|
392
|
+
|
393
|
+
// FieldDescriptors is a list of field declarations.
|
394
|
+
type FieldDescriptors interface {
|
395
|
+
// Len reports the number of fields.
|
396
|
+
Len() int
|
397
|
+
// Get returns the ith FieldDescriptor. It panics if out of bounds.
|
398
|
+
Get(i int) FieldDescriptor
|
399
|
+
// ByName returns the FieldDescriptor for a field named s.
|
400
|
+
// It returns nil if not found.
|
401
|
+
ByName(s Name) FieldDescriptor
|
402
|
+
// ByJSONName returns the FieldDescriptor for a field with s as the JSON name.
|
403
|
+
// It returns nil if not found.
|
404
|
+
ByJSONName(s string) FieldDescriptor
|
405
|
+
// ByTextName returns the FieldDescriptor for a field with s as the text name.
|
406
|
+
// It returns nil if not found.
|
407
|
+
ByTextName(s string) FieldDescriptor
|
408
|
+
// ByNumber returns the FieldDescriptor for a field numbered n.
|
409
|
+
// It returns nil if not found.
|
410
|
+
ByNumber(n FieldNumber) FieldDescriptor
|
411
|
+
|
412
|
+
doNotImplement
|
413
|
+
}
|
414
|
+
|
415
|
+
// OneofDescriptor describes a oneof field set within a given message and
|
416
|
+
// corresponds with the google.protobuf.OneofDescriptorProto message.
|
417
|
+
type OneofDescriptor interface {
|
418
|
+
Descriptor
|
419
|
+
|
420
|
+
// IsSynthetic reports whether this is a synthetic oneof created to support
|
421
|
+
// proto3 optional semantics. If true, Fields contains exactly one field
|
422
|
+
// with HasOptionalKeyword specified.
|
423
|
+
IsSynthetic() bool
|
424
|
+
|
425
|
+
// Fields is a list of fields belonging to this oneof.
|
426
|
+
Fields() FieldDescriptors
|
427
|
+
|
428
|
+
isOneofDescriptor
|
429
|
+
}
|
430
|
+
type isOneofDescriptor interface{ ProtoType(OneofDescriptor) }
|
431
|
+
|
432
|
+
// OneofDescriptors is a list of oneof declarations.
|
433
|
+
type OneofDescriptors interface {
|
434
|
+
// Len reports the number of oneof fields.
|
435
|
+
Len() int
|
436
|
+
// Get returns the ith OneofDescriptor. It panics if out of bounds.
|
437
|
+
Get(i int) OneofDescriptor
|
438
|
+
// ByName returns the OneofDescriptor for a oneof named s.
|
439
|
+
// It returns nil if not found.
|
440
|
+
ByName(s Name) OneofDescriptor
|
441
|
+
|
442
|
+
doNotImplement
|
443
|
+
}
|
444
|
+
|
445
|
+
// ExtensionDescriptor is an alias of FieldDescriptor for documentation.
|
446
|
+
type ExtensionDescriptor = FieldDescriptor
|
447
|
+
|
448
|
+
// ExtensionTypeDescriptor is an ExtensionDescriptor with an associated ExtensionType.
|
449
|
+
type ExtensionTypeDescriptor interface {
|
450
|
+
ExtensionDescriptor
|
451
|
+
|
452
|
+
// Type returns the associated ExtensionType.
|
453
|
+
Type() ExtensionType
|
454
|
+
|
455
|
+
// Descriptor returns the plain ExtensionDescriptor without the
|
456
|
+
// associated ExtensionType.
|
457
|
+
Descriptor() ExtensionDescriptor
|
458
|
+
}
|
459
|
+
|
460
|
+
// ExtensionDescriptors is a list of field declarations.
|
461
|
+
type ExtensionDescriptors interface {
|
462
|
+
// Len reports the number of fields.
|
463
|
+
Len() int
|
464
|
+
// Get returns the ith ExtensionDescriptor. It panics if out of bounds.
|
465
|
+
Get(i int) ExtensionDescriptor
|
466
|
+
// ByName returns the ExtensionDescriptor for a field named s.
|
467
|
+
// It returns nil if not found.
|
468
|
+
ByName(s Name) ExtensionDescriptor
|
469
|
+
|
470
|
+
doNotImplement
|
471
|
+
}
|
472
|
+
|
473
|
+
// ExtensionType encapsulates an ExtensionDescriptor with a concrete
|
474
|
+
// Go implementation. The nested field descriptor must be for a extension field.
|
475
|
+
//
|
476
|
+
// While a normal field is a member of the parent message that it is declared
|
477
|
+
// within (see Descriptor.Parent), an extension field is a member of some other
|
478
|
+
// target message (see ExtensionDescriptor.Extendee) and may have no
|
479
|
+
// relationship with the parent. However, the full name of an extension field is
|
480
|
+
// relative to the parent that it is declared within.
|
481
|
+
//
|
482
|
+
// For example:
|
483
|
+
// syntax = "proto2";
|
484
|
+
// package example;
|
485
|
+
// message FooMessage {
|
486
|
+
// extensions 100 to max;
|
487
|
+
// }
|
488
|
+
// message BarMessage {
|
489
|
+
// extends FooMessage { optional BarMessage bar_field = 100; }
|
490
|
+
// }
|
491
|
+
//
|
492
|
+
// Field "bar_field" is an extension of FooMessage, but its full name is
|
493
|
+
// "example.BarMessage.bar_field" instead of "example.FooMessage.bar_field".
|
494
|
+
type ExtensionType interface {
|
495
|
+
// New returns a new value for the field.
|
496
|
+
// For scalars, this returns the default value in native Go form.
|
497
|
+
New() Value
|
498
|
+
|
499
|
+
// Zero returns a new value for the field.
|
500
|
+
// For scalars, this returns the default value in native Go form.
|
501
|
+
// For composite types, this returns an empty, read-only message, list, or map.
|
502
|
+
Zero() Value
|
503
|
+
|
504
|
+
// TypeDescriptor returns the extension type descriptor.
|
505
|
+
TypeDescriptor() ExtensionTypeDescriptor
|
506
|
+
|
507
|
+
// ValueOf wraps the input and returns it as a Value.
|
508
|
+
// ValueOf panics if the input value is invalid or not the appropriate type.
|
509
|
+
//
|
510
|
+
// ValueOf is more extensive than protoreflect.ValueOf for a given field's
|
511
|
+
// value as it has more type information available.
|
512
|
+
ValueOf(interface{}) Value
|
513
|
+
|
514
|
+
// InterfaceOf completely unwraps the Value to the underlying Go type.
|
515
|
+
// InterfaceOf panics if the input is nil or does not represent the
|
516
|
+
// appropriate underlying Go type. For composite types, it panics if the
|
517
|
+
// value is not mutable.
|
518
|
+
//
|
519
|
+
// InterfaceOf is able to unwrap the Value further than Value.Interface
|
520
|
+
// as it has more type information available.
|
521
|
+
InterfaceOf(Value) interface{}
|
522
|
+
|
523
|
+
// IsValidValue reports whether the Value is valid to assign to the field.
|
524
|
+
IsValidValue(Value) bool
|
525
|
+
|
526
|
+
// IsValidInterface reports whether the input is valid to assign to the field.
|
527
|
+
IsValidInterface(interface{}) bool
|
528
|
+
}
|
529
|
+
|
530
|
+
// EnumDescriptor describes an enum and
|
531
|
+
// corresponds with the google.protobuf.EnumDescriptorProto message.
|
532
|
+
//
|
533
|
+
// Nested declarations:
|
534
|
+
// EnumValueDescriptor.
|
535
|
+
type EnumDescriptor interface {
|
536
|
+
Descriptor
|
537
|
+
|
538
|
+
// Values is a list of nested enum value declarations.
|
539
|
+
Values() EnumValueDescriptors
|
540
|
+
|
541
|
+
// ReservedNames is a list of reserved enum names.
|
542
|
+
ReservedNames() Names
|
543
|
+
// ReservedRanges is a list of reserved ranges of enum numbers.
|
544
|
+
ReservedRanges() EnumRanges
|
545
|
+
|
546
|
+
isEnumDescriptor
|
547
|
+
}
|
548
|
+
type isEnumDescriptor interface{ ProtoType(EnumDescriptor) }
|
549
|
+
|
550
|
+
// EnumType encapsulates an EnumDescriptor with a concrete Go implementation.
|
551
|
+
type EnumType interface {
|
552
|
+
// New returns an instance of this enum type with its value set to n.
|
553
|
+
New(n EnumNumber) Enum
|
554
|
+
|
555
|
+
// Descriptor returns the enum descriptor.
|
556
|
+
//
|
557
|
+
// Invariant: t.Descriptor() == t.New(0).Descriptor()
|
558
|
+
Descriptor() EnumDescriptor
|
559
|
+
}
|
560
|
+
|
561
|
+
// EnumDescriptors is a list of enum declarations.
|
562
|
+
type EnumDescriptors interface {
|
563
|
+
// Len reports the number of enum types.
|
564
|
+
Len() int
|
565
|
+
// Get returns the ith EnumDescriptor. It panics if out of bounds.
|
566
|
+
Get(i int) EnumDescriptor
|
567
|
+
// ByName returns the EnumDescriptor for an enum named s.
|
568
|
+
// It returns nil if not found.
|
569
|
+
ByName(s Name) EnumDescriptor
|
570
|
+
|
571
|
+
doNotImplement
|
572
|
+
}
|
573
|
+
|
574
|
+
// EnumValueDescriptor describes an enum value and
|
575
|
+
// corresponds with the google.protobuf.EnumValueDescriptorProto message.
|
576
|
+
//
|
577
|
+
// All other proto declarations are in the namespace of the parent.
|
578
|
+
// However, enum values do not follow this rule and are within the namespace
|
579
|
+
// of the parent's parent (i.e., they are a sibling of the containing enum).
|
580
|
+
// Thus, a value named "FOO_VALUE" declared within an enum uniquely identified
|
581
|
+
// as "proto.package.MyEnum" has a full name of "proto.package.FOO_VALUE".
|
582
|
+
type EnumValueDescriptor interface {
|
583
|
+
Descriptor
|
584
|
+
|
585
|
+
// Number returns the enum value as an integer.
|
586
|
+
Number() EnumNumber
|
587
|
+
|
588
|
+
isEnumValueDescriptor
|
589
|
+
}
|
590
|
+
type isEnumValueDescriptor interface{ ProtoType(EnumValueDescriptor) }
|
591
|
+
|
592
|
+
// EnumValueDescriptors is a list of enum value declarations.
|
593
|
+
type EnumValueDescriptors interface {
|
594
|
+
// Len reports the number of enum values.
|
595
|
+
Len() int
|
596
|
+
// Get returns the ith EnumValueDescriptor. It panics if out of bounds.
|
597
|
+
Get(i int) EnumValueDescriptor
|
598
|
+
// ByName returns the EnumValueDescriptor for the enum value named s.
|
599
|
+
// It returns nil if not found.
|
600
|
+
ByName(s Name) EnumValueDescriptor
|
601
|
+
// ByNumber returns the EnumValueDescriptor for the enum value numbered n.
|
602
|
+
// If multiple have the same number, the first one defined is returned
|
603
|
+
// It returns nil if not found.
|
604
|
+
ByNumber(n EnumNumber) EnumValueDescriptor
|
605
|
+
|
606
|
+
doNotImplement
|
607
|
+
}
|
608
|
+
|
609
|
+
// ServiceDescriptor describes a service and
|
610
|
+
// corresponds with the google.protobuf.ServiceDescriptorProto message.
|
611
|
+
//
|
612
|
+
// Nested declarations: MethodDescriptor.
|
613
|
+
type ServiceDescriptor interface {
|
614
|
+
Descriptor
|
615
|
+
|
616
|
+
// Methods is a list of nested message declarations.
|
617
|
+
Methods() MethodDescriptors
|
618
|
+
|
619
|
+
isServiceDescriptor
|
620
|
+
}
|
621
|
+
type isServiceDescriptor interface{ ProtoType(ServiceDescriptor) }
|
622
|
+
|
623
|
+
// ServiceDescriptors is a list of service declarations.
|
624
|
+
type ServiceDescriptors interface {
|
625
|
+
// Len reports the number of services.
|
626
|
+
Len() int
|
627
|
+
// Get returns the ith ServiceDescriptor. It panics if out of bounds.
|
628
|
+
Get(i int) ServiceDescriptor
|
629
|
+
// ByName returns the ServiceDescriptor for a service named s.
|
630
|
+
// It returns nil if not found.
|
631
|
+
ByName(s Name) ServiceDescriptor
|
632
|
+
|
633
|
+
doNotImplement
|
634
|
+
}
|
635
|
+
|
636
|
+
// MethodDescriptor describes a method and
|
637
|
+
// corresponds with the google.protobuf.MethodDescriptorProto message.
|
638
|
+
type MethodDescriptor interface {
|
639
|
+
Descriptor
|
640
|
+
|
641
|
+
// Input is the input message descriptor.
|
642
|
+
Input() MessageDescriptor
|
643
|
+
// Output is the output message descriptor.
|
644
|
+
Output() MessageDescriptor
|
645
|
+
// IsStreamingClient reports whether the client streams multiple messages.
|
646
|
+
IsStreamingClient() bool
|
647
|
+
// IsStreamingServer reports whether the server streams multiple messages.
|
648
|
+
IsStreamingServer() bool
|
649
|
+
|
650
|
+
isMethodDescriptor
|
651
|
+
}
|
652
|
+
type isMethodDescriptor interface{ ProtoType(MethodDescriptor) }
|
653
|
+
|
654
|
+
// MethodDescriptors is a list of method declarations.
|
655
|
+
type MethodDescriptors interface {
|
656
|
+
// Len reports the number of methods.
|
657
|
+
Len() int
|
658
|
+
// Get returns the ith MethodDescriptor. It panics if out of bounds.
|
659
|
+
Get(i int) MethodDescriptor
|
660
|
+
// ByName returns the MethodDescriptor for a service method named s.
|
661
|
+
// It returns nil if not found.
|
662
|
+
ByName(s Name) MethodDescriptor
|
663
|
+
|
664
|
+
doNotImplement
|
665
|
+
}
|