Repository: kubernetes-sigs/bootkube Branch: master Commit: 56216d7d14b1 Files: 1777 Total size: 25.4 MB Directory structure: gitextract_n2_dffvn/ ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── Documentation/ │ ├── alpha-features.md │ ├── design-principles.md │ ├── development.md │ ├── disaster-recovery.md │ ├── network-requirements.md │ ├── root-requirements.md │ ├── upgrading.md │ └── users-integrations.md ├── LICENSE ├── Makefile ├── NOTICE ├── OWNERS ├── OWNERS_ALIASES ├── README.md ├── RELEASING.md ├── ROADMAP.md ├── SECURITY_CONTACTS ├── bill-of-materials.json ├── build/ │ ├── README.md │ ├── build-image.sh │ ├── build-release.sh │ └── git-version.sh ├── cmd/ │ ├── bootkube/ │ │ ├── main.go │ │ ├── recover.go │ │ ├── render.go │ │ └── start.go │ ├── checkpoint/ │ │ ├── README.md │ │ └── main.go │ └── render/ │ └── plugin/ │ └── default/ │ ├── asset/ │ │ ├── asset.go │ │ ├── asset_test.go │ │ ├── images.go │ │ ├── internal/ │ │ │ └── templates.go │ │ ├── k8s.go │ │ └── tls.go │ ├── main.go │ └── render_test.go ├── code-of-conduct.md ├── e2e/ │ ├── README.md │ ├── checkpointer_test.go │ ├── deleteapi_test.go │ ├── internal/ │ │ └── e2eutil/ │ │ ├── testworkload/ │ │ │ └── nginx_workload.go │ │ └── utils/ │ │ └── utils.go │ ├── main_test.go │ ├── network_test.go │ ├── node_test.go │ ├── reboot_test.go │ ├── required_imports.go │ ├── smoke_test.go │ └── ssh_client_test.go ├── go.mod ├── go.sum ├── hack/ │ ├── jenkins/ │ │ ├── README.md │ │ ├── images/ │ │ │ └── bootkube-e2e/ │ │ │ └── Dockerfile │ │ ├── jobs/ │ │ │ ├── bootkube_conformance_cncf.groovy │ │ │ └── bootkube_e2e.groovy │ │ ├── pipelines/ │ │ │ ├── bootkube-conformance/ │ │ │ │ └── Jenkinsfile │ │ │ └── bootkube-e2e/ │ │ │ └── Jenkinsfile │ │ └── scripts/ │ │ ├── conformance.sh │ │ ├── e2e.sh │ │ ├── gather-logs.sh │ │ ├── tqs-down.sh │ │ └── tqs-up.sh │ ├── multi-node/ │ │ ├── README.md │ │ ├── Vagrantfile │ │ ├── bootkube-test-recovery │ │ ├── bootkube-up │ │ ├── conformance-test.sh │ │ ├── etcd-cloud-config.yaml │ │ └── user-data.sample │ ├── quickstart/ │ │ ├── .gitignore │ │ ├── copylogs.sh │ │ ├── init-master.sh │ │ ├── init-node.sh │ │ ├── kubelet.service │ │ ├── quickstart-aws.md │ │ ├── quickstart-gce.md │ │ └── test.sh │ ├── scripts/ │ │ └── gatherlogs │ ├── single-node/ │ │ ├── README.md │ │ ├── Vagrantfile │ │ ├── bootkube-up │ │ ├── conformance-test.sh │ │ ├── user-data-etcd.sample │ │ └── user-data.sample │ ├── terraform-quickstart/ │ │ ├── README.md │ │ ├── copylogs.sh │ │ ├── environment_default.txt │ │ ├── environment_e2e.txt │ │ ├── genlogs.sh │ │ ├── iam.tf │ │ ├── main.tf │ │ ├── network.tf │ │ ├── outputs.tf │ │ ├── run-conformance.sh │ │ ├── start-cluster.sh │ │ ├── terraform.tfvars.example │ │ └── variables.tf │ └── tests/ │ ├── conformance-gce.sh │ └── conformance-test.sh ├── image/ │ ├── bootkube/ │ │ ├── Dockerfile │ │ └── build-image.sh │ └── checkpoint/ │ ├── Dockerfile │ └── build-image.sh ├── pkg/ │ ├── bootkube/ │ │ ├── bootkube.go │ │ ├── bootstrap.go │ │ ├── bootstrap_test.go │ │ ├── create.go │ │ ├── create_test.go │ │ └── status.go │ ├── checkpoint/ │ │ ├── apiserver.go │ │ ├── checkpoint.go │ │ ├── config_map.go │ │ ├── cri/ │ │ │ ├── README.md │ │ │ ├── v1alpha1/ │ │ │ │ ├── api.pb.go │ │ │ │ └── constants.go │ │ │ └── v1alpha2/ │ │ │ ├── api.pb.go │ │ │ └── constants.go │ │ ├── internal/ │ │ │ ├── README.md │ │ │ ├── util.go │ │ │ └── util_unix.go │ │ ├── kubelet.go │ │ ├── manifest.go │ │ ├── pod.go │ │ ├── pod_test.go │ │ ├── process.go │ │ ├── process_test.go │ │ ├── runtime_service.go │ │ ├── secret.go │ │ ├── state.go │ │ └── state_test.go │ ├── plugin/ │ │ └── plugin.go │ ├── recovery/ │ │ ├── apiserver.go │ │ ├── etcd.go │ │ ├── etcd_template.go │ │ ├── recover.go │ │ ├── recover_test.go │ │ └── util.go │ ├── tlsutil/ │ │ └── tlsutil.go │ ├── util/ │ │ └── log.go │ └── version/ │ └── version.go └── vendor/ ├── github.com/ │ ├── coreos/ │ │ └── etcd/ │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── auth/ │ │ │ └── authpb/ │ │ │ ├── auth.pb.go │ │ │ └── auth.proto │ │ ├── clientv3/ │ │ │ ├── README.md │ │ │ ├── auth.go │ │ │ ├── client.go │ │ │ ├── cluster.go │ │ │ ├── compact_op.go │ │ │ ├── compare.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── health_balancer.go │ │ │ ├── kv.go │ │ │ ├── lease.go │ │ │ ├── logger.go │ │ │ ├── maintenance.go │ │ │ ├── op.go │ │ │ ├── options.go │ │ │ ├── ready_wait.go │ │ │ ├── retry.go │ │ │ ├── sort.go │ │ │ ├── txn.go │ │ │ └── watch.go │ │ ├── etcdserver/ │ │ │ ├── api/ │ │ │ │ └── v3rpc/ │ │ │ │ └── rpctypes/ │ │ │ │ ├── doc.go │ │ │ │ ├── error.go │ │ │ │ └── md.go │ │ │ └── etcdserverpb/ │ │ │ ├── etcdserver.pb.go │ │ │ ├── etcdserver.proto │ │ │ ├── raft_internal.pb.go │ │ │ ├── raft_internal.proto │ │ │ ├── raft_internal_stringer.go │ │ │ ├── rpc.pb.go │ │ │ └── rpc.proto │ │ ├── mvcc/ │ │ │ └── mvccpb/ │ │ │ ├── kv.pb.go │ │ │ └── kv.proto │ │ └── pkg/ │ │ └── types/ │ │ ├── doc.go │ │ ├── id.go │ │ ├── set.go │ │ ├── slice.go │ │ ├── urls.go │ │ └── urlsmap.go │ ├── davecgh/ │ │ └── go-spew/ │ │ ├── LICENSE │ │ └── spew/ │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go │ ├── ghodss/ │ │ └── yaml/ │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── fields.go │ │ └── yaml.go │ ├── gogo/ │ │ └── protobuf/ │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── gogoproto/ │ │ │ ├── Makefile │ │ │ ├── doc.go │ │ │ ├── gogo.pb.go │ │ │ ├── gogo.pb.golden │ │ │ ├── gogo.proto │ │ │ └── helper.go │ │ ├── proto/ │ │ │ ├── Makefile │ │ │ ├── clone.go │ │ │ ├── custom_gogo.go │ │ │ ├── decode.go │ │ │ ├── deprecated.go │ │ │ ├── discard.go │ │ │ ├── duration.go │ │ │ ├── duration_gogo.go │ │ │ ├── encode.go │ │ │ ├── encode_gogo.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── extensions_gogo.go │ │ │ ├── lib.go │ │ │ ├── lib_gogo.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_reflect_gogo.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── pointer_unsafe_gogo.go │ │ │ ├── properties.go │ │ │ ├── properties_gogo.go │ │ │ ├── skip_gogo.go │ │ │ ├── table_marshal.go │ │ │ ├── table_marshal_gogo.go │ │ │ ├── table_merge.go │ │ │ ├── table_unmarshal.go │ │ │ ├── table_unmarshal_gogo.go │ │ │ ├── text.go │ │ │ ├── text_gogo.go │ │ │ ├── text_parser.go │ │ │ ├── timestamp.go │ │ │ ├── timestamp_gogo.go │ │ │ ├── wrappers.go │ │ │ └── wrappers_gogo.go │ │ ├── protoc-gen-gogo/ │ │ │ └── descriptor/ │ │ │ ├── Makefile │ │ │ ├── descriptor.go │ │ │ ├── descriptor.pb.go │ │ │ ├── descriptor_gostring.gen.go │ │ │ └── helper.go │ │ └── sortkeys/ │ │ └── sortkeys.go │ ├── golang/ │ │ ├── glog/ │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── glog.go │ │ │ └── glog_file.go │ │ └── protobuf/ │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── proto/ │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── deprecated.go │ │ │ ├── discard.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── table_marshal.go │ │ │ ├── table_merge.go │ │ │ ├── table_unmarshal.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ │ └── ptypes/ │ │ ├── any/ │ │ │ ├── any.pb.go │ │ │ └── any.proto │ │ ├── any.go │ │ ├── doc.go │ │ ├── duration/ │ │ │ ├── duration.pb.go │ │ │ └── duration.proto │ │ ├── duration.go │ │ ├── timestamp/ │ │ │ ├── timestamp.pb.go │ │ │ └── timestamp.proto │ │ └── timestamp.go │ ├── google/ │ │ ├── btree/ │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── btree.go │ │ └── gofuzz/ │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── fuzz.go │ │ └── go.mod │ ├── googleapis/ │ │ └── gnostic/ │ │ ├── LICENSE │ │ ├── OpenAPIv2/ │ │ │ ├── OpenAPIv2.go │ │ │ ├── OpenAPIv2.pb.go │ │ │ ├── OpenAPIv2.proto │ │ │ ├── README.md │ │ │ └── openapi-2.0.json │ │ ├── compiler/ │ │ │ ├── README.md │ │ │ ├── context.go │ │ │ ├── error.go │ │ │ ├── extension-handler.go │ │ │ ├── helpers.go │ │ │ ├── main.go │ │ │ └── reader.go │ │ └── extensions/ │ │ ├── COMPILE-EXTENSION.sh │ │ ├── README.md │ │ ├── extension.pb.go │ │ ├── extension.proto │ │ └── extensions.go │ ├── gregjones/ │ │ └── httpcache/ │ │ ├── .travis.yml │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── diskcache/ │ │ │ └── diskcache.go │ │ └── httpcache.go │ ├── hashicorp/ │ │ └── golang-lru/ │ │ ├── .gitignore │ │ ├── 2q.go │ │ ├── LICENSE │ │ ├── README.md │ │ ├── arc.go │ │ ├── lru.go │ │ └── simplelru/ │ │ └── lru.go │ ├── imdario/ │ │ └── mergo/ │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CODE_OF_CONDUCT.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── map.go │ │ ├── merge.go │ │ └── mergo.go │ ├── inconshreveable/ │ │ └── mousetrap/ │ │ ├── LICENSE │ │ ├── README.md │ │ ├── trap_others.go │ │ ├── trap_windows.go │ │ └── trap_windows_1.4.go │ ├── modern-go/ │ │ └── concurrent/ │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── executor.go │ │ ├── go_above_19.go │ │ ├── go_below_19.go │ │ ├── log.go │ │ ├── test.sh │ │ └── unbounded_executor.go │ ├── pborman/ │ │ └── uuid/ │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── dce.go │ │ ├── doc.go │ │ ├── hash.go │ │ ├── json.go │ │ ├── node.go │ │ ├── time.go │ │ ├── util.go │ │ ├── uuid.go │ │ ├── version1.go │ │ └── version4.go │ ├── peterbourgon/ │ │ └── diskv/ │ │ ├── LICENSE │ │ ├── README.md │ │ ├── compression.go │ │ ├── diskv.go │ │ └── index.go │ └── spf13/ │ ├── cobra/ │ │ ├── .gitignore │ │ ├── .mailmap │ │ ├── .travis.yml │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── bash_completions.go │ │ ├── bash_completions.md │ │ ├── cobra.go │ │ ├── command.go │ │ ├── command_notwin.go │ │ └── command_win.go │ └── pflag/ │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── bool.go │ ├── bool_slice.go │ ├── count.go │ ├── duration.go │ ├── flag.go │ ├── float32.go │ ├── float64.go │ ├── golangflag.go │ ├── int.go │ ├── int32.go │ ├── int64.go │ ├── int8.go │ ├── int_slice.go │ ├── ip.go │ ├── ip_slice.go │ ├── ipmask.go │ ├── ipnet.go │ ├── string.go │ ├── string_array.go │ ├── string_slice.go │ ├── uint.go │ ├── uint16.go │ ├── uint32.go │ ├── uint64.go │ ├── uint8.go │ └── uint_slice.go ├── golang.org/ │ └── x/ │ ├── crypto/ │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── curve25519/ │ │ │ ├── const_amd64.h │ │ │ ├── const_amd64.s │ │ │ ├── cswap_amd64.s │ │ │ ├── curve25519.go │ │ │ ├── doc.go │ │ │ ├── freeze_amd64.s │ │ │ ├── ladderstep_amd64.s │ │ │ ├── mont25519_amd64.go │ │ │ ├── mul_amd64.s │ │ │ └── square_amd64.s │ │ ├── ed25519/ │ │ │ ├── ed25519.go │ │ │ └── internal/ │ │ │ └── edwards25519/ │ │ │ ├── const.go │ │ │ └── edwards25519.go │ │ ├── internal/ │ │ │ ├── chacha20/ │ │ │ │ ├── asm_arm64.s │ │ │ │ ├── chacha_arm64.go │ │ │ │ ├── chacha_generic.go │ │ │ │ ├── chacha_noasm.go │ │ │ │ ├── chacha_s390x.go │ │ │ │ ├── chacha_s390x.s │ │ │ │ └── xor.go │ │ │ └── subtle/ │ │ │ ├── aliasing.go │ │ │ └── aliasing_appengine.go │ │ ├── poly1305/ │ │ │ ├── mac_noasm.go │ │ │ ├── poly1305.go │ │ │ ├── sum_amd64.go │ │ │ ├── sum_amd64.s │ │ │ ├── sum_arm.go │ │ │ ├── sum_arm.s │ │ │ ├── sum_generic.go │ │ │ ├── sum_noasm.go │ │ │ ├── sum_s390x.go │ │ │ ├── sum_s390x.s │ │ │ └── sum_vmsl_s390x.s │ │ └── ssh/ │ │ ├── agent/ │ │ │ ├── client.go │ │ │ ├── forward.go │ │ │ ├── keyring.go │ │ │ └── server.go │ │ ├── buffer.go │ │ ├── certs.go │ │ ├── channel.go │ │ ├── cipher.go │ │ ├── client.go │ │ ├── client_auth.go │ │ ├── common.go │ │ ├── connection.go │ │ ├── doc.go │ │ ├── handshake.go │ │ ├── kex.go │ │ ├── keys.go │ │ ├── mac.go │ │ ├── messages.go │ │ ├── mux.go │ │ ├── server.go │ │ ├── session.go │ │ ├── streamlocal.go │ │ ├── tcpip.go │ │ ├── terminal/ │ │ │ ├── terminal.go │ │ │ ├── util.go │ │ │ ├── util_aix.go │ │ │ ├── util_bsd.go │ │ │ ├── util_linux.go │ │ │ ├── util_plan9.go │ │ │ ├── util_solaris.go │ │ │ └── util_windows.go │ │ └── transport.go │ ├── net/ │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── context/ │ │ │ ├── context.go │ │ │ ├── ctxhttp/ │ │ │ │ └── ctxhttp.go │ │ │ ├── go17.go │ │ │ ├── go19.go │ │ │ ├── pre_go17.go │ │ │ └── pre_go19.go │ │ ├── http/ │ │ │ └── httpguts/ │ │ │ ├── guts.go │ │ │ └── httplex.go │ │ ├── http2/ │ │ │ ├── .gitignore │ │ │ ├── Dockerfile │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── ciphers.go │ │ │ ├── client_conn_pool.go │ │ │ ├── databuffer.go │ │ │ ├── errors.go │ │ │ ├── flow.go │ │ │ ├── frame.go │ │ │ ├── go111.go │ │ │ ├── gotrack.go │ │ │ ├── headermap.go │ │ │ ├── hpack/ │ │ │ │ ├── encode.go │ │ │ │ ├── hpack.go │ │ │ │ ├── huffman.go │ │ │ │ └── tables.go │ │ │ ├── http2.go │ │ │ ├── not_go111.go │ │ │ ├── pipe.go │ │ │ ├── server.go │ │ │ ├── transport.go │ │ │ ├── write.go │ │ │ ├── writesched.go │ │ │ ├── writesched_priority.go │ │ │ └── writesched_random.go │ │ ├── idna/ │ │ │ ├── idna10.0.0.go │ │ │ ├── idna9.0.0.go │ │ │ ├── punycode.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables11.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ ├── trie.go │ │ │ └── trieval.go │ │ ├── internal/ │ │ │ └── timeseries/ │ │ │ └── timeseries.go │ │ └── trace/ │ │ ├── events.go │ │ ├── histogram.go │ │ └── trace.go │ ├── oauth2/ │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── CONTRIBUTING.md │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── internal/ │ │ │ ├── client_appengine.go │ │ │ ├── doc.go │ │ │ ├── oauth2.go │ │ │ ├── token.go │ │ │ └── transport.go │ │ ├── oauth2.go │ │ ├── token.go │ │ └── transport.go │ ├── sys/ │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── cpu/ │ │ │ ├── asm_aix_ppc64.s │ │ │ ├── byteorder.go │ │ │ ├── cpu.go │ │ │ ├── cpu_aix_ppc64.go │ │ │ ├── cpu_arm.go │ │ │ ├── cpu_gc_s390x.go │ │ │ ├── cpu_gc_x86.go │ │ │ ├── cpu_gccgo.c │ │ │ ├── cpu_gccgo.go │ │ │ ├── cpu_gccgo_s390x.go │ │ │ ├── cpu_linux.go │ │ │ ├── cpu_linux_arm64.go │ │ │ ├── cpu_linux_ppc64x.go │ │ │ ├── cpu_linux_s390x.go │ │ │ ├── cpu_mips64x.go │ │ │ ├── cpu_mipsx.go │ │ │ ├── cpu_other_arm64.go │ │ │ ├── cpu_s390x.s │ │ │ ├── cpu_wasm.go │ │ │ ├── cpu_x86.go │ │ │ ├── cpu_x86.s │ │ │ └── syscall_aix_ppc64_gc.go │ │ ├── unix/ │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── affinity_linux.go │ │ │ ├── aliases.go │ │ │ ├── asm_aix_ppc64.s │ │ │ ├── asm_darwin_386.s │ │ │ ├── asm_darwin_amd64.s │ │ │ ├── asm_darwin_arm.s │ │ │ ├── asm_darwin_arm64.s │ │ │ ├── asm_dragonfly_amd64.s │ │ │ ├── asm_freebsd_386.s │ │ │ ├── asm_freebsd_amd64.s │ │ │ ├── asm_freebsd_arm.s │ │ │ ├── asm_freebsd_arm64.s │ │ │ ├── asm_linux_386.s │ │ │ ├── asm_linux_amd64.s │ │ │ ├── asm_linux_arm.s │ │ │ ├── asm_linux_arm64.s │ │ │ ├── asm_linux_mips64x.s │ │ │ ├── asm_linux_mipsx.s │ │ │ ├── asm_linux_ppc64x.s │ │ │ ├── asm_linux_riscv64.s │ │ │ ├── asm_linux_s390x.s │ │ │ ├── asm_netbsd_386.s │ │ │ ├── asm_netbsd_amd64.s │ │ │ ├── asm_netbsd_arm.s │ │ │ ├── asm_netbsd_arm64.s │ │ │ ├── asm_openbsd_386.s │ │ │ ├── asm_openbsd_amd64.s │ │ │ ├── asm_openbsd_arm.s │ │ │ ├── asm_openbsd_arm64.s │ │ │ ├── asm_solaris_amd64.s │ │ │ ├── bluetooth_linux.go │ │ │ ├── cap_freebsd.go │ │ │ ├── constants.go │ │ │ ├── dev_aix_ppc.go │ │ │ ├── dev_aix_ppc64.go │ │ │ ├── dev_darwin.go │ │ │ ├── dev_dragonfly.go │ │ │ ├── dev_freebsd.go │ │ │ ├── dev_linux.go │ │ │ ├── dev_netbsd.go │ │ │ ├── dev_openbsd.go │ │ │ ├── dirent.go │ │ │ ├── endian_big.go │ │ │ ├── endian_little.go │ │ │ ├── env_unix.go │ │ │ ├── errors_freebsd_386.go │ │ │ ├── errors_freebsd_amd64.go │ │ │ ├── errors_freebsd_arm.go │ │ │ ├── fcntl.go │ │ │ ├── fcntl_darwin.go │ │ │ ├── fcntl_linux_32bit.go │ │ │ ├── gccgo.go │ │ │ ├── gccgo_c.c │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── ioctl.go │ │ │ ├── mkall.sh │ │ │ ├── mkerrors.sh │ │ │ ├── pagesize_unix.go │ │ │ ├── pledge_openbsd.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── readdirent_getdents.go │ │ │ ├── readdirent_getdirentries.go │ │ │ ├── sockcmsg_linux.go │ │ │ ├── sockcmsg_unix.go │ │ │ ├── str.go │ │ │ ├── syscall.go │ │ │ ├── syscall_aix.go │ │ │ ├── syscall_aix_ppc.go │ │ │ ├── syscall_aix_ppc64.go │ │ │ ├── syscall_bsd.go │ │ │ ├── syscall_darwin.go │ │ │ ├── syscall_darwin_386.go │ │ │ ├── syscall_darwin_amd64.go │ │ │ ├── syscall_darwin_arm.go │ │ │ ├── syscall_darwin_arm64.go │ │ │ ├── syscall_darwin_libSystem.go │ │ │ ├── syscall_dragonfly.go │ │ │ ├── syscall_dragonfly_amd64.go │ │ │ ├── syscall_freebsd.go │ │ │ ├── syscall_freebsd_386.go │ │ │ ├── syscall_freebsd_amd64.go │ │ │ ├── syscall_freebsd_arm.go │ │ │ ├── syscall_freebsd_arm64.go │ │ │ ├── syscall_linux.go │ │ │ ├── syscall_linux_386.go │ │ │ ├── syscall_linux_amd64.go │ │ │ ├── syscall_linux_amd64_gc.go │ │ │ ├── syscall_linux_arm.go │ │ │ ├── syscall_linux_arm64.go │ │ │ ├── syscall_linux_gc.go │ │ │ ├── syscall_linux_gc_386.go │ │ │ ├── syscall_linux_gccgo_386.go │ │ │ ├── syscall_linux_gccgo_arm.go │ │ │ ├── syscall_linux_mips64x.go │ │ │ ├── syscall_linux_mipsx.go │ │ │ ├── syscall_linux_ppc64x.go │ │ │ ├── syscall_linux_riscv64.go │ │ │ ├── syscall_linux_s390x.go │ │ │ ├── syscall_linux_sparc64.go │ │ │ ├── syscall_netbsd.go │ │ │ ├── syscall_netbsd_386.go │ │ │ ├── syscall_netbsd_amd64.go │ │ │ ├── syscall_netbsd_arm.go │ │ │ ├── syscall_netbsd_arm64.go │ │ │ ├── syscall_openbsd.go │ │ │ ├── syscall_openbsd_386.go │ │ │ ├── syscall_openbsd_amd64.go │ │ │ ├── syscall_openbsd_arm.go │ │ │ ├── syscall_openbsd_arm64.go │ │ │ ├── syscall_solaris.go │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── syscall_unix.go │ │ │ ├── syscall_unix_gc.go │ │ │ ├── syscall_unix_gc_ppc64x.go │ │ │ ├── timestruct.go │ │ │ ├── unveil_openbsd.go │ │ │ ├── xattr_bsd.go │ │ │ ├── zerrors_aix_ppc.go │ │ │ ├── zerrors_aix_ppc64.go │ │ │ ├── zerrors_darwin_386.go │ │ │ ├── zerrors_darwin_amd64.go │ │ │ ├── zerrors_darwin_arm.go │ │ │ ├── zerrors_darwin_arm64.go │ │ │ ├── zerrors_dragonfly_amd64.go │ │ │ ├── zerrors_freebsd_386.go │ │ │ ├── zerrors_freebsd_amd64.go │ │ │ ├── zerrors_freebsd_arm.go │ │ │ ├── zerrors_freebsd_arm64.go │ │ │ ├── zerrors_linux_386.go │ │ │ ├── zerrors_linux_amd64.go │ │ │ ├── zerrors_linux_arm.go │ │ │ ├── zerrors_linux_arm64.go │ │ │ ├── zerrors_linux_mips.go │ │ │ ├── zerrors_linux_mips64.go │ │ │ ├── zerrors_linux_mips64le.go │ │ │ ├── zerrors_linux_mipsle.go │ │ │ ├── zerrors_linux_ppc64.go │ │ │ ├── zerrors_linux_ppc64le.go │ │ │ ├── zerrors_linux_riscv64.go │ │ │ ├── zerrors_linux_s390x.go │ │ │ ├── zerrors_linux_sparc64.go │ │ │ ├── zerrors_netbsd_386.go │ │ │ ├── zerrors_netbsd_amd64.go │ │ │ ├── zerrors_netbsd_arm.go │ │ │ ├── zerrors_netbsd_arm64.go │ │ │ ├── zerrors_openbsd_386.go │ │ │ ├── zerrors_openbsd_amd64.go │ │ │ ├── zerrors_openbsd_arm.go │ │ │ ├── zerrors_openbsd_arm64.go │ │ │ ├── zerrors_solaris_amd64.go │ │ │ ├── zptrace386_linux.go │ │ │ ├── zptracearm_linux.go │ │ │ ├── zptracemips_linux.go │ │ │ ├── zptracemipsle_linux.go │ │ │ ├── zsyscall_aix_ppc.go │ │ │ ├── zsyscall_aix_ppc64.go │ │ │ ├── zsyscall_aix_ppc64_gc.go │ │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ │ ├── zsyscall_darwin_386.1_11.go │ │ │ ├── zsyscall_darwin_386.go │ │ │ ├── zsyscall_darwin_386.s │ │ │ ├── zsyscall_darwin_amd64.1_11.go │ │ │ ├── zsyscall_darwin_amd64.go │ │ │ ├── zsyscall_darwin_amd64.s │ │ │ ├── zsyscall_darwin_arm.1_11.go │ │ │ ├── zsyscall_darwin_arm.go │ │ │ ├── zsyscall_darwin_arm.s │ │ │ ├── zsyscall_darwin_arm64.1_11.go │ │ │ ├── zsyscall_darwin_arm64.go │ │ │ ├── zsyscall_darwin_arm64.s │ │ │ ├── zsyscall_dragonfly_amd64.go │ │ │ ├── zsyscall_freebsd_386.go │ │ │ ├── zsyscall_freebsd_amd64.go │ │ │ ├── zsyscall_freebsd_arm.go │ │ │ ├── zsyscall_freebsd_arm64.go │ │ │ ├── zsyscall_linux_386.go │ │ │ ├── zsyscall_linux_amd64.go │ │ │ ├── zsyscall_linux_arm.go │ │ │ ├── zsyscall_linux_arm64.go │ │ │ ├── zsyscall_linux_mips.go │ │ │ ├── zsyscall_linux_mips64.go │ │ │ ├── zsyscall_linux_mips64le.go │ │ │ ├── zsyscall_linux_mipsle.go │ │ │ ├── zsyscall_linux_ppc64.go │ │ │ ├── zsyscall_linux_ppc64le.go │ │ │ ├── zsyscall_linux_riscv64.go │ │ │ ├── zsyscall_linux_s390x.go │ │ │ ├── zsyscall_linux_sparc64.go │ │ │ ├── zsyscall_netbsd_386.go │ │ │ ├── zsyscall_netbsd_amd64.go │ │ │ ├── zsyscall_netbsd_arm.go │ │ │ ├── zsyscall_netbsd_arm64.go │ │ │ ├── zsyscall_openbsd_386.go │ │ │ ├── zsyscall_openbsd_amd64.go │ │ │ ├── zsyscall_openbsd_arm.go │ │ │ ├── zsyscall_openbsd_arm64.go │ │ │ ├── zsyscall_solaris_amd64.go │ │ │ ├── zsysctl_openbsd_386.go │ │ │ ├── zsysctl_openbsd_amd64.go │ │ │ ├── zsysctl_openbsd_arm.go │ │ │ ├── zsysctl_openbsd_arm64.go │ │ │ ├── zsysnum_darwin_386.go │ │ │ ├── zsysnum_darwin_amd64.go │ │ │ ├── zsysnum_darwin_arm.go │ │ │ ├── zsysnum_darwin_arm64.go │ │ │ ├── zsysnum_dragonfly_amd64.go │ │ │ ├── zsysnum_freebsd_386.go │ │ │ ├── zsysnum_freebsd_amd64.go │ │ │ ├── zsysnum_freebsd_arm.go │ │ │ ├── zsysnum_freebsd_arm64.go │ │ │ ├── zsysnum_linux_386.go │ │ │ ├── zsysnum_linux_amd64.go │ │ │ ├── zsysnum_linux_arm.go │ │ │ ├── zsysnum_linux_arm64.go │ │ │ ├── zsysnum_linux_mips.go │ │ │ ├── zsysnum_linux_mips64.go │ │ │ ├── zsysnum_linux_mips64le.go │ │ │ ├── zsysnum_linux_mipsle.go │ │ │ ├── zsysnum_linux_ppc64.go │ │ │ ├── zsysnum_linux_ppc64le.go │ │ │ ├── zsysnum_linux_riscv64.go │ │ │ ├── zsysnum_linux_s390x.go │ │ │ ├── zsysnum_linux_sparc64.go │ │ │ ├── zsysnum_netbsd_386.go │ │ │ ├── zsysnum_netbsd_amd64.go │ │ │ ├── zsysnum_netbsd_arm.go │ │ │ ├── zsysnum_netbsd_arm64.go │ │ │ ├── zsysnum_openbsd_386.go │ │ │ ├── zsysnum_openbsd_amd64.go │ │ │ ├── zsysnum_openbsd_arm.go │ │ │ ├── zsysnum_openbsd_arm64.go │ │ │ ├── ztypes_aix_ppc.go │ │ │ ├── ztypes_aix_ppc64.go │ │ │ ├── ztypes_darwin_386.go │ │ │ ├── ztypes_darwin_amd64.go │ │ │ ├── ztypes_darwin_arm.go │ │ │ ├── ztypes_darwin_arm64.go │ │ │ ├── ztypes_dragonfly_amd64.go │ │ │ ├── ztypes_freebsd_386.go │ │ │ ├── ztypes_freebsd_amd64.go │ │ │ ├── ztypes_freebsd_arm.go │ │ │ ├── ztypes_freebsd_arm64.go │ │ │ ├── ztypes_linux_386.go │ │ │ ├── ztypes_linux_amd64.go │ │ │ ├── ztypes_linux_arm.go │ │ │ ├── ztypes_linux_arm64.go │ │ │ ├── ztypes_linux_mips.go │ │ │ ├── ztypes_linux_mips64.go │ │ │ ├── ztypes_linux_mips64le.go │ │ │ ├── ztypes_linux_mipsle.go │ │ │ ├── ztypes_linux_ppc64.go │ │ │ ├── ztypes_linux_ppc64le.go │ │ │ ├── ztypes_linux_riscv64.go │ │ │ ├── ztypes_linux_s390x.go │ │ │ ├── ztypes_linux_sparc64.go │ │ │ ├── ztypes_netbsd_386.go │ │ │ ├── ztypes_netbsd_amd64.go │ │ │ ├── ztypes_netbsd_arm.go │ │ │ ├── ztypes_netbsd_arm64.go │ │ │ ├── ztypes_openbsd_386.go │ │ │ ├── ztypes_openbsd_amd64.go │ │ │ ├── ztypes_openbsd_arm.go │ │ │ ├── ztypes_openbsd_arm64.go │ │ │ └── ztypes_solaris_amd64.go │ │ └── windows/ │ │ ├── aliases.go │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── asm_windows_arm.s │ │ ├── dll_windows.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── memory_windows.go │ │ ├── mkerrors.bash │ │ ├── mkknownfolderids.bash │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_windows.go │ │ ├── types_windows.go │ │ ├── types_windows_386.go │ │ ├── types_windows_amd64.go │ │ ├── types_windows_arm.go │ │ ├── zerrors_windows.go │ │ ├── zknownfolderids_windows.go │ │ └── zsyscall_windows.go │ ├── text/ │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── secure/ │ │ │ └── bidirule/ │ │ │ ├── bidirule.go │ │ │ ├── bidirule10.0.0.go │ │ │ └── bidirule9.0.0.go │ │ ├── transform/ │ │ │ └── transform.go │ │ └── unicode/ │ │ ├── bidi/ │ │ │ ├── bidi.go │ │ │ ├── bracket.go │ │ │ ├── core.go │ │ │ ├── prop.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ └── trieval.go │ │ └── norm/ │ │ ├── composition.go │ │ ├── forminfo.go │ │ ├── input.go │ │ ├── iter.go │ │ ├── normalize.go │ │ ├── readwriter.go │ │ ├── tables10.0.0.go │ │ ├── tables9.0.0.go │ │ ├── transform.go │ │ └── trie.go │ └── time/ │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ └── rate/ │ ├── rate.go │ ├── rate_go16.go │ └── rate_go17.go ├── google.golang.org/ │ ├── appengine/ │ │ ├── LICENSE │ │ ├── internal/ │ │ │ ├── api.go │ │ │ ├── api_classic.go │ │ │ ├── api_common.go │ │ │ ├── app_id.go │ │ │ ├── base/ │ │ │ │ ├── api_base.pb.go │ │ │ │ └── api_base.proto │ │ │ ├── datastore/ │ │ │ │ ├── datastore_v3.pb.go │ │ │ │ └── datastore_v3.proto │ │ │ ├── identity.go │ │ │ ├── identity_classic.go │ │ │ ├── identity_flex.go │ │ │ ├── identity_vm.go │ │ │ ├── internal.go │ │ │ ├── log/ │ │ │ │ ├── log_service.pb.go │ │ │ │ └── log_service.proto │ │ │ ├── main.go │ │ │ ├── main_common.go │ │ │ ├── main_vm.go │ │ │ ├── metadata.go │ │ │ ├── net.go │ │ │ ├── regen.sh │ │ │ ├── remote_api/ │ │ │ │ ├── remote_api.pb.go │ │ │ │ └── remote_api.proto │ │ │ ├── transaction.go │ │ │ └── urlfetch/ │ │ │ ├── urlfetch_service.pb.go │ │ │ └── urlfetch_service.proto │ │ └── urlfetch/ │ │ └── urlfetch.go │ ├── genproto/ │ │ ├── LICENSE │ │ └── googleapis/ │ │ └── rpc/ │ │ └── status/ │ │ └── status.pb.go │ └── grpc/ │ ├── .travis.yml │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── backoff.go │ ├── balancer/ │ │ ├── balancer.go │ │ ├── base/ │ │ │ ├── balancer.go │ │ │ └── base.go │ │ └── roundrobin/ │ │ └── roundrobin.go │ ├── balancer.go │ ├── balancer_conn_wrappers.go │ ├── balancer_v1_wrapper.go │ ├── binarylog/ │ │ └── grpc_binarylog_v1/ │ │ └── binarylog.pb.go │ ├── call.go │ ├── clientconn.go │ ├── codec.go │ ├── codegen.sh │ ├── codes/ │ │ ├── code_string.go │ │ └── codes.go │ ├── connectivity/ │ │ └── connectivity.go │ ├── credentials/ │ │ ├── credentials.go │ │ ├── internal/ │ │ │ ├── syscallconn.go │ │ │ └── syscallconn_appengine.go │ │ └── tls13.go │ ├── dialoptions.go │ ├── doc.go │ ├── encoding/ │ │ ├── encoding.go │ │ └── proto/ │ │ └── proto.go │ ├── go.mod │ ├── go.sum │ ├── grpclog/ │ │ ├── grpclog.go │ │ ├── logger.go │ │ └── loggerv2.go │ ├── health/ │ │ └── grpc_health_v1/ │ │ └── health.pb.go │ ├── install_gae.sh │ ├── interceptor.go │ ├── internal/ │ │ ├── backoff/ │ │ │ └── backoff.go │ │ ├── binarylog/ │ │ │ ├── binarylog.go │ │ │ ├── binarylog_testutil.go │ │ │ ├── env_config.go │ │ │ ├── method_logger.go │ │ │ ├── regenerate.sh │ │ │ ├── sink.go │ │ │ └── util.go │ │ ├── channelz/ │ │ │ ├── funcs.go │ │ │ ├── types.go │ │ │ ├── types_linux.go │ │ │ ├── types_nonlinux.go │ │ │ ├── util_linux.go │ │ │ └── util_nonlinux.go │ │ ├── envconfig/ │ │ │ └── envconfig.go │ │ ├── grpcrand/ │ │ │ └── grpcrand.go │ │ ├── grpcsync/ │ │ │ └── event.go │ │ ├── internal.go │ │ ├── syscall/ │ │ │ ├── syscall_linux.go │ │ │ └── syscall_nonlinux.go │ │ └── transport/ │ │ ├── bdp_estimator.go │ │ ├── controlbuf.go │ │ ├── defaults.go │ │ ├── flowcontrol.go │ │ ├── handler_server.go │ │ ├── http2_client.go │ │ ├── http2_server.go │ │ ├── http_util.go │ │ ├── log.go │ │ └── transport.go │ ├── keepalive/ │ │ └── keepalive.go │ ├── metadata/ │ │ └── metadata.go │ ├── naming/ │ │ ├── dns_resolver.go │ │ └── naming.go │ ├── peer/ │ │ └── peer.go │ ├── picker_wrapper.go │ ├── pickfirst.go │ ├── proxy.go │ ├── resolver/ │ │ ├── dns/ │ │ │ └── dns_resolver.go │ │ ├── passthrough/ │ │ │ └── passthrough.go │ │ └── resolver.go │ ├── resolver_conn_wrapper.go │ ├── rpc_util.go │ ├── server.go │ ├── service_config.go │ ├── stats/ │ │ ├── handlers.go │ │ └── stats.go │ ├── status/ │ │ └── status.go │ ├── stream.go │ ├── tap/ │ │ └── tap.go │ ├── trace.go │ ├── version.go │ └── vet.sh ├── gopkg.in/ │ ├── inf.v0/ │ │ ├── LICENSE │ │ ├── dec.go │ │ └── rounder.go │ └── yaml.v2/ │ ├── .travis.yml │ ├── LICENSE │ ├── LICENSE.libyaml │ ├── NOTICE │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── go.mod │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go ├── k8s.io/ │ ├── api/ │ │ ├── LICENSE │ │ ├── admissionregistration/ │ │ │ ├── v1alpha1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── apps/ │ │ │ ├── v1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ ├── v1beta1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ └── v1beta2/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── auditregistration/ │ │ │ └── v1alpha1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── authentication/ │ │ │ ├── v1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── authorization/ │ │ │ ├── v1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── autoscaling/ │ │ │ ├── v1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ ├── v2beta1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ └── v2beta2/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── batch/ │ │ │ ├── v1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ ├── v1beta1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ └── v2alpha1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── certificates/ │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── coordination/ │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── core/ │ │ │ └── v1/ │ │ │ ├── annotation_key_constants.go │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── objectreference.go │ │ │ ├── register.go │ │ │ ├── resource.go │ │ │ ├── taint.go │ │ │ ├── toleration.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── events/ │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── extensions/ │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── networking/ │ │ │ └── v1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── policy/ │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── rbac/ │ │ │ ├── v1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ ├── v1alpha1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── scheduling/ │ │ │ ├── v1alpha1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── settings/ │ │ │ └── v1alpha1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ └── storage/ │ │ ├── v1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── v1alpha1/ │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_swagger_doc_generated.go │ │ │ └── zz_generated.deepcopy.go │ │ └── v1beta1/ │ │ ├── doc.go │ │ ├── generated.pb.go │ │ ├── generated.proto │ │ ├── register.go │ │ ├── types.go │ │ ├── types_swagger_doc_generated.go │ │ └── zz_generated.deepcopy.go │ ├── apiextensions-apiserver/ │ │ ├── LICENSE │ │ └── pkg/ │ │ └── apis/ │ │ └── apiextensions/ │ │ ├── deepcopy.go │ │ ├── doc.go │ │ ├── helpers.go │ │ ├── register.go │ │ ├── types.go │ │ ├── types_jsonschema.go │ │ ├── v1beta1/ │ │ │ ├── conversion.go │ │ │ ├── deepcopy.go │ │ │ ├── defaults.go │ │ │ ├── doc.go │ │ │ ├── generated.pb.go │ │ │ ├── generated.proto │ │ │ ├── marshal.go │ │ │ ├── register.go │ │ │ ├── types.go │ │ │ ├── types_jsonschema.go │ │ │ ├── zz_generated.conversion.go │ │ │ ├── zz_generated.deepcopy.go │ │ │ └── zz_generated.defaults.go │ │ └── zz_generated.deepcopy.go │ ├── apimachinery/ │ │ ├── LICENSE │ │ ├── pkg/ │ │ │ ├── api/ │ │ │ │ ├── equality/ │ │ │ │ │ └── semantic.go │ │ │ │ ├── errors/ │ │ │ │ │ ├── OWNERS │ │ │ │ │ ├── doc.go │ │ │ │ │ └── errors.go │ │ │ │ ├── meta/ │ │ │ │ │ ├── OWNERS │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── firsthit_restmapper.go │ │ │ │ │ ├── help.go │ │ │ │ │ ├── interfaces.go │ │ │ │ │ ├── lazy.go │ │ │ │ │ ├── meta.go │ │ │ │ │ ├── multirestmapper.go │ │ │ │ │ ├── priority.go │ │ │ │ │ └── restmapper.go │ │ │ │ └── resource/ │ │ │ │ ├── OWNERS │ │ │ │ ├── amount.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── math.go │ │ │ │ ├── quantity.go │ │ │ │ ├── quantity_proto.go │ │ │ │ ├── scale_int.go │ │ │ │ ├── suffix.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ ├── apis/ │ │ │ │ └── meta/ │ │ │ │ ├── internalversion/ │ │ │ │ │ ├── conversion.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── register.go │ │ │ │ │ ├── types.go │ │ │ │ │ ├── zz_generated.conversion.go │ │ │ │ │ └── zz_generated.deepcopy.go │ │ │ │ ├── v1/ │ │ │ │ │ ├── OWNERS │ │ │ │ │ ├── controller_ref.go │ │ │ │ │ ├── conversion.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── duration.go │ │ │ │ │ ├── generated.pb.go │ │ │ │ │ ├── generated.proto │ │ │ │ │ ├── group_version.go │ │ │ │ │ ├── helpers.go │ │ │ │ │ ├── labels.go │ │ │ │ │ ├── meta.go │ │ │ │ │ ├── micro_time.go │ │ │ │ │ ├── micro_time_proto.go │ │ │ │ │ ├── register.go │ │ │ │ │ ├── time.go │ │ │ │ │ ├── time_proto.go │ │ │ │ │ ├── types.go │ │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ │ ├── unstructured/ │ │ │ │ │ │ ├── helpers.go │ │ │ │ │ │ ├── unstructured.go │ │ │ │ │ │ ├── unstructured_list.go │ │ │ │ │ │ └── zz_generated.deepcopy.go │ │ │ │ │ ├── watch.go │ │ │ │ │ ├── zz_generated.deepcopy.go │ │ │ │ │ └── zz_generated.defaults.go │ │ │ │ └── v1beta1/ │ │ │ │ ├── conversion.go │ │ │ │ ├── deepcopy.go │ │ │ │ ├── doc.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── types_swagger_doc_generated.go │ │ │ │ ├── zz_generated.deepcopy.go │ │ │ │ └── zz_generated.defaults.go │ │ │ ├── conversion/ │ │ │ │ ├── converter.go │ │ │ │ ├── deep_equal.go │ │ │ │ ├── doc.go │ │ │ │ ├── helper.go │ │ │ │ └── queryparams/ │ │ │ │ ├── convert.go │ │ │ │ └── doc.go │ │ │ ├── fields/ │ │ │ │ ├── doc.go │ │ │ │ ├── fields.go │ │ │ │ ├── requirements.go │ │ │ │ └── selector.go │ │ │ ├── labels/ │ │ │ │ ├── doc.go │ │ │ │ ├── labels.go │ │ │ │ ├── selector.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ ├── runtime/ │ │ │ │ ├── codec.go │ │ │ │ ├── codec_check.go │ │ │ │ ├── conversion.go │ │ │ │ ├── converter.go │ │ │ │ ├── doc.go │ │ │ │ ├── embedded.go │ │ │ │ ├── error.go │ │ │ │ ├── extension.go │ │ │ │ ├── generated.pb.go │ │ │ │ ├── generated.proto │ │ │ │ ├── helper.go │ │ │ │ ├── interfaces.go │ │ │ │ ├── register.go │ │ │ │ ├── schema/ │ │ │ │ │ ├── generated.pb.go │ │ │ │ │ ├── generated.proto │ │ │ │ │ ├── group_version.go │ │ │ │ │ └── interfaces.go │ │ │ │ ├── scheme.go │ │ │ │ ├── scheme_builder.go │ │ │ │ ├── serializer/ │ │ │ │ │ ├── codec_factory.go │ │ │ │ │ ├── json/ │ │ │ │ │ │ ├── json.go │ │ │ │ │ │ └── meta.go │ │ │ │ │ ├── negotiated_codec.go │ │ │ │ │ ├── protobuf/ │ │ │ │ │ │ ├── doc.go │ │ │ │ │ │ └── protobuf.go │ │ │ │ │ ├── protobuf_extension.go │ │ │ │ │ ├── recognizer/ │ │ │ │ │ │ └── recognizer.go │ │ │ │ │ ├── streaming/ │ │ │ │ │ │ └── streaming.go │ │ │ │ │ └── versioning/ │ │ │ │ │ └── versioning.go │ │ │ │ ├── swagger_doc_generator.go │ │ │ │ ├── types.go │ │ │ │ ├── types_proto.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ ├── selection/ │ │ │ │ └── operator.go │ │ │ ├── types/ │ │ │ │ ├── doc.go │ │ │ │ ├── namespacedname.go │ │ │ │ ├── nodename.go │ │ │ │ ├── patch.go │ │ │ │ └── uid.go │ │ │ ├── util/ │ │ │ │ ├── cache/ │ │ │ │ │ ├── cache.go │ │ │ │ │ └── lruexpirecache.go │ │ │ │ ├── clock/ │ │ │ │ │ └── clock.go │ │ │ │ ├── diff/ │ │ │ │ │ └── diff.go │ │ │ │ ├── errors/ │ │ │ │ │ ├── doc.go │ │ │ │ │ └── errors.go │ │ │ │ ├── framer/ │ │ │ │ │ └── framer.go │ │ │ │ ├── intstr/ │ │ │ │ │ ├── generated.pb.go │ │ │ │ │ ├── generated.proto │ │ │ │ │ └── intstr.go │ │ │ │ ├── json/ │ │ │ │ │ └── json.go │ │ │ │ ├── naming/ │ │ │ │ │ └── from_stack.go │ │ │ │ ├── net/ │ │ │ │ │ ├── http.go │ │ │ │ │ ├── interface.go │ │ │ │ │ ├── port_range.go │ │ │ │ │ ├── port_split.go │ │ │ │ │ └── util.go │ │ │ │ ├── rand/ │ │ │ │ │ └── rand.go │ │ │ │ ├── runtime/ │ │ │ │ │ └── runtime.go │ │ │ │ ├── sets/ │ │ │ │ │ ├── byte.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── empty.go │ │ │ │ │ ├── int.go │ │ │ │ │ ├── int64.go │ │ │ │ │ └── string.go │ │ │ │ ├── validation/ │ │ │ │ │ ├── field/ │ │ │ │ │ │ ├── errors.go │ │ │ │ │ │ └── path.go │ │ │ │ │ └── validation.go │ │ │ │ ├── wait/ │ │ │ │ │ ├── doc.go │ │ │ │ │ └── wait.go │ │ │ │ └── yaml/ │ │ │ │ └── decoder.go │ │ │ ├── version/ │ │ │ │ ├── doc.go │ │ │ │ ├── helpers.go │ │ │ │ └── types.go │ │ │ └── watch/ │ │ │ ├── doc.go │ │ │ ├── filter.go │ │ │ ├── mux.go │ │ │ ├── streamwatcher.go │ │ │ ├── watch.go │ │ │ └── zz_generated.deepcopy.go │ │ └── third_party/ │ │ └── forked/ │ │ └── golang/ │ │ └── reflect/ │ │ └── deep_equal.go │ ├── client-go/ │ │ ├── LICENSE │ │ ├── discovery/ │ │ │ ├── cached_discovery.go │ │ │ ├── discovery_client.go │ │ │ ├── doc.go │ │ │ ├── helper.go │ │ │ └── round_tripper.go │ │ ├── kubernetes/ │ │ │ ├── clientset.go │ │ │ ├── doc.go │ │ │ ├── import.go │ │ │ ├── scheme/ │ │ │ │ ├── doc.go │ │ │ │ └── register.go │ │ │ └── typed/ │ │ │ ├── admissionregistration/ │ │ │ │ ├── v1alpha1/ │ │ │ │ │ ├── admissionregistration_client.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ └── initializerconfiguration.go │ │ │ │ └── v1beta1/ │ │ │ │ ├── admissionregistration_client.go │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── mutatingwebhookconfiguration.go │ │ │ │ └── validatingwebhookconfiguration.go │ │ │ ├── apps/ │ │ │ │ ├── v1/ │ │ │ │ │ ├── apps_client.go │ │ │ │ │ ├── controllerrevision.go │ │ │ │ │ ├── daemonset.go │ │ │ │ │ ├── deployment.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ ├── replicaset.go │ │ │ │ │ └── statefulset.go │ │ │ │ ├── v1beta1/ │ │ │ │ │ ├── apps_client.go │ │ │ │ │ ├── controllerrevision.go │ │ │ │ │ ├── deployment.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ └── statefulset.go │ │ │ │ └── v1beta2/ │ │ │ │ ├── apps_client.go │ │ │ │ ├── controllerrevision.go │ │ │ │ ├── daemonset.go │ │ │ │ ├── deployment.go │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── replicaset.go │ │ │ │ └── statefulset.go │ │ │ ├── auditregistration/ │ │ │ │ └── v1alpha1/ │ │ │ │ ├── auditregistration_client.go │ │ │ │ ├── auditsink.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ ├── authentication/ │ │ │ │ ├── v1/ │ │ │ │ │ ├── authentication_client.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ ├── tokenreview.go │ │ │ │ │ └── tokenreview_expansion.go │ │ │ │ └── v1beta1/ │ │ │ │ ├── authentication_client.go │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── tokenreview.go │ │ │ │ └── tokenreview_expansion.go │ │ │ ├── authorization/ │ │ │ │ ├── v1/ │ │ │ │ │ ├── authorization_client.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ ├── localsubjectaccessreview.go │ │ │ │ │ ├── localsubjectaccessreview_expansion.go │ │ │ │ │ ├── selfsubjectaccessreview.go │ │ │ │ │ ├── selfsubjectaccessreview_expansion.go │ │ │ │ │ ├── selfsubjectrulesreview.go │ │ │ │ │ ├── selfsubjectrulesreview_expansion.go │ │ │ │ │ ├── subjectaccessreview.go │ │ │ │ │ └── subjectaccessreview_expansion.go │ │ │ │ └── v1beta1/ │ │ │ │ ├── authorization_client.go │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── localsubjectaccessreview.go │ │ │ │ ├── localsubjectaccessreview_expansion.go │ │ │ │ ├── selfsubjectaccessreview.go │ │ │ │ ├── selfsubjectaccessreview_expansion.go │ │ │ │ ├── selfsubjectrulesreview.go │ │ │ │ ├── selfsubjectrulesreview_expansion.go │ │ │ │ ├── subjectaccessreview.go │ │ │ │ └── subjectaccessreview_expansion.go │ │ │ ├── autoscaling/ │ │ │ │ ├── v1/ │ │ │ │ │ ├── autoscaling_client.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ └── horizontalpodautoscaler.go │ │ │ │ ├── v2beta1/ │ │ │ │ │ ├── autoscaling_client.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ └── horizontalpodautoscaler.go │ │ │ │ └── v2beta2/ │ │ │ │ ├── autoscaling_client.go │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ └── horizontalpodautoscaler.go │ │ │ ├── batch/ │ │ │ │ ├── v1/ │ │ │ │ │ ├── batch_client.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ └── job.go │ │ │ │ ├── v1beta1/ │ │ │ │ │ ├── batch_client.go │ │ │ │ │ ├── cronjob.go │ │ │ │ │ ├── doc.go │ │ │ │ │ └── generated_expansion.go │ │ │ │ └── v2alpha1/ │ │ │ │ ├── batch_client.go │ │ │ │ ├── cronjob.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ ├── certificates/ │ │ │ │ └── v1beta1/ │ │ │ │ ├── certificates_client.go │ │ │ │ ├── certificatesigningrequest.go │ │ │ │ ├── certificatesigningrequest_expansion.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ ├── coordination/ │ │ │ │ └── v1beta1/ │ │ │ │ ├── coordination_client.go │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ └── lease.go │ │ │ ├── core/ │ │ │ │ └── v1/ │ │ │ │ ├── componentstatus.go │ │ │ │ ├── configmap.go │ │ │ │ ├── core_client.go │ │ │ │ ├── doc.go │ │ │ │ ├── endpoints.go │ │ │ │ ├── event.go │ │ │ │ ├── event_expansion.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── limitrange.go │ │ │ │ ├── namespace.go │ │ │ │ ├── namespace_expansion.go │ │ │ │ ├── node.go │ │ │ │ ├── node_expansion.go │ │ │ │ ├── persistentvolume.go │ │ │ │ ├── persistentvolumeclaim.go │ │ │ │ ├── pod.go │ │ │ │ ├── pod_expansion.go │ │ │ │ ├── podtemplate.go │ │ │ │ ├── replicationcontroller.go │ │ │ │ ├── resourcequota.go │ │ │ │ ├── secret.go │ │ │ │ ├── service.go │ │ │ │ ├── service_expansion.go │ │ │ │ ├── serviceaccount.go │ │ │ │ └── serviceaccount_expansion.go │ │ │ ├── events/ │ │ │ │ └── v1beta1/ │ │ │ │ ├── doc.go │ │ │ │ ├── event.go │ │ │ │ ├── events_client.go │ │ │ │ └── generated_expansion.go │ │ │ ├── extensions/ │ │ │ │ └── v1beta1/ │ │ │ │ ├── daemonset.go │ │ │ │ ├── deployment.go │ │ │ │ ├── deployment_expansion.go │ │ │ │ ├── doc.go │ │ │ │ ├── extensions_client.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── ingress.go │ │ │ │ ├── podsecuritypolicy.go │ │ │ │ └── replicaset.go │ │ │ ├── networking/ │ │ │ │ └── v1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── networking_client.go │ │ │ │ └── networkpolicy.go │ │ │ ├── policy/ │ │ │ │ └── v1beta1/ │ │ │ │ ├── doc.go │ │ │ │ ├── eviction.go │ │ │ │ ├── eviction_expansion.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── poddisruptionbudget.go │ │ │ │ ├── podsecuritypolicy.go │ │ │ │ └── policy_client.go │ │ │ ├── rbac/ │ │ │ │ ├── v1/ │ │ │ │ │ ├── clusterrole.go │ │ │ │ │ ├── clusterrolebinding.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ ├── rbac_client.go │ │ │ │ │ ├── role.go │ │ │ │ │ └── rolebinding.go │ │ │ │ ├── v1alpha1/ │ │ │ │ │ ├── clusterrole.go │ │ │ │ │ ├── clusterrolebinding.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ ├── rbac_client.go │ │ │ │ │ ├── role.go │ │ │ │ │ └── rolebinding.go │ │ │ │ └── v1beta1/ │ │ │ │ ├── clusterrole.go │ │ │ │ ├── clusterrolebinding.go │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── rbac_client.go │ │ │ │ ├── role.go │ │ │ │ └── rolebinding.go │ │ │ ├── scheduling/ │ │ │ │ ├── v1alpha1/ │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── generated_expansion.go │ │ │ │ │ ├── priorityclass.go │ │ │ │ │ └── scheduling_client.go │ │ │ │ └── v1beta1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── priorityclass.go │ │ │ │ └── scheduling_client.go │ │ │ ├── settings/ │ │ │ │ └── v1alpha1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── podpreset.go │ │ │ │ └── settings_client.go │ │ │ └── storage/ │ │ │ ├── v1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── storage_client.go │ │ │ │ ├── storageclass.go │ │ │ │ └── volumeattachment.go │ │ │ ├── v1alpha1/ │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ ├── storage_client.go │ │ │ │ └── volumeattachment.go │ │ │ └── v1beta1/ │ │ │ ├── doc.go │ │ │ ├── generated_expansion.go │ │ │ ├── storage_client.go │ │ │ ├── storageclass.go │ │ │ └── volumeattachment.go │ │ ├── pkg/ │ │ │ ├── apis/ │ │ │ │ └── clientauthentication/ │ │ │ │ ├── OWNERS │ │ │ │ ├── doc.go │ │ │ │ ├── register.go │ │ │ │ ├── types.go │ │ │ │ ├── v1alpha1/ │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── register.go │ │ │ │ │ ├── types.go │ │ │ │ │ ├── zz_generated.conversion.go │ │ │ │ │ ├── zz_generated.deepcopy.go │ │ │ │ │ └── zz_generated.defaults.go │ │ │ │ ├── v1beta1/ │ │ │ │ │ ├── conversion.go │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── register.go │ │ │ │ │ ├── types.go │ │ │ │ │ ├── zz_generated.conversion.go │ │ │ │ │ ├── zz_generated.deepcopy.go │ │ │ │ │ └── zz_generated.defaults.go │ │ │ │ └── zz_generated.deepcopy.go │ │ │ └── version/ │ │ │ ├── .gitattributes │ │ │ ├── base.go │ │ │ ├── def.bzl │ │ │ ├── doc.go │ │ │ └── version.go │ │ ├── plugin/ │ │ │ └── pkg/ │ │ │ └── client/ │ │ │ └── auth/ │ │ │ └── exec/ │ │ │ └── exec.go │ │ ├── rest/ │ │ │ ├── OWNERS │ │ │ ├── client.go │ │ │ ├── config.go │ │ │ ├── plugin.go │ │ │ ├── request.go │ │ │ ├── transport.go │ │ │ ├── url_utils.go │ │ │ ├── urlbackoff.go │ │ │ ├── watch/ │ │ │ │ ├── decoder.go │ │ │ │ └── encoder.go │ │ │ └── zz_generated.deepcopy.go │ │ ├── tools/ │ │ │ ├── auth/ │ │ │ │ ├── OWNERS │ │ │ │ └── clientauth.go │ │ │ ├── cache/ │ │ │ │ ├── OWNERS │ │ │ │ ├── controller.go │ │ │ │ ├── delta_fifo.go │ │ │ │ ├── doc.go │ │ │ │ ├── expiration_cache.go │ │ │ │ ├── expiration_cache_fakes.go │ │ │ │ ├── fake_custom_store.go │ │ │ │ ├── fifo.go │ │ │ │ ├── heap.go │ │ │ │ ├── index.go │ │ │ │ ├── listers.go │ │ │ │ ├── listwatch.go │ │ │ │ ├── mutation_cache.go │ │ │ │ ├── mutation_detector.go │ │ │ │ ├── reflector.go │ │ │ │ ├── reflector_metrics.go │ │ │ │ ├── shared_informer.go │ │ │ │ ├── store.go │ │ │ │ ├── thread_safe_store.go │ │ │ │ └── undelta_store.go │ │ │ ├── clientcmd/ │ │ │ │ ├── api/ │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── helpers.go │ │ │ │ │ ├── latest/ │ │ │ │ │ │ └── latest.go │ │ │ │ │ ├── register.go │ │ │ │ │ ├── types.go │ │ │ │ │ ├── v1/ │ │ │ │ │ │ ├── conversion.go │ │ │ │ │ │ ├── doc.go │ │ │ │ │ │ ├── register.go │ │ │ │ │ │ ├── types.go │ │ │ │ │ │ └── zz_generated.deepcopy.go │ │ │ │ │ └── zz_generated.deepcopy.go │ │ │ │ ├── auth_loaders.go │ │ │ │ ├── client_config.go │ │ │ │ ├── config.go │ │ │ │ ├── doc.go │ │ │ │ ├── flag.go │ │ │ │ ├── helpers.go │ │ │ │ ├── loader.go │ │ │ │ ├── merged_client_builder.go │ │ │ │ ├── overrides.go │ │ │ │ └── validation.go │ │ │ ├── metrics/ │ │ │ │ ├── OWNERS │ │ │ │ └── metrics.go │ │ │ ├── pager/ │ │ │ │ └── pager.go │ │ │ └── reference/ │ │ │ └── ref.go │ │ ├── transport/ │ │ │ ├── OWNERS │ │ │ ├── cache.go │ │ │ ├── config.go │ │ │ ├── round_trippers.go │ │ │ ├── token_source.go │ │ │ └── transport.go │ │ └── util/ │ │ ├── buffer/ │ │ │ └── ring_growing.go │ │ ├── cert/ │ │ │ ├── OWNERS │ │ │ ├── cert.go │ │ │ ├── csr.go │ │ │ ├── io.go │ │ │ └── pem.go │ │ ├── connrotation/ │ │ │ └── connrotation.go │ │ ├── flowcontrol/ │ │ │ ├── backoff.go │ │ │ └── throttle.go │ │ ├── homedir/ │ │ │ └── homedir.go │ │ ├── integer/ │ │ │ └── integer.go │ │ └── retry/ │ │ ├── OWNERS │ │ └── util.go │ └── klog/ │ ├── .travis.yml │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── OWNERS │ ├── README.md │ ├── RELEASE.md │ ├── SECURITY_CONTACTS │ ├── code-of-conduct.md │ ├── klog.go │ └── klog_file.go ├── modules.txt └── sigs.k8s.io/ └── yaml/ ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── OWNERS ├── README.md ├── RELEASE.md ├── SECURITY_CONTACTS ├── code-of-conduct.md ├── fields.go ├── yaml.go └── yaml_go110.go ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ cmd/bootkube/bootkube *.so _output _pluton_temp vendor-v[0-9].[0-9].[0-9]/ hack/*/.vagrant/ hack/*/cluster/ hack/*/ssh_config hack/*/.terraform* hack/*/terraform.tfstate* hack/*/terraform.tfvars # e2e tests touch these hack/terraform-quickstart/terraform hack/terraform*tar.gz e2e/logs ================================================ FILE: .travis.yml ================================================ language: go before_script: - wget https://releases.hashicorp.com/terraform/0.11.3/terraform_0.11.3_linux_amd64.zip - unzip terraform_0.11.3_linux_amd64.zip - export PATH=$PWD:$PATH go: - 1.13.x script: - make release ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing guidelines ## How to become a contributor and submit your own code ### Contributor License Agreements We'd love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles. Please fill out either the individual or corporate Contributor License Agreement (CLA). * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](https://identity.linuxfoundation.org/node/285/node/285/individual-signup). * If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](https://identity.linuxfoundation.org/node/285/organization-signup). Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests. ### Contributing A Patch 1. Submit an issue describing your proposed change to the repo in question. 1. The [repo owners](OWNERS) will respond to your issue promptly. 1. If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above). 1. Fork the desired repo, develop and test your code changes. 1. Submit a pull request. ### Adding dependencies If your patch depends on new packages, add that package with [`godep`](https://github.com/tools/godep). Follow the [instructions to add a dependency](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md#godep-and-dependency-management). ================================================ FILE: Documentation/alpha-features.md ================================================ # Alpha Features Tracking document for alpha features that bootkube installed clusters may make use of. We track these alpha features as their behavior may change or be deprecated between Kubernetes versions. Therefore clusters that use these features need to keep track of any potential changes in upstream releases. See the upstream [api versioning documentation](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api_changes.md#alpha-beta-and-stable-versions) for more information. ### TolerateUnreadyEndpointsAnnotation Used by the etcd service object when self-hosted etcd cluster is enabled. This alpha annotation will retain the endpoints even if the etcd pod isn't ready. This feature is always enabled in endpoint controller in k8s even it is alpha. References: - https://github.com/kubernetes-sigs/bootkube/issues/599 - https://github.com/kubernetes-sigs/bootkube/pull/626#issuecomment-313187659 ================================================ FILE: Documentation/design-principles.md ================================================ # Design Principles There are exceptions to these principles, but these are general guidelines the project strives to adhere to. ## General - Bootkube should be a single-use tool, which only runs on the first node in a cluster. - An exception is the `recover` subcommand, discussed below. - Bootkube should not be required to add new nodes to an existing cluster. - For example, adding nodes should not require a `bootkube join` command. - Ideally all that should be required to add a node is starting the kubelet and providing a valid kubeconfig. - Configuration beyond the initial kubeconfig should be sourced from API objects. For example, the pod network is configured via CNI daemonset. - Should not require flag or configuration coordination between the `render` and `start` steps. - Required flag coordination means certain `render` assets will only work with certain `start` flags, and this is something we should avoid. - For example, `bootkube render --self-hosted-etcd` requires no changes when ultimately running `bootkube start`. - Avoid adding feature flags as much as possible. This makes testing & stability very difficult to maintain. - Users customize their cluster by modifying the output of `bootkube render` to fit their configuration. Users can generate their own assets for use with `bootkube start`, subject to following a small number of conventions. - Complex rendering needs can be handled by custom rendering tools. - For example, the [CoreOS Tectonic Installer](https://github.com/coreos/tectonic-installer) performs its own rendering step, but utilizes `bootkube start` to launch the cluster. - Launching compute resources is out of scope. Bootkube merely provides quickstart examples, but should not be prescriptive. ## Bootkube Render - Bootkube is not meant to be a fully-featured rendering engine. There are much better tools for this - we shouldn't write yet another. - Bootkube render should be considered a useful starting point, which generates assets utilizing latest versions and best-practices. - Should render assets for the most recent upstream release. If another version is desired, this can be left to the user to modify in their rendered templates. - Should avoid using upstream alpha features, and instead allow a user to enable these on a case-by-case basis. - Adding new configuration flags should be avoided. Instead users can customize the output and/or use an external rendering tool. ## Bootkube Start - Should be able to launch a cluster by only specifying an `--asset-dir`. - Should be agnostic to the version of kubernetes cluster that is being launched. - Should strive toward idempotent bootstrap operation. - Although, this is not currently the case when bootstrapping with self-hosted etcd. ## Bootkube Recovery - When running recovery, only a valid `kubeconfig` should be required (and in some cases may not be needed). - The latest version of the recovery tool should strive to be able to recover all previously installed versions (no coupling between recovery process, and time of installation). ## Hack Directory - Provides simple options for local development on bootkube - Provide simple / non-production examples for some cloud providers. - Should not be prescriptive of how production compute should be launched or managed (e.g. Adding nodes, firewall rules, etc.) ================================================ FILE: Documentation/development.md ================================================ # Bootkube Development ## Requirements * Go 1.10+ ## Building First, clone the repo into the proper location in your [`GOPATH`][GOPATH]: ``` go get -u github.com/kubernetes-sigs/bootkube cd $(go env GOPATH | cut -d: -f1)/src/github.com/kubernetes-sigs/bootkube ``` Then build: ``` make clean make all ``` ## Local Development Environments To easily launch local, single-node vagrant development clusters: ``` make clean-vm-single make run-single ``` You can also launch a multi-node cluster: ``` make clean-vm-multi make run-multi ``` Each of these commands will recompile bootkube, then render new assets and provision a new cluster. Additionally, if you wish to run upstream Kubernetes conformance tests against these local clusters: ``` make conformance-single ``` ``` make conformance-multi ``` ## Running PR Tests The basic test suite should run automatically on PRs, but can also be triggered manually. Jobs prefixed with `tku-` are running on the new Jenkins instance. Commenting on the PR: - `ok to test`: whitelists an external contributor's PR as safe to test. - `coreosbot run [job_name]`: re-runs the named job. The job name is always the same as the build context reported to GitHub. So if there is a failed build for `tku-bootkube-e2e-calico`, you can re-trigger it by commenting, `coreosbot run tku-bootkube-e2e-calico`. ## Running PR Tests (legacy Jenkins) The basic test suite should run automatically on PRs, but can also be triggered manually. Commenting on the PR: * `ok to test`: whitelists an external contributor's PR as safe to test. * `coreosbot run e2e`: re-runs the end-to-end test suite. * `coreosbot run e2e calico`: re-runs the Calico end-to-end test suite. * `coreosbot run e2e checkpointer`: can be used to specifically test new checkpointer code. * This will build a new checkpointer image from the PR, and includes that image as part of the checkpointer daemonset. * `coreosbot run conformance`: run upstream Kubernetes conformance tests [GOPATH]: https://golang.org/cmd/go/#hdr-GOPATH_environment_variable ================================================ FILE: Documentation/disaster-recovery.md ================================================ # Disaster Recovery Self-hosted Kubernetes clusters are vulnerable to the following catastrophic failure scenarios: - Loss of all api-servers - Loss of all schedulers - Loss of all controller-managers - Loss of all self-hosted etcd nodes To minimize the likelihood of any of the these scenarios, production self-hosted clusters should always run in a high-availability configuration (**TODO:** [add documentation for running high-availability self-hosted clusters](https://github.com/kubernetes-sigs/bootkube/issues/311)). Nevertheless, in the event of a control plane loss the bootkube project provides limited disaster avoidance and recovery support through the `pod-checkpointer` program and the `bootkube recover` subcommand. ## Pod Checkpointer The Pod Checkpointer is a program that ensures that existing local pod state can be recovered in the absence of an api-server. This is accomplished by managing "checkpoints" of local pod state as static pod manifests: - When the checkpointer sees that a "parent pod" (a pod which should be checkpointed), is successfully running, the checkpointer will save a local copy of the manifest. - If the parent pod is detected as no longer running, the checkpointer will "activate" the checkpoint manifest. It will allow the checkpoint to continue running until the parent-pod is restarted on the local node, or it is able to contact an api-server to determine that the parent pod is no longer scheduled to this node. A Pod Checkpointer DaemonSet is deployed by default when using `bootkube render` to create cluster manifests. Using the Pod Checkpointer is highly recommended for all self-hosted clusters to ensure node reboot resiliency. For more information, see the [Pod Checkpointer README](https://github.com/kubernetes-sigs/bootkube/blob/master/cmd/checkpoint/README.md). ## Bootkube Recover In the event of partial or total self-hosted control plane loss, `bootkube recover` may be able to assist in re-bootstrapping the self-hosted control plane. The `bootkube recover` subcommand does not recover a cluster directly. The recovery is a two step process: `bootkube recover` then `bootkube start`. The recovery command extracts the control plane configuration from an available source and renders manifests to the local filesystem. These resulting manifests can be passed to `bootkube start`. There are two available sources to choose from in `recover`: etcd or API server. ### What does bootkube recover do? `bootkube recover`attempts to read the configuration from an existing backend etcd or API server. On success, `bootkube recover` writes manifests for a modified bootstrap control plane to a directory. The second phase of the recover can be initiated by an administrator by running `bootkube start` on these manifests. `bootkube recover` modifies bootstrap pod specs in the following ways: * Ensure the pod runs as root * Ensure the container runs as root * Change Secret volume mounts to point to file mounts * Change ConfigMaps volume mounts to point to file mounts * Ensures the commandline of the containers contains --kubeconfig=/kubeconfig/kubeconfig * Add a mount for the kubeconfig Assets include: * Bootstrap Daemonsets * Bootstrap Deployments * Required ConfigMaps * Required Secrets By running `bootkube start` to recover the cluster, `bootkube start` will automatically tear down the recovery control plane. ### bootkube recover usage For best results always use the most recently tagged Bootkube release when using `recover`, regardless of which release was used to create the cluster. To see the available releases, checkout [the tagged binary releases on GitHub](https://github.com/kubernetes-sigs/bootkube/releases) or [the tagged Docker images on Quay.io](https://quay.io/repository/coreos/bootkube). To see available options, run: ``` bootkube recover --help ``` To recover a cluster, first invoke `bootkube recover` with flags corresponding to the current state of the cluster (supported states listed below). Then, invoke `bootkube start` to reboot the cluster. For example: ``` scp bootkube user@master-node: ssh user@master-node ./bootkube recover --recovery-dir=recovered [scenario-specific options] sudo ./bootkube start --asset-dir=recovered ``` Note: the `bootkube start` invocation will print the following warning message: ``` WARNING: recovered/manifests does not exist, not creating any self-hosted assets. ``` This message can be safely ignored. It is printed because recovery does not attempt to recreate self-hosted assets; it only runs a temporary control plane to allow the self-hosted control plane to recover itself. For complete recovery examples see the [hack/multi-node/bootkube-test-recovery](https://github.com/kubernetes-sigs/bootkube/blob/master/hack/multi-node/bootkube-test-recovery) and [![asciicast](https://asciinema.org/a/dsp43ziuuzwcztni94y8l25s5.png)](https://asciinema.org/a/dsp43ziuuzwcztni94y8l25s5) ### If an api-server is still running If an api-server is still running but other control plane components are down, preventing cluster functionality (i.e. the scheduler pods are all down), the control plane can be extracted directly from the api-server: ``` bootkube recover --recovery-dir=recovered --kubeconfig=/etc/kubernetes/kubeconfig ``` ### If an external etcd cluster is still running If using an external etcd cluster, the control plane can be extracted directly from etcd: ``` bootkube recover --recovery-dir=recovered --etcd-servers=http://127.0.0.1:2379 --kubeconfig=/etc/kubernetes/kubeconfig ``` ### If an etcd backup is available (non-self-hosted etcd) First, recover the external etcd cluster from the backup. Then use the method described in the previous section to recover the control plane manifests. ================================================ FILE: Documentation/network-requirements.md ================================================ # Requirements ## Ports The information below describes a minimum set of port allocations used by Kubernetes components. ### Master node(s) ingress | Protocol | Port Range | Source | Purpose | -----------|------------|-------------------------------------------|------------------------| | TCP | 443 | Worker Nodes, API Requests, and End-Users | Kubernetes API server. | | UDP | 4789 | Master & Worker Nodes | flannel overlay network - *vxlan backend* | ### etcd node(s) ingress | Protocol | Port Range | Source | Purpose | -----------|------------|-----------------------|--------------------------------------------------| | TCP | 2379-2380 | Master & Worker Nodes | etcd server client API | ### Worker node(s) ingress | Protocol | Port Range | Source | Purpose | -----------|-------------|--------------------------------|------------------------------------------------------------------------| | TCP | 4194 | Master & Worker Nodes | The port of the localhost cAdvisor endpoint | | UDP | 4789 | Master & Worker Nodes | flannel overlay network - *vxlan backend* | | TCP | 10250 | Master Nodes | Worker node Kubelet API for exec and logs. | | TCP | 10255 | Master & Worker Nodes | Worker node read-only Kubelet API (Heapster). | | TCP | 30000-32767 | External Application Consumers | Default port range for [external service][https://kubernetes.io/docs/concepts/services-networking/service] ports. Typically, these ports would need to be exposed to external load-balancers, or other external consumers of the application itself. | ================================================ FILE: Documentation/root-requirements.md ================================================ # Information about services running as root Running services as a non-root user is typically better for security, since permissions can be controlled. Some Kubernetes services can be run as a non-root user, but most require root privileges in some manner. This document will try out outline why certain Kubernetes services require root privileges. ## Services that do *not* run as root * Scheduler * Controller Manager ## Services requiring root ### Flannel Flannel is a layer 3 network fabric. Flannel needs access to low level networking interfaces to be able to dynamically configure them. ### Proxy kube-proxy is a network proxy found on every Kubernetes node. Kube-proxy often needs to open and manage privileged ports (< 1024) in addition to managing iptables. ### DNS DNS needs to bind to privileged port 53 for UDP and TCP. ### Checkpointer Checkpointer is a service to recover a cluster after a reboot or loss of a node. This service writes to `/etc/kubernetes/manifests`. ================================================ FILE: Documentation/upgrading.md ================================================ # Upgrading self-hosted Kubernetes "Self-hosted" Kubernetes clusters run the apiserver, scheduler, controller-manager, kube-dns, kube-proxy, and flannel or calico as pods, like ordinary applications. This allows upgrades to be performed in-place using (mostly) `kubectl`, as an alternative to re-provisioning. Let's upgrade a Kubernetes v1.6.6 cluster to v1.6.7 as an example. ## Status The process of in-place upgrading a self-hosted Kubernetes cluster can be straight-forward, but there may be complex underlying changes that affect your cluster. In most cases, patch version upgrades (e.g. v1.6.6 to v1.6.7) are safe. Before beginning an upgrade, it is recommended you evaluate if an in-place upgrade is appropriate for your Kubernetes cluster and risk tolerance. You may wish to test the in-place upgrade on a development cluster, failover important workloads to another cluster, or be prepared to handle unforseen issues. ## Prepare Find the diff between bootkube assets generated for the existing cluster version and the desired version. This depends on the tool used to generate assets: * Github [compare](https://github.com/kubernetes-sigs/bootkube/compare/v0.5.0...v0.5.1) changes between the existing and desired versions and infer the appropriate cluster changes. * [bootkube render](https://github.com/kubernetes-sigs/bootkube) - Install the `bootkube` binaries for the existing and desired versions. Render assets to different locations with each binary and diff the assets. * [External Tools](users-integrations.md) - Check the docs for the external tool and compare assets generated for each version. In simple cases, you may only need to bump the version of a few images. In more complex cases, there may be entirely new components, configuration, or flags. ## Inspect Check the current Kubernetes version. ```sh $ kubectl version Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.2", GitCommit:"477efc3cbe6a7effca06bd1452fa356e2201e1ee", GitTreeState:"clean", BuildDate:"2017-04-19T20:33:11Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.6", GitCommit:"42a5c8b99c994a51d9ceaed5d0254f177e97d419", GitTreeState:"clean", BuildDate:"2017-06-21T01:10:07Z", GoVersion:"go1.7.6", Compiler:"gc", Platform:"linux/amd64"} ``` ```sh $ kubectl get nodes NAME STATUS AGE VERSION node1.example.com Ready 21d v1.6.6 node2.example.com Ready 21d v1.6.6 node3.example.com Ready 21d v1.6.6 node4.example.com Ready 21d v1.6.6 ``` ## Control Plane Show the control plane DaemonSets and Deployments that will need to be updated. ```sh $ kubectl get daemonsets -n=kube-system NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE-SELECTOR AGE kube-apiserver 1 1 1 1 1 node-role.kubernetes.io/master= 21d kube-flannel 4 4 4 4 4 21d kube-proxy 4 4 4 4 4 21d pod-checkpointer 1 1 1 1 1 node-role.kubernetes.io/master= 21d $ kubectl get deployments -n=kube-system kube-controller-manager 2 2 2 2 21d kube-dns 1 1 1 1 21d kube-scheduler 2 2 2 2 21d ``` ### kube-apiserver If only the container image version has changed, update the image with a single command. ``` kubectl set image daemonset -n kube-system kube-apiserver kube-apiserver=k8s.gcr.io/hyperkube:v1.6.7 ``` You can edit the daemonset directly if other changes are needed. ```sh $ kubectl edit daemonset kube-apiserver -n=kube-system ``` With only one apiserver, the cluster may be momentarily unavailable. ### kube-scheduler Again, if only the container image version has changed, update the image with a single command. ``` kubectl set image deployment -n kube-system kube-scheduler kube-scheduler=k8s.gcr.io/hyperkube:v1.6.7 ``` You can edit the deployment directly if other changes are needed. ```sh $ kubectl edit deployments kube-scheduler -n=kube-system ``` ### kube-controller-manager Again, if only the container image version has changed, update the image with a single command. ``` kubectl set image deployment -n kube-system kube-controller-manager kube-controller-manager=k8s.gcr.io/hyperkube:v1.6.7 ``` You can edit the deployment directly if other changes are needed. ```sh $ kubectl edit deployments -n kube-system kube-controller-manager -n=kube-system ``` ### kube-proxy Again, if only the container image version has changed, update the image with a single command. ``` kubectl set image daemonset -n kube-system kube-proxy kube-proxy=k8s.gcr.io/hyperkube:v1.6.7 ``` You can edit the deployment directly if other changes are needed. ```sh $ kubectl edit daemonset kube-proxy -n=kube-system ``` ### Others Update any other components which have changes between the existing version and desired version manifests. Update the `kube-dns` deployment, `kube-flannel` daemonset, or `pod-checkpointer` daemonset. ### Verify Verify the control plane components updated. ```sh $ kubectl version Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.2", GitCommit:"477efc3cbe6a7effca06bd1452fa356e2201e1ee", GitTreeState:"clean", BuildDate:"2017-04-19T20:33:11Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.7", GitCommit:"c8c505ee26ac3ab4d1dff506c46bc5538bc66733", GitTreeState:"clean", BuildDate:"2017-07-06T17:38:33Z", GoVersion:"go1.7.6", Compiler:"gc", Platform:"linux/amd64"} ``` Also, consider running `kubectl -n kube-system get pods` to verify all upgraded pods are running correctly. ## kubelet SSH to each node and update the `KUBELET_IMAGE_TAG` in `kubelet.service` or `/etc/kubernetes/kubelet.env`, depending on the provisioning tool used. Restart the `kubelet.service`. ```sh ssh core@node1.example.com # NOTE: KUBELET_IMAGE_TAG may not be used in both files, this is expected sudo vim /etc/systemd/system/kubelet.service sudo vim /etc/kubernetes/kubelet.env sudo systemctl restart kubelet ``` ### Verify Verify the kubelet and kube-proxy of each node updated. ```sh $ kubectl get nodes -o yaml | grep 'kubeletVersion\|kubeProxyVersion' kubeProxyVersion: v1.6.7 kubeletVersion: v1.6.7 kubeProxyVersion: v1.6.7 kubeletVersion: v1.6.7 kubeProxyVersion: v1.6.7 kubeletVersion: v1.6.7 kubeProxyVersion: v1.6.7 kubeletVersion: v1.6.7 ``` ```sh $ kubectl get nodes NAME STATUS AGE VERSION node1.example.com Ready 21d v1.6.7 node2.example.com Ready 21d v1.6.7 node3.example.com Ready 21d v1.6.7 node4.example.com Ready 21d v1.6.7 ``` Kubernetes control plane components have been successfully updated! ================================================ FILE: Documentation/users-integrations.md ================================================ # Users and Integrations This document tracks projects, integrations, and use cases for bootkube. [Join the community](../README.md), and help us keep the list up-to-date. * [Lokomotive](https://github.com/kinvolk/lokomotive) - Open source Kubernetes distribution that ships pure upstream Kubernetes. It focuses on being minimal, easy to use, and secure by default. * [kubermesh](https://github.com/kubermesh/kubermesh) - Bare metal, self-hosted, self-healing/provisioning, mesh network kubernetes cluster. See the [blog post](http://ocadotechnology.com/blog/creating-a-distributed-data-centre-architecture-using-kubernetes-and-containers/) for more details. * [Archon](https://github.com/kubeup/archon) - Kubernetes management and automation tool based on the [operator pattern](https://coreos.com/blog/introducing-operators.html) * [kube-linode](https://github.com/kahkhang/kube-linode) - Provision a CoreOS/Kubernetes cluster on Linode ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: Makefile ================================================ export CGO_ENABLED:=0 export GOARCH:=amd64 export PATH:=$(PATH):$(PWD) LOCAL_OS:=$(shell uname | tr A-Z a-z) GOFILES:=$(shell find . -name '*.go' ! -path './vendor/*') VENDOR_GOFILES ?= $(shell find vendor -name '*.go') LDFLAGS=-X github.com/kubernetes-sigs/bootkube/pkg/version.Version=$(shell $(CURDIR)/build/git-version.sh) TERRAFORM:=$(shell command -v terraform 2> /dev/null) all: \ _output/bin/$(LOCAL_OS)/bootkube \ _output/bin/linux/bootkube \ _output/bin/linux/checkpoint cross: \ _output/bin/linux/bootkube \ _output/bin/darwin/bootkube \ _output/bin/linux/checkpoint \ _output/bin/linux/amd64/checkpoint \ _output/bin/linux/arm/checkpoint \ _output/bin/linux/arm64/checkpoint \ _output/bin/linux/ppc64le/checkpoint \ _output/bin/linux/s390x/checkpoint release: \ check \ _output/release/bootkube.tar.gz \ check: gofmt ifdef TERRAFORM $(TERRAFORM) fmt -check ; if [ ! $$? -eq 0 ]; then exit 1; fi else @echo -e "\e[91mSkipping terraform lint. terraform binary not available.\e[0m" endif @go vet $(shell go list ./... | grep -v '/vendor/') @go test -v $(shell go list ./... | grep -v '/vendor/\|/e2e') gofmt: gofmt -s -w $(GOFILES) install: go install -ldflags "$(LDFLAGS)" ./cmd/bootkube _output/bin/%: GOOS=$(word 1, $(subst /, ,$*)) _output/bin/%: GOARCH=$(word 2, $(subst /, ,$*)) _output/bin/%: GOARCH:=amd64 # default to amd64 to support release scripts _output/bin/%: $(GOFILES) $(VENDOR_GOFILES) mkdir -p $(dir $@) GOOS=$(GOOS) GOARCH=$(GOARCH) go build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o $@ github.com/kubernetes-sigs/bootkube/cmd/$(notdir $@) _output/release/bootkube.tar.gz: _output/bin/linux/bootkube _output/bin/darwin/bootkube _output/bin/linux/checkpoint mkdir -p $(dir $@) tar czf $@ -C _output bin/linux/bootkube bin/darwin/bootkube bin/linux/checkpoint run-%: GOFLAGS = -i run-%: _output/bin/linux/bootkube _output/bin/$(LOCAL_OS)/bootkube @cd hack/$*-node && ./bootkube-up @echo "Bootkube ready" clean-vm-single: clean-vm-%: @echo "Cleaning VM..." @(cd hack/$*-node && \ vagrant destroy -f && \ rm -rf cluster ) #TODO(aaron): Prompt because this is destructive conformance-%: all @cd hack/$*-node && vagrant destroy -f @cd hack/$*-node && rm -rf cluster @cd hack/$*-node && ./bootkube-up @sleep 30 # Give addons a little time to start @cd hack/$*-node && ./conformance-test.sh #TODO: curl/sed "vendored" libs is gross - come up with something better vendor: @go mod vendor @curl https://raw.githubusercontent.com/kubernetes/kubernetes/v1.16.2/pkg/kubelet/util/util.go | sed 's/^package util$$/package internal/' > pkg/checkpoint/internal/util.go @curl https://raw.githubusercontent.com/kubernetes/kubernetes/v1.16.2/pkg/kubelet/util/util_unix.go | sed 's/^package util$$/package internal/' > pkg/checkpoint/internal/util_unix.go @CGO_ENABLED=1 go build -o _output/bin/license-bill-of-materials ./vendor/github.com/coreos/license-bill-of-materials @./_output/bin/license-bill-of-materials ./cmd/bootkube ./cmd/checkpoint > bill-of-materials.json clean: rm -rf _output .PHONY: all check clean gofmt install release vendor ================================================ FILE: NOTICE ================================================ CoreOS Project Copyright 2015 CoreOS, Inc This product includes software developed at CoreOS, Inc. (http://www.coreos.com/). ================================================ FILE: OWNERS ================================================ # See the OWNERS file documentation: # https://github.com/kubernetes/community/blob/master/contributors/guide/owners.md approvers: - aaronlevy - rphillips - rmenn - andrewrynhard ================================================ FILE: OWNERS_ALIASES ================================================ # See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md aliases: sig-cluster-lifecycle-leads: - luxas - justinsb - timothysc ================================================ FILE: README.md ================================================ # Bootkube [![Build Status](https://travis-ci.org/kubernetes-incubator/bootkube.svg?branch=master)](https://travis-ci.org/kubernetes-incubator/bootkube) [![GoDoc](https://godoc.org/github.com/kubernetes-sigs/bootkube?status.svg)](https://godoc.org/github.com/kubernetes-sigs/bootkube) [![Go Report Card](https://goreportcard.com/badge/github.com/kubernetes-sigs/bootkube)](https://goreportcard.com/report/github.com/kubernetes-sigs/bootkube) Bootkube is a tool for launching self-hosted Kubernetes clusters. When launched, bootkube will deploy a temporary Kubernetes control-plane (api-server, scheduler, controller-manager), which operates long enough to bootstrap a replacement self-hosted control-plane. Additionally, bootkube can be used to generate all of the necessary assets for use in bootstrapping a new cluster. These assets can then be modified to support any additional configuration options. ## Details of self-hosting - [KubeCon self-hosted presentation video](https://www.youtube.com/watch?v=EbNxGK9MwN4) - [Kubernetes self-hosted design document](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/cluster-lifecycle/self-hosted-kubernetes.md) ## Guides - [GCE Quickstart](hack/quickstart/quickstart-gce.md) - [AWS Quickstart](hack/quickstart/quickstart-aws.md) - [Vagrant Single-Node](hack/single-node/README.md) - [Vagrant Multi-Node](hack/multi-node/README.md) ## Usage Bootkube has two main commands: `render` and `start`. There is a third, experimental command `recover` which can help reboot a downed cluster (see below). ### Render assets Bootkube can be used to render all of the assets necessary for bootstrapping a self-hosted Kubernetes cluster. This includes generation of TLS assets, Kubernetes object manifests, and a kubeconfig to connect to the bootstrapped cluster. To see available options, run: ``` bootkube render --help ``` Example: ``` bootkube render --asset-dir=my-cluster ``` The resulting assets can be inspected / modified in the generated asset-dir. ### Start bootkube To start bootkube use the `start` subcommand. To see available options, run: ``` bootkube start --help ``` Example: ``` bootkube start --asset-dir=my-cluster ``` When `bootkube start` is creating Kubernetes resources from manifests, the following order is used: 1. Any `Namespace` objects are created, in lexicographical order. 1. Any `CustomResourceDefinition` objects are created, in lexicographical order. 1. Any remaining resources are created, in lexicographical order. ### Recover a downed cluster In the case of a partial or total control plane outage (i.e. due to lost master nodes) an experimental `recover` command can extract and write manifests from a backup location. These manifests can then be used by the `start` command to reboot the cluster. Currently recovery from a running apiserver, an external running etcd cluster, or an etcd backup taken from the self hosted etcd cluster are the methods. For more details and examples see [disaster recovery documentation](Documentation/disaster-recovery.md). ## Development See [Documentation/development.md](Documentation/development.md) for more information. ## Getting Involved Want to contribute to bootkube? Have Questions? We are looking for active participation from the community You can find us at the `#bootkube` channel on [Kubernetes slack][slack]. ## Related Links - [Users and Integrations](Documentation/users-integrations.md) ## License bootkube is under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details. [slack]: https://github.com/kubernetes/community/tree/master/communication#social-media ================================================ FILE: RELEASING.md ================================================ # Preparing a bootkube release ## Versioning Notes ### Bootkube Versioning Historically, we bump the minor version when we start supporting a new kubernetes minor version. This means: ``` v0.1.0 -> Kubernetes v1.3.x v0.2.0 -> Kubernetes v1.4.x v0.3.0 -> Kubernetes v1.5.x v0.4.0 -> Kubernetes v1.6.x ``` However, as the tool has stabilized in functionality, and we head toward a v1.0, we should also begin bumping minor versions on breaking changes. A breaking change is considered an incompability between `bootkube render` assets of one version not being able to be used with a newer `bootkube start`. In those situations we should also begin bumping the minor version to communicate that new assets might need to be generated, or that existing assets need to be updated. ### Checkpointer Versioning The checkpointer is developed in the same repo, but can be thought of as an independent project. Because of this we do not use tags for the checkpointer releases, as they would intermix with bootkube releases (which do not coincide). Instead, checkpointers are released using the last git-hash of the changes added to the checkpointer subtree. Available releases can be seen on the Quay repository: https://quay.io/repository/coreos/pod-checkpointer. If there were no changes made to the checkpointer subtree, a new release is not necessary. Eventually we might want to consider moving the checkpointer to its own repo. This would allow for independent development / release cycle, which would also benefit other projects that might want to use the pod-checkpointer. However, this should also be balanced against the longer-term goal, which would be that checkpointing is natively supported in the kubelet. For some past discussions related to these topics, see: - https://github.com/kubernetes/kubeadm/issues/131 - https://github.com/kubernetes/kubernetes/issues/489 - https://github.com/kubernetes-sigs/bootkube/issues/424 ## Updating Kubernetes Version ### Updating Kubernetes vendor code Vendoring relies on go modules. - Run `go get -u` the desired `k8s.io/client-go` version - Run `make vendor` ### Updating hyperkube image / Kubernetes version - Update hyperkube image for manifests in templates: - `pkg/asset/internal/templates.go` - Update conformance test version: (`CONFORMANCE_VERSION`) - `hack/tests/conformance-test.sh` - Update on-host kubelet versions (`KUBELET_IMAGE_TAG`) - `hack/multi-node/user-data.sample` - `hack/single-node/user-data.sample` - `hack/quickstart/kubelet.master` - `hack/quickstart/kubelet.worker` ## Run conformance test Easiest is to use internal jenkins job: [bootkube-development](https://jenkins-kube-lifecycle.prod.coreos.systems/view/bootkube/job/bootkube-dev/) Or, manually: ``` # GCE ./hack/tests/conformance-gce.sh ``` ``` # Vagrant make conformance-multi ``` ``` # Other ./hack/tests/conformance-test.sh ``` ### Tag a release ``` git tag -s vX.Y.Z git push origin vX.Y.Z ``` ### Cut a release image Easiest is to use internal jenkins job: [bootkube-release](https://jenkins-kube-lifecycle.prod.coreos.systems/view/bootkube/job/bootkube-release/). This job will push the image to the quay.io/coreos/bootkube repo, and archive a tarball of binary releases (manually upload to github release) Or, manually: ``` git checkout vX.Y.Z make release PUSH_IMAGE=true ./build/build-image.sh ``` # Updating checkpointer This only needs to happen when changes have been made to the checkpointer code / container. ### Build a new checkpointer image Easiest is to use internal jenkin job: [checkpointer-release](https://jenkins-kube-lifecycle.prod.coreos.systems/view/bootkube/job/checkpointer-release/) Or, manually: ``` git checkout master # Checkpointer releases should only be built from commits reachable by master make release BUILD_IMAGE=checkpoint PUSH_IMAGE=true ./build/build-image.sh ``` ### Update checkpointer manifest In `pkg/asset/images.go` change: `PodCheckpointer` in `DefaultImages` to use the image built in previous step. ================================================ FILE: ROADMAP.md ================================================ # Bootkube Roadmap ## v1.0.0 targets - [ ] Recovery from etcd-backup part of e2e testing (https://github.com/kubernetes-sigs/bootkube/issues/596) - [ ] Publicly published upstream conformance tests - [ ] How-it-works documentation for bootkube - [ ] Documentation for running HA clusters (https://github.com/kubernetes-sigs/bootkube/issues/311) - [ ] Versioned configuration objects replace flags (https://github.com/kubernetes-sigs/bootkube/issues/565) ## Upstream Features (as available) - [ ] Kubelet TLS bootstrap/rotation for client/server certificates (https://github.com/kubernetes/features/issues/43 & https://github.com/kubernetes/features/issues/266) - [ ] componentConfig/configMap for all core components - [ ] Cluster configuration object (https://github.com/kubernetes/kubernetes/issues/19831) - [ ] Adoption of kubelet checkpointing / deprecation of pod-checkpointer (https://github.com/kubernetes/kubernetes/issues/489) ================================================ FILE: SECURITY_CONTACTS ================================================ # Defined below are the security contacts for this repo. # # They are the contact point for the Product Security Team to reach out # to for triaging and handling of incoming issues. # # The below names agree to abide by the # [Embargo Policy](https://github.com/kubernetes/sig-release/blob/master/security-release-process-documentation/security-release-process.md#embargo-policy) # and will be removed and replaced if they violate that agreement. # # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE # INSTRUCTIONS AT https://kubernetes.io/security/ aaronlevy ================================================ FILE: bill-of-materials.json ================================================ [ { "project": "github.com/coreos/etcd", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "github.com/davecgh/go-spew/spew", "licenses": [ { "type": "ISC License", "confidence": 1 } ] }, { "project": "github.com/ghodss/yaml", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.8357142857142857 } ] }, { "project": "github.com/gogo/protobuf", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9090909090909091 } ] }, { "project": "github.com/golang/glog", "licenses": [ { "type": "Apache License 2.0", "confidence": 0.9966703662597114 } ] }, { "project": "github.com/golang/protobuf", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.92 } ] }, { "project": "github.com/google/btree", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "github.com/google/gofuzz", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "github.com/googleapis/gnostic", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "github.com/gregjones/httpcache", "licenses": [ { "type": "MIT License", "confidence": 0.9891304347826086 } ] }, { "project": "github.com/hashicorp/golang-lru", "licenses": [ { "type": "Mozilla Public License 2.0", "confidence": 1 } ] }, { "project": "github.com/imdario/mergo", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9663865546218487 } ] }, { "project": "github.com/json-iterator/go", "licenses": [ { "type": "MIT License", "confidence": 1 } ] }, { "project": "github.com/kubernetes-sigs/bootkube", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "github.com/modern-go/concurrent", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "github.com/modern-go/reflect2", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "github.com/pborman/uuid", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9663865546218487 } ] }, { "project": "github.com/peterbourgon/diskv", "licenses": [ { "type": "MIT License", "confidence": 0.9891304347826086 } ] }, { "project": "github.com/spf13/cobra", "licenses": [ { "type": "Apache License 2.0", "confidence": 0.9573241061130334 } ] }, { "project": "github.com/spf13/pflag", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9663865546218487 } ] }, { "project": "golang.org/x/crypto/ssh/terminal", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9663865546218487 } ] }, { "project": "golang.org/x/net", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9663865546218487 } ] }, { "project": "golang.org/x/oauth2", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9663865546218487 } ] }, { "project": "golang.org/x/sys/unix", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9663865546218487 } ] }, { "project": "golang.org/x/text", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9663865546218487 } ] }, { "project": "golang.org/x/time/rate", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9663865546218487 } ] }, { "project": "google.golang.org/genproto/googleapis/rpc/status", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "google.golang.org/grpc", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "gopkg.in/inf.v0", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.9752066115702479 } ] }, { "project": "gopkg.in/yaml.v2", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 }, { "type": "MIT License", "confidence": 0.8975609756097561 } ] }, { "project": "k8s.io/api", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "k8s.io/apimachinery", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "k8s.io/client-go", "licenses": [ { "type": "Apache License 2.0", "confidence": 1 } ] }, { "project": "k8s.io/klog", "licenses": [ { "type": "Apache License 2.0", "confidence": 0.9966703662597114 } ] }, { "project": "sigs.k8s.io/yaml", "licenses": [ { "type": "BSD 3-clause \"New\" or \"Revised\" License", "confidence": 0.8357142857142857 } ] } ] ================================================ FILE: build/README.md ================================================ ## Build Release Images Build release binaries + images ``` BUILD_IMAGE=bootkube PUSH_IMAGE=true ./build/build-image.sh BUILD_IMAGE=checkpoint PUSH_IMAGE=true ./build/build-image.sh ``` ## Updating checkpoint container The hyperkube release will use a specific git hash for the checkpoint pod. This requires a two step process to update the checkpoint container. First update & commit changes to checkpoint code and build an image: ``` BUILD_IMAGE=checkpoint PUSH_IMAGE=true ./build/build-image.sh ``` Now that we have a checkpoint image released, we can reference that git hash in the api-server manifest: ``` # Edit api-server manifest vi pkg/asset/internal/templates.go # commmit / push changes # Now build bootkube image with the updated manifest BUILD_IMAGE=bootkube PUSH_IMAGE=true ./build/build-image.sh ``` ================================================ FILE: build/build-image.sh ================================================ #!/usr/bin/env bash set -euo pipefail BUILD_IMAGE=${BUILD_IMAGE:-} PUSH_IMAGE=${PUSH_IMAGE:-false} if [ -z "${BUILD_IMAGE}" ]; then echo "BUILD_IMAGE env var must be set" exit 1 fi BOOTKUBE_ROOT=$(git rev-parse --show-toplevel) source "${BOOTKUBE_ROOT}/build/build-release.sh" source "${BOOTKUBE_ROOT}/image/${BUILD_IMAGE}/build-image.sh" image::build if [[ ${PUSH_IMAGE} == "true" ]]; then docker push $(image::name) fi ================================================ FILE: build/build-release.sh ================================================ #!/usr/bin/env bash set -euo pipefail BOOTKUBE_ROOT=$(git rev-parse --show-toplevel) GOLANG_IMAGE=${GOLANG_IMAGE:-golang:1.13.11} SRCDIR="/usr/src/bootkube" docker run -v ${BOOTKUBE_ROOT}:${SRCDIR} ${GOLANG_IMAGE} make -C ${SRCDIR} release ================================================ FILE: build/git-version.sh ================================================ #!/bin/sh DESCRIPTION=$(git describe --abbrev=100 --dirty) && echo "${DESCRIPTION##*-g}" ================================================ FILE: cmd/bootkube/main.go ================================================ package main import ( "flag" "fmt" "os" "github.com/spf13/cobra" "github.com/kubernetes-sigs/bootkube/pkg/util" "github.com/kubernetes-sigs/bootkube/pkg/version" ) var ( cmdRoot = &cobra.Command{ Use: "bootkube", Short: "Bootkube!", SilenceErrors: true, // suppress cobra errors so we can handle them (also applies to subcommands) Long: "", } cmdVersion = &cobra.Command{ Use: "version", Short: "Output version information", Long: "", RunE: func(cmd *cobra.Command, args []string) error { fmt.Printf("Version: %s\n", version.Version) return nil }, } ) func main() { flag.Parse() util.InitLogs() defer util.FlushLogs() cmdRoot.AddCommand(cmdVersion) if err := cmdRoot.Execute(); err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) os.Exit(1) } } ================================================ FILE: cmd/bootkube/recover.go ================================================ package main import ( "context" "crypto/tls" "crypto/x509" "errors" "fmt" "io/ioutil" "path/filepath" "strings" "time" "github.com/kubernetes-sigs/bootkube/pkg/bootkube" "github.com/kubernetes-sigs/bootkube/pkg/recovery" "github.com/spf13/cobra" "go.etcd.io/etcd/clientv3" ) var ( cmdRecover = &cobra.Command{ Use: "recover", Short: "Recover a self-hosted control plane", Long: "This command reads control plane manifests from a running apiserver or etcd and writes them to recovery-dir. Users can then use `bootkube start` pointed at this recovery-dir to re-the a self-hosted cluster. Please see the project README for more details and examples.", PreRunE: validateRecoverOpts, RunE: runCmdRecover, SilenceUsage: true, } recoverOpts struct { recoveryDir string etcdCAPath string etcdCertificatePath string etcdPrivateKeyPath string etcdServers string etcdPrefix string kubeConfigPath string podManifestPath string } ) func init() { cmdRoot.AddCommand(cmdRecover) cmdRecover.Flags().StringVar(&recoverOpts.recoveryDir, "recovery-dir", "", "Output path for writing recovered cluster assets.") cmdRecover.Flags().StringVar(&recoverOpts.etcdCAPath, "etcd-ca-path", "", "Path to an existing PEM encoded CA that will be used for TLS-enabled communication between the apiserver and etcd. Must be used in conjunction with --etcd-certificate-path and --etcd-private-key-path, and must have etcd configured to use TLS with matching secrets.") cmdRecover.Flags().StringVar(&recoverOpts.etcdCertificatePath, "etcd-certificate-path", "", "Path to an existing certificate that will be used for TLS-enabled communication between the apiserver and etcd. Must be used in conjunction with --etcd-ca-path and --etcd-private-key-path, and must have etcd configured to use TLS with matching secrets.") cmdRecover.Flags().StringVar(&recoverOpts.etcdPrivateKeyPath, "etcd-private-key-path", "", "Path to an existing private key that will be used for TLS-enabled communication between the apiserver and etcd. Must be used in conjunction with --etcd-ca-path and --etcd-certificate-path, and must have etcd configured to use TLS with matching secrets.") cmdRecover.Flags().StringVar(&recoverOpts.etcdServers, "etcd-servers", "", "List of etcd server URLs including host:port, comma separated.") cmdRecover.Flags().StringVar(&recoverOpts.etcdPrefix, "etcd-prefix", "/registry", "Path prefix to Kubernetes cluster data in etcd.") cmdRecover.Flags().StringVar(&recoverOpts.kubeConfigPath, "kubeconfig", "", "Path to kubeconfig for communicating with the cluster.") cmdRecover.Flags().StringVar(&recoverOpts.podManifestPath, "pod-manifest-path", "/etc/kubernetes/manifests", "The location where the kubelet is configured to look for static pod manifests. (Only need to be set when recovering from a etcd backup file)") } func runCmdRecover(cmd *cobra.Command, args []string) error { var err error recoverOpts.kubeConfigPath, err = filepath.Abs(recoverOpts.kubeConfigPath) if err != nil { return err } var backend recovery.Backend switch { case recoverOpts.etcdServers != "": bootkube.UserOutput("Attempting recovery using etcd cluster at %q...\n", recoverOpts.etcdServers) etcdClient, err := createEtcdClient() if err != nil { return err } backend = recovery.NewEtcdBackend(etcdClient, recoverOpts.etcdPrefix) default: bootkube.UserOutput("Attempting recovery using apiserver at %q...\n", recoverOpts.kubeConfigPath) backend, err = recovery.NewAPIServerBackend(recoverOpts.kubeConfigPath) if err != nil { return err } } as, err := recovery.Recover(context.Background(), backend, recoverOpts.kubeConfigPath) if err != nil { return err } return as.WriteFiles(recoverOpts.recoveryDir) } func validateRecoverOpts(cmd *cobra.Command, args []string) error { if recoverOpts.recoveryDir == "" { return errors.New("missing required flag: --recovery-dir") } if (recoverOpts.etcdCertificatePath != "" || recoverOpts.etcdPrivateKeyPath != "") && (recoverOpts.etcdCertificatePath == "" || recoverOpts.etcdPrivateKeyPath == "") { return errors.New("you must specify both --etcd-certificate-path, and --etcd-private-key-path") } if recoverOpts.etcdPrefix == "" { return errors.New("missing required flag: --etcd-prefix") } if recoverOpts.kubeConfigPath == "" { return errors.New("missing required flag: --kubeconfig") } return nil } func createEtcdClient() (*clientv3.Client, error) { cfg := clientv3.Config{ Endpoints: strings.Split(recoverOpts.etcdServers, ","), DialTimeout: 5 * time.Second, } var roots *x509.CertPool if recoverOpts.etcdCAPath != "" { roots = x509.NewCertPool() etcdCA, err := ioutil.ReadFile(recoverOpts.etcdCAPath) if err != nil { return nil, err } if ok := roots.AppendCertsFromPEM(etcdCA); !ok { return nil, fmt.Errorf("error processing --etcd-ca-file %s", recoverOpts.etcdCAPath) } } var certs []tls.Certificate if recoverOpts.etcdCertificatePath != "" && recoverOpts.etcdPrivateKeyPath != "" { clientCert, err := tls.LoadX509KeyPair(recoverOpts.etcdCertificatePath, recoverOpts.etcdPrivateKeyPath) if err != nil { return nil, err } certs = []tls.Certificate{clientCert} } if roots != nil || len(certs) > 0 { cfg.TLS = &tls.Config{ RootCAs: roots, Certificates: certs, } } return clientv3.New(cfg) } ================================================ FILE: cmd/bootkube/render.go ================================================ package main import ( "fmt" "os" "plugin" bootkubeplugin "github.com/kubernetes-sigs/bootkube/pkg/plugin" "github.com/spf13/cobra" ) var ( cmdRender = &cobra.Command{ Use: "render", Short: "Render cluster manifests using the specified plugin", RunE: runCmdRender, SilenceUsage: true, } renderOpts struct { assetDir string plugin string pluginFlags []string } pluginOpts bootkubeplugin.Options ) func init() { cmdRoot.AddCommand(cmdRender) cmdRender.Flags().StringVar(&pluginOpts.AssetDir, "asset-dir", "", "Output path for rendered assets") cmdRender.Flags().StringVar(&renderOpts.plugin, "plugin", "", "Path to the render plugin") cmdRender.Flags().StringSliceVar(&renderOpts.pluginFlags, "plugin-flag", []string{}, "The flags to pass to the render plugin") cobra.MarkFlagRequired(cmdRender.Flags(), "asset-dir") cobra.MarkFlagRequired(cmdRender.Flags(), "plugin") } func runCmdRender(cmd *cobra.Command, args []string) error { plug, err := plugin.Open(renderOpts.plugin) if err != nil { fmt.Println(err) os.Exit(1) } symbol, err := plug.Lookup("Renderer") if err != nil { fmt.Println(err) os.Exit(1) } var renderer bootkubeplugin.Renderer renderer, ok := symbol.(bootkubeplugin.Renderer) if !ok { fmt.Println("unexpected type from plugin") os.Exit(1) } return renderer.Render(&pluginOpts, renderOpts.pluginFlags) } ================================================ FILE: cmd/bootkube/start.go ================================================ package main import ( "errors" "fmt" "strings" "github.com/spf13/cobra" "github.com/kubernetes-sigs/bootkube/pkg/bootkube" ) var ( cmdStart = &cobra.Command{ Use: "start", Short: "Start the bootkube service", Long: "", PreRunE: validateStartOpts, RunE: runCmdStart, SilenceUsage: true, } startOpts struct { assetDir string podManifestPath string strict bool requiredPods []string } ) var defaultRequiredPods = []string{ "kube-system/pod-checkpointer", "kube-system/kube-apiserver", "kube-system/kube-scheduler", "kube-system/kube-controller-manager", } func init() { cmdRoot.AddCommand(cmdStart) cmdStart.Flags().StringVar(&startOpts.assetDir, "asset-dir", "", "Path to the cluster asset directory. Expected layout generated by the `bootkube render` command.") cmdStart.Flags().StringVar(&startOpts.podManifestPath, "pod-manifest-path", "/etc/kubernetes/manifests", "The location where the kubelet is configured to look for static pod manifests.") cmdStart.Flags().BoolVar(&startOpts.strict, "strict", false, "Strict mode will cause bootkube to exit early if any manifests in the asset directory cannot be created.") cmdStart.Flags().StringSliceVar(&startOpts.requiredPods, "required-pods", defaultRequiredPods, "List of pods with their namespace (written as /) that are required to be running before the start command does the pivot.") } func runCmdStart(cmd *cobra.Command, args []string) error { bk, err := bootkube.NewBootkube(bootkube.Config{ AssetDir: startOpts.assetDir, PodManifestPath: startOpts.podManifestPath, Strict: startOpts.strict, RequiredPods: startOpts.requiredPods, }) if err != nil { return err } err = bk.Run() if err != nil { // Always report errors. bootkube.UserOutput("Error: %v\n", err) } return err } func validateStartOpts(cmd *cobra.Command, args []string) error { if startOpts.podManifestPath == "" { return errors.New("missing required flag: --pod-manifest-path") } if startOpts.assetDir == "" { return errors.New("missing required flag: --asset-dir") } for _, nsPod := range startOpts.requiredPods { if len(strings.Split(nsPod, "/")) != 2 { return fmt.Errorf("invalid required pod: expected %q to be of shape /", nsPod) } } return nil } ================================================ FILE: cmd/checkpoint/README.md ================================================ # Checkpoint ## Description `checkpoint` is a utility application which will manage "checkpoints" of pods scheduled to the local node. The purpose of a pod checkpoint is to ensure that existing local pod state can be recovered in the absence of an api-server. The kubelet will already attempt to ensure that local pods will continue to run in the absence of an API server (based on restartPolicy). However, if all local runtime state has been lost (for example after a reboot), the checkpoint utility will ensure the local state can be recovered until an api-server is contacted. This is accomplished by managing checkpoints as static pod manifests: - When the checkpointer sees that a "parent pod" (a pod which should be checkpointed), is successfully running, the checkpointer will save a local copy of the manifest. - If the parent pod is detected as no longer running, the checkpointer will "activate" the checkpoint manifest. It will allow the checkpoint to continue running until the parent-pod is restarted on the local node, or it is able to contact an api-server to determine that the parent pod is no longer scheduled to this node. ## Use Any pod which contains the `checkpointer.alpha.coreos.com/checkpoint=true` annotation will be considered a viable "parent pod" which should be checkpointed. The parent pod cannot itself be a static pod, and is not a checkpoint itself. Affinity is not supported for a pod, and any pod labelled with the checkpoint annotation will be checkpointed. Checkpoints are denoted by the `checkpointer.alpha.coreos.com/checkpoint-of` annotation. This annotation will point to the parent of this checkpoint by pod name. For example the pod: ``` apiVersion: v1 kind: Pod metadata: name: kube-apiserver namespace: kube-system annotations: checkpointer.alpha.coreos.com/checkpoint=true ``` Will generate a checkpointed pod as: ``` apiVersion: v1 kind: Pod metadata: name: kube-apiserver namespace: kube-system annotations: checkpointer.alpha.coreos.com/checkpoint-of=kube-apiserver ``` ## Implementation Notes: ### Asset Locations - Inactive checkpoint manifests: /etc/kubernetes/inactive-manifests - Active checkpoint manifests: /etc/kubernetes/manifests - Checkpointed secrets: /etc/kubernetes/checkpoint-secrets - Config Maps: /etc/kubernetes/checkpoint-configmaps ### Pod Manifest Sanitization Parts of the pod manifest will be scrubbed prior to being saved as checkpoints. This is to ensure that the pod does not interfere with the parent object, and is managed in isolation. - All labels and non-checkpoint related annotations will be removed - Service account details are removed - Secrets are downloaded from the apiserver and converted to hostMounts - ConfigMaps are downloaded from the apiserver and converted to hostMounts - Pod status is cleared ### Secret Storage Secrets are stored using a path of: ``` /etc/kubernetes/checkpoint-secrets/// ``` ### ConfigMap Storage ConfigMaps are stored using a path of: ``` /etc/kubernetes/checkpoint-configmaps/// ``` ### Self Checkpointing The pod checkpoint will also checkpoint itself to the disk to handle the absence of the API server. After a node reboot, the on-disk pod-checkpointer will take over the responsibility. If the pod checkpointer reaches the API server and finds out that it's no longer being scheduled, it will remove all on-disk checkpoints before cleaning itself up. ### RBAC Requirements By default, the pod checkpoint runs with service account credentials, checkpointing its own service account secret for reboots. That service account must be bound to a Role that lets the pod checkpoint watch for Pods with the checkpoint annotation, then save ConfigMaps and Secrets referenced by those Pods. ```yaml kind: Role metadata: name: pod-checkpointer namespace: kube-system rules: - apiGroups: [""] # "" indicates the core API group resources: ["pods"] verbs: ["get", "watch", "list"] - apiGroups: [""] # "" indicates the core API group resources: ["secrets", "configmaps"] verbs: ["get"] ``` ================================================ FILE: cmd/checkpoint/main.go ================================================ package main import ( "flag" "fmt" "os" "syscall" "time" "github.com/golang/glog" "k8s.io/client-go/tools/clientcmd" "github.com/kubernetes-sigs/bootkube/pkg/checkpoint" ) const ( nodeNameEnv = "NODE_NAME" podNameEnv = "POD_NAME" podNamespaceEnv = "POD_NAMESPACE" defaultRuntimeEndpoint = "unix:///var/run/dockershim.sock" defaultRuntimeRequestTimeout = 2 * time.Minute defaultCheckpointGracePeriod = 1 * time.Minute ) var ( lockfilePath string kubeconfigPath string remoteRuntimeEndpoint string runtimeRequestTimeout time.Duration checkpointGracePeriod time.Duration ) func init() { flag.StringVar(&lockfilePath, "lock-file", "/var/run/lock/pod-checkpointer.lock", "The path to lock file for checkpointer to use") flag.StringVar(&kubeconfigPath, "kubeconfig", "/etc/kubernetes/kubeconfig", "Path to a kubeconfig file containing credentials used to talk to the kubelet.") flag.Set("logtostderr", "true") flag.StringVar(&remoteRuntimeEndpoint, "container-runtime-endpoint", defaultRuntimeEndpoint, "[Experimental] The endpoint of remote runtime service. Currently unix socket is supported on Linux, and tcp is supported on windows. Examples:'unix:///var/run/dockershim.sock', 'tcp://localhost:3735'") flag.DurationVar(&runtimeRequestTimeout, "runtime-request-timeout", defaultRuntimeRequestTimeout, "Timeout of all runtime requests except long running request - pull, logs, exec and attach. When timeout exceeded, kubelet will cancel the request, throw out an error and retry later.") flag.DurationVar(&checkpointGracePeriod, "checkpoint-grace-period", defaultCheckpointGracePeriod, "Grace period for cleaning up checkpoints when the parent pod is deleted. Non-zero values are helpful for accommodating control plane eventual consistency.") } func main() { flag.Parse() defer glog.Flush() glog.Info("Determining environment from downward API") nodeName, podName, podNamespace, err := readDownwardAPI() if err != nil { glog.Fatalf("Error reading downward API: %v", err) } glog.Infof("Trying to acquire the flock at %q", lockfilePath) if err := flock(lockfilePath); err != nil { glog.Fatalf("Error when acquiring the flock: %v", err) } glog.Infof("Starting checkpointer for node: %s", nodeName) // This is run as a static pod, so we can't use InClusterConfig because // KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT won't be set in // the pod. kubeConfig, err := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(&clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeconfigPath}, &clientcmd.ConfigOverrides{}).ClientConfig() if err != nil { glog.Fatalf("Failed to load kubeconfig: %v", err) } if err := checkpoint.Run(checkpoint.Options{ CheckpointerPod: checkpoint.CheckpointerPod{ NodeName: nodeName, PodName: podName, PodNamespace: podNamespace, }, KubeConfig: kubeConfig, RemoteRuntimeEndpoint: remoteRuntimeEndpoint, RuntimeRequestTimeout: runtimeRequestTimeout, CheckpointGracePeriod: checkpointGracePeriod, }); err != nil { glog.Fatalf("Error starting checkpointer: %v", err) } } // flock tries to grab a flock on the given path. // If the lock is already acquired by other process, the function will block. // TODO(yifan): Maybe replace this with kubernetes/pkg/util/flock.Acquire() once // https://github.com/kubernetes/kubernetes/issues/42929 is solved, or maybe not. func flock(path string) error { fd, err := syscall.Open(path, syscall.O_CREAT|syscall.O_RDWR, 0600) if err != nil { return err } // We don't need to close the fd since we should hold // it until the process exits. return syscall.Flock(fd, syscall.LOCK_EX) } // readDownwardAPI fills the node name, pod name, and pod namespace. func readDownwardAPI() (nodeName, podName, podNamespace string, err error) { nodeName = os.Getenv(nodeNameEnv) if nodeName == "" { return "", "", "", fmt.Errorf("missing required environment variable: %s", nodeNameEnv) } podName = os.Getenv(podNameEnv) if podName == "" { return "", "", "", fmt.Errorf("missing required environment variable: %s", podNameEnv) } podNamespace = os.Getenv(podNamespaceEnv) if podNamespace == "" { return "", "", "", fmt.Errorf("missing required environment variable: %s", podNamespaceEnv) } return nodeName, podName, podNamespace, nil } ================================================ FILE: cmd/render/plugin/default/asset/asset.go ================================================ package asset import ( "crypto/rsa" "crypto/x509" "errors" "fmt" "io/ioutil" "net" "net/url" "os" "path" "path/filepath" "reflect" "strings" "github.com/kubernetes-sigs/bootkube/pkg/tlsutil" ) const ( AssetPathSecrets = "tls" AssetPathCAKey = "tls/ca.key" AssetPathCACert = "tls/ca.crt" AssetPathAPIServerKey = "tls/apiserver.key" AssetPathAPIServerCert = "tls/apiserver.crt" AssetPathEtcdClientCA = "tls/etcd-client-ca.crt" AssetPathEtcdClientCert = "tls/etcd-client.crt" AssetPathEtcdClientKey = "tls/etcd-client.key" AssetPathEtcdServerCA = "tls/etcd/server-ca.crt" AssetPathEtcdServerCert = "tls/etcd/server.crt" AssetPathEtcdServerKey = "tls/etcd/server.key" AssetPathEtcdPeerCA = "tls/etcd/peer-ca.crt" AssetPathEtcdPeerCert = "tls/etcd/peer.crt" AssetPathEtcdPeerKey = "tls/etcd/peer.key" AssetPathAggregatorCA = "tls/front-proxy-ca.crt" AssetPathFrontProxyClientCert = "tls/front-proxy-client.crt" AssetPathFrontProxyClientKey = "tls/front-proxy-client.key" AssetPathServiceAccountPrivKey = "tls/service-account.key" AssetPathServiceAccountPubKey = "tls/service-account.pub" AssetPathKubeletClientCert = "tls/apiserver-kubelet-client.crt" AssetPathKubeletClientKey = "tls/apiserver-kubelet-client.key" AssetPathAdminKey = "tls/admin.key" AssetPathAdminCert = "tls/admin.crt" AssetPathAdminKubeConfig = "auth/kubeconfig" AssetPathKubeletKubeConfig = "auth/kubeconfig-kubelet" AssetPathManifests = "manifests" AssetPathKubeConfigInCluster = "manifests/kubeconfig-in-cluster.yaml" AssetPathKubeletBootstrapToken = "manifests/kubelet-bootstrap-token.yaml" AssetPathProxy = "manifests/kube-proxy.yaml" AssetPathProxySA = "manifests/kube-proxy-sa.yaml" AssetPathProxyRoleBinding = "manifests/kube-proxy-role-binding.yaml" AssetPathFlannel = "manifests/flannel.yaml" AssetPathFlannelCfg = "manifests/flannel-cfg.yaml" AssetPathFlannelClusterRole = "manifests/flannel-cluster-role.yaml" AssetPathFlannelClusterRoleBinding = "manifests/flannel-cluster-role-binding.yaml" AssetPathFlannelSA = "manifests/flannel-sa.yaml" AssetPathCalico = "manifests/calico.yaml" AssetPathCalicoPolicyOnly = "manifests/calico-policy-only.yaml" AssetPathCalicoCfg = "manifests/calico-config.yaml" AssetPathCalicoSA = "manifests/calico-service-account.yaml" AssetPathCalicoRole = "manifests/calico-role.yaml" AssetPathCalicoRoleBinding = "manifests/calico-role-binding.yaml" AssetPathCalicoBGPConfigurationsCRD = "manifests/calico-bgp-configurations-crd.yaml" AssetPathCalicoBGPPeersCRD = "manifests/calico-bgp-peers-crd.yaml" AssetPathCalicoFelixConfigurationsCRD = "manifests/calico-felix-configurations-crd.yaml" AssetPathCalicoGlobalNetworkPoliciesCRD = "manifests/calico-global-network-policies-crd.yaml" AssetPathCalicoNetworkPoliciesCRD = "manifests/calico-network-policies-crd.yaml" AssetPathCalicoGlobalNetworkSetsCRD = "manifests/calico-global-network-sets-crd.yaml" AssetPathCalicoIPPoolsCRD = "manifests/calico-ip-pools-crd.yaml" AssetPathCalicoClusterInformationsCRD = "manifests/calico-cluster-informations-crd.yaml" AssetPathAPIServerSecret = "manifests/kube-apiserver-secret.yaml" AssetPathAPIServer = "manifests/kube-apiserver.yaml" AssetPathControllerManager = "manifests/kube-controller-manager.yaml" AssetPathControllerManagerSA = "manifests/kube-controller-manager-service-account.yaml" AssetPathControllerManagerRB = "manifests/kube-controller-manager-role-binding.yaml" AssetPathControllerManagerSecret = "manifests/kube-controller-manager-secret.yaml" AssetPathControllerManagerDisruption = "manifests/kube-controller-manager-disruption.yaml" AssetPathScheduler = "manifests/kube-scheduler.yaml" AssetPathSchedulerDisruption = "manifests/kube-scheduler-disruption.yaml" AssetPathCoreDNSClusterRoleBinding = "manifests/coredns-cluster-role-binding.yaml" AssetPathCoreDNSClusterRole = "manifests/coredns-cluster-role.yaml" AssetPathCoreDNSConfig = "manifests/coredns-config.yaml" AssetPathCoreDNSDeployment = "manifests/coredns-deployment.yaml" AssetPathCoreDNSSA = "manifests/coredns-service-account.yaml" AssetPathCoreDNSSvc = "manifests/coredns-service.yaml" AssetPathSystemNamespace = "manifests/kube-system-ns.yaml" AssetPathCheckpointer = "manifests/pod-checkpointer.yaml" AssetPathCheckpointerSA = "manifests/pod-checkpointer-sa.yaml" AssetPathCheckpointerRole = "manifests/pod-checkpointer-role.yaml" AssetPathCheckpointerRoleBinding = "manifests/pod-checkpointer-role-binding.yaml" AssetPathCheckpointerClusterRole = "manifests/pod-checkpointer-cluster-role.yaml" AssetPathCheckpointerClusterRoleBinding = "manifests/pod-checkpointer-cluster-role-binding.yaml" AssetPathEtcdClientSecret = "manifests/etcd-client-tls.yaml" AssetPathEtcdPeerSecret = "manifests/etcd-peer-tls.yaml" AssetPathEtcdServerSecret = "manifests/etcd-server-tls.yaml" AssetPathCSRBootstrapRoleBinding = "manifests/csr-bootstrap-role-binding.yaml" AssetPathCSRApproverRoleBinding = "manifests/csr-approver-role-binding.yaml" AssetPathCSRRenewalRoleBinding = "manifests/csr-renewal-role-binding.yaml" AssetPathKubeSystemSARoleBinding = "manifests/kube-system-rbac-role-binding.yaml" AssetPathBootstrapManifests = "bootstrap-manifests" AssetPathBootstrapAPIServer = "bootstrap-manifests/bootstrap-apiserver.yaml" AssetPathBootstrapControllerManager = "bootstrap-manifests/bootstrap-controller-manager.yaml" AssetPathBootstrapScheduler = "bootstrap-manifests/bootstrap-scheduler.yaml" ) var BootstrapSecretsDir = "/etc/kubernetes/bootstrap-secrets" // Overridden for testing. // AssetConfig holds all configuration needed when generating // the default set of assets. type Config struct { ClusterName string EtcdCACert *x509.Certificate EtcdClientCert *x509.Certificate EtcdClientKey *rsa.PrivateKey EtcdServers []*url.URL EtcdUseTLS bool APIServers []*url.URL CACert *x509.Certificate CAPrivKey *rsa.PrivateKey AltNames *tlsutil.AltNames PodCIDRs []*net.IPNet ServiceCIDRs []*net.IPNet APIServiceIPs []net.IP DNSServiceIPs []net.IP CloudProvider string NetworkProvider string BootstrapSecretsSubdir string Images ImageVersions // PodCIDR describes the networking subnet to be used for inter-pod networking. // // Deprecated: PodCIDR exists only for compatibility with older external // systems. Please use PodCIDRs instead, which allows for dual-stack // configurations. PodCIDR *net.IPNet // ServiceCIDR describes the networking subnet to be used to expose services. // // Deprecated: ServiceCIDR exists only for compatibility with older external // systems. Please use ServiceCIDRs instead, which allows for dual-stack // configurations. If both are specified, only ServiceCIDRs will be used. ServiceCIDR *net.IPNet // APIServiceIP describes the in-cluster IP address by which the API Servers may be reached. // // Deprecated: APIServiceIP exists only for compatibility with older // external systems. Please use APIServiceIPs instead, which allows for // dual-stack configurations. If both are specified, only APIServiceIPs // will be used. APIServiceIP net.IP // DNSServiceIP describes the in-cluster IP address by which the cluster DNS servers may be reached. // // Deprecated: DNSServiceIP exists only for compatibility with older // external systems. Please use DNSServiceIPs instead, which allows for // dual-stack configurations. If both are specified, only DNSServiceIPs // will be used. DNSServiceIP net.IP } // BindAllAddress indicates the address to use when binding all IPs. If this // is an IPv6 or dual-stack system, `::` will be returned. Otherwise // `0.0.0.0`. func (c Config) BindAllAddress() string { if containsNonLocalIPv6(c.APIServiceIPs) { return "::" } return "0.0.0.0" } // ServiceCIDRsString returns a "," concatenated string for the ServiceCIDRs func (c Config) ServiceCIDRsString() string { return joinStringsFromSliceOrSingle(stringerSlice(c.ServiceCIDRs), c.ServiceCIDR) } // PodCIDRsString returns a "," concatenated string for the PodCIDRs func (c Config) PodCIDRsString() string { return joinStringsFromSliceOrSingle(stringerSlice(c.PodCIDRs), c.PodCIDR) } // APIServiceIPsString returns a "," concatenated string for the APIServiceIPs func (c Config) APIServiceIPsString() string { return joinStringsFromSliceOrSingle(stringerSlice(c.APIServiceIPs), c.APIServiceIP) } // DNSServiceIPsString returns a "," concatenated string for the DNSServiceIPs func (c Config) DNSServiceIPsString() string { return joinStringsFromSliceOrSingle(stringerSlice(c.DNSServiceIPs), c.DNSServiceIP) } func stringerSlice(in interface{}) []string { var ok bool type Stringer interface { String() string } var stringer Stringer if in == nil { return nil } r := reflect.ValueOf(in) if r.Len() == 0 { return nil } rval := make([]string, r.Len()) for i := 0; i < r.Len(); i++ { stringer, ok = r.Index(i).Interface().(fmt.Stringer) if !ok { rval[i] = "" continue } rval[i] = stringer.String() } return rval } func joinStringsFromSliceOrSingle(inSlice []string, inSingle fmt.Stringer) string { if len(inSlice) > 0 { return strings.Join(inSlice, ",") } if inSingle == nil { return "" } return inSingle.String() } func containsNonLocalIPv6(in []net.IP) bool { for _, ip := range in { if ip == nil || ip.IsLoopback() || ip.IsUnspecified() { continue } if ip.To4() == nil && ip.To16() != nil { return true } } return false } // ImageVersions holds all the images (and their versions) that are rendered into the templates. type ImageVersions struct { Etcd string Flannel string FlannelCNI string Calico string CalicoCNI string CoreDNS string Hyperkube string Kenc string PodCheckpointer string } // NewDefaultAssets returns a list of default assets, optionally // configured via a user provided AssetConfig. Default assets include // TLS assets (certs, keys and secrets), and k8s component manifests. func NewDefaultAssets(conf Config) (Assets, error) { conf.BootstrapSecretsSubdir = path.Base(BootstrapSecretsDir) as := newStaticAssets(conf.Images) as = append(as, newDynamicAssets(conf)...) // Add kube-apiserver service IP if len(conf.APIServiceIPs) > 0 { conf.AltNames.IPs = append(conf.AltNames.IPs, conf.APIServiceIPs...) } else { conf.AltNames.IPs = append(conf.AltNames.IPs, conf.APIServiceIP) } // Create a CA if none was provided. if conf.CACert == nil { var err error conf.CAPrivKey, conf.CACert, err = newCACert() if err != nil { return Assets{}, err } } // TLS assets tlsAssets, err := newTLSAssets(conf.CACert, conf.CAPrivKey, *conf.AltNames) if err != nil { return Assets{}, err } as = append(as, tlsAssets...) // etcd TLS assets. if conf.EtcdUseTLS { etcdTLSAssets, err := newEtcdTLSAssets(conf.EtcdCACert, conf.EtcdClientCert, conf.EtcdClientKey, conf.CACert, conf.CAPrivKey, conf.EtcdServers) if err != nil { return Assets{}, err } as = append(as, etcdTLSAssets...) } kubeConfigAssets, err := newKubeConfigAssets(as, conf) if err != nil { return Assets{}, err } as = append(as, kubeConfigAssets...) // K8S APIServer secret apiSecret, err := newAPIServerSecretAsset(as, conf.EtcdUseTLS) if err != nil { return Assets{}, err } as = append(as, apiSecret) // K8S ControllerManager secret cmSecret, err := newControllerManagerSecretAsset(as) if err != nil { return Assets{}, err } as = append(as, cmSecret) return as, nil } type Asset struct { Name string Data []byte } type Assets []Asset func (as Assets) Get(name string) (Asset, error) { for _, asset := range as { if asset.Name == name { return asset, nil } } return Asset{}, fmt.Errorf("asset %q does not exist", name) } func (as Assets) WriteFiles(path string) error { if err := os.MkdirAll(path, 0755); err != nil { return err } files, err := ioutil.ReadDir(path) if err != nil { return err } if len(files) > 0 { return errors.New("asset directory must be empty") } for _, asset := range as { if err := asset.WriteFile(path); err != nil { return err } } return nil } func (a Asset) WriteFile(path string) error { f := filepath.Join(path, a.Name) if err := os.MkdirAll(filepath.Dir(f), 0755); err != nil { return err } fmt.Printf("Writing asset: %s\n", f) return ioutil.WriteFile(f, a.Data, 0600) } ================================================ FILE: cmd/render/plugin/default/asset/asset_test.go ================================================ package asset import ( "net" "strings" "testing" ) type f struct { M string } func (f *f) String() string { return f.M } func TestJoinStringsFromSliceOrSingle(t *testing.T) { var out string testSingle := &f{M: "hello"} emptySingle := &f{M: ""} testSlice := []string{"Hello", "World"} if out = joinStringsFromSliceOrSingle(nil, testSingle); out != testSingle.String() { t.Errorf("single-only test failed: expected '%s', got '%s'", testSingle, out) } if out = joinStringsFromSliceOrSingle(testSlice, emptySingle); out != strings.Join(testSlice, ",") { t.Errorf("slice-only test failed: expected '%s', got '%s'", strings.Join(testSlice, ","), out) } if out = joinStringsFromSliceOrSingle(testSlice, testSingle); out != strings.Join(testSlice, ",") { t.Errorf("single+slice test failed: expected '%s', got '%s'", strings.Join(testSlice, ","), out) } if out = joinStringsFromSliceOrSingle(nil, emptySingle); out != "" { t.Errorf("empty test failed: expected '%s', got '%s'", "", out) } } func TestContainsNonLocalIPv6(t *testing.T) { ipv4Loopback := net.ParseIP("127.0.0.1") ipv4PublicUnicast := net.ParseIP("8.8.8.8") ipv4PrivateUnicast := net.ParseIP("192.168.1.2") ipv4Multicast := net.ParseIP("224.10.20.30") ipv6Loopback := net.ParseIP("::1") ipv6Unicast := net.ParseIP("2001:db8::1") ipv6LinkLocal := net.ParseIP("fe80::db8:2") ipv6Multicast := net.ParseIP("ff00::db8:3") if containsNonLocalIPv6(nil) { t.Errorf("empty set failed") } if containsNonLocalIPv6([]net.IP{ipv4Loopback, ipv4PublicUnicast, ipv4PrivateUnicast, ipv4Multicast, ipv6Loopback}) { t.Errorf("all-false set check failed") } if !containsNonLocalIPv6([]net.IP{ipv6Unicast}) { t.Errorf("single-true set failed") } if !containsNonLocalIPv6([]net.IP{ipv6LinkLocal, ipv4Loopback}) { t.Errorf("true+v4Loop set failed") } if !containsNonLocalIPv6([]net.IP{ipv6Loopback, ipv6Multicast}) { t.Errorf("true+v6Loop set failed") } } func TestStringerSlice(t *testing.T) { var out []string if out = stringerSlice(nil); out != nil { t.Errorf("nil input test did not have nil output: %v", out) } testNilSlice := []net.IP{} out = stringerSlice(testNilSlice) if len(out) != len(testNilSlice) { t.Errorf("output mismatch (%d) for testNilSlice (%d)", len(out), len(testNilSlice)) } testNonStringerSlice := []int{1, 2, 3, 4} out = stringerSlice(testNonStringerSlice) for i, s := range out { if s != "" { t.Errorf("nonStringerSlice[%d] produced non-nil output: %s", i, s) } } testNormal1 := []net.IP{net.ParseIP("127.0.0.1"), net.ParseIP("0.0.0.0")} out = stringerSlice(testNormal1) if len(out) != len(testNormal1) { t.Errorf("output mismatch (%d) for testNormal1 (%d)", len(out), len(testNormal1)) } if out[0] != testNormal1[0].String() { t.Errorf("output index 0 mismatch (%s) on testNormal (%s)", out[0], testNormal1[0].String()) } if out[1] != testNormal1[1].String() { t.Errorf("output index 1 mismatch (%s) on testNormal (%s)", out[1], testNormal1[1].String()) } } ================================================ FILE: cmd/render/plugin/default/asset/images.go ================================================ package asset // DefaultImages are the defualt images bootkube components use. var DefaultImages = ImageVersions{ Etcd: "quay.io/coreos/etcd:v3.3.12", Flannel: "quay.io/coreos/flannel:v0.11.0-amd64", FlannelCNI: "quay.io/coreos/flannel-cni:v0.3.0", Calico: "quay.io/calico/node:v3.0.3", CalicoCNI: "quay.io/calico/cni:v2.0.0", CoreDNS: "k8s.gcr.io/coredns:1.6.5", Hyperkube: "k8s.gcr.io/hyperkube:v1.16.2", PodCheckpointer: "quay.io/coreos/pod-checkpointer:83e25e5968391b9eb342042c435d1b3eeddb2be1", } ================================================ FILE: cmd/render/plugin/default/asset/internal/templates.go ================================================ // Package internal holds asset templates used by bootkube. package internal var AdminKubeConfigTemplate = []byte(`apiVersion: v1 kind: Config clusters: - name: {{ or .Cluster "local" }} cluster: server: {{ .Server }} certificate-authority-data: {{ .CACert }} users: - name: admin user: client-certificate-data: {{ .AdminCert }} client-key-data: {{ .AdminKey }} contexts: - context: cluster: {{ or .Cluster "local" }} user: admin name: admin@{{ or .Cluster "local" }} current-context: admin@{{ or .Cluster "local" }} `) var KubeletKubeConfigTemplate = []byte(`apiVersion: v1 kind: Config clusters: - name: local cluster: server: {{ .Server }} certificate-authority-data: {{ .CACert }} users: - name: kubelet user: token: {{ .BootstrapTokenID }}.{{ .BootstrapTokenSecret }} contexts: - context: cluster: local user: kubelet `) var KubeletBootstrappingToken = []byte(`apiVersion: v1 kind: Secret metadata: name: bootstrap-token-{{ .BootstrapTokenID }} namespace: kube-system type: bootstrap.kubernetes.io/token stringData: token-id: "{{ .BootstrapTokenID }}" token-secret: "{{ .BootstrapTokenSecret }}" usage-bootstrap-authentication: "true" `) // CSRNodeBootstrapTemplate lets bootstrapping tokens and nodes request CSRs. var CSRNodeBootstrapTemplate = []byte(`kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: system-bootstrap-node-bootstrapper subjects: - kind: Group name: system:bootstrappers apiGroup: rbac.authorization.k8s.io - kind: Group name: system:nodes apiGroup: rbac.authorization.k8s.io roleRef: kind: ClusterRole name: system:node-bootstrapper apiGroup: rbac.authorization.k8s.io `) // CSRApproverRoleBindingTemplate instructs the csrapprover controller to // automatically approve CSRs made by bootstrapping tokens for client // credentials. // // This binding should be removed to disable CSR auto-approval. var CSRApproverRoleBindingTemplate = []byte(`kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: system-bootstrap-approve-node-client-csr subjects: - kind: Group name: system:bootstrappers apiGroup: rbac.authorization.k8s.io roleRef: kind: ClusterRole name: system:certificates.k8s.io:certificatesigningrequests:nodeclient apiGroup: rbac.authorization.k8s.io `) // CSRRenewalRoleBindingTemplate instructs the csrapprover controller to // automatically approve all CSRs made by nodes to renew their client // certificates. // // This binding should be altered in the future to hold a list of node // names instead of targeting `system:nodes` so we can revoke invidivual // node's ability to renew its certs. var CSRRenewalRoleBindingTemplate = []byte(`kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: system-bootstrap-node-renewal subjects: - kind: Group name: system:nodes apiGroup: rbac.authorization.k8s.io roleRef: kind: ClusterRole name: system:certificates.k8s.io:certificatesigningrequests:selfnodeclient apiGroup: rbac.authorization.k8s.io `) var KubeSystemSARoleBindingTemplate = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: system:default-sa subjects: - kind: ServiceAccount name: default namespace: kube-system roleRef: kind: ClusterRole name: cluster-admin apiGroup: rbac.authorization.k8s.io `) var APIServerTemplate = []byte(`apiVersion: apps/v1 kind: DaemonSet metadata: name: kube-apiserver namespace: kube-system labels: tier: control-plane k8s-app: kube-apiserver spec: selector: matchLabels: tier: control-plane k8s-app: kube-apiserver template: metadata: labels: tier: control-plane k8s-app: kube-apiserver annotations: checkpointer.alpha.coreos.com/checkpoint: "true" spec: containers: - name: kube-apiserver image: {{ .Images.Hyperkube }} command: - /hyperkube - kube-apiserver - --enable-admission-plugins=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeClaimResize,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,Priority,NodeRestriction - --advertise-address=$(POD_IP) - --allow-privileged=true - --anonymous-auth=false - --authorization-mode=Node,RBAC - --bind-address={{ .BindAllAddress }} - --client-ca-file=/etc/kubernetes/secrets/ca.crt - --requestheader-client-ca-file=/etc/kubernetes/secrets/front-proxy-ca.crt - --requestheader-allowed-names=front-proxy-client - --requestheader-extra-headers-prefix=X-Remote-Extra- - --requestheader-group-headers=X-Remote-Group - --requestheader-username-headers=X-Remote-User - --proxy-client-cert-file=/etc/kubernetes/secrets/front-proxy-client.crt - --proxy-client-key-file=/etc/kubernetes/secrets/front-proxy-client.key - --cloud-provider={{ .CloudProvider }} - --enable-bootstrap-token-auth=true {{- if .EtcdUseTLS }} - --etcd-cafile=/etc/kubernetes/secrets/etcd-client-ca.crt - --etcd-certfile=/etc/kubernetes/secrets/etcd-client.crt - --etcd-keyfile=/etc/kubernetes/secrets/etcd-client.key {{- end }} - --etcd-servers={{ range $i, $e := .EtcdServers }}{{ if $i }},{{end}}{{ $e }}{{end}} - --insecure-port=0 - --kubelet-client-certificate=/etc/kubernetes/secrets/apiserver-kubelet-client.crt - --kubelet-client-key=/etc/kubernetes/secrets/apiserver-kubelet-client.key - --secure-port={{ (index .APIServers 0).Port }} - --service-account-key-file=/etc/kubernetes/secrets/service-account.pub - --service-cluster-ip-range={{ .ServiceCIDRsString }} - --tls-cert-file=/etc/kubernetes/secrets/apiserver.crt - --tls-private-key-file=/etc/kubernetes/secrets/apiserver.key env: - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP volumeMounts: - mountPath: /etc/ssl/certs name: ssl-certs-host readOnly: true - mountPath: /etc/kubernetes/secrets name: secrets readOnly: true hostNetwork: true nodeSelector: node-role.kubernetes.io/master: "" tolerations: - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule volumes: - name: ssl-certs-host hostPath: path: /usr/share/ca-certificates - name: secrets secret: secretName: kube-apiserver securityContext: runAsNonRoot: true runAsUser: 65534 updateStrategy: rollingUpdate: maxUnavailable: 1 type: RollingUpdate `) var BootstrapAPIServerTemplate = []byte(`apiVersion: v1 kind: Pod metadata: name: bootstrap-kube-apiserver namespace: kube-system spec: containers: - name: kube-apiserver image: {{ .Images.Hyperkube }} command: - /hyperkube - kube-apiserver - --advertise-address=$(POD_IP) - --allow-privileged=true - --authorization-mode=Node,RBAC - --bind-address={{ .BindAllAddress }} - --client-ca-file=/etc/kubernetes/secrets/ca.crt - --requestheader-client-ca-file=/etc/kubernetes/secrets/front-proxy-ca.crt - --requestheader-allowed-names=front-proxy-client - --requestheader-extra-headers-prefix=X-Remote-Extra- - --requestheader-group-headers=X-Remote-Group - --requestheader-username-headers=X-Remote-User - --proxy-client-cert-file=/etc/kubernetes/secrets/front-proxy-client.crt - --proxy-client-key-file=/etc/kubernetes/secrets/front-proxy-client.key - --enable-admission-plugins=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeClaimResize,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,Priority,NodeRestriction - --enable-bootstrap-token-auth=true {{- if .EtcdUseTLS }} - --etcd-cafile=/etc/kubernetes/secrets/etcd-client-ca.crt - --etcd-certfile=/etc/kubernetes/secrets/etcd-client.crt - --etcd-keyfile=/etc/kubernetes/secrets/etcd-client.key {{- end }} - --etcd-servers={{ range $i, $e := .EtcdServers }}{{ if $i }},{{end}}{{ $e }}{{end}} - --kubelet-client-certificate=/etc/kubernetes/secrets/apiserver-kubelet-client.crt - --kubelet-client-key=/etc/kubernetes/secrets/apiserver-kubelet-client.key - --secure-port={{ (index .APIServers 0).Port }} - --service-account-key-file=/etc/kubernetes/secrets/service-account.pub - --service-cluster-ip-range={{ .ServiceCIDRsString }} - --cloud-provider={{ .CloudProvider }} - --tls-cert-file=/etc/kubernetes/secrets/apiserver.crt - --tls-private-key-file=/etc/kubernetes/secrets/apiserver.key env: - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP volumeMounts: - mountPath: /etc/ssl/certs name: ssl-certs-host readOnly: true - mountPath: /etc/kubernetes/secrets name: secrets readOnly: true hostNetwork: true volumes: - name: secrets hostPath: path: /etc/kubernetes/{{ .BootstrapSecretsSubdir }} - name: ssl-certs-host hostPath: path: /usr/share/ca-certificates `) var CheckpointerTemplate = []byte(`apiVersion: apps/v1 kind: DaemonSet metadata: name: pod-checkpointer namespace: kube-system labels: tier: control-plane k8s-app: pod-checkpointer spec: selector: matchLabels: tier: control-plane k8s-app: pod-checkpointer template: metadata: labels: tier: control-plane k8s-app: pod-checkpointer annotations: checkpointer.alpha.coreos.com/checkpoint: "true" spec: containers: - name: pod-checkpointer image: {{ .Images.PodCheckpointer }} command: - /checkpoint - --lock-file=/var/run/lock/pod-checkpointer.lock - --kubeconfig=/etc/checkpointer/kubeconfig - --checkpoint-grace-period=5m env: - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName - name: POD_NAME valueFrom: fieldRef: fieldPath: metadata.name - name: POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace imagePullPolicy: Always volumeMounts: - mountPath: /etc/checkpointer name: kubeconfig - mountPath: /etc/kubernetes name: etc-kubernetes - mountPath: /var/run name: var-run serviceAccountName: pod-checkpointer hostNetwork: true nodeSelector: node-role.kubernetes.io/master: "" restartPolicy: Always tolerations: - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule volumes: - name: kubeconfig configMap: name: kubeconfig-in-cluster - name: etc-kubernetes hostPath: path: /etc/kubernetes - name: var-run hostPath: path: /var/run updateStrategy: rollingUpdate: maxUnavailable: 1 type: RollingUpdate `) var CheckpointerServiceAccount = []byte(`apiVersion: v1 kind: ServiceAccount metadata: namespace: kube-system name: pod-checkpointer `) var CheckpointerRole = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: pod-checkpointer namespace: kube-system rules: - apiGroups: [""] # "" indicates the core API group resources: ["pods"] verbs: ["get", "watch", "list"] - apiGroups: [""] # "" indicates the core API group resources: ["secrets", "configmaps"] verbs: ["get"] `) var CheckpointerRoleBinding = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: pod-checkpointer namespace: kube-system roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: pod-checkpointer subjects: - kind: ServiceAccount name: pod-checkpointer namespace: kube-system `) var CheckpointerClusterRole = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: pod-checkpointer rules: - apiGroups: [""] resources: ["nodes", "nodes/proxy"] verbs: ["get"] `) var CheckpointerClusterRoleBinding = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: pod-checkpointer roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: pod-checkpointer subjects: - kind: ServiceAccount name: pod-checkpointer namespace: kube-system `) var ControllerManagerTemplate = []byte(`apiVersion: apps/v1 kind: Deployment metadata: name: kube-controller-manager namespace: kube-system labels: tier: control-plane k8s-app: kube-controller-manager spec: replicas: 2 selector: matchLabels: tier: control-plane k8s-app: kube-controller-manager template: metadata: labels: tier: control-plane k8s-app: kube-controller-manager spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: tier operator: In values: - control-plane - key: k8s-app operator: In values: - kube-controller-manager topologyKey: kubernetes.io/hostname containers: - name: kube-controller-manager image: {{ .Images.Hyperkube }} command: - ./hyperkube - kube-controller-manager - --use-service-account-credentials - --allocate-node-cidrs=true - --cloud-provider={{ .CloudProvider }} - --cluster-cidr={{ .PodCIDRsString }} - --service-cluster-ip-range={{ .ServiceCIDRsString }} - --cluster-signing-cert-file=/etc/kubernetes/secrets/ca.crt - --cluster-signing-key-file=/etc/kubernetes/secrets/ca.key - --configure-cloud-routes=false - --leader-elect=true - --root-ca-file=/etc/kubernetes/secrets/ca.crt - --service-account-private-key-file=/etc/kubernetes/secrets/service-account.key livenessProbe: httpGet: path: /healthz port: 10252 # Note: Using default port. Update if --port option is set differently. initialDelaySeconds: 15 timeoutSeconds: 15 volumeMounts: - name: var-run-kubernetes mountPath: /var/run/kubernetes - name: secrets mountPath: /etc/kubernetes/secrets readOnly: true - name: ssl-host mountPath: /etc/ssl/certs readOnly: true nodeSelector: node-role.kubernetes.io/master: "" securityContext: runAsNonRoot: true runAsUser: 65534 serviceAccountName: kube-controller-manager tolerations: - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule volumes: - name: var-run-kubernetes emptyDir: {} - name: secrets secret: secretName: kube-controller-manager - name: ssl-host hostPath: path: /usr/share/ca-certificates dnsPolicy: ClusterFirstWithHostNet `) var ControllerManagerServiceAccount = []byte(`apiVersion: v1 kind: ServiceAccount metadata: namespace: kube-system name: kube-controller-manager `) var ControllerManagerClusterRoleBinding = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: controller-manager roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: system:kube-controller-manager subjects: - kind: ServiceAccount name: kube-controller-manager namespace: kube-system `) var BootstrapControllerManagerTemplate = []byte(`apiVersion: v1 kind: Pod metadata: name: bootstrap-kube-controller-manager namespace: kube-system spec: containers: - name: kube-controller-manager image: {{ .Images.Hyperkube }} command: - ./hyperkube - kube-controller-manager - --allocate-node-cidrs=true - --cluster-cidr={{ .PodCIDRsString }} - --service-cluster-ip-range={{ .ServiceCIDRsString }} - --cloud-provider={{ .CloudProvider }} - --cluster-signing-cert-file=/etc/kubernetes/secrets/ca.crt - --cluster-signing-key-file=/etc/kubernetes/secrets/ca.key - --configure-cloud-routes=false - --kubeconfig=/etc/kubernetes/secrets/kubeconfig - --leader-elect=true - --root-ca-file=/etc/kubernetes/secrets/ca.crt - --service-account-private-key-file=/etc/kubernetes/secrets/service-account.key volumeMounts: - name: secrets mountPath: /etc/kubernetes/secrets readOnly: true - name: ssl-host mountPath: /etc/ssl/certs readOnly: true hostNetwork: true volumes: - name: secrets hostPath: path: /etc/kubernetes/{{ .BootstrapSecretsSubdir }} - name: ssl-host hostPath: path: /usr/share/ca-certificates `) var ControllerManagerDisruptionTemplate = []byte(`apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: name: kube-controller-manager namespace: kube-system spec: minAvailable: 1 selector: matchLabels: tier: control-plane k8s-app: kube-controller-manager `) var SchedulerTemplate = []byte(`apiVersion: apps/v1 kind: Deployment metadata: name: kube-scheduler namespace: kube-system labels: tier: control-plane k8s-app: kube-scheduler spec: replicas: 2 selector: matchLabels: tier: control-plane k8s-app: kube-scheduler template: metadata: labels: tier: control-plane k8s-app: kube-scheduler spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: tier operator: In values: - control-plane - key: k8s-app operator: In values: - kube-scheduler topologyKey: kubernetes.io/hostname containers: - name: kube-scheduler image: {{ .Images.Hyperkube }} command: - ./hyperkube - kube-scheduler - --leader-elect=true livenessProbe: httpGet: path: /healthz port: 10251 # Note: Using default port. Update if --port option is set differently. initialDelaySeconds: 15 timeoutSeconds: 15 nodeSelector: node-role.kubernetes.io/master: "" securityContext: runAsNonRoot: true runAsUser: 65534 tolerations: - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule `) var BootstrapSchedulerTemplate = []byte(`apiVersion: v1 kind: Pod metadata: name: bootstrap-kube-scheduler namespace: kube-system spec: containers: - name: kube-scheduler image: {{ .Images.Hyperkube }} command: - ./hyperkube - kube-scheduler - --kubeconfig=/etc/kubernetes/secrets/kubeconfig - --leader-elect=true volumeMounts: - name: secrets mountPath: /etc/kubernetes/secrets readOnly: true hostNetwork: true volumes: - name: secrets hostPath: path: /etc/kubernetes/{{ .BootstrapSecretsSubdir }} `) var SchedulerDisruptionTemplate = []byte(`apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: name: kube-scheduler namespace: kube-system spec: minAvailable: 1 selector: matchLabels: tier: control-plane k8s-app: kube-scheduler `) var ProxyTemplate = []byte(`apiVersion: apps/v1 kind: DaemonSet metadata: name: kube-proxy namespace: kube-system labels: tier: node k8s-app: kube-proxy spec: selector: matchLabels: tier: node k8s-app: kube-proxy template: metadata: labels: tier: node k8s-app: kube-proxy spec: containers: - name: kube-proxy image: {{ .Images.Hyperkube }} command: - ./hyperkube - kube-proxy - --cluster-cidr={{ .PodCIDRsString }} - --hostname-override=$(NODE_NAME) - --kubeconfig=/etc/kubernetes/kubeconfig - --proxy-mode=iptables env: - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName securityContext: privileged: true volumeMounts: - mountPath: /lib/modules name: lib-modules readOnly: true - mountPath: /etc/ssl/certs name: ssl-certs-host readOnly: true - name: kubeconfig mountPath: /etc/kubernetes readOnly: true hostNetwork: true serviceAccountName: kube-proxy tolerations: - effect: NoSchedule operator: Exists - effect: NoExecute operator: Exists volumes: - name: lib-modules hostPath: path: /lib/modules - name: ssl-certs-host hostPath: path: /usr/share/ca-certificates - name: kubeconfig configMap: name: kubeconfig-in-cluster updateStrategy: rollingUpdate: maxUnavailable: 1 type: RollingUpdate `) var ProxyServiceAccount = []byte(`apiVersion: v1 kind: ServiceAccount metadata: namespace: kube-system name: kube-proxy `) var ProxyClusterRoleBinding = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: kube-proxy roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: system:node-proxier # Automatically created system role. subjects: - kind: ServiceAccount name: kube-proxy namespace: kube-system `) // KubeConfigInCluster instructs clients to use their service account token, // but unlike an in-cluster client doesn't rely on the `KUBERNETES_SERVICE_PORT` // and `KUBERNETES_PORT` to determine the API servers address. // // This kubeconfig is used by bootstrapping pods that might not have access to // these env vars, such as kube-proxy, which sets up the API server endpoint // (chicken and egg), and the checkpointer, which needs to run as a static pod // even if the API server isn't available. var KubeConfigInClusterTemplate = []byte(`apiVersion: v1 kind: ConfigMap metadata: name: kubeconfig-in-cluster namespace: kube-system data: kubeconfig: | apiVersion: v1 clusters: - name: local cluster: server: {{ .Server }} certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt users: - name: service-account user: # Use service account token tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token contexts: - context: cluster: local user: service-account `) var CoreDNSClusterRoleBindingTemplate = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: system:coredns labels: kubernetes.io/bootstrapping: rbac-defaults annotations: rbac.authorization.kubernetes.io/autoupdate: "true" roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: system:coredns subjects: - kind: ServiceAccount name: coredns namespace: kube-system `) var CoreDNSClusterRoleTemplate = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: system:coredns labels: kubernetes.io/bootstrapping: rbac-defaults rules: - apiGroups: [""] resources: - endpoints - services - pods - namespaces verbs: - list - watch - apiGroups: [""] resources: - nodes verbs: - get `) var CoreDNSConfigTemplate = []byte(`apiVersion: v1 kind: ConfigMap metadata: name: coredns namespace: kube-system data: Corefile: | .:53 { errors health { lameduck 5s } ready log . { class error } kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } prometheus :9153 forward . /etc/resolv.conf cache 30 loop reload loadbalance } `) var CoreDNSDeploymentTemplate = []byte(`apiVersion: apps/v1 kind: Deployment metadata: name: coredns namespace: kube-system labels: k8s-app: kube-dns kubernetes.io/name: "CoreDNS" kubernetes.io/cluster-service: "true" spec: replicas : 2 strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 1 selector: matchLabels: k8s-app: coredns template: metadata: labels: k8s-app: coredns annotations: seccomp.security.alpha.kubernetes.io/pod: 'docker/default' spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: k8s-app operator: In values: - coredns topologyKey: kubernetes.io/hostname serviceAccountName: coredns tolerations: - key: node-role.kubernetes.io/master effect: NoSchedule containers: - name: coredns image: {{ .Images.CoreDNS }} imagePullPolicy: IfNotPresent resources: limits: memory: 170Mi requests: cpu: 100m memory: 70Mi args: [ "-conf", "/etc/coredns/Corefile" ] volumeMounts: - name: config-volume mountPath: /etc/coredns readOnly: true ports: - name: dns protocol: UDP containerPort: 53 - name: dns-tcp protocol: TCP containerPort: 53 - name: metrics protocol: TCP containerPort: 9153 livenessProbe: httpGet: path: /health port: 8080 scheme: HTTP initialDelaySeconds: 60 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 5 readinessProbe: httpGet: path: /ready port: 8181 scheme: HTTP securityContext: allowPrivilegeEscalation: false capabilities: add: - NET_BIND_SERVICE drop: - all readOnlyRootFilesystem: true dnsPolicy: Default volumes: - name: config-volume configMap: name: coredns items: - key: Corefile path: Corefile `) var CoreDNSServiceAccountTemplate = []byte(`apiVersion: v1 kind: ServiceAccount metadata: name: coredns namespace: kube-system labels: kubernetes.io/cluster-service: "true" `) var CoreDNSSvcTemplate = []byte(`apiVersion: v1 kind: Service metadata: name: kube-dns namespace: kube-system annotations: prometheus.io/scrape: "true" prometheus.io/port: "9153" labels: k8s-app: kube-dns kubernetes.io/cluster-service: "true" kubernetes.io/name: "CoreDNS" spec: selector: k8s-app: kube-dns clusterIP: {{ .DNSServiceIPsString }} ports: - name: dns port: 53 protocol: UDP - name: dns-tcp port: 53 protocol: TCP `) var FlannelClusterRole = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: flannel rules: - apiGroups: - "" resources: - pods verbs: - get - apiGroups: - "" resources: - nodes verbs: - list - watch - apiGroups: - "" resources: - nodes/status verbs: - patch `) var FlannelClusterRoleBinding = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: flannel roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: flannel subjects: - kind: ServiceAccount name: flannel namespace: kube-system `) var FlannelServiceAccount = []byte(`apiVersion: v1 kind: ServiceAccount metadata: name: flannel namespace: kube-system `) var FlannelCfgTemplate = []byte(`apiVersion: v1 kind: ConfigMap metadata: name: kube-flannel-cfg namespace: kube-system labels: tier: node k8s-app: flannel data: cni-conf.json: | { "name": "cbr0", "cniVersion": "0.3.1", "plugins": [ { "type": "flannel", "delegate": { "hairpinMode": true, "isDefaultGateway": true } }, { "type": "portmap", "capabilities": { "portMappings": true } } ] } net-conf.json: | { "Network": "{{ .PodCIDR }}", "Backend": { "Type": "vxlan", "Port": 4789 } } `) var FlannelTemplate = []byte(`apiVersion: apps/v1 kind: DaemonSet metadata: name: kube-flannel namespace: kube-system labels: tier: node k8s-app: flannel spec: selector: matchLabels: tier: node k8s-app: flannel template: metadata: labels: tier: node k8s-app: flannel spec: serviceAccountName: flannel containers: - name: kube-flannel image: {{ .Images.Flannel }} command: [ "/opt/bin/flanneld", "--ip-masq", "--kube-subnet-mgr", "--iface=$(POD_IP)"] securityContext: privileged: true env: - name: POD_NAME valueFrom: fieldRef: fieldPath: metadata.name - name: POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP volumeMounts: - name: run mountPath: /run - name: cni mountPath: /etc/cni/net.d - name: flannel-cfg mountPath: /etc/kube-flannel/ - name: install-cni image: {{ .Images.FlannelCNI }} command: ["/install-cni.sh"] env: - name: CNI_NETWORK_CONFIG valueFrom: configMapKeyRef: name: kube-flannel-cfg key: cni-conf.json volumeMounts: - name: cni mountPath: /host/etc/cni/net.d - name: host-cni-bin mountPath: /host/opt/cni/bin/ hostNetwork: true tolerations: - effect: NoSchedule operator: Exists - effect: NoExecute operator: Exists volumes: - name: run hostPath: path: /run - name: cni hostPath: path: /etc/kubernetes/cni/net.d - name: flannel-cfg configMap: name: kube-flannel-cfg - name: host-cni-bin hostPath: path: /opt/cni/bin updateStrategy: rollingUpdate: maxUnavailable: 1 type: RollingUpdate `) var CalicoCfgTemplate = []byte(`apiVersion: v1 kind: ConfigMap metadata: name: calico-config namespace: kube-system data: # Typha is still listed as a beta feature. Hence disabling it. typha_service_name: "none" # The CNI network configuration to install on each node. cni_network_config: |- { "name": "k8s-pod-network", "cniVersion": "0.3.1", "plugins": [ { "type": "calico", "log_level": "info", "datastore_type": "kubernetes", "nodename": "__KUBERNETES_NODE_NAME__", "ipam": { "type": "host-local", "subnet": "usePodCidr" }, "policy": { "type": "k8s", "k8s_auth_token": "__SERVICEACCOUNT_TOKEN__" }, "kubernetes": { "k8s_api_root": "https://__KUBERNETES_SERVICE_HOST__:__KUBERNETES_SERVICE_PORT__", "kubeconfig": "__KUBECONFIG_FILEPATH__" } }, { "type": "portmap", "snat": true, "capabilities": {"portMappings": true} } ] } `) var CalicoNodeTemplate = []byte(`apiVersion: apps/v1 kind: DaemonSet metadata: name: calico-node namespace: kube-system labels: k8s-app: calico-node spec: selector: matchLabels: k8s-app: calico-node template: metadata: labels: k8s-app: calico-node spec: hostNetwork: true serviceAccountName: calico-node tolerations: - effect: NoSchedule operator: Exists - effect: NoExecute operator: Exists containers: - name: calico-node image: {{ .Images.Calico }} env: - name: DATASTORE_TYPE value: "kubernetes" - name: FELIX_LOGSEVERITYSCREEN value: "info" - name: CLUSTER_TYPE value: "k8s,bgp" - name: CALICO_DISABLE_FILE_LOGGING value: "true" - name: FELIX_DEFAULTENDPOINTTOHOSTACTION value: "ACCEPT" - name: FELIX_IPV6SUPPORT value: "false" - name: FELIX_IPINIPMTU value: "1440" - name: WAIT_FOR_DATASTORE value: "true" - name: CALICO_IPV4POOL_CIDR value: "{{ .PodCIDR }}" - name: CALICO_IPV4POOL_IPIP value: "Always" - name: FELIX_IPINIPENABLED value: "true" - name: FELIX_TYPHAK8SSERVICENAME valueFrom: configMapKeyRef: name: calico-config key: typha_service_name - name: NODENAME valueFrom: fieldRef: fieldPath: spec.nodeName - name: IP value: "autodetect" - name: FELIX_HEALTHENABLED value: "true" securityContext: privileged: true resources: requests: cpu: 250m livenessProbe: httpGet: path: /liveness port: 9099 periodSeconds: 10 initialDelaySeconds: 10 failureThreshold: 6 readinessProbe: httpGet: path: /readiness port: 9099 periodSeconds: 10 volumeMounts: - mountPath: /lib/modules name: lib-modules readOnly: true - mountPath: /var/run/calico name: var-run-calico readOnly: false - name: install-cni image: {{ .Images.CalicoCNI }} command: ["/install-cni.sh"] env: - name: CNI_CONF_NAME value: "10-calico.conflist" - name: CNI_NETWORK_CONFIG valueFrom: configMapKeyRef: name: calico-config key: cni_network_config - name: CNI_NET_DIR value: "/etc/kubernetes/cni/net.d" - name: KUBERNETES_NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName volumeMounts: - mountPath: /host/opt/cni/bin name: cni-bin-dir - mountPath: /host/etc/cni/net.d name: cni-net-dir terminationGracePeriodSeconds: 0 volumes: - name: lib-modules hostPath: path: /lib/modules - name: var-run-calico hostPath: path: /var/run/calico - name: cni-bin-dir hostPath: path: /opt/cni/bin - name: cni-net-dir hostPath: path: /etc/kubernetes/cni/net.d updateStrategy: rollingUpdate: maxUnavailable: 1 type: RollingUpdate `) var CalicoPolicyOnlyTemplate = []byte(`apiVersion: apps/v1 kind: DaemonSet metadata: name: calico-node namespace: kube-system labels: k8s-app: calico-node spec: selector: matchLabels: k8s-app: calico-node template: metadata: labels: k8s-app: calico-node spec: hostNetwork: true serviceAccountName: calico-node tolerations: - effect: NoSchedule operator: Exists - effect: NoExecute operator: Exists containers: - name: calico-node image: {{ .Images.Calico }} env: - name: DATASTORE_TYPE value: "kubernetes" - name: FELIX_LOGSEVERITYSCREEN value: "info" - name: CALICO_NETWORKING_BACKEND value: "none" - name: CLUSTER_TYPE value: "bootkube,canal" - name: CALICO_DISABLE_FILE_LOGGING value: "true" - name: FELIX_DEFAULTENDPOINTTOHOSTACTION value: "ACCEPT" - name: FELIX_IPV6SUPPORT value: "false" - name: WAIT_FOR_DATASTORE value: "true" - name: CALICO_IPV4POOL_CIDR value: "{{ .PodCIDR }}" - name: CALICO_IPV4POOL_IPIP value: "Always" - name: NODENAME valueFrom: fieldRef: fieldPath: spec.nodeName - name: IP value: "" - name: FELIX_HEALTHENABLED value: "true" securityContext: privileged: true resources: requests: cpu: 250m livenessProbe: httpGet: path: /liveness port: 9099 periodSeconds: 10 initialDelaySeconds: 10 failureThreshold: 6 readinessProbe: httpGet: path: /readiness port: 9099 periodSeconds: 10 volumeMounts: - mountPath: /lib/modules name: lib-modules readOnly: true - mountPath: /var/run/calico name: var-run-calico readOnly: false - name: install-cni image: {{ .Images.CalicoCNI }} command: ["/install-cni.sh"] env: - name: CNI_CONF_NAME value: "10-calico.conflist" - name: CNI_NETWORK_CONFIG valueFrom: configMapKeyRef: name: calico-config key: cni_network_config - name: CNI_NET_DIR value: "/etc/kubernetes/cni/net.d" - name: KUBERNETES_NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName - name: SKIP_CNI_BINARIES value: bridge,cnitool,dhcp,flannel,host-local,ipvlan,loopback,macvlan,noop,portmap,ptp,tuning volumeMounts: - mountPath: /host/opt/cni/bin name: cni-bin-dir - mountPath: /host/etc/cni/net.d name: cni-net-dir terminationGracePeriodSeconds: 0 volumes: - name: lib-modules hostPath: path: /lib/modules - name: var-run-calico hostPath: path: /var/run/calico - name: cni-bin-dir hostPath: path: /opt/cni/bin - name: cni-net-dir hostPath: path: /etc/kubernetes/cni/net.d updateStrategy: rollingUpdate: maxUnavailable: 1 type: RollingUpdate `) var CalicoGlobalNetworkPoliciesCRD = []byte(`apiVersion: apiextensions.k8s.io/v1beta1 description: Calico Global Network Policies kind: CustomResourceDefinition metadata: name: globalnetworkpolicies.crd.projectcalico.org spec: scope: Cluster group: crd.projectcalico.org version: v1 names: kind: GlobalNetworkPolicy plural: globalnetworkpolicies singular: globalnetworkpolicy `) var CalicoIPPoolsCRD = []byte(`apiVersion: apiextensions.k8s.io/v1beta1 description: Calico IP Pools kind: CustomResourceDefinition metadata: name: ippools.crd.projectcalico.org spec: scope: Cluster group: crd.projectcalico.org version: v1 names: kind: IPPool plural: ippools singular: ippool `) var CalicoBGPConfigurationsCRD = []byte(`apiVersion: apiextensions.k8s.io/v1beta1 description: Calico BGP Configuration kind: CustomResourceDefinition metadata: name: bgpconfigurations.crd.projectcalico.org spec: scope: Cluster group: crd.projectcalico.org version: v1 names: kind: BGPConfiguration plural: bgpconfigurations singular: bgpconfiguration `) var CalicoBGPPeersCRD = []byte(`apiVersion: apiextensions.k8s.io/v1beta1 description: Calico BGP Peers kind: CustomResourceDefinition metadata: name: bgppeers.crd.projectcalico.org spec: scope: Cluster group: crd.projectcalico.org version: v1 names: kind: BGPPeer plural: bgppeers singular: bgppeer `) var CalicoFelixConfigurationsCRD = []byte(`apiVersion: apiextensions.k8s.io/v1beta1 description: Calico Felix Configuration kind: CustomResourceDefinition metadata: name: felixconfigurations.crd.projectcalico.org spec: scope: Cluster group: crd.projectcalico.org version: v1 names: kind: FelixConfiguration plural: felixconfigurations singular: felixconfiguration `) var CalicoGlobalNetworkSetsCRD = []byte(`apiVersion: apiextensions.k8s.io/v1beta1 description: Calico Global Network Sets kind: CustomResourceDefinition metadata: name: globalnetworksets.crd.projectcalico.org spec: scope: Cluster group: crd.projectcalico.org version: v1 names: kind: GlobalNetworkSet plural: globalnetworksets singular: globalnetworkset `) var CalicoNetworkPoliciesCRD = []byte(`apiVersion: apiextensions.k8s.io/v1beta1 description: Calico Network Policies kind: CustomResourceDefinition metadata: name: networkpolicies.crd.projectcalico.org spec: scope: Namespaced group: crd.projectcalico.org version: v1 names: kind: NetworkPolicy plural: networkpolicies singular: networkpolicy `) var CalicoClusterInformationsCRD = []byte(`apiVersion: apiextensions.k8s.io/v1beta1 description: Calico Cluster Information kind: CustomResourceDefinition metadata: name: clusterinformations.crd.projectcalico.org spec: scope: Cluster group: crd.projectcalico.org version: v1 names: kind: ClusterInformation plural: clusterinformations singular: clusterinformation `) var CalicoServiceAccountTemplate = []byte(`apiVersion: v1 kind: ServiceAccount metadata: name: calico-node namespace: kube-system `) var CalicoRoleTemplate = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: calico-node rules: - apiGroups: [""] resources: ["namespaces"] verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["pods/status"] verbs: ["update"] - apiGroups: [""] resources: ["pods"] verbs: ["get", "list", "watch", "patch"] - apiGroups: [""] resources: ["services"] verbs: ["get"] - apiGroups: [""] resources: ["endpoints"] verbs: ["get"] - apiGroups: [""] resources: ["nodes"] verbs: ["get", "list", "update", "watch"] - apiGroups: ["extensions"] resources: ["networkpolicies"] verbs: ["get", "list", "watch"] - apiGroups: ["crd.projectcalico.org"] resources: ["globalfelixconfigs", "felixconfigurations", "bgppeers", "globalbgpconfigs", "bgpconfigurations", "ippools", "globalnetworkpolicies", "globalnetworksets", "networkpolicies", "clusterinformations"] verbs: ["create", "get", "list", "update", "watch"] `) var CalicoRoleBindingTemplate = []byte(`apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: calico-node roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: calico-node subjects: - kind: ServiceAccount name: calico-node namespace: kube-system `) // vim: set expandtab:tabstop=2 ================================================ FILE: cmd/render/plugin/default/asset/k8s.go ================================================ package asset import ( "bytes" "crypto/rand" "encoding/base64" "fmt" "path/filepath" "text/template" "github.com/ghodss/yaml" "github.com/kubernetes-sigs/bootkube/cmd/render/plugin/default/asset/internal" ) const ( // The name of the k8s service that selects self-hosted etcd pods EtcdServiceName = "etcd-service" SecretEtcdPeer = "etcd-peer-tls" SecretEtcdServer = "etcd-server-tls" SecretEtcdClient = "etcd-client-tls" NetworkFlannel = "flannel" NetworkCalico = "experimental-calico" NetworkCanal = "experimental-canal" secretNamespace = "kube-system" secretAPIServerName = "kube-apiserver" secretCMName = "kube-controller-manager" ) type staticConfig struct { Images ImageVersions } func newStaticAssets(imageVersions ImageVersions) Assets { conf := staticConfig{Images: imageVersions} assets := Assets{ MustCreateAssetFromTemplate(AssetPathScheduler, internal.SchedulerTemplate, conf), MustCreateAssetFromTemplate(AssetPathSchedulerDisruption, internal.SchedulerDisruptionTemplate, conf), MustCreateAssetFromTemplate(AssetPathControllerManagerDisruption, internal.ControllerManagerDisruptionTemplate, conf), MustCreateAssetFromTemplate(AssetPathCoreDNSClusterRoleBinding, internal.CoreDNSClusterRoleBindingTemplate, conf), MustCreateAssetFromTemplate(AssetPathCoreDNSClusterRole, internal.CoreDNSClusterRoleTemplate, conf), MustCreateAssetFromTemplate(AssetPathCoreDNSDeployment, internal.CoreDNSDeploymentTemplate, conf), MustCreateAssetFromTemplate(AssetPathCoreDNSSA, internal.CoreDNSServiceAccountTemplate, conf), MustCreateAssetFromTemplate(AssetPathCheckpointer, internal.CheckpointerTemplate, conf), MustCreateAssetFromTemplate(AssetPathCheckpointerSA, internal.CheckpointerServiceAccount, conf), MustCreateAssetFromTemplate(AssetPathCheckpointerRole, internal.CheckpointerRole, conf), MustCreateAssetFromTemplate(AssetPathCheckpointerRoleBinding, internal.CheckpointerRoleBinding, conf), MustCreateAssetFromTemplate(AssetPathCheckpointerClusterRole, internal.CheckpointerClusterRole, conf), MustCreateAssetFromTemplate(AssetPathCheckpointerClusterRoleBinding, internal.CheckpointerClusterRoleBinding, conf), MustCreateAssetFromTemplate(AssetPathCSRApproverRoleBinding, internal.CSRApproverRoleBindingTemplate, conf), MustCreateAssetFromTemplate(AssetPathCSRBootstrapRoleBinding, internal.CSRNodeBootstrapTemplate, conf), MustCreateAssetFromTemplate(AssetPathCSRRenewalRoleBinding, internal.CSRRenewalRoleBindingTemplate, conf), MustCreateAssetFromTemplate(AssetPathKubeSystemSARoleBinding, internal.KubeSystemSARoleBindingTemplate, conf), } return assets } func newDynamicAssets(conf Config) Assets { assets := Assets{ MustCreateAssetFromTemplate(AssetPathControllerManager, internal.ControllerManagerTemplate, conf), MustCreateAssetFromTemplate(AssetPathControllerManagerSA, internal.ControllerManagerServiceAccount, conf), MustCreateAssetFromTemplate(AssetPathControllerManagerRB, internal.ControllerManagerClusterRoleBinding, conf), MustCreateAssetFromTemplate(AssetPathAPIServer, internal.APIServerTemplate, conf), MustCreateAssetFromTemplate(AssetPathProxy, internal.ProxyTemplate, conf), MustCreateAssetFromTemplate(AssetPathProxySA, internal.ProxyServiceAccount, conf), MustCreateAssetFromTemplate(AssetPathProxyRoleBinding, internal.ProxyClusterRoleBinding, conf), MustCreateAssetFromTemplate(AssetPathCoreDNSConfig, internal.CoreDNSConfigTemplate, conf), MustCreateAssetFromTemplate(AssetPathCoreDNSSvc, internal.CoreDNSSvcTemplate, conf), MustCreateAssetFromTemplate(AssetPathBootstrapAPIServer, internal.BootstrapAPIServerTemplate, conf), MustCreateAssetFromTemplate(AssetPathBootstrapControllerManager, internal.BootstrapControllerManagerTemplate, conf), MustCreateAssetFromTemplate(AssetPathBootstrapScheduler, internal.BootstrapSchedulerTemplate, conf), } switch conf.NetworkProvider { case NetworkFlannel: assets = append(assets, MustCreateAssetFromTemplate(AssetPathFlannel, internal.FlannelTemplate, conf), MustCreateAssetFromTemplate(AssetPathFlannelCfg, internal.FlannelCfgTemplate, conf), MustCreateAssetFromTemplate(AssetPathFlannelClusterRole, internal.FlannelClusterRole, conf), MustCreateAssetFromTemplate(AssetPathFlannelClusterRoleBinding, internal.FlannelClusterRoleBinding, conf), MustCreateAssetFromTemplate(AssetPathFlannelSA, internal.FlannelServiceAccount, conf), ) case NetworkCalico: assets = append(assets, MustCreateAssetFromTemplate(AssetPathCalicoCfg, internal.CalicoCfgTemplate, conf), MustCreateAssetFromTemplate(AssetPathCalicoRole, internal.CalicoRoleTemplate, conf), MustCreateAssetFromTemplate(AssetPathCalicoRoleBinding, internal.CalicoRoleBindingTemplate, conf), MustCreateAssetFromTemplate(AssetPathCalicoSA, internal.CalicoServiceAccountTemplate, conf), MustCreateAssetFromTemplate(AssetPathCalico, internal.CalicoNodeTemplate, conf), MustCreateAssetFromTemplate(AssetPathCalicoBGPConfigurationsCRD, internal.CalicoBGPConfigurationsCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoBGPPeersCRD, internal.CalicoBGPPeersCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoFelixConfigurationsCRD, internal.CalicoFelixConfigurationsCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoGlobalNetworkPoliciesCRD, internal.CalicoGlobalNetworkPoliciesCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoGlobalNetworkSetsCRD, internal.CalicoGlobalNetworkSetsCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoNetworkPoliciesCRD, internal.CalicoNetworkPoliciesCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoClusterInformationsCRD, internal.CalicoClusterInformationsCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoIPPoolsCRD, internal.CalicoIPPoolsCRD, conf)) case NetworkCanal: assets = append(assets, MustCreateAssetFromTemplate(AssetPathCalicoCfg, internal.CalicoCfgTemplate, conf), MustCreateAssetFromTemplate(AssetPathCalicoRole, internal.CalicoRoleTemplate, conf), MustCreateAssetFromTemplate(AssetPathCalicoRoleBinding, internal.CalicoRoleBindingTemplate, conf), MustCreateAssetFromTemplate(AssetPathCalicoSA, internal.CalicoServiceAccountTemplate, conf), MustCreateAssetFromTemplate(AssetPathCalicoPolicyOnly, internal.CalicoPolicyOnlyTemplate, conf), MustCreateAssetFromTemplate(AssetPathCalicoBGPConfigurationsCRD, internal.CalicoBGPConfigurationsCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoBGPPeersCRD, internal.CalicoBGPPeersCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoFelixConfigurationsCRD, internal.CalicoFelixConfigurationsCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoGlobalNetworkPoliciesCRD, internal.CalicoGlobalNetworkPoliciesCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoGlobalNetworkSetsCRD, internal.CalicoGlobalNetworkSetsCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoGlobalNetworkPoliciesCRD, internal.CalicoGlobalNetworkPoliciesCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoNetworkPoliciesCRD, internal.CalicoNetworkPoliciesCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoClusterInformationsCRD, internal.CalicoClusterInformationsCRD, conf), MustCreateAssetFromTemplate(AssetPathCalicoIPPoolsCRD, internal.CalicoIPPoolsCRD, conf)) } return assets } const validBootstrapTokenChars = "0123456789abcdefghijklmnopqrstuvwxyz" // newBootstrapToken constructs a bootstrap token in conformance with the following format: // https://kubernetes.io/docs/admin/bootstrap-tokens/#token-format func newBootstrapToken() (id string, secret string, err error) { // Read 6 random bytes for the id and 16 random bytes for the token (see spec for details). token := make([]byte, 6+16) if _, err := rand.Read(token); err != nil { return "", "", err } for i, b := range token { token[i] = validBootstrapTokenChars[int(b)%len(validBootstrapTokenChars)] } return string(token[:6]), string(token[6:]), nil } func newKubeConfigAssets(assets Assets, conf Config) ([]Asset, error) { caCert, err := assets.Get(AssetPathCACert) if err != nil { return nil, err } adminCert, err := assets.Get(AssetPathAdminCert) if err != nil { return nil, err } adminKey, err := assets.Get(AssetPathAdminKey) if err != nil { return nil, err } bootstrapTokenID, bootstrapTokenSecret, err := newBootstrapToken() if err != nil { return nil, err } cfg := struct { Cluster string Server string CACert string AdminCert string AdminKey string BootstrapTokenID string BootstrapTokenSecret string }{ Server: conf.APIServers[0].String(), Cluster: conf.ClusterName, CACert: base64.StdEncoding.EncodeToString(caCert.Data), AdminCert: base64.StdEncoding.EncodeToString(adminCert.Data), AdminKey: base64.StdEncoding.EncodeToString(adminKey.Data), BootstrapTokenID: bootstrapTokenID, BootstrapTokenSecret: bootstrapTokenSecret, } templates := []struct { path string tmpl []byte }{ {AssetPathAdminKubeConfig, internal.AdminKubeConfigTemplate}, {AssetPathKubeConfigInCluster, internal.KubeConfigInClusterTemplate}, {AssetPathKubeletKubeConfig, internal.KubeletKubeConfigTemplate}, {AssetPathKubeletBootstrapToken, internal.KubeletBootstrappingToken}, } var as []Asset for _, t := range templates { a, err := assetFromTemplate(t.path, t.tmpl, cfg) if err != nil { return nil, fmt.Errorf("rendering template %s: %v", t.path, err) } as = append(as, a) } return as, nil } func newAPIServerSecretAsset(assets Assets, etcdUseTLS bool) (Asset, error) { secretAssets := []string{ AssetPathAPIServerKey, AssetPathAPIServerCert, AssetPathServiceAccountPubKey, AssetPathAggregatorCA, AssetPathFrontProxyClientCert, AssetPathFrontProxyClientKey, AssetPathKubeletClientCert, AssetPathKubeletClientKey, AssetPathCACert, } if etcdUseTLS { secretAssets = append(secretAssets, []string{ AssetPathEtcdClientCA, AssetPathEtcdClientCert, AssetPathEtcdClientKey, }...) } secretYAML, err := secretFromAssets(secretAPIServerName, secretNamespace, secretAssets, assets) if err != nil { return Asset{}, err } return Asset{Name: AssetPathAPIServerSecret, Data: secretYAML}, nil } func newControllerManagerSecretAsset(assets Assets) (Asset, error) { secretAssets := []string{ AssetPathServiceAccountPrivKey, AssetPathCACert, AssetPathCAKey, } secretYAML, err := secretFromAssets(secretCMName, secretNamespace, secretAssets, assets) if err != nil { return Asset{}, err } return Asset{Name: AssetPathControllerManagerSecret, Data: secretYAML}, nil } // TODO(aaron): use actual secret object (need to wrap in apiversion/type) type secret struct { ApiVersion string `json:"apiVersion"` Kind string `json:"kind"` Metadata map[string]string `json:"metadata"` Type string `json:"type"` Data map[string]string `json:"data"` } func secretFromAssets(name, namespace string, assetNames []string, assets Assets) ([]byte, error) { data := make(map[string]string) for _, an := range assetNames { a, err := assets.Get(an) if err != nil { return []byte{}, err } data[filepath.Base(a.Name)] = base64.StdEncoding.EncodeToString(a.Data) } return yaml.Marshal(secret{ ApiVersion: "v1", Kind: "Secret", Type: "Opaque", Metadata: map[string]string{ "name": name, "namespace": namespace, }, Data: data, }) } func MustCreateAssetFromTemplate(name string, template []byte, data interface{}) Asset { a, err := assetFromTemplate(name, template, data) if err != nil { panic(err) } return a } func assetFromTemplate(name string, tb []byte, data interface{}) (Asset, error) { tmpl, err := template.New(name).Parse(string(tb)) if err != nil { return Asset{}, err } var buf bytes.Buffer if err := tmpl.Execute(&buf, data); err != nil { return Asset{}, err } return Asset{Name: name, Data: buf.Bytes()}, nil } ================================================ FILE: cmd/render/plugin/default/asset/tls.go ================================================ package asset import ( "crypto/rsa" "crypto/x509" "net" "net/url" "github.com/pborman/uuid" "github.com/kubernetes-sigs/bootkube/pkg/tlsutil" ) // TLS organizations map to Kubernetes groups, and "system:masters" // is a well-known Kubernetes group that gives a user admin power. const orgSystemMasters = "system:masters" func newTLSAssets(caCert *x509.Certificate, caPrivKey *rsa.PrivateKey, altNames tlsutil.AltNames) ([]Asset, error) { var ( assets []Asset err error ) apiKey, apiCert, err := newAPIKeyAndCert(caCert, caPrivKey, altNames) if err != nil { return assets, err } aggregatorCAPrivKey, err := tlsutil.NewPrivateKey() if err != nil { return assets, err } cfg := tlsutil.CertConfig{ CommonName: "front-proxy", } aggregatorCACert, err := tlsutil.NewSelfSignedCACertificate(cfg, aggregatorCAPrivKey) if err != nil { return assets, err } frontProxyPrivKey, err := tlsutil.NewPrivateKey() if err != nil { return assets, err } cfg = tlsutil.CertConfig{ CommonName: "front-proxy-client", } frontProxyCert, err := tlsutil.NewSignedCertificate(cfg, frontProxyPrivKey, aggregatorCACert, aggregatorCAPrivKey) if err != nil { return assets, err } kubeletClientCertConfig := tlsutil.CertConfig{ CommonName: "apiserver-kubelet-client", Organization: []string{orgSystemMasters}, } kubeletClientKey, kubeletClientCert, err := newAdminKeyAndCert(caCert, caPrivKey, kubeletClientCertConfig) if err != nil { return assets, err } saPrivKey, err := tlsutil.NewPrivateKey() if err != nil { return assets, err } saPubKey, err := tlsutil.EncodePublicKeyPEM(&saPrivKey.PublicKey) if err != nil { return assets, err } adminCertConfig := tlsutil.CertConfig{ CommonName: "admin", Organization: []string{orgSystemMasters}, } adminKey, adminCert, err := newAdminKeyAndCert(caCert, caPrivKey, adminCertConfig) if err != nil { return assets, err } assets = append(assets, []Asset{ {Name: AssetPathCAKey, Data: tlsutil.EncodePrivateKeyPEM(caPrivKey)}, {Name: AssetPathCACert, Data: tlsutil.EncodeCertificatePEM(caCert)}, {Name: AssetPathAPIServerKey, Data: tlsutil.EncodePrivateKeyPEM(apiKey)}, {Name: AssetPathAPIServerCert, Data: tlsutil.EncodeCertificatePEM(apiCert)}, {Name: AssetPathServiceAccountPrivKey, Data: tlsutil.EncodePrivateKeyPEM(saPrivKey)}, {Name: AssetPathAggregatorCA, Data: tlsutil.EncodeCertificatePEM(aggregatorCACert)}, {Name: AssetPathFrontProxyClientCert, Data: tlsutil.EncodeCertificatePEM(frontProxyCert)}, {Name: AssetPathFrontProxyClientKey, Data: tlsutil.EncodePrivateKeyPEM(frontProxyPrivKey)}, {Name: AssetPathKubeletClientKey, Data: tlsutil.EncodePrivateKeyPEM(kubeletClientKey)}, {Name: AssetPathKubeletClientCert, Data: tlsutil.EncodeCertificatePEM(kubeletClientCert)}, {Name: AssetPathServiceAccountPubKey, Data: saPubKey}, {Name: AssetPathAdminKey, Data: tlsutil.EncodePrivateKeyPEM(adminKey)}, {Name: AssetPathAdminCert, Data: tlsutil.EncodeCertificatePEM(adminCert)}, }...) return assets, nil } func newCACert() (*rsa.PrivateKey, *x509.Certificate, error) { key, err := tlsutil.NewPrivateKey() if err != nil { return nil, nil, err } config := tlsutil.CertConfig{ CommonName: "kube-ca", Organization: []string{uuid.New()}, OrganizationalUnit: []string{"bootkube"}, } cert, err := tlsutil.NewSelfSignedCACertificate(config, key) if err != nil { return nil, nil, err } return key, cert, err } func newAPIKeyAndCert(caCert *x509.Certificate, caPrivKey *rsa.PrivateKey, altNames tlsutil.AltNames) (*rsa.PrivateKey, *x509.Certificate, error) { key, err := tlsutil.NewPrivateKey() if err != nil { return nil, nil, err } altNames.DNSNames = append(altNames.DNSNames, []string{ "kubernetes", "kubernetes.default", "kubernetes.default.svc", "kubernetes.default.svc.cluster.local", }...) config := tlsutil.CertConfig{ CommonName: "kube-apiserver", Organization: []string{"kube-master"}, AltNames: altNames, } cert, err := tlsutil.NewSignedCertificate(config, key, caCert, caPrivKey) if err != nil { return nil, nil, err } return key, cert, err } func newAdminKeyAndCert(caCert *x509.Certificate, caPrivKey *rsa.PrivateKey, config tlsutil.CertConfig) (*rsa.PrivateKey, *x509.Certificate, error) { key, err := tlsutil.NewPrivateKey() if err != nil { return nil, nil, err } cert, err := tlsutil.NewSignedCertificate(config, key, caCert, caPrivKey) if err != nil { return nil, nil, err } return key, cert, err } func newEtcdTLSAssets(etcdCACert, etcdClientCert *x509.Certificate, etcdClientKey *rsa.PrivateKey, caCert *x509.Certificate, caPrivKey *rsa.PrivateKey, etcdServers []*url.URL) ([]Asset, error) { var assets []Asset if etcdCACert == nil { // Use the master CA to generate etcd assets. etcdCACert = caCert // Create an etcd client cert. var err error etcdClientKey, etcdClientCert, err = newEtcdKeyAndCert(caCert, caPrivKey, "etcd-client", etcdServers) if err != nil { return nil, err } // Create an etcd peer cert (not consumed by self-hosted components). etcdPeerKey, etcdPeerCert, err := newEtcdKeyAndCert(caCert, caPrivKey, "etcd-peer", etcdServers) if err != nil { return nil, err } etcdServerKey, etcdServerCert, err := newEtcdKeyAndCert(caCert, caPrivKey, "etcd-server", etcdServers) if err != nil { return nil, err } assets = append(assets, []Asset{ {Name: AssetPathEtcdPeerCA, Data: tlsutil.EncodeCertificatePEM(etcdCACert)}, {Name: AssetPathEtcdPeerKey, Data: tlsutil.EncodePrivateKeyPEM(etcdPeerKey)}, {Name: AssetPathEtcdPeerCert, Data: tlsutil.EncodeCertificatePEM(etcdPeerCert)}, {Name: AssetPathEtcdServerCA, Data: tlsutil.EncodeCertificatePEM(etcdCACert)}, {Name: AssetPathEtcdServerKey, Data: tlsutil.EncodePrivateKeyPEM(etcdServerKey)}, {Name: AssetPathEtcdServerCert, Data: tlsutil.EncodeCertificatePEM(etcdServerCert)}, }...) } assets = append(assets, []Asset{ {Name: AssetPathEtcdClientCA, Data: tlsutil.EncodeCertificatePEM(etcdCACert)}, {Name: AssetPathEtcdClientKey, Data: tlsutil.EncodePrivateKeyPEM(etcdClientKey)}, {Name: AssetPathEtcdClientCert, Data: tlsutil.EncodeCertificatePEM(etcdClientCert)}, }...) return assets, nil } func newEtcdKeyAndCert(caCert *x509.Certificate, caPrivKey *rsa.PrivateKey, commonName string, etcdServers []*url.URL) (*rsa.PrivateKey, *x509.Certificate, error) { addrs := make([]string, len(etcdServers)) for i := range etcdServers { addrs[i] = etcdServers[i].Hostname() } return newKeyAndCert(caCert, caPrivKey, commonName, addrs) } func newKeyAndCert(caCert *x509.Certificate, caPrivKey *rsa.PrivateKey, commonName string, addrs []string) (*rsa.PrivateKey, *x509.Certificate, error) { key, err := tlsutil.NewPrivateKey() if err != nil { return nil, nil, err } var altNames tlsutil.AltNames for _, addr := range addrs { if ip := net.ParseIP(addr); ip != nil { altNames.IPs = append(altNames.IPs, ip) } else { altNames.DNSNames = append(altNames.DNSNames, addr) } } config := tlsutil.CertConfig{ CommonName: commonName, Organization: []string{"etcd"}, AltNames: altNames, } cert, err := tlsutil.NewSignedCertificate(config, key, caCert, caPrivKey) if err != nil { return nil, nil, err } return key, cert, err } ================================================ FILE: cmd/render/plugin/default/main.go ================================================ package main import ( "crypto/rsa" "crypto/x509" "errors" "flag" "fmt" "io/ioutil" "net" "net/url" "strings" "github.com/kubernetes-sigs/bootkube/cmd/render/plugin/default/asset" "github.com/kubernetes-sigs/bootkube/pkg/plugin" "github.com/kubernetes-sigs/bootkube/pkg/tlsutil" ) const ( apiOffset = 1 dnsOffset = 10 defaultServiceBaseIP = "10.3.0.0" defaultEtcdServers = "https://127.0.0.1:2379" ) var ( renderOpts struct { caCertificatePath string caPrivateKeyPath string etcdCAPath string etcdCertificatePath string etcdPrivateKeyPath string etcdServers string apiServers string altNames string podCIDR string serviceCIDR string cloudProvider string networkProvider string clusterName string } imageVersions = asset.DefaultImages ) type render struct{} var Renderer render func (*render) Render(opts *plugin.Options, args []string) error { CommandLine := flag.NewFlagSet("plugin", flag.ExitOnError) CommandLine.StringVar(&renderOpts.caCertificatePath, "ca-certificate-path", "", "Path to an existing PEM encoded CA. If provided, TLS assets will be generated using this certificate authority.") CommandLine.StringVar(&renderOpts.caPrivateKeyPath, "ca-private-key-path", "", "Path to an existing Certificate Authority RSA private key. Required if --ca-certificate is set.") CommandLine.StringVar(&renderOpts.etcdCAPath, "etcd-ca-path", "", "Path to an existing PEM encoded CA that will be used for TLS-enabled communication between the apiserver and etcd. Must be used in conjunction with --etcd-certificate-path and --etcd-private-key-path, and must have etcd configured to use TLS with matching secrets.") CommandLine.StringVar(&renderOpts.etcdCertificatePath, "etcd-certificate-path", "", "Path to an existing certificate that will be used for TLS-enabled communication between the apiserver and etcd. Must be used in conjunction with --etcd-ca-path and --etcd-private-key-path, and must have etcd configured to use TLS with matching secrets.") CommandLine.StringVar(&renderOpts.etcdPrivateKeyPath, "etcd-private-key-path", "", "Path to an existing private key that will be used for TLS-enabled communication between the apiserver and etcd. Must be used in conjunction with --etcd-ca-path and --etcd-certificate-path, and must have etcd configured to use TLS with matching secrets.") CommandLine.StringVar(&renderOpts.etcdServers, "etcd-servers", defaultEtcdServers, "List of etcd servers URLs including host:port, comma separated") CommandLine.StringVar(&renderOpts.apiServers, "api-servers", "https://127.0.0.1:6443", "List of API server URLs including host:port, comma seprated") CommandLine.StringVar(&renderOpts.altNames, "api-server-alt-names", "", "List of SANs to use in api-server certificate. Example: 'IP=127.0.0.1,IP=127.0.0.2,DNS=localhost'. If empty, SANs will be extracted from the --api-servers flag.") CommandLine.StringVar(&renderOpts.podCIDR, "pod-cidr", "10.2.0.0/16", "The CIDR range(s) of cluster pods. If dual-stack, IPv4 must come first, separated by a comma.") CommandLine.StringVar(&renderOpts.serviceCIDR, "service-cidr", "10.3.0.0/24", "The CIDR range(s) of cluster services. If dual-stack, IPv4 must come first, seprated by a comma.") CommandLine.StringVar(&renderOpts.cloudProvider, "cloud-provider", "", "The provider for cloud services. Empty string for no provider") CommandLine.StringVar(&renderOpts.networkProvider, "network-provider", "flannel", "CNI network provider (flannel, experimental-canal or experimental-calico).") CommandLine.StringVar(&renderOpts.clusterName, "cluster-name", "", "The name of the kubernetes cluster.") CommandLine.Parse(args) err := validateRenderOpts() if err != nil { return err } config, err := flagsToAssetConfig() if err != nil { return err } as, err := asset.NewDefaultAssets(*config) if err != nil { return err } err = as.WriteFiles(opts.AssetDir) if err != nil { return err } return nil } func validateRenderOpts() error { if renderOpts.caCertificatePath != "" && renderOpts.caPrivateKeyPath == "" { return errors.New("You must provide the --ca-private-key-path flag when --ca-certificate-path is provided.") } if renderOpts.caPrivateKeyPath != "" && renderOpts.caCertificatePath == "" { return errors.New("You must provide the --ca-certificate-path flag when --ca-private-key-path is provided.") } if (renderOpts.etcdCAPath != "" || renderOpts.etcdCertificatePath != "" || renderOpts.etcdPrivateKeyPath != "") && (renderOpts.etcdCAPath == "" || renderOpts.etcdCertificatePath == "" || renderOpts.etcdPrivateKeyPath == "") { return errors.New("You must specify either all or none of --etcd-ca-path, --etcd-certificate-path, and --etcd-private-key-path") } if renderOpts.etcdServers == "" { return errors.New("Missing required flag: --etcd-servers") } if renderOpts.apiServers == "" { return errors.New("Missing required flag: --api-servers") } if renderOpts.networkProvider != asset.NetworkFlannel && renderOpts.networkProvider != asset.NetworkCalico && renderOpts.networkProvider != asset.NetworkCanal { return errors.New("Must specify --network-provider flannel or experimental-calico or experimental-canal") } return nil } func flagsToAssetConfig() (c *asset.Config, err error) { apiServers, err := parseURLs(renderOpts.apiServers) if err != nil { return nil, err } altNames, err := parseAltNames(renderOpts.altNames) if err != nil { return nil, err } if altNames == nil { // Fall back to parsing from api-server list altNames = altNamesFromURLs(apiServers) } var caCert *x509.Certificate var caPrivKey *rsa.PrivateKey if renderOpts.caCertificatePath != "" { caPrivKey, caCert, err = parseCertAndPrivateKeyFromDisk(renderOpts.caCertificatePath, renderOpts.caPrivateKeyPath) if err != nil { return nil, err } } var podNets, serviceNets []*net.IPNet for _, cidr := range strings.Split(renderOpts.podCIDR, ",") { _, podNet, err := net.ParseCIDR(cidr) if err != nil { return nil, err } podNets = append(podNets, podNet) } for _, cidr := range strings.Split(renderOpts.serviceCIDR, ",") { _, serviceNet, err := net.ParseCIDR(cidr) if err != nil { return nil, err } serviceNets = append(serviceNets, serviceNet) } if len(podNets) != len(serviceNets) { return nil, fmt.Errorf("number of service CIDRs (%d) must match the number of pod CIDRs (%d)", len(serviceNets), len(podNets)) } if len(podNets) > 2 || len(podNets) < 1 { return nil, errors.New("kubernetes requires exactly 1 or 2 pod networks, and they must be of different address families") } if len(serviceNets) > 2 || len(serviceNets) < 1 { return nil, errors.New("kubernetes requires exactly 1 or 2 service networks, and they must be of different address families") } for _, podNet := range podNets { for _, svcNet := range serviceNets { if podNet.Contains(svcNet.IP) || svcNet.Contains(podNet.IP) { return nil, fmt.Errorf("Pod CIDR %s and service CIDR %s must not overlap", podNet.String(), svcNet.String()) } } } var apiServiceIPs, dnsServiceIPs []net.IP for _, serviceNet := range serviceNets { apiServiceIP, err := offsetServiceIP(serviceNet, apiOffset) if err != nil { return nil, err } apiServiceIPs = append(apiServiceIPs, apiServiceIP) dnsServiceIP, err := offsetServiceIP(serviceNet, dnsOffset) if err != nil { return nil, err } dnsServiceIPs = append(dnsServiceIPs, dnsServiceIP) } etcdServers, err := parseURLs(renderOpts.etcdServers) if err != nil { return nil, err } etcdUseTLS := false for _, url := range etcdServers { if url.Scheme == "https" { etcdUseTLS = true } } var etcdCACert *x509.Certificate if renderOpts.etcdCAPath != "" { etcdCACert, err = parseCertFromDisk(renderOpts.etcdCAPath) if err != nil { return nil, err } } var etcdClientCert *x509.Certificate var etcdClientKey *rsa.PrivateKey if renderOpts.etcdCertificatePath != "" { etcdClientKey, etcdClientCert, err = parseCertAndPrivateKeyFromDisk(renderOpts.etcdCertificatePath, renderOpts.etcdPrivateKeyPath) if err != nil { return nil, err } } // TODO: Find better option than asking users to make manual changes if serviceNets[0].IP.String() != defaultServiceBaseIP { fmt.Printf("You have selected a non-default service CIDR %s - be sure your kubelet service file uses --cluster-dns=%s\n", serviceNets[0].String(), dnsServiceIPs[0].String()) } return &asset.Config{ ClusterName: renderOpts.clusterName, EtcdCACert: etcdCACert, EtcdClientCert: etcdClientCert, EtcdClientKey: etcdClientKey, EtcdServers: etcdServers, EtcdUseTLS: etcdUseTLS, CACert: caCert, CAPrivKey: caPrivKey, APIServers: apiServers, AltNames: altNames, PodCIDRs: podNets, ServiceCIDRs: serviceNets, APIServiceIPs: apiServiceIPs, DNSServiceIPs: dnsServiceIPs, CloudProvider: renderOpts.cloudProvider, NetworkProvider: renderOpts.networkProvider, Images: imageVersions, }, nil } func parseCertAndPrivateKeyFromDisk(caCertPath, privKeyPath string) (*rsa.PrivateKey, *x509.Certificate, error) { // Parse CA Private key. keypem, err := ioutil.ReadFile(privKeyPath) if err != nil { return nil, nil, fmt.Errorf("error reading ca private key file at %s: %v", privKeyPath, err) } key, err := tlsutil.ParsePEMEncodedPrivateKey(keypem) if err != nil { return nil, nil, fmt.Errorf("unable to parse CA private key: %v", err) } // Parse CA Cert. cert, err := parseCertFromDisk(caCertPath) if err != nil { return nil, nil, err } return key, cert, nil } func parseCertFromDisk(caCertPath string) (*x509.Certificate, error) { capem, err := ioutil.ReadFile(caCertPath) if err != nil { return nil, fmt.Errorf("error reading ca cert file at %s: %v", caCertPath, err) } cert, err := tlsutil.ParsePEMEncodedCACert(capem) if err != nil { return nil, fmt.Errorf("unable to parse CA Cert: %v", err) } return cert, nil } func parseURLs(s string) ([]*url.URL, error) { var out []*url.URL for _, u := range strings.Split(s, ",") { parsed, err := url.Parse(u) if err != nil { return nil, err } out = append(out, parsed) } return out, nil } func parseAltNames(s string) (*tlsutil.AltNames, error) { if s == "" { return nil, nil } var alt tlsutil.AltNames for _, an := range strings.Split(s, ",") { switch { case strings.HasPrefix(an, "DNS="): alt.DNSNames = append(alt.DNSNames, strings.TrimPrefix(an, "DNS=")) case strings.HasPrefix(an, "IP="): ip := net.ParseIP(strings.TrimPrefix(an, "IP=")) if ip == nil { return nil, fmt.Errorf("Invalid IP alt name: %s", an) } alt.IPs = append(alt.IPs, ip) default: return nil, fmt.Errorf("Invalid alt name: %s", an) } } return &alt, nil } func altNamesFromURLs(urls []*url.URL) *tlsutil.AltNames { var an tlsutil.AltNames for _, u := range urls { host, _, err := net.SplitHostPort(u.Host) if err != nil { host = u.Host } ip := net.ParseIP(host) if ip == nil { an.DNSNames = append(an.DNSNames, host) } else { an.IPs = append(an.IPs, ip) } } return &an } // offsetServiceIP returns an IP offset by up to 255. // TODO: do numeric conversion to generalize this utility. func offsetServiceIP(ipnet *net.IPNet, offset int) (net.IP, error) { ip := make(net.IP, len(ipnet.IP)) copy(ip, ipnet.IP) for i := 0; i < offset; i++ { incIPv4(ip) } if ipnet.Contains(ip) { return ip, nil } return net.IP([]byte("")), fmt.Errorf("Service IP %v is not in %s", ip, ipnet) } func incIPv4(ip net.IP) { for j := len(ip) - 1; j >= 0; j-- { ip[j]++ if ip[j] > 0 { break } } } ================================================ FILE: cmd/render/plugin/default/render_test.go ================================================ package main import ( "net" "testing" ) func TestOffsetIP(t *testing.T) { cases := []struct { input string offset int expected string }{ {"10.3.0.0/24", 1, "10.3.0.1"}, {"10.3.0.0/24", 10, "10.3.0.10"}, {"10.3.0.0/24", 15, "10.3.0.15"}, {"10.3.0.0/16", 1, "10.3.0.1"}, {"10.3.0.0/16", 10, "10.3.0.10"}, {"10.3.0.0/16", 15, "10.3.0.15"}, {"10.33.1.200/16", 1, "10.33.0.1"}, {"10.33.1.200/16", 10, "10.33.0.10"}, {"10.33.1.200/16", 15, "10.33.0.15"}, {"192.168.1.0/24", 15, "192.168.1.15"}, } for _, c := range cases { _, cidr, err := net.ParseCIDR(c.input) if err != nil { t.Errorf("unexpected CIDR parse error: %v", err) } ip, err := offsetServiceIP(cidr, c.offset) if ip.String() != c.expected { t.Errorf("expected %s, got %s", c.expected, ip.String()) } } } ================================================ FILE: code-of-conduct.md ================================================ # Kubernetes Community Code of Conduct Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) ================================================ FILE: e2e/README.md ================================================ ## Bootkube E2E Testing This is the beginnings of E2E testing for the bootkube repo using the standard go testing harness. To run the tests once you have a kubeconfig to a running cluster just execute: `go test -v ./e2e/ --kubeconfig=` The number of nodes is required so that the setup can block on all nodes being registered. ## Roadmap Implement whatever is needed to finish porting all functionality from pluton tests ================================================ FILE: e2e/checkpointer_test.go ================================================ package e2e import ( "bytes" "context" "fmt" "strings" "sync" "testing" "time" "github.com/kubernetes-sigs/bootkube/cmd/render/plugin/default/asset" v1 "k8s.io/api/core/v1" "k8s.io/api/extensions/v1beta1" rbac "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" ) const ( retryAttempts = 60 retryInterval = 5 * time.Second ) func TestCheckpointer(t *testing.T) { t.Run("UnscheduleCheckpointer", testCheckpointerUnscheduleCheckpointer) t.Run("UnscheduleParent", testCheckpointerUnscheduleParent) } // Deleting a checkpointer should cleanup any other checkpointed manifests on that node. func testCheckpointerUnscheduleCheckpointer(t *testing.T) { // Get the cluster c := waitCluster(t) testNS := makeNamespace(t.Name()) if _, err := createNamespace(client, testNS); err != nil { t.Fatalf("Failed to create namespace: %v", err) } defer deleteNamespace(client, testNS) // Deploy the pod checkpointer and test nginx. if err := setupTestCheckpointerRole(testNS); err != nil { t.Fatalf("Failed to create test-checkpointer role: %v", err) } if err := createDaemonSet(testNS, []byte(fmt.Sprintf(checkpointerDS, asset.DefaultImages.PodCheckpointer)), c); err != nil { t.Fatalf("Failed to create pod-checkpointer daemonset: %v", err) } if err := createDaemonSet(testNS, nginxDS, c); err != nil { t.Fatalf("Failed to create nginx daemonset: %v", err) } // Verify the checkpoints are created. if err := verifyCheckpoint(c, testNS, "test-checkpointer", true, true); err != nil { t.Fatalf("Failed to verify checkpoint: %v", err) } if err := verifyCheckpoint(c, testNS, "test-nginx", true, false); err != nil { t.Fatalf("Failed to verify checkpoint: %v", err) } // Delete the pod checkpointer. deletePropagationForeground := metav1.DeletePropagationForeground if err := client.ExtensionsV1beta1().DaemonSets(testNS).Delete(context.TODO(), "test-checkpointer", metav1.DeleteOptions{PropagationPolicy: &deletePropagationForeground}); err != nil { t.Fatalf("Failed to delete checkpointer: %v", err) } // Verify that the test-checkpointer is cleaned up but the nginx daemonset is still running. if err := verifyPod(c, "test-checkpointer", false); err != nil { t.Errorf("Failed to verifyPod: %s", err) } if err := verifyPod(c, "test-nginx", true); err != nil { t.Errorf("Failed to verifyPod: %s", err) } // Currently disabled due to e2e testing flakes. See: // * https://github.com/kubernetes-sigs/bootkube/issues/816 // * https://github.com/kubernetes-sigs/bootkube/pull/836 // if err := verifyCheckpoint(c, testNS, "test-checkpointer", false, false); err != nil { // t.Fatalf("Failed to verifyCheckpoint: %s", err) // } // Checkpointed manifest should be cleaned up. if err := verifyCheckpoint(c, testNS, "test-nginx", false, false); err != nil { t.Errorf("Failed to verifyCheckpoint: %s", err) } } // 1. Schedule a pod checkpointer on worker node. // 2. Schedule a test pod on worker node. // 3. Reboot the worker without starting the kubelet. // 4. Delete the test pod on API server. // 5. Reboot the masters without starting the kubelet. // 6. Start the worker kubelet, verify the checkpointer and the pod are still running as static pods. // 7. Start the master kubelets, verify the test pod is removed, but not the checkpointer. func testCheckpointerUnscheduleParent(t *testing.T) { // Get the cluster c := waitCluster(t) testNS := makeNamespace(t.Name()) if _, err := createNamespace(client, testNS); err != nil { t.Fatalf("Failed to create namespace: %v", err) } defer deleteNamespace(client, testNS) // Deploy the pod checkpointer and test nginx. if err := setupTestCheckpointerRole(testNS); err != nil { t.Fatalf("Failed to create test-checkpointer role: %v", err) } if err := createDaemonSet(testNS, []byte(fmt.Sprintf(checkpointerDS, asset.DefaultImages.PodCheckpointer)), c); err != nil { t.Fatalf("Failed to create pod-checkpointer daemonset: %v", err) } if err := createDaemonSet(testNS, nginxDS, c); err != nil { t.Fatalf("Failed to create nginx daemonset: %v", err) } // Verify the checkpoints are created. if err := verifyCheckpoint(c, testNS, "test-checkpointer", true, true); err != nil { t.Fatalf("verifyCheckpoint: %s", err) } if err := verifyCheckpoint(c, testNS, "test-nginx", true, false); err != nil { t.Fatalf("verifyCheckpoint: %s", err) } // Disable the kubelet and reboot the worker. if stdout, stderr, err := c.Workers[0].SSH("sudo systemctl disable kubelet"); err != nil { t.Fatalf("Failed to disable kubelet on worker %q: %v\nstdout: %s\nstderr: %s", c.Workers[0].Name, err, stdout, stderr) } if err := c.Workers[0].Reboot(); err != nil { t.Fatalf("Failed to reboot worker: %v", err) } // Delete test pod on the workers. patch := `{"spec":{"template":{"spec":{"nodeSelector":{"node-role.kubernetes.io/master":""}}}}}` if _, err := client.ExtensionsV1beta1().DaemonSets(testNS).Patch(context.TODO(), "test-nginx", types.MergePatchType, []byte(patch), metav1.PatchOptions{}); err != nil { t.Fatalf("unable to patch daemonset: %v", err) } // Disable the kubelet and reboot the masters. var rebootGroup sync.WaitGroup for i := range c.Masters { rebootGroup.Add(1) go func(i int) { defer rebootGroup.Done() if stdout, stderr, err := c.Masters[i].SSH("sudo systemctl disable kubelet"); err != nil { t.Fatalf("Failed to disable kubelet on master %q: %v\nstdout: %s\nstderr: %s", c.Masters[i].Name, err, stdout, stderr) } if err := c.Masters[i].Reboot(); err != nil { t.Fatalf("Failed to reboot master: %v", err) } }(i) } rebootGroup.Wait() // Start the worker kubelet. if stdout, stderr, err := c.Workers[0].SSH("sudo systemctl enable kubelet && sudo systemctl start kubelet"); err != nil { t.Fatalf("unable to start kubelet on worker %q: %v\nstdout: %s\nstderr: %s", c.Workers[0].Name, err, stdout, stderr) } // Verify that the checkpoints are running. if err := verifyPod(c, "pod-checkpointer", true); err != nil { t.Fatalf("verifyPod: %s", err) } if err := verifyPod(c, "test-nginx", true); err != nil { t.Fatalf("verifyPod: %s", err) } // Start the master kubelets. var enableGroup sync.WaitGroup for i := range c.Masters { enableGroup.Add(1) go func(i int) { defer enableGroup.Done() if stdout, stderr, err := c.Masters[i].SSH("sudo systemctl enable kubelet && sudo systemctl start kubelet"); err != nil { t.Fatalf("unable to start kubelet on master %q: %v\nstdout: %s\nstderr: %s", c.Masters[i].Name, err, stdout, stderr) } }(i) } enableGroup.Wait() // Verify that checkpoint is cleaned up and not running, but the pod checkpointer should still be running. if err := verifyPod(c, "test-checkpointer", true); err != nil { t.Fatalf("verifyPod: %s", err) } if err := verifyPod(c, "test-nginx", false); err != nil { t.Fatalf("verifyPod: %s", err) } if err := verifyCheckpoint(c, testNS, "test-checkpointer", true, true); err != nil { t.Fatalf("verifyCheckpoint: %s", err) } if err := verifyCheckpoint(c, testNS, "test-nginx", false, false); err != nil { t.Fatalf("verifyCheckpoint: %s", err) } } func makeNamespace(testName string) string { return strings.ToLower(fmt.Sprintf("%s-%s", namespace, strings.Split(testName, "/")[1])) } func createDaemonSet(namespace string, manifest []byte, c *Cluster) error { obj, _, err := scheme.Codecs.UniversalDecoder().Decode(manifest, nil, &v1beta1.DaemonSet{}) if err != nil { return fmt.Errorf("unable to decode manifest: %v", err) } ds, ok := obj.(*v1beta1.DaemonSet) if !ok { return fmt.Errorf("expected manifest to decode into *api.Daemonset, got %T", ds) } if _, err := client.ExtensionsV1beta1().DaemonSets(namespace).Create(context.TODO(), ds, metav1.CreateOptions{}); err != nil { return fmt.Errorf("failed to create the checkpoint parent: %v", err) } if err := verifyPod(c, ds.ObjectMeta.Name, true); err != nil { return fmt.Errorf("failed to verifyPod: %s", err) } return nil } func verifyCheckpoint(c *Cluster, namespace, daemonsetName string, shouldExist, shouldBeActive bool) error { return retry(retryAttempts, retryInterval, func() error { dirs := []string{ "/etc/kubernetes/inactive-manifests/", "/etc/kubernetes/checkpoint-secrets/" + namespace, // TODO(yifan): Add configmap. } if shouldBeActive { dirs = append(dirs, "/etc/kubernetes/manifests") } for _, dir := range dirs { stdout, stderr, err := c.Workers[0].SSH("sudo ls " + dir) if err != nil { return fmt.Errorf("unable to ls %q, error: %v\nstdout: %s\nstderr: %s", dir, err, stdout, stderr) } if shouldExist && !bytes.Contains(stdout, []byte(daemonsetName)) { return fmt.Errorf("unable to find checkpoint %q in %q: error: %v, output: %q", daemonsetName, dir, err, stdout) } if !shouldExist && bytes.Contains(stdout, []byte(daemonsetName)) { return fmt.Errorf("should not find checkpoint %q in %q, error: %v, output: %q", daemonsetName, dir, err, stdout) } } // Check active checkpoints. dir := "/etc/kubernetes/manifests" stdout, stderr, err := c.Workers[0].SSH("sudo ls " + dir) if err != nil { return fmt.Errorf("unable to ls %q, error: %v\nstdout: %s\nstderr: %s", dir, err, stdout, stderr) } if shouldBeActive && !bytes.Contains(stdout, []byte(daemonsetName)) { return fmt.Errorf("unable to find checkpoint %q in %q: error: %v, output: %q", daemonsetName, dir, err, stdout) } if !shouldBeActive && bytes.Contains(stdout, []byte(daemonsetName)) { return fmt.Errorf("should not find checkpoint %q in %q, error: %v, output: %q", daemonsetName, dir, err, stdout) } return nil }) } func verifyPod(c *Cluster, daemonsetName string, shouldRun bool) error { return retry(retryAttempts, retryInterval, func() error { stdout, stderr, err := c.Workers[0].SSH("docker ps") if err != nil { return fmt.Errorf("unable to docker ps, error: %v\nstdout: %s\nstderr: %s", err, stdout, stderr) } if shouldRun && !bytes.Contains(stdout, []byte(daemonsetName)) { return fmt.Errorf("unable to find running checkpoints %q, error: %v, output: %q", daemonsetName, err, stdout) } if !shouldRun && bytes.Contains(stdout, []byte(daemonsetName)) { return fmt.Errorf("should not find running checkpoints %q, error: %v, output: %q", daemonsetName, err, stdout) } return nil }) } func isNodeReady(n *Node) bool { for _, condition := range n.Status.Conditions { if condition.Type == v1.NodeReady && condition.Status == v1.ConditionTrue { return true } } return false } // waitCluster waits for master and workers to be ready. func waitCluster(t *testing.T) *Cluster { var c *Cluster var err error if err := retry(retryAttempts, retryInterval, func() error { c, err = GetCluster() if err != nil { t.Fatalf("Failed to get cluster") } if len(c.Masters) == 0 { return fmt.Errorf("no masters") } if len(c.Workers) == 0 { return fmt.Errorf("no workers") } for i := range c.Masters { if !isNodeReady(c.Masters[i]) { return fmt.Errorf("masters[%d] is not ready", i) } } for i := range c.Workers { if !isNodeReady(c.Workers[i]) { return fmt.Errorf("workers[%d] is not ready", i) } } return nil }); err != nil { t.Fatalf("Failed to wait cluster: %v", err) } return c } func setupTestCheckpointerRole(namespace string) error { // Copy special kubeconfig-in-cluster configmap from kube-system namespace. kc, err := client.CoreV1().ConfigMaps(metav1.NamespaceSystem).Get(context.TODO(), "kubeconfig-in-cluster", metav1.GetOptions{}) if err != nil { return err } kc.ObjectMeta = metav1.ObjectMeta{ Name: kc.ObjectMeta.Name, Namespace: namespace, } if _, err := client.CoreV1().ConfigMaps(namespace).Create(context.TODO(), kc, metav1.CreateOptions{}); err != nil { return err } if _, err := client.CoreV1().ServiceAccounts(namespace).Create(context.TODO(), &v1.ServiceAccount{ ObjectMeta: metav1.ObjectMeta{ Name: "test-checkpointer", Namespace: namespace, }, }, metav1.CreateOptions{}); err != nil { return err } if _, err := client.RbacV1beta1().Roles(namespace).Create(context.TODO(), &rbac.Role{ ObjectMeta: metav1.ObjectMeta{ Name: "test-checkpointer", Namespace: namespace, }, Rules: []rbac.PolicyRule{{ APIGroups: []string{""}, // "" indicates the core API group Resources: []string{"pods"}, Verbs: []string{"get", "watch", "list"}, }, { APIGroups: []string{""}, // "" indicates the core API group Resources: []string{"secrets", "configmaps"}, Verbs: []string{"get"}, }}, }, metav1.CreateOptions{}); err != nil { return err } if _, err := client.RbacV1beta1().RoleBindings(namespace).Create(context.TODO(), &rbac.RoleBinding{ ObjectMeta: metav1.ObjectMeta{ Name: "test-checkpointer", Namespace: namespace, }, Subjects: []rbac.Subject{{ Kind: "ServiceAccount", Name: "test-checkpointer", Namespace: namespace, }}, RoleRef: rbac.RoleRef{ APIGroup: "rbac.authorization.k8s.io", Kind: "Role", Name: "test-checkpointer", }, }, metav1.CreateOptions{}); err != nil { return err } return nil } const checkpointerDS = `apiVersion: extensions/v1beta1 kind: DaemonSet metadata: name: test-checkpointer labels: app: test-checkpointer spec: selector: matchLabels: app: test-checkpointer template: metadata: labels: app: test-checkpointer annotations: checkpointer.alpha.coreos.com/checkpoint: "true" spec: containers: - name: test-checkpointer image: %s command: - /checkpoint - --checkpoint-grace-period=5s - --lock-file=/var/run/lock/test-checkpointer.lock - --kubeconfig=/etc/checkpointer/kubeconfig env: - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName - name: POD_NAME valueFrom: fieldRef: fieldPath: metadata.name - name: POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace imagePullPolicy: Always volumeMounts: - mountPath: /etc/checkpointer name: kubeconfig - mountPath: /etc/kubernetes name: etc-kubernetes - mountPath: /var/run name: var-run serviceAccountName: test-checkpointer hostNetwork: true restartPolicy: Always volumes: - name: kubeconfig configMap: name: kubeconfig-in-cluster - name: etc-kubernetes hostPath: path: /etc/kubernetes - name: var-run hostPath: path: /var/run ` var nginxDS = []byte(`apiVersion: extensions/v1beta1 kind: DaemonSet metadata: name: test-nginx spec: selector: matchLabels: app: nginx-checkpoint-test template: metadata: labels: app: nginx-checkpoint-test annotations: checkpointer.alpha.coreos.com/checkpoint: "true" spec: hostNetwork: true containers: - name: nginx image: nginx `) ================================================ FILE: e2e/deleteapi_test.go ================================================ package e2e import ( "context" "fmt" "testing" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestDeleteAPI(t *testing.T) { apiPods, err := client.CoreV1().Pods("kube-system").List(context.TODO(), metav1.ListOptions{LabelSelector: "k8s-app=kube-apiserver"}) if err != nil { t.Fatal(err) } // delete any api-server pods deletedPods := make(map[string]struct{}) for _, pod := range apiPods.Items { if err := client.CoreV1().Pods("kube-system").Delete(context.TODO(), pod.ObjectMeta.Name, metav1.DeleteOptions{}); err != nil { t.Fatalf("error deleting api-server pod: %v", err) } deletedPods[pod.ObjectMeta.Name] = struct{}{} } // wait for pods to be completely deleted. if err := retry(100, 1*time.Second, func() error { remainingPods, err := client.CoreV1().Pods("kube-system").List(context.TODO(), metav1.ListOptions{LabelSelector: "k8s-app=kube-apiserver"}) if err != nil { return fmt.Errorf("error checking for remaining apiserver pods: %v", err) } for _, pod := range remainingPods.Items { if _, ok := deletedPods[pod.ObjectMeta.Name]; ok { return fmt.Errorf("pod %s is still not deleted", pod.ObjectMeta.Name) } } return nil }); err != nil { t.Fatalf("error waiting for apiserver pods to be deleted: %v", err) } // wait until api server is back up if err := controlPlaneReady(client, 120, 5*time.Second); err != nil { t.Fatalf("waiting for control plane: %v", err) } } ================================================ FILE: e2e/internal/e2eutil/testworkload/nginx_workload.go ================================================ package testworkload import ( "context" "fmt" "time" "github.com/golang/glog" batchv1 "k8s.io/api/batch/v1" "k8s.io/api/core/v1" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" utilrand "k8s.io/apimachinery/pkg/util/rand" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" ) var ( // PollTimeoutForNginx is the max duration for polling when using Nginx testworkload. PollTimeoutForNginx = 10 * time.Minute // PollIntervalForNginx is the interval between each condition check of poolling when using Nginx testworkload. PollIntervalForNginx = 10 * time.Second ) // Nginx creates a temp nginx deployment/service pair // that can be used as a test workload type Nginx struct { Namespace string Name string // List of pods that belong to the deployment Pods []*v1.Pod client kubernetes.Interface podSelector *metav1.LabelSelector nodeSelector *metav1.LabelSelector pingPodSelector *metav1.LabelSelector } // NginxOpts defines func that applies custom options for Nginx type NginxOpts func(*Nginx) error // NewNginx create this nginx deployment/service pair. // It waits until all the pods in the deployment are running. func NewNginx(kc kubernetes.Interface, namespace string, options ...NginxOpts) (*Nginx, error) { //create random suffix name := fmt.Sprintf("nginx-%s", utilrand.String(5)) n := &Nginx{ Namespace: namespace, Name: name, podSelector: &metav1.LabelSelector{ MatchLabels: map[string]string{"app": name}}, nodeSelector: &metav1.LabelSelector{ MatchLabels: map[string]string{}, }, pingPodSelector: &metav1.LabelSelector{ MatchLabels: map[string]string{}, }, client: kc, } //apply options for _, option := range options { if err := option(n); err != nil { return nil, fmt.Errorf("error invalid options: %v", err) } } var err error defer func() { if err != nil { n.Delete() } }() if err = n.newNginxDeployment(); err != nil { return nil, fmt.Errorf("error creating deployment %s: %v", n.Name, err) } if err = n.newNginxService(); err != nil { return nil, fmt.Errorf("error creating service %s: %v", n.Name, err) } if err = wait.PollImmediate(PollIntervalForNginx, PollTimeoutForNginx, func() (bool, error) { d, err := kc.ExtensionsV1beta1().Deployments(n.Namespace).Get(context.TODO(), n.Name, metav1.GetOptions{}) if err != nil { glog.Errorf("Error getting deployment %s: %v", n.Name, err) return false, nil } if d.Status.UpdatedReplicas != d.Status.AvailableReplicas && d.Status.UnavailableReplicas != 0 { return false, nil } //wait for all pods to enter running phase pl, err := kc.CoreV1().Pods(n.Namespace).List(context.TODO(), metav1.ListOptions{ LabelSelector: metav1.FormatLabelSelector(n.podSelector), }) if err != nil { glog.Errorf("Error getting pods for deployment %s: %v", n.Name, err) return false, nil } if len(pl.Items) == 0 { return false, nil } var pods []*v1.Pod for i := range pl.Items { p := &pl.Items[i] if p.Status.Phase != v1.PodRunning { return false, nil } pods = append(pods, p) } n.Pods = pods return true, nil }); err != nil { return nil, fmt.Errorf("deployment %s is not ready: %v", n.Name, err) } return n, nil } // WithNginxPingJobLabels adds custom labels for PinJob's pods. // Affects only PingJob's pods. func WithNginxPingJobLabels(labels map[string]string) NginxOpts { return func(n *Nginx) error { for k, v := range labels { n.pingPodSelector.MatchLabels[k] = v } return nil } } // IsReachable pings the nginx service. // Expects the nginx service to be reachable. func (n *Nginx) IsReachable() error { if err := n.newPingPod(true); err != nil { return fmt.Errorf("error svc wasn't reachable: %v", err) } return nil } // IsUnReachable pings the nginx service. // Expects the nginx service to be unreachable. func (n *Nginx) IsUnReachable() error { if err := n.newPingPod(false); err != nil { return fmt.Errorf("error svc was reachable: %v", err) } return nil } // Delete deletes the deployment and service func (n *Nginx) Delete() error { delPropPolicy := metav1.DeletePropagationForeground if err := wait.PollImmediate(PollIntervalForNginx, PollTimeoutForNginx, func() (bool, error) { if err := n.client.ExtensionsV1beta1().Deployments(n.Namespace).Delete(context.TODO(), n.Name, metav1.DeleteOptions{ PropagationPolicy: &delPropPolicy, }); err != nil && !apierrors.IsNotFound(err) { return false, nil } if err := n.client.CoreV1().Services(n.Namespace).Delete(context.TODO(), n.Name, metav1.DeleteOptions{ PropagationPolicy: &delPropPolicy, }); err != nil && !apierrors.IsNotFound(err) { return false, nil } return true, nil }); err != nil { return fmt.Errorf("error deleting %s deployment and service: %v", n.Name, err) } return nil } func (n *Nginx) newNginxDeployment() error { var ( repl int32 = 2 cPort int32 = 80 ) d := &extensionsv1beta1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: n.Name, Namespace: n.Namespace, }, Spec: extensionsv1beta1.DeploymentSpec{ Replicas: &repl, Selector: n.podSelector, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: n.podSelector.MatchLabels, }, Spec: v1.PodSpec{ Containers: []v1.Container{ { Name: "nginx", Image: "nginx:1.12-alpine", Ports: []v1.ContainerPort{ { ContainerPort: cPort, }, }, }, }, NodeSelector: n.nodeSelector.MatchLabels, }, }, }, } if _, err := n.client.ExtensionsV1beta1().Deployments(n.Namespace).Create(context.TODO(), d, metav1.CreateOptions{}); err != nil { return err } return nil } func (n *Nginx) newNginxService() error { var ( cPort int32 = 80 tPort int32 = 80 ) svc := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: n.Name, Namespace: n.Namespace, }, Spec: v1.ServiceSpec{ Selector: n.podSelector.MatchLabels, Ports: []v1.ServicePort{ { Protocol: v1.ProtocolTCP, Port: cPort, TargetPort: intstr.FromInt(int(tPort)), }, }, }, } if _, err := n.client.CoreV1().Services(n.Namespace).Create(context.TODO(), svc, metav1.CreateOptions{}); err != nil { return err } return nil } func (n *Nginx) newPingPod(reachable bool) error { name := fmt.Sprintf("%s-ping-job-%s", n.Name, utilrand.String(5)) deadline := int64(PollTimeoutForNginx.Seconds()) cmd := fmt.Sprintf("wget --timeout 5 %s", n.Name) if !reachable { cmd = fmt.Sprintf("! %s", cmd) } runcmd := []string{"/bin/sh", "-c", cmd} job := &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: n.Namespace, }, Spec: batchv1.JobSpec{ ActiveDeadlineSeconds: &deadline, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: n.pingPodSelector.MatchLabels, }, Spec: v1.PodSpec{ Containers: []v1.Container{ { Name: "ping-container", Image: "alpine:3.6", Command: runcmd, }, }, RestartPolicy: v1.RestartPolicyOnFailure, }, }, }, } if _, err := n.client.BatchV1().Jobs(n.Namespace).Create(context.TODO(), job, metav1.CreateOptions{}); err != nil { return err } // wait for pod state if err := wait.PollImmediate(PollIntervalForNginx, PollTimeoutForNginx, func() (bool, error) { j, err := n.client.BatchV1().Jobs(n.Namespace).Get(context.TODO(), job.GetName(), metav1.GetOptions{}) if err != nil { glog.Errorf("Error getting job %s: %v", job.GetName(), err) return false, nil } if j.Status.Succeeded < 1 { return false, nil } return true, nil }); err != nil { return fmt.Errorf("ping job didn't succeed: %v", err) } return nil } ================================================ FILE: e2e/internal/e2eutil/utils/utils.go ================================================ package utils import ( "time" ) const ( // NodeRoleMasterLabel defines the master node's label. NodeRoleMasterLabel = "node-role.kubernetes.io/master" // NodeRoleWorkerLabel defines the worker node's label. NodeRoleWorkerLabel = "node-role.kubernetes.io/node" ) // Retry retries f until f return nil error. // It makes max attempts and adds delay between each attempt. func Retry(attempts int, delay time.Duration, f func() error) error { var err error for i := 0; i < attempts; i++ { err = f() if err == nil { break } if i < attempts-1 { time.Sleep(delay) } } return err } ================================================ FILE: e2e/main_test.go ================================================ package e2e import ( "context" "flag" "fmt" "log" "math/rand" "os" "testing" "time" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" ) // global clients for use by all tests var ( client kubernetes.Interface sshClient *SSHClient expectedMasters int // hint for tests to figure out how to fail or block on resources missing namespace string enableExperimental = flag.Bool("enable-experimental", false, "If true, runs experimental/flaky tests.") ) func init() { rand.Seed(time.Now().UTC().UnixNano()) namespace = fmt.Sprintf("bootkube-e2e-%x", rand.Int31()) } // TestMain handles setup before all tests func TestMain(m *testing.M) { var kubeconfig = flag.String("kubeconfig", "../hack/quickstart/cluster/auth/kubeconfig", "absolute path to the kubeconfig file") var keypath = flag.String("keypath", "", "path to private key for ssh client") flag.IntVar(&expectedMasters, "expectedmasters", 1, "hint needed for certain tests to fail, skip, or block on missing resources") flag.Parse() config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig) if err != nil { fmt.Println(err) os.Exit(1) } // create the clientset client, err = kubernetes.NewForConfig(config) if err != nil { fmt.Println(err) os.Exit(1) } if err := ready(client); err != nil { fmt.Println(err) os.Exit(1) } // create ssh client sshClient = newSSHClientOrDie(*keypath) // createNamespace if _, err := createNamespace(client, namespace); err != nil { fmt.Println(err) os.Exit(1) } // run tests exitCode := m.Run() if err := deleteNamespace(client, namespace); err != nil { fmt.Println(err) os.Exit(1) } os.Exit(exitCode) } func createNamespace(c kubernetes.Interface, name string) (*v1.Namespace, error) { ns, err := c.CoreV1().Namespaces().Create(context.TODO(), &v1.Namespace{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, }, metav1.CreateOptions{}) if errors.IsAlreadyExists(err) { log.Println("ns already exists") } else if err != nil { return nil, fmt.Errorf("failed to create namespace with name %v %v", name, namespace) } return ns, nil } func deleteNamespace(c kubernetes.Interface, name string) error { return c.CoreV1().Namespaces().Delete(context.TODO(), name, metav1.DeleteOptions{}) } // Ready blocks until the cluster is considered available. The current // implementation checks that 1 schedulable node is ready. func ready(c kubernetes.Interface) error { return retry(50, 10*time.Second, func() error { list, err := c.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) if err != nil { return fmt.Errorf("error listing nodes: %v", err) } if len(list.Items) < 1 { return fmt.Errorf("cluster is not ready, waiting for 1 or more worker nodes, have %v", len(list.Items)) } // check for 1 or more ready nodes by ignoring nodes marked unschedulable or containing taints for _, node := range list.Items { switch { case node.Spec.Unschedulable: log.Printf("worker node %q is unschedulable\n", node.Name) case len(node.Spec.Taints) != 0: log.Printf("worker node %q is tainted\n", node.Name) default: for _, condition := range node.Status.Conditions { if condition.Type == v1.NodeReady && condition.Status == v1.ConditionTrue { log.Printf("worker node %q is ready\n", node.Name) return nil } } log.Printf("worker node %q is not ready\n", node.Name) } } return fmt.Errorf("no worker nodes are ready, will retry") }) } func retry(attempts int, delay time.Duration, f func() error) error { var err error for i := 0; i < attempts; i++ { err = f() if err == nil { break } if i < attempts-1 { time.Sleep(delay) } } return err } ================================================ FILE: e2e/network_test.go ================================================ package e2e import ( "context" "fmt" "strings" "testing" "time" "github.com/kubernetes-sigs/bootkube/e2e/internal/e2eutil/testworkload" "k8s.io/api/extensions/v1beta1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes/scheme" ) const ( networkPingPollInterval = 1 * time.Second networkPingPollTimeout = 5 * time.Minute ) // 1. create nginx test workload. // 2. check if network is setup right. // 3. set DefaultDeny policy // 4. create a wget job that fails to hit nginx service // 5. create NetworkPolicy that allows `allow=access` // 6. create a wget job with label `allow=access` that hits the nginx service func TestNetwork(t *testing.T) { // check if calico-node daemonset exists // if absent skip this test if _, err := client.ExtensionsV1beta1().DaemonSets("kube-system").Get(context.TODO(), "calico-node", metav1.GetOptions{}); err != nil { if apierrors.IsNotFound(err) { t.Skip("calico-node daemonset is not installed") } t.Fatalf("error getting calico-node daemonset: %v", err) } var nginx *testworkload.Nginx if err := wait.Poll(networkPingPollInterval, networkPingPollTimeout, func() (bool, error) { var err error if nginx, err = testworkload.NewNginx(client, namespace, testworkload.WithNginxPingJobLabels(map[string]string{"allow": "access"})); err != nil { t.Logf("failed to create test nginx: %v", err) return false, nil } return true, nil }); err != nil { t.Fatalf("failed to create an testworkload: %v", err) } defer nginx.Delete() if err := wait.Poll(networkPingPollInterval, networkPingPollTimeout, func() (bool, error) { if err := nginx.IsReachable(); err != nil { t.Logf("error not reachable %s: %v", nginx.Name, err) return false, nil } return true, nil }); err != nil { t.Fatalf("network not set up correctly: %v", err) } t.Run("DefaultDeny", func(t *testing.T) { HelperDefaultDeny(t, nginx) }) t.Run("NetworkPolicy", func(t *testing.T) { HelperPolicy(t, nginx) }) } func HelperDefaultDeny(t *testing.T, nginx *testworkload.Nginx) { npi, _, err := scheme.Codecs.UniversalDecoder().Decode(defaultDenyNetworkPolicy, nil, &v1beta1.NetworkPolicy{}) if err != nil { t.Fatalf("unable to decode network policy manifest: %v", err) } np, ok := npi.(*v1beta1.NetworkPolicy) if !ok { t.Fatalf("expected manifest to decode into *api.networkpolicy, got %T", npi) } httpRestClient := client.ExtensionsV1beta1().RESTClient() uri := fmt.Sprintf("/apis/%s/%s/namespaces/%s/%s", strings.ToLower("extensions"), strings.ToLower("v1beta1"), strings.ToLower(namespace), strings.ToLower("NetworkPolicies")) result := httpRestClient.Post().RequestURI(uri).Body(np).Do(context.TODO()) if result.Error() != nil { t.Fatal(result.Error()) } defer func() { uri = fmt.Sprintf("/apis/%s/%s/namespaces/%s/%s/%s", strings.ToLower("extensions"), strings.ToLower("v1beta1"), strings.ToLower(namespace), strings.ToLower("NetworkPolicies"), strings.ToLower(np.ObjectMeta.Name)) result = httpRestClient.Delete().RequestURI(uri).Do(context.TODO()) if result.Error() != nil { t.Fatal(result.Error()) } }() if err := wait.Poll(networkPingPollInterval, networkPingPollTimeout, func() (bool, error) { if err := nginx.IsUnReachable(); err != nil { t.Logf("error still reachable %s: %v", nginx.Name, err) return false, nil } return true, nil }); err != nil { t.Fatalf("default deny failed: %v", err) } } func HelperPolicy(t *testing.T, nginx *testworkload.Nginx) { netPolicy := fmt.Sprintf(string(netPolicyTpl), nginx.Name) npi, _, err := scheme.Codecs.UniversalDecoder().Decode([]byte(netPolicy), nil, &v1beta1.NetworkPolicy{}) if err != nil { t.Fatalf("unable to decode network policy manifest: %v", err) } np, ok := npi.(*v1beta1.NetworkPolicy) if !ok { t.Fatalf("expected manifest to decode into *api.networkpolicy, got %T", npi) } httpRestClient := client.ExtensionsV1beta1().RESTClient() uri := fmt.Sprintf("/apis/%s/%s/namespaces/%s/%s", strings.ToLower("extensions"), strings.ToLower("v1beta1"), strings.ToLower(namespace), strings.ToLower("NetworkPolicies")) result := httpRestClient.Post().RequestURI(uri).Body(np).Do(context.TODO()) if result.Error() != nil { t.Fatal(result.Error()) } defer func() { uri = fmt.Sprintf("/apis/%s/%s/namespaces/%s/%s/%s", strings.ToLower("extensions"), strings.ToLower("v1beta1"), strings.ToLower(namespace), strings.ToLower("NetworkPolicies"), strings.ToLower(np.ObjectMeta.Name)) result = httpRestClient.Delete().RequestURI(uri).Do(context.TODO()) if result.Error() != nil { t.Fatal(result.Error()) } }() if err := wait.Poll(networkPingPollInterval, networkPingPollTimeout, func() (bool, error) { if err := nginx.IsReachable(); err != nil { t.Logf("error not reachable %s: %v", nginx.Name, err) return false, nil } return true, nil }); err != nil { t.Fatalf("allow nginx network policy failed: %v", err) } } var defaultDenyNetworkPolicy = []byte(`kind: NetworkPolicy apiVersion: extensions/v1beta1 metadata: name: default-deny spec: podSelector: `) var netPolicyTpl = []byte(`kind: NetworkPolicy apiVersion: extensions/v1beta1 metadata: name: access-nginx spec: podSelector: matchLabels: app: %s ingress: - from: - podSelector: matchLabels: allow: access `) ================================================ FILE: e2e/node_test.go ================================================ package e2e import ( "bytes" "context" "fmt" "time" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "golang.org/x/crypto/ssh" ) const ( LabelNodeRoleMaster = "node-role.kubernetes.io/master" ) type Node struct { *v1.Node } func newNode(n *v1.Node) *Node { return &Node{n} } func (n *Node) GetIPByType(addrType v1.NodeAddressType) string { var host string for _, addr := range n.Status.Addresses { if addr.Type == addrType { host = addr.Address break } } return host } func (n *Node) ExternalIP() string { return n.GetIPByType(v1.NodeExternalIP) } func (n *Node) InternalIP() string { return n.GetIPByType(v1.NodeInternalIP) } func (n *Node) SSH(cmd string) (stdout, stderr []byte, err error) { host := n.ExternalIP() if host == "" { host = n.InternalIP() if host == "" { return nil, nil, fmt.Errorf("cannot find external or internal IP for node %q", n.Name) } } return sshClient.SSH(host, cmd) } func (n *Node) Reboot() error { // ssh to node and reboot rebooter := func() error { stdout, stderr, err := n.SSH("sudo reboot") if _, ok := err.(*ssh.ExitMissingError); ok { // A terminated session is perfectly normal during reboot. err = nil } if err != nil { return fmt.Errorf("issuing reboot command failed: %v\nstdout:%s\nstderr:%s", err, stdout, stderr) } return err } // ensure rebooted node is running checker := func() error { stdout, stderr, err := n.SSH("systemctl is-system-running") if err != nil { return fmt.Errorf("%v: %v", err, stderr) } if !bytes.Contains(stdout, []byte("running")) { return fmt.Errorf("system is not running yet") } return nil } if err := retry(5, 30*time.Second, rebooter); err != nil { return err } return retry(20, 10*time.Second, checker) } // IsMaster returns true if the node's labels contains "node-role.kubernetes.io/master". func (n *Node) IsMaster() bool { _, ok := n.Labels[LabelNodeRoleMaster] return ok } // Cluster is a simple abstraction to make writing tests easier. type Cluster struct { Masters []*Node Workers []*Node } // GetCluster can be called in every test to return a *Cluster object. func GetCluster() (*Cluster, error) { var c Cluster nodelist, err := client.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) if err != nil { return nil, err } for i := range nodelist.Items { nn := newNode(&nodelist.Items[i]) if nn.IsMaster() { c.Masters = append(c.Masters, nn) } else { c.Workers = append(c.Workers, nn) } } return &c, nil } ================================================ FILE: e2e/reboot_test.go ================================================ package e2e import ( "context" "fmt" "log" "sort" "strings" "sync" "testing" "time" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" ) // Reboot all nodes in cluster all at once. Wait for nodes to return. Run nginx // workload. func TestReboot(t *testing.T) { nodeList, err := client.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) if err != nil { t.Fatal(err) } t.Logf("rebooting %v nodes", len(nodeList.Items)) var wg sync.WaitGroup for _, node := range nodeList.Items { wg.Add(1) go func(node v1.Node) { defer wg.Done() if err := newNode(&node).Reboot(); err != nil { t.Errorf("failed to reboot node: %v", err) } }(node) } wg.Wait() if err := nodesReady(client, nodeList, t); err != nil { t.Fatalf("some or all nodes did not recover from reboot: %v", err) } if err := controlPlaneReady(client, 120, 5*time.Second); err != nil { t.Fatalf("waiting for control plane: %v", err) } } // nodesReady blocks until all nodes in list are ready based on Name. Safe // against new unknown nodes joining while the original set reboots. func nodesReady(c kubernetes.Interface, expectedNodes *v1.NodeList, t *testing.T) error { var expectedNodeSet = make(map[string]struct{}) for _, node := range expectedNodes.Items { expectedNodeSet[node.ObjectMeta.Name] = struct{}{} } return retry(80, 5*time.Second, func() error { list, err := c.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{}) if err != nil { return err } var recoveredNodes int for _, node := range list.Items { _, ok := expectedNodeSet[node.ObjectMeta.Name] if !ok { t.Logf("unexpected node checked in") continue } for _, condition := range node.Status.Conditions { if condition.Type == v1.NodeReady { if condition.Status == v1.ConditionTrue { recoveredNodes++ } else { return fmt.Errorf("one or more nodes not in the ready state: %v", node.Status.Phase) } break } } } if recoveredNodes != len(expectedNodeSet) { return fmt.Errorf("not enough nodes recovered, expected %v got %v", len(expectedNodeSet), recoveredNodes) } return nil }) } const checkpointAnnotation = "checkpointer.alpha.coreos.com/checkpoint-of" // controlPlaneReady waits for API server availability and no checkpointed pods // in kube-system. func controlPlaneReady(c kubernetes.Interface, attempts int, backoff time.Duration) error { return retry(attempts, backoff, func() error { pods, err := c.CoreV1().Pods("kube-system").List(context.TODO(), metav1.ListOptions{}) if err != nil { return fmt.Errorf("get pods in kube-system: %v", err) } // list of pods that are checkpoint pods, not the real pods. var ( waitablePods []string regularPods []string ) // only wait on Pods that have lack a parent, or have a non-runnning parent for _, pod := range pods.Items { if checkpointedPodName, ok := pod.Annotations[checkpointAnnotation]; ok { foundParent := false for _, possibleParentPod := range pods.Items { if possibleParentPod.Name == checkpointedPodName { foundParent = possibleParentPod.Status.Phase == "Running" break } } if !foundParent { waitablePods = append(waitablePods, pod.Name) } } else { regularPods = append(regularPods, pod.Name) } } if len(waitablePods) > 0 { sort.Strings(waitablePods) sort.Strings(regularPods) waitablePodsStr := strings.Join(waitablePods, ",") regularPodsStr := strings.Join(regularPods, ",") log.Printf("waiting for control plane: running non-checkpoint pods: %s", regularPodsStr) return fmt.Errorf("waiting for control plane: waiting on checkpointed pods: %s", waitablePodsStr) } return nil }) } ================================================ FILE: e2e/required_imports.go ================================================ package e2e import ( _ "github.com/kubernetes-sigs/bootkube/e2e/internal/e2eutil/testworkload" ) ================================================ FILE: e2e/smoke_test.go ================================================ package e2e import ( "testing" "time" "github.com/kubernetes-sigs/bootkube/e2e/internal/e2eutil/testworkload" ) func TestSmoke(t *testing.T) { nginx, err := testworkload.NewNginx(client, namespace, testworkload.WithNginxPingJobLabels(map[string]string{"allow": "access"})) if err != nil { t.Fatalf("Test nginx creation failed: %v", err) } defer nginx.Delete() if err := retry(60, 5*time.Second, nginx.IsReachable); err != nil { t.Errorf("%s is not reachable: %v", nginx.Name, err) } } ================================================ FILE: e2e/ssh_client_test.go ================================================ package e2e import ( "bytes" "fmt" "io/ioutil" "log" "net" "os" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" "golang.org/x/crypto/ssh/terminal" ) type SSHClient struct { *ssh.ClientConfig } // newSSHClientOrDie tries to create an ssh client. // If $SSH_AUTH_SOCK is set, the use the ssh agent to create the client, // otherwise read the private key directly. func newSSHClientOrDie(keypath string) *SSHClient { var authMethod ssh.AuthMethod sock := os.Getenv("SSH_AUTH_SOCK") if sock != "" { log.Println("Creating ssh client with ssh agent") sshAgent, err := net.Dial("unix", sock) if err != nil { panic(err) } authMethod = ssh.PublicKeysCallback(agent.NewClient(sshAgent).Signers) } else { log.Println("Creating ssh client with private key") key, err := ioutil.ReadFile(keypath) if err != nil { panic(err) } signer, err := ssh.ParsePrivateKey(key) if err != nil { panic(err) } authMethod = ssh.PublicKeys(signer) } sshConfig := &ssh.ClientConfig{ User: "core", // TODO(yifan): Assume all nodes are container linux nodes for now. Auth: []ssh.AuthMethod{authMethod}, HostKeyCallback: ssh.InsecureIgnoreHostKey(), } return &SSHClient{sshConfig} } func (c *SSHClient) SSH(host, cmd string) (stdout, stderr []byte, err error) { client, err := ssh.Dial("tcp", host+":22", c.ClientConfig) // TODO(yifan): Assume all nodes are listening on :22 for ssh requests for now. if err != nil { return nil, nil, err } defer client.Conn.Close() session, err := client.NewSession() if err != nil { return nil, nil, err } defer session.Close() outBuf := bytes.NewBuffer(nil) errBuf := bytes.NewBuffer(nil) session.Stdout = outBuf session.Stderr = errBuf err = session.Run(cmd) stdout = bytes.TrimSpace(outBuf.Bytes()) stderr = bytes.TrimSpace(errBuf.Bytes()) return stdout, stderr, err } // Manhole connects os.Stdin, os.Stdout, and os.Stderr to an interactive shell // session on the Machine m. Manhole blocks until the shell session has ended. // If os.Stdin does not refer to a TTY, Manhole returns immediately with a nil // error. Copied from github.com/coreos/mantle/platform/util.go func (c *SSHClient) Manhole(host string) error { fd := int(os.Stdin.Fd()) if !terminal.IsTerminal(fd) { return nil } tstate, _ := terminal.MakeRaw(fd) defer terminal.Restore(fd, tstate) client, err := ssh.Dial("tcp", host+":22", c.ClientConfig) if err != nil { return err } defer client.Close() session, err := client.NewSession() if err != nil { return fmt.Errorf("SSH session failed: %v", err) } defer session.Close() session.Stdin = os.Stdin session.Stdout = os.Stdout session.Stderr = os.Stderr modes := ssh.TerminalModes{ ssh.TTY_OP_ISPEED: 115200, ssh.TTY_OP_OSPEED: 115200, } cols, lines, err := terminal.GetSize(int(os.Stdin.Fd())) if err != nil { return err } if err = session.RequestPty(os.Getenv("TERM"), lines, cols, modes); err != nil { return fmt.Errorf("failed to request pseudo terminal: %s", err) } if err := session.Shell(); err != nil { return fmt.Errorf("failed to start shell: %s", err) } if err := session.Wait(); err != nil { return fmt.Errorf("failed to wait for session: %s", err) } return nil } ================================================ FILE: go.mod ================================================ module github.com/kubernetes-sigs/bootkube go 1.13 require ( github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect github.com/ghodss/yaml v1.0.0 github.com/gogo/protobuf v1.3.1 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect github.com/google/go-cmp v0.3.1 // indirect github.com/googleapis/gnostic v0.3.1 // indirect github.com/gorilla/websocket v1.4.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.11.3 // indirect github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/imdario/mergo v0.3.8 // indirect github.com/pborman/uuid v1.2.0 github.com/prometheus/client_golang v1.1.0 // indirect github.com/spf13/cobra v0.0.5 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect go.etcd.io/bbolt v1.3.4 // indirect go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 go.uber.org/zap v1.14.1 // indirect golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 golang.org/x/net v0.0.0-20191109021931-daa7c04131f5 golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect google.golang.org/appengine v1.6.5 // indirect google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a // indirect google.golang.org/grpc v1.26.0 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect k8s.io/api v0.18.2 k8s.io/apiextensions-apiserver v0.18.2 k8s.io/apimachinery v0.18.2 k8s.io/client-go v0.18.2 k8s.io/klog v1.0.0 ) ================================================ FILE: go.sum ================================================ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= 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-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= 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/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17OJKJXD2Cfs= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= 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= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 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/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 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-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= github.com/go-openapi/analysis v0.19.5 h1:8b2ZgKfKIUTVQpTb77MoRDIMEIwvDVw40o3aOXdfYzI= github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= github.com/go-openapi/errors v0.19.2 h1:a2kIyV3w+OS3S97zxUndRVD46+FhGOUBDFY7nmu4CsY= github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= github.com/go-openapi/loads v0.19.4 h1:5I4CCSqoWzT+82bBkNIvmLc0UOsoKKQ4Fz+3VxOB7SY= github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= github.com/go-openapi/runtime v0.19.4 h1:csnOgcgAiuGoM/Po7PEpKDoNulCcF3FGbSnbHfxgjMI= github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= github.com/go-openapi/strfmt v0.19.3 h1:eRfyY5SkaNJCAwmmMcADjY31ow9+N7MCLW7oRkbsINA= github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.5 h1:QhCBKRYqZR+SKo4gl1lPhPahope8/RLt6EVgY8X80w0= github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 h1:uHTyIjqVhYRhLbJ8nIiOJHkEZZ+5YoOsAbD3sk82NiE= github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= 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 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= 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/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/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/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0 h1:rVsPeBmXbYv4If/cumu1AzZPwV58q433hvONV1UEZoI= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= 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.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.11.3 h1:h8+NsYENhxNTuq+dobk3+ODoJtwY4Fu0WQXsxJfL8aM= github.com/grpc-ecosystem/grpc-gateway v1.11.3/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/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/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0 h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= 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 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= 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/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0 h1:kRhiuYSXR3+uv2IbVbZhUxK5zVD/2pp3Gd2PpvPkpEo= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= 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.0.3 h1:CTwfnzjQ+8dS6MhHHu4YswVAD99sL2wjPqP+VkURmKE= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 h1:LnC5Kc/wtumK+WB441p7ynQJzVuNRJiqddSIE3IlSEQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738 h1:VcrIfasaLFkyjk6KNlXQSzO+B0fZcnECiDrKJsfxka0= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2 h1:jxcFYjlkl8xaERsgLo+RNquI0epW6zuy/ZRQs6jnrFA= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 h1:/Tl7pH94bvbAAHBdZJT947M/+gp0+CqQXDtMRC0fseo= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225 h1:kNX+jCowfMYzvlSvJu5pQWEmyWFrBXJ3PBy10xKMXK8= 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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/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-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191109021931-daa7c04131f5 h1:bHNaocaoJxYBo5cw41UyTMLjYlb8wPY7+WFrnklbHOM= golang.org/x/net v0.0.0-20191109021931-daa7c04131f5/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 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 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/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 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 h1:+DCIGbF/swA92ohVg0//6X2IVY3KZs6p9mix0ziNYJM= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a h1:Ob5/580gVHBJZgXnff1cZDbG+xLtMVE5mDRTe+nIsX4= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= k8s.io/api v0.18.2 h1:wG5g5ZmSVgm5B+eHMIbI9EGATS2L8Z72rda19RIEgY8= k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/apiextensions-apiserver v0.18.2 h1:I4v3/jAuQC+89L3Z7dDgAiN4EOjN6sbm6iBqQwHTah8= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apimachinery v0.18.2 h1:44CmtbmkzVDAhCpRVSiP2R5PPrC2RtlIv/MoB8xpdRA= k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apiserver v0.18.2 h1:fwKxdTWwwYhxvtjo0UUfX+/fsitsNtfErPNegH2x9ic= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/client-go v0.18.2 h1:aLB0iaD4nmwh7arT2wIn+lMnAq7OswjaejkQ8p9bBYE= k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/component-base v0.18.2 h1:SJweNZAGcUvsypLGNPNGeJ9UgPZQ6+bW+gEHe8uyh/Y= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c h1:/KUFqjjqAcY4Us6luF5RDNZ16KJtb49HfR3ZHB9qYXM= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89 h1:d4vVOjXm687F1iLSP2q3lyPPuyvTUt3aVoBpi2DqRsU= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7 h1:uuHDyjllyzRyCIvvn0OBjiRB0SgBZGqHNYAmjR7fO50= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0 h1:dOmIZBMfhcHS09XZkMyUgkq5trg3/jRyJYFZUiaOp8E= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= ================================================ FILE: hack/jenkins/README.md ================================================ # hack/jenkins Job configurations, pipelines, scripts, and docker images used for `bootkube` validation. ### Overvew This contains all specifications for `bootkube` Jenkins jobs. No changes are made to these jobs after they are deployed. They are re-deployed each time Jenkins is restarted. The goal is for Jenkins and its job configurations to be as fungible as possible. ### Jenkins Quick Information - Declarative, Verison-Controlled Jenkins Jobs - (via [Job DSL Plugin](https://github.com/jenkinsci/job-dsl-plugin)) - It defines a groovy DSL for specifying Jenkins job in a declarative-looking imperative syntax that emits Jenkins job xml. - It provides a "Build Action" that is used in a "Seed Job" (defined in a separate repo) to instantiate jobs. - Jobs for this repo are defined in `./jobs/`. - Jenkinsfile / Jenkins Pipelines - (built-in to Jenkins) - Jenkins has pipelines for defining workflows for jobs in a version-control friendly manner (as opposed to the non-friendly XML files that it uses internally) - Confusingly, they come in two variants - [Declarative Pipelines](https://jenkins.io/doc/book/pipeline/syntax/#declarative-pipeline) and [Scripted Pipelines](https://jenkins.io/doc/book/pipeline/syntax/#scripted-pipeline). Be sure you are reading the docs for the right kind. They have slightly different steps, and even they have same-named steps, they can have behavioral differences. - This repository favors "Declarative Pipelines" where possible. - It seems to be where Jenkins is trending and trying to push people toward. - The syntax is more convincingly declarative. - It has an escape hatch that allows you to enter a scripting block and use the full scripting syntax. - Pipelines for this repo are defined in `./pipelines/`. - Kubernetes Plugin - (via [Kubernetes Plugin](https://github.com/jenkinsci/kubernetes-plugin)) - Allows using a Kubernetes cluster as a Jenkins "Cloud" (resource from which worker Agents can be spawned). - _Note:_ All jobs here are expected to run on the default `kubernetes` cloud. ### Structure - `images`: Contains `Dockerfile`s for any images used in validation. (_Note:_ images used for CI are not considered or supported as part of any bootkube release.) - `jobs`: Contains top-level groovy scripts containing the Job DSL configurations. (these are recommeneded to be (but are not necessarily) Pipeline Jobs.) - `pipelines`: Contains `Jenkinsfile` pipelines used as part of pipeline jobs. - `scripts`: Contains scripts that are used in Pipelines, or in Jobs directly. (May or may not be usable outside of Jenkins. Only supported as part of CI.) This shows an example directory structure, added as part of the `bootkube-e2e-*` jobs: hack/jenkins ├── images │   └── bootkube-e2e │   └── Dockerfile ├── jobs │   └── bootkube_e2e.groovy ├── pipelines │   └── bootkube-e2e │   └── Jenkinsfile └── scripts ├── e2e.sh ├── tqs-down.sh └── tqs-up.sh ### Currently Defined Jobs - tku-bootkube-e2e-\* - calico: tests a standard single-master bootkube cluster with calico - flannel: tests a standard single-master bootkube cluster with flannel - tku-2-release-hyperkube - default: builds and optionally pushes a hyperkube image to quay.io ================================================ FILE: hack/jenkins/images/bootkube-e2e/Dockerfile ================================================ FROM ubuntu:xenial RUN apt-get update && apt-get upgrade -y && \ apt-get install -y unzip wget curl git make jq openssh-client && \ rm -rf /var/lib/apt/lists/* RUN wget https://godeb.s3.amazonaws.com/godeb-amd64.tar.gz && \ tar xvzf godeb-amd64.tar.gz && \ ./godeb install 1.10 && \ rm -rf godeb* *.deb ENV TERRAFORM_VERSION 0.11.3 RUN curl -L -O "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" && \ unzip "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" && \ mv terraform /usr/local/bin/ && \ rm "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" ================================================ FILE: hack/jenkins/jobs/bootkube_conformance_cncf.groovy ================================================ // META repo = "kubernetes-incubator/bootkube" // CONFIG org_whitelist = ['coreos', 'coreos-inc'] job_admins = ['ericchiang', 'rithujohn191', 'rphillips'] user_whitelist = job_admins // JOBS job_name = "tku-bootkube-conformance-cncf" pipelineJob(job_name) { parameters { stringParam('sha1', 'master', 'git reference to build') } definition { cpsScm { scm { git { remote { github("${repo}") refspec('+refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/remotes/origin/pr/*') credentials('github_userpass') } branch('${sha1}') } } scriptPath('hack/jenkins/pipelines/bootkube-conformance/Jenkinsfile') } triggers { cron('H 11 * * *') } } } ================================================ FILE: hack/jenkins/jobs/bootkube_e2e.groovy ================================================ // META repo = "kubernetes-incubator/bootkube" // CONFIG org_whitelist = ['coreos', 'coreos-inc'] job_admins = ['colemickens', 'ericchiang', 'rithujohn191', 'rphillips'] user_whitelist = job_admins // JOBS network_providers = ['flannel', 'calico'] network_providers.each { np -> // Note: the "tku-" prefix is to differentiate "team-kube-upstream" jenkins job // statuses and triggers from the legacy jobs and triggers. job_name = "tku-bootkube-e2e-${np}" pipelineJob(job_name) { parameters { stringParam('sha1', 'origin/master', 'git reference to build') stringParam('NETWORK_PROVIDER', "${np}", 'network provider') } definition { triggers { githubPullRequest { admins(job_admins) userWhitelist(user_whitelist) orgWhitelist(org_whitelist) useGitHubHooks(true) onlyTriggerPhrase(false) triggerPhrase("coreosbot run ${job_name}") extensions { commitStatus { // TODO: this is dependent on this merging, or using my fork: https://github.com/awslabs/aws-js-s3-explorer/pull/16 statusUrl('https://bootkube-pr-logs.s3-us-west-2.amazonaws.com/index.html#pr/${JOB_NAME}-${BUILD_NUMBER}/') context(job_name) triggeredStatus('e2e triggered') startedStatus('e2e started') completedStatus('SUCCESS', 'e2e succeeded') completedStatus('FAILURE', 'e2e failed. Investigate!') completedStatus('PENDING', 'e2e queued') completedStatus('ERROR', 'e2e internal error. Investigate!') } } } } cpsScm { scm { git { remote { github("${repo}") refspec('+refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/remotes/origin/pr/*') credentials('github_userpass') } branch('${sha1}') } } scriptPath('hack/jenkins/pipelines/bootkube-e2e/Jenkinsfile') } } } } ================================================ FILE: hack/jenkins/pipelines/bootkube-conformance/Jenkinsfile ================================================ // Declarative Pipeline used by `bootkube-conformance` job def bash(String cmd) { sh("#/usr/bin/env bash\nset -euo pipefail\n${cmd}") } pipeline { agent { kubernetes { cloud 'kubernetes' label "${JOB_NAME}-${BUILD_NUMBER}" containerTemplate { name 'default' image 'quay.io/coreos/bootkube-e2e-builder:v0.1' ttyEnabled true command 'cat' } } } options { timeout(time: 3, unit: 'HOURS') ansiColor('xterm') timestamps() skipDefaultCheckout(true) } environment { CLUSTER_NAME="${JOB_NAME}-${BUILD_NUMBER}" ARTIFACT_DIR="${WORKSPACE}/artifacts" REGION = "us-west-2" GOPATH = "${WORKSPACE}" WORKDIR = "${WORKSPACE}/src/github.com/kubernetes-sigs/bootkube" KUBECONFIG = "${WORKSPACE}/src/github.com/kubernetes-sigs/bootkube/hack/quickstart/cluster/auth/kubeconfig" IDENT = "${WORKSPACE}/src/github.com/kubernetes-sigs/bootkube/hack/quickstart/cluster/auth/id_rsa" BOOTKUBE_OPTS = "--strict" AWS_CRED = credentials('aws') ACCESS_KEY_ID = "${AWS_CRED_USR}" ACCESS_KEY_SECRET = "${AWS_CRED_PSW}" } stages { stage('checkout') { steps { // jnlp slave runs as "jenkins" user, use the escape hatch. (https://hub.docker.com/r/jenkins/slave/~/dockerfile/) bash "chmod -R go+rw /home/jenkins" bash "mkdir -p \"${ARTIFACT_DIR}\"" dir("${WORKDIR}") { checkout scm } } } stage('build') { steps { dir("${WORKDIR}") { bash "make release |& tee -a ${ARTIFACT_DIR}/build.log" } } } stage('deploy') { steps { dir("${WORKDIR}") { bash "./hack/jenkins/scripts/tqs-up.sh |& tee -a ${ARTIFACT_DIR}/deploy.log" } } } stage('conformance') { steps { dir("${WORKDIR}") { bash "./hack/jenkins/scripts/conformance.sh |& tee -a ${ARTIFACT_DIR}/conformance.log" } } } } post { always { script { stage('collect-logs') { bash "${WORKDIR}/hack/jenkins/scripts/gather-logs.sh || true" bash "cp -r ${WORKDIR}/hack/quickstart/logs-** ${ARTIFACT_DIR}/ || true" } stage('cleanup') { bash "(${WORKDIR}/hack/jenkins/scripts/tqs-down.sh || true) |& tee -a ${ARTIFACT_DIR}/cleanup.log" } stage('archive-logs') { dir("${ARTIFACT_DIR}") { archiveArtifacts '**/*' withAWS(credentials: 'aws', region: "${REGION}") { bash "tar -czf /tmp/artifacts.tar.gz ." bash "mv /tmp/artifacts.tar.gz \"${ARTIFACT_DIR}/artifacts-${JOB_NAME}-${BUILD_NUMBER}.tar.gz\"" // note: do not use includepathpattern! https://issues.jenkins-ci.org/browse/JENKINS-47046 s3Upload(acl: 'PublicRead', bucket: 'bootkube-pr-logs', path: "pr/${JOB_NAME}-${BUILD_NUMBER}/", file: "${ARTIFACT_DIR}") } } } } } } } ================================================ FILE: hack/jenkins/pipelines/bootkube-e2e/Jenkinsfile ================================================ // Declarative Pipeline (used by `bootkube-e2e-*` jobs) def bash(String cmd) { sh("#/usr/bin/env bash\nset -euo pipefail\n${cmd}") } pipeline { agent { kubernetes { cloud 'kubernetes' label "${JOB_NAME}-${BUILD_NUMBER}" containerTemplate { name 'default' image 'quay.io/coreos/bootkube-e2e-builder:v0.1' ttyEnabled true command 'cat' } } } options { timeout(time: 1, unit: 'HOURS') ansiColor('xterm') timestamps() skipDefaultCheckout(true) } environment { CLUSTER_NAME="${JOB_NAME}-${BUILD_NUMBER}" ARTIFACT_DIR="${WORKSPACE}/artifacts" REGION = "us-west-2" GOPATH = "${WORKSPACE}" WORKDIR = "${WORKSPACE}/src/github.com/kubernetes-sigs/bootkube" KUBECONFIG = "${WORKSPACE}/src/github.com/kubernetes-sigs/bootkube/hack/quickstart/cluster/auth/kubeconfig" IDENT = "${WORKSPACE}/src/github.com/kubernetes-sigs/bootkube/hack/quickstart/cluster/auth/id_rsa" BOOTKUBE_OPTS = "--strict" TF_VAR_network_provider = "${NETWORK_PROVIDER}" AWS_CRED = credentials('aws') ACCESS_KEY_ID = "${AWS_CRED_USR}" ACCESS_KEY_SECRET = "${AWS_CRED_PSW}" } stages { stage('checkout') { steps { // jnlp slave runs as "jenkins" user, use the escape hatch. (https://hub.docker.com/r/jenkins/slave/~/dockerfile/) bash "chmod -R go+rw /home/jenkins" bash "mkdir -p \"${ARTIFACT_DIR}\"" dir("${WORKDIR}") { checkout scm } } } stage('build') { steps { dir("${WORKDIR}") { bash "make release |& tee -a ${ARTIFACT_DIR}/build.log" } } } stage('deploy') { steps { dir("${WORKDIR}") { bash "./hack/jenkins/scripts/tqs-up.sh |& tee -a ${ARTIFACT_DIR}/deploy.log" } } } stage('e2e') { steps { dir("${WORKDIR}") { bash "./hack/jenkins/scripts/e2e.sh |& tee -a ${ARTIFACT_DIR}/e2e.log" } } } } // Notes about the post/always stage(s): // We are breaking the seal and using a script{} block for better management of "stages" // and so that additional actions are available. There is " || true" used below, so // that a script failure doesn't prevent teardown/cleanup/log-upload/etc as much as possible. post { always { script { stage('collect-logs') { bash "${WORKDIR}/hack/jenkins/scripts/gather-logs.sh || true" bash "cp -r ${WORKDIR}/hack/quickstart/logs-** ${ARTIFACT_DIR}/ || true" } stage('cleanup') { bash "(${WORKDIR}/hack/jenkins/scripts/tqs-down.sh || true) |& tee -a ${ARTIFACT_DIR}/cleanup.log" } stage('archive-logs') { dir("${ARTIFACT_DIR}") { archiveArtifacts '**/*' withAWS(credentials: 'aws', region: "${REGION}") { bash "tar -czf /tmp/artifacts.tar.gz ." bash "mv /tmp/artifacts.tar.gz \"${ARTIFACT_DIR}/artifacts-${JOB_NAME}-${BUILD_NUMBER}.tar.gz\"" // note: do not use includepathpattern! https://issues.jenkins-ci.org/browse/JENKINS-47046 s3Upload(acl: 'PublicRead', bucket: 'bootkube-pr-logs', path: "pr/${JOB_NAME}-${BUILD_NUMBER}/", file: "${ARTIFACT_DIR}") } } } } } } } ================================================ FILE: hack/jenkins/scripts/conformance.sh ================================================ #!/bin/bash set -euo pipefail export KUBECONFIG="${KUBECONFIG:-"${DIR}/../../quickstart/cluster/auth/kubeconfig"}" export KUBERNETES_VERSION="v1.13.3" # Set up kubectl curl -L -O -v https://storage.googleapis.com/kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/amd64/kubectl chmod +x ./kubectl export PATH=$PATH:$PWD echo "kubectl setup completed" # sonobuoy # Conformance yaml file from https://raw.githubusercontent.com/cncf/k8s-conformance/master/sonobuoy-conformance.yaml cat << EOF >> conformance.yaml --- apiVersion: v1 kind: Namespace metadata: name: sonobuoy --- apiVersion: v1 kind: ServiceAccount metadata: labels: component: sonobuoy name: sonobuoy-serviceaccount namespace: sonobuoy --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: labels: component: sonobuoy name: sonobuoy-serviceaccount roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: sonobuoy-serviceaccount subjects: - kind: ServiceAccount name: sonobuoy-serviceaccount namespace: sonobuoy --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: labels: component: sonobuoy name: sonobuoy-serviceaccount namespace: sonobuoy rules: - apiGroups: - '*' resources: - '*' verbs: - '*' --- apiVersion: v1 kind: ConfigMap metadata: labels: component: sonobuoy name: sonobuoy-config-cm namespace: sonobuoy data: config.json: | { "Description": "CNCF v1.9 or v.1.10 Conformance Results", "Filters": { "LabelSelector": "", "Namespaces": ".*" }, "PluginNamespace": "sonobuoy", "Plugins": [ { "name": "e2e" } ], "Resources": [ ], "ResultsDir": "/tmp/sonobuoy", "Server": { "advertiseaddress": "sonobuoy-master:8080", "bindaddress": "0.0.0.0", "bindport": 8080, "timeoutseconds": 5400 }, "Version": "v0.10.0" } --- apiVersion: v1 kind: ConfigMap metadata: labels: component: sonobuoy name: sonobuoy-plugins-cm namespace: sonobuoy data: e2e.tmpl: | apiVersion: v1 kind: Pod metadata: annotations: sonobuoy-driver: Job sonobuoy-plugin: e2e sonobuoy-result-type: e2e labels: component: sonobuoy sonobuoy-run: '{{.SessionID}}' tier: analysis name: sonobuoy-e2e-job-{{.SessionID}} namespace: '{{.Namespace}}' spec: containers: - env: - name: E2E_FOCUS value: '\[Conformance\]' image: gcr.io/heptio-images/kube-conformance:v1.10 imagePullPolicy: Always name: e2e volumeMounts: - mountPath: /tmp/results name: results readOnly: false - command: - sh - -c - /sonobuoy worker global -v 5 --logtostderr env: - name: NODE_NAME valueFrom: fieldRef: apiVersion: v1 fieldPath: spec.nodeName - name: RESULTS_DIR value: /tmp/results - name: MASTER_URL value: '{{.MasterAddress}}' - name: RESULT_TYPE value: e2e image: gcr.io/heptio-images/sonobuoy:v0.10.0 imagePullPolicy: Always name: sonobuoy-worker volumeMounts: - mountPath: /tmp/results name: results readOnly: false restartPolicy: Never serviceAccountName: sonobuoy-serviceaccount tolerations: - effect: NoSchedule key: node-role.kubernetes.io/master operator: Exists - key: CriticalAddonsOnly operator: Exists volumes: - emptyDir: {} name: results --- apiVersion: v1 kind: Pod metadata: labels: component: sonobuoy run: sonobuoy-master tier: analysis name: sonobuoy namespace: sonobuoy spec: containers: - command: - /bin/bash - -c - /sonobuoy master --no-exit=true -v 3 --logtostderr env: - name: SONOBUOY_ADVERTISE_IP valueFrom: fieldRef: fieldPath: status.podIP image: gcr.io/heptio-images/sonobuoy:v0.10.0 imagePullPolicy: Always name: kube-sonobuoy volumeMounts: - mountPath: /etc/sonobuoy name: sonobuoy-config-volume - mountPath: /plugins.d name: sonobuoy-plugins-volume - mountPath: /tmp/sonobuoy name: output-volume restartPolicy: Never serviceAccountName: sonobuoy-serviceaccount volumes: - configMap: name: sonobuoy-config-cm name: sonobuoy-config-volume - configMap: name: sonobuoy-plugins-cm name: sonobuoy-plugins-volume - emptyDir: {} name: output-volume --- apiVersion: v1 kind: Service metadata: labels: component: sonobuoy run: sonobuoy-master name: sonobuoy-master namespace: sonobuoy spec: ports: - port: 8080 protocol: TCP targetPort: 8080 selector: run: sonobuoy-master type: ClusterIP EOF echo "Waiting for cluster to be up and ready" # Wait for cluster to be ready readyNodes() { kubectl --kubeconfig="${KUBECONFIG}" get nodes -o template --template='{{range .items}}{{range .status.conditions}}{{if eq .type "Ready"}}{{.}}{{end}}{{end}}{{end}}' | grep -o -E True | wc -l } until [[ "$(readyNodes)" == "2" ]]; do echo "$(readyNodes) of 2 nodes are Ready..." sleep 10 done echo "Applying conformance tests" kubectl --kubeconfig="${KUBECONFIG}" apply -f conformance.yaml until [[ "$(kubectl --kubeconfig="${KUBECONFIG}" logs sonobuoy -n sonobuoy --tail=1)" == *"no-exit was specified, sonobuoy is now blocking"* ]]; do echo "Waiting for sonobuoy results" kubectl --kubeconfig="${KUBECONFIG}" logs sonobuoy -n sonobuoy --tail=1 || true sleep 10 done # Copy results from pod to Jenkins executor kubectl --kubeconfig="${KUBECONFIG}" cp sonobuoy/sonobuoy:/tmp/sonobuoy ${ARTIFACT_DIR}/conformance-results ================================================ FILE: hack/jenkins/scripts/e2e.sh ================================================ #!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" set -x set -euo pipefail cd "${DIR}/../../../e2e" export KUBECONFIG="${KUBECONFIG:-"${DIR}/../../quickstart/cluster/auth/kubeconfig"}" go test -v -timeout 45m \ --kubeconfig="${KUBECONFIG}" \ --keypath="${IDENT}" \ --expectedmasters=1 \ ./e2e/ ================================================ FILE: hack/jenkins/scripts/gather-logs.sh ================================================ #!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" set -x set -euo pipefail export IDENT="${IDENT:-"${HOME}/.ssh/id_rsa"}" cd ${DIR}/../../terraform-quickstart/ # TODO: unclear why ssh-agent isn't still running from tqs-up.sh... if [ -z "${SSH_AUTH_SOCK:-}" ] ; then ssh-agent -s > "/tmp/bootkube-tqs-sshagent.env" source "/tmp/bootkube-tqs-sshagent.env" ssh-add "${IDENT}" fi ./genlogs.sh ./copylogs.sh ================================================ FILE: hack/jenkins/scripts/tqs-down.sh ================================================ #!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" set -x set -euo pipefail export TERRAFORM="terraform" export NUM_WORKERS=${NUM_WORKERS:-1} export ADDITIONAL_MASTERS=${ADDITIONAL_MASTER:-0} export REGION="${REGION:-"us-west-2"}" export CLUSTER_NAME="${CLUSTER_NAME:-"default"}" export IDENT="${IDENT:-"${HOME}/.ssh/id_rsa"}" export KUBERNETES_IDENT=${KUBERNETES_IDENT:-"${DIR}/.kubernetes-id"} cd "${DIR}/../../terraform-quickstart" set +x export TF_VAR_access_key_id="${ACCESS_KEY_ID}" export TF_VAR_access_key="${ACCESS_KEY_SECRET}" set -x export TF_VAR_kubernetes_id="$(cat ${KUBERNETES_IDENT})" export TF_VAR_resource_owner="${CLUSTER_NAME}" export TF_VAR_ssh_public_key="$(cat "${IDENT}.pub")" export TF_VAR_additional_masters="${ADDITIONAL_MASTERS}" export TF_VAR_num_workers=${NUM_WORKERS} export TF_VAR_region="${REGION}" # early exit if there's no state file. we probably failed before we even got to terraform if [[ ! -f "./terraform.tfstate" ]]; then exit 0; fi for i in 1 2 3 4 5; do "${TERRAFORM}" destroy --force && break || sleep 15; done # TODO: remove if unnecessary # if additional resources are destroyed in subsequent calls, the "cleanup" stage will painlessly fail # giving us an indicator we need this. if we don't, let's remove it. destroyed_extra="" for i in 1 2 3; do #sleep 30 output="$("${TERRAFORM}" destroy --force | tail -1)" count="$(echo "$output" | sed 's/.*\([0-9]\+\) destroyed.*/\1/')" if (( count > 0 )); then destroyed_extra="y" fi done if [[ ! -z "${destroyed_extra:-}" ]]; then echo "Terraform required multiple 'destroy' runs to cleanup everything!" exit -1 fi rm -f ${KUBERNETES_IDENT} ================================================ FILE: hack/jenkins/scripts/tqs-up.sh ================================================ #!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" set -x set -euo pipefail export TERRAFORM="terraform" export NUM_WORKERS=${NUM_WORKERS:-1} export ADDITIONAL_MASTERS=${ADDITIONAL_MASTER:-0} export REGION="${REGION:-"us-west-2"}" export CLUSTER_NAME="${CLUSTER_NAME:-"default"}" export IDENT="${IDENT:-"${HOME}/.ssh/id_rsa"}" export KUBERNETES_IDENT=${KUBERNETES_IDENT:-"${DIR}/.kubernetes-id"} cd "${DIR}/../../terraform-quickstart" if [[ ! -f "${IDENT}" ]]; then mkdir -p "$(dirname "${IDENT}")" ssh-keygen -t rsa -f "${IDENT}" -q -N "" fi if [ -z "${SSH_AUTH_SOCK:-}" ] ; then ssh-agent -s > "/tmp/bootkube-tqs-sshagent.env" source "/tmp/bootkube-tqs-sshagent.env" ssh-add "${IDENT}" fi set +x export TF_VAR_access_key_id="${ACCESS_KEY_ID}" export TF_VAR_access_key="${ACCESS_KEY_SECRET}" set -x # terraform defaults cannot contain terraform interpolations (uuid()) so we # generate the ID outside of terraform. export TF_VAR_kubernetes_id="$(cat /proc/sys/kernel/random/uuid)" export TF_VAR_resource_owner="${CLUSTER_NAME}" export TF_VAR_ssh_public_key="$(cat "${IDENT}.pub")" export TF_VAR_additional_masters="${ADDITIONAL_MASTERS}" export TF_VAR_num_workers=${NUM_WORKERS} export TF_VAR_region="${REGION}" # write out kubernetes cluster ID so we can remove it in cleanup rm -f ${KUBERNETES_IDENT} echo ${TF_VAR_kubernetes_id} > ${KUBERNETES_IDENT} # bring up compute "${TERRAFORM}" init "${TERRAFORM}" apply --auto-approve # sleep so ssh works with start-cluster sleep 30 #avoid some IPs being blank bootkube/issues/552 "${TERRAFORM}" refresh #launch bootkube via quickstart scripts ./start-cluster.sh ================================================ FILE: hack/multi-node/README.md ================================================ # Hack / Dev multi-node build **Note: All scripts are assumed to be ran from this directory.** ## Quickstart This will generate the default assets in the `cluster` directory and launch multi-node self-hosted cluster. ``` ./bootkube-up ``` ## Running E2E tests ``` ssh-add ~/.vagrant.d/insecure_private_key export KUBECONFIG=$PWD/cluster/auth/kubeconfig cd ../.. # project root go test -v ./e2e/ --kubeconfig=$KUBECONFIG ``` ## Cleaning up To stop the running cluster and remove generated assets, run: ``` vagrant destroy -f rm -rf cluster ``` ================================================ FILE: hack/multi-node/Vagrantfile ================================================ # -*- mode: ruby -*- # # vi: set ft=ruby : require 'fileutils' require 'open-uri' require 'tempfile' require 'yaml' Vagrant.require_version ">= 1.6.0" $update_channel = "stable" $controller_count = 1 $controller_vm_memory = 2048 $worker_count = 1 $worker_vm_memory = 1024 if $worker_vm_memory < 1024 puts "Workers should have at least 1024 MB of memory" end CONTROLLER_USER_DATA_PATH = File.expand_path("./cluster/user-data-controller") WORKER_USER_DATA_PATH = File.expand_path("./cluster/user-data-worker") KUBECONFIG_PATH = File.expand_path("cluster/auth/kubeconfig-kubelet") CA_CERT_PATH = File.expand_path("cluster/tls/ca.crt") ETCD_CLI_CERT_GLOB = File.expand_path("cluster/tls/etcd-*") ETCD_CERT_GLOB = File.expand_path("cluster/tls/etcd/*") def etcdIP(num) return "172.17.4.#{num+50}" end def controllerIP(num) return "172.17.4.#{num+100}" end def workerIP(num) return "172.17.4.#{num+200}" end $etcd_count = 1 $etcd_vm_memory = 512 ETCD_CLOUD_CONFIG_PATH = File.expand_path("./etcd-cloud-config.yaml") etcdIPs = [*1..$etcd_count].map{ |i| etcdIP(i) } initial_etcd_cluster = etcdIPs.map.with_index{ |ip, i| "e#{i+1}=https://#{ip}:2380" }.join(",") Vagrant.configure("2") do |config| # always use Vagrant's insecure key config.ssh.insert_key = false config.vm.box = "coreos-%s" % $update_channel config.vm.box_version = ">= 766.0.0" config.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json" % $update_channel ["vmware_fusion", "vmware_workstation"].each do |vmware| config.vm.provider vmware do |v, override| override.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant_vmware_fusion.json" % $update_channel end end config.vm.provider :virtualbox do |v| # On VirtualBox, we don't have guest additions or a functional vboxsf # in CoreOS, so tell Vagrant that so it can be smarter. v.check_guest_additions = false v.functional_vboxsf = false end # plugin conflict if Vagrant.has_plugin?("vagrant-vbguest") then config.vbguest.auto_update = false end ["vmware_fusion", "vmware_workstation"].each do |vmware| config.vm.provider vmware do |v| v.vmx['numvcpus'] = 1 v.gui = false end end config.vm.provider :virtualbox do |vb| vb.cpus = 1 vb.gui = false end (1..$etcd_count).each do |i| config.vm.define vm_name = "e%d" % i do |etcd| data = File.read(ETCD_CLOUD_CONFIG_PATH) data = data.gsub("{{ETCD_NODE_NAME}}", vm_name) data = data.gsub("{{ETCD_INITIAL_CLUSTER}}", initial_etcd_cluster) etcd_config_file = Tempfile.new('etcd_config') etcd_config_file.write(data) etcd_config_file.close etcd.vm.hostname = vm_name ["vmware_fusion", "vmware_workstation"].each do |vmware| etcd.vm.provider vmware do |v| v.vmx['memsize'] = $etcd_vm_memory end end etcd.vm.provider :virtualbox do |vb| vb.memory = $etcd_vm_memory end etcd.vm.network :private_network, ip: etcdIP(i) etcd.vm.provision :file, source: etcd_config_file.path, destination: "/tmp/vagrantfile-user-data" etcd.vm.provision :shell, inline: "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", privileged: true etcd.vm.provision :shell, :inline => "mkdir -p /etc/etcd/tls", :privileged => true Dir.glob(ETCD_CLI_CERT_GLOB) do |etcd_cert_file| etcd.vm.provision :file, :source => etcd_cert_file, :destination => "/tmp/#{File.basename(etcd_cert_file)}" etcd.vm.provision :shell, :inline => "mv /tmp/#{File.basename(etcd_cert_file)} /etc/etcd/tls/", :privileged => true end etcd.vm.provision :shell, :inline => "mkdir -p /etc/etcd/tls/etcd", :privileged => true Dir.glob(ETCD_CERT_GLOB) do |etcd_cert_file| etcd.vm.provision :file, :source => etcd_cert_file, :destination => "/tmp/#{File.basename(etcd_cert_file)}" etcd.vm.provision :shell, :inline => "mv /tmp/#{File.basename(etcd_cert_file)} /etc/etcd/tls/etcd/", :privileged => true end etcd.vm.provision :shell, :inline => "chown -R etcd:etcd /etc/etcd", :privileged => true etcd.vm.provision :shell, :inline => "chmod -R u=rX,g=,o= /etc/etcd", :privileged => true end end (1..$controller_count).each do |i| config.vm.define vm_name = "c%d" % i do |controller| controller.vm.hostname = vm_name ["vmware_fusion", "vmware_workstation"].each do |vmware| controller.vm.provider vmware do |v| v.vmx['memsize'] = $controller_vm_memory end end controller.vm.provider :virtualbox do |vb| vb.memory = $controller_vm_memory end controllerIP = controllerIP(i) controller.vm.network :private_network, ip: controllerIP controller.vm.provision :file, source: CONTROLLER_USER_DATA_PATH, destination: "/tmp/vagrantfile-user-data" controller.vm.provision :shell, inline: "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", privileged: true controller.vm.provision :shell, :inline => "mkdir -p /etc/kubernetes", :privileged => true controller.vm.provision :file, :source => KUBECONFIG_PATH, :destination => "/tmp/kubeconfig" controller.vm.provision :shell, :inline => "mv /tmp/kubeconfig /etc/kubernetes/kubeconfig", :privileged => true controller.vm.provision :file, :source => CA_CERT_PATH, :destination => "/tmp/ca.crt" controller.vm.provision :shell, :inline => "mv /tmp/ca.crt /etc/kubernetes/ca.crt", :privileged => true end end (1..$worker_count).each do |i| config.vm.define vm_name = "w%d" % i do |worker| worker.vm.hostname = vm_name ["vmware_fusion", "vmware_workstation"].each do |vmware| worker.vm.provider vmware do |v| v.vmx['memsize'] = $worker_vm_memory end end worker.vm.provider :virtualbox do |vb| vb.memory = $worker_vm_memory end workerIP = workerIP(i) worker.vm.network :private_network, ip: workerIP worker.vm.provision :file, source: WORKER_USER_DATA_PATH, destination: "/tmp/vagrantfile-user-data" worker.vm.provision :shell, inline: "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", privileged: true worker.vm.provision :shell, :inline => "mkdir -p /etc/kubernetes", :privileged => true worker.vm.provision :file, :source => KUBECONFIG_PATH, :destination => "/tmp/kubeconfig" worker.vm.provision :shell, :inline => "mv /tmp/kubeconfig /etc/kubernetes/kubeconfig", :privileged => true worker.vm.provision :file, :source => CA_CERT_PATH, :destination => "/tmp/ca.crt" worker.vm.provision :shell, :inline => "mv /tmp/ca.crt /etc/kubernetes/ca.crt", :privileged => true end end end ================================================ FILE: hack/multi-node/bootkube-test-recovery ================================================ #!/usr/bin/env bash set -euo pipefail GLOG_v=${GLOG_v:-1} HOST=${HOST:-c1} if [ ! -d "cluster" ]; then echo "Need some cluster assets to perform recovery; try running bootkube-up." fi echo echo "Destroying and re-creating the master node..." echo vagrant destroy -f $HOST vagrant up $HOST echo echo "As you can see, the cluster is now dead:" echo set -x ! kubectl --kubeconfig=cluster/auth/kubeconfig get nodes { set +x; } 2>/dev/null echo echo "Recovering the control plane from etcd..." echo scp -q -F ssh_config ../../_output/bin/linux/bootkube cluster/auth/kubeconfig cluster/tls/etcd-* core@$HOST:/home/core ssh -q -F ssh_config core@$HOST "GLOG_v=${GLOG_v} /home/core/bootkube recover \ --recovery-dir=/home/core/recovered \ --etcd-ca-path=/home/core/etcd-client-ca.crt \ --etcd-certificate-path=/home/core/etcd-client.crt \ --etcd-private-key-path=/home/core/etcd-client.key \ --etcd-servers=https://172.17.4.51:2379 \ --kubeconfig=/home/core/kubeconfig 2>> /home/core/recovery.log" echo echo "Running bootkube start..." echo ssh -q -F ssh_config core@$HOST "sudo GLOG_v=${GLOG_v} /home/core/bootkube start --asset-dir=/home/core/recovered 2>> /home/core/recovery.log" echo echo "The cluster should now be recovered. You should be able to access the cluster again using:" echo "kubectl --kubeconfig=cluster/auth/kubeconfig get nodes" echo ================================================ FILE: hack/multi-node/bootkube-up ================================================ #!/usr/bin/env bash set -euo pipefail GLOG_v=${GLOG_v:-1} un="$(uname)" local_os="linux" if [ ${un} == 'Darwin' ]; then local_os="darwin" fi # Note: if you increase the number of etcd servers in the Vagrantfile you must also add them here. etcd_render_flags="--etcd-servers=https://172.17.4.51:2379" CALICO_NETWORK_POLICY=${CALICO_NETWORK_POLICY:-false} if [ ${CALICO_NETWORK_POLICY} = "true" ]; then echo "WARNING: THIS IS EXPERIMENTAL SUPPORT FOR NETWORK POLICY" cnp_render_flags="--network-provider=experimental-calico" else cnp_render_flags="" fi # Render assets if [ ! -d "cluster" ]; then ../../_output/bin/${local_os}/bootkube render --asset-dir=cluster --api-servers=https://172.17.4.101:6443 ${etcd_render_flags} ${cnp_render_flags} cp user-data.sample cluster/user-data-worker cp user-data.sample cluster/user-data-controller sed -i -e '/node.kubernetes.io\/master/d' cluster/user-data-worker sed -i -e 's/node-role.kubernetes.io\/master/node.kubernetes.io\/master/g' cluster/manifests/* fi # Start the VM vagrant up vagrant ssh-config c1 > ssh_config # Copy locally rendered assets to the server scp -q -F ssh_config -r cluster core@c1:/home/core/cluster scp -q -F ssh_config ../../_output/bin/linux/bootkube core@c1:/home/core # Run bootkube ssh -q -F ssh_config core@c1 "sudo GLOG_v=${GLOG_v} /home/core/bootkube start --asset-dir=/home/core/cluster 2>> /home/core/bootkube.log" echo echo "Bootstrap complete. Access your kubernetes cluster using:" echo "kubectl --kubeconfig=cluster/auth/kubeconfig get nodes" echo ================================================ FILE: hack/multi-node/conformance-test.sh ================================================ #!/usr/bin/env bash set -euo pipefail ssh_key="$(vagrant ssh-config c1 | awk '/IdentityFile/ {print $2}' | tr -d '"')" ssh_port="$(vagrant ssh-config c1 | awk '/Port [0-9]+/ {print $2}')" ../tests/conformance-test.sh "127.0.0.1" "${ssh_port}" "${ssh_key}" ================================================ FILE: hack/multi-node/etcd-cloud-config.yaml ================================================ #cloud-config coreos: update: reboot-strategy: "off" units: - name: etcd-member.service enable: true command: start drop-ins: - name: 40-etcd-cluster.conf content: | [Service] Environment="ETCD_IMAGE_TAG=v3.1.8" Environment="ETCD_NAME={{ETCD_NODE_NAME}}" Environment="ETCD_ADVERTISE_CLIENT_URLS=https://$private_ipv4:2379" Environment="ETCD_INITIAL_ADVERTISE_PEER_URLS=https://$private_ipv4:2380" Environment="ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:2379" Environment="ETCD_LISTEN_PEER_URLS=https://$private_ipv4:2380" Environment="ETCD_INITIAL_CLUSTER={{ETCD_INITIAL_CLUSTER}}" Environment="ETCD_SSL_DIR=/etc/etcd/tls" Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/server-ca.crt" Environment="ETCD_CERT_FILE=/etc/ssl/certs/etcd/server.crt" Environment="ETCD_KEY_FILE=/etc/ssl/certs/etcd/server.key" Environment="ETCD_CLIENT_CERT_AUTH=true" Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/peer-ca.crt" Environment="ETCD_PEER_CERT_FILE=/etc/ssl/certs/etcd/peer.crt" Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key" ================================================ FILE: hack/multi-node/user-data.sample ================================================ #cloud-config coreos: units: - name: kubelet.service enable: true command: start content: | [Service] EnvironmentFile=/etc/environment Environment=KUBELET_IMAGE_URL=docker://k8s.gcr.io/hyperkube Environment=KUBELET_IMAGE_TAG=v1.16.2 Environment="RKT_RUN_ARGS=--uuid-file-save=/var/cache/kubelet-pod.uuid \ --volume var-lib-cni,kind=host,source=/var/lib/cni \ --volume var-lib-kubelet,kind=host,source=/var/lib/kubelet \ --volume opt-cni-bin,kind=host,source=/opt/cni/bin \ --volume var-log,kind=host,source=/var/log \ --mount volume=var-log,target=/var/log \ --mount volume=var-lib-cni,target=/var/lib/cni \ --mount volume=var-lib-kubelet,target=/var/lib/kubelet \ --mount volume=opt-cni-bin,target=/opt/cni/bin \ --insecure-options=image" ExecStartPre=/bin/mkdir -p /opt/cni/bin ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d ExecStartPre=/bin/mkdir -p /etc/kubernetes/checkpoint-secrets ExecStartPre=/bin/mkdir -p /etc/kubernetes/inactive-manifests ExecStartPre=/bin/mkdir -p /var/lib/cni ExecStartPre=/bin/mkdir -p /var/lib/kubelet/pki ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/cache/kubelet-pod.uuid ExecStart=/usr/lib/coreos/kubelet-wrapper \ --anonymous-auth=false \ --authentication-token-webhook \ --authorization-mode=Webhook \ --cert-dir=/var/lib/kubelet/pki \ --client-ca-file=/etc/kubernetes/ca.crt \ --cluster_dns=10.3.0.10 \ --cluster_domain=cluster.local \ --cni-conf-dir=/etc/kubernetes/cni/net.d \ --exit-on-lock-contention \ --hostname-override=${COREOS_PUBLIC_IPV4} \ --kubeconfig=/etc/kubernetes/kubeconfig \ --lock-file=/var/run/lock/kubelet.lock \ --network-plugin=cni \ --node-labels=node.kubernetes.io/master \ --pod-manifest-path=/etc/kubernetes/manifests \ --register-with-taints=node.kubernetes.io/master=:NoSchedule \ --rotate-certificates ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid Restart=always RestartSec=5 [Install] WantedBy=multi-user.target ================================================ FILE: hack/quickstart/.gitignore ================================================ cluster/ ================================================ FILE: hack/quickstart/copylogs.sh ================================================ #!/usr/bin/env bash set -euo pipefail # copies logs from the remote machine to a local temporary directory REMOTE_HOST=$1 NAME=$2 REMOTE_PORT=${REMOTE_PORT:-22} REMOTE_USER=${REMOTE_USER:-core} SSH_OPTS=${SSH_OPTS:-}" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" REMOTE_LOGS_DIR=${REMOTE_LOGS_DIR:-logs} function usage() { echo "USAGE:" echo "$0: " exit 1 } [ "$#" == 2 ] || usage scp -P ${REMOTE_PORT} ${SSH_OPTS} -r ${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_LOGS_DIR} . mv ${REMOTE_LOGS_DIR} logs-${NAME} echo DONE ================================================ FILE: hack/quickstart/init-master.sh ================================================ #!/usr/bin/env bash set -euo pipefail set -x REMOTE_HOST=$1 REMOTE_PORT=${REMOTE_PORT:-22} REMOTE_USER=${REMOTE_USER:-core} CLUSTER_DIR=${CLUSTER_DIR:-cluster} IDENT=${IDENT:-${HOME}/.ssh/id_rsa} SSH_OPTS=${SSH_OPTS:-} BOOTKUBE_OPTS=${BOOTKUBE_OPTS:-} CLOUD_PROVIDER=${CLOUD_PROVIDER:-} NETWORK_PROVIDER=${NETWORK_PROVIDER:-flannel} function usage() { echo "USAGE:" echo "$0: " exit 1 } function retry_cmd() { set +e max_retries=$1; shift backoff=1 retry=0 false while [ $? -ne 0 ]; do if [ "$retry" -ge $max_retries ]; then break else retry=$((retry+1)) fi "$@" || (sleep $((backoff *= 2)); false) done set -e } function wait_for_ssh() { retry_cmd 100 ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} ${REMOTE_USER}@${REMOTE_HOST} "uname -a" } function configure_etcd() { [ -f "/etc/systemd/system/etcd-member.service.d/10-etcd-member.conf" ] || { mkdir -p /etc/etcd/tls cp /home/${REMOTE_USER}/assets/tls/etcd-* /etc/etcd/tls mkdir -p /etc/etcd/tls/etcd cp /home/${REMOTE_USER}/assets/tls/etcd/* /etc/etcd/tls/etcd chown -R etcd:etcd /etc/etcd chmod -R u=rX,g=,o= /etc/etcd mkdir -p /etc/systemd/system/etcd-member.service.d cat << EOF > /etc/systemd/system/etcd-member.service.d/10-etcd-member.conf [Service] Environment="ETCD_IMAGE_TAG=v3.1.8" Environment="ETCD_NAME=controller" Environment="ETCD_INITIAL_CLUSTER=controller=https://${COREOS_PRIVATE_IPV4}:2380" Environment="ETCD_INITIAL_ADVERTISE_PEER_URLS=https://${COREOS_PRIVATE_IPV4}:2380" Environment="ETCD_ADVERTISE_CLIENT_URLS=https://${COREOS_PRIVATE_IPV4}:2379" Environment="ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:2379" Environment="ETCD_LISTEN_PEER_URLS=https://0.0.0.0:2380" Environment="ETCD_SSL_DIR=/etc/etcd/tls" Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/server-ca.crt" Environment="ETCD_CERT_FILE=/etc/ssl/certs/etcd/server.crt" Environment="ETCD_KEY_FILE=/etc/ssl/certs/etcd/server.key" Environment="ETCD_CLIENT_CERT_AUTH=true" Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/peer-ca.crt" Environment="ETCD_PEER_CERT_FILE=/etc/ssl/certs/etcd/peer.crt" Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key" EOF } } # Initialize a Master node function init_master_node() { systemctl daemon-reload systemctl stop locksmithd; systemctl mask locksmithd etcd_render_flags="--etcd-servers=https://${COREOS_PRIVATE_IPV4}:2379" if [ "$NETWORK_PROVIDER" = "canal" ]; then network_provider_flags="--network-provider=experimental-canal" elif [ "$NETWORK_PROVIDER" = "calico" ]; then network_provider_flags="--network-provider=experimental-calico" else network_provider_flags="--network-provider=flannel" fi # Render cluster assets /home/${REMOTE_USER}/bootkube render --asset-dir=/home/${REMOTE_USER}/assets ${etcd_render_flags} ${network_provider_flags} \ --api-servers=https://${COREOS_PUBLIC_IPV4}:6443,https://${COREOS_PRIVATE_IPV4}:6443 # Move the local kubeconfig into expected location chown -R ${REMOTE_USER}:${REMOTE_USER} /home/${REMOTE_USER}/assets mkdir -p /etc/kubernetes cp /home/${REMOTE_USER}/assets/auth/kubeconfig-kubelet /etc/kubernetes/kubeconfig cp /home/${REMOTE_USER}/assets/auth/kubeconfig /etc/kubernetes/kubeconfig-admin cp /home/${REMOTE_USER}/assets/tls/ca.crt /etc/kubernetes/ca.crt # Start etcd. configure_etcd systemctl enable etcd-member; sudo systemctl start etcd-member # Set cloud provider sed -i "s/cloud-provider=/cloud-provider=$CLOUD_PROVIDER/" /etc/systemd/system/kubelet.service # Configure master label and taint echo -e 'node_label=node-role.kubernetes.io/master\nnode_taint=node-role.kubernetes.io/master=:NoSchedule' > /etc/kubernetes/kubelet.env # Start the kubelet systemctl enable kubelet; sudo systemctl start kubelet # Start bootkube to launch a self-hosted cluster /home/${REMOTE_USER}/bootkube start ${BOOTKUBE_OPTS} --asset-dir=/home/${REMOTE_USER}/assets } [ "$#" == 1 ] || usage # This script can execute on a remote host by copying itself + bootkube binary + kubelet service unit to remote host. # After assets are available on the remote host, the script will execute itself in "local" mode. if [ "${REMOTE_HOST}" != "local" ]; then # wait for ssh to be ready wait_for_ssh # Set up the kubelet.service on remote host scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} kubelet.service ${REMOTE_USER}@${REMOTE_HOST}:/home/${REMOTE_USER}/kubelet.service ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} ${REMOTE_USER}@${REMOTE_HOST} "sudo mv /home/${REMOTE_USER}/kubelet.service /etc/systemd/system/kubelet.service" # Copy bootkube binary to remote host. if [ -e "../../_output/bin/linux/bootkube" ]; then scp -i ${IDENT} -P ${REMOTE_PORT} -C ${SSH_OPTS} ../../_output/bin/linux/bootkube ${REMOTE_USER}@${REMOTE_HOST}:/home/${REMOTE_USER}/bootkube else echo "Error: Local static bootkube binary not found." echo "Falling back to bootkube binary in path." if which bootkube &>/dev/null; then scp -i ${IDENT} -P ${REMOTE_PORT} -C ${SSH_OPTS} "$(which bootkube)" ${REMOTE_USER}@${REMOTE_HOST}:/home/${REMOTE_USER}/bootkube else echo "Error: bootkube not found in PATH." exit 1 fi fi # Copy self to remote host so script can be executed in "local" mode scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} ${BASH_SOURCE[0]} ${REMOTE_USER}@${REMOTE_HOST}:/home/${REMOTE_USER}/init-master.sh ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} ${REMOTE_USER}@${REMOTE_HOST} "sudo BOOTKUBE_OPTS=${BOOTKUBE_OPTS} REMOTE_USER=${REMOTE_USER} CLOUD_PROVIDER=${CLOUD_PROVIDER} NETWORK_PROVIDER=${NETWORK_PROVIDER} /home/${REMOTE_USER}/init-master.sh local" # Copy assets from remote host to a local directory. These can be used to launch additional nodes & contain TLS assets mkdir -p ${CLUSTER_DIR} scp -q -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} -r ${REMOTE_USER}@${REMOTE_HOST}:/home/${REMOTE_USER}/assets/* ${CLUSTER_DIR} # Cleanup ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} ${REMOTE_USER}@${REMOTE_HOST} "rm -rf /home/${REMOTE_USER}/{assets,init-master.sh,bootkube}" echo "Cluster assets copied to ${CLUSTER_DIR}" echo echo "Bootstrap complete. Access your kubernetes cluster using:" echo "kubectl --kubeconfig=${CLUSTER_DIR}/auth/kubeconfig get nodes" echo echo "Additional nodes can be added to the cluster using:" echo "./init-node.sh ${CLUSTER_DIR}/auth/kubeconfig-kubelet" echo # Execute this script locally on the machine, assumes a kubelet.service file has already been placed on host. elif [ "$1" == "local" ]; then init_master_node fi ================================================ FILE: hack/quickstart/init-node.sh ================================================ #!/usr/bin/env bash set -euo pipefail REMOTE_HOST=$1 KUBECONFIG=$2 REMOTE_PORT=${REMOTE_PORT:-22} REMOTE_USER=${REMOTE_USER:-core} IDENT=${IDENT:-${HOME}/.ssh/id_rsa} SSH_OPTS=${SSH_OPTS:-} TAG_MASTER=${TAG_MASTER:-false} CLOUD_PROVIDER=${CLOUD_PROVIDER:-} function usage() { echo "USAGE:" echo "$0: " exit 1 } function retry_cmd() { set +e max_retries=$1; shift backoff=1 retry=0 false while [ $? -ne 0 ]; do if [ "$retry" -ge $max_retries ]; then break else retry=$((retry+1)) fi "$@" || (sleep $((backoff *= 2)); false) done set -e } function wait_for_ssh() { retry_cmd 100 ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} ${REMOTE_USER}@${REMOTE_HOST} "uname -a" } # Initialize a worker node function init_worker_node() { # Setup kubeconfig mkdir -p /etc/kubernetes cp ${KUBECONFIG} /etc/kubernetes/kubeconfig # Pulled out of the kubeconfig. Other installations should place the root # CA here manually. grep 'certificate-authority-data' ${KUBECONFIG} | awk '{print $2}' | base64 -d > /etc/kubernetes/ca.crt mv /home/${REMOTE_USER}/kubelet.service /etc/systemd/system/kubelet.service # Set cloud provider sed -i "s/cloud-provider=/cloud-provider=$CLOUD_PROVIDER/" /etc/systemd/system/kubelet.service if [ "$TAG_MASTER" = true ] ; then # Configure master label and taint echo -e 'node_label=node-role.kubernetes.io/master\nnode_taint=node-role.kubernetes.io/master=:NoSchedule' > /etc/kubernetes/kubelet.env fi # Start services systemctl daemon-reload systemctl stop locksmithd; systemctl mask locksmithd systemctl enable kubelet; sudo systemctl start kubelet } [ "$#" == 2 ] || usage # This script can execute on a remote host by copying itself + kubelet service unit to remote host. # After assets are available on the remote host, the script will execute itself in "local" mode. if [ "${REMOTE_HOST}" != "local" ]; then # wait for ssh to be ready wait_for_ssh # Copy kubelet service file and kubeconfig to remote host scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} kubelet.service ${REMOTE_USER}@${REMOTE_HOST}:/home/${REMOTE_USER}/kubelet.service scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} ${KUBECONFIG} ${REMOTE_USER}@${REMOTE_HOST}:/home/${REMOTE_USER}/kubeconfig # Copy self to remote host so script can be executed in "local" mode scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} ${BASH_SOURCE[0]} ${REMOTE_USER}@${REMOTE_HOST}:/home/${REMOTE_USER}/init-node.sh ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} ${REMOTE_USER}@${REMOTE_HOST} "sudo REMOTE_USER=${REMOTE_USER} TAG_MASTER=$TAG_MASTER CLOUD_PROVIDER=${CLOUD_PROVIDER} /home/${REMOTE_USER}/init-node.sh local /home/${REMOTE_USER}/kubeconfig" # Cleanup ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} ${REMOTE_USER}@${REMOTE_HOST} "rm /home/${REMOTE_USER}/{init-node.sh,kubeconfig}" echo echo "Node (${REMOTE_HOST}) bootstrap complete. It may take a few minutes for the node to become ready." # Execute this script locally on the machine, assumes a kubelet.service file has already been placed on host. elif [ "$1" == "local" ]; then init_worker_node fi ================================================ FILE: hack/quickstart/kubelet.service ================================================ [Service] EnvironmentFile=-/etc/kubernetes/kubelet.env Environment=KUBELET_IMAGE_URL=docker://k8s.gcr.io/hyperkube Environment=KUBELET_IMAGE_TAG=v1.13.3 Environment=KUBELET_MINIMUM_CONTAINER_TTL_DURATION=3m0s Environment=KUBELET_MAXIMUM_DEAD_CONTAINERS=-1 Environment=KUBELET_MAXIMUM_DEAD_CONTAINERS_PER_CONTAINER=1 Environment="RKT_RUN_ARGS=\ --uuid-file-save=/var/cache/kubelet-pod.uuid \ --volume etc-resolv,kind=host,source=/etc/resolv.conf --mount volume=etc-resolv,target=/etc/resolv.conf \ --volume opt-cni-bin,kind=host,source=/opt/cni/bin --mount volume=opt-cni-bin,target=/opt/cni/bin \ --volume var-log,kind=host,source=/var/log --mount volume=var-log,target=/var/log \ --volume var-lib-cni,kind=host,source=/var/lib/cni --mount volume=var-lib-cni,target=/var/lib/cni \ --volume var-lib-kubelet,kind=host,source=/var/lib/kubelet --mount volume=var-lib-kubelet,target=/var/lib/kubelet \ --insecure-options=image" EnvironmentFile=/etc/environment ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests ExecStartPre=/bin/mkdir -p /opt/cni/bin ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d ExecStartPre=/bin/mkdir -p /etc/kubernetes/checkpoint-secrets ExecStartPre=/bin/mkdir -p /etc/kubernetes/inactive-manifests ExecStartPre=/bin/mkdir -p /var/lib/kubelet/pki ExecStartPre=/bin/mkdir -p /var/lib/cni ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/cache/kubelet-pod.uuid ExecStart=/usr/lib/coreos/kubelet-wrapper \ --allow-privileged \ --anonymous-auth=false \ --cert-dir=/var/lib/kubelet/pki \ --client-ca-file=/etc/kubernetes/ca.crt \ --cloud-provider= \ --cluster_dns=10.3.0.10 \ --cluster_domain=cluster.local \ --cni-conf-dir=/etc/kubernetes/cni/net.d \ --exit-on-lock-contention \ --hostname-override=${COREOS_PRIVATE_IPV4} \ --kubeconfig=/etc/kubernetes/kubeconfig \ --lock-file=/var/run/lock/kubelet.lock \ --maximum-dead-containers-per-container=${KUBELET_MAXIMUM_DEAD_CONTAINERS_PER_CONTAINER} \ --minimum-container-ttl-duration=${KUBELET_MINIMUM_CONTAINER_TTL_DURATION} \ --network-plugin=cni \ --node-labels=${node_label} \ --pod-manifest-path=/etc/kubernetes/manifests \ --register-with-taints=${node_taint} \ --rotate-certificates ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid Restart=always RestartSec=5 [Install] WantedBy=multi-user.target ================================================ FILE: hack/quickstart/quickstart-aws.md ================================================ ## AWS Quickstart ### Choose a cluster prefix This can be changed to identify separate clusters. ``` export CLUSTER_PREFIX=quickstart ``` ### Configure Security Groups Make note of the `GroupId` output of this command, as it will be referenced later in this guide as ``. ``` $ aws ec2 create-security-group --region us-west-2 --group-name ${CLUSTER_PREFIX}-sg --description "Security group for ${CLUSTER_PREFIX} cluster" GroupID: "sg-abcdefg" ``` Next, create the security group rules. ``` $ aws ec2 authorize-security-group-ingress --region us-west-2 --group-name ${CLUSTER_PREFIX}-sg --protocol tcp --port 22 --cidr 0.0.0.0/0 $ aws ec2 authorize-security-group-ingress --region us-west-2 --group-name ${CLUSTER_PREFIX}-sg --protocol tcp --port 6443 --cidr 0.0.0.0/0 $ aws ec2 authorize-security-group-ingress --region us-west-2 --group-name ${CLUSTER_PREFIX}-sg --protocol tcp --port 0-65535 --source-group ${CLUSTER_PREFIX}-sg ``` ### Create a key-pair ``` $ aws ec2 create-key-pair --key-name ${CLUSTER_PREFIX}-key --query 'KeyMaterial' --output text > ${CLUSTER_PREFIX}-key.pem $ chmod 400 ${CLUSTER_PREFIX}-key.pem ``` ### Launch Nodes To find the latest CoreOS alpha/beta/stable images, please see the [CoreOS AWS Documentation](https://coreos.com/os/docs/latest/booting-on-ec2.html). Then replace the `--image-id` in the command below. In the command below, replace `` with the security-group-id noted earlier. ``` $ aws ec2 run-instances --region us-west-2 --image-id ami-184a8f78 --security-group-ids --count 1 --instance-type m3.medium --key-name ${CLUSTER_PREFIX}-key --query 'Instances[0].InstanceId' "i-abcdefgh" ``` Next we will use the output of the above command (instance-id) in place of in the command below: ``` $ aws ec2 describe-instances --region us-west-2 --instance-ids --query 'Reservations[0].Instances[0].PublicIpAddress' ``` ### Bootstrap Master We can then use the public-ip to initialize a master node: ``` $ IDENT=${CLUSTER_PREFIX}-key.pem ./init-master.sh ``` After the master bootstrap is complete, you can continue to add worker nodes. Or cluster state can be inspected via kubectl: ``` $ kubectl --kubeconfig=cluster/auth/kubeconfig get nodes ``` ### Add Workers Run the `Launch Nodes` step for each additional node you wish to add, then using the public-ip, run: ``` IDENT=${CLUSTER_PREFIX}-key.pem ./init-node.sh cluster/auth/kubeconfig ``` **NOTE:** It can take a few minutes for each node to download all of the required assets / containers. They may not be immediately available, but the state can be inspected with: ``` $ kubectl --kubeconfig=cluster/auth/kubeconfig get nodes ``` ================================================ FILE: hack/quickstart/quickstart-gce.md ================================================ ## GCE Quickstart ### Choose a cluster prefix This can be changed to identify separate clusters. ``` export CLUSTER_PREFIX=quickstart ``` ### Launch Nodes Launch nodes: ``` gcloud compute instances create ${CLUSTER_PREFIX}-core1 --image-project coreos-cloud --image-family coreos-stable --zone us-central1-a --machine-type n1-standard-1 ``` Tag the first node as an apiserver node, and allow traffic to 6443 on that node. ``` gcloud compute instances add-tags ${CLUSTER_PREFIX}-core1 --tags ${CLUSTER_PREFIX}-apiserver --zone us-central1-a gcloud compute firewall-rules create ${CLUSTER_PREFIX}-6443 --target-tags=${CLUSTER_PREFIX}-apiserver --allow tcp:6443 ``` ### Bootstrap Master *Replace* `` with the EXTERNAL_IP from output of `gcloud compute instances list ${CLUSTER_PREFIX}-core1`. ``` REMOTE_USER=$USER IDENT=~/.ssh/google_compute_engine ./init-master.sh ``` After the master bootstrap is complete, you can continue to add worker nodes. Or cluster state can be inspected via kubectl: ``` kubectl --kubeconfig=cluster/auth/kubeconfig get nodes ``` ### Add Workers Run the `Launch Nodes` step for each additional node you wish to add (changing the name from ` ${CLUSTER_PREFIX}-core1`) Get the EXTERNAL_IP from each node you wish to add: ``` gcloud compute instances list ${CLUSTER_PREFIX}-core2 gcloud compute instances list ${CLUSTER_PREFIX}-core3 ``` Initialize each worker node by replacing `` with the EXTERNAL_IP from the commands above. ``` REMOTE_USER=$USER IDENT=~/.ssh/google_compute_engine ./init-node.sh cluster/auth/kubeconfig ``` **NOTE:** It can take a few minutes for each node to download all of the required assets / containers. They may not be immediately available, but the state can be inspected with: ``` kubectl --kubeconfig=cluster/auth/kubeconfig get nodes ``` ================================================ FILE: hack/quickstart/test.sh ================================================ #!/usr/bin/env bash set -euo pipefail export SSH_OPTS=${SSH_OPTS:-}" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" echo $SSH_OPTS ================================================ FILE: hack/scripts/gatherlogs ================================================ #!/bin/bash # dependencies # jq # docker # journalctl set -euo pipefail LOGS_DIR=${LOGS_DIR:-logs} rm -rf ${LOGS_DIR} && mkdir -p ${LOGS_DIR} echo Capturing Docker Logs for CID in $( docker ps -a -q ); do data=$(docker inspect $CID) || true [ -z "$data" ] && continue if [ "$(echo "$data" | jq '.[0].Path')" == "\"/pause\"" ]; then # Ignore pause pods continue fi NAME=$(echo "$data" | jq '.[0].Name' -r | sed 's/^\/k8s_//g') FILENAME=${LOGS_DIR}/containers/$NAME.log mkdir -p $(dirname $FILENAME) echo "Generating Log for ${NAME} at ${FILENAME}" docker logs -t $CID &> $FILENAME || true done echo Capturing Systemd Logs for UNIT in kubelet docker; do filename=${LOGS_DIR}/services/$UNIT.log mkdir -p $(dirname $filename) journalctl -o short-iso --no-hostname -u $UNIT &> $filename done echo DONE ================================================ FILE: hack/single-node/README.md ================================================ # Hack / Dev single-node build **Note: All scripts are assumed to be ran from this directory.** ## Quickstart This will generate the default assets in the `cluster` directory and launch a single-node self-hosted cluster. ``` ./bootkube-up ``` ## Cleaning up To stop the running cluster and remove generated assets, run: ``` vagrant destroy -f rm -rf cluster ``` ================================================ FILE: hack/single-node/Vagrantfile ================================================ # -*- mode: ruby -*- # # vi: set ft=ruby : require 'fileutils' require 'open-uri' require 'tempfile' require 'yaml' $update_channel = "stable" Vagrant.require_version ">= 1.6.0" NODE_IP = "172.17.4.100" USER_DATA_PATH = File.expand_path("cluster/user-data") KUBECONFIG_PATH = File.expand_path("cluster/auth/kubeconfig-kubelet") CA_CERT_PATH = File.expand_path("cluster/tls/ca.crt") ETCD_CLI_CERT_GLOB = File.expand_path("cluster/tls/etcd-*") ETCD_CERT_GLOB = File.expand_path("cluster/tls/etcd/*") GATHER_LOGS_PATH=File.expand_path("../scripts/gatherlogs") Vagrant.configure("2") do |config| # always use Vagrant's insecure key config.ssh.insert_key = false config.vm.box = "coreos-%s" % $update_channel config.vm.box_version = ">= 962.0.0" config.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json" % $update_channel ["vmware_fusion", "vmware_workstation"].each do |vmware| config.vm.provider vmware do |v, override| v.vmx['numvcpus'] = 1 v.vmx['memsize'] = 2048 v.gui = false override.vm.box_url = "http://%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant_vmware_fusion.json" % $update_channel end end config.vm.provider :virtualbox do |v| v.cpus = 1 v.gui = false v.memory = 2048 # On VirtualBox, we don't have guest additions or a functional vboxsf # in CoreOS, so tell Vagrant that so it can be smarter. v.check_guest_additions = false v.functional_vboxsf = false end # plugin conflict if Vagrant.has_plugin?("vagrant-vbguest") then config.vbguest.auto_update = false end config.vm.network :private_network, ip: NODE_IP config.vm.provision :file, :source => USER_DATA_PATH, :destination => "/tmp/vagrantfile-user-data" config.vm.provision :shell, :inline => "mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/", :privileged => true config.vm.provision :shell, :inline => "mkdir -p /etc/kubernetes", :privileged => true config.vm.provision :file, :source => KUBECONFIG_PATH, :destination => "/tmp/kubeconfig" config.vm.provision :shell, :inline => "mv /tmp/kubeconfig /etc/kubernetes/kubeconfig", :privileged => true config.vm.provision :file, :source => CA_CERT_PATH, :destination => "/tmp/ca.crt" config.vm.provision :shell, :inline => "mv /tmp/ca.crt /etc/kubernetes/ca.crt", :privileged => true config.vm.provision :shell, :inline => "mkdir -p /etc/etcd/tls", :privileged => true Dir.glob(ETCD_CLI_CERT_GLOB) do |etcd_cert_file| config.vm.provision :file, :source => etcd_cert_file, :destination => "/tmp/#{File.basename(etcd_cert_file)}" config.vm.provision :shell, :inline => "mv /tmp/#{File.basename(etcd_cert_file)} /etc/etcd/tls/", :privileged => true end config.vm.provision :shell, :inline => "mkdir -p /etc/etcd/tls/etcd", :privileged => true Dir.glob(ETCD_CERT_GLOB) do |etcd_cert_file| config.vm.provision :file, :source => etcd_cert_file, :destination => "/tmp/#{File.basename(etcd_cert_file)}" config.vm.provision :shell, :inline => "mv /tmp/#{File.basename(etcd_cert_file)} /etc/etcd/tls/etcd/", :privileged => true end config.vm.provision :shell, :inline => "chown -R etcd:etcd /etc/etcd", :privileged => true config.vm.provision :shell, :inline => "chmod -R u=rX,g=,o= /etc/etcd", :privileged => true config.vm.provision :file, :source => GATHER_LOGS_PATH, :destination => "/tmp/gatherlogs" end ================================================ FILE: hack/single-node/bootkube-up ================================================ #!/usr/bin/env bash set -euo pipefail GLOG_v=${GLOG_v:-1} un="$(uname)" local_os="linux" if [ ${un} == 'Darwin' ]; then local_os="darwin" fi CALICO_NETWORK_POLICY=${CALICO_NETWORK_POLICY:-false} if [ ${CALICO_NETWORK_POLICY} = "true" ]; then echo "WARNING: THIS IS EXPERIMENTAL SUPPORT FOR NETWORK POLICY" cnp_render_flags="--network-provider=experimental-calico" else cnp_render_flags="" fi # Render assets if [ ! -d "cluster" ]; then ../../_output/bin/${local_os}/bootkube render --asset-dir=cluster --api-servers=https://172.17.4.100:6443 ${cnp_render_flags} cp user-data.sample cluster/user-data cat user-data-etcd.sample >> cluster/user-data sed -i -e 's/node-role.kubernetes.io\/master/node.kubernetes.io\/master/g' cluster/manifests/* fi # Start the VM vagrant up vagrant ssh-config > ssh_config # Copy locally rendered assets to the server scp -q -F ssh_config -r cluster core@default:/home/core/cluster scp -q -F ssh_config ../../_output/bin/linux/bootkube core@default:/home/core # Run bootkube ssh -q -F ssh_config core@default "sudo GLOG_v=${GLOG_v} /home/core/bootkube start --asset-dir=/home/core/cluster 2>> /home/core/bootkube.log" echo echo "Bootstrap complete. Access your kubernetes cluster using:" echo "kubectl --kubeconfig=cluster/auth/kubeconfig get nodes" echo ================================================ FILE: hack/single-node/conformance-test.sh ================================================ #!/usr/bin/env bash set -euo pipefail ssh_key="$(vagrant ssh-config | awk '/IdentityFile/ {print $2}' | tr -d '"')" ssh_port="$(vagrant ssh-config | awk '/Port [0-9]+/ {print $2}')" ../tests/conformance-test.sh "127.0.0.1" "${ssh_port}" "${ssh_key}" ================================================ FILE: hack/single-node/user-data-etcd.sample ================================================ - name: etcd-member.service enable: true drop-ins: - name: 10-version.conf content: | [Service] Environment="ETCD_IMAGE_TAG=v3.1.8" Environment="ETCD_NAME=default" Environment="ETCD_INITIAL_CLUSTER=default=https://127.0.0.1:2380" Environment="ETCD_INITIAL_ADVERTISE_PEER_URLS=https://127.0.0.1:2380" Environment="ETCD_ADVERTISE_CLIENT_URLS=https://127.0.0.1:2379" Environment="ETCD_LISTEN_CLIENT_URLS=https://0.0.0.0:2379" Environment="ETCD_LISTEN_PEER_URLS=https://0.0.0.0:2380" Environment="ETCD_SSL_DIR=/etc/etcd/tls" Environment="ETCD_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/server-ca.crt" Environment="ETCD_CERT_FILE=/etc/ssl/certs/etcd/server.crt" Environment="ETCD_KEY_FILE=/etc/ssl/certs/etcd/server.key" Environment="ETCD_CLIENT_CERT_AUTH=true" Environment="ETCD_PEER_TRUSTED_CA_FILE=/etc/ssl/certs/etcd/peer-ca.crt" Environment="ETCD_PEER_CERT_FILE=/etc/ssl/certs/etcd/peer.crt" Environment="ETCD_PEER_KEY_FILE=/etc/ssl/certs/etcd/peer.key" command: start ================================================ FILE: hack/single-node/user-data.sample ================================================ #cloud-config coreos: units: - name: kubelet.service enable: true command: start content: | [Service] EnvironmentFile=/etc/environment Environment=KUBELET_IMAGE_URL=docker://k8s.gcr.io/hyperkube Environment=KUBELET_IMAGE_TAG=v1.16.2 Environment="RKT_RUN_ARGS=--uuid-file-save=/var/cache/kubelet-pod.uuid \ --volume var-lib-cni,kind=host,source=/var/lib/cni \ --volume var-lib-kubelet,kind=host,source=/var/lib/kubelet \ --volume opt-cni-bin,kind=host,source=/opt/cni/bin \ --volume var-log,kind=host,source=/var/log \ --mount volume=var-log,target=/var/log \ --mount volume=var-lib-cni,target=/var/lib/cni \ --mount volume=var-lib-kubelet,target=/var/lib/kubelet \ --mount volume=opt-cni-bin,target=/opt/cni/bin \ --insecure-options=image" ExecStartPre=/bin/mkdir -p /opt/cni/bin ExecStartPre=/bin/mkdir -p /etc/kubernetes/manifests ExecStartPre=/bin/mkdir -p /etc/kubernetes/cni/net.d ExecStartPre=/bin/mkdir -p /etc/kubernetes/checkpoint-secrets ExecStartPre=/bin/mkdir -p /etc/kubernetes/inactive-manifests ExecStartPre=/bin/mkdir -p /var/lib/cni ExecStartPre=/bin/mkdir -p /var/lib/kubelet/pki ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/cache/kubelet-pod.uuid ExecStart=/usr/lib/coreos/kubelet-wrapper \ --anonymous-auth=false \ --authentication-token-webhook \ --authorization-mode=Webhook \ --cert-dir=/var/lib/kubelet/pki \ --client-ca-file=/etc/kubernetes/ca.crt \ --cluster_dns=10.3.0.10 \ --cluster_domain=cluster.local \ --cni-conf-dir=/etc/kubernetes/cni/net.d \ --exit-on-lock-contention=true \ --hostname-override=${COREOS_PUBLIC_IPV4} \ --kubeconfig=/etc/kubernetes/kubeconfig \ --lock-file=/var/run/lock/kubelet.lock \ --network-plugin=cni \ --node-labels=node.kubernetes.io/master \ --pod-manifest-path=/etc/kubernetes/manifests \ --rotate-certificates ExecStop=-/usr/bin/rkt stop --uuid-file=/var/cache/kubelet-pod.uuid Restart=always RestartSec=5 [Install] WantedBy=multi-user.target ================================================ FILE: hack/terraform-quickstart/README.md ================================================ ## Terraform-quickstart This directory provides a basic way to use terraform to setup compute resources on AWS. It was written with testing in mind. Prerequisites: - terraform - bootkube binary built from the repo root To start a cluster first fill out the terraform.tfvars.example with the needed secrets and rename it to terraform.tfvars. Then: ``` terraform plan terraform apply IDENT=${path_to_your_ssh_key} ./start-cluster.sh ``` To destroy a cluster: ``` terraform destroy ``` ================================================ FILE: hack/terraform-quickstart/copylogs.sh ================================================ #!/usr/bin/env bash set -euo pipefail export WORKER_IPS=`terraform output -json worker_ips | jq -r '.value[]'` export MASTER_IPS=`terraform output -json master_ips | jq -r '.value[]'` export BOOTSTRAP_IP=`terraform output bootstrap_node_ip` export LOGS_DIR=${LOGS_DIR:-$PWD/logs} export SSH_OPTS=${SSH_OPTS:-}" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" cd ../quickstart count=0 for IP in $WORKER_IPS; do echo Copying Log for worker $IP ./copylogs.sh $IP worker-$count count=$((count+1)) done count=0 for IP in $MASTER_IPS; do echo Copying Log for master $IP ./copylogs.sh $IP master-$count count=$((count+1)) done count=0 for IP in $BOOTSTRAP_IP; do echo Copying Log for master $IP ./copylogs.sh $IP bootstrap-$count count=$((count+1)) done ================================================ FILE: hack/terraform-quickstart/environment_default.txt ================================================ ================================================ FILE: hack/terraform-quickstart/environment_e2e.txt ================================================ KUBELET_MINIMUM_CONTAINER_TTL_DURATION=30m0s ================================================ FILE: hack/terraform-quickstart/genlogs.sh ================================================ #!/usr/bin/env bash set -euo pipefail export WORKER_IPS=`terraform output -json worker_ips | jq -r '.value[]'` export MASTER_IPS=`terraform output -json master_ips | jq -r '.value[]'` export BOOTSTRAP_IP=`terraform output bootstrap_node_ip` export LOGS_DIR=${LOGS_DIR:-/tmp/logs} export REMOTE_PORT=${REMOTE_PORT:-22} export REMOTE_USER=${REMOTE_USER:-core} export SSH_OPTS=${SSH_OPTS:-}" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" IPS="$WORKER_IPS $MASTER_IPS $BOOTSTRAP_IP" for IP in $IPS; do echo Generating Log for $IP ssh -p ${REMOTE_PORT} ${SSH_OPTS} ${REMOTE_USER}@${IP} 'bash -s' < ../scripts/gatherlogs || true done ================================================ FILE: hack/terraform-quickstart/iam.tf ================================================ resource "aws_iam_instance_profile" "bk_profile" { name_prefix = "bootkube_e2e_profile" role = "${aws_iam_role.bk_role.id}" provisioner "local-exec" { command = "sleep 90" } } resource "aws_iam_role" "bk_role" { name_prefix = "bootkube_e2e_role" path = "/" assume_role_policy = <> /etc/environment'", "sudo rm -f /tmp/environment", ] connection { user = "core" } } } resource "aws_instance" "worker_node" { ami = "${data.aws_ami.coreos_ami.image_id}" instance_type = "${var.instance_type}" key_name = "${aws_key_pair.core.key_name}" count = "${var.num_workers}" iam_instance_profile = "${aws_iam_instance_profile.bk_profile.id}" vpc_security_group_ids = ["${aws_security_group.allow_all.id}"] subnet_id = "${aws_subnet.main.id}" associate_public_ip_address = true depends_on = ["aws_internet_gateway.main"] tags = "${local.default_tags}" root_block_device { volume_type = "gp2" volume_size = "30" } provisioner "file" { source = "environment_${var.environment}.txt" destination = "/tmp/environment" connection { user = "core" } } provisioner "remote-exec" { # coreos manages /etc/environment, so append to the file inline = [ "sudo bash -c 'cat /tmp/environment >> /etc/environment'", "sudo rm -f /tmp/environment", ] connection { user = "core" } } } resource "aws_instance" "master_node" { ami = "${data.aws_ami.coreos_ami.image_id}" instance_type = "${var.instance_type}" key_name = "${aws_key_pair.core.key_name}" count = "${var.additional_masters}" iam_instance_profile = "${aws_iam_instance_profile.bk_profile.id}" vpc_security_group_ids = ["${aws_security_group.allow_all.id}"] subnet_id = "${aws_subnet.main.id}" associate_public_ip_address = true depends_on = ["aws_internet_gateway.main"] tags = "${local.default_tags}" root_block_device { volume_type = "gp2" volume_size = "30" } provisioner "file" { source = "environment_${var.environment}.txt" destination = "/tmp/environment" connection { user = "core" } } provisioner "remote-exec" { # coreos manages /etc/environment, so append to the file inline = [ "sudo bash -c 'cat /tmp/environment >> /etc/environment'", "sudo rm -f /tmp/environment", ] connection { user = "core" } } } data "aws_ami" "coreos_ami" { most_recent = true filter { name = "name" values = ["CoreOS-stable-*"] } filter { name = "architecture" values = ["x86_64"] } filter { name = "virtualization-type" values = ["hvm"] } filter { name = "owner-id" values = ["595879546273"] } } ================================================ FILE: hack/terraform-quickstart/network.tf ================================================ resource "aws_vpc" "main" { cidr_block = "10.8.0.0/16" tags { Name = "${var.resource_owner}" } } data "aws_availability_zones" "available" {} resource "aws_subnet" "main" { vpc_id = "${aws_vpc.main.id}" cidr_block = "10.8.0.0/24" availability_zone = "${data.aws_availability_zones.available.names[0]}" tags { Name = "${var.resource_owner}" } } resource "aws_internet_gateway" "main" { vpc_id = "${aws_vpc.main.id}" tags { Name = "${var.resource_owner}" } } resource "aws_route_table" "public" { vpc_id = "${aws_vpc.main.id}" tags { Name = "${var.resource_owner}" } route { cidr_block = "0.0.0.0/0" gateway_id = "${aws_internet_gateway.main.id}" } } resource "aws_route_table_association" "main_subnet" { subnet_id = "${aws_subnet.main.id}" route_table_id = "${aws_route_table.public.id}" } resource "aws_security_group" "allow_all" { name_prefix = "allow_all" description = "Allow all inbound traffic" vpc_id = "${aws_vpc.main.id}" ingress { from_port = 0 to_port = 0 protocol = "-1" cidr_blocks = ["0.0.0.0/0"] } egress { from_port = 0 to_port = 0 protocol = "-1" cidr_blocks = ["0.0.0.0/0"] } tags { Name = "${var.resource_owner}" } } resource "aws_network_acl" "all" { vpc_id = "${aws_vpc.main.id}" egress { protocol = "-1" rule_no = 2 action = "allow" cidr_block = "0.0.0.0/0" from_port = 0 to_port = 0 } ingress { protocol = "-1" rule_no = 1 action = "allow" cidr_block = "0.0.0.0/0" from_port = 0 to_port = 0 } tags { Name = "${var.resource_owner}" } } ================================================ FILE: hack/terraform-quickstart/outputs.tf ================================================ output "bootstrap_node_ip" { value = "${aws_instance.bootstrap_node.public_ip}" } output "worker_ips" { value = ["${aws_instance.worker_node.*.public_ip}"] } output "master_ips" { value = ["${aws_instance.master_node.*.public_ip}"] } output "network_provider" { value = "${var.network_provider}" } ================================================ FILE: hack/terraform-quickstart/run-conformance.sh ================================================ #!/usr/bin/env bash set -euo pipefail # This is a small shim to run the conformance runner script in # /hack/tests/conformance-test.sh. More option defaults such as # CONFORMANCE_VERSION are set in that script. If the SSH key you use to # access the nodes setup by terraform is not available via the ssh agent then # you must specify which keyfile to use. export BOOTSTRAP_IP=`terraform output bootstrap_node_ip` export KUBECONFIG=/etc/kubernetes/kubeconfig export SSH_KEY_FILE=${SSH_KEY_FILE:-/fake/keyfile/have/agent} cd ../tests ./conformance-test.sh $BOOTSTRAP_IP 22 ${SSH_KEY_FILE} ================================================ FILE: hack/terraform-quickstart/start-cluster.sh ================================================ #!/usr/bin/env bash set -euo pipefail export BOOTSTRAP_IP=`terraform output bootstrap_node_ip` export WORKER_IPS=`terraform output -json worker_ips | jq -r '.value[]'` export MASTER_IPS=`terraform output -json master_ips | jq -r '.value[]'` export SSH_OPTS=${SSH_OPTS:-}" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" export CLOUD_PROVIDER=${CLOUD_PROVIDER:-aws} export BOOTKUBE_OPTS=${BOOTKUBE_OPTS:-} export NETWORK_PROVIDER=`terraform output network_provider` # Normally we want to default to aws here since that is all terraform # supports and it is required for the e2e tests. However because of an # upstream bug, conformance tests won't pass with cloud provider integration # set to aws. So we need a knob to set the CLOUD_PROVIDER to nothing while # keeping aws as the default as to not mess up people using the e2e tests. if [ "$CLOUD_PROVIDER" == "none" ] ; then echo "cloud provider integration disabled" CLOUD_PROVIDER= fi cd ../quickstart ./init-master.sh $BOOTSTRAP_IP for IP in $WORKER_IPS do ./init-node.sh $IP cluster/auth/kubeconfig-kubelet done for IP in $MASTER_IPS do TAG_MASTER=true ./init-node.sh $IP cluster/auth/kubeconfig-kubelet done echo "Cluster bootstrap is complete. Access your kubernetes cluster using:" echo "kubectl --kubeconfig=cluster/auth/kubeconfig get nodes" ================================================ FILE: hack/terraform-quickstart/terraform.tfvars.example ================================================ access_key_id = "" access_key = "" resource_owner = "bootkube_example_terraform" ssh_key = "" ================================================ FILE: hack/terraform-quickstart/variables.tf ================================================ variable "access_key_id" { type = "string" } variable "access_key" { type = "string" } variable "kubernetes_id" { description = "ID of the kubernetes cluster" type = "string" } variable "ssh_public_key" { description = "SSH Public Key" type = "string" } variable "resource_owner" { description = "Tag all resources behind a single tag based on who/what is running terraform" type = "string" default = "bootkube-terraform-example-deleteme" } variable "instance_type" { description = "Instance type" type = "string" default = "m3.medium" } variable "network_provider" { type = "string" default = "flannel" } variable "num_workers" { description = "number of worker nodes" type = "string" default = "1" } variable "additional_masters" { description = "number of additional master nodes not including bootstrap node" type = "string" default = "0" } variable "region" { description = "aws region" type = "string" default = "us-east-1" } variable "environment" { description = "environment flavor to push to instances" type = "string" default = "default" } ================================================ FILE: hack/tests/conformance-gce.sh ================================================ #!/usr/bin/env bash set -euo pipefail # DESCRIPTION: # # This script is meant to launch GCE nodes, run bootkube to bootstrap a self-hosted k8s cluster, then run conformance tests. # # REQUIREMENTS: # - gcloud cli is installed # - rkt is available on the host # # REQUIRED ENV VARS: # - $BUILD_ROOT: contains a checkout of bootkube at $BUILD_ROOT/bootkube # - $KEY_FILE: path to GCE service account keyfile # # OPTIONAL ENV VARS: # - $COREOS_VERSION: CoreOS image version. # # PROCESS: # # Inside a rkt container: # - Use gcloud to launch master node # - Use the quickstart init-master.sh script to run bootkube on that node # - Use gcloud to launch worker node(s) # - Use the quickstart init-node.sh script to join node to kubernetes cluster # - Run conformance tests against the launched cluster # COREOS_CHANNEL=${COREOS_CHANNEL:-'coreos-stable'} WORKER_COUNT=4 GCE_PREFIX=${GCE_PREFIX:-'bootkube-ci'} GCE_SERVICE_ACCOUNT=${GCE_SERVICE_ACCOUNT:-'bootkube-ci'} GCE_PROJECT=${GCE_PROJECT:-coreos-gce-testing} function cleanup { gcloud compute instances delete --quiet --zone us-central1-a ${GCE_PREFIX}-m1 || true gcloud compute firewall-rules delete --quiet ${GCE_PREFIX}-api-6443 || true for i in $(seq 1 ${WORKER_COUNT}); do gcloud compute instances delete --quiet --zone us-central1-a ${GCE_PREFIX}-w${i} || true done rm -rf /build/cluster } function init { curl https://storage.googleapis.com/cloud-sdk-release/google-cloud-sdk-148.0.1-linux-x86_64.tar.gz > google-cloud-sdk.tar.gz tar xzf google-cloud-sdk.tar.gz ./google-cloud-sdk/install.sh source ~/.bashrc gcloud config set project ${GCE_PROJECT} gcloud auth activate-service-account ${GCE_SERVICE_ACCOUNT}@${GCE_PROJECT}.iam.gserviceaccount.com --key-file=/build/keyfile apt-get update && apt-get install -y jq ssh-keygen -t rsa -f /root/.ssh/id_rsa -N "" awk '{print "core:" $1 " " $2 " core@conformance"}' /root/.ssh/id_rsa.pub > /root/.ssh/gce-format.pub } function add_master { gcloud compute instances create ${GCE_PREFIX}-m1 \ --image-project coreos-cloud --image-family ${COREOS_CHANNEL} --zone us-central1-a --machine-type n1-standard-4 --boot-disk-size=30GB gcloud compute instances add-tags --zone us-central1-a ${GCE_PREFIX}-m1 --tags ${GCE_PREFIX}-apiserver gcloud compute firewall-rules create ${GCE_PREFIX}-api-6443 --target-tags=${GCE_PREFIX}-apiserver --allow tcp:6443 gcloud compute instances add-metadata ${GCE_PREFIX}-m1 --zone us-central1-a --metadata-from-file ssh-keys=/root/.ssh/gce-format.pub MASTER_IP=$(gcloud compute instances list ${GCE_PREFIX}-m1 --format=json | jq --raw-output '.[].networkInterfaces[].accessConfigs[].natIP') cd /build/bootkube/hack/quickstart && SSH_OPTS="-o StrictHostKeyChecking=no" \ CLUSTER_DIR=/build/cluster ./init-master.sh ${MASTER_IP} } function add_workers { #TODO (aaron): parallelize launching workers for i in $(seq 1 ${WORKER_COUNT}); do echo "Launching worker" gcloud compute instances create ${GCE_PREFIX}-w${i} \ --image-project coreos-cloud --image-family ${COREOS_CHANNEL} --zone us-central1-a --machine-type n1-standard-2 --boot-disk-size=15GB echo "Adding ssh-key to worker metadata" gcloud compute instances add-metadata ${GCE_PREFIX}-w${i} --zone us-central1-a --metadata-from-file ssh-keys=/root/.ssh/gce-format.pub echo "Waiting 30s before retrieving worker metadata" sleep 30 # TODO(aaron) Have seen "Too many authentication failures" in CI jobs. This seems to help, but should dig into why echo "Getting worker public IP" local WORKER_IP=$(gcloud compute instances list ${GCE_PREFIX}-w${i} --format=json | jq --raw-output '.[].networkInterfaces[].accessConfigs[].natIP') cd /build/bootkube/hack/quickstart && SSH_OPTS="-o StrictHostKeyChecking=no" ./init-node.sh ${WORKER_IP} /build/cluster/auth/kubeconfig done } IN_CONTAINER=${IN_CONTAINER:-false} if [ "${IN_CONTAINER}" == true ]; then #TODO(aaron): should probably run cleanup as part of init (not just on exit). Or add some random identifier to objects created during this run. trap cleanup EXIT init add_master add_workers KUBECONFIG=/etc/kubernetes/kubeconfig-admin WORKER_COUNT=${WORKER_COUNT} /build/bootkube/hack/tests/conformance-test.sh ${MASTER_IP} 22 /root/.ssh/id_rsa else BUILD_ROOT=${BUILD_ROOT:-} if [ -z "$BUILD_ROOT" ]; then echo "BUILD_ROOT must be set" exit 1 fi if [ -z "$KEY_FILE" ]; then echo "KEY_FILE must be set" exit 1 fi RKT_OPTS=$(echo \ "--volume buildroot,kind=host,source=${BUILD_ROOT} " \ "--mount volume=buildroot,target=/build " \ "--volume keyfile,kind=host,source=${KEY_FILE} " \ "--mount volume=keyfile,target=/build/keyfile " \ ) #TODO(pb): See if there is a way to make the --inherit-env option replace #passing all the variables manually. sudo rkt run --insecure-options=image ${RKT_OPTS} docker://golang:1.11.1 --exec /bin/bash -- -c \ "IN_CONTAINER=true COREOS_CHANNEL=${COREOS_CHANNEL} GCE_PREFIX=${GCE_PREFIX} GCE_SERVICE_ACCOUNT=${GCE_SERVICE_ACCOUNT} GCE_PROJECT=${GCE_PROJECT} /build/bootkube/hack/tests/$(basename $0)" fi ================================================ FILE: hack/tests/conformance-test.sh ================================================ #!/usr/bin/env bash set -euo pipefail CONFORMANCE_REPO=${CONFORMANCE_REPO:-github.com/kubernetes/kubernetes} CONFORMANCE_VERSION=${CONFORMANCE_VERSION:-v1.13.3} usage() { echo "USAGE:" echo " $0 " echo exit 1 } if [ $# -ne 3 ]; then usage exit 1 fi ssh_host=$1 ssh_port=$2 ssh_key=$3 KUBECONFIG=${KUBECONFIG:-/home/core/cluster/auth/kubeconfig} K8S_SRC=/home/core/go/src/k8s.io/kubernetes ssh -q -o UserKnownHostsFile=/dev/null -o stricthostkeychecking=no -i ${ssh_key} -p ${ssh_port} core@${ssh_host} \ "mkdir -p ${K8S_SRC} && [[ -d ${K8S_SRC}/.git ]] || git clone https://${CONFORMANCE_REPO} ${K8S_SRC}" RKT_OPTS="\ --volume=kc,kind=host,source=${KUBECONFIG} \ --volume=k8s,kind=host,source=${K8S_SRC} \ --mount volume=kc,target=/kubeconfig \ --mount volume=k8s,target=/go/src/k8s.io/kubernetes" # Init steps necessary to run conformance in golang container INIT="apt-get update && apt-get install -y rsync && go get -u github.com/jteeuwen/go-bindata/go-bindata" BUILD="cd /go/src/k8s.io/kubernetes && \ git checkout ${CONFORMANCE_VERSION} && \ make all WHAT=cmd/kubectl && \ make all WHAT=vendor/github.com/onsi/ginkgo/ginkgo && \ make all WHAT=test/e2e/e2e.test" CONFORMANCE="\ KUBECONFIG=/kubeconfig KUBERNETES_CONFORMANCE_TEST=Y go run hack/e2e.go \ -- -v --test --check-version-skew=false --provider=skeleton --test_args='--ginkgo.focus=\[Conformance\]'" CMD="sudo rkt run --insecure-options=image ${RKT_OPTS} docker://golang:1.11.1 --exec /bin/bash -- -c \"${INIT} && ${BUILD} && ${CONFORMANCE}\"" ssh -q -o UserKnownHostsFile=/dev/null -o stricthostkeychecking=no -i ${ssh_key} -p ${ssh_port} core@${ssh_host} "${CMD}" ================================================ FILE: image/bootkube/Dockerfile ================================================ FROM scratch COPY bootkube /bootkube ================================================ FILE: image/bootkube/build-image.sh ================================================ #!/usr/bin/env bash set -euo pipefail IMAGE_REPO=${IMAGE_REPO:-quay.io/coreos/bootkube} readonly BOOTKUBE_ROOT=$(git rev-parse --show-toplevel) readonly VERSION=${VERSION:-$(${BOOTKUBE_ROOT}/build/git-version.sh)} function image::build() { local TEMP_DIR=$(mktemp -d -t bootkube.XXXX) cp $BOOTKUBE_ROOT/_output/bin/linux/bootkube ${TEMP_DIR} cp $BOOTKUBE_ROOT/image/bootkube/Dockerfile ${TEMP_DIR} docker build -t ${IMAGE_REPO}:${VERSION} -f ${TEMP_DIR}/Dockerfile ${TEMP_DIR} rm -rf ${TEMP_DIR} } function image::name() { echo "${IMAGE_REPO}:${VERSION}" } ================================================ FILE: image/checkpoint/Dockerfile ================================================ FROM alpine COPY checkpoint /checkpoint ================================================ FILE: image/checkpoint/build-image.sh ================================================ #!/usr/bin/env bash set -euo pipefail IMAGE_REPO=${IMAGE_REPO:-quay.io/coreos/pod-checkpointer} readonly BOOTKUBE_ROOT=$(git rev-parse --show-toplevel) readonly VERSION=${VERSION:-$(${BOOTKUBE_ROOT}/build/git-version.sh)} function image::build() { local TEMP_DIR=$(mktemp -d -t checkpoint.XXXX) # Add assets for container build cp ${BOOTKUBE_ROOT}/_output/bin/linux/checkpoint ${TEMP_DIR} cp ${BOOTKUBE_ROOT}/image/checkpoint/Dockerfile ${TEMP_DIR} docker build -t ${IMAGE_REPO}:${VERSION} -f ${TEMP_DIR}/Dockerfile ${TEMP_DIR} rm -rf ${TEMP_DIR} } function image::name() { echo "${IMAGE_REPO}:${VERSION}" } ================================================ FILE: pkg/bootkube/bootkube.go ================================================ package bootkube import ( "fmt" "path/filepath" "time" "github.com/kubernetes-sigs/bootkube/cmd/render/plugin/default/asset" "k8s.io/client-go/tools/clientcmd" ) const assetTimeout = 20 * time.Minute type Config struct { AssetDir string PodManifestPath string Strict bool RequiredPods []string } type bootkube struct { podManifestPath string assetDir string strict bool requiredPods []string } func NewBootkube(config Config) (*bootkube, error) { return &bootkube{ assetDir: config.AssetDir, podManifestPath: config.PodManifestPath, strict: config.Strict, requiredPods: config.RequiredPods, }, nil } func (b *bootkube) Run() error { // TODO(diegs): create and share a single client rather than the kubeconfig once all uses of it // are migrated to client-go. kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig( &clientcmd.ClientConfigLoadingRules{ExplicitPath: filepath.Join(b.assetDir, asset.AssetPathAdminKubeConfig)}, &clientcmd.ConfigOverrides{}) bcp := NewBootstrapControlPlane(b.assetDir, b.podManifestPath) defer func() { // Always tear down the bootstrap control plane and clean up manifests and secrets. if err := bcp.Teardown(); err != nil { UserOutput("Error tearing down temporary bootstrap control plane: %v\n", err) } }() var err error defer func() { // Always report errors. if err != nil { UserOutput("Error: %v\n", err) } }() if err = bcp.Start(); err != nil { return err } if err = CreateAssets(kubeConfig, filepath.Join(b.assetDir, asset.AssetPathManifests), assetTimeout, b.strict); err != nil { return err } if err = WaitUntilPodsRunning(kubeConfig, b.requiredPods, assetTimeout); err != nil { return err } return nil } // All bootkube printing to stdout should go through this fmt.Printf wrapper. // The stdout of bootkube should convey information useful to a human sitting // at a terminal watching their cluster bootstrap itself. Otherwise the message // should go to stderr. func UserOutput(format string, a ...interface{}) { fmt.Printf(format, a...) } ================================================ FILE: pkg/bootkube/bootstrap.go ================================================ package bootkube import ( "io" "os" "path/filepath" "strings" "github.com/kubernetes-sigs/bootkube/cmd/render/plugin/default/asset" ) type bootstrapControlPlane struct { assetDir string podManifestPath string ownedManifests []string } // NewBootstrapControlPlane constructs a new bootstrap control plane object. func NewBootstrapControlPlane(assetDir, podManifestPath string) *bootstrapControlPlane { return &bootstrapControlPlane{ assetDir: assetDir, podManifestPath: podManifestPath, } } // Start seeds static manifests to the kubelet to launch the bootstrap control plane. // Users should always ensure that Cleanup() is called even in the case of errors. func (b *bootstrapControlPlane) Start() error { UserOutput("Starting temporary bootstrap control plane...\n") // Make secrets temporarily available to bootstrap cluster. if err := os.RemoveAll(asset.BootstrapSecretsDir); err != nil { return err } secretsDir := filepath.Join(b.assetDir, asset.AssetPathSecrets) if _, err := copyDirectory(secretsDir, asset.BootstrapSecretsDir, true /* overwrite */); err != nil { return err } // Copy the admin kubeconfig. TODO(diegs): this is kind of a hack, maybe do something better. if err := copyFile(filepath.Join(b.assetDir, asset.AssetPathAdminKubeConfig), filepath.Join(asset.BootstrapSecretsDir, "kubeconfig"), true /* overwrite */); err != nil { return err } // Copy the static manifests to the kubelet's pod manifest path. manifestsDir := filepath.Join(b.assetDir, asset.AssetPathBootstrapManifests) ownedManifests, err := copyDirectory(manifestsDir, b.podManifestPath, false /* overwrite */) b.ownedManifests = ownedManifests // always copy in case of partial failure. return err } // Teardown brings down the bootstrap control plane and cleans up the temporary manifests and // secrets. This function is idempotent. func (b *bootstrapControlPlane) Teardown() error { UserOutput("Tearing down temporary bootstrap control plane...\n") if err := os.RemoveAll(asset.BootstrapSecretsDir); err != nil { return err } for _, manifest := range b.ownedManifests { if err := os.Remove(manifest); err != nil && !os.IsNotExist(err) { return err } } b.ownedManifests = nil return nil } // copyFile copies a single file from src to dst. Returns an error if overwrite is true and dst // exists, or if any I/O error occurs during copying. func copyFile(src, dst string, overwrite bool) error { flags := os.O_CREATE | os.O_WRONLY if !overwrite { flags |= os.O_EXCL } dstfile, err := os.OpenFile(dst, flags, os.FileMode(0600)) if err != nil { return err } defer dstfile.Close() srcfile, err := os.Open(src) if err != nil { return err } defer srcfile.Close() _, err = io.Copy(dstfile, srcfile) return err } // copyDirectory copies srcDir to dstDir recursively. It returns the paths of files (not // directories) that were copied. func copyDirectory(srcDir, dstDir string, overwrite bool) ([]string, error) { var copied []string return copied, filepath.Walk(srcDir, func(src string, info os.FileInfo, err error) error { if err != nil { return err } dst := filepath.Join(dstDir, strings.TrimPrefix(src, srcDir)) if info.IsDir() { err = os.Mkdir(dst, os.FileMode(0700)) if os.IsExist(err) { err = nil } return err } if err := copyFile(src, dst, overwrite); err != nil { return err } copied = append(copied, dst) return nil }) } ================================================ FILE: pkg/bootkube/bootstrap_test.go ================================================ package bootkube import ( "io/ioutil" "os" "path/filepath" "reflect" "testing" "github.com/kubernetes-sigs/bootkube/cmd/render/plugin/default/asset" ) var ( secrets = []string{"secret-1.yaml", "secret-2.yaml", "secret-3.yaml"} manifests = []string{"pod-1.yaml", "pod-2.yaml"} ) func setUp(t *testing.T) (assetDir, podManifestPath string) { // Create source directories. var err error assetDir, err = ioutil.TempDir("", "assets") if err != nil { t.Fatal(err) } podManifestPath, err = ioutil.TempDir("", "manifests") if err != nil { t.Fatal(err) } asset.BootstrapSecretsDir, err = ioutil.TempDir("", "bootstrap-secrets") if err != nil { t.Fatal(err) } // Create assets. if err := os.Mkdir(filepath.Join(assetDir, filepath.Dir(asset.AssetPathAdminKubeConfig)), os.FileMode(0755)); err != nil { t.Fatal(err) } if err := ioutil.WriteFile(filepath.Join(assetDir, asset.AssetPathAdminKubeConfig), []byte("kubeconfig data"), os.FileMode(0644)); err != nil { t.Fatal(err) } if err := os.Mkdir(filepath.Join(assetDir, asset.AssetPathSecrets), os.FileMode(0755)); err != nil { t.Fatal(err) } for _, secret := range secrets { if err := ioutil.WriteFile(filepath.Join(assetDir, asset.AssetPathSecrets, secret), []byte("secret data"), os.FileMode(0644)); err != nil { t.Fatal(err) } } if err := os.Mkdir(filepath.Join(assetDir, asset.AssetPathBootstrapManifests), os.FileMode(0755)); err != nil { t.Fatal(err) } for _, manifest := range manifests { if err := ioutil.WriteFile(filepath.Join(assetDir, asset.AssetPathBootstrapManifests, manifest), []byte("manifest data"), os.FileMode(0644)); err != nil { t.Fatal(err) } } return } func tearDown(assetDir, podManifestPath string, t *testing.T) { if err := os.RemoveAll(assetDir); err != nil { t.Fatal(err) } if err := os.RemoveAll(podManifestPath); err != nil { t.Fatal(err) } if err := os.RemoveAll(asset.BootstrapSecretsDir); err != nil { t.Fatal(err) } } func TestBootstrapControlPlane(t *testing.T) { assetDir, podManifestPath := setUp(t) defer tearDown(assetDir, podManifestPath, t) // Create and start bootstrap control plane. bcp := NewBootstrapControlPlane(assetDir, podManifestPath) if err := bcp.Start(); err != nil { t.Errorf("bcp.Start() = %v, want: nil", err) } // Make sure assets were copied. for _, secret := range secrets { if _, err := os.Stat(filepath.Join(asset.BootstrapSecretsDir, secret)); os.IsNotExist(err) { t.Errorf("bcp.Start() failed to copy secret: %v", secret) } } for _, manifest := range manifests { if _, err := os.Stat(filepath.Join(podManifestPath, manifest)); os.IsNotExist(err) { t.Errorf("bcp.Start() failed to copy manifest: %v", manifest) } } // Tear down control plane. if err := bcp.Teardown(); err != nil { t.Errorf("bcp.Teardown() = %v, want: nil", err) } // Make sure directories were properly cleaned up. if fi, err := os.Stat(asset.BootstrapSecretsDir); fi != nil || !os.IsNotExist(err) { t.Error("bcp.Teardown() failed to delete secrets directory") } for _, manifest := range manifests { if fi, err := os.Stat(filepath.Join(podManifestPath, manifest)); fi != nil || !os.IsNotExist(err) { t.Errorf("bcp.Teardown() failed to delete manifest: %v", manifest) } } } func TestBootstrapControlPlaneNoOverwrite(t *testing.T) { assetDir, podManifestPath := setUp(t) defer tearDown(assetDir, podManifestPath, t) existingManifest := manifests[1] existingData := []byte("existing data") // Create a manifest in the destination already. if err := ioutil.WriteFile(filepath.Join(podManifestPath, existingManifest), existingData, os.FileMode(0644)); err != nil { t.Fatal(err) } // Create and start bootstrap control plane. bcp := NewBootstrapControlPlane(assetDir, podManifestPath) if err := bcp.Start(); err == nil { t.Errorf("bcp.Start() = %v, want: non-nil", err) } // Make sure assets were copied. for _, secret := range secrets { if _, err := os.Stat(filepath.Join(asset.BootstrapSecretsDir, secret)); os.IsNotExist(err) { t.Errorf("bcp.Start() failed to copy secret: %v", secret) } } for _, manifest := range manifests { if _, err := os.Stat(filepath.Join(podManifestPath, manifest)); os.IsNotExist(err) { t.Errorf("bcp.Start() failed to copy manifest: %v", manifest) } if manifest == existingManifest { data, err := ioutil.ReadFile(filepath.Join(podManifestPath, manifest)) if err != nil { t.Fatal(err) } if !reflect.DeepEqual(data, existingData) { t.Errorf("existing manifest %v was overwritten, got: %s, want: %s", existingManifest, data, existingData) } } } // Tear down control plane. if err := bcp.Teardown(); err != nil { t.Errorf("bcp.Start() = %v, want: nil", err) } // Make sure directories were properly cleaned up. if fi, err := os.Stat(asset.BootstrapSecretsDir); fi != nil || !os.IsNotExist(err) { t.Error("bcp.Teardown() failed to delete secrets directory") } for _, manifest := range manifests { if manifest == existingManifest { continue // The manifest previously existed -- do not delete. } if fi, err := os.Stat(filepath.Join(podManifestPath, manifest)); fi != nil || !os.IsNotExist(err) { t.Errorf("bcp.Teardown() failed to delete manifest: %v", manifest) } } } ================================================ FILE: pkg/bootkube/create.go ================================================ package bootkube import ( "bufio" "bytes" "context" "encoding/json" "fmt" "io" "net/http" "os" "path/filepath" "sort" "strings" "sync" "time" "github.com/golang/glog" apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/client-go/discovery" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" ) const ( crdRolloutDuration = 1 * time.Second crdRolloutTimeout = 2 * time.Minute ) func CreateAssets(config clientcmd.ClientConfig, manifestDir string, timeout time.Duration, strict bool) error { if _, err := os.Stat(manifestDir); os.IsNotExist(err) { UserOutput(fmt.Sprintf("WARNING: %v does not exist, not creating any self-hosted assets.\n", manifestDir)) return nil } c, err := config.ClientConfig() if err != nil { return err } creater, err := newCreater(c, strict) if err != nil { return err } m, err := loadManifests(manifestDir) if err != nil { return fmt.Errorf("loading manifests: %v", err) } upFn := func() (bool, error) { if err := apiTest(config); err != nil { glog.Warningf("Unable to determine api-server readiness: %v", err) return false, nil } return true, nil } UserOutput("Waiting for api-server...\n") if err := wait.Poll(5*time.Second, timeout, upFn); err != nil { err = fmt.Errorf("API Server is not ready: %v", err) glog.Error(err) return err } UserOutput("Creating self-hosted assets...\n") if ok := creater.createManifests(m); !ok { UserOutput("\nNOTE: Bootkube failed to create some cluster assets. It is important that manifest errors are resolved and resubmitted to the apiserver.\n") UserOutput("For example, after resolving issues: kubectl create -f \n\n") // Don't fail on manifest creation. It's easier to debug a cluster with a failed // manifest than exiting and tearing down the control plane. If strict // mode is enabled, then error out. if strict { return fmt.Errorf("Self-hosted assets could not be created") } } return nil } func apiTest(c clientcmd.ClientConfig) error { config, err := c.ClientConfig() if err != nil { return err } client, err := kubernetes.NewForConfig(config) if err != nil { return err } // API Server is responding healthStatus := 0 client.Discovery().RESTClient().Get().AbsPath("/healthz").Do(context.TODO()).StatusCode(&healthStatus) if healthStatus != http.StatusOK { return fmt.Errorf("API Server http status: %d", healthStatus) } // System namespace has been created _, err = client.CoreV1().Namespaces().Get(context.TODO(), "kube-system", metav1.GetOptions{}) return err } type manifest struct { kind string apiVersion string namespace string name string raw []byte filepath string } func (m manifest) String() string { if m.namespace == "" { return fmt.Sprintf("%s %s %s", m.filepath, m.kind, m.name) } return fmt.Sprintf("%s %s %s/%s", m.filepath, m.kind, m.namespace, m.name) } type creater struct { client *rest.RESTClient strict bool // mapper maps resource kinds ("ConfigMap") with their pluralized URL // path ("configmaps") using the discovery APIs. mapper *resourceMapper } func newCreater(c *rest.Config, strict bool) (*creater, error) { c.NegotiatedSerializer = serializer.WithoutConversionCodecFactory{CodecFactory: scheme.Codecs} client, err := rest.UnversionedRESTClientFor(c) if err != nil { return nil, err } discoveryClient, err := discovery.NewDiscoveryClientForConfig(c) if err != nil { return nil, err } return &creater{ mapper: newResourceMapper(discoveryClient), client: client, strict: strict, }, nil } func (c *creater) createManifests(manifests []manifest) (ok bool) { ok = true // Bootkube used to create manifests in named order ("01-foo" before "02-foo"). // Maintain this behavior for everything except CRDs and NSs, which have strict ordering // that we should always respect. sort.Slice(manifests, func(i, j int) bool { return manifests[i].filepath < manifests[j].filepath }) var namespaces, crds, other []manifest for _, m := range manifests { if m.kind == "CustomResourceDefinition" && strings.HasPrefix(m.apiVersion, "apiextensions.k8s.io/") { crds = append(crds, m) } else if m.kind == "Namespace" && m.apiVersion == "v1" { namespaces = append(namespaces, m) } else { other = append(other, m) } } create := func(m manifest) error { if err := c.create(m); err != nil { ok = false UserOutput("Failed creating %s: %v\n", m, err) return err } UserOutput("Created %s\n", m) return nil } // Create all namespaces first for _, m := range namespaces { if err := create(m); err != nil && c.strict { return false } } // Create the custom resource definition before creating the actual custom resources. for _, m := range crds { if err := create(m); err != nil && c.strict { return false } } // Wait until the API server registers the CRDs. Until then it's not safe to create the // manifests for those custom resources. for _, crd := range crds { if err := c.waitForCRD(crd); err != nil { ok = false UserOutput("Failed waiting for %s: %v\n", crd, err) if c.strict { return false } } } for _, m := range other { // There are cases when a multi-doc YAML contains empty manifests. This // is most often the case when using a templating enging that skips // over a certain manifest in the case that a feature is diabled. This // check is to allow for this. When decoded, the raw string becomes // "null", so we check for that and skip the manifest if it is "null". if string(m.raw) == "null" { continue } if err := create(m); err != nil && c.strict { return false } } return ok } // waitForCRD blocks until the API server begins serving the custom resource this // manifest defines. This is determined by listing the custom resource in a loop. func (c *creater) waitForCRD(m manifest) error { var crd apiextensionsv1beta1.CustomResourceDefinition if err := json.Unmarshal(m.raw, &crd); err != nil { return fmt.Errorf("failed to unmarshal manifest: %v", err) } // get first served version firstVer := "" if len(crd.Spec.Versions) > 0 { for _, v := range crd.Spec.Versions { if v.Served { firstVer = v.Name break } } } else { firstVer = crd.Spec.Version } if len(firstVer) == 0 { return fmt.Errorf("expected at least one served version") } return wait.PollImmediate(crdRolloutDuration, crdRolloutTimeout, func() (bool, error) { // get all resources, giving a 200 result with empty list on success, 404 before the CRD is active. namespaceLessURI := allCustomResourcesURI(schema.GroupVersionResource{Group: crd.Spec.Group, Version: firstVer, Resource: crd.Spec.Names.Plural}) res := c.client.Get().RequestURI(namespaceLessURI).Do(context.TODO()) if res.Error() != nil { if errors.IsNotFound(res.Error()) { return false, nil } return false, res.Error() } return true, nil }) } // allCustomResourcesURI returns the URI for the CRD resource without a namespace, listing // all objects of that GroupVersionResource. func allCustomResourcesURI(gvr schema.GroupVersionResource) string { return fmt.Sprintf("/apis/%s/%s/%s", strings.ToLower(gvr.Group), strings.ToLower(gvr.Version), strings.ToLower(gvr.Resource), ) } func (c *creater) create(m manifest) error { info, err := c.mapper.resourceInfo(m.apiVersion, m.kind) if err != nil { return fmt.Errorf("dicovery failed: %v", err) } return c.client.Post(). AbsPath(m.urlPath(info.Name, info.Namespaced)). Body(m.raw). SetHeader("Content-Type", "application/json"). Do(context.TODO()).Error() } func (m manifest) urlPath(plural string, namespaced bool) string { u := "/apis" if m.apiVersion == "v1" { u = "/api" } u = u + "/" + m.apiVersion // NOTE(ericchiang): Some of our non-namespaced manifests have a "namespace" field. // Since kubectl create accepts this, also accept this. if m.namespace != "" && namespaced { u = u + "/namespaces/" + m.namespace } return u + "/" + plural } // loadManifests parses a directory of YAML Kubernetes manifest. func loadManifests(p string) ([]manifest, error) { var manifests []manifest err := filepath.Walk(p, func(path string, info os.FileInfo, err error) error { if err != nil { return err } if info.IsDir() { b := filepath.Base(p) if b != p && strings.HasPrefix(b, ".") { // Ignore directories that start with a "." return filepath.SkipDir } return nil } f, err := os.Open(path) if err != nil { return fmt.Errorf("open %s: %v", path, err) } defer f.Close() ms, err := parseManifests(f) if err != nil { return fmt.Errorf("parse file %s: %v", path, err) } for i := range ms { ms[i].filepath = path } manifests = append(manifests, ms...) return nil }) return manifests, err } // parseManifests parses a YAML or JSON document that may contain one or more // kubernetes resoures. func parseManifests(r io.Reader) ([]manifest, error) { reader := yaml.NewYAMLReader(bufio.NewReader(r)) var manifests []manifest for { yamlManifest, err := reader.Read() if err != nil { if err == io.EOF { if len(manifests) == 0 { return nil, fmt.Errorf("no resources found") } return manifests, nil } return nil, err } yamlManifest = bytes.TrimSpace(yamlManifest) if len(yamlManifest) == 0 { continue } jsonManifest, err := yaml.ToJSON(yamlManifest) if err != nil { return nil, fmt.Errorf("invalid manifest: %v", err) } m, err := parseJSONManifest(jsonManifest) if err != nil { return nil, fmt.Errorf("parse manifest: %v", err) } manifests = append(manifests, m) } } // parseJSONManifest parses a single JSON Kubernetes resource. func parseJSONManifest(data []byte) (manifest, error) { var m struct { APIVersion string `json:"apiVersion"` Kind string `json:"kind"` Metadata struct { Name string `json:"name"` Namespace string `json:"namespace"` } `json:"metadata"` } if err := json.Unmarshal(data, &m); err != nil { return manifest{}, fmt.Errorf("parse manifest: %v", err) } return manifest{ kind: m.Kind, apiVersion: m.APIVersion, namespace: m.Metadata.Namespace, name: m.Metadata.Name, raw: data, }, nil } func newResourceMapper(d discovery.DiscoveryInterface) *resourceMapper { return &resourceMapper{d, sync.Mutex{}, make(map[string]*metav1.APIResourceList)} } // resourceMapper uses the Kubernetes discovery APIs to map a resource Kind to its pluralized // name to construct a URL path. For example, "ClusterRole" would be converted to "clusterroles". // // NOTE(ericchiang): I couldn't get discovery.DeferredDiscoveryRESTMapper working for the // life of me. This implements the same logic. type resourceMapper struct { discoveryClient discovery.DiscoveryInterface mu sync.Mutex cache map[string]*metav1.APIResourceList } // resourceInfo uses the API server discovery APIs to determine the resource definition // of a given Kind. func (m *resourceMapper) resourceInfo(groupVersion, kind string) (*metav1.APIResource, error) { m.mu.Lock() l, ok := m.cache[groupVersion] m.mu.Unlock() if ok { // Check cache. for _, r := range l.APIResources { if r.Kind == kind { return &r, nil } } } l, err := m.discoveryClient.ServerResourcesForGroupVersion(groupVersion) if err != nil { return nil, fmt.Errorf("discover group version %s: %v", groupVersion, err) } m.mu.Lock() m.cache[groupVersion] = l m.mu.Unlock() for _, r := range l.APIResources { if r.Kind == kind { return &r, nil } } return nil, fmt.Errorf("resource %s %s not found", groupVersion, kind) } ================================================ FILE: pkg/bootkube/create_test.go ================================================ package bootkube import ( "reflect" "strings" "testing" ) func TestParseManifests(t *testing.T) { tests := []struct { name string raw string want []manifest }{ { name: "ingress", raw: ` apiVersion: extensions/v1beta1 kind: Ingress metadata: name: test-ingress namespace: test-namespace spec: rules: - http: paths: - path: /testpath backend: serviceName: test servicePort: 80 `, want: []manifest{ { kind: "Ingress", apiVersion: "extensions/v1beta1", namespace: "test-namespace", name: "test-ingress", }, }, }, { name: "configmap", raw: ` apiVersion: v1 kind: ConfigMap metadata: name: a-config namespace: default data: color: "red" multi-line: | hello world how are you? `, want: []manifest{ { kind: "ConfigMap", apiVersion: "v1", namespace: "default", name: "a-config", }, }, }, { name: "two-resources", raw: ` apiVersion: extensions/v1beta1 kind: Ingress metadata: name: test-ingress namespace: test-namespace spec: rules: - http: paths: - path: /testpath backend: serviceName: test servicePort: 80 --- apiVersion: v1 kind: ConfigMap metadata: name: a-config namespace: default data: color: "red" multi-line: | hello world how are you? `, want: []manifest{ { kind: "Ingress", apiVersion: "extensions/v1beta1", namespace: "test-namespace", name: "test-ingress", }, { kind: "ConfigMap", apiVersion: "v1", namespace: "default", name: "a-config", }, }, }, { name: "empty-manifests", raw: ` --- # Source: x --- # Source: y --- # Source: z `, want: []manifest{ {}, {}, {}, }, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { got, err := parseManifests(strings.NewReader(test.raw)) if err != nil { t.Fatalf("failed to parse manifest: %v", err) } for i := range got { got[i].raw = nil } if !reflect.DeepEqual(test.want, got) { t.Errorf("wanted %#v, got %#v", test.want, got) } }) } } func TestManifestURLPath(t *testing.T) { tests := []struct { apiVersion string namespace string plural string namespaced bool want string }{ {"v1", "my-ns", "pods", true, "/api/v1/namespaces/my-ns/pods"}, {"apps.k8s.io/v1beta1", "my-ns", "deployments", true, "/apis/apps.k8s.io/v1beta1/namespaces/my-ns/deployments"}, {"v1", "", "nodes", false, "/api/v1/nodes"}, {"apiextensions.k8s.io/v1beta1", "", "customresourcedefinitions", false, "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions"}, // If non-namespaced, ignore the namespace field. This is to mimic kubectl create // behavior, which allows this but drops the namespace. {"apiextensions.k8s.io/v1beta1", "my-ns", "customresourcedefinitions", false, "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions"}, } for _, test := range tests { m := manifest{ apiVersion: test.apiVersion, namespace: test.namespace, } got := m.urlPath(test.plural, test.namespaced) if test.want != got { t.Errorf("{&manifest{apiVersion:%q, namespace: %q}).urlPath(%q, %t); wanted=%q, got=%q", test.apiVersion, test.namespace, test.plural, test.namespaced, test.want, got) } } } ================================================ FILE: pkg/bootkube/status.go ================================================ package bootkube import ( "context" "fmt" "reflect" "strings" "time" "github.com/golang/glog" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/clientcmd" ) const ( doesNotExist = "DoesNotExist" ) func WaitUntilPodsRunning(c clientcmd.ClientConfig, pods []string, timeout time.Duration) error { sc, err := NewStatusController(c, pods) if err != nil { return err } ctx, cancel := context.WithCancel(context.Background()) defer cancel() sc.Run(ctx) if err := wait.Poll(5*time.Second, timeout, sc.AllRunning); err != nil { return fmt.Errorf("error while checking pod status: %v", err) } UserOutput("All self-hosted control plane components successfully started\n") return nil } type statusController struct { client kubernetes.Interface podStore cache.Store nodeStore cache.Store watchPods []string lastPodPhases map[string]corev1.PodPhase lastNodeConditions map[string]corev1.NodeCondition } func NewStatusController(c clientcmd.ClientConfig, pods []string) (*statusController, error) { config, err := c.ClientConfig() if err != nil { return nil, err } client, err := kubernetes.NewForConfig(config) if err != nil { return nil, err } return &statusController{client: client, watchPods: pods}, nil } func (s *statusController) Run(ctx context.Context) { // TODO: launch a separate watcher for each component? s.podWatcher(ctx) s.nodeWatcher(ctx) } func (s *statusController) podWatcher(ctx context.Context) { // TODO(yifan): Be more explicit about the labels so that we don't just // reply on the prefix of the pod name when looking for the pods we are interested. // E.g. For a scheduler pod, we will look for pods that has label `tier=control-plane` // and `component=kube-scheduler`. options := metav1.ListOptions{} podStore, podController := cache.NewInformer( &cache.ListWatch{ ListFunc: func(lo metav1.ListOptions) (runtime.Object, error) { return s.client.CoreV1().Pods("").List(ctx, options) }, WatchFunc: func(lo metav1.ListOptions) (watch.Interface, error) { return s.client.CoreV1().Pods("").Watch(ctx, options) }, }, &corev1.Pod{}, 30*time.Minute, cache.ResourceEventHandlerFuncs{}, ) s.podStore = podStore go podController.Run(ctx.Done()) } func (s *statusController) nodeWatcher(ctx context.Context) { options := metav1.ListOptions{} nodeStore, nodeController := cache.NewInformer( &cache.ListWatch{ ListFunc: func(lo metav1.ListOptions) (runtime.Object, error) { return s.client.CoreV1().Nodes().List(ctx, options) }, WatchFunc: func(lo metav1.ListOptions) (watch.Interface, error) { return s.client.CoreV1().Nodes().Watch(ctx, options) }, }, &corev1.Node{}, 30*time.Minute, cache.ResourceEventHandlerFuncs{}, ) s.nodeStore = nodeStore go nodeController.Run(ctx.Done()) } func (s *statusController) AllRunning() (bool, error) { var podsRunning, nodesReady, running bool podsRunning = s.allPodsRunning() if podsRunning { nodesReady = s.allNodesReady() } if podsRunning && nodesReady { running = true } return running, nil } func (s *statusController) allPodsRunning() bool { ps, err := s.PodStatus() if err != nil { glog.Infof("Error retriving pod statuses: %v", err) return false } if s.lastPodPhases == nil { s.lastPodPhases = ps } // use lastPodPhases to print only pods whose phase has changed changed := !reflect.DeepEqual(ps, s.lastPodPhases) s.lastPodPhases = ps running := true for p, s := range ps { if changed { UserOutput("\tPod Status:%24s\t%s\n", p, s) } if s != corev1.PodRunning { running = false } } return running } func (s *statusController) allNodesReady() bool { // Check node status to ensure all nodes are Ready ns, err := s.NodeStatus() if err != nil { glog.Infof("Error retrieving node conditions: %v", err) return false } if s.lastNodeConditions == nil { s.lastNodeConditions = ns } changed := !reflect.DeepEqual(ns, s.lastNodeConditions) s.lastNodeConditions = ns running := true for node, condition := range ns { if changed { UserOutput("\tNode Conditions:%24s\t%s\n", node, condition) } if condition.Status != corev1.ConditionTrue { running = false } } return running } func (s *statusController) PodStatus() (map[string]corev1.PodPhase, error) { status := make(map[string]corev1.PodPhase) podNames := s.podStore.ListKeys() for _, watchedPod := range s.watchPods { // Pod names are suffixed with random data. Match on prefix for _, pn := range podNames { if strings.HasPrefix(pn, watchedPod) { watchedPod = pn break } } p, exists, err := s.podStore.GetByKey(watchedPod) if err != nil { return nil, err } if !exists { status[watchedPod] = doesNotExist continue } if p, ok := p.(*corev1.Pod); ok { status[watchedPod] = p.Status.Phase } } return status, nil } func (s *statusController) NodeStatus() (map[string]corev1.NodeCondition, error) { status := make(map[string]corev1.NodeCondition) for _, node := range s.nodeStore.List() { for _, condition := range node.(*corev1.Node).Status.Conditions { if condition.Type == corev1.NodeReady { status[node.(*corev1.Node).Name] = condition break } } } return status, nil } ================================================ FILE: pkg/checkpoint/apiserver.go ================================================ package checkpoint import ( "context" "github.com/golang/glog" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" ) // getAPIParentPods will retrieve all pods from apiserver that are parents & should be checkpointed // Returns false if we could not contact the apiserver. func (c *checkpointer) getAPIParentPods(nodeName string) (bool, map[string]*v1.Pod) { opts := metav1.ListOptions{ FieldSelector: fields.OneTermEqualSelector("spec.nodeName", nodeName).String(), } podList, err := c.apiserver.CoreV1().Pods(c.checkpointerPod.PodNamespace).List(context.TODO(), opts) if err != nil { glog.Warningf("Unable to contact APIServer, skipping garbage collection: %v", err) return false, nil } return true, podListToParentPods(podList) } ================================================ FILE: pkg/checkpoint/checkpoint.go ================================================ // Package checkpoint provides libraries that are used by the pod-checkpointer utility to checkpoint // pods on a node. See cmd/checkpoint/README.md in this repository for more information. package checkpoint import ( "fmt" "os" "time" "github.com/golang/glog" "k8s.io/client-go/kubernetes" restclient "k8s.io/client-go/rest" ) const ( activeCheckpointPath = "/etc/kubernetes/manifests" inactiveCheckpointPath = "/etc/kubernetes/inactive-manifests" checkpointSecretPath = "/etc/kubernetes/checkpoint-secrets" checkpointConfigMapPath = "/etc/kubernetes/checkpoint-configmaps" shouldCheckpointAnnotation = "checkpointer.alpha.coreos.com/checkpoint" // = "true" checkpointParentAnnotation = "checkpointer.alpha.coreos.com/checkpoint-of" // = "podName" podSourceAnnotation = "kubernetes.io/config.source" shouldCheckpoint = "true" podSourceFile = "file" defaultPollingFrequency = 5 * time.Second defaultCheckpointTimeout = 1 * time.Minute rootUID = 0 rootGID = 0 ) var ( lastCheckpoint time.Time checkpointGracePeriod time.Duration ) // Options defines the parameters that are required to start the checkpointer. type Options struct { // CheckpointerPod holds information about this checkpointer pod. CheckpointerPod CheckpointerPod // KubeConfig is a valid kubeconfig for communicating with the APIServer. KubeConfig *restclient.Config // RemoteRuntimeEndpoint is the location of the CRI GRPC endpoint. RemoteRuntimeEndpoint string // RuntimeRequestTimeout is the timeout that is used for requests to the RemoteRuntimeEndpoint. RuntimeRequestTimeout time.Duration // CheckpointGracePeriod is the timeout that is used for cleaning up checkpoints when the parent // pod is deleted. CheckpointGracePeriod time.Duration } // CheckpointerPod holds information about this checkpointer pod. type CheckpointerPod struct { // The name of the node this checkpointer is running on. NodeName string // The name of the pod that is running this checkpointer. PodName string // The namespace of the pod that is running this checkpointer. PodNamespace string } // checkpointer holds state used by the checkpointer to perform its duties. type checkpointer struct { apiserver kubernetes.Interface kubelet *kubeletClient cri *remoteRuntimeService checkpointerPod CheckpointerPod checkpoints checkpoints } // Run instantiates and starts a new checkpointer. Returns error if there was a problem creating // the checkpointer, otherwise never returns. func Run(opts Options) error { apiserver := kubernetes.NewForConfigOrDie(opts.KubeConfig) kubelet, err := newKubeletClient(opts.KubeConfig) if err != nil { return fmt.Errorf("failed to load kubelet client: %v", err) } // Open a GRPC connection to the CRI shim cri, err := newRemoteRuntimeService(opts.RemoteRuntimeEndpoint, opts.RuntimeRequestTimeout) if err != nil { return fmt.Errorf("failed to connect to CRI server: %v", err) } checkpointGracePeriod = opts.CheckpointGracePeriod cp := &checkpointer{ apiserver: apiserver, kubelet: kubelet, cri: cri, checkpointerPod: opts.CheckpointerPod, } cp.run() return nil } // run is the main checkpointing loop. func (c *checkpointer) run() { // Make sure the inactive checkpoint path exists. if err := os.MkdirAll(inactiveCheckpointPath, 0700); err != nil { glog.Fatalf("Could not create inactive checkpoint path: %v", err) } for { time.Sleep(defaultPollingFrequency) // We must use both the kubelet /pods endpoint and CRI shim, because /pods // endpoint could have stale data. The /pods endpoint will only show the last cached // status which has successfully been written to an apiserver. However, if there is // no apiserver, we may get stale state (e.g. saying pod is running, when it really is // not). localParentPods := c.kubelet.localParentPods() localRunningPods := c.cri.localRunningPods() // Try to get scheduled pods from the apiserver. // These will be used to GC checkpoints for parents no longer scheduled to this node. // TODO(aaron): only check this every 30 seconds or so apiAvailable, apiParentPods := c.getAPIParentPods(c.checkpointerPod.NodeName) // Get on disk copies of (in)active checkpoints //TODO(aaron): Could be racy to load from disk each time, but much easier than trying to keep in-memory state in sync. activeCheckpoints := getFileCheckpoints(activeCheckpointPath) inactiveCheckpoints := getFileCheckpoints(inactiveCheckpointPath) // Update checkpoints using the latest information from the APIs. c.checkpoints.update(localRunningPods, localParentPods, apiParentPods, activeCheckpoints, inactiveCheckpoints, c.checkpointerPod) // Update on-disk manifests based on updated checkpoint state. c.createCheckpointsForValidParents() // Update checkpoint states and determine which checkpoints to start, stop, or remove. start, stop, remove := c.checkpoints.process(time.Now(), apiAvailable, localRunningPods, localParentPods, apiParentPods) // Handle remove at last because we may still have some work to do // before removing the checkpointer itself. handleStop(stop) handleStart(start) handleRemove(remove) } } ================================================ FILE: pkg/checkpoint/config_map.go ================================================ package checkpoint import ( "context" "fmt" "os" "path" "path/filepath" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // checkpointConfigMapVolumes ensures that all pod configMaps are checkpointed locally, then converts the configMap volume to a hostpath. func (c *checkpointer) checkpointConfigMapVolumes(pod *corev1.Pod) (*corev1.Pod, error) { uid, gid, err := podUserAndGroup(pod) if err != nil { return nil, fmt.Errorf("failed to checkpoint configMap for pod %s/%s: %v", pod.Namespace, pod.Name, err) } for i := range pod.Spec.Volumes { v := &pod.Spec.Volumes[i] if v.ConfigMap == nil { continue } _, err := c.checkpointConfigMap(pod.Namespace, pod.Name, v.ConfigMap.Name, uid, gid) if err != nil { return nil, fmt.Errorf("failed to checkpoint configMap for pod %s/%s: %v", pod.Namespace, pod.Name, err) } } return pod, nil } // checkpointConfigMap will locally store configMap data. // The path to the configMap data becomes: checkpointConfigMapPath/namespace/podname/configMapName/configMap.file // Where each "configMap.file" is a key from the configMap.Data field. func (c *checkpointer) checkpointConfigMap(namespace, podName, configMapName string, uid, gid int) (string, error) { configMap, err := c.apiserver.CoreV1().ConfigMaps(namespace).Get(context.TODO(), configMapName, metav1.GetOptions{}) if err != nil { return "", fmt.Errorf("failed to retrieve configMap %s/%s: %v", namespace, configMapName, err) } basePath := configMapPath(namespace, podName, configMapName) if err := os.MkdirAll(basePath, 0700); err != nil { return "", fmt.Errorf("failed to create configMap checkpoint path %s: %v", basePath, err) } if err := os.Chown(basePath, uid, gid); err != nil { return "", fmt.Errorf("failed to chown configMap checkpoint path %s: %v", basePath, err) } // TODO(aaron): No need to store if already exists for f, d := range configMap.Data { if err := writeAndAtomicRename(filepath.Join(basePath, f), []byte(d), uid, gid, 0600); err != nil { return "", fmt.Errorf("failed to write configMap %s: %v", configMap.Name, err) } } return basePath, nil } func configMapPath(namespace, podName, configMapName string) string { return filepath.Join(checkpointConfigMapPath, namespace, podName, configMapName) } func podFullNameToConfigMapPath(id string) string { namespace, podname := path.Split(id) return filepath.Join(checkpointConfigMapPath, namespace, podname) } ================================================ FILE: pkg/checkpoint/cri/README.md ================================================ # Vendored CRI APIs We copy generated CRI APIs for a couple reasons: * When CRI promotes a version, it sometimes deletes the old alpha version. * Prevents importing `k8s.io/kubernetes`. The various versions of CRI are taken from: * v1alpha1: https://github.com/kubernetes/kubernetes/tree/v1.9.6/pkg/kubelet/apis/cri * v1alpha2: https://github.com/kubernetes/cri-api/tree/release-1.16/pkg/apis ================================================ FILE: pkg/checkpoint/cri/v1alpha1/api.pb.go ================================================ /* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by protoc-gen-gogo. // source: api.proto // DO NOT EDIT! /* Package runtime is a generated protocol buffer package. It is generated from these files: api.proto It has these top-level messages: VersionRequest VersionResponse DNSConfig PortMapping Mount NamespaceOption Int64Value LinuxSandboxSecurityContext LinuxPodSandboxConfig PodSandboxMetadata PodSandboxConfig RunPodSandboxRequest RunPodSandboxResponse StopPodSandboxRequest StopPodSandboxResponse RemovePodSandboxRequest RemovePodSandboxResponse PodSandboxStatusRequest PodSandboxNetworkStatus Namespace LinuxPodSandboxStatus PodSandboxStatus PodSandboxStatusResponse PodSandboxStateValue PodSandboxFilter ListPodSandboxRequest PodSandbox ListPodSandboxResponse ImageSpec KeyValue LinuxContainerResources SELinuxOption Capability LinuxContainerSecurityContext LinuxContainerConfig ContainerMetadata Device ContainerConfig CreateContainerRequest CreateContainerResponse StartContainerRequest StartContainerResponse StopContainerRequest StopContainerResponse RemoveContainerRequest RemoveContainerResponse ContainerStateValue ContainerFilter ListContainersRequest Container ListContainersResponse ContainerStatusRequest ContainerStatus ContainerStatusResponse UpdateContainerResourcesRequest UpdateContainerResourcesResponse ExecSyncRequest ExecSyncResponse ExecRequest ExecResponse AttachRequest AttachResponse PortForwardRequest PortForwardResponse ImageFilter ListImagesRequest Image ListImagesResponse ImageStatusRequest ImageStatusResponse AuthConfig PullImageRequest PullImageResponse RemoveImageRequest RemoveImageResponse NetworkConfig RuntimeConfig UpdateRuntimeConfigRequest UpdateRuntimeConfigResponse RuntimeCondition RuntimeStatus StatusRequest StatusResponse ImageFsInfoRequest UInt64Value StorageIdentifier FilesystemUsage ImageFsInfoResponse ContainerStatsRequest ContainerStatsResponse ListContainerStatsRequest ContainerStatsFilter ListContainerStatsResponse ContainerAttributes ContainerStats CpuUsage MemoryUsage */ package v1alpha1 import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" import _ "github.com/gogo/protobuf/gogoproto" import ( context "golang.org/x/net/context" grpc "google.golang.org/grpc" ) import strings "strings" import reflect "reflect" import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type Protocol int32 const ( Protocol_TCP Protocol = 0 Protocol_UDP Protocol = 1 ) var Protocol_name = map[int32]string{ 0: "TCP", 1: "UDP", } var Protocol_value = map[string]int32{ "TCP": 0, "UDP": 1, } func (x Protocol) String() string { return proto.EnumName(Protocol_name, int32(x)) } func (Protocol) EnumDescriptor() ([]byte, []int) { return fileDescriptorApi, []int{0} } type MountPropagation int32 const ( // No mount propagation ("private" in Linux terminology). MountPropagation_PROPAGATION_PRIVATE MountPropagation = 0 // Mounts get propagated from the host to the container ("rslave" in Linux). MountPropagation_PROPAGATION_HOST_TO_CONTAINER MountPropagation = 1 // Mounts get propagated from the host to the container and from the // container to the host ("rshared" in Linux). MountPropagation_PROPAGATION_BIDIRECTIONAL MountPropagation = 2 ) var MountPropagation_name = map[int32]string{ 0: "PROPAGATION_PRIVATE", 1: "PROPAGATION_HOST_TO_CONTAINER", 2: "PROPAGATION_BIDIRECTIONAL", } var MountPropagation_value = map[string]int32{ "PROPAGATION_PRIVATE": 0, "PROPAGATION_HOST_TO_CONTAINER": 1, "PROPAGATION_BIDIRECTIONAL": 2, } func (x MountPropagation) String() string { return proto.EnumName(MountPropagation_name, int32(x)) } func (MountPropagation) EnumDescriptor() ([]byte, []int) { return fileDescriptorApi, []int{1} } type PodSandboxState int32 const ( PodSandboxState_SANDBOX_READY PodSandboxState = 0 PodSandboxState_SANDBOX_NOTREADY PodSandboxState = 1 ) var PodSandboxState_name = map[int32]string{ 0: "SANDBOX_READY", 1: "SANDBOX_NOTREADY", } var PodSandboxState_value = map[string]int32{ "SANDBOX_READY": 0, "SANDBOX_NOTREADY": 1, } func (x PodSandboxState) String() string { return proto.EnumName(PodSandboxState_name, int32(x)) } func (PodSandboxState) EnumDescriptor() ([]byte, []int) { return fileDescriptorApi, []int{2} } type ContainerState int32 const ( ContainerState_CONTAINER_CREATED ContainerState = 0 ContainerState_CONTAINER_RUNNING ContainerState = 1 ContainerState_CONTAINER_EXITED ContainerState = 2 ContainerState_CONTAINER_UNKNOWN ContainerState = 3 ) var ContainerState_name = map[int32]string{ 0: "CONTAINER_CREATED", 1: "CONTAINER_RUNNING", 2: "CONTAINER_EXITED", 3: "CONTAINER_UNKNOWN", } var ContainerState_value = map[string]int32{ "CONTAINER_CREATED": 0, "CONTAINER_RUNNING": 1, "CONTAINER_EXITED": 2, "CONTAINER_UNKNOWN": 3, } func (x ContainerState) String() string { return proto.EnumName(ContainerState_name, int32(x)) } func (ContainerState) EnumDescriptor() ([]byte, []int) { return fileDescriptorApi, []int{3} } type VersionRequest struct { // Version of the kubelet runtime API. Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` } func (m *VersionRequest) Reset() { *m = VersionRequest{} } func (*VersionRequest) ProtoMessage() {} func (*VersionRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{0} } func (m *VersionRequest) GetVersion() string { if m != nil { return m.Version } return "" } type VersionResponse struct { // Version of the kubelet runtime API. Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // Name of the container runtime. RuntimeName string `protobuf:"bytes,2,opt,name=runtime_name,json=runtimeName,proto3" json:"runtime_name,omitempty"` // Version of the container runtime. The string must be // semver-compatible. RuntimeVersion string `protobuf:"bytes,3,opt,name=runtime_version,json=runtimeVersion,proto3" json:"runtime_version,omitempty"` // API version of the container runtime. The string must be // semver-compatible. RuntimeApiVersion string `protobuf:"bytes,4,opt,name=runtime_api_version,json=runtimeApiVersion,proto3" json:"runtime_api_version,omitempty"` } func (m *VersionResponse) Reset() { *m = VersionResponse{} } func (*VersionResponse) ProtoMessage() {} func (*VersionResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{1} } func (m *VersionResponse) GetVersion() string { if m != nil { return m.Version } return "" } func (m *VersionResponse) GetRuntimeName() string { if m != nil { return m.RuntimeName } return "" } func (m *VersionResponse) GetRuntimeVersion() string { if m != nil { return m.RuntimeVersion } return "" } func (m *VersionResponse) GetRuntimeApiVersion() string { if m != nil { return m.RuntimeApiVersion } return "" } // DNSConfig specifies the DNS servers and search domains of a sandbox. type DNSConfig struct { // List of DNS servers of the cluster. Servers []string `protobuf:"bytes,1,rep,name=servers" json:"servers,omitempty"` // List of DNS search domains of the cluster. Searches []string `protobuf:"bytes,2,rep,name=searches" json:"searches,omitempty"` // List of DNS options. See https://linux.die.net/man/5/resolv.conf // for all available options. Options []string `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"` } func (m *DNSConfig) Reset() { *m = DNSConfig{} } func (*DNSConfig) ProtoMessage() {} func (*DNSConfig) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{2} } func (m *DNSConfig) GetServers() []string { if m != nil { return m.Servers } return nil } func (m *DNSConfig) GetSearches() []string { if m != nil { return m.Searches } return nil } func (m *DNSConfig) GetOptions() []string { if m != nil { return m.Options } return nil } // PortMapping specifies the port mapping configurations of a sandbox. type PortMapping struct { // Protocol of the port mapping. Protocol Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=runtime.Protocol" json:"protocol,omitempty"` // Port number within the container. Default: 0 (not specified). ContainerPort int32 `protobuf:"varint,2,opt,name=container_port,json=containerPort,proto3" json:"container_port,omitempty"` // Port number on the host. Default: 0 (not specified). HostPort int32 `protobuf:"varint,3,opt,name=host_port,json=hostPort,proto3" json:"host_port,omitempty"` // Host IP. HostIp string `protobuf:"bytes,4,opt,name=host_ip,json=hostIp,proto3" json:"host_ip,omitempty"` } func (m *PortMapping) Reset() { *m = PortMapping{} } func (*PortMapping) ProtoMessage() {} func (*PortMapping) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{3} } func (m *PortMapping) GetProtocol() Protocol { if m != nil { return m.Protocol } return Protocol_TCP } func (m *PortMapping) GetContainerPort() int32 { if m != nil { return m.ContainerPort } return 0 } func (m *PortMapping) GetHostPort() int32 { if m != nil { return m.HostPort } return 0 } func (m *PortMapping) GetHostIp() string { if m != nil { return m.HostIp } return "" } // Mount specifies a host volume to mount into a container. type Mount struct { // Path of the mount within the container. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"` // Path of the mount on the host. HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` // If set, the mount is read-only. Readonly bool `protobuf:"varint,3,opt,name=readonly,proto3" json:"readonly,omitempty"` // If set, the mount needs SELinux relabeling. SelinuxRelabel bool `protobuf:"varint,4,opt,name=selinux_relabel,json=selinuxRelabel,proto3" json:"selinux_relabel,omitempty"` // Requested propagation mode. Propagation MountPropagation `protobuf:"varint,5,opt,name=propagation,proto3,enum=runtime.MountPropagation" json:"propagation,omitempty"` } func (m *Mount) Reset() { *m = Mount{} } func (*Mount) ProtoMessage() {} func (*Mount) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{4} } func (m *Mount) GetContainerPath() string { if m != nil { return m.ContainerPath } return "" } func (m *Mount) GetHostPath() string { if m != nil { return m.HostPath } return "" } func (m *Mount) GetReadonly() bool { if m != nil { return m.Readonly } return false } func (m *Mount) GetSelinuxRelabel() bool { if m != nil { return m.SelinuxRelabel } return false } func (m *Mount) GetPropagation() MountPropagation { if m != nil { return m.Propagation } return MountPropagation_PROPAGATION_PRIVATE } // NamespaceOption provides options for Linux namespaces. type NamespaceOption struct { // If set, use the host's network namespace. HostNetwork bool `protobuf:"varint,1,opt,name=host_network,json=hostNetwork,proto3" json:"host_network,omitempty"` // If set, use the host's PID namespace. HostPid bool `protobuf:"varint,2,opt,name=host_pid,json=hostPid,proto3" json:"host_pid,omitempty"` // If set, use the host's IPC namespace. HostIpc bool `protobuf:"varint,3,opt,name=host_ipc,json=hostIpc,proto3" json:"host_ipc,omitempty"` } func (m *NamespaceOption) Reset() { *m = NamespaceOption{} } func (*NamespaceOption) ProtoMessage() {} func (*NamespaceOption) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{5} } func (m *NamespaceOption) GetHostNetwork() bool { if m != nil { return m.HostNetwork } return false } func (m *NamespaceOption) GetHostPid() bool { if m != nil { return m.HostPid } return false } func (m *NamespaceOption) GetHostIpc() bool { if m != nil { return m.HostIpc } return false } // Int64Value is the wrapper of int64. type Int64Value struct { // The value. Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *Int64Value) Reset() { *m = Int64Value{} } func (*Int64Value) ProtoMessage() {} func (*Int64Value) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{6} } func (m *Int64Value) GetValue() int64 { if m != nil { return m.Value } return 0 } // LinuxSandboxSecurityContext holds linux security configuration that will be // applied to a sandbox. Note that: // 1) It does not apply to containers in the pods. // 2) It may not be applicable to a PodSandbox which does not contain any running // process. type LinuxSandboxSecurityContext struct { // Configurations for the sandbox's namespaces. // This will be used only if the PodSandbox uses namespace for isolation. NamespaceOptions *NamespaceOption `protobuf:"bytes,1,opt,name=namespace_options,json=namespaceOptions" json:"namespace_options,omitempty"` // Optional SELinux context to be applied. SelinuxOptions *SELinuxOption `protobuf:"bytes,2,opt,name=selinux_options,json=selinuxOptions" json:"selinux_options,omitempty"` // UID to run sandbox processes as, when applicable. RunAsUser *Int64Value `protobuf:"bytes,3,opt,name=run_as_user,json=runAsUser" json:"run_as_user,omitempty"` // If set, the root filesystem of the sandbox is read-only. ReadonlyRootfs bool `protobuf:"varint,4,opt,name=readonly_rootfs,json=readonlyRootfs,proto3" json:"readonly_rootfs,omitempty"` // List of groups applied to the first process run in the sandbox, in // addition to the sandbox's primary GID. SupplementalGroups []int64 `protobuf:"varint,5,rep,packed,name=supplemental_groups,json=supplementalGroups" json:"supplemental_groups,omitempty"` // Indicates whether the sandbox will be asked to run a privileged // container. If a privileged container is to be executed within it, this // MUST be true. // This allows a sandbox to take additional security precautions if no // privileged containers are expected to be run. Privileged bool `protobuf:"varint,6,opt,name=privileged,proto3" json:"privileged,omitempty"` // Seccomp profile for the sandbox, candidate values are: // * docker/default: the default profile for the docker container runtime // * unconfined: unconfined profile, ie, no seccomp sandboxing // * localhost/: the profile installed on the node. // is the full path of the profile. // Default: "", which is identical with unconfined. SeccompProfilePath string `protobuf:"bytes,7,opt,name=seccomp_profile_path,json=seccompProfilePath,proto3" json:"seccomp_profile_path,omitempty"` } func (m *LinuxSandboxSecurityContext) Reset() { *m = LinuxSandboxSecurityContext{} } func (*LinuxSandboxSecurityContext) ProtoMessage() {} func (*LinuxSandboxSecurityContext) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{7} } func (m *LinuxSandboxSecurityContext) GetNamespaceOptions() *NamespaceOption { if m != nil { return m.NamespaceOptions } return nil } func (m *LinuxSandboxSecurityContext) GetSelinuxOptions() *SELinuxOption { if m != nil { return m.SelinuxOptions } return nil } func (m *LinuxSandboxSecurityContext) GetRunAsUser() *Int64Value { if m != nil { return m.RunAsUser } return nil } func (m *LinuxSandboxSecurityContext) GetReadonlyRootfs() bool { if m != nil { return m.ReadonlyRootfs } return false } func (m *LinuxSandboxSecurityContext) GetSupplementalGroups() []int64 { if m != nil { return m.SupplementalGroups } return nil } func (m *LinuxSandboxSecurityContext) GetPrivileged() bool { if m != nil { return m.Privileged } return false } func (m *LinuxSandboxSecurityContext) GetSeccompProfilePath() string { if m != nil { return m.SeccompProfilePath } return "" } // LinuxPodSandboxConfig holds platform-specific configurations for Linux // host platforms and Linux-based containers. type LinuxPodSandboxConfig struct { // Parent cgroup of the PodSandbox. // The cgroupfs style syntax will be used, but the container runtime can // convert it to systemd semantics if needed. CgroupParent string `protobuf:"bytes,1,opt,name=cgroup_parent,json=cgroupParent,proto3" json:"cgroup_parent,omitempty"` // LinuxSandboxSecurityContext holds sandbox security attributes. SecurityContext *LinuxSandboxSecurityContext `protobuf:"bytes,2,opt,name=security_context,json=securityContext" json:"security_context,omitempty"` // Sysctls holds linux sysctls config for the sandbox. Sysctls map[string]string `protobuf:"bytes,3,rep,name=sysctls" json:"sysctls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *LinuxPodSandboxConfig) Reset() { *m = LinuxPodSandboxConfig{} } func (*LinuxPodSandboxConfig) ProtoMessage() {} func (*LinuxPodSandboxConfig) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{8} } func (m *LinuxPodSandboxConfig) GetCgroupParent() string { if m != nil { return m.CgroupParent } return "" } func (m *LinuxPodSandboxConfig) GetSecurityContext() *LinuxSandboxSecurityContext { if m != nil { return m.SecurityContext } return nil } func (m *LinuxPodSandboxConfig) GetSysctls() map[string]string { if m != nil { return m.Sysctls } return nil } // PodSandboxMetadata holds all necessary information for building the sandbox name. // The container runtime is encouraged to expose the metadata associated with the // PodSandbox in its user interface for better user experience. For example, // the runtime can construct a unique PodSandboxName based on the metadata. type PodSandboxMetadata struct { // Pod name of the sandbox. Same as the pod name in the PodSpec. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Pod UID of the sandbox. Same as the pod UID in the PodSpec. Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // Pod namespace of the sandbox. Same as the pod namespace in the PodSpec. Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` // Attempt number of creating the sandbox. Default: 0. Attempt uint32 `protobuf:"varint,4,opt,name=attempt,proto3" json:"attempt,omitempty"` } func (m *PodSandboxMetadata) Reset() { *m = PodSandboxMetadata{} } func (*PodSandboxMetadata) ProtoMessage() {} func (*PodSandboxMetadata) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{9} } func (m *PodSandboxMetadata) GetName() string { if m != nil { return m.Name } return "" } func (m *PodSandboxMetadata) GetUid() string { if m != nil { return m.Uid } return "" } func (m *PodSandboxMetadata) GetNamespace() string { if m != nil { return m.Namespace } return "" } func (m *PodSandboxMetadata) GetAttempt() uint32 { if m != nil { return m.Attempt } return 0 } // PodSandboxConfig holds all the required and optional fields for creating a // sandbox. type PodSandboxConfig struct { // Metadata of the sandbox. This information will uniquely identify the // sandbox, and the runtime should leverage this to ensure correct // operation. The runtime may also use this information to improve UX, such // as by constructing a readable name. Metadata *PodSandboxMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // Hostname of the sandbox. Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"` // Path to the directory on the host in which container log files are // stored. // By default the log of a container going into the LogDirectory will be // hooked up to STDOUT and STDERR. However, the LogDirectory may contain // binary log files with structured logging data from the individual // containers. For example, the files might be newline separated JSON // structured logs, systemd-journald journal files, gRPC trace files, etc. // E.g., // PodSandboxConfig.LogDirectory = `/var/log/pods//` // ContainerConfig.LogPath = `containerName_Instance#.log` // // WARNING: Log management and how kubelet should interface with the // container logs are under active discussion in // https://issues.k8s.io/24677. There *may* be future change of direction // for logging as the discussion carries on. LogDirectory string `protobuf:"bytes,3,opt,name=log_directory,json=logDirectory,proto3" json:"log_directory,omitempty"` // DNS config for the sandbox. DnsConfig *DNSConfig `protobuf:"bytes,4,opt,name=dns_config,json=dnsConfig" json:"dns_config,omitempty"` // Port mappings for the sandbox. PortMappings []*PortMapping `protobuf:"bytes,5,rep,name=port_mappings,json=portMappings" json:"port_mappings,omitempty"` // Key-value pairs that may be used to scope and select individual resources. Labels map[string]string `protobuf:"bytes,6,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map that may be set by the kubelet to store and // retrieve arbitrary metadata. This will include any annotations set on a // pod through the Kubernetes API. // // Annotations MUST NOT be altered by the runtime; the annotations stored // here MUST be returned in the PodSandboxStatus associated with the pod // this PodSandboxConfig creates. // // In general, in order to preserve a well-defined interface between the // kubelet and the container runtime, annotations SHOULD NOT influence // runtime behaviour. // // Annotations can also be useful for runtime authors to experiment with // new features that are opaque to the Kubernetes APIs (both user-facing // and the CRI). Whenever possible, however, runtime authors SHOULD // consider proposing new typed fields for any new features instead. Annotations map[string]string `protobuf:"bytes,7,rep,name=annotations" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Optional configurations specific to Linux hosts. Linux *LinuxPodSandboxConfig `protobuf:"bytes,8,opt,name=linux" json:"linux,omitempty"` } func (m *PodSandboxConfig) Reset() { *m = PodSandboxConfig{} } func (*PodSandboxConfig) ProtoMessage() {} func (*PodSandboxConfig) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{10} } func (m *PodSandboxConfig) GetMetadata() *PodSandboxMetadata { if m != nil { return m.Metadata } return nil } func (m *PodSandboxConfig) GetHostname() string { if m != nil { return m.Hostname } return "" } func (m *PodSandboxConfig) GetLogDirectory() string { if m != nil { return m.LogDirectory } return "" } func (m *PodSandboxConfig) GetDnsConfig() *DNSConfig { if m != nil { return m.DnsConfig } return nil } func (m *PodSandboxConfig) GetPortMappings() []*PortMapping { if m != nil { return m.PortMappings } return nil } func (m *PodSandboxConfig) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *PodSandboxConfig) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } func (m *PodSandboxConfig) GetLinux() *LinuxPodSandboxConfig { if m != nil { return m.Linux } return nil } type RunPodSandboxRequest struct { // Configuration for creating a PodSandbox. Config *PodSandboxConfig `protobuf:"bytes,1,opt,name=config" json:"config,omitempty"` } func (m *RunPodSandboxRequest) Reset() { *m = RunPodSandboxRequest{} } func (*RunPodSandboxRequest) ProtoMessage() {} func (*RunPodSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{11} } func (m *RunPodSandboxRequest) GetConfig() *PodSandboxConfig { if m != nil { return m.Config } return nil } type RunPodSandboxResponse struct { // ID of the PodSandbox to run. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` } func (m *RunPodSandboxResponse) Reset() { *m = RunPodSandboxResponse{} } func (*RunPodSandboxResponse) ProtoMessage() {} func (*RunPodSandboxResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{12} } func (m *RunPodSandboxResponse) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } type StopPodSandboxRequest struct { // ID of the PodSandbox to stop. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` } func (m *StopPodSandboxRequest) Reset() { *m = StopPodSandboxRequest{} } func (*StopPodSandboxRequest) ProtoMessage() {} func (*StopPodSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{13} } func (m *StopPodSandboxRequest) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } type StopPodSandboxResponse struct { } func (m *StopPodSandboxResponse) Reset() { *m = StopPodSandboxResponse{} } func (*StopPodSandboxResponse) ProtoMessage() {} func (*StopPodSandboxResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{14} } type RemovePodSandboxRequest struct { // ID of the PodSandbox to remove. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` } func (m *RemovePodSandboxRequest) Reset() { *m = RemovePodSandboxRequest{} } func (*RemovePodSandboxRequest) ProtoMessage() {} func (*RemovePodSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{15} } func (m *RemovePodSandboxRequest) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } type RemovePodSandboxResponse struct { } func (m *RemovePodSandboxResponse) Reset() { *m = RemovePodSandboxResponse{} } func (*RemovePodSandboxResponse) ProtoMessage() {} func (*RemovePodSandboxResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{16} } type PodSandboxStatusRequest struct { // ID of the PodSandbox for which to retrieve status. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // Verbose indicates whether to return extra information about the pod sandbox. Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"` } func (m *PodSandboxStatusRequest) Reset() { *m = PodSandboxStatusRequest{} } func (*PodSandboxStatusRequest) ProtoMessage() {} func (*PodSandboxStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{17} } func (m *PodSandboxStatusRequest) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *PodSandboxStatusRequest) GetVerbose() bool { if m != nil { return m.Verbose } return false } // PodSandboxNetworkStatus is the status of the network for a PodSandbox. type PodSandboxNetworkStatus struct { // IP address of the PodSandbox. Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` } func (m *PodSandboxNetworkStatus) Reset() { *m = PodSandboxNetworkStatus{} } func (*PodSandboxNetworkStatus) ProtoMessage() {} func (*PodSandboxNetworkStatus) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{18} } func (m *PodSandboxNetworkStatus) GetIp() string { if m != nil { return m.Ip } return "" } // Namespace contains paths to the namespaces. type Namespace struct { // Namespace options for Linux namespaces. Options *NamespaceOption `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` } func (m *Namespace) Reset() { *m = Namespace{} } func (*Namespace) ProtoMessage() {} func (*Namespace) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{19} } func (m *Namespace) GetOptions() *NamespaceOption { if m != nil { return m.Options } return nil } // LinuxSandboxStatus contains status specific to Linux sandboxes. type LinuxPodSandboxStatus struct { // Paths to the sandbox's namespaces. Namespaces *Namespace `protobuf:"bytes,1,opt,name=namespaces" json:"namespaces,omitempty"` } func (m *LinuxPodSandboxStatus) Reset() { *m = LinuxPodSandboxStatus{} } func (*LinuxPodSandboxStatus) ProtoMessage() {} func (*LinuxPodSandboxStatus) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{20} } func (m *LinuxPodSandboxStatus) GetNamespaces() *Namespace { if m != nil { return m.Namespaces } return nil } // PodSandboxStatus contains the status of the PodSandbox. type PodSandboxStatus struct { // ID of the sandbox. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Metadata of the sandbox. Metadata *PodSandboxMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata,omitempty"` // State of the sandbox. State PodSandboxState `protobuf:"varint,3,opt,name=state,proto3,enum=runtime.PodSandboxState" json:"state,omitempty"` // Creation timestamp of the sandbox in nanoseconds. Must be > 0. CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Network contains network status if network is handled by the runtime. Network *PodSandboxNetworkStatus `protobuf:"bytes,5,opt,name=network" json:"network,omitempty"` // Linux-specific status to a pod sandbox. Linux *LinuxPodSandboxStatus `protobuf:"bytes,6,opt,name=linux" json:"linux,omitempty"` // Labels are key-value pairs that may be used to scope and select individual resources. Labels map[string]string `protobuf:"bytes,7,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map holding arbitrary metadata. // Annotations MUST NOT be altered by the runtime; the value of this field // MUST be identical to that of the corresponding PodSandboxConfig used to // instantiate the pod sandbox this status represents. Annotations map[string]string `protobuf:"bytes,8,rep,name=annotations" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *PodSandboxStatus) Reset() { *m = PodSandboxStatus{} } func (*PodSandboxStatus) ProtoMessage() {} func (*PodSandboxStatus) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{21} } func (m *PodSandboxStatus) GetId() string { if m != nil { return m.Id } return "" } func (m *PodSandboxStatus) GetMetadata() *PodSandboxMetadata { if m != nil { return m.Metadata } return nil } func (m *PodSandboxStatus) GetState() PodSandboxState { if m != nil { return m.State } return PodSandboxState_SANDBOX_READY } func (m *PodSandboxStatus) GetCreatedAt() int64 { if m != nil { return m.CreatedAt } return 0 } func (m *PodSandboxStatus) GetNetwork() *PodSandboxNetworkStatus { if m != nil { return m.Network } return nil } func (m *PodSandboxStatus) GetLinux() *LinuxPodSandboxStatus { if m != nil { return m.Linux } return nil } func (m *PodSandboxStatus) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *PodSandboxStatus) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } type PodSandboxStatusResponse struct { // Status of the PodSandbox. Status *PodSandboxStatus `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"` // Info is extra information of the PodSandbox. The key could be abitrary string, and // value should be in json format. The information could include anything useful for // debug, e.g. network namespace for linux container based container runtime. // It should only be returned non-empty when Verbose is true. Info map[string]string `protobuf:"bytes,2,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *PodSandboxStatusResponse) Reset() { *m = PodSandboxStatusResponse{} } func (*PodSandboxStatusResponse) ProtoMessage() {} func (*PodSandboxStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{22} } func (m *PodSandboxStatusResponse) GetStatus() *PodSandboxStatus { if m != nil { return m.Status } return nil } func (m *PodSandboxStatusResponse) GetInfo() map[string]string { if m != nil { return m.Info } return nil } // PodSandboxStateValue is the wrapper of PodSandboxState. type PodSandboxStateValue struct { // State of the sandbox. State PodSandboxState `protobuf:"varint,1,opt,name=state,proto3,enum=runtime.PodSandboxState" json:"state,omitempty"` } func (m *PodSandboxStateValue) Reset() { *m = PodSandboxStateValue{} } func (*PodSandboxStateValue) ProtoMessage() {} func (*PodSandboxStateValue) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{23} } func (m *PodSandboxStateValue) GetState() PodSandboxState { if m != nil { return m.State } return PodSandboxState_SANDBOX_READY } // PodSandboxFilter is used to filter a list of PodSandboxes. // All those fields are combined with 'AND' type PodSandboxFilter struct { // ID of the sandbox. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // State of the sandbox. State *PodSandboxStateValue `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"` // LabelSelector to select matches. // Only api.MatchLabels is supported for now and the requirements // are ANDed. MatchExpressions is not supported yet. LabelSelector map[string]string `protobuf:"bytes,3,rep,name=label_selector,json=labelSelector" json:"label_selector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *PodSandboxFilter) Reset() { *m = PodSandboxFilter{} } func (*PodSandboxFilter) ProtoMessage() {} func (*PodSandboxFilter) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{24} } func (m *PodSandboxFilter) GetId() string { if m != nil { return m.Id } return "" } func (m *PodSandboxFilter) GetState() *PodSandboxStateValue { if m != nil { return m.State } return nil } func (m *PodSandboxFilter) GetLabelSelector() map[string]string { if m != nil { return m.LabelSelector } return nil } type ListPodSandboxRequest struct { // PodSandboxFilter to filter a list of PodSandboxes. Filter *PodSandboxFilter `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` } func (m *ListPodSandboxRequest) Reset() { *m = ListPodSandboxRequest{} } func (*ListPodSandboxRequest) ProtoMessage() {} func (*ListPodSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{25} } func (m *ListPodSandboxRequest) GetFilter() *PodSandboxFilter { if m != nil { return m.Filter } return nil } // PodSandbox contains minimal information about a sandbox. type PodSandbox struct { // ID of the PodSandbox. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Metadata of the PodSandbox. Metadata *PodSandboxMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata,omitempty"` // State of the PodSandbox. State PodSandboxState `protobuf:"varint,3,opt,name=state,proto3,enum=runtime.PodSandboxState" json:"state,omitempty"` // Creation timestamps of the PodSandbox in nanoseconds. Must be > 0. CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Labels of the PodSandbox. Labels map[string]string `protobuf:"bytes,5,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map holding arbitrary metadata. // Annotations MUST NOT be altered by the runtime; the value of this field // MUST be identical to that of the corresponding PodSandboxConfig used to // instantiate this PodSandbox. Annotations map[string]string `protobuf:"bytes,6,rep,name=annotations" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *PodSandbox) Reset() { *m = PodSandbox{} } func (*PodSandbox) ProtoMessage() {} func (*PodSandbox) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{26} } func (m *PodSandbox) GetId() string { if m != nil { return m.Id } return "" } func (m *PodSandbox) GetMetadata() *PodSandboxMetadata { if m != nil { return m.Metadata } return nil } func (m *PodSandbox) GetState() PodSandboxState { if m != nil { return m.State } return PodSandboxState_SANDBOX_READY } func (m *PodSandbox) GetCreatedAt() int64 { if m != nil { return m.CreatedAt } return 0 } func (m *PodSandbox) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *PodSandbox) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } type ListPodSandboxResponse struct { // List of PodSandboxes. Items []*PodSandbox `protobuf:"bytes,1,rep,name=items" json:"items,omitempty"` } func (m *ListPodSandboxResponse) Reset() { *m = ListPodSandboxResponse{} } func (*ListPodSandboxResponse) ProtoMessage() {} func (*ListPodSandboxResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{27} } func (m *ListPodSandboxResponse) GetItems() []*PodSandbox { if m != nil { return m.Items } return nil } // ImageSpec is an internal representation of an image. Currently, it wraps the // value of a Container's Image field (e.g. imageID or imageDigest), but in the // future it will include more detailed information about the different image types. type ImageSpec struct { Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` } func (m *ImageSpec) Reset() { *m = ImageSpec{} } func (*ImageSpec) ProtoMessage() {} func (*ImageSpec) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{28} } func (m *ImageSpec) GetImage() string { if m != nil { return m.Image } return "" } type KeyValue struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` } func (m *KeyValue) Reset() { *m = KeyValue{} } func (*KeyValue) ProtoMessage() {} func (*KeyValue) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{29} } func (m *KeyValue) GetKey() string { if m != nil { return m.Key } return "" } func (m *KeyValue) GetValue() string { if m != nil { return m.Value } return "" } // LinuxContainerResources specifies Linux specific configuration for // resources. // TODO: Consider using Resources from opencontainers/runtime-spec/specs-go // directly. type LinuxContainerResources struct { // CPU CFS (Completely Fair Scheduler) period. Default: 0 (not specified). CpuPeriod int64 `protobuf:"varint,1,opt,name=cpu_period,json=cpuPeriod,proto3" json:"cpu_period,omitempty"` // CPU CFS (Completely Fair Scheduler) quota. Default: 0 (not specified). CpuQuota int64 `protobuf:"varint,2,opt,name=cpu_quota,json=cpuQuota,proto3" json:"cpu_quota,omitempty"` // CPU shares (relative weight vs. other containers). Default: 0 (not specified). CpuShares int64 `protobuf:"varint,3,opt,name=cpu_shares,json=cpuShares,proto3" json:"cpu_shares,omitempty"` // Memory limit in bytes. Default: 0 (not specified). MemoryLimitInBytes int64 `protobuf:"varint,4,opt,name=memory_limit_in_bytes,json=memoryLimitInBytes,proto3" json:"memory_limit_in_bytes,omitempty"` // OOMScoreAdj adjusts the oom-killer score. Default: 0 (not specified). OomScoreAdj int64 `protobuf:"varint,5,opt,name=oom_score_adj,json=oomScoreAdj,proto3" json:"oom_score_adj,omitempty"` // CpusetCpus constrains the allowed set of logical CPUs. Default: "" (not specified). CpusetCpus string `protobuf:"bytes,6,opt,name=cpuset_cpus,json=cpusetCpus,proto3" json:"cpuset_cpus,omitempty"` // CpusetMems constrains the allowed set of memory nodes. Default: "" (not specified). CpusetMems string `protobuf:"bytes,7,opt,name=cpuset_mems,json=cpusetMems,proto3" json:"cpuset_mems,omitempty"` } func (m *LinuxContainerResources) Reset() { *m = LinuxContainerResources{} } func (*LinuxContainerResources) ProtoMessage() {} func (*LinuxContainerResources) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{30} } func (m *LinuxContainerResources) GetCpuPeriod() int64 { if m != nil { return m.CpuPeriod } return 0 } func (m *LinuxContainerResources) GetCpuQuota() int64 { if m != nil { return m.CpuQuota } return 0 } func (m *LinuxContainerResources) GetCpuShares() int64 { if m != nil { return m.CpuShares } return 0 } func (m *LinuxContainerResources) GetMemoryLimitInBytes() int64 { if m != nil { return m.MemoryLimitInBytes } return 0 } func (m *LinuxContainerResources) GetOomScoreAdj() int64 { if m != nil { return m.OomScoreAdj } return 0 } func (m *LinuxContainerResources) GetCpusetCpus() string { if m != nil { return m.CpusetCpus } return "" } func (m *LinuxContainerResources) GetCpusetMems() string { if m != nil { return m.CpusetMems } return "" } // SELinuxOption are the labels to be applied to the container. type SELinuxOption struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` Level string `protobuf:"bytes,4,opt,name=level,proto3" json:"level,omitempty"` } func (m *SELinuxOption) Reset() { *m = SELinuxOption{} } func (*SELinuxOption) ProtoMessage() {} func (*SELinuxOption) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{31} } func (m *SELinuxOption) GetUser() string { if m != nil { return m.User } return "" } func (m *SELinuxOption) GetRole() string { if m != nil { return m.Role } return "" } func (m *SELinuxOption) GetType() string { if m != nil { return m.Type } return "" } func (m *SELinuxOption) GetLevel() string { if m != nil { return m.Level } return "" } // Capability contains the container capabilities to add or drop type Capability struct { // List of capabilities to add. AddCapabilities []string `protobuf:"bytes,1,rep,name=add_capabilities,json=addCapabilities" json:"add_capabilities,omitempty"` // List of capabilities to drop. DropCapabilities []string `protobuf:"bytes,2,rep,name=drop_capabilities,json=dropCapabilities" json:"drop_capabilities,omitempty"` } func (m *Capability) Reset() { *m = Capability{} } func (*Capability) ProtoMessage() {} func (*Capability) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{32} } func (m *Capability) GetAddCapabilities() []string { if m != nil { return m.AddCapabilities } return nil } func (m *Capability) GetDropCapabilities() []string { if m != nil { return m.DropCapabilities } return nil } // LinuxContainerSecurityContext holds linux security configuration that will be applied to a container. type LinuxContainerSecurityContext struct { // Capabilities to add or drop. Capabilities *Capability `protobuf:"bytes,1,opt,name=capabilities" json:"capabilities,omitempty"` // If set, run container in privileged mode. // Privileged mode is incompatible with the following options. If // privileged is set, the following features MAY have no effect: // 1. capabilities // 2. selinux_options // 4. seccomp // 5. apparmor // // Privileged mode implies the following specific options are applied: // 1. All capabilities are added. // 2. Sensitive paths, such as kernel module paths within sysfs, are not masked. // 3. Any sysfs and procfs mounts are mounted RW. // 4. Apparmor confinement is not applied. // 5. Seccomp restrictions are not applied. // 6. The device cgroup does not restrict access to any devices. // 7. All devices from the host's /dev are available within the container. // 8. SELinux restrictions are not applied (e.g. label=disabled). Privileged bool `protobuf:"varint,2,opt,name=privileged,proto3" json:"privileged,omitempty"` // Configurations for the container's namespaces. // Only used if the container uses namespace for isolation. NamespaceOptions *NamespaceOption `protobuf:"bytes,3,opt,name=namespace_options,json=namespaceOptions" json:"namespace_options,omitempty"` // SELinux context to be optionally applied. SelinuxOptions *SELinuxOption `protobuf:"bytes,4,opt,name=selinux_options,json=selinuxOptions" json:"selinux_options,omitempty"` // UID to run the container process as. Only one of run_as_user and // run_as_username can be specified at a time. RunAsUser *Int64Value `protobuf:"bytes,5,opt,name=run_as_user,json=runAsUser" json:"run_as_user,omitempty"` // User name to run the container process as. If specified, the user MUST // exist in the container image (i.e. in the /etc/passwd inside the image), // and be resolved there by the runtime; otherwise, the runtime MUST error. RunAsUsername string `protobuf:"bytes,6,opt,name=run_as_username,json=runAsUsername,proto3" json:"run_as_username,omitempty"` // If set, the root filesystem of the container is read-only. ReadonlyRootfs bool `protobuf:"varint,7,opt,name=readonly_rootfs,json=readonlyRootfs,proto3" json:"readonly_rootfs,omitempty"` // List of groups applied to the first process run in the container, in // addition to the container's primary GID. SupplementalGroups []int64 `protobuf:"varint,8,rep,packed,name=supplemental_groups,json=supplementalGroups" json:"supplemental_groups,omitempty"` // AppArmor profile for the container, candidate values are: // * runtime/default: equivalent to not specifying a profile. // * unconfined: no profiles are loaded // * localhost/: profile loaded on the node // (localhost) by name. The possible profile names are detailed at // http://wiki.apparmor.net/index.php/AppArmor_Core_Policy_Reference ApparmorProfile string `protobuf:"bytes,9,opt,name=apparmor_profile,json=apparmorProfile,proto3" json:"apparmor_profile,omitempty"` // Seccomp profile for the container, candidate values are: // * docker/default: the default profile for the docker container runtime // * unconfined: unconfined profile, ie, no seccomp sandboxing // * localhost/: the profile installed on the node. // is the full path of the profile. // Default: "", which is identical with unconfined. SeccompProfilePath string `protobuf:"bytes,10,opt,name=seccomp_profile_path,json=seccompProfilePath,proto3" json:"seccomp_profile_path,omitempty"` // no_new_privs defines if the flag for no_new_privs should be set on the // container. NoNewPrivs bool `protobuf:"varint,11,opt,name=no_new_privs,json=noNewPrivs,proto3" json:"no_new_privs,omitempty"` } func (m *LinuxContainerSecurityContext) Reset() { *m = LinuxContainerSecurityContext{} } func (*LinuxContainerSecurityContext) ProtoMessage() {} func (*LinuxContainerSecurityContext) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{33} } func (m *LinuxContainerSecurityContext) GetCapabilities() *Capability { if m != nil { return m.Capabilities } return nil } func (m *LinuxContainerSecurityContext) GetPrivileged() bool { if m != nil { return m.Privileged } return false } func (m *LinuxContainerSecurityContext) GetNamespaceOptions() *NamespaceOption { if m != nil { return m.NamespaceOptions } return nil } func (m *LinuxContainerSecurityContext) GetSelinuxOptions() *SELinuxOption { if m != nil { return m.SelinuxOptions } return nil } func (m *LinuxContainerSecurityContext) GetRunAsUser() *Int64Value { if m != nil { return m.RunAsUser } return nil } func (m *LinuxContainerSecurityContext) GetRunAsUsername() string { if m != nil { return m.RunAsUsername } return "" } func (m *LinuxContainerSecurityContext) GetReadonlyRootfs() bool { if m != nil { return m.ReadonlyRootfs } return false } func (m *LinuxContainerSecurityContext) GetSupplementalGroups() []int64 { if m != nil { return m.SupplementalGroups } return nil } func (m *LinuxContainerSecurityContext) GetApparmorProfile() string { if m != nil { return m.ApparmorProfile } return "" } func (m *LinuxContainerSecurityContext) GetSeccompProfilePath() string { if m != nil { return m.SeccompProfilePath } return "" } func (m *LinuxContainerSecurityContext) GetNoNewPrivs() bool { if m != nil { return m.NoNewPrivs } return false } // LinuxContainerConfig contains platform-specific configuration for // Linux-based containers. type LinuxContainerConfig struct { // Resources specification for the container. Resources *LinuxContainerResources `protobuf:"bytes,1,opt,name=resources" json:"resources,omitempty"` // LinuxContainerSecurityContext configuration for the container. SecurityContext *LinuxContainerSecurityContext `protobuf:"bytes,2,opt,name=security_context,json=securityContext" json:"security_context,omitempty"` } func (m *LinuxContainerConfig) Reset() { *m = LinuxContainerConfig{} } func (*LinuxContainerConfig) ProtoMessage() {} func (*LinuxContainerConfig) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{34} } func (m *LinuxContainerConfig) GetResources() *LinuxContainerResources { if m != nil { return m.Resources } return nil } func (m *LinuxContainerConfig) GetSecurityContext() *LinuxContainerSecurityContext { if m != nil { return m.SecurityContext } return nil } // ContainerMetadata holds all necessary information for building the container // name. The container runtime is encouraged to expose the metadata in its user // interface for better user experience. E.g., runtime can construct a unique // container name based on the metadata. Note that (name, attempt) is unique // within a sandbox for the entire lifetime of the sandbox. type ContainerMetadata struct { // Name of the container. Same as the container name in the PodSpec. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Attempt number of creating the container. Default: 0. Attempt uint32 `protobuf:"varint,2,opt,name=attempt,proto3" json:"attempt,omitempty"` } func (m *ContainerMetadata) Reset() { *m = ContainerMetadata{} } func (*ContainerMetadata) ProtoMessage() {} func (*ContainerMetadata) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{35} } func (m *ContainerMetadata) GetName() string { if m != nil { return m.Name } return "" } func (m *ContainerMetadata) GetAttempt() uint32 { if m != nil { return m.Attempt } return 0 } // Device specifies a host device to mount into a container. type Device struct { // Path of the device within the container. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"` // Path of the device on the host. HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` // Cgroups permissions of the device, candidates are one or more of // * r - allows container to read from the specified device. // * w - allows container to write to the specified device. // * m - allows container to create device files that do not yet exist. Permissions string `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"` } func (m *Device) Reset() { *m = Device{} } func (*Device) ProtoMessage() {} func (*Device) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{36} } func (m *Device) GetContainerPath() string { if m != nil { return m.ContainerPath } return "" } func (m *Device) GetHostPath() string { if m != nil { return m.HostPath } return "" } func (m *Device) GetPermissions() string { if m != nil { return m.Permissions } return "" } // ContainerConfig holds all the required and optional fields for creating a // container. type ContainerConfig struct { // Metadata of the container. This information will uniquely identify the // container, and the runtime should leverage this to ensure correct // operation. The runtime may also use this information to improve UX, such // as by constructing a readable name. Metadata *ContainerMetadata `protobuf:"bytes,1,opt,name=metadata" json:"metadata,omitempty"` // Image to use. Image *ImageSpec `protobuf:"bytes,2,opt,name=image" json:"image,omitempty"` // Command to execute (i.e., entrypoint for docker) Command []string `protobuf:"bytes,3,rep,name=command" json:"command,omitempty"` // Args for the Command (i.e., command for docker) Args []string `protobuf:"bytes,4,rep,name=args" json:"args,omitempty"` // Current working directory of the command. WorkingDir string `protobuf:"bytes,5,opt,name=working_dir,json=workingDir,proto3" json:"working_dir,omitempty"` // List of environment variable to set in the container. Envs []*KeyValue `protobuf:"bytes,6,rep,name=envs" json:"envs,omitempty"` // Mounts for the container. Mounts []*Mount `protobuf:"bytes,7,rep,name=mounts" json:"mounts,omitempty"` // Devices for the container. Devices []*Device `protobuf:"bytes,8,rep,name=devices" json:"devices,omitempty"` // Key-value pairs that may be used to scope and select individual resources. // Label keys are of the form: // label-key ::= prefixed-name | name // prefixed-name ::= prefix '/' name // prefix ::= DNS_SUBDOMAIN // name ::= DNS_LABEL Labels map[string]string `protobuf:"bytes,9,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map that may be used by the kubelet to store and // retrieve arbitrary metadata. // // Annotations MUST NOT be altered by the runtime; the annotations stored // here MUST be returned in the ContainerStatus associated with the container // this ContainerConfig creates. // // In general, in order to preserve a well-defined interface between the // kubelet and the container runtime, annotations SHOULD NOT influence // runtime behaviour. Annotations map[string]string `protobuf:"bytes,10,rep,name=annotations" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Path relative to PodSandboxConfig.LogDirectory for container to store // the log (STDOUT and STDERR) on the host. // E.g., // PodSandboxConfig.LogDirectory = `/var/log/pods//` // ContainerConfig.LogPath = `containerName_Instance#.log` // // WARNING: Log management and how kubelet should interface with the // container logs are under active discussion in // https://issues.k8s.io/24677. There *may* be future change of direction // for logging as the discussion carries on. LogPath string `protobuf:"bytes,11,opt,name=log_path,json=logPath,proto3" json:"log_path,omitempty"` // Variables for interactive containers, these have very specialized // use-cases (e.g. debugging). // TODO: Determine if we need to continue supporting these fields that are // part of Kubernetes's Container Spec. Stdin bool `protobuf:"varint,12,opt,name=stdin,proto3" json:"stdin,omitempty"` StdinOnce bool `protobuf:"varint,13,opt,name=stdin_once,json=stdinOnce,proto3" json:"stdin_once,omitempty"` Tty bool `protobuf:"varint,14,opt,name=tty,proto3" json:"tty,omitempty"` // Configuration specific to Linux containers. Linux *LinuxContainerConfig `protobuf:"bytes,15,opt,name=linux" json:"linux,omitempty"` } func (m *ContainerConfig) Reset() { *m = ContainerConfig{} } func (*ContainerConfig) ProtoMessage() {} func (*ContainerConfig) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{37} } func (m *ContainerConfig) GetMetadata() *ContainerMetadata { if m != nil { return m.Metadata } return nil } func (m *ContainerConfig) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } func (m *ContainerConfig) GetCommand() []string { if m != nil { return m.Command } return nil } func (m *ContainerConfig) GetArgs() []string { if m != nil { return m.Args } return nil } func (m *ContainerConfig) GetWorkingDir() string { if m != nil { return m.WorkingDir } return "" } func (m *ContainerConfig) GetEnvs() []*KeyValue { if m != nil { return m.Envs } return nil } func (m *ContainerConfig) GetMounts() []*Mount { if m != nil { return m.Mounts } return nil } func (m *ContainerConfig) GetDevices() []*Device { if m != nil { return m.Devices } return nil } func (m *ContainerConfig) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *ContainerConfig) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } func (m *ContainerConfig) GetLogPath() string { if m != nil { return m.LogPath } return "" } func (m *ContainerConfig) GetStdin() bool { if m != nil { return m.Stdin } return false } func (m *ContainerConfig) GetStdinOnce() bool { if m != nil { return m.StdinOnce } return false } func (m *ContainerConfig) GetTty() bool { if m != nil { return m.Tty } return false } func (m *ContainerConfig) GetLinux() *LinuxContainerConfig { if m != nil { return m.Linux } return nil } type CreateContainerRequest struct { // ID of the PodSandbox in which the container should be created. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // Config of the container. Config *ContainerConfig `protobuf:"bytes,2,opt,name=config" json:"config,omitempty"` // Config of the PodSandbox. This is the same config that was passed // to RunPodSandboxRequest to create the PodSandbox. It is passed again // here just for easy reference. The PodSandboxConfig is immutable and // remains the same throughout the lifetime of the pod. SandboxConfig *PodSandboxConfig `protobuf:"bytes,3,opt,name=sandbox_config,json=sandboxConfig" json:"sandbox_config,omitempty"` } func (m *CreateContainerRequest) Reset() { *m = CreateContainerRequest{} } func (*CreateContainerRequest) ProtoMessage() {} func (*CreateContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{38} } func (m *CreateContainerRequest) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *CreateContainerRequest) GetConfig() *ContainerConfig { if m != nil { return m.Config } return nil } func (m *CreateContainerRequest) GetSandboxConfig() *PodSandboxConfig { if m != nil { return m.SandboxConfig } return nil } type CreateContainerResponse struct { // ID of the created container. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` } func (m *CreateContainerResponse) Reset() { *m = CreateContainerResponse{} } func (*CreateContainerResponse) ProtoMessage() {} func (*CreateContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{39} } func (m *CreateContainerResponse) GetContainerId() string { if m != nil { return m.ContainerId } return "" } type StartContainerRequest struct { // ID of the container to start. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` } func (m *StartContainerRequest) Reset() { *m = StartContainerRequest{} } func (*StartContainerRequest) ProtoMessage() {} func (*StartContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{40} } func (m *StartContainerRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } type StartContainerResponse struct { } func (m *StartContainerResponse) Reset() { *m = StartContainerResponse{} } func (*StartContainerResponse) ProtoMessage() {} func (*StartContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{41} } type StopContainerRequest struct { // ID of the container to stop. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Timeout in seconds to wait for the container to stop before forcibly // terminating it. Default: 0 (forcibly terminate the container immediately) Timeout int64 `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (m *StopContainerRequest) Reset() { *m = StopContainerRequest{} } func (*StopContainerRequest) ProtoMessage() {} func (*StopContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{42} } func (m *StopContainerRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *StopContainerRequest) GetTimeout() int64 { if m != nil { return m.Timeout } return 0 } type StopContainerResponse struct { } func (m *StopContainerResponse) Reset() { *m = StopContainerResponse{} } func (*StopContainerResponse) ProtoMessage() {} func (*StopContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{43} } type RemoveContainerRequest struct { // ID of the container to remove. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` } func (m *RemoveContainerRequest) Reset() { *m = RemoveContainerRequest{} } func (*RemoveContainerRequest) ProtoMessage() {} func (*RemoveContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{44} } func (m *RemoveContainerRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } type RemoveContainerResponse struct { } func (m *RemoveContainerResponse) Reset() { *m = RemoveContainerResponse{} } func (*RemoveContainerResponse) ProtoMessage() {} func (*RemoveContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{45} } // ContainerStateValue is the wrapper of ContainerState. type ContainerStateValue struct { // State of the container. State ContainerState `protobuf:"varint,1,opt,name=state,proto3,enum=runtime.ContainerState" json:"state,omitempty"` } func (m *ContainerStateValue) Reset() { *m = ContainerStateValue{} } func (*ContainerStateValue) ProtoMessage() {} func (*ContainerStateValue) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{46} } func (m *ContainerStateValue) GetState() ContainerState { if m != nil { return m.State } return ContainerState_CONTAINER_CREATED } // ContainerFilter is used to filter containers. // All those fields are combined with 'AND' type ContainerFilter struct { // ID of the container. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // State of the container. State *ContainerStateValue `protobuf:"bytes,2,opt,name=state" json:"state,omitempty"` // ID of the PodSandbox. PodSandboxId string `protobuf:"bytes,3,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // LabelSelector to select matches. // Only api.MatchLabels is supported for now and the requirements // are ANDed. MatchExpressions is not supported yet. LabelSelector map[string]string `protobuf:"bytes,4,rep,name=label_selector,json=labelSelector" json:"label_selector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *ContainerFilter) Reset() { *m = ContainerFilter{} } func (*ContainerFilter) ProtoMessage() {} func (*ContainerFilter) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{47} } func (m *ContainerFilter) GetId() string { if m != nil { return m.Id } return "" } func (m *ContainerFilter) GetState() *ContainerStateValue { if m != nil { return m.State } return nil } func (m *ContainerFilter) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *ContainerFilter) GetLabelSelector() map[string]string { if m != nil { return m.LabelSelector } return nil } type ListContainersRequest struct { Filter *ContainerFilter `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` } func (m *ListContainersRequest) Reset() { *m = ListContainersRequest{} } func (*ListContainersRequest) ProtoMessage() {} func (*ListContainersRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{48} } func (m *ListContainersRequest) GetFilter() *ContainerFilter { if m != nil { return m.Filter } return nil } // Container provides the runtime information for a container, such as ID, hash, // state of the container. type Container struct { // ID of the container, used by the container runtime to identify // a container. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // ID of the sandbox to which this container belongs. PodSandboxId string `protobuf:"bytes,2,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // Metadata of the container. Metadata *ContainerMetadata `protobuf:"bytes,3,opt,name=metadata" json:"metadata,omitempty"` // Spec of the image. Image *ImageSpec `protobuf:"bytes,4,opt,name=image" json:"image,omitempty"` // Reference to the image in use. For most runtimes, this should be an // image ID. ImageRef string `protobuf:"bytes,5,opt,name=image_ref,json=imageRef,proto3" json:"image_ref,omitempty"` // State of the container. State ContainerState `protobuf:"varint,6,opt,name=state,proto3,enum=runtime.ContainerState" json:"state,omitempty"` // Creation time of the container in nanoseconds. CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Key-value pairs that may be used to scope and select individual resources. Labels map[string]string `protobuf:"bytes,8,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map holding arbitrary metadata. // Annotations MUST NOT be altered by the runtime; the value of this field // MUST be identical to that of the corresponding ContainerConfig used to // instantiate this Container. Annotations map[string]string `protobuf:"bytes,9,rep,name=annotations" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *Container) Reset() { *m = Container{} } func (*Container) ProtoMessage() {} func (*Container) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{49} } func (m *Container) GetId() string { if m != nil { return m.Id } return "" } func (m *Container) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *Container) GetMetadata() *ContainerMetadata { if m != nil { return m.Metadata } return nil } func (m *Container) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } func (m *Container) GetImageRef() string { if m != nil { return m.ImageRef } return "" } func (m *Container) GetState() ContainerState { if m != nil { return m.State } return ContainerState_CONTAINER_CREATED } func (m *Container) GetCreatedAt() int64 { if m != nil { return m.CreatedAt } return 0 } func (m *Container) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *Container) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } type ListContainersResponse struct { // List of containers. Containers []*Container `protobuf:"bytes,1,rep,name=containers" json:"containers,omitempty"` } func (m *ListContainersResponse) Reset() { *m = ListContainersResponse{} } func (*ListContainersResponse) ProtoMessage() {} func (*ListContainersResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{50} } func (m *ListContainersResponse) GetContainers() []*Container { if m != nil { return m.Containers } return nil } type ContainerStatusRequest struct { // ID of the container for which to retrieve status. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Verbose indicates whether to return extra information about the container. Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"` } func (m *ContainerStatusRequest) Reset() { *m = ContainerStatusRequest{} } func (*ContainerStatusRequest) ProtoMessage() {} func (*ContainerStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{51} } func (m *ContainerStatusRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *ContainerStatusRequest) GetVerbose() bool { if m != nil { return m.Verbose } return false } // ContainerStatus represents the status of a container. type ContainerStatus struct { // ID of the container. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Metadata of the container. Metadata *ContainerMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata,omitempty"` // Status of the container. State ContainerState `protobuf:"varint,3,opt,name=state,proto3,enum=runtime.ContainerState" json:"state,omitempty"` // Creation time of the container in nanoseconds. CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Start time of the container in nanoseconds. Default: 0 (not specified). StartedAt int64 `protobuf:"varint,5,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` // Finish time of the container in nanoseconds. Default: 0 (not specified). FinishedAt int64 `protobuf:"varint,6,opt,name=finished_at,json=finishedAt,proto3" json:"finished_at,omitempty"` // Exit code of the container. Only required when finished_at != 0. Default: 0. ExitCode int32 `protobuf:"varint,7,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` // Spec of the image. Image *ImageSpec `protobuf:"bytes,8,opt,name=image" json:"image,omitempty"` // Reference to the image in use. For most runtimes, this should be an // image ID ImageRef string `protobuf:"bytes,9,opt,name=image_ref,json=imageRef,proto3" json:"image_ref,omitempty"` // Brief CamelCase string explaining why container is in its current state. Reason string `protobuf:"bytes,10,opt,name=reason,proto3" json:"reason,omitempty"` // Human-readable message indicating details about why container is in its // current state. Message string `protobuf:"bytes,11,opt,name=message,proto3" json:"message,omitempty"` // Key-value pairs that may be used to scope and select individual resources. Labels map[string]string `protobuf:"bytes,12,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map holding arbitrary metadata. // Annotations MUST NOT be altered by the runtime; the value of this field // MUST be identical to that of the corresponding ContainerConfig used to // instantiate the Container this status represents. Annotations map[string]string `protobuf:"bytes,13,rep,name=annotations" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Mounts for the container. Mounts []*Mount `protobuf:"bytes,14,rep,name=mounts" json:"mounts,omitempty"` // Log path of container. LogPath string `protobuf:"bytes,15,opt,name=log_path,json=logPath,proto3" json:"log_path,omitempty"` } func (m *ContainerStatus) Reset() { *m = ContainerStatus{} } func (*ContainerStatus) ProtoMessage() {} func (*ContainerStatus) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{52} } func (m *ContainerStatus) GetId() string { if m != nil { return m.Id } return "" } func (m *ContainerStatus) GetMetadata() *ContainerMetadata { if m != nil { return m.Metadata } return nil } func (m *ContainerStatus) GetState() ContainerState { if m != nil { return m.State } return ContainerState_CONTAINER_CREATED } func (m *ContainerStatus) GetCreatedAt() int64 { if m != nil { return m.CreatedAt } return 0 } func (m *ContainerStatus) GetStartedAt() int64 { if m != nil { return m.StartedAt } return 0 } func (m *ContainerStatus) GetFinishedAt() int64 { if m != nil { return m.FinishedAt } return 0 } func (m *ContainerStatus) GetExitCode() int32 { if m != nil { return m.ExitCode } return 0 } func (m *ContainerStatus) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } func (m *ContainerStatus) GetImageRef() string { if m != nil { return m.ImageRef } return "" } func (m *ContainerStatus) GetReason() string { if m != nil { return m.Reason } return "" } func (m *ContainerStatus) GetMessage() string { if m != nil { return m.Message } return "" } func (m *ContainerStatus) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *ContainerStatus) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } func (m *ContainerStatus) GetMounts() []*Mount { if m != nil { return m.Mounts } return nil } func (m *ContainerStatus) GetLogPath() string { if m != nil { return m.LogPath } return "" } type ContainerStatusResponse struct { // Status of the container. Status *ContainerStatus `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"` // Info is extra information of the Container. The key could be abitrary string, and // value should be in json format. The information could include anything useful for // debug, e.g. pid for linux container based container runtime. // It should only be returned non-empty when Verbose is true. Info map[string]string `protobuf:"bytes,2,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *ContainerStatusResponse) Reset() { *m = ContainerStatusResponse{} } func (*ContainerStatusResponse) ProtoMessage() {} func (*ContainerStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{53} } func (m *ContainerStatusResponse) GetStatus() *ContainerStatus { if m != nil { return m.Status } return nil } func (m *ContainerStatusResponse) GetInfo() map[string]string { if m != nil { return m.Info } return nil } type UpdateContainerResourcesRequest struct { // ID of the container to update. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Resource configuration specific to Linux containers. Linux *LinuxContainerResources `protobuf:"bytes,2,opt,name=linux" json:"linux,omitempty"` } func (m *UpdateContainerResourcesRequest) Reset() { *m = UpdateContainerResourcesRequest{} } func (*UpdateContainerResourcesRequest) ProtoMessage() {} func (*UpdateContainerResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{54} } func (m *UpdateContainerResourcesRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *UpdateContainerResourcesRequest) GetLinux() *LinuxContainerResources { if m != nil { return m.Linux } return nil } type UpdateContainerResourcesResponse struct { } func (m *UpdateContainerResourcesResponse) Reset() { *m = UpdateContainerResourcesResponse{} } func (*UpdateContainerResourcesResponse) ProtoMessage() {} func (*UpdateContainerResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{55} } type ExecSyncRequest struct { // ID of the container. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Command to execute. Cmd []string `protobuf:"bytes,2,rep,name=cmd" json:"cmd,omitempty"` // Timeout in seconds to stop the command. Default: 0 (run forever). Timeout int64 `protobuf:"varint,3,opt,name=timeout,proto3" json:"timeout,omitempty"` } func (m *ExecSyncRequest) Reset() { *m = ExecSyncRequest{} } func (*ExecSyncRequest) ProtoMessage() {} func (*ExecSyncRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{56} } func (m *ExecSyncRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *ExecSyncRequest) GetCmd() []string { if m != nil { return m.Cmd } return nil } func (m *ExecSyncRequest) GetTimeout() int64 { if m != nil { return m.Timeout } return 0 } type ExecSyncResponse struct { // Captured command stdout output. Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"` // Captured command stderr output. Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"` // Exit code the command finished with. Default: 0 (success). ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` } func (m *ExecSyncResponse) Reset() { *m = ExecSyncResponse{} } func (*ExecSyncResponse) ProtoMessage() {} func (*ExecSyncResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{57} } func (m *ExecSyncResponse) GetStdout() []byte { if m != nil { return m.Stdout } return nil } func (m *ExecSyncResponse) GetStderr() []byte { if m != nil { return m.Stderr } return nil } func (m *ExecSyncResponse) GetExitCode() int32 { if m != nil { return m.ExitCode } return 0 } type ExecRequest struct { // ID of the container in which to execute the command. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Command to execute. Cmd []string `protobuf:"bytes,2,rep,name=cmd" json:"cmd,omitempty"` // Whether to exec the command in a TTY. Tty bool `protobuf:"varint,3,opt,name=tty,proto3" json:"tty,omitempty"` // Whether to stream stdin. // One of `stdin`, `stdout`, and `stderr` MUST be true. Stdin bool `protobuf:"varint,4,opt,name=stdin,proto3" json:"stdin,omitempty"` // Whether to stream stdout. // One of `stdin`, `stdout`, and `stderr` MUST be true. Stdout bool `protobuf:"varint,5,opt,name=stdout,proto3" json:"stdout,omitempty"` // Whether to stream stderr. // One of `stdin`, `stdout`, and `stderr` MUST be true. // If `tty` is true, `stderr` MUST be false. Multiplexing is not supported // in this case. The output of stdout and stderr will be combined to a // single stream. Stderr bool `protobuf:"varint,6,opt,name=stderr,proto3" json:"stderr,omitempty"` } func (m *ExecRequest) Reset() { *m = ExecRequest{} } func (*ExecRequest) ProtoMessage() {} func (*ExecRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{58} } func (m *ExecRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *ExecRequest) GetCmd() []string { if m != nil { return m.Cmd } return nil } func (m *ExecRequest) GetTty() bool { if m != nil { return m.Tty } return false } func (m *ExecRequest) GetStdin() bool { if m != nil { return m.Stdin } return false } func (m *ExecRequest) GetStdout() bool { if m != nil { return m.Stdout } return false } func (m *ExecRequest) GetStderr() bool { if m != nil { return m.Stderr } return false } type ExecResponse struct { // Fully qualified URL of the exec streaming server. Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` } func (m *ExecResponse) Reset() { *m = ExecResponse{} } func (*ExecResponse) ProtoMessage() {} func (*ExecResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{59} } func (m *ExecResponse) GetUrl() string { if m != nil { return m.Url } return "" } type AttachRequest struct { // ID of the container to which to attach. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Whether to stream stdin. // One of `stdin`, `stdout`, and `stderr` MUST be true. Stdin bool `protobuf:"varint,2,opt,name=stdin,proto3" json:"stdin,omitempty"` // Whether the process being attached is running in a TTY. // This must match the TTY setting in the ContainerConfig. Tty bool `protobuf:"varint,3,opt,name=tty,proto3" json:"tty,omitempty"` // Whether to stream stdout. // One of `stdin`, `stdout`, and `stderr` MUST be true. Stdout bool `protobuf:"varint,4,opt,name=stdout,proto3" json:"stdout,omitempty"` // Whether to stream stderr. // One of `stdin`, `stdout`, and `stderr` MUST be true. // If `tty` is true, `stderr` MUST be false. Multiplexing is not supported // in this case. The output of stdout and stderr will be combined to a // single stream. Stderr bool `protobuf:"varint,5,opt,name=stderr,proto3" json:"stderr,omitempty"` } func (m *AttachRequest) Reset() { *m = AttachRequest{} } func (*AttachRequest) ProtoMessage() {} func (*AttachRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{60} } func (m *AttachRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *AttachRequest) GetStdin() bool { if m != nil { return m.Stdin } return false } func (m *AttachRequest) GetTty() bool { if m != nil { return m.Tty } return false } func (m *AttachRequest) GetStdout() bool { if m != nil { return m.Stdout } return false } func (m *AttachRequest) GetStderr() bool { if m != nil { return m.Stderr } return false } type AttachResponse struct { // Fully qualified URL of the attach streaming server. Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` } func (m *AttachResponse) Reset() { *m = AttachResponse{} } func (*AttachResponse) ProtoMessage() {} func (*AttachResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{61} } func (m *AttachResponse) GetUrl() string { if m != nil { return m.Url } return "" } type PortForwardRequest struct { // ID of the container to which to forward the port. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // Port to forward. Port []int32 `protobuf:"varint,2,rep,packed,name=port" json:"port,omitempty"` } func (m *PortForwardRequest) Reset() { *m = PortForwardRequest{} } func (*PortForwardRequest) ProtoMessage() {} func (*PortForwardRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{62} } func (m *PortForwardRequest) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *PortForwardRequest) GetPort() []int32 { if m != nil { return m.Port } return nil } type PortForwardResponse struct { // Fully qualified URL of the port-forward streaming server. Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` } func (m *PortForwardResponse) Reset() { *m = PortForwardResponse{} } func (*PortForwardResponse) ProtoMessage() {} func (*PortForwardResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{63} } func (m *PortForwardResponse) GetUrl() string { if m != nil { return m.Url } return "" } type ImageFilter struct { // Spec of the image. Image *ImageSpec `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` } func (m *ImageFilter) Reset() { *m = ImageFilter{} } func (*ImageFilter) ProtoMessage() {} func (*ImageFilter) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{64} } func (m *ImageFilter) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } type ListImagesRequest struct { // Filter to list images. Filter *ImageFilter `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` } func (m *ListImagesRequest) Reset() { *m = ListImagesRequest{} } func (*ListImagesRequest) ProtoMessage() {} func (*ListImagesRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{65} } func (m *ListImagesRequest) GetFilter() *ImageFilter { if m != nil { return m.Filter } return nil } // Basic information about a container image. type Image struct { // ID of the image. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Other names by which this image is known. RepoTags []string `protobuf:"bytes,2,rep,name=repo_tags,json=repoTags" json:"repo_tags,omitempty"` // Digests by which this image is known. RepoDigests []string `protobuf:"bytes,3,rep,name=repo_digests,json=repoDigests" json:"repo_digests,omitempty"` // Size of the image in bytes. Must be > 0. Size_ uint64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` // UID that will run the command(s). This is used as a default if no user is // specified when creating the container. UID and the following user name // are mutually exclusive. Uid *Int64Value `protobuf:"bytes,5,opt,name=uid" json:"uid,omitempty"` // User name that will run the command(s). This is used if UID is not set // and no user is specified when creating container. Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"` } func (m *Image) Reset() { *m = Image{} } func (*Image) ProtoMessage() {} func (*Image) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{66} } func (m *Image) GetId() string { if m != nil { return m.Id } return "" } func (m *Image) GetRepoTags() []string { if m != nil { return m.RepoTags } return nil } func (m *Image) GetRepoDigests() []string { if m != nil { return m.RepoDigests } return nil } func (m *Image) GetSize_() uint64 { if m != nil { return m.Size_ } return 0 } func (m *Image) GetUid() *Int64Value { if m != nil { return m.Uid } return nil } func (m *Image) GetUsername() string { if m != nil { return m.Username } return "" } type ListImagesResponse struct { // List of images. Images []*Image `protobuf:"bytes,1,rep,name=images" json:"images,omitempty"` } func (m *ListImagesResponse) Reset() { *m = ListImagesResponse{} } func (*ListImagesResponse) ProtoMessage() {} func (*ListImagesResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{67} } func (m *ListImagesResponse) GetImages() []*Image { if m != nil { return m.Images } return nil } type ImageStatusRequest struct { // Spec of the image. Image *ImageSpec `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` // Verbose indicates whether to return extra information about the image. Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"` } func (m *ImageStatusRequest) Reset() { *m = ImageStatusRequest{} } func (*ImageStatusRequest) ProtoMessage() {} func (*ImageStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{68} } func (m *ImageStatusRequest) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } func (m *ImageStatusRequest) GetVerbose() bool { if m != nil { return m.Verbose } return false } type ImageStatusResponse struct { // Status of the image. Image *Image `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` // Info is extra information of the Image. The key could be abitrary string, and // value should be in json format. The information could include anything useful // for debug, e.g. image config for oci image based container runtime. // It should only be returned non-empty when Verbose is true. Info map[string]string `protobuf:"bytes,2,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *ImageStatusResponse) Reset() { *m = ImageStatusResponse{} } func (*ImageStatusResponse) ProtoMessage() {} func (*ImageStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{69} } func (m *ImageStatusResponse) GetImage() *Image { if m != nil { return m.Image } return nil } func (m *ImageStatusResponse) GetInfo() map[string]string { if m != nil { return m.Info } return nil } // AuthConfig contains authorization information for connecting to a registry. type AuthConfig struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Auth string `protobuf:"bytes,3,opt,name=auth,proto3" json:"auth,omitempty"` ServerAddress string `protobuf:"bytes,4,opt,name=server_address,json=serverAddress,proto3" json:"server_address,omitempty"` // IdentityToken is used to authenticate the user and get // an access token for the registry. IdentityToken string `protobuf:"bytes,5,opt,name=identity_token,json=identityToken,proto3" json:"identity_token,omitempty"` // RegistryToken is a bearer token to be sent to a registry RegistryToken string `protobuf:"bytes,6,opt,name=registry_token,json=registryToken,proto3" json:"registry_token,omitempty"` } func (m *AuthConfig) Reset() { *m = AuthConfig{} } func (*AuthConfig) ProtoMessage() {} func (*AuthConfig) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{70} } func (m *AuthConfig) GetUsername() string { if m != nil { return m.Username } return "" } func (m *AuthConfig) GetPassword() string { if m != nil { return m.Password } return "" } func (m *AuthConfig) GetAuth() string { if m != nil { return m.Auth } return "" } func (m *AuthConfig) GetServerAddress() string { if m != nil { return m.ServerAddress } return "" } func (m *AuthConfig) GetIdentityToken() string { if m != nil { return m.IdentityToken } return "" } func (m *AuthConfig) GetRegistryToken() string { if m != nil { return m.RegistryToken } return "" } type PullImageRequest struct { // Spec of the image. Image *ImageSpec `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` // Authentication configuration for pulling the image. Auth *AuthConfig `protobuf:"bytes,2,opt,name=auth" json:"auth,omitempty"` // Config of the PodSandbox, which is used to pull image in PodSandbox context. SandboxConfig *PodSandboxConfig `protobuf:"bytes,3,opt,name=sandbox_config,json=sandboxConfig" json:"sandbox_config,omitempty"` } func (m *PullImageRequest) Reset() { *m = PullImageRequest{} } func (*PullImageRequest) ProtoMessage() {} func (*PullImageRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{71} } func (m *PullImageRequest) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } func (m *PullImageRequest) GetAuth() *AuthConfig { if m != nil { return m.Auth } return nil } func (m *PullImageRequest) GetSandboxConfig() *PodSandboxConfig { if m != nil { return m.SandboxConfig } return nil } type PullImageResponse struct { // Reference to the image in use. For most runtimes, this should be an // image ID or digest. ImageRef string `protobuf:"bytes,1,opt,name=image_ref,json=imageRef,proto3" json:"image_ref,omitempty"` } func (m *PullImageResponse) Reset() { *m = PullImageResponse{} } func (*PullImageResponse) ProtoMessage() {} func (*PullImageResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{72} } func (m *PullImageResponse) GetImageRef() string { if m != nil { return m.ImageRef } return "" } type RemoveImageRequest struct { // Spec of the image to remove. Image *ImageSpec `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` } func (m *RemoveImageRequest) Reset() { *m = RemoveImageRequest{} } func (*RemoveImageRequest) ProtoMessage() {} func (*RemoveImageRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{73} } func (m *RemoveImageRequest) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } type RemoveImageResponse struct { } func (m *RemoveImageResponse) Reset() { *m = RemoveImageResponse{} } func (*RemoveImageResponse) ProtoMessage() {} func (*RemoveImageResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{74} } type NetworkConfig struct { // CIDR to use for pod IP addresses. PodCidr string `protobuf:"bytes,1,opt,name=pod_cidr,json=podCidr,proto3" json:"pod_cidr,omitempty"` } func (m *NetworkConfig) Reset() { *m = NetworkConfig{} } func (*NetworkConfig) ProtoMessage() {} func (*NetworkConfig) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{75} } func (m *NetworkConfig) GetPodCidr() string { if m != nil { return m.PodCidr } return "" } type RuntimeConfig struct { NetworkConfig *NetworkConfig `protobuf:"bytes,1,opt,name=network_config,json=networkConfig" json:"network_config,omitempty"` } func (m *RuntimeConfig) Reset() { *m = RuntimeConfig{} } func (*RuntimeConfig) ProtoMessage() {} func (*RuntimeConfig) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{76} } func (m *RuntimeConfig) GetNetworkConfig() *NetworkConfig { if m != nil { return m.NetworkConfig } return nil } type UpdateRuntimeConfigRequest struct { RuntimeConfig *RuntimeConfig `protobuf:"bytes,1,opt,name=runtime_config,json=runtimeConfig" json:"runtime_config,omitempty"` } func (m *UpdateRuntimeConfigRequest) Reset() { *m = UpdateRuntimeConfigRequest{} } func (*UpdateRuntimeConfigRequest) ProtoMessage() {} func (*UpdateRuntimeConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{77} } func (m *UpdateRuntimeConfigRequest) GetRuntimeConfig() *RuntimeConfig { if m != nil { return m.RuntimeConfig } return nil } type UpdateRuntimeConfigResponse struct { } func (m *UpdateRuntimeConfigResponse) Reset() { *m = UpdateRuntimeConfigResponse{} } func (*UpdateRuntimeConfigResponse) ProtoMessage() {} func (*UpdateRuntimeConfigResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{78} } // RuntimeCondition contains condition information for the runtime. // There are 2 kinds of runtime conditions: // 1. Required conditions: Conditions are required for kubelet to work // properly. If any required condition is unmet, the node will be not ready. // The required conditions include: // * RuntimeReady: RuntimeReady means the runtime is up and ready to accept // basic containers e.g. container only needs host network. // * NetworkReady: NetworkReady means the runtime network is up and ready to // accept containers which require container network. // 2. Optional conditions: Conditions are informative to the user, but kubelet // will not rely on. Since condition type is an arbitrary string, all conditions // not required are optional. These conditions will be exposed to users to help // them understand the status of the system. type RuntimeCondition struct { // Type of runtime condition. Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Status of the condition, one of true/false. Default: false. Status bool `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` // Brief CamelCase string containing reason for the condition's last transition. Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` // Human-readable message indicating details about last transition. Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` } func (m *RuntimeCondition) Reset() { *m = RuntimeCondition{} } func (*RuntimeCondition) ProtoMessage() {} func (*RuntimeCondition) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{79} } func (m *RuntimeCondition) GetType() string { if m != nil { return m.Type } return "" } func (m *RuntimeCondition) GetStatus() bool { if m != nil { return m.Status } return false } func (m *RuntimeCondition) GetReason() string { if m != nil { return m.Reason } return "" } func (m *RuntimeCondition) GetMessage() string { if m != nil { return m.Message } return "" } // RuntimeStatus is information about the current status of the runtime. type RuntimeStatus struct { // List of current observed runtime conditions. Conditions []*RuntimeCondition `protobuf:"bytes,1,rep,name=conditions" json:"conditions,omitempty"` } func (m *RuntimeStatus) Reset() { *m = RuntimeStatus{} } func (*RuntimeStatus) ProtoMessage() {} func (*RuntimeStatus) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{80} } func (m *RuntimeStatus) GetConditions() []*RuntimeCondition { if m != nil { return m.Conditions } return nil } type StatusRequest struct { // Verbose indicates whether to return extra information about the runtime. Verbose bool `protobuf:"varint,1,opt,name=verbose,proto3" json:"verbose,omitempty"` } func (m *StatusRequest) Reset() { *m = StatusRequest{} } func (*StatusRequest) ProtoMessage() {} func (*StatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{81} } func (m *StatusRequest) GetVerbose() bool { if m != nil { return m.Verbose } return false } type StatusResponse struct { // Status of the Runtime. Status *RuntimeStatus `protobuf:"bytes,1,opt,name=status" json:"status,omitempty"` // Info is extra information of the Runtime. The key could be abitrary string, and // value should be in json format. The information could include anything useful for // debug, e.g. plugins used by the container runtime. // It should only be returned non-empty when Verbose is true. Info map[string]string `protobuf:"bytes,2,rep,name=info" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *StatusResponse) Reset() { *m = StatusResponse{} } func (*StatusResponse) ProtoMessage() {} func (*StatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{82} } func (m *StatusResponse) GetStatus() *RuntimeStatus { if m != nil { return m.Status } return nil } func (m *StatusResponse) GetInfo() map[string]string { if m != nil { return m.Info } return nil } type ImageFsInfoRequest struct { } func (m *ImageFsInfoRequest) Reset() { *m = ImageFsInfoRequest{} } func (*ImageFsInfoRequest) ProtoMessage() {} func (*ImageFsInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{83} } // UInt64Value is the wrapper of uint64. type UInt64Value struct { // The value. Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *UInt64Value) Reset() { *m = UInt64Value{} } func (*UInt64Value) ProtoMessage() {} func (*UInt64Value) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{84} } func (m *UInt64Value) GetValue() uint64 { if m != nil { return m.Value } return 0 } // StorageIdentifier uniquely identify the storage.. type StorageIdentifier struct { // UUID of the device. Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` } func (m *StorageIdentifier) Reset() { *m = StorageIdentifier{} } func (*StorageIdentifier) ProtoMessage() {} func (*StorageIdentifier) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{85} } func (m *StorageIdentifier) GetUuid() string { if m != nil { return m.Uuid } return "" } // FilesystemUsage provides the filesystem usage information. type FilesystemUsage struct { // Timestamp in nanoseconds at which the information were collected. Must be > 0. Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // The underlying storage of the filesystem. StorageId *StorageIdentifier `protobuf:"bytes,2,opt,name=storage_id,json=storageId" json:"storage_id,omitempty"` // UsedBytes represents the bytes used for images on the filesystem. // This may differ from the total bytes used on the filesystem and may not // equal CapacityBytes - AvailableBytes. UsedBytes *UInt64Value `protobuf:"bytes,3,opt,name=used_bytes,json=usedBytes" json:"used_bytes,omitempty"` // InodesUsed represents the inodes used by the images. // This may not equal InodesCapacity - InodesAvailable because the underlying // filesystem may also be used for purposes other than storing images. InodesUsed *UInt64Value `protobuf:"bytes,4,opt,name=inodes_used,json=inodesUsed" json:"inodes_used,omitempty"` } func (m *FilesystemUsage) Reset() { *m = FilesystemUsage{} } func (*FilesystemUsage) ProtoMessage() {} func (*FilesystemUsage) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{86} } func (m *FilesystemUsage) GetTimestamp() int64 { if m != nil { return m.Timestamp } return 0 } func (m *FilesystemUsage) GetStorageId() *StorageIdentifier { if m != nil { return m.StorageId } return nil } func (m *FilesystemUsage) GetUsedBytes() *UInt64Value { if m != nil { return m.UsedBytes } return nil } func (m *FilesystemUsage) GetInodesUsed() *UInt64Value { if m != nil { return m.InodesUsed } return nil } type ImageFsInfoResponse struct { // Information of image filesystem(s). ImageFilesystems []*FilesystemUsage `protobuf:"bytes,1,rep,name=image_filesystems,json=imageFilesystems" json:"image_filesystems,omitempty"` } func (m *ImageFsInfoResponse) Reset() { *m = ImageFsInfoResponse{} } func (*ImageFsInfoResponse) ProtoMessage() {} func (*ImageFsInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{87} } func (m *ImageFsInfoResponse) GetImageFilesystems() []*FilesystemUsage { if m != nil { return m.ImageFilesystems } return nil } type ContainerStatsRequest struct { // ID of the container for which to retrieve stats. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` } func (m *ContainerStatsRequest) Reset() { *m = ContainerStatsRequest{} } func (*ContainerStatsRequest) ProtoMessage() {} func (*ContainerStatsRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{88} } func (m *ContainerStatsRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } type ContainerStatsResponse struct { // Stats of the container. Stats *ContainerStats `protobuf:"bytes,1,opt,name=stats" json:"stats,omitempty"` } func (m *ContainerStatsResponse) Reset() { *m = ContainerStatsResponse{} } func (*ContainerStatsResponse) ProtoMessage() {} func (*ContainerStatsResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{89} } func (m *ContainerStatsResponse) GetStats() *ContainerStats { if m != nil { return m.Stats } return nil } type ListContainerStatsRequest struct { // Filter for the list request. Filter *ContainerStatsFilter `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` } func (m *ListContainerStatsRequest) Reset() { *m = ListContainerStatsRequest{} } func (*ListContainerStatsRequest) ProtoMessage() {} func (*ListContainerStatsRequest) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{90} } func (m *ListContainerStatsRequest) GetFilter() *ContainerStatsFilter { if m != nil { return m.Filter } return nil } // ContainerStatsFilter is used to filter containers. // All those fields are combined with 'AND' type ContainerStatsFilter struct { // ID of the container. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // ID of the PodSandbox. PodSandboxId string `protobuf:"bytes,2,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // LabelSelector to select matches. // Only api.MatchLabels is supported for now and the requirements // are ANDed. MatchExpressions is not supported yet. LabelSelector map[string]string `protobuf:"bytes,3,rep,name=label_selector,json=labelSelector" json:"label_selector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *ContainerStatsFilter) Reset() { *m = ContainerStatsFilter{} } func (*ContainerStatsFilter) ProtoMessage() {} func (*ContainerStatsFilter) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{91} } func (m *ContainerStatsFilter) GetId() string { if m != nil { return m.Id } return "" } func (m *ContainerStatsFilter) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *ContainerStatsFilter) GetLabelSelector() map[string]string { if m != nil { return m.LabelSelector } return nil } type ListContainerStatsResponse struct { // Stats of the container. Stats []*ContainerStats `protobuf:"bytes,1,rep,name=stats" json:"stats,omitempty"` } func (m *ListContainerStatsResponse) Reset() { *m = ListContainerStatsResponse{} } func (*ListContainerStatsResponse) ProtoMessage() {} func (*ListContainerStatsResponse) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{92} } func (m *ListContainerStatsResponse) GetStats() []*ContainerStats { if m != nil { return m.Stats } return nil } // ContainerAttributes provides basic information of the container. type ContainerAttributes struct { // ID of the container. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Metadata of the container. Metadata *ContainerMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata,omitempty"` // Key-value pairs that may be used to scope and select individual resources. Labels map[string]string `protobuf:"bytes,3,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map holding arbitrary metadata. // Annotations MUST NOT be altered by the runtime; the value of this field // MUST be identical to that of the corresponding ContainerConfig used to // instantiate the Container this status represents. Annotations map[string]string `protobuf:"bytes,4,rep,name=annotations" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *ContainerAttributes) Reset() { *m = ContainerAttributes{} } func (*ContainerAttributes) ProtoMessage() {} func (*ContainerAttributes) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{93} } func (m *ContainerAttributes) GetId() string { if m != nil { return m.Id } return "" } func (m *ContainerAttributes) GetMetadata() *ContainerMetadata { if m != nil { return m.Metadata } return nil } func (m *ContainerAttributes) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *ContainerAttributes) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } // ContainerStats provides the resource usage statistics for a container. type ContainerStats struct { // Information of the container. Attributes *ContainerAttributes `protobuf:"bytes,1,opt,name=attributes" json:"attributes,omitempty"` // CPU usage gathered from the container. Cpu *CpuUsage `protobuf:"bytes,2,opt,name=cpu" json:"cpu,omitempty"` // Memory usage gathered from the container. Memory *MemoryUsage `protobuf:"bytes,3,opt,name=memory" json:"memory,omitempty"` // Usage of the writeable layer. WritableLayer *FilesystemUsage `protobuf:"bytes,4,opt,name=writable_layer,json=writableLayer" json:"writable_layer,omitempty"` } func (m *ContainerStats) Reset() { *m = ContainerStats{} } func (*ContainerStats) ProtoMessage() {} func (*ContainerStats) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{94} } func (m *ContainerStats) GetAttributes() *ContainerAttributes { if m != nil { return m.Attributes } return nil } func (m *ContainerStats) GetCpu() *CpuUsage { if m != nil { return m.Cpu } return nil } func (m *ContainerStats) GetMemory() *MemoryUsage { if m != nil { return m.Memory } return nil } func (m *ContainerStats) GetWritableLayer() *FilesystemUsage { if m != nil { return m.WritableLayer } return nil } // CpuUsage provides the CPU usage information. type CpuUsage struct { // Timestamp in nanoseconds at which the information were collected. Must be > 0. Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Cumulative CPU usage (sum across all cores) since object creation. UsageCoreNanoSeconds *UInt64Value `protobuf:"bytes,2,opt,name=usage_core_nano_seconds,json=usageCoreNanoSeconds" json:"usage_core_nano_seconds,omitempty"` } func (m *CpuUsage) Reset() { *m = CpuUsage{} } func (*CpuUsage) ProtoMessage() {} func (*CpuUsage) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{95} } func (m *CpuUsage) GetTimestamp() int64 { if m != nil { return m.Timestamp } return 0 } func (m *CpuUsage) GetUsageCoreNanoSeconds() *UInt64Value { if m != nil { return m.UsageCoreNanoSeconds } return nil } // MemoryUsage provides the memory usage information. type MemoryUsage struct { // Timestamp in nanoseconds at which the information were collected. Must be > 0. Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // The amount of working set memory in bytes. WorkingSetBytes *UInt64Value `protobuf:"bytes,2,opt,name=working_set_bytes,json=workingSetBytes" json:"working_set_bytes,omitempty"` } func (m *MemoryUsage) Reset() { *m = MemoryUsage{} } func (*MemoryUsage) ProtoMessage() {} func (*MemoryUsage) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{96} } func (m *MemoryUsage) GetTimestamp() int64 { if m != nil { return m.Timestamp } return 0 } func (m *MemoryUsage) GetWorkingSetBytes() *UInt64Value { if m != nil { return m.WorkingSetBytes } return nil } func init() { proto.RegisterType((*VersionRequest)(nil), "runtime.VersionRequest") proto.RegisterType((*VersionResponse)(nil), "runtime.VersionResponse") proto.RegisterType((*DNSConfig)(nil), "runtime.DNSConfig") proto.RegisterType((*PortMapping)(nil), "runtime.PortMapping") proto.RegisterType((*Mount)(nil), "runtime.Mount") proto.RegisterType((*NamespaceOption)(nil), "runtime.NamespaceOption") proto.RegisterType((*Int64Value)(nil), "runtime.Int64Value") proto.RegisterType((*LinuxSandboxSecurityContext)(nil), "runtime.LinuxSandboxSecurityContext") proto.RegisterType((*LinuxPodSandboxConfig)(nil), "runtime.LinuxPodSandboxConfig") proto.RegisterType((*PodSandboxMetadata)(nil), "runtime.PodSandboxMetadata") proto.RegisterType((*PodSandboxConfig)(nil), "runtime.PodSandboxConfig") proto.RegisterType((*RunPodSandboxRequest)(nil), "runtime.RunPodSandboxRequest") proto.RegisterType((*RunPodSandboxResponse)(nil), "runtime.RunPodSandboxResponse") proto.RegisterType((*StopPodSandboxRequest)(nil), "runtime.StopPodSandboxRequest") proto.RegisterType((*StopPodSandboxResponse)(nil), "runtime.StopPodSandboxResponse") proto.RegisterType((*RemovePodSandboxRequest)(nil), "runtime.RemovePodSandboxRequest") proto.RegisterType((*RemovePodSandboxResponse)(nil), "runtime.RemovePodSandboxResponse") proto.RegisterType((*PodSandboxStatusRequest)(nil), "runtime.PodSandboxStatusRequest") proto.RegisterType((*PodSandboxNetworkStatus)(nil), "runtime.PodSandboxNetworkStatus") proto.RegisterType((*Namespace)(nil), "runtime.Namespace") proto.RegisterType((*LinuxPodSandboxStatus)(nil), "runtime.LinuxPodSandboxStatus") proto.RegisterType((*PodSandboxStatus)(nil), "runtime.PodSandboxStatus") proto.RegisterType((*PodSandboxStatusResponse)(nil), "runtime.PodSandboxStatusResponse") proto.RegisterType((*PodSandboxStateValue)(nil), "runtime.PodSandboxStateValue") proto.RegisterType((*PodSandboxFilter)(nil), "runtime.PodSandboxFilter") proto.RegisterType((*ListPodSandboxRequest)(nil), "runtime.ListPodSandboxRequest") proto.RegisterType((*PodSandbox)(nil), "runtime.PodSandbox") proto.RegisterType((*ListPodSandboxResponse)(nil), "runtime.ListPodSandboxResponse") proto.RegisterType((*ImageSpec)(nil), "runtime.ImageSpec") proto.RegisterType((*KeyValue)(nil), "runtime.KeyValue") proto.RegisterType((*LinuxContainerResources)(nil), "runtime.LinuxContainerResources") proto.RegisterType((*SELinuxOption)(nil), "runtime.SELinuxOption") proto.RegisterType((*Capability)(nil), "runtime.Capability") proto.RegisterType((*LinuxContainerSecurityContext)(nil), "runtime.LinuxContainerSecurityContext") proto.RegisterType((*LinuxContainerConfig)(nil), "runtime.LinuxContainerConfig") proto.RegisterType((*ContainerMetadata)(nil), "runtime.ContainerMetadata") proto.RegisterType((*Device)(nil), "runtime.Device") proto.RegisterType((*ContainerConfig)(nil), "runtime.ContainerConfig") proto.RegisterType((*CreateContainerRequest)(nil), "runtime.CreateContainerRequest") proto.RegisterType((*CreateContainerResponse)(nil), "runtime.CreateContainerResponse") proto.RegisterType((*StartContainerRequest)(nil), "runtime.StartContainerRequest") proto.RegisterType((*StartContainerResponse)(nil), "runtime.StartContainerResponse") proto.RegisterType((*StopContainerRequest)(nil), "runtime.StopContainerRequest") proto.RegisterType((*StopContainerResponse)(nil), "runtime.StopContainerResponse") proto.RegisterType((*RemoveContainerRequest)(nil), "runtime.RemoveContainerRequest") proto.RegisterType((*RemoveContainerResponse)(nil), "runtime.RemoveContainerResponse") proto.RegisterType((*ContainerStateValue)(nil), "runtime.ContainerStateValue") proto.RegisterType((*ContainerFilter)(nil), "runtime.ContainerFilter") proto.RegisterType((*ListContainersRequest)(nil), "runtime.ListContainersRequest") proto.RegisterType((*Container)(nil), "runtime.Container") proto.RegisterType((*ListContainersResponse)(nil), "runtime.ListContainersResponse") proto.RegisterType((*ContainerStatusRequest)(nil), "runtime.ContainerStatusRequest") proto.RegisterType((*ContainerStatus)(nil), "runtime.ContainerStatus") proto.RegisterType((*ContainerStatusResponse)(nil), "runtime.ContainerStatusResponse") proto.RegisterType((*UpdateContainerResourcesRequest)(nil), "runtime.UpdateContainerResourcesRequest") proto.RegisterType((*UpdateContainerResourcesResponse)(nil), "runtime.UpdateContainerResourcesResponse") proto.RegisterType((*ExecSyncRequest)(nil), "runtime.ExecSyncRequest") proto.RegisterType((*ExecSyncResponse)(nil), "runtime.ExecSyncResponse") proto.RegisterType((*ExecRequest)(nil), "runtime.ExecRequest") proto.RegisterType((*ExecResponse)(nil), "runtime.ExecResponse") proto.RegisterType((*AttachRequest)(nil), "runtime.AttachRequest") proto.RegisterType((*AttachResponse)(nil), "runtime.AttachResponse") proto.RegisterType((*PortForwardRequest)(nil), "runtime.PortForwardRequest") proto.RegisterType((*PortForwardResponse)(nil), "runtime.PortForwardResponse") proto.RegisterType((*ImageFilter)(nil), "runtime.ImageFilter") proto.RegisterType((*ListImagesRequest)(nil), "runtime.ListImagesRequest") proto.RegisterType((*Image)(nil), "runtime.Image") proto.RegisterType((*ListImagesResponse)(nil), "runtime.ListImagesResponse") proto.RegisterType((*ImageStatusRequest)(nil), "runtime.ImageStatusRequest") proto.RegisterType((*ImageStatusResponse)(nil), "runtime.ImageStatusResponse") proto.RegisterType((*AuthConfig)(nil), "runtime.AuthConfig") proto.RegisterType((*PullImageRequest)(nil), "runtime.PullImageRequest") proto.RegisterType((*PullImageResponse)(nil), "runtime.PullImageResponse") proto.RegisterType((*RemoveImageRequest)(nil), "runtime.RemoveImageRequest") proto.RegisterType((*RemoveImageResponse)(nil), "runtime.RemoveImageResponse") proto.RegisterType((*NetworkConfig)(nil), "runtime.NetworkConfig") proto.RegisterType((*RuntimeConfig)(nil), "runtime.RuntimeConfig") proto.RegisterType((*UpdateRuntimeConfigRequest)(nil), "runtime.UpdateRuntimeConfigRequest") proto.RegisterType((*UpdateRuntimeConfigResponse)(nil), "runtime.UpdateRuntimeConfigResponse") proto.RegisterType((*RuntimeCondition)(nil), "runtime.RuntimeCondition") proto.RegisterType((*RuntimeStatus)(nil), "runtime.RuntimeStatus") proto.RegisterType((*StatusRequest)(nil), "runtime.StatusRequest") proto.RegisterType((*StatusResponse)(nil), "runtime.StatusResponse") proto.RegisterType((*ImageFsInfoRequest)(nil), "runtime.ImageFsInfoRequest") proto.RegisterType((*UInt64Value)(nil), "runtime.UInt64Value") proto.RegisterType((*StorageIdentifier)(nil), "runtime.StorageIdentifier") proto.RegisterType((*FilesystemUsage)(nil), "runtime.FilesystemUsage") proto.RegisterType((*ImageFsInfoResponse)(nil), "runtime.ImageFsInfoResponse") proto.RegisterType((*ContainerStatsRequest)(nil), "runtime.ContainerStatsRequest") proto.RegisterType((*ContainerStatsResponse)(nil), "runtime.ContainerStatsResponse") proto.RegisterType((*ListContainerStatsRequest)(nil), "runtime.ListContainerStatsRequest") proto.RegisterType((*ContainerStatsFilter)(nil), "runtime.ContainerStatsFilter") proto.RegisterType((*ListContainerStatsResponse)(nil), "runtime.ListContainerStatsResponse") proto.RegisterType((*ContainerAttributes)(nil), "runtime.ContainerAttributes") proto.RegisterType((*ContainerStats)(nil), "runtime.ContainerStats") proto.RegisterType((*CpuUsage)(nil), "runtime.CpuUsage") proto.RegisterType((*MemoryUsage)(nil), "runtime.MemoryUsage") proto.RegisterEnum("runtime.Protocol", Protocol_name, Protocol_value) proto.RegisterEnum("runtime.MountPropagation", MountPropagation_name, MountPropagation_value) proto.RegisterEnum("runtime.PodSandboxState", PodSandboxState_name, PodSandboxState_value) proto.RegisterEnum("runtime.ContainerState", ContainerState_name, ContainerState_value) } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // Client API for RuntimeService service type RuntimeServiceClient interface { // Version returns the runtime name, runtime version, and runtime API version. Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) // RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure // the sandbox is in the ready state on success. RunPodSandbox(ctx context.Context, in *RunPodSandboxRequest, opts ...grpc.CallOption) (*RunPodSandboxResponse, error) // StopPodSandbox stops any running process that is part of the sandbox and // reclaims network resources (e.g., IP addresses) allocated to the sandbox. // If there are any running containers in the sandbox, they must be forcibly // terminated. // This call is idempotent, and must not return an error if all relevant // resources have already been reclaimed. kubelet will call StopPodSandbox // at least once before calling RemovePodSandbox. It will also attempt to // reclaim resources eagerly, as soon as a sandbox is not needed. Hence, // multiple StopPodSandbox calls are expected. StopPodSandbox(ctx context.Context, in *StopPodSandboxRequest, opts ...grpc.CallOption) (*StopPodSandboxResponse, error) // RemovePodSandbox removes the sandbox. If there are any running containers // in the sandbox, they must be forcibly terminated and removed. // This call is idempotent, and must not return an error if the sandbox has // already been removed. RemovePodSandbox(ctx context.Context, in *RemovePodSandboxRequest, opts ...grpc.CallOption) (*RemovePodSandboxResponse, error) // PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not // present, returns an error. PodSandboxStatus(ctx context.Context, in *PodSandboxStatusRequest, opts ...grpc.CallOption) (*PodSandboxStatusResponse, error) // ListPodSandbox returns a list of PodSandboxes. ListPodSandbox(ctx context.Context, in *ListPodSandboxRequest, opts ...grpc.CallOption) (*ListPodSandboxResponse, error) // CreateContainer creates a new container in specified PodSandbox CreateContainer(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error) // StartContainer starts the container. StartContainer(ctx context.Context, in *StartContainerRequest, opts ...grpc.CallOption) (*StartContainerResponse, error) // StopContainer stops a running container with a grace period (i.e., timeout). // This call is idempotent, and must not return an error if the container has // already been stopped. // TODO: what must the runtime do after the grace period is reached? StopContainer(ctx context.Context, in *StopContainerRequest, opts ...grpc.CallOption) (*StopContainerResponse, error) // RemoveContainer removes the container. If the container is running, the // container must be forcibly removed. // This call is idempotent, and must not return an error if the container has // already been removed. RemoveContainer(ctx context.Context, in *RemoveContainerRequest, opts ...grpc.CallOption) (*RemoveContainerResponse, error) // ListContainers lists all containers by filters. ListContainers(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error) // ContainerStatus returns status of the container. If the container is not // present, returns an error. ContainerStatus(ctx context.Context, in *ContainerStatusRequest, opts ...grpc.CallOption) (*ContainerStatusResponse, error) // UpdateContainerResources updates ContainerConfig of the container. UpdateContainerResources(ctx context.Context, in *UpdateContainerResourcesRequest, opts ...grpc.CallOption) (*UpdateContainerResourcesResponse, error) // ExecSync runs a command in a container synchronously. ExecSync(ctx context.Context, in *ExecSyncRequest, opts ...grpc.CallOption) (*ExecSyncResponse, error) // Exec prepares a streaming endpoint to execute a command in the container. Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error) // Attach prepares a streaming endpoint to attach to a running container. Attach(ctx context.Context, in *AttachRequest, opts ...grpc.CallOption) (*AttachResponse, error) // PortForward prepares a streaming endpoint to forward ports from a PodSandbox. PortForward(ctx context.Context, in *PortForwardRequest, opts ...grpc.CallOption) (*PortForwardResponse, error) // ContainerStats returns stats of the container. If the container does not // exist, the call returns an error. ContainerStats(ctx context.Context, in *ContainerStatsRequest, opts ...grpc.CallOption) (*ContainerStatsResponse, error) // ListContainerStats returns stats of all running containers. ListContainerStats(ctx context.Context, in *ListContainerStatsRequest, opts ...grpc.CallOption) (*ListContainerStatsResponse, error) // UpdateRuntimeConfig updates the runtime configuration based on the given request. UpdateRuntimeConfig(ctx context.Context, in *UpdateRuntimeConfigRequest, opts ...grpc.CallOption) (*UpdateRuntimeConfigResponse, error) // Status returns the status of the runtime. Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) } type runtimeServiceClient struct { cc *grpc.ClientConn } func NewRuntimeServiceClient(cc *grpc.ClientConn) RuntimeServiceClient { return &runtimeServiceClient{cc} } func (c *runtimeServiceClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) { out := new(VersionResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/Version", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) RunPodSandbox(ctx context.Context, in *RunPodSandboxRequest, opts ...grpc.CallOption) (*RunPodSandboxResponse, error) { out := new(RunPodSandboxResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/RunPodSandbox", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) StopPodSandbox(ctx context.Context, in *StopPodSandboxRequest, opts ...grpc.CallOption) (*StopPodSandboxResponse, error) { out := new(StopPodSandboxResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/StopPodSandbox", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) RemovePodSandbox(ctx context.Context, in *RemovePodSandboxRequest, opts ...grpc.CallOption) (*RemovePodSandboxResponse, error) { out := new(RemovePodSandboxResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/RemovePodSandbox", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) PodSandboxStatus(ctx context.Context, in *PodSandboxStatusRequest, opts ...grpc.CallOption) (*PodSandboxStatusResponse, error) { out := new(PodSandboxStatusResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/PodSandboxStatus", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ListPodSandbox(ctx context.Context, in *ListPodSandboxRequest, opts ...grpc.CallOption) (*ListPodSandboxResponse, error) { out := new(ListPodSandboxResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/ListPodSandbox", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) CreateContainer(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error) { out := new(CreateContainerResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/CreateContainer", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) StartContainer(ctx context.Context, in *StartContainerRequest, opts ...grpc.CallOption) (*StartContainerResponse, error) { out := new(StartContainerResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/StartContainer", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) StopContainer(ctx context.Context, in *StopContainerRequest, opts ...grpc.CallOption) (*StopContainerResponse, error) { out := new(StopContainerResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/StopContainer", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) RemoveContainer(ctx context.Context, in *RemoveContainerRequest, opts ...grpc.CallOption) (*RemoveContainerResponse, error) { out := new(RemoveContainerResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/RemoveContainer", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ListContainers(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error) { out := new(ListContainersResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/ListContainers", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ContainerStatus(ctx context.Context, in *ContainerStatusRequest, opts ...grpc.CallOption) (*ContainerStatusResponse, error) { out := new(ContainerStatusResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/ContainerStatus", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) UpdateContainerResources(ctx context.Context, in *UpdateContainerResourcesRequest, opts ...grpc.CallOption) (*UpdateContainerResourcesResponse, error) { out := new(UpdateContainerResourcesResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/UpdateContainerResources", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ExecSync(ctx context.Context, in *ExecSyncRequest, opts ...grpc.CallOption) (*ExecSyncResponse, error) { out := new(ExecSyncResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/ExecSync", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error) { out := new(ExecResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/Exec", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) Attach(ctx context.Context, in *AttachRequest, opts ...grpc.CallOption) (*AttachResponse, error) { out := new(AttachResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/Attach", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) PortForward(ctx context.Context, in *PortForwardRequest, opts ...grpc.CallOption) (*PortForwardResponse, error) { out := new(PortForwardResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/PortForward", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ContainerStats(ctx context.Context, in *ContainerStatsRequest, opts ...grpc.CallOption) (*ContainerStatsResponse, error) { out := new(ContainerStatsResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/ContainerStats", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ListContainerStats(ctx context.Context, in *ListContainerStatsRequest, opts ...grpc.CallOption) (*ListContainerStatsResponse, error) { out := new(ListContainerStatsResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/ListContainerStats", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) UpdateRuntimeConfig(ctx context.Context, in *UpdateRuntimeConfigRequest, opts ...grpc.CallOption) (*UpdateRuntimeConfigResponse, error) { out := new(UpdateRuntimeConfigResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/UpdateRuntimeConfig", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { out := new(StatusResponse) err := grpc.Invoke(ctx, "/runtime.RuntimeService/Status", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } // Server API for RuntimeService service type RuntimeServiceServer interface { // Version returns the runtime name, runtime version, and runtime API version. Version(context.Context, *VersionRequest) (*VersionResponse, error) // RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure // the sandbox is in the ready state on success. RunPodSandbox(context.Context, *RunPodSandboxRequest) (*RunPodSandboxResponse, error) // StopPodSandbox stops any running process that is part of the sandbox and // reclaims network resources (e.g., IP addresses) allocated to the sandbox. // If there are any running containers in the sandbox, they must be forcibly // terminated. // This call is idempotent, and must not return an error if all relevant // resources have already been reclaimed. kubelet will call StopPodSandbox // at least once before calling RemovePodSandbox. It will also attempt to // reclaim resources eagerly, as soon as a sandbox is not needed. Hence, // multiple StopPodSandbox calls are expected. StopPodSandbox(context.Context, *StopPodSandboxRequest) (*StopPodSandboxResponse, error) // RemovePodSandbox removes the sandbox. If there are any running containers // in the sandbox, they must be forcibly terminated and removed. // This call is idempotent, and must not return an error if the sandbox has // already been removed. RemovePodSandbox(context.Context, *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error) // PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not // present, returns an error. PodSandboxStatus(context.Context, *PodSandboxStatusRequest) (*PodSandboxStatusResponse, error) // ListPodSandbox returns a list of PodSandboxes. ListPodSandbox(context.Context, *ListPodSandboxRequest) (*ListPodSandboxResponse, error) // CreateContainer creates a new container in specified PodSandbox CreateContainer(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) // StartContainer starts the container. StartContainer(context.Context, *StartContainerRequest) (*StartContainerResponse, error) // StopContainer stops a running container with a grace period (i.e., timeout). // This call is idempotent, and must not return an error if the container has // already been stopped. // TODO: what must the runtime do after the grace period is reached? StopContainer(context.Context, *StopContainerRequest) (*StopContainerResponse, error) // RemoveContainer removes the container. If the container is running, the // container must be forcibly removed. // This call is idempotent, and must not return an error if the container has // already been removed. RemoveContainer(context.Context, *RemoveContainerRequest) (*RemoveContainerResponse, error) // ListContainers lists all containers by filters. ListContainers(context.Context, *ListContainersRequest) (*ListContainersResponse, error) // ContainerStatus returns status of the container. If the container is not // present, returns an error. ContainerStatus(context.Context, *ContainerStatusRequest) (*ContainerStatusResponse, error) // UpdateContainerResources updates ContainerConfig of the container. UpdateContainerResources(context.Context, *UpdateContainerResourcesRequest) (*UpdateContainerResourcesResponse, error) // ExecSync runs a command in a container synchronously. ExecSync(context.Context, *ExecSyncRequest) (*ExecSyncResponse, error) // Exec prepares a streaming endpoint to execute a command in the container. Exec(context.Context, *ExecRequest) (*ExecResponse, error) // Attach prepares a streaming endpoint to attach to a running container. Attach(context.Context, *AttachRequest) (*AttachResponse, error) // PortForward prepares a streaming endpoint to forward ports from a PodSandbox. PortForward(context.Context, *PortForwardRequest) (*PortForwardResponse, error) // ContainerStats returns stats of the container. If the container does not // exist, the call returns an error. ContainerStats(context.Context, *ContainerStatsRequest) (*ContainerStatsResponse, error) // ListContainerStats returns stats of all running containers. ListContainerStats(context.Context, *ListContainerStatsRequest) (*ListContainerStatsResponse, error) // UpdateRuntimeConfig updates the runtime configuration based on the given request. UpdateRuntimeConfig(context.Context, *UpdateRuntimeConfigRequest) (*UpdateRuntimeConfigResponse, error) // Status returns the status of the runtime. Status(context.Context, *StatusRequest) (*StatusResponse, error) } func RegisterRuntimeServiceServer(s *grpc.Server, srv RuntimeServiceServer) { s.RegisterService(&_RuntimeService_serviceDesc, srv) } func _RuntimeService_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(VersionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).Version(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/Version", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).Version(ctx, req.(*VersionRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_RunPodSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RunPodSandboxRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).RunPodSandbox(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/RunPodSandbox", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).RunPodSandbox(ctx, req.(*RunPodSandboxRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_StopPodSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StopPodSandboxRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).StopPodSandbox(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/StopPodSandbox", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).StopPodSandbox(ctx, req.(*StopPodSandboxRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_RemovePodSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RemovePodSandboxRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).RemovePodSandbox(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/RemovePodSandbox", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).RemovePodSandbox(ctx, req.(*RemovePodSandboxRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_PodSandboxStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PodSandboxStatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).PodSandboxStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/PodSandboxStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).PodSandboxStatus(ctx, req.(*PodSandboxStatusRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ListPodSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListPodSandboxRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ListPodSandbox(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/ListPodSandbox", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ListPodSandbox(ctx, req.(*ListPodSandboxRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_CreateContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateContainerRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).CreateContainer(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/CreateContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).CreateContainer(ctx, req.(*CreateContainerRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_StartContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StartContainerRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).StartContainer(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/StartContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).StartContainer(ctx, req.(*StartContainerRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_StopContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StopContainerRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).StopContainer(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/StopContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).StopContainer(ctx, req.(*StopContainerRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_RemoveContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RemoveContainerRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).RemoveContainer(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/RemoveContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).RemoveContainer(ctx, req.(*RemoveContainerRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ListContainers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListContainersRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ListContainers(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/ListContainers", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ListContainers(ctx, req.(*ListContainersRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ContainerStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ContainerStatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ContainerStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/ContainerStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ContainerStatus(ctx, req.(*ContainerStatusRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_UpdateContainerResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateContainerResourcesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).UpdateContainerResources(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/UpdateContainerResources", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).UpdateContainerResources(ctx, req.(*UpdateContainerResourcesRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ExecSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ExecSyncRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ExecSync(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/ExecSync", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ExecSync(ctx, req.(*ExecSyncRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ExecRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).Exec(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/Exec", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).Exec(ctx, req.(*ExecRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_Attach_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AttachRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).Attach(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/Attach", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).Attach(ctx, req.(*AttachRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_PortForward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PortForwardRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).PortForward(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/PortForward", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).PortForward(ctx, req.(*PortForwardRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ContainerStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ContainerStatsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ContainerStats(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/ContainerStats", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ContainerStats(ctx, req.(*ContainerStatsRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ListContainerStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListContainerStatsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ListContainerStats(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/ListContainerStats", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ListContainerStats(ctx, req.(*ListContainerStatsRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_UpdateRuntimeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateRuntimeConfigRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).UpdateRuntimeConfig(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/UpdateRuntimeConfig", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).UpdateRuntimeConfig(ctx, req.(*UpdateRuntimeConfigRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).Status(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.RuntimeService/Status", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).Status(ctx, req.(*StatusRequest)) } return interceptor(ctx, in, info, handler) } var _RuntimeService_serviceDesc = grpc.ServiceDesc{ ServiceName: "runtime.RuntimeService", HandlerType: (*RuntimeServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Version", Handler: _RuntimeService_Version_Handler, }, { MethodName: "RunPodSandbox", Handler: _RuntimeService_RunPodSandbox_Handler, }, { MethodName: "StopPodSandbox", Handler: _RuntimeService_StopPodSandbox_Handler, }, { MethodName: "RemovePodSandbox", Handler: _RuntimeService_RemovePodSandbox_Handler, }, { MethodName: "PodSandboxStatus", Handler: _RuntimeService_PodSandboxStatus_Handler, }, { MethodName: "ListPodSandbox", Handler: _RuntimeService_ListPodSandbox_Handler, }, { MethodName: "CreateContainer", Handler: _RuntimeService_CreateContainer_Handler, }, { MethodName: "StartContainer", Handler: _RuntimeService_StartContainer_Handler, }, { MethodName: "StopContainer", Handler: _RuntimeService_StopContainer_Handler, }, { MethodName: "RemoveContainer", Handler: _RuntimeService_RemoveContainer_Handler, }, { MethodName: "ListContainers", Handler: _RuntimeService_ListContainers_Handler, }, { MethodName: "ContainerStatus", Handler: _RuntimeService_ContainerStatus_Handler, }, { MethodName: "UpdateContainerResources", Handler: _RuntimeService_UpdateContainerResources_Handler, }, { MethodName: "ExecSync", Handler: _RuntimeService_ExecSync_Handler, }, { MethodName: "Exec", Handler: _RuntimeService_Exec_Handler, }, { MethodName: "Attach", Handler: _RuntimeService_Attach_Handler, }, { MethodName: "PortForward", Handler: _RuntimeService_PortForward_Handler, }, { MethodName: "ContainerStats", Handler: _RuntimeService_ContainerStats_Handler, }, { MethodName: "ListContainerStats", Handler: _RuntimeService_ListContainerStats_Handler, }, { MethodName: "UpdateRuntimeConfig", Handler: _RuntimeService_UpdateRuntimeConfig_Handler, }, { MethodName: "Status", Handler: _RuntimeService_Status_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } // Client API for ImageService service type ImageServiceClient interface { // ListImages lists existing images. ListImages(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error) // ImageStatus returns the status of the image. If the image is not // present, returns a response with ImageStatusResponse.Image set to // nil. ImageStatus(ctx context.Context, in *ImageStatusRequest, opts ...grpc.CallOption) (*ImageStatusResponse, error) // PullImage pulls an image with authentication config. PullImage(ctx context.Context, in *PullImageRequest, opts ...grpc.CallOption) (*PullImageResponse, error) // RemoveImage removes the image. // This call is idempotent, and must not return an error if the image has // already been removed. RemoveImage(ctx context.Context, in *RemoveImageRequest, opts ...grpc.CallOption) (*RemoveImageResponse, error) // ImageFSInfo returns information of the filesystem that is used to store images. ImageFsInfo(ctx context.Context, in *ImageFsInfoRequest, opts ...grpc.CallOption) (*ImageFsInfoResponse, error) } type imageServiceClient struct { cc *grpc.ClientConn } func NewImageServiceClient(cc *grpc.ClientConn) ImageServiceClient { return &imageServiceClient{cc} } func (c *imageServiceClient) ListImages(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error) { out := new(ListImagesResponse) err := grpc.Invoke(ctx, "/runtime.ImageService/ListImages", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *imageServiceClient) ImageStatus(ctx context.Context, in *ImageStatusRequest, opts ...grpc.CallOption) (*ImageStatusResponse, error) { out := new(ImageStatusResponse) err := grpc.Invoke(ctx, "/runtime.ImageService/ImageStatus", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *imageServiceClient) PullImage(ctx context.Context, in *PullImageRequest, opts ...grpc.CallOption) (*PullImageResponse, error) { out := new(PullImageResponse) err := grpc.Invoke(ctx, "/runtime.ImageService/PullImage", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *imageServiceClient) RemoveImage(ctx context.Context, in *RemoveImageRequest, opts ...grpc.CallOption) (*RemoveImageResponse, error) { out := new(RemoveImageResponse) err := grpc.Invoke(ctx, "/runtime.ImageService/RemoveImage", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *imageServiceClient) ImageFsInfo(ctx context.Context, in *ImageFsInfoRequest, opts ...grpc.CallOption) (*ImageFsInfoResponse, error) { out := new(ImageFsInfoResponse) err := grpc.Invoke(ctx, "/runtime.ImageService/ImageFsInfo", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } // Server API for ImageService service type ImageServiceServer interface { // ListImages lists existing images. ListImages(context.Context, *ListImagesRequest) (*ListImagesResponse, error) // ImageStatus returns the status of the image. If the image is not // present, returns a response with ImageStatusResponse.Image set to // nil. ImageStatus(context.Context, *ImageStatusRequest) (*ImageStatusResponse, error) // PullImage pulls an image with authentication config. PullImage(context.Context, *PullImageRequest) (*PullImageResponse, error) // RemoveImage removes the image. // This call is idempotent, and must not return an error if the image has // already been removed. RemoveImage(context.Context, *RemoveImageRequest) (*RemoveImageResponse, error) // ImageFSInfo returns information of the filesystem that is used to store images. ImageFsInfo(context.Context, *ImageFsInfoRequest) (*ImageFsInfoResponse, error) } func RegisterImageServiceServer(s *grpc.Server, srv ImageServiceServer) { s.RegisterService(&_ImageService_serviceDesc, srv) } func _ImageService_ListImages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListImagesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ImageServiceServer).ListImages(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.ImageService/ListImages", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ImageServiceServer).ListImages(ctx, req.(*ListImagesRequest)) } return interceptor(ctx, in, info, handler) } func _ImageService_ImageStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ImageStatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ImageServiceServer).ImageStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.ImageService/ImageStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ImageServiceServer).ImageStatus(ctx, req.(*ImageStatusRequest)) } return interceptor(ctx, in, info, handler) } func _ImageService_PullImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PullImageRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ImageServiceServer).PullImage(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.ImageService/PullImage", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ImageServiceServer).PullImage(ctx, req.(*PullImageRequest)) } return interceptor(ctx, in, info, handler) } func _ImageService_RemoveImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RemoveImageRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ImageServiceServer).RemoveImage(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.ImageService/RemoveImage", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ImageServiceServer).RemoveImage(ctx, req.(*RemoveImageRequest)) } return interceptor(ctx, in, info, handler) } func _ImageService_ImageFsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ImageFsInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ImageServiceServer).ImageFsInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.ImageService/ImageFsInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ImageServiceServer).ImageFsInfo(ctx, req.(*ImageFsInfoRequest)) } return interceptor(ctx, in, info, handler) } var _ImageService_serviceDesc = grpc.ServiceDesc{ ServiceName: "runtime.ImageService", HandlerType: (*ImageServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListImages", Handler: _ImageService_ListImages_Handler, }, { MethodName: "ImageStatus", Handler: _ImageService_ImageStatus_Handler, }, { MethodName: "PullImage", Handler: _ImageService_PullImage_Handler, }, { MethodName: "RemoveImage", Handler: _ImageService_RemoveImage_Handler, }, { MethodName: "ImageFsInfo", Handler: _ImageService_ImageFsInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } func (m *VersionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *VersionRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Version) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Version))) i += copy(dAtA[i:], m.Version) } return i, nil } func (m *VersionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *VersionResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Version) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Version))) i += copy(dAtA[i:], m.Version) } if len(m.RuntimeName) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.RuntimeName))) i += copy(dAtA[i:], m.RuntimeName) } if len(m.RuntimeVersion) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.RuntimeVersion))) i += copy(dAtA[i:], m.RuntimeVersion) } if len(m.RuntimeApiVersion) > 0 { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.RuntimeApiVersion))) i += copy(dAtA[i:], m.RuntimeApiVersion) } return i, nil } func (m *DNSConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DNSConfig) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Servers) > 0 { for _, s := range m.Servers { dAtA[i] = 0xa i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if len(m.Searches) > 0 { for _, s := range m.Searches { dAtA[i] = 0x12 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if len(m.Options) > 0 { for _, s := range m.Options { dAtA[i] = 0x1a i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } return i, nil } func (m *PortMapping) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PortMapping) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Protocol != 0 { dAtA[i] = 0x8 i++ i = encodeVarintApi(dAtA, i, uint64(m.Protocol)) } if m.ContainerPort != 0 { dAtA[i] = 0x10 i++ i = encodeVarintApi(dAtA, i, uint64(m.ContainerPort)) } if m.HostPort != 0 { dAtA[i] = 0x18 i++ i = encodeVarintApi(dAtA, i, uint64(m.HostPort)) } if len(m.HostIp) > 0 { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.HostIp))) i += copy(dAtA[i:], m.HostIp) } return i, nil } func (m *Mount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Mount) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerPath) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath))) i += copy(dAtA[i:], m.ContainerPath) } if len(m.HostPath) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath))) i += copy(dAtA[i:], m.HostPath) } if m.Readonly { dAtA[i] = 0x18 i++ if m.Readonly { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.SelinuxRelabel { dAtA[i] = 0x20 i++ if m.SelinuxRelabel { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Propagation != 0 { dAtA[i] = 0x28 i++ i = encodeVarintApi(dAtA, i, uint64(m.Propagation)) } return i, nil } func (m *NamespaceOption) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NamespaceOption) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.HostNetwork { dAtA[i] = 0x8 i++ if m.HostNetwork { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.HostPid { dAtA[i] = 0x10 i++ if m.HostPid { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.HostIpc { dAtA[i] = 0x18 i++ if m.HostIpc { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *Int64Value) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Int64Value) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Value != 0 { dAtA[i] = 0x8 i++ i = encodeVarintApi(dAtA, i, uint64(m.Value)) } return i, nil } func (m *LinuxSandboxSecurityContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxSandboxSecurityContext) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.NamespaceOptions != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.NamespaceOptions.Size())) n1, err := m.NamespaceOptions.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n1 } if m.SelinuxOptions != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.SelinuxOptions.Size())) n2, err := m.SelinuxOptions.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n2 } if m.RunAsUser != nil { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.RunAsUser.Size())) n3, err := m.RunAsUser.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n3 } if m.ReadonlyRootfs { dAtA[i] = 0x20 i++ if m.ReadonlyRootfs { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if len(m.SupplementalGroups) > 0 { dAtA5 := make([]byte, len(m.SupplementalGroups)*10) var j4 int for _, num1 := range m.SupplementalGroups { num := uint64(num1) for num >= 1<<7 { dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 j4++ } dAtA5[j4] = uint8(num) j4++ } dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(j4)) i += copy(dAtA[i:], dAtA5[:j4]) } if m.Privileged { dAtA[i] = 0x30 i++ if m.Privileged { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if len(m.SeccompProfilePath) > 0 { dAtA[i] = 0x3a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.SeccompProfilePath))) i += copy(dAtA[i:], m.SeccompProfilePath) } return i, nil } func (m *LinuxPodSandboxConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxPodSandboxConfig) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.CgroupParent) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.CgroupParent))) i += copy(dAtA[i:], m.CgroupParent) } if m.SecurityContext != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.SecurityContext.Size())) n6, err := m.SecurityContext.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n6 } if len(m.Sysctls) > 0 { for k := range m.Sysctls { dAtA[i] = 0x1a i++ v := m.Sysctls[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *PodSandboxMetadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxMetadata) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if len(m.Uid) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Uid))) i += copy(dAtA[i:], m.Uid) } if len(m.Namespace) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Namespace))) i += copy(dAtA[i:], m.Namespace) } if m.Attempt != 0 { dAtA[i] = 0x20 i++ i = encodeVarintApi(dAtA, i, uint64(m.Attempt)) } return i, nil } func (m *PodSandboxConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxConfig) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Metadata != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Metadata.Size())) n7, err := m.Metadata.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n7 } if len(m.Hostname) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Hostname))) i += copy(dAtA[i:], m.Hostname) } if len(m.LogDirectory) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.LogDirectory))) i += copy(dAtA[i:], m.LogDirectory) } if m.DnsConfig != nil { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(m.DnsConfig.Size())) n8, err := m.DnsConfig.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n8 } if len(m.PortMappings) > 0 { for _, msg := range m.PortMappings { dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } if len(m.Labels) > 0 { for k := range m.Labels { dAtA[i] = 0x32 i++ v := m.Labels[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } if len(m.Annotations) > 0 { for k := range m.Annotations { dAtA[i] = 0x3a i++ v := m.Annotations[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } if m.Linux != nil { dAtA[i] = 0x42 i++ i = encodeVarintApi(dAtA, i, uint64(m.Linux.Size())) n9, err := m.Linux.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n9 } return i, nil } func (m *RunPodSandboxRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RunPodSandboxRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Config != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Config.Size())) n10, err := m.Config.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n10 } return i, nil } func (m *RunPodSandboxResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RunPodSandboxResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.PodSandboxId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i += copy(dAtA[i:], m.PodSandboxId) } return i, nil } func (m *StopPodSandboxRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StopPodSandboxRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.PodSandboxId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i += copy(dAtA[i:], m.PodSandboxId) } return i, nil } func (m *StopPodSandboxResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StopPodSandboxResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *RemovePodSandboxRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemovePodSandboxRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.PodSandboxId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i += copy(dAtA[i:], m.PodSandboxId) } return i, nil } func (m *RemovePodSandboxResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemovePodSandboxResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *PodSandboxStatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxStatusRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.PodSandboxId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i += copy(dAtA[i:], m.PodSandboxId) } if m.Verbose { dAtA[i] = 0x10 i++ if m.Verbose { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *PodSandboxNetworkStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxNetworkStatus) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Ip) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Ip))) i += copy(dAtA[i:], m.Ip) } return i, nil } func (m *Namespace) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Namespace) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Options != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Options.Size())) n11, err := m.Options.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n11 } return i, nil } func (m *LinuxPodSandboxStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxPodSandboxStatus) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Namespaces != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Namespaces.Size())) n12, err := m.Namespaces.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n12 } return i, nil } func (m *PodSandboxStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxStatus) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Id) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i += copy(dAtA[i:], m.Id) } if m.Metadata != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Metadata.Size())) n13, err := m.Metadata.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n13 } if m.State != 0 { dAtA[i] = 0x18 i++ i = encodeVarintApi(dAtA, i, uint64(m.State)) } if m.CreatedAt != 0 { dAtA[i] = 0x20 i++ i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) } if m.Network != nil { dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(m.Network.Size())) n14, err := m.Network.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n14 } if m.Linux != nil { dAtA[i] = 0x32 i++ i = encodeVarintApi(dAtA, i, uint64(m.Linux.Size())) n15, err := m.Linux.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n15 } if len(m.Labels) > 0 { for k := range m.Labels { dAtA[i] = 0x3a i++ v := m.Labels[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } if len(m.Annotations) > 0 { for k := range m.Annotations { dAtA[i] = 0x42 i++ v := m.Annotations[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *PodSandboxStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxStatusResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Status != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Status.Size())) n16, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n16 } if len(m.Info) > 0 { for k := range m.Info { dAtA[i] = 0x12 i++ v := m.Info[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *PodSandboxStateValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxStateValue) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.State != 0 { dAtA[i] = 0x8 i++ i = encodeVarintApi(dAtA, i, uint64(m.State)) } return i, nil } func (m *PodSandboxFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxFilter) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Id) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i += copy(dAtA[i:], m.Id) } if m.State != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.State.Size())) n17, err := m.State.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n17 } if len(m.LabelSelector) > 0 { for k := range m.LabelSelector { dAtA[i] = 0x1a i++ v := m.LabelSelector[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *ListPodSandboxRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListPodSandboxRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Filter != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Filter.Size())) n18, err := m.Filter.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n18 } return i, nil } func (m *PodSandbox) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandbox) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Id) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i += copy(dAtA[i:], m.Id) } if m.Metadata != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Metadata.Size())) n19, err := m.Metadata.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n19 } if m.State != 0 { dAtA[i] = 0x18 i++ i = encodeVarintApi(dAtA, i, uint64(m.State)) } if m.CreatedAt != 0 { dAtA[i] = 0x20 i++ i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) } if len(m.Labels) > 0 { for k := range m.Labels { dAtA[i] = 0x2a i++ v := m.Labels[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } if len(m.Annotations) > 0 { for k := range m.Annotations { dAtA[i] = 0x32 i++ v := m.Annotations[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *ListPodSandboxResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListPodSandboxResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *ImageSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageSpec) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Image) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Image))) i += copy(dAtA[i:], m.Image) } return i, nil } func (m *KeyValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Key) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Key))) i += copy(dAtA[i:], m.Key) } if len(m.Value) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Value))) i += copy(dAtA[i:], m.Value) } return i, nil } func (m *LinuxContainerResources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxContainerResources) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.CpuPeriod != 0 { dAtA[i] = 0x8 i++ i = encodeVarintApi(dAtA, i, uint64(m.CpuPeriod)) } if m.CpuQuota != 0 { dAtA[i] = 0x10 i++ i = encodeVarintApi(dAtA, i, uint64(m.CpuQuota)) } if m.CpuShares != 0 { dAtA[i] = 0x18 i++ i = encodeVarintApi(dAtA, i, uint64(m.CpuShares)) } if m.MemoryLimitInBytes != 0 { dAtA[i] = 0x20 i++ i = encodeVarintApi(dAtA, i, uint64(m.MemoryLimitInBytes)) } if m.OomScoreAdj != 0 { dAtA[i] = 0x28 i++ i = encodeVarintApi(dAtA, i, uint64(m.OomScoreAdj)) } if len(m.CpusetCpus) > 0 { dAtA[i] = 0x32 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.CpusetCpus))) i += copy(dAtA[i:], m.CpusetCpus) } if len(m.CpusetMems) > 0 { dAtA[i] = 0x3a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.CpusetMems))) i += copy(dAtA[i:], m.CpusetMems) } return i, nil } func (m *SELinuxOption) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *SELinuxOption) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.User) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.User))) i += copy(dAtA[i:], m.User) } if len(m.Role) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Role))) i += copy(dAtA[i:], m.Role) } if len(m.Type) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) i += copy(dAtA[i:], m.Type) } if len(m.Level) > 0 { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Level))) i += copy(dAtA[i:], m.Level) } return i, nil } func (m *Capability) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Capability) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.AddCapabilities) > 0 { for _, s := range m.AddCapabilities { dAtA[i] = 0xa i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if len(m.DropCapabilities) > 0 { for _, s := range m.DropCapabilities { dAtA[i] = 0x12 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } return i, nil } func (m *LinuxContainerSecurityContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxContainerSecurityContext) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Capabilities != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Capabilities.Size())) n20, err := m.Capabilities.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n20 } if m.Privileged { dAtA[i] = 0x10 i++ if m.Privileged { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.NamespaceOptions != nil { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.NamespaceOptions.Size())) n21, err := m.NamespaceOptions.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n21 } if m.SelinuxOptions != nil { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(m.SelinuxOptions.Size())) n22, err := m.SelinuxOptions.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n22 } if m.RunAsUser != nil { dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(m.RunAsUser.Size())) n23, err := m.RunAsUser.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n23 } if len(m.RunAsUsername) > 0 { dAtA[i] = 0x32 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.RunAsUsername))) i += copy(dAtA[i:], m.RunAsUsername) } if m.ReadonlyRootfs { dAtA[i] = 0x38 i++ if m.ReadonlyRootfs { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if len(m.SupplementalGroups) > 0 { dAtA25 := make([]byte, len(m.SupplementalGroups)*10) var j24 int for _, num1 := range m.SupplementalGroups { num := uint64(num1) for num >= 1<<7 { dAtA25[j24] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 j24++ } dAtA25[j24] = uint8(num) j24++ } dAtA[i] = 0x42 i++ i = encodeVarintApi(dAtA, i, uint64(j24)) i += copy(dAtA[i:], dAtA25[:j24]) } if len(m.ApparmorProfile) > 0 { dAtA[i] = 0x4a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ApparmorProfile))) i += copy(dAtA[i:], m.ApparmorProfile) } if len(m.SeccompProfilePath) > 0 { dAtA[i] = 0x52 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.SeccompProfilePath))) i += copy(dAtA[i:], m.SeccompProfilePath) } if m.NoNewPrivs { dAtA[i] = 0x58 i++ if m.NoNewPrivs { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *LinuxContainerConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxContainerConfig) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Resources != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Resources.Size())) n26, err := m.Resources.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n26 } if m.SecurityContext != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.SecurityContext.Size())) n27, err := m.SecurityContext.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n27 } return i, nil } func (m *ContainerMetadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerMetadata) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if m.Attempt != 0 { dAtA[i] = 0x10 i++ i = encodeVarintApi(dAtA, i, uint64(m.Attempt)) } return i, nil } func (m *Device) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Device) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerPath) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath))) i += copy(dAtA[i:], m.ContainerPath) } if len(m.HostPath) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath))) i += copy(dAtA[i:], m.HostPath) } if len(m.Permissions) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Permissions))) i += copy(dAtA[i:], m.Permissions) } return i, nil } func (m *ContainerConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerConfig) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Metadata != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Metadata.Size())) n28, err := m.Metadata.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n28 } if m.Image != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Image.Size())) n29, err := m.Image.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n29 } if len(m.Command) > 0 { for _, s := range m.Command { dAtA[i] = 0x1a i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if len(m.Args) > 0 { for _, s := range m.Args { dAtA[i] = 0x22 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if len(m.WorkingDir) > 0 { dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.WorkingDir))) i += copy(dAtA[i:], m.WorkingDir) } if len(m.Envs) > 0 { for _, msg := range m.Envs { dAtA[i] = 0x32 i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } if len(m.Mounts) > 0 { for _, msg := range m.Mounts { dAtA[i] = 0x3a i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } if len(m.Devices) > 0 { for _, msg := range m.Devices { dAtA[i] = 0x42 i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } if len(m.Labels) > 0 { for k := range m.Labels { dAtA[i] = 0x4a i++ v := m.Labels[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } if len(m.Annotations) > 0 { for k := range m.Annotations { dAtA[i] = 0x52 i++ v := m.Annotations[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } if len(m.LogPath) > 0 { dAtA[i] = 0x5a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.LogPath))) i += copy(dAtA[i:], m.LogPath) } if m.Stdin { dAtA[i] = 0x60 i++ if m.Stdin { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.StdinOnce { dAtA[i] = 0x68 i++ if m.StdinOnce { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Tty { dAtA[i] = 0x70 i++ if m.Tty { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Linux != nil { dAtA[i] = 0x7a i++ i = encodeVarintApi(dAtA, i, uint64(m.Linux.Size())) n30, err := m.Linux.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n30 } return i, nil } func (m *CreateContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CreateContainerRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.PodSandboxId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i += copy(dAtA[i:], m.PodSandboxId) } if m.Config != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Config.Size())) n31, err := m.Config.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n31 } if m.SandboxConfig != nil { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.SandboxConfig.Size())) n32, err := m.SandboxConfig.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n32 } return i, nil } func (m *CreateContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CreateContainerResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } return i, nil } func (m *StartContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StartContainerRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } return i, nil } func (m *StartContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StartContainerResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *StopContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StopContainerRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } if m.Timeout != 0 { dAtA[i] = 0x10 i++ i = encodeVarintApi(dAtA, i, uint64(m.Timeout)) } return i, nil } func (m *StopContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StopContainerResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *RemoveContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemoveContainerRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } return i, nil } func (m *RemoveContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemoveContainerResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *ContainerStateValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStateValue) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.State != 0 { dAtA[i] = 0x8 i++ i = encodeVarintApi(dAtA, i, uint64(m.State)) } return i, nil } func (m *ContainerFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerFilter) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Id) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i += copy(dAtA[i:], m.Id) } if m.State != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.State.Size())) n33, err := m.State.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n33 } if len(m.PodSandboxId) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i += copy(dAtA[i:], m.PodSandboxId) } if len(m.LabelSelector) > 0 { for k := range m.LabelSelector { dAtA[i] = 0x22 i++ v := m.LabelSelector[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *ListContainersRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListContainersRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Filter != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Filter.Size())) n34, err := m.Filter.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n34 } return i, nil } func (m *Container) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Container) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Id) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i += copy(dAtA[i:], m.Id) } if len(m.PodSandboxId) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i += copy(dAtA[i:], m.PodSandboxId) } if m.Metadata != nil { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.Metadata.Size())) n35, err := m.Metadata.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n35 } if m.Image != nil { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(m.Image.Size())) n36, err := m.Image.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n36 } if len(m.ImageRef) > 0 { dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) i += copy(dAtA[i:], m.ImageRef) } if m.State != 0 { dAtA[i] = 0x30 i++ i = encodeVarintApi(dAtA, i, uint64(m.State)) } if m.CreatedAt != 0 { dAtA[i] = 0x38 i++ i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) } if len(m.Labels) > 0 { for k := range m.Labels { dAtA[i] = 0x42 i++ v := m.Labels[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } if len(m.Annotations) > 0 { for k := range m.Annotations { dAtA[i] = 0x4a i++ v := m.Annotations[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *ListContainersResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListContainersResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Containers) > 0 { for _, msg := range m.Containers { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *ContainerStatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatusRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } if m.Verbose { dAtA[i] = 0x10 i++ if m.Verbose { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *ContainerStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatus) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Id) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i += copy(dAtA[i:], m.Id) } if m.Metadata != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Metadata.Size())) n37, err := m.Metadata.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n37 } if m.State != 0 { dAtA[i] = 0x18 i++ i = encodeVarintApi(dAtA, i, uint64(m.State)) } if m.CreatedAt != 0 { dAtA[i] = 0x20 i++ i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) } if m.StartedAt != 0 { dAtA[i] = 0x28 i++ i = encodeVarintApi(dAtA, i, uint64(m.StartedAt)) } if m.FinishedAt != 0 { dAtA[i] = 0x30 i++ i = encodeVarintApi(dAtA, i, uint64(m.FinishedAt)) } if m.ExitCode != 0 { dAtA[i] = 0x38 i++ i = encodeVarintApi(dAtA, i, uint64(m.ExitCode)) } if m.Image != nil { dAtA[i] = 0x42 i++ i = encodeVarintApi(dAtA, i, uint64(m.Image.Size())) n38, err := m.Image.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n38 } if len(m.ImageRef) > 0 { dAtA[i] = 0x4a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) i += copy(dAtA[i:], m.ImageRef) } if len(m.Reason) > 0 { dAtA[i] = 0x52 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Reason))) i += copy(dAtA[i:], m.Reason) } if len(m.Message) > 0 { dAtA[i] = 0x5a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Message))) i += copy(dAtA[i:], m.Message) } if len(m.Labels) > 0 { for k := range m.Labels { dAtA[i] = 0x62 i++ v := m.Labels[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } if len(m.Annotations) > 0 { for k := range m.Annotations { dAtA[i] = 0x6a i++ v := m.Annotations[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } if len(m.Mounts) > 0 { for _, msg := range m.Mounts { dAtA[i] = 0x72 i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } if len(m.LogPath) > 0 { dAtA[i] = 0x7a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.LogPath))) i += copy(dAtA[i:], m.LogPath) } return i, nil } func (m *ContainerStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatusResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Status != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Status.Size())) n39, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n39 } if len(m.Info) > 0 { for k := range m.Info { dAtA[i] = 0x12 i++ v := m.Info[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *UpdateContainerResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UpdateContainerResourcesRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } if m.Linux != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Linux.Size())) n40, err := m.Linux.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n40 } return i, nil } func (m *UpdateContainerResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UpdateContainerResourcesResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *ExecSyncRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ExecSyncRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } if len(m.Cmd) > 0 { for _, s := range m.Cmd { dAtA[i] = 0x12 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if m.Timeout != 0 { dAtA[i] = 0x18 i++ i = encodeVarintApi(dAtA, i, uint64(m.Timeout)) } return i, nil } func (m *ExecSyncResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ExecSyncResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Stdout) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Stdout))) i += copy(dAtA[i:], m.Stdout) } if len(m.Stderr) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Stderr))) i += copy(dAtA[i:], m.Stderr) } if m.ExitCode != 0 { dAtA[i] = 0x18 i++ i = encodeVarintApi(dAtA, i, uint64(m.ExitCode)) } return i, nil } func (m *ExecRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ExecRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } if len(m.Cmd) > 0 { for _, s := range m.Cmd { dAtA[i] = 0x12 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if m.Tty { dAtA[i] = 0x18 i++ if m.Tty { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Stdin { dAtA[i] = 0x20 i++ if m.Stdin { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Stdout { dAtA[i] = 0x28 i++ if m.Stdout { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Stderr { dAtA[i] = 0x30 i++ if m.Stderr { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *ExecResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ExecResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Url) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) i += copy(dAtA[i:], m.Url) } return i, nil } func (m *AttachRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AttachRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } if m.Stdin { dAtA[i] = 0x10 i++ if m.Stdin { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Tty { dAtA[i] = 0x18 i++ if m.Tty { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Stdout { dAtA[i] = 0x20 i++ if m.Stdout { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Stderr { dAtA[i] = 0x28 i++ if m.Stderr { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *AttachResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AttachResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Url) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) i += copy(dAtA[i:], m.Url) } return i, nil } func (m *PortForwardRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PortForwardRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.PodSandboxId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i += copy(dAtA[i:], m.PodSandboxId) } if len(m.Port) > 0 { dAtA42 := make([]byte, len(m.Port)*10) var j41 int for _, num1 := range m.Port { num := uint64(num1) for num >= 1<<7 { dAtA42[j41] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 j41++ } dAtA42[j41] = uint8(num) j41++ } dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(j41)) i += copy(dAtA[i:], dAtA42[:j41]) } return i, nil } func (m *PortForwardResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PortForwardResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Url) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) i += copy(dAtA[i:], m.Url) } return i, nil } func (m *ImageFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageFilter) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Image != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Image.Size())) n43, err := m.Image.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n43 } return i, nil } func (m *ListImagesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListImagesRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Filter != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Filter.Size())) n44, err := m.Filter.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n44 } return i, nil } func (m *Image) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Image) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Id) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i += copy(dAtA[i:], m.Id) } if len(m.RepoTags) > 0 { for _, s := range m.RepoTags { dAtA[i] = 0x12 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if len(m.RepoDigests) > 0 { for _, s := range m.RepoDigests { dAtA[i] = 0x1a i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if m.Size_ != 0 { dAtA[i] = 0x20 i++ i = encodeVarintApi(dAtA, i, uint64(m.Size_)) } if m.Uid != nil { dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(m.Uid.Size())) n45, err := m.Uid.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n45 } if len(m.Username) > 0 { dAtA[i] = 0x32 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Username))) i += copy(dAtA[i:], m.Username) } return i, nil } func (m *ListImagesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListImagesResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Images) > 0 { for _, msg := range m.Images { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *ImageStatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageStatusRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Image != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Image.Size())) n46, err := m.Image.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n46 } if m.Verbose { dAtA[i] = 0x10 i++ if m.Verbose { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *ImageStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageStatusResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Image != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Image.Size())) n47, err := m.Image.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n47 } if len(m.Info) > 0 { for k := range m.Info { dAtA[i] = 0x12 i++ v := m.Info[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *AuthConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthConfig) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Username) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Username))) i += copy(dAtA[i:], m.Username) } if len(m.Password) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Password))) i += copy(dAtA[i:], m.Password) } if len(m.Auth) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Auth))) i += copy(dAtA[i:], m.Auth) } if len(m.ServerAddress) > 0 { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ServerAddress))) i += copy(dAtA[i:], m.ServerAddress) } if len(m.IdentityToken) > 0 { dAtA[i] = 0x2a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.IdentityToken))) i += copy(dAtA[i:], m.IdentityToken) } if len(m.RegistryToken) > 0 { dAtA[i] = 0x32 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.RegistryToken))) i += copy(dAtA[i:], m.RegistryToken) } return i, nil } func (m *PullImageRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PullImageRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Image != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Image.Size())) n48, err := m.Image.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n48 } if m.Auth != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Auth.Size())) n49, err := m.Auth.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n49 } if m.SandboxConfig != nil { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.SandboxConfig.Size())) n50, err := m.SandboxConfig.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n50 } return i, nil } func (m *PullImageResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PullImageResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ImageRef) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) i += copy(dAtA[i:], m.ImageRef) } return i, nil } func (m *RemoveImageRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemoveImageRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Image != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Image.Size())) n51, err := m.Image.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n51 } return i, nil } func (m *RemoveImageResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemoveImageResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *NetworkConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NetworkConfig) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.PodCidr) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.PodCidr))) i += copy(dAtA[i:], m.PodCidr) } return i, nil } func (m *RuntimeConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RuntimeConfig) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.NetworkConfig != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.NetworkConfig.Size())) n52, err := m.NetworkConfig.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n52 } return i, nil } func (m *UpdateRuntimeConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UpdateRuntimeConfigRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.RuntimeConfig != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.RuntimeConfig.Size())) n53, err := m.RuntimeConfig.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n53 } return i, nil } func (m *UpdateRuntimeConfigResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UpdateRuntimeConfigResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *RuntimeCondition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RuntimeCondition) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Type) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) i += copy(dAtA[i:], m.Type) } if m.Status { dAtA[i] = 0x10 i++ if m.Status { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if len(m.Reason) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Reason))) i += copy(dAtA[i:], m.Reason) } if len(m.Message) > 0 { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Message))) i += copy(dAtA[i:], m.Message) } return i, nil } func (m *RuntimeStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RuntimeStatus) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Conditions) > 0 { for _, msg := range m.Conditions { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *StatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Verbose { dAtA[i] = 0x8 i++ if m.Verbose { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *StatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Status != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Status.Size())) n54, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n54 } if len(m.Info) > 0 { for k := range m.Info { dAtA[i] = 0x12 i++ v := m.Info[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *ImageFsInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageFsInfoRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *UInt64Value) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UInt64Value) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Value != 0 { dAtA[i] = 0x8 i++ i = encodeVarintApi(dAtA, i, uint64(m.Value)) } return i, nil } func (m *StorageIdentifier) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StorageIdentifier) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Uuid) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Uuid))) i += copy(dAtA[i:], m.Uuid) } return i, nil } func (m *FilesystemUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *FilesystemUsage) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Timestamp != 0 { dAtA[i] = 0x8 i++ i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) } if m.StorageId != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.StorageId.Size())) n55, err := m.StorageId.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n55 } if m.UsedBytes != nil { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.UsedBytes.Size())) n56, err := m.UsedBytes.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n56 } if m.InodesUsed != nil { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(m.InodesUsed.Size())) n57, err := m.InodesUsed.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n57 } return i, nil } func (m *ImageFsInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageFsInfoResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ImageFilesystems) > 0 { for _, msg := range m.ImageFilesystems { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *ContainerStatsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatsRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.ContainerId) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i += copy(dAtA[i:], m.ContainerId) } return i, nil } func (m *ContainerStatsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatsResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Stats != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Stats.Size())) n58, err := m.Stats.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n58 } return i, nil } func (m *ListContainerStatsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListContainerStatsRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Filter != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Filter.Size())) n59, err := m.Filter.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n59 } return i, nil } func (m *ContainerStatsFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatsFilter) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Id) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i += copy(dAtA[i:], m.Id) } if len(m.PodSandboxId) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i += copy(dAtA[i:], m.PodSandboxId) } if len(m.LabelSelector) > 0 { for k := range m.LabelSelector { dAtA[i] = 0x1a i++ v := m.LabelSelector[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *ListContainerStatsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListContainerStatsResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Stats) > 0 { for _, msg := range m.Stats { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *ContainerAttributes) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerAttributes) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Id) > 0 { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i += copy(dAtA[i:], m.Id) } if m.Metadata != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Metadata.Size())) n60, err := m.Metadata.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n60 } if len(m.Labels) > 0 { for k := range m.Labels { dAtA[i] = 0x1a i++ v := m.Labels[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } if len(m.Annotations) > 0 { for k := range m.Annotations { dAtA[i] = 0x22 i++ v := m.Annotations[k] mapSize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) i = encodeVarintApi(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(len(v))) i += copy(dAtA[i:], v) } } return i, nil } func (m *ContainerStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStats) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Attributes != nil { dAtA[i] = 0xa i++ i = encodeVarintApi(dAtA, i, uint64(m.Attributes.Size())) n61, err := m.Attributes.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n61 } if m.Cpu != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.Cpu.Size())) n62, err := m.Cpu.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n62 } if m.Memory != nil { dAtA[i] = 0x1a i++ i = encodeVarintApi(dAtA, i, uint64(m.Memory.Size())) n63, err := m.Memory.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n63 } if m.WritableLayer != nil { dAtA[i] = 0x22 i++ i = encodeVarintApi(dAtA, i, uint64(m.WritableLayer.Size())) n64, err := m.WritableLayer.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n64 } return i, nil } func (m *CpuUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CpuUsage) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Timestamp != 0 { dAtA[i] = 0x8 i++ i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) } if m.UsageCoreNanoSeconds != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.UsageCoreNanoSeconds.Size())) n65, err := m.UsageCoreNanoSeconds.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n65 } return i, nil } func (m *MemoryUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MemoryUsage) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Timestamp != 0 { dAtA[i] = 0x8 i++ i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) } if m.WorkingSetBytes != nil { dAtA[i] = 0x12 i++ i = encodeVarintApi(dAtA, i, uint64(m.WorkingSetBytes.Size())) n66, err := m.WorkingSetBytes.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n66 } return i, nil } func encodeFixed64Api(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) dAtA[offset+2] = uint8(v >> 16) dAtA[offset+3] = uint8(v >> 24) dAtA[offset+4] = uint8(v >> 32) dAtA[offset+5] = uint8(v >> 40) dAtA[offset+6] = uint8(v >> 48) dAtA[offset+7] = uint8(v >> 56) return offset + 8 } func encodeFixed32Api(dAtA []byte, offset int, v uint32) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) dAtA[offset+2] = uint8(v >> 16) dAtA[offset+3] = uint8(v >> 24) return offset + 4 } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return offset + 1 } func (m *VersionRequest) Size() (n int) { var l int _ = l l = len(m.Version) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *VersionResponse) Size() (n int) { var l int _ = l l = len(m.Version) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.RuntimeName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.RuntimeVersion) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.RuntimeApiVersion) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *DNSConfig) Size() (n int) { var l int _ = l if len(m.Servers) > 0 { for _, s := range m.Servers { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.Searches) > 0 { for _, s := range m.Searches { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.Options) > 0 { for _, s := range m.Options { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *PortMapping) Size() (n int) { var l int _ = l if m.Protocol != 0 { n += 1 + sovApi(uint64(m.Protocol)) } if m.ContainerPort != 0 { n += 1 + sovApi(uint64(m.ContainerPort)) } if m.HostPort != 0 { n += 1 + sovApi(uint64(m.HostPort)) } l = len(m.HostIp) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *Mount) Size() (n int) { var l int _ = l l = len(m.ContainerPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.HostPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Readonly { n += 2 } if m.SelinuxRelabel { n += 2 } if m.Propagation != 0 { n += 1 + sovApi(uint64(m.Propagation)) } return n } func (m *NamespaceOption) Size() (n int) { var l int _ = l if m.HostNetwork { n += 2 } if m.HostPid { n += 2 } if m.HostIpc { n += 2 } return n } func (m *Int64Value) Size() (n int) { var l int _ = l if m.Value != 0 { n += 1 + sovApi(uint64(m.Value)) } return n } func (m *LinuxSandboxSecurityContext) Size() (n int) { var l int _ = l if m.NamespaceOptions != nil { l = m.NamespaceOptions.Size() n += 1 + l + sovApi(uint64(l)) } if m.SelinuxOptions != nil { l = m.SelinuxOptions.Size() n += 1 + l + sovApi(uint64(l)) } if m.RunAsUser != nil { l = m.RunAsUser.Size() n += 1 + l + sovApi(uint64(l)) } if m.ReadonlyRootfs { n += 2 } if len(m.SupplementalGroups) > 0 { l = 0 for _, e := range m.SupplementalGroups { l += sovApi(uint64(e)) } n += 1 + sovApi(uint64(l)) + l } if m.Privileged { n += 2 } l = len(m.SeccompProfilePath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *LinuxPodSandboxConfig) Size() (n int) { var l int _ = l l = len(m.CgroupParent) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.SecurityContext != nil { l = m.SecurityContext.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Sysctls) > 0 { for k, v := range m.Sysctls { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *PodSandboxMetadata) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Uid) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Namespace) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Attempt != 0 { n += 1 + sovApi(uint64(m.Attempt)) } return n } func (m *PodSandboxConfig) Size() (n int) { var l int _ = l if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.Hostname) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.LogDirectory) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.DnsConfig != nil { l = m.DnsConfig.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.PortMappings) > 0 { for _, e := range m.PortMappings { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if m.Linux != nil { l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *RunPodSandboxRequest) Size() (n int) { var l int _ = l if m.Config != nil { l = m.Config.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *RunPodSandboxResponse) Size() (n int) { var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *StopPodSandboxRequest) Size() (n int) { var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *StopPodSandboxResponse) Size() (n int) { var l int _ = l return n } func (m *RemovePodSandboxRequest) Size() (n int) { var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RemovePodSandboxResponse) Size() (n int) { var l int _ = l return n } func (m *PodSandboxStatusRequest) Size() (n int) { var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Verbose { n += 2 } return n } func (m *PodSandboxNetworkStatus) Size() (n int) { var l int _ = l l = len(m.Ip) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *Namespace) Size() (n int) { var l int _ = l if m.Options != nil { l = m.Options.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *LinuxPodSandboxStatus) Size() (n int) { var l int _ = l if m.Namespaces != nil { l = m.Namespaces.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *PodSandboxStatus) Size() (n int) { var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } if m.CreatedAt != 0 { n += 1 + sovApi(uint64(m.CreatedAt)) } if m.Network != nil { l = m.Network.Size() n += 1 + l + sovApi(uint64(l)) } if m.Linux != nil { l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *PodSandboxStatusResponse) Size() (n int) { var l int _ = l if m.Status != nil { l = m.Status.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Info) > 0 { for k, v := range m.Info { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *PodSandboxStateValue) Size() (n int) { var l int _ = l if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } return n } func (m *PodSandboxFilter) Size() (n int) { var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.State != nil { l = m.State.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.LabelSelector) > 0 { for k, v := range m.LabelSelector { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ListPodSandboxRequest) Size() (n int) { var l int _ = l if m.Filter != nil { l = m.Filter.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *PodSandbox) Size() (n int) { var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } if m.CreatedAt != 0 { n += 1 + sovApi(uint64(m.CreatedAt)) } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ListPodSandboxResponse) Size() (n int) { var l int _ = l if len(m.Items) > 0 { for _, e := range m.Items { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ImageSpec) Size() (n int) { var l int _ = l l = len(m.Image) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *KeyValue) Size() (n int) { var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Value) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *LinuxContainerResources) Size() (n int) { var l int _ = l if m.CpuPeriod != 0 { n += 1 + sovApi(uint64(m.CpuPeriod)) } if m.CpuQuota != 0 { n += 1 + sovApi(uint64(m.CpuQuota)) } if m.CpuShares != 0 { n += 1 + sovApi(uint64(m.CpuShares)) } if m.MemoryLimitInBytes != 0 { n += 1 + sovApi(uint64(m.MemoryLimitInBytes)) } if m.OomScoreAdj != 0 { n += 1 + sovApi(uint64(m.OomScoreAdj)) } l = len(m.CpusetCpus) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.CpusetMems) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *SELinuxOption) Size() (n int) { var l int _ = l l = len(m.User) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Role) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Type) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Level) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *Capability) Size() (n int) { var l int _ = l if len(m.AddCapabilities) > 0 { for _, s := range m.AddCapabilities { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.DropCapabilities) > 0 { for _, s := range m.DropCapabilities { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *LinuxContainerSecurityContext) Size() (n int) { var l int _ = l if m.Capabilities != nil { l = m.Capabilities.Size() n += 1 + l + sovApi(uint64(l)) } if m.Privileged { n += 2 } if m.NamespaceOptions != nil { l = m.NamespaceOptions.Size() n += 1 + l + sovApi(uint64(l)) } if m.SelinuxOptions != nil { l = m.SelinuxOptions.Size() n += 1 + l + sovApi(uint64(l)) } if m.RunAsUser != nil { l = m.RunAsUser.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.RunAsUsername) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.ReadonlyRootfs { n += 2 } if len(m.SupplementalGroups) > 0 { l = 0 for _, e := range m.SupplementalGroups { l += sovApi(uint64(e)) } n += 1 + sovApi(uint64(l)) + l } l = len(m.ApparmorProfile) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.SeccompProfilePath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.NoNewPrivs { n += 2 } return n } func (m *LinuxContainerConfig) Size() (n int) { var l int _ = l if m.Resources != nil { l = m.Resources.Size() n += 1 + l + sovApi(uint64(l)) } if m.SecurityContext != nil { l = m.SecurityContext.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ContainerMetadata) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Attempt != 0 { n += 1 + sovApi(uint64(m.Attempt)) } return n } func (m *Device) Size() (n int) { var l int _ = l l = len(m.ContainerPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.HostPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Permissions) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ContainerConfig) Size() (n int) { var l int _ = l if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Command) > 0 { for _, s := range m.Command { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.Args) > 0 { for _, s := range m.Args { l = len(s) n += 1 + l + sovApi(uint64(l)) } } l = len(m.WorkingDir) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Envs) > 0 { for _, e := range m.Envs { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Mounts) > 0 { for _, e := range m.Mounts { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } l = len(m.LogPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Stdin { n += 2 } if m.StdinOnce { n += 2 } if m.Tty { n += 2 } if m.Linux != nil { l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *CreateContainerRequest) Size() (n int) { var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Config != nil { l = m.Config.Size() n += 1 + l + sovApi(uint64(l)) } if m.SandboxConfig != nil { l = m.SandboxConfig.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *CreateContainerResponse) Size() (n int) { var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *StartContainerRequest) Size() (n int) { var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *StartContainerResponse) Size() (n int) { var l int _ = l return n } func (m *StopContainerRequest) Size() (n int) { var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Timeout != 0 { n += 1 + sovApi(uint64(m.Timeout)) } return n } func (m *StopContainerResponse) Size() (n int) { var l int _ = l return n } func (m *RemoveContainerRequest) Size() (n int) { var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RemoveContainerResponse) Size() (n int) { var l int _ = l return n } func (m *ContainerStateValue) Size() (n int) { var l int _ = l if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } return n } func (m *ContainerFilter) Size() (n int) { var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.State != nil { l = m.State.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.LabelSelector) > 0 { for k, v := range m.LabelSelector { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ListContainersRequest) Size() (n int) { var l int _ = l if m.Filter != nil { l = m.Filter.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *Container) Size() (n int) { var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.ImageRef) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } if m.CreatedAt != 0 { n += 1 + sovApi(uint64(m.CreatedAt)) } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ListContainersResponse) Size() (n int) { var l int _ = l if len(m.Containers) > 0 { for _, e := range m.Containers { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerStatusRequest) Size() (n int) { var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Verbose { n += 2 } return n } func (m *ContainerStatus) Size() (n int) { var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } if m.CreatedAt != 0 { n += 1 + sovApi(uint64(m.CreatedAt)) } if m.StartedAt != 0 { n += 1 + sovApi(uint64(m.StartedAt)) } if m.FinishedAt != 0 { n += 1 + sovApi(uint64(m.FinishedAt)) } if m.ExitCode != 0 { n += 1 + sovApi(uint64(m.ExitCode)) } if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.ImageRef) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Reason) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Message) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Mounts) > 0 { for _, e := range m.Mounts { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } l = len(m.LogPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ContainerStatusResponse) Size() (n int) { var l int _ = l if m.Status != nil { l = m.Status.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Info) > 0 { for k, v := range m.Info { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *UpdateContainerResourcesRequest) Size() (n int) { var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Linux != nil { l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *UpdateContainerResourcesResponse) Size() (n int) { var l int _ = l return n } func (m *ExecSyncRequest) Size() (n int) { var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Cmd) > 0 { for _, s := range m.Cmd { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if m.Timeout != 0 { n += 1 + sovApi(uint64(m.Timeout)) } return n } func (m *ExecSyncResponse) Size() (n int) { var l int _ = l l = len(m.Stdout) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Stderr) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.ExitCode != 0 { n += 1 + sovApi(uint64(m.ExitCode)) } return n } func (m *ExecRequest) Size() (n int) { var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Cmd) > 0 { for _, s := range m.Cmd { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if m.Tty { n += 2 } if m.Stdin { n += 2 } if m.Stdout { n += 2 } if m.Stderr { n += 2 } return n } func (m *ExecResponse) Size() (n int) { var l int _ = l l = len(m.Url) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *AttachRequest) Size() (n int) { var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Stdin { n += 2 } if m.Tty { n += 2 } if m.Stdout { n += 2 } if m.Stderr { n += 2 } return n } func (m *AttachResponse) Size() (n int) { var l int _ = l l = len(m.Url) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *PortForwardRequest) Size() (n int) { var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Port) > 0 { l = 0 for _, e := range m.Port { l += sovApi(uint64(e)) } n += 1 + sovApi(uint64(l)) + l } return n } func (m *PortForwardResponse) Size() (n int) { var l int _ = l l = len(m.Url) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ImageFilter) Size() (n int) { var l int _ = l if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ListImagesRequest) Size() (n int) { var l int _ = l if m.Filter != nil { l = m.Filter.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *Image) Size() (n int) { var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.RepoTags) > 0 { for _, s := range m.RepoTags { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.RepoDigests) > 0 { for _, s := range m.RepoDigests { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if m.Size_ != 0 { n += 1 + sovApi(uint64(m.Size_)) } if m.Uid != nil { l = m.Uid.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.Username) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ListImagesResponse) Size() (n int) { var l int _ = l if len(m.Images) > 0 { for _, e := range m.Images { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ImageStatusRequest) Size() (n int) { var l int _ = l if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } if m.Verbose { n += 2 } return n } func (m *ImageStatusResponse) Size() (n int) { var l int _ = l if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Info) > 0 { for k, v := range m.Info { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *AuthConfig) Size() (n int) { var l int _ = l l = len(m.Username) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Password) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Auth) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.ServerAddress) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.IdentityToken) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.RegistryToken) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *PullImageRequest) Size() (n int) { var l int _ = l if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } if m.Auth != nil { l = m.Auth.Size() n += 1 + l + sovApi(uint64(l)) } if m.SandboxConfig != nil { l = m.SandboxConfig.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *PullImageResponse) Size() (n int) { var l int _ = l l = len(m.ImageRef) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RemoveImageRequest) Size() (n int) { var l int _ = l if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *RemoveImageResponse) Size() (n int) { var l int _ = l return n } func (m *NetworkConfig) Size() (n int) { var l int _ = l l = len(m.PodCidr) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RuntimeConfig) Size() (n int) { var l int _ = l if m.NetworkConfig != nil { l = m.NetworkConfig.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *UpdateRuntimeConfigRequest) Size() (n int) { var l int _ = l if m.RuntimeConfig != nil { l = m.RuntimeConfig.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *UpdateRuntimeConfigResponse) Size() (n int) { var l int _ = l return n } func (m *RuntimeCondition) Size() (n int) { var l int _ = l l = len(m.Type) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Status { n += 2 } l = len(m.Reason) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Message) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RuntimeStatus) Size() (n int) { var l int _ = l if len(m.Conditions) > 0 { for _, e := range m.Conditions { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *StatusRequest) Size() (n int) { var l int _ = l if m.Verbose { n += 2 } return n } func (m *StatusResponse) Size() (n int) { var l int _ = l if m.Status != nil { l = m.Status.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Info) > 0 { for k, v := range m.Info { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ImageFsInfoRequest) Size() (n int) { var l int _ = l return n } func (m *UInt64Value) Size() (n int) { var l int _ = l if m.Value != 0 { n += 1 + sovApi(uint64(m.Value)) } return n } func (m *StorageIdentifier) Size() (n int) { var l int _ = l l = len(m.Uuid) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *FilesystemUsage) Size() (n int) { var l int _ = l if m.Timestamp != 0 { n += 1 + sovApi(uint64(m.Timestamp)) } if m.StorageId != nil { l = m.StorageId.Size() n += 1 + l + sovApi(uint64(l)) } if m.UsedBytes != nil { l = m.UsedBytes.Size() n += 1 + l + sovApi(uint64(l)) } if m.InodesUsed != nil { l = m.InodesUsed.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ImageFsInfoResponse) Size() (n int) { var l int _ = l if len(m.ImageFilesystems) > 0 { for _, e := range m.ImageFilesystems { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerStatsRequest) Size() (n int) { var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ContainerStatsResponse) Size() (n int) { var l int _ = l if m.Stats != nil { l = m.Stats.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ListContainerStatsRequest) Size() (n int) { var l int _ = l if m.Filter != nil { l = m.Filter.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ContainerStatsFilter) Size() (n int) { var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.LabelSelector) > 0 { for k, v := range m.LabelSelector { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ListContainerStatsResponse) Size() (n int) { var l int _ = l if len(m.Stats) > 0 { for _, e := range m.Stats { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerAttributes) Size() (n int) { var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ContainerStats) Size() (n int) { var l int _ = l if m.Attributes != nil { l = m.Attributes.Size() n += 1 + l + sovApi(uint64(l)) } if m.Cpu != nil { l = m.Cpu.Size() n += 1 + l + sovApi(uint64(l)) } if m.Memory != nil { l = m.Memory.Size() n += 1 + l + sovApi(uint64(l)) } if m.WritableLayer != nil { l = m.WritableLayer.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *CpuUsage) Size() (n int) { var l int _ = l if m.Timestamp != 0 { n += 1 + sovApi(uint64(m.Timestamp)) } if m.UsageCoreNanoSeconds != nil { l = m.UsageCoreNanoSeconds.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *MemoryUsage) Size() (n int) { var l int _ = l if m.Timestamp != 0 { n += 1 + sovApi(uint64(m.Timestamp)) } if m.WorkingSetBytes != nil { l = m.WorkingSetBytes.Size() n += 1 + l + sovApi(uint64(l)) } return n } func sovApi(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *VersionRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&VersionRequest{`, `Version:` + fmt.Sprintf("%v", this.Version) + `,`, `}`, }, "") return s } func (this *VersionResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&VersionResponse{`, `Version:` + fmt.Sprintf("%v", this.Version) + `,`, `RuntimeName:` + fmt.Sprintf("%v", this.RuntimeName) + `,`, `RuntimeVersion:` + fmt.Sprintf("%v", this.RuntimeVersion) + `,`, `RuntimeApiVersion:` + fmt.Sprintf("%v", this.RuntimeApiVersion) + `,`, `}`, }, "") return s } func (this *DNSConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&DNSConfig{`, `Servers:` + fmt.Sprintf("%v", this.Servers) + `,`, `Searches:` + fmt.Sprintf("%v", this.Searches) + `,`, `Options:` + fmt.Sprintf("%v", this.Options) + `,`, `}`, }, "") return s } func (this *PortMapping) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PortMapping{`, `Protocol:` + fmt.Sprintf("%v", this.Protocol) + `,`, `ContainerPort:` + fmt.Sprintf("%v", this.ContainerPort) + `,`, `HostPort:` + fmt.Sprintf("%v", this.HostPort) + `,`, `HostIp:` + fmt.Sprintf("%v", this.HostIp) + `,`, `}`, }, "") return s } func (this *Mount) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Mount{`, `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, `Readonly:` + fmt.Sprintf("%v", this.Readonly) + `,`, `SelinuxRelabel:` + fmt.Sprintf("%v", this.SelinuxRelabel) + `,`, `Propagation:` + fmt.Sprintf("%v", this.Propagation) + `,`, `}`, }, "") return s } func (this *NamespaceOption) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&NamespaceOption{`, `HostNetwork:` + fmt.Sprintf("%v", this.HostNetwork) + `,`, `HostPid:` + fmt.Sprintf("%v", this.HostPid) + `,`, `HostIpc:` + fmt.Sprintf("%v", this.HostIpc) + `,`, `}`, }, "") return s } func (this *Int64Value) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Int64Value{`, `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `}`, }, "") return s } func (this *LinuxSandboxSecurityContext) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LinuxSandboxSecurityContext{`, `NamespaceOptions:` + strings.Replace(fmt.Sprintf("%v", this.NamespaceOptions), "NamespaceOption", "NamespaceOption", 1) + `,`, `SelinuxOptions:` + strings.Replace(fmt.Sprintf("%v", this.SelinuxOptions), "SELinuxOption", "SELinuxOption", 1) + `,`, `RunAsUser:` + strings.Replace(fmt.Sprintf("%v", this.RunAsUser), "Int64Value", "Int64Value", 1) + `,`, `ReadonlyRootfs:` + fmt.Sprintf("%v", this.ReadonlyRootfs) + `,`, `SupplementalGroups:` + fmt.Sprintf("%v", this.SupplementalGroups) + `,`, `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, `SeccompProfilePath:` + fmt.Sprintf("%v", this.SeccompProfilePath) + `,`, `}`, }, "") return s } func (this *LinuxPodSandboxConfig) String() string { if this == nil { return "nil" } keysForSysctls := make([]string, 0, len(this.Sysctls)) for k := range this.Sysctls { keysForSysctls = append(keysForSysctls, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForSysctls) mapStringForSysctls := "map[string]string{" for _, k := range keysForSysctls { mapStringForSysctls += fmt.Sprintf("%v: %v,", k, this.Sysctls[k]) } mapStringForSysctls += "}" s := strings.Join([]string{`&LinuxPodSandboxConfig{`, `CgroupParent:` + fmt.Sprintf("%v", this.CgroupParent) + `,`, `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "LinuxSandboxSecurityContext", "LinuxSandboxSecurityContext", 1) + `,`, `Sysctls:` + mapStringForSysctls + `,`, `}`, }, "") return s } func (this *PodSandboxMetadata) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PodSandboxMetadata{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Uid:` + fmt.Sprintf("%v", this.Uid) + `,`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `Attempt:` + fmt.Sprintf("%v", this.Attempt) + `,`, `}`, }, "") return s } func (this *PodSandboxConfig) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&PodSandboxConfig{`, `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, `LogDirectory:` + fmt.Sprintf("%v", this.LogDirectory) + `,`, `DnsConfig:` + strings.Replace(fmt.Sprintf("%v", this.DnsConfig), "DNSConfig", "DNSConfig", 1) + `,`, `PortMappings:` + strings.Replace(fmt.Sprintf("%v", this.PortMappings), "PortMapping", "PortMapping", 1) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `Linux:` + strings.Replace(fmt.Sprintf("%v", this.Linux), "LinuxPodSandboxConfig", "LinuxPodSandboxConfig", 1) + `,`, `}`, }, "") return s } func (this *RunPodSandboxRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RunPodSandboxRequest{`, `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, `}`, }, "") return s } func (this *RunPodSandboxResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RunPodSandboxResponse{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `}`, }, "") return s } func (this *StopPodSandboxRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StopPodSandboxRequest{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `}`, }, "") return s } func (this *StopPodSandboxResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StopPodSandboxResponse{`, `}`, }, "") return s } func (this *RemovePodSandboxRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemovePodSandboxRequest{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `}`, }, "") return s } func (this *RemovePodSandboxResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemovePodSandboxResponse{`, `}`, }, "") return s } func (this *PodSandboxStatusRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PodSandboxStatusRequest{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, `}`, }, "") return s } func (this *PodSandboxNetworkStatus) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PodSandboxNetworkStatus{`, `Ip:` + fmt.Sprintf("%v", this.Ip) + `,`, `}`, }, "") return s } func (this *Namespace) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Namespace{`, `Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "NamespaceOption", "NamespaceOption", 1) + `,`, `}`, }, "") return s } func (this *LinuxPodSandboxStatus) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LinuxPodSandboxStatus{`, `Namespaces:` + strings.Replace(fmt.Sprintf("%v", this.Namespaces), "Namespace", "Namespace", 1) + `,`, `}`, }, "") return s } func (this *PodSandboxStatus) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&PodSandboxStatus{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "PodSandboxNetworkStatus", "PodSandboxNetworkStatus", 1) + `,`, `Linux:` + strings.Replace(fmt.Sprintf("%v", this.Linux), "LinuxPodSandboxStatus", "LinuxPodSandboxStatus", 1) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } func (this *PodSandboxStatusResponse) String() string { if this == nil { return "nil" } keysForInfo := make([]string, 0, len(this.Info)) for k := range this.Info { keysForInfo = append(keysForInfo, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) mapStringForInfo := "map[string]string{" for _, k := range keysForInfo { mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) } mapStringForInfo += "}" s := strings.Join([]string{`&PodSandboxStatusResponse{`, `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "PodSandboxStatus", "PodSandboxStatus", 1) + `,`, `Info:` + mapStringForInfo + `,`, `}`, }, "") return s } func (this *PodSandboxStateValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PodSandboxStateValue{`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `}`, }, "") return s } func (this *PodSandboxFilter) String() string { if this == nil { return "nil" } keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) for k := range this.LabelSelector { keysForLabelSelector = append(keysForLabelSelector, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) mapStringForLabelSelector := "map[string]string{" for _, k := range keysForLabelSelector { mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) } mapStringForLabelSelector += "}" s := strings.Join([]string{`&PodSandboxFilter{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `State:` + strings.Replace(fmt.Sprintf("%v", this.State), "PodSandboxStateValue", "PodSandboxStateValue", 1) + `,`, `LabelSelector:` + mapStringForLabelSelector + `,`, `}`, }, "") return s } func (this *ListPodSandboxRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListPodSandboxRequest{`, `Filter:` + strings.Replace(fmt.Sprintf("%v", this.Filter), "PodSandboxFilter", "PodSandboxFilter", 1) + `,`, `}`, }, "") return s } func (this *PodSandbox) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&PodSandbox{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } func (this *ListPodSandboxResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListPodSandboxResponse{`, `Items:` + strings.Replace(fmt.Sprintf("%v", this.Items), "PodSandbox", "PodSandbox", 1) + `,`, `}`, }, "") return s } func (this *ImageSpec) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ImageSpec{`, `Image:` + fmt.Sprintf("%v", this.Image) + `,`, `}`, }, "") return s } func (this *KeyValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&KeyValue{`, `Key:` + fmt.Sprintf("%v", this.Key) + `,`, `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `}`, }, "") return s } func (this *LinuxContainerResources) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LinuxContainerResources{`, `CpuPeriod:` + fmt.Sprintf("%v", this.CpuPeriod) + `,`, `CpuQuota:` + fmt.Sprintf("%v", this.CpuQuota) + `,`, `CpuShares:` + fmt.Sprintf("%v", this.CpuShares) + `,`, `MemoryLimitInBytes:` + fmt.Sprintf("%v", this.MemoryLimitInBytes) + `,`, `OomScoreAdj:` + fmt.Sprintf("%v", this.OomScoreAdj) + `,`, `CpusetCpus:` + fmt.Sprintf("%v", this.CpusetCpus) + `,`, `CpusetMems:` + fmt.Sprintf("%v", this.CpusetMems) + `,`, `}`, }, "") return s } func (this *SELinuxOption) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&SELinuxOption{`, `User:` + fmt.Sprintf("%v", this.User) + `,`, `Role:` + fmt.Sprintf("%v", this.Role) + `,`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Level:` + fmt.Sprintf("%v", this.Level) + `,`, `}`, }, "") return s } func (this *Capability) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Capability{`, `AddCapabilities:` + fmt.Sprintf("%v", this.AddCapabilities) + `,`, `DropCapabilities:` + fmt.Sprintf("%v", this.DropCapabilities) + `,`, `}`, }, "") return s } func (this *LinuxContainerSecurityContext) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LinuxContainerSecurityContext{`, `Capabilities:` + strings.Replace(fmt.Sprintf("%v", this.Capabilities), "Capability", "Capability", 1) + `,`, `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, `NamespaceOptions:` + strings.Replace(fmt.Sprintf("%v", this.NamespaceOptions), "NamespaceOption", "NamespaceOption", 1) + `,`, `SelinuxOptions:` + strings.Replace(fmt.Sprintf("%v", this.SelinuxOptions), "SELinuxOption", "SELinuxOption", 1) + `,`, `RunAsUser:` + strings.Replace(fmt.Sprintf("%v", this.RunAsUser), "Int64Value", "Int64Value", 1) + `,`, `RunAsUsername:` + fmt.Sprintf("%v", this.RunAsUsername) + `,`, `ReadonlyRootfs:` + fmt.Sprintf("%v", this.ReadonlyRootfs) + `,`, `SupplementalGroups:` + fmt.Sprintf("%v", this.SupplementalGroups) + `,`, `ApparmorProfile:` + fmt.Sprintf("%v", this.ApparmorProfile) + `,`, `SeccompProfilePath:` + fmt.Sprintf("%v", this.SeccompProfilePath) + `,`, `NoNewPrivs:` + fmt.Sprintf("%v", this.NoNewPrivs) + `,`, `}`, }, "") return s } func (this *LinuxContainerConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LinuxContainerConfig{`, `Resources:` + strings.Replace(fmt.Sprintf("%v", this.Resources), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, `SecurityContext:` + strings.Replace(fmt.Sprintf("%v", this.SecurityContext), "LinuxContainerSecurityContext", "LinuxContainerSecurityContext", 1) + `,`, `}`, }, "") return s } func (this *ContainerMetadata) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerMetadata{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Attempt:` + fmt.Sprintf("%v", this.Attempt) + `,`, `}`, }, "") return s } func (this *Device) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Device{`, `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, `Permissions:` + fmt.Sprintf("%v", this.Permissions) + `,`, `}`, }, "") return s } func (this *ContainerConfig) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&ContainerConfig{`, `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "ContainerMetadata", "ContainerMetadata", 1) + `,`, `Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "ImageSpec", "ImageSpec", 1) + `,`, `Command:` + fmt.Sprintf("%v", this.Command) + `,`, `Args:` + fmt.Sprintf("%v", this.Args) + `,`, `WorkingDir:` + fmt.Sprintf("%v", this.WorkingDir) + `,`, `Envs:` + strings.Replace(fmt.Sprintf("%v", this.Envs), "KeyValue", "KeyValue", 1) + `,`, `Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "Mount", 1) + `,`, `Devices:` + strings.Replace(fmt.Sprintf("%v", this.Devices), "Device", "Device", 1) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `LogPath:` + fmt.Sprintf("%v", this.LogPath) + `,`, `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, `StdinOnce:` + fmt.Sprintf("%v", this.StdinOnce) + `,`, `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, `Linux:` + strings.Replace(fmt.Sprintf("%v", this.Linux), "LinuxContainerConfig", "LinuxContainerConfig", 1) + `,`, `}`, }, "") return s } func (this *CreateContainerRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CreateContainerRequest{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "ContainerConfig", "ContainerConfig", 1) + `,`, `SandboxConfig:` + strings.Replace(fmt.Sprintf("%v", this.SandboxConfig), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, `}`, }, "") return s } func (this *CreateContainerResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CreateContainerResponse{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } func (this *StartContainerRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StartContainerRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } func (this *StartContainerResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StartContainerResponse{`, `}`, }, "") return s } func (this *StopContainerRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StopContainerRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, `}`, }, "") return s } func (this *StopContainerResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StopContainerResponse{`, `}`, }, "") return s } func (this *RemoveContainerRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemoveContainerRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } func (this *RemoveContainerResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemoveContainerResponse{`, `}`, }, "") return s } func (this *ContainerStateValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerStateValue{`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `}`, }, "") return s } func (this *ContainerFilter) String() string { if this == nil { return "nil" } keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) for k := range this.LabelSelector { keysForLabelSelector = append(keysForLabelSelector, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) mapStringForLabelSelector := "map[string]string{" for _, k := range keysForLabelSelector { mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) } mapStringForLabelSelector += "}" s := strings.Join([]string{`&ContainerFilter{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `State:` + strings.Replace(fmt.Sprintf("%v", this.State), "ContainerStateValue", "ContainerStateValue", 1) + `,`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `LabelSelector:` + mapStringForLabelSelector + `,`, `}`, }, "") return s } func (this *ListContainersRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListContainersRequest{`, `Filter:` + strings.Replace(fmt.Sprintf("%v", this.Filter), "ContainerFilter", "ContainerFilter", 1) + `,`, `}`, }, "") return s } func (this *Container) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&Container{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "ContainerMetadata", "ContainerMetadata", 1) + `,`, `Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "ImageSpec", "ImageSpec", 1) + `,`, `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } func (this *ListContainersResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListContainersResponse{`, `Containers:` + strings.Replace(fmt.Sprintf("%v", this.Containers), "Container", "Container", 1) + `,`, `}`, }, "") return s } func (this *ContainerStatusRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerStatusRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, `}`, }, "") return s } func (this *ContainerStatus) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&ContainerStatus{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "ContainerMetadata", "ContainerMetadata", 1) + `,`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, `StartedAt:` + fmt.Sprintf("%v", this.StartedAt) + `,`, `FinishedAt:` + fmt.Sprintf("%v", this.FinishedAt) + `,`, `ExitCode:` + fmt.Sprintf("%v", this.ExitCode) + `,`, `Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "ImageSpec", "ImageSpec", 1) + `,`, `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "Mount", 1) + `,`, `LogPath:` + fmt.Sprintf("%v", this.LogPath) + `,`, `}`, }, "") return s } func (this *ContainerStatusResponse) String() string { if this == nil { return "nil" } keysForInfo := make([]string, 0, len(this.Info)) for k := range this.Info { keysForInfo = append(keysForInfo, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) mapStringForInfo := "map[string]string{" for _, k := range keysForInfo { mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) } mapStringForInfo += "}" s := strings.Join([]string{`&ContainerStatusResponse{`, `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "ContainerStatus", "ContainerStatus", 1) + `,`, `Info:` + mapStringForInfo + `,`, `}`, }, "") return s } func (this *UpdateContainerResourcesRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UpdateContainerResourcesRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Linux:` + strings.Replace(fmt.Sprintf("%v", this.Linux), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, `}`, }, "") return s } func (this *UpdateContainerResourcesResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UpdateContainerResourcesResponse{`, `}`, }, "") return s } func (this *ExecSyncRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ExecSyncRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Cmd:` + fmt.Sprintf("%v", this.Cmd) + `,`, `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, `}`, }, "") return s } func (this *ExecSyncResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ExecSyncResponse{`, `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, `ExitCode:` + fmt.Sprintf("%v", this.ExitCode) + `,`, `}`, }, "") return s } func (this *ExecRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ExecRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Cmd:` + fmt.Sprintf("%v", this.Cmd) + `,`, `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, `}`, }, "") return s } func (this *ExecResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ExecResponse{`, `Url:` + fmt.Sprintf("%v", this.Url) + `,`, `}`, }, "") return s } func (this *AttachRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&AttachRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, `}`, }, "") return s } func (this *AttachResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&AttachResponse{`, `Url:` + fmt.Sprintf("%v", this.Url) + `,`, `}`, }, "") return s } func (this *PortForwardRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PortForwardRequest{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `Port:` + fmt.Sprintf("%v", this.Port) + `,`, `}`, }, "") return s } func (this *PortForwardResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PortForwardResponse{`, `Url:` + fmt.Sprintf("%v", this.Url) + `,`, `}`, }, "") return s } func (this *ImageFilter) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ImageFilter{`, `Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "ImageSpec", "ImageSpec", 1) + `,`, `}`, }, "") return s } func (this *ListImagesRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListImagesRequest{`, `Filter:` + strings.Replace(fmt.Sprintf("%v", this.Filter), "ImageFilter", "ImageFilter", 1) + `,`, `}`, }, "") return s } func (this *Image) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Image{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `RepoTags:` + fmt.Sprintf("%v", this.RepoTags) + `,`, `RepoDigests:` + fmt.Sprintf("%v", this.RepoDigests) + `,`, `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`, `Uid:` + strings.Replace(fmt.Sprintf("%v", this.Uid), "Int64Value", "Int64Value", 1) + `,`, `Username:` + fmt.Sprintf("%v", this.Username) + `,`, `}`, }, "") return s } func (this *ListImagesResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListImagesResponse{`, `Images:` + strings.Replace(fmt.Sprintf("%v", this.Images), "Image", "Image", 1) + `,`, `}`, }, "") return s } func (this *ImageStatusRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ImageStatusRequest{`, `Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "ImageSpec", "ImageSpec", 1) + `,`, `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, `}`, }, "") return s } func (this *ImageStatusResponse) String() string { if this == nil { return "nil" } keysForInfo := make([]string, 0, len(this.Info)) for k := range this.Info { keysForInfo = append(keysForInfo, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) mapStringForInfo := "map[string]string{" for _, k := range keysForInfo { mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) } mapStringForInfo += "}" s := strings.Join([]string{`&ImageStatusResponse{`, `Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "Image", "Image", 1) + `,`, `Info:` + mapStringForInfo + `,`, `}`, }, "") return s } func (this *AuthConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&AuthConfig{`, `Username:` + fmt.Sprintf("%v", this.Username) + `,`, `Password:` + fmt.Sprintf("%v", this.Password) + `,`, `Auth:` + fmt.Sprintf("%v", this.Auth) + `,`, `ServerAddress:` + fmt.Sprintf("%v", this.ServerAddress) + `,`, `IdentityToken:` + fmt.Sprintf("%v", this.IdentityToken) + `,`, `RegistryToken:` + fmt.Sprintf("%v", this.RegistryToken) + `,`, `}`, }, "") return s } func (this *PullImageRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PullImageRequest{`, `Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "ImageSpec", "ImageSpec", 1) + `,`, `Auth:` + strings.Replace(fmt.Sprintf("%v", this.Auth), "AuthConfig", "AuthConfig", 1) + `,`, `SandboxConfig:` + strings.Replace(fmt.Sprintf("%v", this.SandboxConfig), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, `}`, }, "") return s } func (this *PullImageResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PullImageResponse{`, `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, `}`, }, "") return s } func (this *RemoveImageRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemoveImageRequest{`, `Image:` + strings.Replace(fmt.Sprintf("%v", this.Image), "ImageSpec", "ImageSpec", 1) + `,`, `}`, }, "") return s } func (this *RemoveImageResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemoveImageResponse{`, `}`, }, "") return s } func (this *NetworkConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&NetworkConfig{`, `PodCidr:` + fmt.Sprintf("%v", this.PodCidr) + `,`, `}`, }, "") return s } func (this *RuntimeConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RuntimeConfig{`, `NetworkConfig:` + strings.Replace(fmt.Sprintf("%v", this.NetworkConfig), "NetworkConfig", "NetworkConfig", 1) + `,`, `}`, }, "") return s } func (this *UpdateRuntimeConfigRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UpdateRuntimeConfigRequest{`, `RuntimeConfig:` + strings.Replace(fmt.Sprintf("%v", this.RuntimeConfig), "RuntimeConfig", "RuntimeConfig", 1) + `,`, `}`, }, "") return s } func (this *UpdateRuntimeConfigResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UpdateRuntimeConfigResponse{`, `}`, }, "") return s } func (this *RuntimeCondition) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RuntimeCondition{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Status:` + fmt.Sprintf("%v", this.Status) + `,`, `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `}`, }, "") return s } func (this *RuntimeStatus) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RuntimeStatus{`, `Conditions:` + strings.Replace(fmt.Sprintf("%v", this.Conditions), "RuntimeCondition", "RuntimeCondition", 1) + `,`, `}`, }, "") return s } func (this *StatusRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StatusRequest{`, `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, `}`, }, "") return s } func (this *StatusResponse) String() string { if this == nil { return "nil" } keysForInfo := make([]string, 0, len(this.Info)) for k := range this.Info { keysForInfo = append(keysForInfo, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) mapStringForInfo := "map[string]string{" for _, k := range keysForInfo { mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) } mapStringForInfo += "}" s := strings.Join([]string{`&StatusResponse{`, `Status:` + strings.Replace(fmt.Sprintf("%v", this.Status), "RuntimeStatus", "RuntimeStatus", 1) + `,`, `Info:` + mapStringForInfo + `,`, `}`, }, "") return s } func (this *ImageFsInfoRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ImageFsInfoRequest{`, `}`, }, "") return s } func (this *UInt64Value) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UInt64Value{`, `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `}`, }, "") return s } func (this *StorageIdentifier) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StorageIdentifier{`, `Uuid:` + fmt.Sprintf("%v", this.Uuid) + `,`, `}`, }, "") return s } func (this *FilesystemUsage) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&FilesystemUsage{`, `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, `StorageId:` + strings.Replace(fmt.Sprintf("%v", this.StorageId), "StorageIdentifier", "StorageIdentifier", 1) + `,`, `UsedBytes:` + strings.Replace(fmt.Sprintf("%v", this.UsedBytes), "UInt64Value", "UInt64Value", 1) + `,`, `InodesUsed:` + strings.Replace(fmt.Sprintf("%v", this.InodesUsed), "UInt64Value", "UInt64Value", 1) + `,`, `}`, }, "") return s } func (this *ImageFsInfoResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ImageFsInfoResponse{`, `ImageFilesystems:` + strings.Replace(fmt.Sprintf("%v", this.ImageFilesystems), "FilesystemUsage", "FilesystemUsage", 1) + `,`, `}`, }, "") return s } func (this *ContainerStatsRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerStatsRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } func (this *ContainerStatsResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerStatsResponse{`, `Stats:` + strings.Replace(fmt.Sprintf("%v", this.Stats), "ContainerStats", "ContainerStats", 1) + `,`, `}`, }, "") return s } func (this *ListContainerStatsRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListContainerStatsRequest{`, `Filter:` + strings.Replace(fmt.Sprintf("%v", this.Filter), "ContainerStatsFilter", "ContainerStatsFilter", 1) + `,`, `}`, }, "") return s } func (this *ContainerStatsFilter) String() string { if this == nil { return "nil" } keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) for k := range this.LabelSelector { keysForLabelSelector = append(keysForLabelSelector, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) mapStringForLabelSelector := "map[string]string{" for _, k := range keysForLabelSelector { mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) } mapStringForLabelSelector += "}" s := strings.Join([]string{`&ContainerStatsFilter{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `LabelSelector:` + mapStringForLabelSelector + `,`, `}`, }, "") return s } func (this *ListContainerStatsResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListContainerStatsResponse{`, `Stats:` + strings.Replace(fmt.Sprintf("%v", this.Stats), "ContainerStats", "ContainerStats", 1) + `,`, `}`, }, "") return s } func (this *ContainerAttributes) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&ContainerAttributes{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `Metadata:` + strings.Replace(fmt.Sprintf("%v", this.Metadata), "ContainerMetadata", "ContainerMetadata", 1) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } func (this *ContainerStats) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerStats{`, `Attributes:` + strings.Replace(fmt.Sprintf("%v", this.Attributes), "ContainerAttributes", "ContainerAttributes", 1) + `,`, `Cpu:` + strings.Replace(fmt.Sprintf("%v", this.Cpu), "CpuUsage", "CpuUsage", 1) + `,`, `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "MemoryUsage", "MemoryUsage", 1) + `,`, `WritableLayer:` + strings.Replace(fmt.Sprintf("%v", this.WritableLayer), "FilesystemUsage", "FilesystemUsage", 1) + `,`, `}`, }, "") return s } func (this *CpuUsage) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CpuUsage{`, `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, `UsageCoreNanoSeconds:` + strings.Replace(fmt.Sprintf("%v", this.UsageCoreNanoSeconds), "UInt64Value", "UInt64Value", 1) + `,`, `}`, }, "") return s } func (this *MemoryUsage) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&MemoryUsage{`, `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, `WorkingSetBytes:` + strings.Replace(fmt.Sprintf("%v", this.WorkingSetBytes), "UInt64Value", "UInt64Value", 1) + `,`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *VersionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: VersionRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: VersionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *VersionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: VersionResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: VersionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.RuntimeName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeVersion", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.RuntimeVersion = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeApiVersion", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.RuntimeApiVersion = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DNSConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DNSConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DNSConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Servers", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Servers = append(m.Servers, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Searches", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Searches = append(m.Searches, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Options = append(m.Options, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PortMapping) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PortMapping: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PortMapping: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) } m.Protocol = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Protocol |= (Protocol(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerPort", wireType) } m.ContainerPort = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ContainerPort |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HostPort", wireType) } m.HostPort = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.HostPort |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HostIp", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.HostIp = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Mount) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Mount: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Mount: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.HostPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Readonly", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Readonly = bool(v != 0) case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SelinuxRelabel", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.SelinuxRelabel = bool(v != 0) case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Propagation", wireType) } m.Propagation = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Propagation |= (MountPropagation(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NamespaceOption) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NamespaceOption: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NamespaceOption: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HostNetwork", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.HostNetwork = bool(v != 0) case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HostPid", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.HostPid = bool(v != 0) case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HostIpc", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.HostIpc = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Int64Value) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Int64Value: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Int64Value: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Value |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxSandboxSecurityContext: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxSandboxSecurityContext: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NamespaceOptions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.NamespaceOptions == nil { m.NamespaceOptions = &NamespaceOption{} } if err := m.NamespaceOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SelinuxOptions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.SelinuxOptions == nil { m.SelinuxOptions = &SELinuxOption{} } if err := m.SelinuxOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RunAsUser", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.RunAsUser == nil { m.RunAsUser = &Int64Value{} } if err := m.RunAsUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ReadonlyRootfs", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.ReadonlyRootfs = bool(v != 0) case 5: if wireType == 0 { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } m.SupplementalGroups = append(m.SupplementalGroups, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + packedLen if postIndex > l { return io.ErrUnexpectedEOF } for iNdEx < postIndex { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } m.SupplementalGroups = append(m.SupplementalGroups, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroups", wireType) } case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Privileged = bool(v != 0) case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SeccompProfilePath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.SeccompProfilePath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxPodSandboxConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxPodSandboxConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxPodSandboxConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CgroupParent", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.CgroupParent = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.SecurityContext == nil { m.SecurityContext = &LinuxSandboxSecurityContext{} } if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Sysctls", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Sysctls == nil { m.Sysctls = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Sysctls[mapkey] = mapvalue } else { var mapvalue string m.Sysctls[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxMetadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxMetadata: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxMetadata: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Uid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Namespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Attempt", wireType) } m.Attempt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Attempt |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &PodSandboxMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Hostname = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LogDirectory", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.LogDirectory = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DnsConfig", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.DnsConfig == nil { m.DnsConfig = &DNSConfig{} } if err := m.DnsConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PortMappings", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.PortMappings = append(m.PortMappings, &PortMapping{}) if err := m.PortMappings[len(m.PortMappings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Labels == nil { m.Labels = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Labels[mapkey] = mapvalue } else { var mapvalue string m.Labels[mapkey] = mapvalue } iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Annotations == nil { m.Annotations = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Annotations[mapkey] = mapvalue } else { var mapvalue string m.Annotations[mapkey] = mapvalue } iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Linux == nil { m.Linux = &LinuxPodSandboxConfig{} } if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RunPodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RunPodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RunPodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Config == nil { m.Config = &PodSandboxConfig{} } if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RunPodSandboxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RunPodSandboxResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RunPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StopPodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StopPodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StopPodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StopPodSandboxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StopPodSandboxResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StopPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemovePodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemovePodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemovePodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemovePodSandboxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemovePodSandboxResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemovePodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxStatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxStatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Verbose", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Verbose = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxNetworkStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxNetworkStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxNetworkStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Ip = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Namespace) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Namespace: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Namespace: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Options == nil { m.Options = &NamespaceOption{} } if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxPodSandboxStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxPodSandboxStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxPodSandboxStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Namespaces == nil { m.Namespaces = &Namespace{} } if err := m.Namespaces.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &PodSandboxMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= (PodSandboxState(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) } m.CreatedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CreatedAt |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Network == nil { m.Network = &PodSandboxNetworkStatus{} } if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Linux == nil { m.Linux = &LinuxPodSandboxStatus{} } if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Labels == nil { m.Labels = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Labels[mapkey] = mapvalue } else { var mapvalue string m.Labels[mapkey] = mapvalue } iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Annotations == nil { m.Annotations = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Annotations[mapkey] = mapvalue } else { var mapvalue string m.Annotations[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Status == nil { m.Status = &PodSandboxStatus{} } if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Info == nil { m.Info = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Info[mapkey] = mapvalue } else { var mapvalue string m.Info[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxStateValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxStateValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxStateValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= (PodSandboxState(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxFilter: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.State == nil { m.State = &PodSandboxStateValue{} } if err := m.State.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.LabelSelector == nil { m.LabelSelector = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.LabelSelector[mapkey] = mapvalue } else { var mapvalue string m.LabelSelector[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListPodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListPodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListPodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Filter == nil { m.Filter = &PodSandboxFilter{} } if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandbox) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandbox: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandbox: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &PodSandboxMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= (PodSandboxState(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) } m.CreatedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CreatedAt |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Labels == nil { m.Labels = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Labels[mapkey] = mapvalue } else { var mapvalue string m.Labels[mapkey] = mapvalue } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Annotations == nil { m.Annotations = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Annotations[mapkey] = mapvalue } else { var mapvalue string m.Annotations[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListPodSandboxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListPodSandboxResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Items = append(m.Items, &PodSandbox{}) if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageSpec: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Image = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *KeyValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: KeyValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxContainerResources) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxContainerResources: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxContainerResources: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CpuPeriod", wireType) } m.CpuPeriod = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CpuPeriod |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CpuQuota", wireType) } m.CpuQuota = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CpuQuota |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CpuShares", wireType) } m.CpuShares = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CpuShares |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MemoryLimitInBytes", wireType) } m.MemoryLimitInBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.MemoryLimitInBytes |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field OomScoreAdj", wireType) } m.OomScoreAdj = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.OomScoreAdj |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CpusetCpus", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.CpusetCpus = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CpusetMems", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.CpusetMems = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *SELinuxOption) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: SELinuxOption: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: SELinuxOption: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.User = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Level", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Level = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Capability) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Capability: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Capability: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AddCapabilities", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.AddCapabilities = append(m.AddCapabilities, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DropCapabilities", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.DropCapabilities = append(m.DropCapabilities, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxContainerSecurityContext) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxContainerSecurityContext: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxContainerSecurityContext: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Capabilities", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Capabilities == nil { m.Capabilities = &Capability{} } if err := m.Capabilities.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Privileged = bool(v != 0) case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NamespaceOptions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.NamespaceOptions == nil { m.NamespaceOptions = &NamespaceOption{} } if err := m.NamespaceOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SelinuxOptions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.SelinuxOptions == nil { m.SelinuxOptions = &SELinuxOption{} } if err := m.SelinuxOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RunAsUser", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.RunAsUser == nil { m.RunAsUser = &Int64Value{} } if err := m.RunAsUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RunAsUsername", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.RunAsUsername = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ReadonlyRootfs", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.ReadonlyRootfs = bool(v != 0) case 8: if wireType == 0 { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } m.SupplementalGroups = append(m.SupplementalGroups, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + packedLen if postIndex > l { return io.ErrUnexpectedEOF } for iNdEx < postIndex { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } m.SupplementalGroups = append(m.SupplementalGroups, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroups", wireType) } case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ApparmorProfile", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ApparmorProfile = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SeccompProfilePath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.SeccompProfilePath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NoNewPrivs", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.NoNewPrivs = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxContainerConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxContainerConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxContainerConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Resources == nil { m.Resources = &LinuxContainerResources{} } if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.SecurityContext == nil { m.SecurityContext = &LinuxContainerSecurityContext{} } if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerMetadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerMetadata: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerMetadata: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Attempt", wireType) } m.Attempt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Attempt |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Device) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Device: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.HostPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Permissions = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &ContainerMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Command = append(m.Command, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WorkingDir", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.WorkingDir = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Envs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Envs = append(m.Envs, &KeyValue{}) if err := m.Envs[len(m.Envs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Mounts = append(m.Mounts, &Mount{}) if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &Device{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Labels == nil { m.Labels = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Labels[mapkey] = mapvalue } else { var mapvalue string m.Labels[mapkey] = mapvalue } iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Annotations == nil { m.Annotations = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Annotations[mapkey] = mapvalue } else { var mapvalue string m.Annotations[mapkey] = mapvalue } iNdEx = postIndex case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LogPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.LogPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 12: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Stdin = bool(v != 0) case 13: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StdinOnce", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.StdinOnce = bool(v != 0) case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Tty", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Tty = bool(v != 0) case 15: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Linux == nil { m.Linux = &LinuxContainerConfig{} } if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CreateContainerRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CreateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Config == nil { m.Config = &ContainerConfig{} } if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SandboxConfig", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.SandboxConfig == nil { m.SandboxConfig = &PodSandboxConfig{} } if err := m.SandboxConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CreateContainerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CreateContainerResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CreateContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StartContainerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StartContainerRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StartContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StartContainerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StartContainerResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StartContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StopContainerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StopContainerRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StopContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) } m.Timeout = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timeout |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StopContainerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StopContainerResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StopContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemoveContainerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemoveContainerRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemoveContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemoveContainerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemoveContainerResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemoveContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStateValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStateValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStateValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= (ContainerState(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerFilter: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.State == nil { m.State = &ContainerStateValue{} } if err := m.State.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.LabelSelector == nil { m.LabelSelector = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.LabelSelector[mapkey] = mapvalue } else { var mapvalue string m.LabelSelector[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListContainersRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListContainersRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListContainersRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Filter == nil { m.Filter = &ContainerFilter{} } if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Container) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Container: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Container: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &ContainerMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ImageRef", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ImageRef = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= (ContainerState(b) & 0x7F) << shift if b < 0x80 { break } } case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) } m.CreatedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CreatedAt |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Labels == nil { m.Labels = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Labels[mapkey] = mapvalue } else { var mapvalue string m.Labels[mapkey] = mapvalue } iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Annotations == nil { m.Annotations = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Annotations[mapkey] = mapvalue } else { var mapvalue string m.Annotations[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListContainersResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListContainersResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListContainersResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Containers", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Containers = append(m.Containers, &Container{}) if err := m.Containers[len(m.Containers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Verbose", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Verbose = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &ContainerMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= (ContainerState(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) } m.CreatedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CreatedAt |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) } m.StartedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.StartedAt |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FinishedAt", wireType) } m.FinishedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.FinishedAt |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ExitCode", wireType) } m.ExitCode = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ExitCode |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ImageRef", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ImageRef = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Reason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Labels == nil { m.Labels = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Labels[mapkey] = mapvalue } else { var mapvalue string m.Labels[mapkey] = mapvalue } iNdEx = postIndex case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Annotations == nil { m.Annotations = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Annotations[mapkey] = mapvalue } else { var mapvalue string m.Annotations[mapkey] = mapvalue } iNdEx = postIndex case 14: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Mounts = append(m.Mounts, &Mount{}) if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 15: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LogPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.LogPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Status == nil { m.Status = &ContainerStatus{} } if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Info == nil { m.Info = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Info[mapkey] = mapvalue } else { var mapvalue string m.Info[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UpdateContainerResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UpdateContainerResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UpdateContainerResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Linux == nil { m.Linux = &LinuxContainerResources{} } if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UpdateContainerResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UpdateContainerResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UpdateContainerResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ExecSyncRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ExecSyncRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ExecSyncRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Cmd", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Cmd = append(m.Cmd, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) } m.Timeout = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timeout |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ExecSyncResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ExecSyncResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ExecSyncResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Stdout = append(m.Stdout[:0], dAtA[iNdEx:postIndex]...) if m.Stdout == nil { m.Stdout = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Stderr = append(m.Stderr[:0], dAtA[iNdEx:postIndex]...) if m.Stderr == nil { m.Stderr = []byte{} } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ExitCode", wireType) } m.ExitCode = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ExitCode |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ExecRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ExecRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ExecRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Cmd", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Cmd = append(m.Cmd, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Tty", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Tty = bool(v != 0) case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Stdin = bool(v != 0) case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Stdout = bool(v != 0) case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Stderr = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ExecResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ExecResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ExecResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Url = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AttachRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AttachRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AttachRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Stdin = bool(v != 0) case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Tty", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Tty = bool(v != 0) case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Stdout = bool(v != 0) case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Stderr = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AttachResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AttachResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AttachResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Url = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PortForwardRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PortForwardRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PortForwardRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType == 0 { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Port = append(m.Port, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + packedLen if postIndex > l { return io.ErrUnexpectedEOF } for iNdEx < postIndex { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int32(b) & 0x7F) << shift if b < 0x80 { break } } m.Port = append(m.Port, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PortForwardResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PortForwardResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PortForwardResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Url = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageFilter: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListImagesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListImagesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListImagesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Filter == nil { m.Filter = &ImageFilter{} } if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Image) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Image: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Image: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RepoTags", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.RepoTags = append(m.RepoTags, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RepoDigests", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.RepoDigests = append(m.RepoDigests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) } m.Size_ = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Size_ |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Uid == nil { m.Uid = &Int64Value{} } if err := m.Uid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Username = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListImagesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListImagesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListImagesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Images", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Images = append(m.Images, &Image{}) if err := m.Images[len(m.Images)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageStatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageStatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Verbose", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Verbose = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &Image{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Info == nil { m.Info = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Info[mapkey] = mapvalue } else { var mapvalue string m.Info[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Username = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Password = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Auth = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ServerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ServerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IdentityToken", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.IdentityToken = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RegistryToken", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.RegistryToken = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PullImageRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PullImageRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PullImageRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Auth == nil { m.Auth = &AuthConfig{} } if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SandboxConfig", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.SandboxConfig == nil { m.SandboxConfig = &PodSandboxConfig{} } if err := m.SandboxConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PullImageResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PullImageResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PullImageResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ImageRef", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ImageRef = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemoveImageRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemoveImageRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemoveImageRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemoveImageResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemoveImageResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemoveImageResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NetworkConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NetworkConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NetworkConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodCidr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PodCidr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RuntimeConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RuntimeConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RuntimeConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NetworkConfig", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.NetworkConfig == nil { m.NetworkConfig = &NetworkConfig{} } if err := m.NetworkConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UpdateRuntimeConfigRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UpdateRuntimeConfigRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UpdateRuntimeConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeConfig", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.RuntimeConfig == nil { m.RuntimeConfig = &RuntimeConfig{} } if err := m.RuntimeConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UpdateRuntimeConfigResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UpdateRuntimeConfigResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UpdateRuntimeConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RuntimeCondition) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RuntimeCondition: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RuntimeCondition: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Status = bool(v != 0) case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Reason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RuntimeStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RuntimeStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RuntimeStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Conditions = append(m.Conditions, &RuntimeCondition{}) if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Verbose", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Verbose = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Status == nil { m.Status = &RuntimeStatus{} } if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Info == nil { m.Info = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Info[mapkey] = mapvalue } else { var mapvalue string m.Info[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageFsInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageFsInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageFsInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UInt64Value) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UInt64Value: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UInt64Value: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Value |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StorageIdentifier) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StorageIdentifier: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StorageIdentifier: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Uuid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *FilesystemUsage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: FilesystemUsage: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: FilesystemUsage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timestamp |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StorageId", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.StorageId == nil { m.StorageId = &StorageIdentifier{} } if err := m.StorageId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UsedBytes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.UsedBytes == nil { m.UsedBytes = &UInt64Value{} } if err := m.UsedBytes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field InodesUsed", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.InodesUsed == nil { m.InodesUsed = &UInt64Value{} } if err := m.InodesUsed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageFsInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageFsInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageFsInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ImageFilesystems", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.ImageFilesystems = append(m.ImageFilesystems, &FilesystemUsage{}) if err := m.ImageFilesystems[len(m.ImageFilesystems)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatsRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatsResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Stats == nil { m.Stats = &ContainerStats{} } if err := m.Stats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListContainerStatsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListContainerStatsRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListContainerStatsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Filter == nil { m.Filter = &ContainerStatsFilter{} } if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatsFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatsFilter: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatsFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.LabelSelector == nil { m.LabelSelector = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.LabelSelector[mapkey] = mapvalue } else { var mapvalue string m.LabelSelector[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListContainerStatsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListContainerStatsResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListContainerStatsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Stats = append(m.Stats, &ContainerStats{}) if err := m.Stats[len(m.Stats)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerAttributes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerAttributes: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerAttributes: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &ContainerMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Labels == nil { m.Labels = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Labels[mapkey] = mapvalue } else { var mapvalue string m.Labels[mapkey] = mapvalue } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Annotations == nil { m.Annotations = make(map[string]string) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue m.Annotations[mapkey] = mapvalue } else { var mapvalue string m.Annotations[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStats) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStats: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStats: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Attributes == nil { m.Attributes = &ContainerAttributes{} } if err := m.Attributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Cpu", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Cpu == nil { m.Cpu = &CpuUsage{} } if err := m.Cpu.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Memory == nil { m.Memory = &MemoryUsage{} } if err := m.Memory.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WritableLayer", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.WritableLayer == nil { m.WritableLayer = &FilesystemUsage{} } if err := m.WritableLayer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CpuUsage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CpuUsage: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CpuUsage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timestamp |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UsageCoreNanoSeconds", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.UsageCoreNanoSeconds == nil { m.UsageCoreNanoSeconds = &UInt64Value{} } if err := m.UsageCoreNanoSeconds.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MemoryUsage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MemoryUsage: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MemoryUsage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timestamp |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WorkingSetBytes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.WorkingSetBytes == nil { m.WorkingSetBytes = &UInt64Value{} } if err := m.WorkingSetBytes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthApi } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipApi(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ) func init() { proto.RegisterFile("api.proto", fileDescriptorApi) } var fileDescriptorApi = []byte{ // 4392 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5b, 0xcd, 0x6f, 0x1c, 0x47, 0x76, 0xe7, 0xcc, 0xf0, 0x63, 0xe6, 0x0d, 0x67, 0x38, 0x2c, 0x51, 0xe4, 0x70, 0x24, 0x51, 0x54, 0xcb, 0x92, 0x25, 0xed, 0x4a, 0x96, 0xe9, 0xb5, 0x14, 0xcb, 0xb6, 0xe4, 0x31, 0x49, 0x29, 0xb4, 0x24, 0x92, 0xdb, 0x43, 0x7a, 0x6d, 0x6c, 0x80, 0x4e, 0x73, 0xba, 0x38, 0x6c, 0x7b, 0xa6, 0xab, 0xdd, 0x1f, 0x92, 0x18, 0xe4, 0x90, 0x5c, 0x82, 0x20, 0x40, 0x80, 0xcd, 0x31, 0x39, 0xe5, 0x10, 0x60, 0x91, 0x4b, 0x10, 0xe4, 0x10, 0xe4, 0x0f, 0x08, 0x92, 0xbd, 0x2c, 0x10, 0x20, 0x40, 0x90, 0xdc, 0xb2, 0xca, 0x21, 0x87, 0x00, 0xf9, 0x1b, 0x16, 0xf5, 0xd5, 0x5d, 0xfd, 0x35, 0x22, 0x65, 0xef, 0x5a, 0xa7, 0xe9, 0x7a, 0xf5, 0xea, 0xd5, 0xab, 0xaa, 0x57, 0xaf, 0xde, 0xfb, 0x55, 0x0d, 0xd4, 0x4c, 0xd7, 0xbe, 0xe5, 0x7a, 0x24, 0x20, 0x68, 0xc6, 0x0b, 0x9d, 0xc0, 0x1e, 0xe1, 0xce, 0xcd, 0x81, 0x1d, 0x1c, 0x85, 0x07, 0xb7, 0xfa, 0x64, 0xf4, 0xce, 0x80, 0x0c, 0xc8, 0x3b, 0xac, 0xfe, 0x20, 0x3c, 0x64, 0x25, 0x56, 0x60, 0x5f, 0xbc, 0x9d, 0x76, 0x03, 0x9a, 0x9f, 0x63, 0xcf, 0xb7, 0x89, 0xa3, 0xe3, 0x6f, 0x42, 0xec, 0x07, 0xa8, 0x0d, 0x33, 0xcf, 0x38, 0xa5, 0x5d, 0x5a, 0x2d, 0x5d, 0xab, 0xe9, 0xb2, 0xa8, 0xfd, 0xbc, 0x04, 0x73, 0x11, 0xb3, 0xef, 0x12, 0xc7, 0xc7, 0xc5, 0xdc, 0xe8, 0x12, 0xcc, 0x0a, 0x9d, 0x0c, 0xc7, 0x1c, 0xe1, 0x76, 0x99, 0x55, 0xd7, 0x05, 0x6d, 0xdb, 0x1c, 0x61, 0xf4, 0x36, 0xcc, 0x49, 0x16, 0x29, 0xa4, 0xc2, 0xb8, 0x9a, 0x82, 0x2c, 0x7a, 0x43, 0xb7, 0xe0, 0x8c, 0x64, 0x34, 0x5d, 0x3b, 0x62, 0x9e, 0x64, 0xcc, 0xf3, 0xa2, 0xaa, 0xeb, 0xda, 0x82, 0x5f, 0xfb, 0x29, 0xd4, 0x36, 0xb6, 0x7b, 0xeb, 0xc4, 0x39, 0xb4, 0x07, 0x54, 0x45, 0x1f, 0x7b, 0xb4, 0x4d, 0xbb, 0xb4, 0x5a, 0xa1, 0x2a, 0x8a, 0x22, 0xea, 0x40, 0xd5, 0xc7, 0xa6, 0xd7, 0x3f, 0xc2, 0x7e, 0xbb, 0xcc, 0xaa, 0xa2, 0x32, 0x6d, 0x45, 0xdc, 0xc0, 0x26, 0x8e, 0xdf, 0xae, 0xf0, 0x56, 0xa2, 0xa8, 0xfd, 0x65, 0x09, 0xea, 0xbb, 0xc4, 0x0b, 0x9e, 0x9a, 0xae, 0x6b, 0x3b, 0x03, 0x74, 0x13, 0xaa, 0x6c, 0x2e, 0xfb, 0x64, 0xc8, 0xe6, 0xa0, 0xb9, 0x36, 0x7f, 0x4b, 0xa8, 0x74, 0x6b, 0x57, 0x54, 0xe8, 0x11, 0x0b, 0xba, 0x02, 0xcd, 0x3e, 0x71, 0x02, 0xd3, 0x76, 0xb0, 0x67, 0xb8, 0xc4, 0x0b, 0xd8, 0xcc, 0x4c, 0xe9, 0x8d, 0x88, 0x4a, 0x85, 0xa3, 0x73, 0x50, 0x3b, 0x22, 0x7e, 0xc0, 0x39, 0x2a, 0x8c, 0xa3, 0x4a, 0x09, 0xac, 0x72, 0x09, 0x66, 0x58, 0xa5, 0xed, 0x8a, 0x39, 0x98, 0xa6, 0xc5, 0x2d, 0x57, 0xfb, 0x65, 0x09, 0xa6, 0x9e, 0x92, 0xd0, 0x09, 0x52, 0xdd, 0x98, 0xc1, 0x91, 0x58, 0x1f, 0xa5, 0x1b, 0x33, 0x38, 0x8a, 0xbb, 0xa1, 0x1c, 0x7c, 0x89, 0x78, 0x37, 0xb4, 0xb2, 0x03, 0x55, 0x0f, 0x9b, 0x16, 0x71, 0x86, 0xc7, 0x4c, 0x85, 0xaa, 0x1e, 0x95, 0xe9, 0xda, 0xf9, 0x78, 0x68, 0x3b, 0xe1, 0x0b, 0xc3, 0xc3, 0x43, 0xf3, 0x00, 0x0f, 0x99, 0x2a, 0x55, 0xbd, 0x29, 0xc8, 0x3a, 0xa7, 0xa2, 0x0f, 0xa1, 0xee, 0x7a, 0xc4, 0x35, 0x07, 0x26, 0x9d, 0xbe, 0xf6, 0x14, 0x9b, 0xa1, 0xe5, 0x68, 0x86, 0x98, 0xb6, 0xbb, 0x31, 0x83, 0xae, 0x72, 0x6b, 0x5f, 0xc1, 0x1c, 0xb5, 0x14, 0xdf, 0x35, 0xfb, 0x78, 0x87, 0xcd, 0x3f, 0xb5, 0x2b, 0xa6, 0xb1, 0x83, 0x83, 0xe7, 0xc4, 0xfb, 0x9a, 0x0d, 0xab, 0xaa, 0xd7, 0x29, 0x6d, 0x9b, 0x93, 0xd0, 0x32, 0x54, 0xf9, 0xa0, 0x6c, 0x8b, 0x8d, 0xa9, 0xaa, 0xb3, 0xe9, 0xda, 0xb5, 0xad, 0xa8, 0xca, 0x76, 0xfb, 0x62, 0x48, 0x33, 0x7c, 0xea, 0xfa, 0x9a, 0x06, 0xb0, 0xe5, 0x04, 0x77, 0x7e, 0xf4, 0xb9, 0x39, 0x0c, 0x31, 0x5a, 0x80, 0xa9, 0x67, 0xf4, 0x83, 0xc9, 0xaf, 0xe8, 0xbc, 0xa0, 0xfd, 0x49, 0x05, 0xce, 0x3d, 0xa1, 0xa3, 0xeb, 0x99, 0x8e, 0x75, 0x40, 0x5e, 0xf4, 0x70, 0x3f, 0xf4, 0xec, 0xe0, 0x78, 0x9d, 0x38, 0x01, 0x7e, 0x11, 0xa0, 0x4d, 0x98, 0x77, 0xa4, 0xbe, 0x86, 0xb4, 0x1f, 0x2a, 0xa1, 0xbe, 0xd6, 0x8e, 0x86, 0x9c, 0x1a, 0x91, 0xde, 0x72, 0x92, 0x04, 0x1f, 0x3d, 0x88, 0x27, 0x57, 0x0a, 0x29, 0x33, 0x21, 0x8b, 0x91, 0x90, 0xde, 0x26, 0xd3, 0x43, 0x88, 0x90, 0x93, 0x2e, 0x05, 0xbc, 0x07, 0x74, 0xa3, 0x19, 0xa6, 0x6f, 0x84, 0x3e, 0xf6, 0xd8, 0x48, 0xeb, 0x6b, 0x67, 0xa2, 0xc6, 0xf1, 0x38, 0xf5, 0x9a, 0x17, 0x3a, 0x5d, 0x7f, 0xdf, 0xc7, 0x1e, 0xdb, 0x8e, 0x62, 0x79, 0x0d, 0x8f, 0x90, 0xe0, 0xd0, 0x97, 0x4b, 0x2a, 0xc9, 0x3a, 0xa3, 0xa2, 0x77, 0xe0, 0x8c, 0x1f, 0xba, 0xee, 0x10, 0x8f, 0xb0, 0x13, 0x98, 0x43, 0x63, 0xe0, 0x91, 0xd0, 0xf5, 0xdb, 0x53, 0xab, 0x95, 0x6b, 0x15, 0x1d, 0xa9, 0x55, 0x8f, 0x58, 0x0d, 0x5a, 0x01, 0x70, 0x3d, 0xfb, 0x99, 0x3d, 0xc4, 0x03, 0x6c, 0xb5, 0xa7, 0x99, 0x50, 0x85, 0x82, 0x6e, 0xc3, 0x82, 0x8f, 0xfb, 0x7d, 0x32, 0x72, 0x0d, 0xd7, 0x23, 0x87, 0xf6, 0x10, 0x73, 0x83, 0x9c, 0x61, 0x06, 0x89, 0x44, 0xdd, 0x2e, 0xaf, 0xa2, 0xa6, 0xa9, 0xfd, 0xac, 0x0c, 0x67, 0xd9, 0x04, 0xec, 0x12, 0x4b, 0xac, 0x85, 0xd8, 0xee, 0x97, 0xa1, 0xd1, 0x67, 0x0a, 0x19, 0xae, 0xe9, 0x61, 0x27, 0x10, 0x76, 0x3f, 0xcb, 0x89, 0xbb, 0x8c, 0x86, 0x76, 0xa0, 0xe5, 0x8b, 0xa5, 0x33, 0xfa, 0x7c, 0xed, 0xc4, 0x0c, 0xbf, 0x15, 0x4d, 0xd2, 0x98, 0x75, 0xd6, 0xe7, 0xfc, 0xcc, 0xc2, 0xcf, 0xf8, 0xc7, 0x7e, 0x3f, 0x18, 0x72, 0x77, 0x51, 0x5f, 0xfb, 0x41, 0x52, 0x4e, 0x5a, 0xcd, 0x5b, 0x3d, 0xce, 0xbd, 0xe9, 0x04, 0xde, 0xb1, 0x2e, 0xdb, 0x76, 0xee, 0xc1, 0xac, 0x5a, 0x81, 0x5a, 0x50, 0xf9, 0x1a, 0x1f, 0x8b, 0x21, 0xd0, 0xcf, 0xd8, 0x2e, 0xf9, 0x66, 0xe5, 0x85, 0x7b, 0xe5, 0xdf, 0x29, 0x69, 0x1e, 0xa0, 0xb8, 0x97, 0xa7, 0x38, 0x30, 0x2d, 0x33, 0x30, 0x11, 0x82, 0x49, 0xe6, 0x7e, 0xb9, 0x08, 0xf6, 0x4d, 0xa5, 0x86, 0x62, 0x6b, 0xd4, 0x74, 0xfa, 0x89, 0xce, 0x43, 0x2d, 0x32, 0x42, 0xe1, 0x83, 0x63, 0x02, 0xf5, 0x85, 0x66, 0x10, 0xe0, 0x91, 0x1b, 0x30, 0x83, 0x68, 0xe8, 0xb2, 0xa8, 0xfd, 0xd3, 0x24, 0xb4, 0x32, 0x2b, 0x70, 0x17, 0xaa, 0x23, 0xd1, 0xbd, 0xb0, 0xfd, 0x73, 0xb1, 0x43, 0xcc, 0x68, 0xa8, 0x47, 0xcc, 0xd4, 0xdf, 0xd0, 0xcd, 0xa8, 0x1c, 0x17, 0x51, 0x99, 0x2e, 0xeb, 0x90, 0x0c, 0x0c, 0xcb, 0xf6, 0x70, 0x3f, 0x20, 0xde, 0xb1, 0xd0, 0x72, 0x76, 0x48, 0x06, 0x1b, 0x92, 0x86, 0xde, 0x05, 0xb0, 0x1c, 0x9f, 0xae, 0xe8, 0xa1, 0x3d, 0x60, 0xba, 0xd6, 0xd7, 0x50, 0xd4, 0x77, 0x74, 0x24, 0xe8, 0x35, 0xcb, 0xf1, 0x85, 0xb2, 0x1f, 0x40, 0x83, 0xba, 0x58, 0x63, 0xc4, 0xbd, 0x39, 0xb7, 0xe2, 0xfa, 0xda, 0x82, 0xa2, 0x71, 0xe4, 0xea, 0xf5, 0x59, 0x37, 0x2e, 0xf8, 0xe8, 0x63, 0x98, 0x66, 0x2e, 0xce, 0x6f, 0x4f, 0xb3, 0x36, 0x57, 0x72, 0x46, 0x29, 0x56, 0xfb, 0x09, 0xe3, 0xe3, 0x8b, 0x2d, 0x1a, 0xa1, 0x27, 0x50, 0x37, 0x1d, 0x87, 0x04, 0x26, 0xdf, 0xe0, 0x33, 0x4c, 0xc6, 0x8d, 0x62, 0x19, 0xdd, 0x98, 0x99, 0x0b, 0x52, 0x9b, 0xa3, 0x1f, 0xc1, 0x14, 0xf3, 0x00, 0xed, 0x2a, 0x1b, 0xf5, 0xca, 0x78, 0xf3, 0xd3, 0x39, 0x73, 0xe7, 0x03, 0xa8, 0x2b, 0xaa, 0x9d, 0xc6, 0xdc, 0x3a, 0xf7, 0xa1, 0x95, 0xd6, 0xe8, 0x54, 0xe6, 0xba, 0x05, 0x0b, 0x7a, 0xe8, 0xc4, 0x8a, 0xc9, 0xf8, 0xe3, 0x5d, 0x98, 0x16, 0xeb, 0xc7, 0x6d, 0x67, 0xb9, 0x70, 0x46, 0x74, 0xc1, 0xa8, 0x7d, 0x0c, 0x67, 0x53, 0xa2, 0x44, 0x74, 0xf2, 0x16, 0x34, 0x5d, 0x62, 0x19, 0x3e, 0x27, 0x1b, 0xb6, 0x25, 0x9d, 0x81, 0x1b, 0xf1, 0x6e, 0x59, 0xb4, 0x79, 0x2f, 0x20, 0x6e, 0x56, 0x95, 0x93, 0x35, 0x6f, 0xc3, 0x62, 0xba, 0x39, 0xef, 0x5e, 0x7b, 0x00, 0x4b, 0x3a, 0x1e, 0x91, 0x67, 0xf8, 0x75, 0x45, 0x77, 0xa0, 0x9d, 0x15, 0x20, 0x84, 0x7f, 0x09, 0x4b, 0x31, 0xb5, 0x17, 0x98, 0x41, 0xe8, 0x9f, 0x4a, 0xb8, 0x08, 0xdd, 0x0e, 0x88, 0x8f, 0xe5, 0x21, 0x29, 0x8a, 0xda, 0x75, 0x55, 0xb4, 0x38, 0x54, 0x79, 0x0f, 0xa8, 0x09, 0x65, 0xdb, 0x15, 0xe2, 0xca, 0xb6, 0xab, 0x3d, 0x80, 0x5a, 0x74, 0x9c, 0xa1, 0xb5, 0x38, 0x66, 0x2a, 0xbf, 0xe2, 0xcc, 0x8b, 0xa2, 0xa9, 0xc7, 0x19, 0x3f, 0x2e, 0x7a, 0x5a, 0x03, 0x88, 0x3c, 0x90, 0x3c, 0x43, 0x51, 0x56, 0x9e, 0xae, 0x70, 0x69, 0x7f, 0x93, 0x70, 0x47, 0x8a, 0xca, 0x56, 0xa4, 0xb2, 0x95, 0x70, 0x4f, 0xe5, 0xd3, 0xb8, 0xa7, 0x5b, 0x30, 0xe5, 0x07, 0x66, 0xc0, 0x1d, 0x64, 0x53, 0x19, 0x5c, 0xb2, 0x4b, 0xac, 0x73, 0x36, 0x74, 0x01, 0xa0, 0xef, 0x61, 0x33, 0xc0, 0x96, 0x61, 0x72, 0xcf, 0x59, 0xd1, 0x6b, 0x82, 0xd2, 0x0d, 0xd0, 0x3d, 0x98, 0x91, 0x31, 0xcc, 0x14, 0x53, 0x63, 0x35, 0x47, 0x60, 0x62, 0xf6, 0x75, 0xd9, 0x20, 0xde, 0xed, 0xd3, 0xe3, 0x77, 0xbb, 0x68, 0xc7, 0x99, 0x15, 0x87, 0x35, 0x53, 0xe8, 0xb0, 0x78, 0x8b, 0x93, 0x38, 0xac, 0x6a, 0xa1, 0xc3, 0x12, 0x32, 0xc6, 0x3a, 0xac, 0xef, 0xd3, 0xf5, 0xfc, 0x6b, 0x09, 0xda, 0xd9, 0xbd, 0x23, 0x7c, 0xc6, 0xbb, 0x30, 0xed, 0x33, 0xca, 0x18, 0xff, 0x23, 0x9a, 0x08, 0x46, 0xf4, 0x00, 0x26, 0x6d, 0xe7, 0x90, 0xb0, 0x1c, 0x42, 0x3d, 0xf9, 0x8b, 0xfa, 0xb8, 0xb5, 0xe5, 0x1c, 0x12, 0x3e, 0x25, 0xac, 0x61, 0xe7, 0x2e, 0xd4, 0x22, 0xd2, 0xa9, 0x46, 0xf2, 0x10, 0x16, 0x52, 0xc6, 0xc7, 0xa3, 0xd7, 0xc8, 0x54, 0x4b, 0x27, 0x32, 0x55, 0xed, 0xff, 0x4b, 0xea, 0xc6, 0x79, 0x68, 0x0f, 0x03, 0xec, 0x65, 0x36, 0xce, 0x7b, 0x52, 0x28, 0xdf, 0x35, 0x17, 0x8a, 0x84, 0xf2, 0xc0, 0x52, 0x6c, 0x82, 0x1e, 0x34, 0x99, 0xf9, 0x18, 0x3e, 0x1e, 0xb2, 0x53, 0x5a, 0xc4, 0x47, 0x3f, 0xcc, 0x69, 0xcd, 0xfb, 0xe5, 0xb6, 0xd7, 0x13, 0xec, 0x7c, 0x9a, 0x1a, 0x43, 0x95, 0xd6, 0xf9, 0x04, 0x50, 0x96, 0xe9, 0x54, 0x13, 0xf7, 0x19, 0x75, 0x3b, 0x34, 0x9b, 0xca, 0x39, 0x7e, 0x0e, 0x99, 0x1a, 0x63, 0x96, 0x9f, 0xeb, 0xa9, 0x0b, 0x46, 0xed, 0xaf, 0x2b, 0x00, 0x71, 0xe5, 0x1b, 0xeb, 0x6f, 0xee, 0x46, 0xbb, 0x9f, 0x87, 0x38, 0x17, 0x73, 0xe4, 0xe5, 0xee, 0xfb, 0x87, 0xc9, 0x7d, 0xcf, 0x83, 0x9d, 0xb7, 0xf2, 0x5a, 0xbf, 0xb1, 0x3b, 0x7e, 0x1d, 0x16, 0xd3, 0xcb, 0x2d, 0xb6, 0xfb, 0x75, 0x98, 0xb2, 0x03, 0x3c, 0xe2, 0xd8, 0x80, 0x9a, 0x23, 0x29, 0xbc, 0x9c, 0x43, 0xbb, 0x04, 0xb5, 0xad, 0x91, 0x39, 0xc0, 0x3d, 0x17, 0xf7, 0x69, 0x5f, 0x36, 0x2d, 0x88, 0xfe, 0x79, 0x41, 0x5b, 0x83, 0xea, 0x63, 0x7c, 0xcc, 0xf7, 0xe0, 0x09, 0xf5, 0xd3, 0xfe, 0xbc, 0x0c, 0x4b, 0xcc, 0x6d, 0xaf, 0xcb, 0xcc, 0x5c, 0xc7, 0x3e, 0x09, 0xbd, 0x3e, 0xf6, 0xd9, 0x92, 0xba, 0xa1, 0xe1, 0x62, 0xcf, 0x26, 0x96, 0x48, 0x45, 0x6b, 0x7d, 0x37, 0xdc, 0x65, 0x04, 0x9a, 0xbd, 0xd3, 0xea, 0x6f, 0x42, 0x22, 0x6c, 0xab, 0xa2, 0x57, 0xfb, 0x6e, 0xf8, 0x63, 0x5a, 0x96, 0x6d, 0xfd, 0x23, 0xd3, 0xc3, 0x3e, 0xb3, 0x21, 0xde, 0xb6, 0xc7, 0x08, 0xe8, 0x5d, 0x38, 0x3b, 0xc2, 0x23, 0xe2, 0x1d, 0x1b, 0x43, 0x7b, 0x64, 0x07, 0x86, 0xed, 0x18, 0x07, 0xc7, 0x01, 0xf6, 0x85, 0xe1, 0x20, 0x5e, 0xf9, 0x84, 0xd6, 0x6d, 0x39, 0x9f, 0xd2, 0x1a, 0xa4, 0x41, 0x83, 0x90, 0x91, 0xe1, 0xf7, 0x89, 0x87, 0x0d, 0xd3, 0xfa, 0x8a, 0x9d, 0x5b, 0x15, 0xbd, 0x4e, 0xc8, 0xa8, 0x47, 0x69, 0x5d, 0xeb, 0x2b, 0x74, 0x11, 0xea, 0x7d, 0x37, 0xf4, 0x71, 0x60, 0xd0, 0x1f, 0x76, 0x3e, 0xd5, 0x74, 0xe0, 0xa4, 0x75, 0x37, 0xf4, 0x15, 0x86, 0x11, 0x9d, 0xf6, 0x19, 0x95, 0xe1, 0x29, 0x9d, 0x66, 0x13, 0x1a, 0x89, 0xe4, 0x96, 0xa6, 0x30, 0x2c, 0x8b, 0x15, 0x29, 0x0c, 0xfd, 0xa6, 0x34, 0x8f, 0x0c, 0xe5, 0x4c, 0xb2, 0x6f, 0x4a, 0x0b, 0x8e, 0x5d, 0x99, 0xbf, 0xb0, 0x6f, 0x3a, 0xe5, 0x43, 0xfc, 0x4c, 0x80, 0x13, 0x35, 0x9d, 0x17, 0x34, 0x0b, 0x60, 0xdd, 0x74, 0xcd, 0x03, 0x7b, 0x68, 0x07, 0xc7, 0xe8, 0x3a, 0xb4, 0x4c, 0xcb, 0x32, 0xfa, 0x92, 0x62, 0x63, 0x89, 0x14, 0xcd, 0x99, 0x96, 0xb5, 0xae, 0x90, 0xd1, 0x0f, 0x60, 0xde, 0xf2, 0x88, 0x9b, 0xe4, 0xe5, 0xd0, 0x51, 0x8b, 0x56, 0xa8, 0xcc, 0xda, 0x3f, 0x4e, 0xc2, 0x85, 0xe4, 0xc2, 0xa6, 0xe1, 0x82, 0xbb, 0x30, 0x9b, 0xea, 0x35, 0x99, 0xa7, 0xc7, 0x4a, 0xea, 0x09, 0xc6, 0x54, 0x42, 0x5d, 0xce, 0x24, 0xd4, 0xb9, 0x38, 0x44, 0xe5, 0xbb, 0xc0, 0x21, 0x26, 0xbf, 0x0d, 0x0e, 0x31, 0x75, 0x22, 0x1c, 0xe2, 0x2a, 0x83, 0x05, 0x65, 0x23, 0x96, 0x0d, 0x72, 0x33, 0x6a, 0x44, 0x3c, 0x8e, 0x84, 0x0f, 0x53, 0x78, 0xc5, 0xcc, 0x69, 0xf0, 0x8a, 0x6a, 0x21, 0x5e, 0x41, 0x2d, 0xc2, 0x75, 0x4d, 0x6f, 0x44, 0x3c, 0x09, 0x48, 0xb4, 0x6b, 0x4c, 0x85, 0x39, 0x49, 0x17, 0x60, 0x44, 0x21, 0x74, 0x01, 0x45, 0xd0, 0x05, 0x5a, 0x85, 0x59, 0x87, 0x18, 0x0e, 0x7e, 0x6e, 0xd0, 0x05, 0xf3, 0xdb, 0x75, 0xbe, 0x7a, 0x0e, 0xd9, 0xc6, 0xcf, 0x77, 0x29, 0x45, 0xfb, 0xdb, 0x12, 0x2c, 0x24, 0x0d, 0x47, 0x24, 0xab, 0xf7, 0xa1, 0xe6, 0x49, 0xdf, 0x20, 0x8c, 0x65, 0x35, 0x19, 0xfa, 0x65, 0x7d, 0x88, 0x1e, 0x37, 0x41, 0x3f, 0x2e, 0x84, 0x3d, 0xae, 0x16, 0x88, 0x79, 0x15, 0xf0, 0xa1, 0x75, 0x61, 0x3e, 0x62, 0x1e, 0x0b, 0x3a, 0x28, 0x20, 0x42, 0x39, 0x09, 0x22, 0x38, 0x30, 0xbd, 0x81, 0x9f, 0xd9, 0x7d, 0xfc, 0x9d, 0x80, 0x96, 0xab, 0x50, 0x77, 0xb1, 0x37, 0xb2, 0x7d, 0x3f, 0x32, 0xfa, 0x9a, 0xae, 0x92, 0xb4, 0xff, 0x9a, 0x82, 0xb9, 0xf4, 0xcc, 0xde, 0xc9, 0x60, 0x16, 0x9d, 0x78, 0x17, 0xa6, 0xc7, 0xa7, 0x9c, 0xd1, 0xd7, 0xe4, 0x31, 0x50, 0x4e, 0x25, 0x28, 0xd1, 0x49, 0x21, 0x8e, 0x06, 0x3a, 0xfe, 0x3e, 0x19, 0x8d, 0x4c, 0xc7, 0x92, 0x80, 0xb2, 0x28, 0xd2, 0xd9, 0x32, 0xbd, 0x01, 0xdd, 0x5a, 0x94, 0xcc, 0xbe, 0xa9, 0x97, 0xa4, 0x81, 0xbe, 0xed, 0x30, 0xc8, 0x83, 0x6d, 0x9c, 0x9a, 0x0e, 0x82, 0xb4, 0x61, 0x7b, 0xe8, 0x0a, 0x4c, 0x62, 0xe7, 0x99, 0x3c, 0x8d, 0x63, 0xc4, 0x59, 0x1e, 0x3f, 0x3a, 0xab, 0x46, 0x57, 0x61, 0x7a, 0x44, 0x42, 0x27, 0x90, 0x21, 0x7f, 0x33, 0x09, 0xbc, 0xea, 0xa2, 0x16, 0x5d, 0x87, 0x19, 0x8b, 0xad, 0x81, 0x8c, 0xeb, 0xe7, 0x62, 0xd8, 0x84, 0xd1, 0x75, 0x59, 0x8f, 0x3e, 0x8a, 0xe2, 0x88, 0x5a, 0x2a, 0x12, 0x48, 0x4d, 0x6a, 0x6e, 0x30, 0xf1, 0x38, 0x19, 0x4c, 0x00, 0x13, 0x71, 0xbd, 0x50, 0xc4, 0x78, 0xd0, 0x63, 0x19, 0xaa, 0x43, 0x32, 0xe0, 0x76, 0x50, 0xe7, 0xd7, 0x0f, 0x43, 0x32, 0x60, 0x66, 0xb0, 0x40, 0x83, 0x27, 0xcb, 0x76, 0xda, 0xb3, 0x6c, 0x7b, 0xf1, 0x02, 0x3d, 0x13, 0xd9, 0x87, 0x41, 0x9c, 0x3e, 0x6e, 0x37, 0x58, 0x55, 0x8d, 0x51, 0x76, 0x9c, 0x3e, 0x3b, 0xb2, 0x83, 0xe0, 0xb8, 0xdd, 0x64, 0x74, 0xfa, 0x49, 0x63, 0x5e, 0x9e, 0x68, 0xcd, 0xa5, 0x62, 0xde, 0xbc, 0xfd, 0xf9, 0x06, 0xa0, 0x2a, 0xff, 0x50, 0x82, 0xc5, 0x75, 0x16, 0xf2, 0x29, 0x9e, 0xe0, 0x34, 0xa8, 0xc0, 0xed, 0x08, 0x7e, 0x49, 0xa7, 0xf0, 0xe9, 0xc1, 0x0a, 0x3e, 0xf4, 0x09, 0x34, 0xa5, 0x4c, 0xd1, 0xb2, 0xf2, 0x2a, 0xe0, 0xa6, 0xe1, 0xab, 0x45, 0xed, 0x23, 0x58, 0xca, 0xe8, 0x2c, 0xc2, 0xb3, 0x4b, 0x30, 0x1b, 0x7b, 0x84, 0x48, 0xe5, 0x7a, 0x44, 0xdb, 0xb2, 0xb4, 0x7b, 0x70, 0xb6, 0x17, 0x98, 0x5e, 0x90, 0x19, 0xf0, 0x09, 0xda, 0x32, 0xec, 0x26, 0xd9, 0x56, 0xc0, 0x2b, 0x3d, 0x58, 0xe8, 0x05, 0xc4, 0x7d, 0x0d, 0xa1, 0x74, 0xa7, 0xd3, 0x61, 0x93, 0x30, 0x10, 0x31, 0x99, 0x2c, 0x6a, 0x4b, 0x1c, 0x69, 0xca, 0xf6, 0xf6, 0x21, 0x2c, 0x72, 0xa0, 0xe7, 0x75, 0x06, 0xb1, 0x2c, 0x61, 0xa6, 0xac, 0xdc, 0x0d, 0x38, 0x13, 0xbb, 0xf2, 0x38, 0x3d, 0xbc, 0x99, 0x4c, 0x0f, 0x97, 0xb2, 0x6b, 0x9c, 0xc8, 0x0e, 0xff, 0xa2, 0xac, 0x38, 0xcc, 0x82, 0xe4, 0x70, 0x2d, 0x99, 0x1c, 0x9e, 0x2f, 0x10, 0x99, 0xc8, 0x0d, 0xb3, 0x16, 0x59, 0xc9, 0xb1, 0x48, 0x3d, 0x93, 0x41, 0x4e, 0xa6, 0xf2, 0xec, 0x94, 0x6e, 0xbf, 0x95, 0x04, 0x72, 0x8b, 0x27, 0x90, 0x51, 0xd7, 0x11, 0xf8, 0x76, 0x3b, 0x95, 0x40, 0xb6, 0x8b, 0xd4, 0x8c, 0xf2, 0xc7, 0x3f, 0x9d, 0x84, 0x5a, 0x54, 0x97, 0x99, 0xd8, 0xec, 0x24, 0x95, 0x73, 0x26, 0x49, 0x3d, 0xbf, 0x2a, 0xaf, 0x73, 0x7e, 0x4d, 0xbe, 0xea, 0xfc, 0x3a, 0x07, 0x35, 0xf6, 0x61, 0x78, 0xf8, 0x50, 0x9c, 0x47, 0x55, 0x46, 0xd0, 0xf1, 0x61, 0x6c, 0x50, 0xd3, 0x27, 0x31, 0xa8, 0x54, 0xa6, 0x3a, 0x93, 0xce, 0x54, 0xef, 0x44, 0x27, 0x0c, 0x3f, 0x8b, 0x56, 0xb2, 0xe2, 0x72, 0xcf, 0x96, 0xcd, 0xe4, 0xd9, 0xc2, 0x8f, 0xa7, 0xcb, 0x39, 0x8d, 0xdf, 0xd8, 0x3c, 0xf5, 0x09, 0xcf, 0x53, 0x55, 0xab, 0x12, 0x8e, 0x70, 0x0d, 0x20, 0xda, 0xf3, 0x32, 0x59, 0x45, 0xd9, 0xa1, 0xe9, 0x0a, 0x97, 0xb6, 0x0f, 0x8b, 0x89, 0xf9, 0x8f, 0x11, 0xe2, 0x93, 0x79, 0xb1, 0x02, 0x78, 0xf8, 0x5f, 0xd4, 0xf8, 0xa9, 0x00, 0x64, 0xbd, 0x93, 0x01, 0x3d, 0x4e, 0x66, 0x8f, 0x37, 0x93, 0x98, 0xc7, 0xe9, 0x0c, 0x29, 0x03, 0x79, 0xb0, 0xe3, 0xde, 0xf4, 0x44, 0x35, 0xcf, 0x56, 0x6b, 0x82, 0xd2, 0x0d, 0x68, 0x90, 0x75, 0x68, 0x3b, 0xb6, 0x7f, 0xc4, 0xeb, 0xa7, 0x59, 0x3d, 0x48, 0x52, 0x97, 0x5d, 0xc2, 0xe3, 0x17, 0x76, 0x60, 0xf4, 0x89, 0x85, 0x99, 0x99, 0x4e, 0xe9, 0x55, 0x4a, 0x58, 0x27, 0x16, 0x8e, 0xb7, 0x4e, 0xf5, 0x54, 0x5b, 0xa7, 0x96, 0xda, 0x3a, 0x8b, 0x30, 0xed, 0x61, 0xd3, 0x27, 0x8e, 0x48, 0x19, 0x44, 0x89, 0xce, 0xff, 0x08, 0xfb, 0x3e, 0xed, 0x40, 0x84, 0x36, 0xa2, 0xa8, 0x04, 0x60, 0xb3, 0x45, 0x01, 0xd8, 0x18, 0x14, 0x37, 0x15, 0x80, 0x35, 0x8a, 0x02, 0xb0, 0x93, 0x80, 0xb8, 0x4a, 0x78, 0xd9, 0x1c, 0x1b, 0x5e, 0xaa, 0x81, 0xda, 0x5c, 0x22, 0x50, 0xfb, 0x3e, 0x77, 0xdb, 0x3f, 0x97, 0x60, 0x29, 0xb3, 0x41, 0xc4, 0x7e, 0xbb, 0x9d, 0x82, 0x81, 0xdb, 0x45, 0x33, 0x14, 0xa1, 0xc0, 0xf7, 0x13, 0x28, 0xf0, 0x8d, 0x42, 0xfe, 0xef, 0x1c, 0x04, 0xfe, 0x43, 0xb8, 0xb8, 0xef, 0x5a, 0xa9, 0xf0, 0x49, 0x24, 0x7f, 0x27, 0xdf, 0xef, 0x77, 0x64, 0xa4, 0x5b, 0x3e, 0x61, 0x5e, 0xc9, 0xd9, 0x35, 0x0d, 0x56, 0x8b, 0x7b, 0x17, 0x61, 0xc8, 0xef, 0xc3, 0xdc, 0xe6, 0x0b, 0xdc, 0xef, 0x1d, 0x3b, 0xfd, 0x53, 0x68, 0xd4, 0x82, 0x4a, 0x7f, 0x64, 0x09, 0x78, 0x85, 0x7e, 0xaa, 0x91, 0x55, 0x25, 0x19, 0x59, 0x19, 0xd0, 0x8a, 0x7b, 0x10, 0x4b, 0xb8, 0x48, 0x97, 0xd0, 0xa2, 0xcc, 0x54, 0xf8, 0xac, 0x2e, 0x4a, 0x82, 0x8e, 0x3d, 0x8f, 0x0d, 0x95, 0xd3, 0xb1, 0xe7, 0x25, 0x77, 0x7b, 0x25, 0xb9, 0xdb, 0xb5, 0xbf, 0x2a, 0x41, 0x9d, 0xf6, 0xf0, 0xad, 0xf4, 0x17, 0xf9, 0x45, 0x25, 0xce, 0x2f, 0xa2, 0x34, 0x65, 0x52, 0x4d, 0x53, 0x62, 0xcd, 0xa7, 0x18, 0x39, 0xab, 0xf9, 0x74, 0x44, 0xc7, 0x9e, 0xa7, 0xad, 0xc2, 0x2c, 0xd7, 0x4d, 0x8c, 0xbc, 0x05, 0x95, 0xd0, 0x1b, 0x4a, 0xeb, 0x09, 0xbd, 0xa1, 0xf6, 0x67, 0x25, 0x68, 0x74, 0x83, 0xc0, 0xec, 0x1f, 0x9d, 0x62, 0x00, 0x91, 0x72, 0x65, 0x55, 0xb9, 0xec, 0x20, 0x62, 0x75, 0x27, 0x0b, 0xd4, 0x9d, 0x4a, 0xa8, 0xab, 0x41, 0x53, 0xea, 0x52, 0xa8, 0xf0, 0x36, 0xa0, 0x5d, 0xe2, 0x05, 0x0f, 0x89, 0xf7, 0xdc, 0xf4, 0xac, 0xd3, 0xe5, 0x30, 0x08, 0x26, 0xc5, 0xc3, 0xaa, 0xca, 0xb5, 0x29, 0x9d, 0x7d, 0x6b, 0x6f, 0xc3, 0x99, 0x84, 0xbc, 0xc2, 0x8e, 0xef, 0x42, 0x9d, 0x39, 0x70, 0x11, 0xe7, 0x5e, 0x53, 0x71, 0xde, 0x71, 0x5e, 0x5e, 0xeb, 0xc2, 0x3c, 0x3d, 0xbb, 0x19, 0x3d, 0xda, 0x78, 0x3f, 0x4c, 0x45, 0x83, 0x0b, 0xc9, 0xf6, 0xa9, 0x48, 0xf0, 0xef, 0x4a, 0x30, 0xc5, 0xe8, 0x99, 0xf3, 0xf4, 0x1c, 0xd4, 0x3c, 0xec, 0x12, 0x23, 0x30, 0x07, 0xd1, 0x5b, 0x35, 0x4a, 0xd8, 0x33, 0x07, 0x3e, 0x7b, 0x6a, 0x47, 0x2b, 0x2d, 0x7b, 0x80, 0xfd, 0x40, 0x3e, 0x58, 0xab, 0x53, 0xda, 0x06, 0x27, 0xd1, 0x29, 0xf1, 0xed, 0x3f, 0xe0, 0x61, 0xde, 0xa4, 0xce, 0xbe, 0xd1, 0x15, 0xfe, 0x0c, 0x64, 0x0c, 0x28, 0xc7, 0xde, 0x86, 0x74, 0xa0, 0x9a, 0xc2, 0xe1, 0xa2, 0xb2, 0xf6, 0x11, 0x20, 0x75, 0xcc, 0x62, 0x52, 0xaf, 0xc2, 0x34, 0x9b, 0x12, 0x19, 0xa7, 0x34, 0x93, 0x83, 0xd6, 0x45, 0xad, 0xf6, 0x05, 0x20, 0x3e, 0x8b, 0x89, 0xd8, 0xe4, 0xc4, 0x33, 0x3e, 0x26, 0x44, 0xf9, 0xfb, 0x12, 0x9c, 0x49, 0x88, 0x8e, 0x1e, 0x04, 0x24, 0x64, 0xa7, 0x15, 0x13, 0x72, 0xef, 0x25, 0x3c, 0xf9, 0xd5, 0x94, 0x02, 0xbf, 0x21, 0x2f, 0xfe, 0xcb, 0x12, 0x40, 0x37, 0x0c, 0x8e, 0x04, 0x20, 0xa5, 0xce, 0x7a, 0x29, 0x39, 0xeb, 0xb4, 0xce, 0x35, 0x7d, 0xff, 0x39, 0xf1, 0x64, 0x32, 0x10, 0x95, 0x19, 0x98, 0x14, 0x06, 0x47, 0x12, 0x04, 0xa7, 0xdf, 0xe8, 0x0a, 0x34, 0xf9, 0x93, 0x47, 0xc3, 0xb4, 0x2c, 0x0f, 0xfb, 0xbe, 0x40, 0xc3, 0x1b, 0x9c, 0xda, 0xe5, 0x44, 0xca, 0x66, 0x5b, 0xd8, 0x09, 0xec, 0xe0, 0xd8, 0x08, 0xc8, 0xd7, 0xd8, 0x11, 0x61, 0x7e, 0x43, 0x52, 0xf7, 0x28, 0x91, 0xb2, 0x79, 0x78, 0x60, 0xfb, 0x81, 0x27, 0xd9, 0x24, 0x3a, 0x2b, 0xa8, 0x8c, 0x4d, 0xfb, 0x79, 0x09, 0x5a, 0xbb, 0xe1, 0x70, 0xc8, 0x67, 0xf6, 0xd4, 0x6b, 0xfb, 0xb6, 0x18, 0x47, 0x39, 0x65, 0x9d, 0xf1, 0x14, 0x89, 0xc1, 0x7d, 0x7b, 0xf8, 0xe1, 0x36, 0xcc, 0x2b, 0x8a, 0x0a, 0x4b, 0x49, 0xc4, 0x6c, 0xa5, 0x64, 0xcc, 0xa6, 0xdd, 0x07, 0xc4, 0x33, 0xee, 0xd7, 0x1b, 0x9c, 0x76, 0x16, 0xce, 0x24, 0xda, 0x8b, 0x63, 0xf2, 0x06, 0x34, 0xc4, 0x7d, 0xbf, 0x30, 0x82, 0x65, 0xa8, 0x52, 0x77, 0xd7, 0xb7, 0x2d, 0x79, 0xfb, 0x31, 0xe3, 0x12, 0x6b, 0xdd, 0xb6, 0x3c, 0x6d, 0x1b, 0x1a, 0x3a, 0x17, 0x2f, 0x78, 0x3f, 0x86, 0xa6, 0x78, 0x1d, 0x60, 0x24, 0xde, 0xcf, 0xc4, 0x50, 0x7d, 0x42, 0xb6, 0xde, 0x70, 0xd4, 0xa2, 0xf6, 0x53, 0xe8, 0xf0, 0x63, 0x3c, 0x21, 0x55, 0x0e, 0xed, 0x63, 0x90, 0x4f, 0x72, 0x8b, 0x84, 0x27, 0x9b, 0x35, 0x3c, 0xb5, 0xa8, 0x5d, 0x80, 0x73, 0xb9, 0xc2, 0xc5, 0xb8, 0x5d, 0x68, 0xc5, 0x15, 0x96, 0x2d, 0x2f, 0x7d, 0xd8, 0x65, 0x4e, 0x49, 0xb9, 0xcc, 0x59, 0x8c, 0x62, 0xb2, 0xb2, 0x3c, 0x4f, 0x58, 0xe4, 0x15, 0x87, 0xd0, 0x95, 0xa2, 0x10, 0x7a, 0x32, 0x11, 0x42, 0x6b, 0x9f, 0x45, 0xb3, 0x27, 0xf2, 0x97, 0x0f, 0x58, 0x7a, 0xc5, 0xfb, 0x96, 0x6e, 0x6b, 0x39, 0x67, 0x70, 0x9c, 0x43, 0x57, 0x98, 0xb5, 0xeb, 0xd0, 0x48, 0x3a, 0x30, 0xc5, 0x2d, 0x95, 0x32, 0x6e, 0xa9, 0x99, 0xf2, 0x48, 0xb7, 0x52, 0x71, 0x66, 0x66, 0x46, 0x53, 0x51, 0xe6, 0xfb, 0x09, 0xdf, 0x74, 0x29, 0xbe, 0x87, 0xf9, 0x0d, 0xb9, 0xa5, 0x05, 0xe1, 0xa3, 0x1f, 0xfa, 0xb4, 0xbd, 0x18, 0xa2, 0x76, 0x19, 0xea, 0xfb, 0x45, 0x8f, 0x65, 0x27, 0xe5, 0xc5, 0xe6, 0xdb, 0x30, 0xdf, 0x0b, 0x88, 0x67, 0x0e, 0xf0, 0x16, 0x73, 0x20, 0x87, 0x36, 0xbf, 0xb8, 0x0b, 0xc3, 0xe8, 0x68, 0x63, 0xdf, 0xda, 0x7f, 0x94, 0x60, 0xee, 0xa1, 0x3d, 0xc4, 0xfe, 0xb1, 0x1f, 0xe0, 0xd1, 0x3e, 0x4b, 0x72, 0xce, 0x43, 0x8d, 0x8e, 0xcb, 0x0f, 0xcc, 0x91, 0x2b, 0x2f, 0x3e, 0x23, 0x02, 0x5d, 0x2e, 0x9f, 0x8b, 0x96, 0x80, 0x88, 0x9a, 0x60, 0x66, 0x7a, 0xa5, 0x49, 0x9f, 0x20, 0xa1, 0xf7, 0x00, 0x42, 0x1f, 0x5b, 0xe2, 0xb2, 0xb3, 0x92, 0x3a, 0x95, 0xf7, 0xd5, 0x2b, 0x29, 0xca, 0xc7, 0x6f, 0x3e, 0xdf, 0x87, 0xba, 0xed, 0x10, 0x0b, 0xb3, 0x2b, 0x29, 0x4b, 0x80, 0x25, 0xf9, 0xad, 0x80, 0x33, 0xee, 0xfb, 0xd8, 0xd2, 0x7e, 0x4f, 0x9c, 0x42, 0x72, 0xf2, 0xc4, 0x9a, 0x6f, 0xc2, 0x3c, 0xf7, 0x2d, 0x87, 0xd1, 0xa0, 0xa5, 0xcd, 0xc5, 0x69, 0x46, 0x6a, 0x42, 0xf4, 0x96, 0x2d, 0x02, 0x06, 0xd9, 0x42, 0xbb, 0x07, 0x67, 0x13, 0xb9, 0xc5, 0x29, 0xa2, 0x7d, 0xed, 0x51, 0x0a, 0x1a, 0x88, 0x0d, 0x52, 0x64, 0xe0, 0xd2, 0x1e, 0x0b, 0x32, 0x70, 0x9f, 0x67, 0xe0, 0xbe, 0xa6, 0xc3, 0x72, 0x02, 0xb1, 0x48, 0x28, 0xf2, 0x7e, 0x2a, 0xfa, 0xb9, 0x50, 0x20, 0x2c, 0x15, 0x06, 0xfd, 0x6f, 0x09, 0x16, 0xf2, 0x18, 0x5e, 0x13, 0x1b, 0xfb, 0x49, 0xc1, 0x13, 0x94, 0xdb, 0x63, 0xb5, 0xf9, 0xad, 0xa0, 0x88, 0x8f, 0xa1, 0x93, 0x37, 0x7b, 0xd9, 0xa5, 0xa8, 0x9c, 0x60, 0x29, 0xfe, 0xaf, 0xac, 0xa0, 0xbd, 0xdd, 0x20, 0xf0, 0xec, 0x83, 0x90, 0x1a, 0xef, 0x77, 0x85, 0xcd, 0x7c, 0x12, 0xe1, 0x0e, 0x7c, 0xfe, 0xae, 0x65, 0x5b, 0xc5, 0xbd, 0xe6, 0x62, 0x0f, 0x3b, 0x49, 0xec, 0x81, 0xe3, 0xb8, 0x37, 0xc7, 0x8a, 0x79, 0x63, 0xa1, 0xba, 0x97, 0x25, 0x68, 0x26, 0xd7, 0x01, 0x7d, 0x04, 0x60, 0x46, 0x9a, 0x0b, 0x93, 0x3f, 0x3f, 0x6e, 0x74, 0xba, 0xc2, 0x8f, 0x2e, 0x43, 0xa5, 0xef, 0x86, 0x62, 0x45, 0xe2, 0x0b, 0xbd, 0x75, 0x37, 0xe4, 0x0e, 0x80, 0xd6, 0xd2, 0x7c, 0x82, 0x3f, 0xcc, 0xc8, 0x78, 0xae, 0xa7, 0x8c, 0xcc, 0x59, 0x05, 0x0f, 0x7a, 0x00, 0xcd, 0xe7, 0x9e, 0x1d, 0x98, 0x07, 0x43, 0x6c, 0x0c, 0xcd, 0x63, 0xec, 0x09, 0xcf, 0x55, 0xec, 0x65, 0x1a, 0x92, 0xff, 0x09, 0x65, 0xd7, 0x42, 0xa8, 0xca, 0xfe, 0x5f, 0xe1, 0x91, 0x1f, 0xc3, 0x52, 0x48, 0xd9, 0x0c, 0xf6, 0x38, 0xc4, 0x31, 0x1d, 0x62, 0xf8, 0x98, 0x9e, 0x92, 0xf2, 0x2d, 0x68, 0xbe, 0xb7, 0x5c, 0x60, 0x8d, 0xd6, 0x89, 0x87, 0xb7, 0x4d, 0x87, 0xf4, 0x78, 0x0b, 0x6d, 0x04, 0x75, 0x65, 0x38, 0xaf, 0xe8, 0xf9, 0x13, 0x98, 0x97, 0x57, 0xa5, 0x3e, 0x0e, 0x84, 0x5f, 0x1f, 0xd7, 0xe7, 0x9c, 0x60, 0xef, 0xe1, 0x80, 0x79, 0xf7, 0x1b, 0xe7, 0xa1, 0x2a, 0xff, 0xa8, 0x83, 0x66, 0xa0, 0xb2, 0xb7, 0xbe, 0xdb, 0x9a, 0xa0, 0x1f, 0xfb, 0x1b, 0xbb, 0xad, 0xd2, 0x8d, 0x11, 0xb4, 0xd2, 0x7f, 0x52, 0x41, 0x4b, 0x70, 0x66, 0x57, 0xdf, 0xd9, 0xed, 0x3e, 0xea, 0xee, 0x6d, 0xed, 0x6c, 0x1b, 0xbb, 0xfa, 0xd6, 0xe7, 0xdd, 0xbd, 0xcd, 0xd6, 0x04, 0xba, 0x04, 0x17, 0xd4, 0x8a, 0xdf, 0xdd, 0xe9, 0xed, 0x19, 0x7b, 0x3b, 0xc6, 0xfa, 0xce, 0xf6, 0x5e, 0x77, 0x6b, 0x7b, 0x53, 0x6f, 0x95, 0xd0, 0x05, 0x58, 0x56, 0x59, 0x3e, 0xdd, 0xda, 0xd8, 0xd2, 0x37, 0xd7, 0xe9, 0x77, 0xf7, 0x49, 0xab, 0x7c, 0xe3, 0x1e, 0xcc, 0xa5, 0xde, 0x77, 0xa1, 0x79, 0x68, 0xf4, 0xba, 0xdb, 0x1b, 0x9f, 0xee, 0x7c, 0x61, 0xe8, 0x9b, 0xdd, 0x8d, 0x2f, 0x5b, 0x13, 0x68, 0x01, 0x5a, 0x92, 0xb4, 0xbd, 0xb3, 0xc7, 0xa9, 0xa5, 0x1b, 0x5f, 0xa7, 0x4c, 0x12, 0xa3, 0xb3, 0x30, 0x1f, 0xf5, 0x6d, 0xac, 0xeb, 0x9b, 0xdd, 0xbd, 0xcd, 0x8d, 0xd6, 0x44, 0x92, 0xac, 0xef, 0x6f, 0x6f, 0x6f, 0x6d, 0x3f, 0x6a, 0x95, 0xa8, 0xd4, 0x98, 0xbc, 0xf9, 0xc5, 0x16, 0x65, 0x2e, 0x27, 0x99, 0xf7, 0xb7, 0x1f, 0x6f, 0xef, 0xfc, 0x64, 0xbb, 0x55, 0x59, 0xfb, 0xf7, 0x06, 0x34, 0x65, 0x8c, 0x82, 0x3d, 0x76, 0x7f, 0x7f, 0x1f, 0x66, 0xe4, 0x5f, 0xb6, 0x62, 0x67, 0x95, 0xfc, 0x7f, 0x59, 0xa7, 0x9d, 0xad, 0x10, 0x61, 0xe0, 0x04, 0xda, 0x65, 0x61, 0x99, 0xf2, 0x96, 0xee, 0x82, 0x1a, 0x0d, 0x65, 0x1e, 0xeb, 0x75, 0x56, 0x8a, 0xaa, 0x23, 0x89, 0x3d, 0x1a, 0x70, 0xa9, 0x8f, 0xb3, 0xd1, 0x8a, 0x1a, 0x26, 0x64, 0x1f, 0x7d, 0x77, 0x2e, 0x16, 0xd6, 0x47, 0x42, 0xbf, 0x84, 0x56, 0xfa, 0x59, 0x36, 0x8a, 0xf1, 0xb2, 0x82, 0x27, 0xdf, 0x9d, 0x4b, 0x63, 0x38, 0x54, 0xd1, 0x99, 0x07, 0xcc, 0xab, 0x63, 0x1e, 0x94, 0xa6, 0x45, 0x17, 0x3d, 0x39, 0xe5, 0x53, 0x91, 0x7c, 0x03, 0x87, 0xd4, 0x67, 0xc3, 0x39, 0x6f, 0x21, 0x95, 0xa9, 0xc8, 0x7f, 0x3c, 0xa7, 0x4d, 0xa0, 0xcf, 0x61, 0x2e, 0x75, 0x75, 0x8b, 0xe2, 0x56, 0xf9, 0x17, 0xd1, 0x9d, 0xd5, 0x62, 0x86, 0xe4, 0xba, 0xa9, 0x17, 0xb3, 0x89, 0x75, 0xcb, 0xb9, 0xed, 0x4d, 0xac, 0x5b, 0xee, 0x8d, 0x2e, 0x33, 0xaf, 0xc4, 0xf5, 0xab, 0x62, 0x5e, 0x79, 0x77, 0xbd, 0x9d, 0x95, 0xa2, 0x6a, 0x75, 0xf8, 0xa9, 0xab, 0x57, 0x65, 0xf8, 0xf9, 0x37, 0xba, 0x9d, 0xd5, 0x62, 0x86, 0xf4, 0x5a, 0xc5, 0xf7, 0x40, 0xa9, 0xb5, 0xca, 0x5c, 0x3b, 0xa6, 0xd6, 0x2a, 0x7b, 0x81, 0x24, 0xd6, 0x2a, 0x75, 0x6d, 0x73, 0xb1, 0x18, 0xa5, 0xce, 0xac, 0x55, 0x3e, 0x8c, 0xad, 0x4d, 0xa0, 0x6f, 0xa0, 0x5d, 0x84, 0x00, 0xa3, 0x38, 0x46, 0x78, 0x05, 0x44, 0xdd, 0xb9, 0x7e, 0x02, 0xce, 0xa8, 0xcb, 0x2e, 0x54, 0x25, 0xdc, 0x8b, 0x62, 0x87, 0x92, 0xc2, 0x98, 0x3b, 0xcb, 0x39, 0x35, 0x91, 0x88, 0xf7, 0x61, 0x92, 0x52, 0xd1, 0x42, 0x82, 0x49, 0x36, 0x3d, 0x9b, 0xa2, 0x46, 0xcd, 0x3e, 0x84, 0x69, 0x8e, 0x5d, 0xa2, 0x38, 0x53, 0x4b, 0x00, 0xab, 0x9d, 0xa5, 0x0c, 0x3d, 0x6a, 0xfc, 0x19, 0xff, 0xe7, 0xa8, 0x00, 0x21, 0xd1, 0xb9, 0xc4, 0x9f, 0x8c, 0x92, 0x50, 0x67, 0xe7, 0x7c, 0x7e, 0xa5, 0x6a, 0x22, 0xa9, 0xf0, 0x63, 0xa5, 0x28, 0x3e, 0xcc, 0x98, 0x48, 0x7e, 0xbc, 0xa9, 0x4d, 0x20, 0x83, 0xe3, 0x79, 0x29, 0xc1, 0x5a, 0xbe, 0x6d, 0x25, 0x84, 0x5f, 0x1e, 0xcb, 0x13, 0x75, 0x70, 0x00, 0x67, 0x72, 0x90, 0x00, 0x74, 0x39, 0xb5, 0xf8, 0x79, 0x20, 0x44, 0xe7, 0xad, 0xf1, 0x4c, 0xea, 0x12, 0x09, 0xf3, 0x5e, 0xcc, 0xa4, 0xc7, 0xe9, 0x25, 0x4a, 0x1b, 0xf3, 0xda, 0x1f, 0x57, 0x60, 0x96, 0xe3, 0x35, 0xe2, 0x4c, 0x7b, 0x04, 0x10, 0x43, 0x9c, 0xa8, 0x93, 0x18, 0x66, 0x02, 0xeb, 0xed, 0x9c, 0xcb, 0xad, 0x53, 0x17, 0x5f, 0x01, 0x10, 0x95, 0xc5, 0xcf, 0x62, 0xa0, 0xca, 0xe2, 0xe7, 0x60, 0x8e, 0xda, 0x04, 0xda, 0x80, 0x5a, 0x04, 0x59, 0x21, 0x05, 0xe9, 0x4a, 0xe1, 0x6d, 0x9d, 0x4e, 0x5e, 0x95, 0xaa, 0x91, 0x02, 0x43, 0x29, 0x1a, 0x65, 0xc1, 0x2d, 0x45, 0xa3, 0x3c, 0xe4, 0x2a, 0x1e, 0x1d, 0x4f, 0x75, 0xd3, 0xa3, 0x4b, 0xa0, 0x07, 0xe9, 0xd1, 0x25, 0xb3, 0x63, 0x6d, 0xe2, 0xd3, 0xf3, 0xbf, 0xf8, 0xd5, 0x4a, 0xe9, 0x3f, 0x7f, 0xb5, 0x32, 0xf1, 0x47, 0x2f, 0x57, 0x4a, 0xbf, 0x78, 0xb9, 0x52, 0xfa, 0xb7, 0x97, 0x2b, 0xa5, 0xff, 0x7e, 0xb9, 0x52, 0xfa, 0xd9, 0xff, 0xac, 0x4c, 0x1c, 0x4c, 0xb3, 0xbf, 0x52, 0xbf, 0xf7, 0xeb, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa6, 0x04, 0x77, 0x58, 0xfe, 0x3e, 0x00, 0x00, } ================================================ FILE: pkg/checkpoint/cri/v1alpha1/constants.go ================================================ /* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1alpha1 // This file contains all constants defined in CRI. // Required runtime condition type. const ( // RuntimeReady means the runtime is up and ready to accept basic containers. RuntimeReady = "RuntimeReady" // NetworkReady means the runtime network is up and ready to accept containers which require network. NetworkReady = "NetworkReady" ) // LogStreamType is the type of the stream in CRI container log. type LogStreamType string const ( // Stdout is the stream type for stdout. Stdout LogStreamType = "stdout" // Stderr is the stream type for stderr. Stderr LogStreamType = "stderr" ) // LogTag is the tag of a log line in CRI container log. // Currently defined log tags: // * First tag: Partial/End - P/E. // The field in the container log format can be extended to include multiple // tags by using a delimiter, but changes should be rare. If it becomes clear // that better extensibility is desired, a more extensible format (e.g., json) // should be adopted as a replacement and/or addition. type LogTag string const ( // LogTagPartial means the line is part of multiple lines. LogTagPartial LogTag = "P" // LogTagFull means the line is a single full line or the end of multiple lines. LogTagFull LogTag = "F" // LogTagDelimiter is the delimiter for different log tags. LogTagDelimiter = ":" ) ================================================ FILE: pkg/checkpoint/cri/v1alpha2/api.pb.go ================================================ /* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: api.proto package v1alpha2 import ( context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type Protocol int32 const ( Protocol_TCP Protocol = 0 Protocol_UDP Protocol = 1 Protocol_SCTP Protocol = 2 ) var Protocol_name = map[int32]string{ 0: "TCP", 1: "UDP", 2: "SCTP", } var Protocol_value = map[string]int32{ "TCP": 0, "UDP": 1, "SCTP": 2, } func (x Protocol) String() string { return proto.EnumName(Protocol_name, int32(x)) } func (Protocol) EnumDescriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } type MountPropagation int32 const ( // No mount propagation ("private" in Linux terminology). MountPropagation_PROPAGATION_PRIVATE MountPropagation = 0 // Mounts get propagated from the host to the container ("rslave" in Linux). MountPropagation_PROPAGATION_HOST_TO_CONTAINER MountPropagation = 1 // Mounts get propagated from the host to the container and from the // container to the host ("rshared" in Linux). MountPropagation_PROPAGATION_BIDIRECTIONAL MountPropagation = 2 ) var MountPropagation_name = map[int32]string{ 0: "PROPAGATION_PRIVATE", 1: "PROPAGATION_HOST_TO_CONTAINER", 2: "PROPAGATION_BIDIRECTIONAL", } var MountPropagation_value = map[string]int32{ "PROPAGATION_PRIVATE": 0, "PROPAGATION_HOST_TO_CONTAINER": 1, "PROPAGATION_BIDIRECTIONAL": 2, } func (x MountPropagation) String() string { return proto.EnumName(MountPropagation_name, int32(x)) } func (MountPropagation) EnumDescriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } // A NamespaceMode describes the intended namespace configuration for each // of the namespaces (Network, PID, IPC) in NamespaceOption. Runtimes should // map these modes as appropriate for the technology underlying the runtime. type NamespaceMode int32 const ( // A POD namespace is common to all containers in a pod. // For example, a container with a PID namespace of POD expects to view // all of the processes in all of the containers in the pod. NamespaceMode_POD NamespaceMode = 0 // A CONTAINER namespace is restricted to a single container. // For example, a container with a PID namespace of CONTAINER expects to // view only the processes in that container. NamespaceMode_CONTAINER NamespaceMode = 1 // A NODE namespace is the namespace of the Kubernetes node. // For example, a container with a PID namespace of NODE expects to view // all of the processes on the host running the kubelet. NamespaceMode_NODE NamespaceMode = 2 ) var NamespaceMode_name = map[int32]string{ 0: "POD", 1: "CONTAINER", 2: "NODE", } var NamespaceMode_value = map[string]int32{ "POD": 0, "CONTAINER": 1, "NODE": 2, } func (x NamespaceMode) String() string { return proto.EnumName(NamespaceMode_name, int32(x)) } func (NamespaceMode) EnumDescriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } type PodSandboxState int32 const ( PodSandboxState_SANDBOX_READY PodSandboxState = 0 PodSandboxState_SANDBOX_NOTREADY PodSandboxState = 1 ) var PodSandboxState_name = map[int32]string{ 0: "SANDBOX_READY", 1: "SANDBOX_NOTREADY", } var PodSandboxState_value = map[string]int32{ "SANDBOX_READY": 0, "SANDBOX_NOTREADY": 1, } func (x PodSandboxState) String() string { return proto.EnumName(PodSandboxState_name, int32(x)) } func (PodSandboxState) EnumDescriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } type ContainerState int32 const ( ContainerState_CONTAINER_CREATED ContainerState = 0 ContainerState_CONTAINER_RUNNING ContainerState = 1 ContainerState_CONTAINER_EXITED ContainerState = 2 ContainerState_CONTAINER_UNKNOWN ContainerState = 3 ) var ContainerState_name = map[int32]string{ 0: "CONTAINER_CREATED", 1: "CONTAINER_RUNNING", 2: "CONTAINER_EXITED", 3: "CONTAINER_UNKNOWN", } var ContainerState_value = map[string]int32{ "CONTAINER_CREATED": 0, "CONTAINER_RUNNING": 1, "CONTAINER_EXITED": 2, "CONTAINER_UNKNOWN": 3, } func (x ContainerState) String() string { return proto.EnumName(ContainerState_name, int32(x)) } func (ContainerState) EnumDescriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{4} } type VersionRequest struct { // Version of the kubelet runtime API. Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *VersionRequest) Reset() { *m = VersionRequest{} } func (*VersionRequest) ProtoMessage() {} func (*VersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } func (m *VersionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *VersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_VersionRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *VersionRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_VersionRequest.Merge(m, src) } func (m *VersionRequest) XXX_Size() int { return m.Size() } func (m *VersionRequest) XXX_DiscardUnknown() { xxx_messageInfo_VersionRequest.DiscardUnknown(m) } var xxx_messageInfo_VersionRequest proto.InternalMessageInfo func (m *VersionRequest) GetVersion() string { if m != nil { return m.Version } return "" } type VersionResponse struct { // Version of the kubelet runtime API. Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // Name of the container runtime. RuntimeName string `protobuf:"bytes,2,opt,name=runtime_name,json=runtimeName,proto3" json:"runtime_name,omitempty"` // Version of the container runtime. The string must be // semver-compatible. RuntimeVersion string `protobuf:"bytes,3,opt,name=runtime_version,json=runtimeVersion,proto3" json:"runtime_version,omitempty"` // API version of the container runtime. The string must be // semver-compatible. RuntimeApiVersion string `protobuf:"bytes,4,opt,name=runtime_api_version,json=runtimeApiVersion,proto3" json:"runtime_api_version,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *VersionResponse) Reset() { *m = VersionResponse{} } func (*VersionResponse) ProtoMessage() {} func (*VersionResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } func (m *VersionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *VersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_VersionResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *VersionResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_VersionResponse.Merge(m, src) } func (m *VersionResponse) XXX_Size() int { return m.Size() } func (m *VersionResponse) XXX_DiscardUnknown() { xxx_messageInfo_VersionResponse.DiscardUnknown(m) } var xxx_messageInfo_VersionResponse proto.InternalMessageInfo func (m *VersionResponse) GetVersion() string { if m != nil { return m.Version } return "" } func (m *VersionResponse) GetRuntimeName() string { if m != nil { return m.RuntimeName } return "" } func (m *VersionResponse) GetRuntimeVersion() string { if m != nil { return m.RuntimeVersion } return "" } func (m *VersionResponse) GetRuntimeApiVersion() string { if m != nil { return m.RuntimeApiVersion } return "" } // DNSConfig specifies the DNS servers and search domains of a sandbox. type DNSConfig struct { // List of DNS servers of the cluster. Servers []string `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"` // List of DNS search domains of the cluster. Searches []string `protobuf:"bytes,2,rep,name=searches,proto3" json:"searches,omitempty"` // List of DNS options. See https://linux.die.net/man/5/resolv.conf // for all available options. Options []string `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DNSConfig) Reset() { *m = DNSConfig{} } func (*DNSConfig) ProtoMessage() {} func (*DNSConfig) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *DNSConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *DNSConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DNSConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *DNSConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_DNSConfig.Merge(m, src) } func (m *DNSConfig) XXX_Size() int { return m.Size() } func (m *DNSConfig) XXX_DiscardUnknown() { xxx_messageInfo_DNSConfig.DiscardUnknown(m) } var xxx_messageInfo_DNSConfig proto.InternalMessageInfo func (m *DNSConfig) GetServers() []string { if m != nil { return m.Servers } return nil } func (m *DNSConfig) GetSearches() []string { if m != nil { return m.Searches } return nil } func (m *DNSConfig) GetOptions() []string { if m != nil { return m.Options } return nil } // PortMapping specifies the port mapping configurations of a sandbox. type PortMapping struct { // Protocol of the port mapping. Protocol Protocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=runtime.v1alpha2.Protocol" json:"protocol,omitempty"` // Port number within the container. Default: 0 (not specified). ContainerPort int32 `protobuf:"varint,2,opt,name=container_port,json=containerPort,proto3" json:"container_port,omitempty"` // Port number on the host. Default: 0 (not specified). HostPort int32 `protobuf:"varint,3,opt,name=host_port,json=hostPort,proto3" json:"host_port,omitempty"` // Host IP. HostIp string `protobuf:"bytes,4,opt,name=host_ip,json=hostIp,proto3" json:"host_ip,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PortMapping) Reset() { *m = PortMapping{} } func (*PortMapping) ProtoMessage() {} func (*PortMapping) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *PortMapping) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PortMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PortMapping.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PortMapping) XXX_Merge(src proto.Message) { xxx_messageInfo_PortMapping.Merge(m, src) } func (m *PortMapping) XXX_Size() int { return m.Size() } func (m *PortMapping) XXX_DiscardUnknown() { xxx_messageInfo_PortMapping.DiscardUnknown(m) } var xxx_messageInfo_PortMapping proto.InternalMessageInfo func (m *PortMapping) GetProtocol() Protocol { if m != nil { return m.Protocol } return Protocol_TCP } func (m *PortMapping) GetContainerPort() int32 { if m != nil { return m.ContainerPort } return 0 } func (m *PortMapping) GetHostPort() int32 { if m != nil { return m.HostPort } return 0 } func (m *PortMapping) GetHostIp() string { if m != nil { return m.HostIp } return "" } // Mount specifies a host volume to mount into a container. type Mount struct { // Path of the mount within the container. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"` // Path of the mount on the host. If the hostPath doesn't exist, then runtimes // should report error. If the hostpath is a symbolic link, runtimes should // follow the symlink and mount the real destination to container. HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` // If set, the mount is read-only. Readonly bool `protobuf:"varint,3,opt,name=readonly,proto3" json:"readonly,omitempty"` // If set, the mount needs SELinux relabeling. SelinuxRelabel bool `protobuf:"varint,4,opt,name=selinux_relabel,json=selinuxRelabel,proto3" json:"selinux_relabel,omitempty"` // Requested propagation mode. Propagation MountPropagation `protobuf:"varint,5,opt,name=propagation,proto3,enum=runtime.v1alpha2.MountPropagation" json:"propagation,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Mount) Reset() { *m = Mount{} } func (*Mount) ProtoMessage() {} func (*Mount) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{4} } func (m *Mount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Mount.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Mount) XXX_Merge(src proto.Message) { xxx_messageInfo_Mount.Merge(m, src) } func (m *Mount) XXX_Size() int { return m.Size() } func (m *Mount) XXX_DiscardUnknown() { xxx_messageInfo_Mount.DiscardUnknown(m) } var xxx_messageInfo_Mount proto.InternalMessageInfo func (m *Mount) GetContainerPath() string { if m != nil { return m.ContainerPath } return "" } func (m *Mount) GetHostPath() string { if m != nil { return m.HostPath } return "" } func (m *Mount) GetReadonly() bool { if m != nil { return m.Readonly } return false } func (m *Mount) GetSelinuxRelabel() bool { if m != nil { return m.SelinuxRelabel } return false } func (m *Mount) GetPropagation() MountPropagation { if m != nil { return m.Propagation } return MountPropagation_PROPAGATION_PRIVATE } // NamespaceOption provides options for Linux namespaces. type NamespaceOption struct { // Network namespace for this container/sandbox. // Note: There is currently no way to set CONTAINER scoped network in the Kubernetes API. // Namespaces currently set by the kubelet: POD, NODE Network NamespaceMode `protobuf:"varint,1,opt,name=network,proto3,enum=runtime.v1alpha2.NamespaceMode" json:"network,omitempty"` // PID namespace for this container/sandbox. // Note: The CRI default is POD, but the v1.PodSpec default is CONTAINER. // The kubelet's runtime manager will set this to CONTAINER explicitly for v1 pods. // Namespaces currently set by the kubelet: POD, CONTAINER, NODE Pid NamespaceMode `protobuf:"varint,2,opt,name=pid,proto3,enum=runtime.v1alpha2.NamespaceMode" json:"pid,omitempty"` // IPC namespace for this container/sandbox. // Note: There is currently no way to set CONTAINER scoped IPC in the Kubernetes API. // Namespaces currently set by the kubelet: POD, NODE Ipc NamespaceMode `protobuf:"varint,3,opt,name=ipc,proto3,enum=runtime.v1alpha2.NamespaceMode" json:"ipc,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NamespaceOption) Reset() { *m = NamespaceOption{} } func (*NamespaceOption) ProtoMessage() {} func (*NamespaceOption) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{5} } func (m *NamespaceOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NamespaceOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NamespaceOption.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NamespaceOption) XXX_Merge(src proto.Message) { xxx_messageInfo_NamespaceOption.Merge(m, src) } func (m *NamespaceOption) XXX_Size() int { return m.Size() } func (m *NamespaceOption) XXX_DiscardUnknown() { xxx_messageInfo_NamespaceOption.DiscardUnknown(m) } var xxx_messageInfo_NamespaceOption proto.InternalMessageInfo func (m *NamespaceOption) GetNetwork() NamespaceMode { if m != nil { return m.Network } return NamespaceMode_POD } func (m *NamespaceOption) GetPid() NamespaceMode { if m != nil { return m.Pid } return NamespaceMode_POD } func (m *NamespaceOption) GetIpc() NamespaceMode { if m != nil { return m.Ipc } return NamespaceMode_POD } // Int64Value is the wrapper of int64. type Int64Value struct { // The value. Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Int64Value) Reset() { *m = Int64Value{} } func (*Int64Value) ProtoMessage() {} func (*Int64Value) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{6} } func (m *Int64Value) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Int64Value) XXX_Merge(src proto.Message) { xxx_messageInfo_Int64Value.Merge(m, src) } func (m *Int64Value) XXX_Size() int { return m.Size() } func (m *Int64Value) XXX_DiscardUnknown() { xxx_messageInfo_Int64Value.DiscardUnknown(m) } var xxx_messageInfo_Int64Value proto.InternalMessageInfo func (m *Int64Value) GetValue() int64 { if m != nil { return m.Value } return 0 } // LinuxSandboxSecurityContext holds linux security configuration that will be // applied to a sandbox. Note that: // 1) It does not apply to containers in the pods. // 2) It may not be applicable to a PodSandbox which does not contain any running // process. type LinuxSandboxSecurityContext struct { // Configurations for the sandbox's namespaces. // This will be used only if the PodSandbox uses namespace for isolation. NamespaceOptions *NamespaceOption `protobuf:"bytes,1,opt,name=namespace_options,json=namespaceOptions,proto3" json:"namespace_options,omitempty"` // Optional SELinux context to be applied. SelinuxOptions *SELinuxOption `protobuf:"bytes,2,opt,name=selinux_options,json=selinuxOptions,proto3" json:"selinux_options,omitempty"` // UID to run sandbox processes as, when applicable. RunAsUser *Int64Value `protobuf:"bytes,3,opt,name=run_as_user,json=runAsUser,proto3" json:"run_as_user,omitempty"` // GID to run sandbox processes as, when applicable. run_as_group should only // be specified when run_as_user is specified; otherwise, the runtime MUST error. RunAsGroup *Int64Value `protobuf:"bytes,8,opt,name=run_as_group,json=runAsGroup,proto3" json:"run_as_group,omitempty"` // If set, the root filesystem of the sandbox is read-only. ReadonlyRootfs bool `protobuf:"varint,4,opt,name=readonly_rootfs,json=readonlyRootfs,proto3" json:"readonly_rootfs,omitempty"` // List of groups applied to the first process run in the sandbox, in // addition to the sandbox's primary GID. SupplementalGroups []int64 `protobuf:"varint,5,rep,packed,name=supplemental_groups,json=supplementalGroups,proto3" json:"supplemental_groups,omitempty"` // Indicates whether the sandbox will be asked to run a privileged // container. If a privileged container is to be executed within it, this // MUST be true. // This allows a sandbox to take additional security precautions if no // privileged containers are expected to be run. Privileged bool `protobuf:"varint,6,opt,name=privileged,proto3" json:"privileged,omitempty"` // Seccomp profile for the sandbox, candidate values are: // * runtime/default: the default profile for the container runtime // * unconfined: unconfined profile, ie, no seccomp sandboxing // * localhost/: the profile installed on the node. // is the full path of the profile. // Default: "", which is identical with unconfined. SeccompProfilePath string `protobuf:"bytes,7,opt,name=seccomp_profile_path,json=seccompProfilePath,proto3" json:"seccomp_profile_path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LinuxSandboxSecurityContext) Reset() { *m = LinuxSandboxSecurityContext{} } func (*LinuxSandboxSecurityContext) ProtoMessage() {} func (*LinuxSandboxSecurityContext) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{7} } func (m *LinuxSandboxSecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *LinuxSandboxSecurityContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_LinuxSandboxSecurityContext.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *LinuxSandboxSecurityContext) XXX_Merge(src proto.Message) { xxx_messageInfo_LinuxSandboxSecurityContext.Merge(m, src) } func (m *LinuxSandboxSecurityContext) XXX_Size() int { return m.Size() } func (m *LinuxSandboxSecurityContext) XXX_DiscardUnknown() { xxx_messageInfo_LinuxSandboxSecurityContext.DiscardUnknown(m) } var xxx_messageInfo_LinuxSandboxSecurityContext proto.InternalMessageInfo func (m *LinuxSandboxSecurityContext) GetNamespaceOptions() *NamespaceOption { if m != nil { return m.NamespaceOptions } return nil } func (m *LinuxSandboxSecurityContext) GetSelinuxOptions() *SELinuxOption { if m != nil { return m.SelinuxOptions } return nil } func (m *LinuxSandboxSecurityContext) GetRunAsUser() *Int64Value { if m != nil { return m.RunAsUser } return nil } func (m *LinuxSandboxSecurityContext) GetRunAsGroup() *Int64Value { if m != nil { return m.RunAsGroup } return nil } func (m *LinuxSandboxSecurityContext) GetReadonlyRootfs() bool { if m != nil { return m.ReadonlyRootfs } return false } func (m *LinuxSandboxSecurityContext) GetSupplementalGroups() []int64 { if m != nil { return m.SupplementalGroups } return nil } func (m *LinuxSandboxSecurityContext) GetPrivileged() bool { if m != nil { return m.Privileged } return false } func (m *LinuxSandboxSecurityContext) GetSeccompProfilePath() string { if m != nil { return m.SeccompProfilePath } return "" } // LinuxPodSandboxConfig holds platform-specific configurations for Linux // host platforms and Linux-based containers. type LinuxPodSandboxConfig struct { // Parent cgroup of the PodSandbox. // The cgroupfs style syntax will be used, but the container runtime can // convert it to systemd semantics if needed. CgroupParent string `protobuf:"bytes,1,opt,name=cgroup_parent,json=cgroupParent,proto3" json:"cgroup_parent,omitempty"` // LinuxSandboxSecurityContext holds sandbox security attributes. SecurityContext *LinuxSandboxSecurityContext `protobuf:"bytes,2,opt,name=security_context,json=securityContext,proto3" json:"security_context,omitempty"` // Sysctls holds linux sysctls config for the sandbox. Sysctls map[string]string `protobuf:"bytes,3,rep,name=sysctls,proto3" json:"sysctls,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LinuxPodSandboxConfig) Reset() { *m = LinuxPodSandboxConfig{} } func (*LinuxPodSandboxConfig) ProtoMessage() {} func (*LinuxPodSandboxConfig) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{8} } func (m *LinuxPodSandboxConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *LinuxPodSandboxConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_LinuxPodSandboxConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *LinuxPodSandboxConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_LinuxPodSandboxConfig.Merge(m, src) } func (m *LinuxPodSandboxConfig) XXX_Size() int { return m.Size() } func (m *LinuxPodSandboxConfig) XXX_DiscardUnknown() { xxx_messageInfo_LinuxPodSandboxConfig.DiscardUnknown(m) } var xxx_messageInfo_LinuxPodSandboxConfig proto.InternalMessageInfo func (m *LinuxPodSandboxConfig) GetCgroupParent() string { if m != nil { return m.CgroupParent } return "" } func (m *LinuxPodSandboxConfig) GetSecurityContext() *LinuxSandboxSecurityContext { if m != nil { return m.SecurityContext } return nil } func (m *LinuxPodSandboxConfig) GetSysctls() map[string]string { if m != nil { return m.Sysctls } return nil } // PodSandboxMetadata holds all necessary information for building the sandbox name. // The container runtime is encouraged to expose the metadata associated with the // PodSandbox in its user interface for better user experience. For example, // the runtime can construct a unique PodSandboxName based on the metadata. type PodSandboxMetadata struct { // Pod name of the sandbox. Same as the pod name in the PodSpec. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Pod UID of the sandbox. Same as the pod UID in the PodSpec. Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // Pod namespace of the sandbox. Same as the pod namespace in the PodSpec. Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` // Attempt number of creating the sandbox. Default: 0. Attempt uint32 `protobuf:"varint,4,opt,name=attempt,proto3" json:"attempt,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodSandboxMetadata) Reset() { *m = PodSandboxMetadata{} } func (*PodSandboxMetadata) ProtoMessage() {} func (*PodSandboxMetadata) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{9} } func (m *PodSandboxMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodSandboxMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodSandboxMetadata.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodSandboxMetadata) XXX_Merge(src proto.Message) { xxx_messageInfo_PodSandboxMetadata.Merge(m, src) } func (m *PodSandboxMetadata) XXX_Size() int { return m.Size() } func (m *PodSandboxMetadata) XXX_DiscardUnknown() { xxx_messageInfo_PodSandboxMetadata.DiscardUnknown(m) } var xxx_messageInfo_PodSandboxMetadata proto.InternalMessageInfo func (m *PodSandboxMetadata) GetName() string { if m != nil { return m.Name } return "" } func (m *PodSandboxMetadata) GetUid() string { if m != nil { return m.Uid } return "" } func (m *PodSandboxMetadata) GetNamespace() string { if m != nil { return m.Namespace } return "" } func (m *PodSandboxMetadata) GetAttempt() uint32 { if m != nil { return m.Attempt } return 0 } // PodSandboxConfig holds all the required and optional fields for creating a // sandbox. type PodSandboxConfig struct { // Metadata of the sandbox. This information will uniquely identify the // sandbox, and the runtime should leverage this to ensure correct // operation. The runtime may also use this information to improve UX, such // as by constructing a readable name. Metadata *PodSandboxMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // Hostname of the sandbox. Hostname could only be empty when the pod // network namespace is NODE. Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"` // Path to the directory on the host in which container log files are // stored. // By default the log of a container going into the LogDirectory will be // hooked up to STDOUT and STDERR. However, the LogDirectory may contain // binary log files with structured logging data from the individual // containers. For example, the files might be newline separated JSON // structured logs, systemd-journald journal files, gRPC trace files, etc. // E.g., // PodSandboxConfig.LogDirectory = `/var/log/pods//` // ContainerConfig.LogPath = `containerName/Instance#.log` // // WARNING: Log management and how kubelet should interface with the // container logs are under active discussion in // https://issues.k8s.io/24677. There *may* be future change of direction // for logging as the discussion carries on. LogDirectory string `protobuf:"bytes,3,opt,name=log_directory,json=logDirectory,proto3" json:"log_directory,omitempty"` // DNS config for the sandbox. DnsConfig *DNSConfig `protobuf:"bytes,4,opt,name=dns_config,json=dnsConfig,proto3" json:"dns_config,omitempty"` // Port mappings for the sandbox. PortMappings []*PortMapping `protobuf:"bytes,5,rep,name=port_mappings,json=portMappings,proto3" json:"port_mappings,omitempty"` // Key-value pairs that may be used to scope and select individual resources. Labels map[string]string `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map that may be set by the kubelet to store and // retrieve arbitrary metadata. This will include any annotations set on a // pod through the Kubernetes API. // // Annotations MUST NOT be altered by the runtime; the annotations stored // here MUST be returned in the PodSandboxStatus associated with the pod // this PodSandboxConfig creates. // // In general, in order to preserve a well-defined interface between the // kubelet and the container runtime, annotations SHOULD NOT influence // runtime behaviour. // // Annotations can also be useful for runtime authors to experiment with // new features that are opaque to the Kubernetes APIs (both user-facing // and the CRI). Whenever possible, however, runtime authors SHOULD // consider proposing new typed fields for any new features instead. Annotations map[string]string `protobuf:"bytes,7,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Optional configurations specific to Linux hosts. Linux *LinuxPodSandboxConfig `protobuf:"bytes,8,opt,name=linux,proto3" json:"linux,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodSandboxConfig) Reset() { *m = PodSandboxConfig{} } func (*PodSandboxConfig) ProtoMessage() {} func (*PodSandboxConfig) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{10} } func (m *PodSandboxConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodSandboxConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodSandboxConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodSandboxConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_PodSandboxConfig.Merge(m, src) } func (m *PodSandboxConfig) XXX_Size() int { return m.Size() } func (m *PodSandboxConfig) XXX_DiscardUnknown() { xxx_messageInfo_PodSandboxConfig.DiscardUnknown(m) } var xxx_messageInfo_PodSandboxConfig proto.InternalMessageInfo func (m *PodSandboxConfig) GetMetadata() *PodSandboxMetadata { if m != nil { return m.Metadata } return nil } func (m *PodSandboxConfig) GetHostname() string { if m != nil { return m.Hostname } return "" } func (m *PodSandboxConfig) GetLogDirectory() string { if m != nil { return m.LogDirectory } return "" } func (m *PodSandboxConfig) GetDnsConfig() *DNSConfig { if m != nil { return m.DnsConfig } return nil } func (m *PodSandboxConfig) GetPortMappings() []*PortMapping { if m != nil { return m.PortMappings } return nil } func (m *PodSandboxConfig) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *PodSandboxConfig) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } func (m *PodSandboxConfig) GetLinux() *LinuxPodSandboxConfig { if m != nil { return m.Linux } return nil } type RunPodSandboxRequest struct { // Configuration for creating a PodSandbox. Config *PodSandboxConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` // Named runtime configuration to use for this PodSandbox. // If the runtime handler is unknown, this request should be rejected. An // empty string should select the default handler, equivalent to the // behavior before this feature was added. // See https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md RuntimeHandler string `protobuf:"bytes,2,opt,name=runtime_handler,json=runtimeHandler,proto3" json:"runtime_handler,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RunPodSandboxRequest) Reset() { *m = RunPodSandboxRequest{} } func (*RunPodSandboxRequest) ProtoMessage() {} func (*RunPodSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{11} } func (m *RunPodSandboxRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RunPodSandboxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RunPodSandboxRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RunPodSandboxRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_RunPodSandboxRequest.Merge(m, src) } func (m *RunPodSandboxRequest) XXX_Size() int { return m.Size() } func (m *RunPodSandboxRequest) XXX_DiscardUnknown() { xxx_messageInfo_RunPodSandboxRequest.DiscardUnknown(m) } var xxx_messageInfo_RunPodSandboxRequest proto.InternalMessageInfo func (m *RunPodSandboxRequest) GetConfig() *PodSandboxConfig { if m != nil { return m.Config } return nil } func (m *RunPodSandboxRequest) GetRuntimeHandler() string { if m != nil { return m.RuntimeHandler } return "" } type RunPodSandboxResponse struct { // ID of the PodSandbox to run. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RunPodSandboxResponse) Reset() { *m = RunPodSandboxResponse{} } func (*RunPodSandboxResponse) ProtoMessage() {} func (*RunPodSandboxResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{12} } func (m *RunPodSandboxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RunPodSandboxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RunPodSandboxResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RunPodSandboxResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_RunPodSandboxResponse.Merge(m, src) } func (m *RunPodSandboxResponse) XXX_Size() int { return m.Size() } func (m *RunPodSandboxResponse) XXX_DiscardUnknown() { xxx_messageInfo_RunPodSandboxResponse.DiscardUnknown(m) } var xxx_messageInfo_RunPodSandboxResponse proto.InternalMessageInfo func (m *RunPodSandboxResponse) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } type StopPodSandboxRequest struct { // ID of the PodSandbox to stop. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *StopPodSandboxRequest) Reset() { *m = StopPodSandboxRequest{} } func (*StopPodSandboxRequest) ProtoMessage() {} func (*StopPodSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{13} } func (m *StopPodSandboxRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *StopPodSandboxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_StopPodSandboxRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *StopPodSandboxRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_StopPodSandboxRequest.Merge(m, src) } func (m *StopPodSandboxRequest) XXX_Size() int { return m.Size() } func (m *StopPodSandboxRequest) XXX_DiscardUnknown() { xxx_messageInfo_StopPodSandboxRequest.DiscardUnknown(m) } var xxx_messageInfo_StopPodSandboxRequest proto.InternalMessageInfo func (m *StopPodSandboxRequest) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } type StopPodSandboxResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *StopPodSandboxResponse) Reset() { *m = StopPodSandboxResponse{} } func (*StopPodSandboxResponse) ProtoMessage() {} func (*StopPodSandboxResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{14} } func (m *StopPodSandboxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *StopPodSandboxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_StopPodSandboxResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *StopPodSandboxResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_StopPodSandboxResponse.Merge(m, src) } func (m *StopPodSandboxResponse) XXX_Size() int { return m.Size() } func (m *StopPodSandboxResponse) XXX_DiscardUnknown() { xxx_messageInfo_StopPodSandboxResponse.DiscardUnknown(m) } var xxx_messageInfo_StopPodSandboxResponse proto.InternalMessageInfo type RemovePodSandboxRequest struct { // ID of the PodSandbox to remove. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RemovePodSandboxRequest) Reset() { *m = RemovePodSandboxRequest{} } func (*RemovePodSandboxRequest) ProtoMessage() {} func (*RemovePodSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{15} } func (m *RemovePodSandboxRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RemovePodSandboxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RemovePodSandboxRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RemovePodSandboxRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_RemovePodSandboxRequest.Merge(m, src) } func (m *RemovePodSandboxRequest) XXX_Size() int { return m.Size() } func (m *RemovePodSandboxRequest) XXX_DiscardUnknown() { xxx_messageInfo_RemovePodSandboxRequest.DiscardUnknown(m) } var xxx_messageInfo_RemovePodSandboxRequest proto.InternalMessageInfo func (m *RemovePodSandboxRequest) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } type RemovePodSandboxResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RemovePodSandboxResponse) Reset() { *m = RemovePodSandboxResponse{} } func (*RemovePodSandboxResponse) ProtoMessage() {} func (*RemovePodSandboxResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{16} } func (m *RemovePodSandboxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RemovePodSandboxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RemovePodSandboxResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RemovePodSandboxResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_RemovePodSandboxResponse.Merge(m, src) } func (m *RemovePodSandboxResponse) XXX_Size() int { return m.Size() } func (m *RemovePodSandboxResponse) XXX_DiscardUnknown() { xxx_messageInfo_RemovePodSandboxResponse.DiscardUnknown(m) } var xxx_messageInfo_RemovePodSandboxResponse proto.InternalMessageInfo type PodSandboxStatusRequest struct { // ID of the PodSandbox for which to retrieve status. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // Verbose indicates whether to return extra information about the pod sandbox. Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodSandboxStatusRequest) Reset() { *m = PodSandboxStatusRequest{} } func (*PodSandboxStatusRequest) ProtoMessage() {} func (*PodSandboxStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{17} } func (m *PodSandboxStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodSandboxStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodSandboxStatusRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodSandboxStatusRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_PodSandboxStatusRequest.Merge(m, src) } func (m *PodSandboxStatusRequest) XXX_Size() int { return m.Size() } func (m *PodSandboxStatusRequest) XXX_DiscardUnknown() { xxx_messageInfo_PodSandboxStatusRequest.DiscardUnknown(m) } var xxx_messageInfo_PodSandboxStatusRequest proto.InternalMessageInfo func (m *PodSandboxStatusRequest) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *PodSandboxStatusRequest) GetVerbose() bool { if m != nil { return m.Verbose } return false } // PodIP represents an ip of a Pod type PodIP struct { // an ip is a string representation of an IPv4 or an IPv6 Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodIP) Reset() { *m = PodIP{} } func (*PodIP) ProtoMessage() {} func (*PodIP) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{18} } func (m *PodIP) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodIP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodIP.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodIP) XXX_Merge(src proto.Message) { xxx_messageInfo_PodIP.Merge(m, src) } func (m *PodIP) XXX_Size() int { return m.Size() } func (m *PodIP) XXX_DiscardUnknown() { xxx_messageInfo_PodIP.DiscardUnknown(m) } var xxx_messageInfo_PodIP proto.InternalMessageInfo func (m *PodIP) GetIp() string { if m != nil { return m.Ip } return "" } // PodSandboxNetworkStatus is the status of the network for a PodSandbox. type PodSandboxNetworkStatus struct { // IP address of the PodSandbox. Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` // list of additional ips (not inclusive of PodSandboxNetworkStatus.Ip) of the PodSandBoxNetworkStatus AdditionalIps []*PodIP `protobuf:"bytes,2,rep,name=additional_ips,json=additionalIps,proto3" json:"additional_ips,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodSandboxNetworkStatus) Reset() { *m = PodSandboxNetworkStatus{} } func (*PodSandboxNetworkStatus) ProtoMessage() {} func (*PodSandboxNetworkStatus) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{19} } func (m *PodSandboxNetworkStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodSandboxNetworkStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodSandboxNetworkStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodSandboxNetworkStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_PodSandboxNetworkStatus.Merge(m, src) } func (m *PodSandboxNetworkStatus) XXX_Size() int { return m.Size() } func (m *PodSandboxNetworkStatus) XXX_DiscardUnknown() { xxx_messageInfo_PodSandboxNetworkStatus.DiscardUnknown(m) } var xxx_messageInfo_PodSandboxNetworkStatus proto.InternalMessageInfo func (m *PodSandboxNetworkStatus) GetIp() string { if m != nil { return m.Ip } return "" } func (m *PodSandboxNetworkStatus) GetAdditionalIps() []*PodIP { if m != nil { return m.AdditionalIps } return nil } // Namespace contains paths to the namespaces. type Namespace struct { // Namespace options for Linux namespaces. Options *NamespaceOption `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Namespace) Reset() { *m = Namespace{} } func (*Namespace) ProtoMessage() {} func (*Namespace) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{20} } func (m *Namespace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Namespace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Namespace.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Namespace) XXX_Merge(src proto.Message) { xxx_messageInfo_Namespace.Merge(m, src) } func (m *Namespace) XXX_Size() int { return m.Size() } func (m *Namespace) XXX_DiscardUnknown() { xxx_messageInfo_Namespace.DiscardUnknown(m) } var xxx_messageInfo_Namespace proto.InternalMessageInfo func (m *Namespace) GetOptions() *NamespaceOption { if m != nil { return m.Options } return nil } // LinuxSandboxStatus contains status specific to Linux sandboxes. type LinuxPodSandboxStatus struct { // Paths to the sandbox's namespaces. Namespaces *Namespace `protobuf:"bytes,1,opt,name=namespaces,proto3" json:"namespaces,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LinuxPodSandboxStatus) Reset() { *m = LinuxPodSandboxStatus{} } func (*LinuxPodSandboxStatus) ProtoMessage() {} func (*LinuxPodSandboxStatus) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{21} } func (m *LinuxPodSandboxStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *LinuxPodSandboxStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_LinuxPodSandboxStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *LinuxPodSandboxStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_LinuxPodSandboxStatus.Merge(m, src) } func (m *LinuxPodSandboxStatus) XXX_Size() int { return m.Size() } func (m *LinuxPodSandboxStatus) XXX_DiscardUnknown() { xxx_messageInfo_LinuxPodSandboxStatus.DiscardUnknown(m) } var xxx_messageInfo_LinuxPodSandboxStatus proto.InternalMessageInfo func (m *LinuxPodSandboxStatus) GetNamespaces() *Namespace { if m != nil { return m.Namespaces } return nil } // PodSandboxStatus contains the status of the PodSandbox. type PodSandboxStatus struct { // ID of the sandbox. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Metadata of the sandbox. Metadata *PodSandboxMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` // State of the sandbox. State PodSandboxState `protobuf:"varint,3,opt,name=state,proto3,enum=runtime.v1alpha2.PodSandboxState" json:"state,omitempty"` // Creation timestamp of the sandbox in nanoseconds. Must be > 0. CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Network contains network status if network is handled by the runtime. Network *PodSandboxNetworkStatus `protobuf:"bytes,5,opt,name=network,proto3" json:"network,omitempty"` // Linux-specific status to a pod sandbox. Linux *LinuxPodSandboxStatus `protobuf:"bytes,6,opt,name=linux,proto3" json:"linux,omitempty"` // Labels are key-value pairs that may be used to scope and select individual resources. Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map holding arbitrary metadata. // Annotations MUST NOT be altered by the runtime; the value of this field // MUST be identical to that of the corresponding PodSandboxConfig used to // instantiate the pod sandbox this status represents. Annotations map[string]string `protobuf:"bytes,8,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // runtime configuration used for this PodSandbox. RuntimeHandler string `protobuf:"bytes,9,opt,name=runtime_handler,json=runtimeHandler,proto3" json:"runtime_handler,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodSandboxStatus) Reset() { *m = PodSandboxStatus{} } func (*PodSandboxStatus) ProtoMessage() {} func (*PodSandboxStatus) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{22} } func (m *PodSandboxStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodSandboxStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodSandboxStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodSandboxStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_PodSandboxStatus.Merge(m, src) } func (m *PodSandboxStatus) XXX_Size() int { return m.Size() } func (m *PodSandboxStatus) XXX_DiscardUnknown() { xxx_messageInfo_PodSandboxStatus.DiscardUnknown(m) } var xxx_messageInfo_PodSandboxStatus proto.InternalMessageInfo func (m *PodSandboxStatus) GetId() string { if m != nil { return m.Id } return "" } func (m *PodSandboxStatus) GetMetadata() *PodSandboxMetadata { if m != nil { return m.Metadata } return nil } func (m *PodSandboxStatus) GetState() PodSandboxState { if m != nil { return m.State } return PodSandboxState_SANDBOX_READY } func (m *PodSandboxStatus) GetCreatedAt() int64 { if m != nil { return m.CreatedAt } return 0 } func (m *PodSandboxStatus) GetNetwork() *PodSandboxNetworkStatus { if m != nil { return m.Network } return nil } func (m *PodSandboxStatus) GetLinux() *LinuxPodSandboxStatus { if m != nil { return m.Linux } return nil } func (m *PodSandboxStatus) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *PodSandboxStatus) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } func (m *PodSandboxStatus) GetRuntimeHandler() string { if m != nil { return m.RuntimeHandler } return "" } type PodSandboxStatusResponse struct { // Status of the PodSandbox. Status *PodSandboxStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` // Info is extra information of the PodSandbox. The key could be arbitrary string, and // value should be in json format. The information could include anything useful for // debug, e.g. network namespace for linux container based container runtime. // It should only be returned non-empty when Verbose is true. Info map[string]string `protobuf:"bytes,2,rep,name=info,proto3" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodSandboxStatusResponse) Reset() { *m = PodSandboxStatusResponse{} } func (*PodSandboxStatusResponse) ProtoMessage() {} func (*PodSandboxStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{23} } func (m *PodSandboxStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodSandboxStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodSandboxStatusResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodSandboxStatusResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_PodSandboxStatusResponse.Merge(m, src) } func (m *PodSandboxStatusResponse) XXX_Size() int { return m.Size() } func (m *PodSandboxStatusResponse) XXX_DiscardUnknown() { xxx_messageInfo_PodSandboxStatusResponse.DiscardUnknown(m) } var xxx_messageInfo_PodSandboxStatusResponse proto.InternalMessageInfo func (m *PodSandboxStatusResponse) GetStatus() *PodSandboxStatus { if m != nil { return m.Status } return nil } func (m *PodSandboxStatusResponse) GetInfo() map[string]string { if m != nil { return m.Info } return nil } // PodSandboxStateValue is the wrapper of PodSandboxState. type PodSandboxStateValue struct { // State of the sandbox. State PodSandboxState `protobuf:"varint,1,opt,name=state,proto3,enum=runtime.v1alpha2.PodSandboxState" json:"state,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodSandboxStateValue) Reset() { *m = PodSandboxStateValue{} } func (*PodSandboxStateValue) ProtoMessage() {} func (*PodSandboxStateValue) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{24} } func (m *PodSandboxStateValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodSandboxStateValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodSandboxStateValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodSandboxStateValue) XXX_Merge(src proto.Message) { xxx_messageInfo_PodSandboxStateValue.Merge(m, src) } func (m *PodSandboxStateValue) XXX_Size() int { return m.Size() } func (m *PodSandboxStateValue) XXX_DiscardUnknown() { xxx_messageInfo_PodSandboxStateValue.DiscardUnknown(m) } var xxx_messageInfo_PodSandboxStateValue proto.InternalMessageInfo func (m *PodSandboxStateValue) GetState() PodSandboxState { if m != nil { return m.State } return PodSandboxState_SANDBOX_READY } // PodSandboxFilter is used to filter a list of PodSandboxes. // All those fields are combined with 'AND' type PodSandboxFilter struct { // ID of the sandbox. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // State of the sandbox. State *PodSandboxStateValue `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` // LabelSelector to select matches. // Only api.MatchLabels is supported for now and the requirements // are ANDed. MatchExpressions is not supported yet. LabelSelector map[string]string `protobuf:"bytes,3,rep,name=label_selector,json=labelSelector,proto3" json:"label_selector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodSandboxFilter) Reset() { *m = PodSandboxFilter{} } func (*PodSandboxFilter) ProtoMessage() {} func (*PodSandboxFilter) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{25} } func (m *PodSandboxFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodSandboxFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodSandboxFilter.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodSandboxFilter) XXX_Merge(src proto.Message) { xxx_messageInfo_PodSandboxFilter.Merge(m, src) } func (m *PodSandboxFilter) XXX_Size() int { return m.Size() } func (m *PodSandboxFilter) XXX_DiscardUnknown() { xxx_messageInfo_PodSandboxFilter.DiscardUnknown(m) } var xxx_messageInfo_PodSandboxFilter proto.InternalMessageInfo func (m *PodSandboxFilter) GetId() string { if m != nil { return m.Id } return "" } func (m *PodSandboxFilter) GetState() *PodSandboxStateValue { if m != nil { return m.State } return nil } func (m *PodSandboxFilter) GetLabelSelector() map[string]string { if m != nil { return m.LabelSelector } return nil } type ListPodSandboxRequest struct { // PodSandboxFilter to filter a list of PodSandboxes. Filter *PodSandboxFilter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListPodSandboxRequest) Reset() { *m = ListPodSandboxRequest{} } func (*ListPodSandboxRequest) ProtoMessage() {} func (*ListPodSandboxRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{26} } func (m *ListPodSandboxRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListPodSandboxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListPodSandboxRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListPodSandboxRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListPodSandboxRequest.Merge(m, src) } func (m *ListPodSandboxRequest) XXX_Size() int { return m.Size() } func (m *ListPodSandboxRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListPodSandboxRequest.DiscardUnknown(m) } var xxx_messageInfo_ListPodSandboxRequest proto.InternalMessageInfo func (m *ListPodSandboxRequest) GetFilter() *PodSandboxFilter { if m != nil { return m.Filter } return nil } // PodSandbox contains minimal information about a sandbox. type PodSandbox struct { // ID of the PodSandbox. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Metadata of the PodSandbox. Metadata *PodSandboxMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` // State of the PodSandbox. State PodSandboxState `protobuf:"varint,3,opt,name=state,proto3,enum=runtime.v1alpha2.PodSandboxState" json:"state,omitempty"` // Creation timestamps of the PodSandbox in nanoseconds. Must be > 0. CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Labels of the PodSandbox. Labels map[string]string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map holding arbitrary metadata. // Annotations MUST NOT be altered by the runtime; the value of this field // MUST be identical to that of the corresponding PodSandboxConfig used to // instantiate this PodSandbox. Annotations map[string]string `protobuf:"bytes,6,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // runtime configuration used for this PodSandbox. RuntimeHandler string `protobuf:"bytes,7,opt,name=runtime_handler,json=runtimeHandler,proto3" json:"runtime_handler,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodSandbox) Reset() { *m = PodSandbox{} } func (*PodSandbox) ProtoMessage() {} func (*PodSandbox) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{27} } func (m *PodSandbox) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodSandbox) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodSandbox.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodSandbox) XXX_Merge(src proto.Message) { xxx_messageInfo_PodSandbox.Merge(m, src) } func (m *PodSandbox) XXX_Size() int { return m.Size() } func (m *PodSandbox) XXX_DiscardUnknown() { xxx_messageInfo_PodSandbox.DiscardUnknown(m) } var xxx_messageInfo_PodSandbox proto.InternalMessageInfo func (m *PodSandbox) GetId() string { if m != nil { return m.Id } return "" } func (m *PodSandbox) GetMetadata() *PodSandboxMetadata { if m != nil { return m.Metadata } return nil } func (m *PodSandbox) GetState() PodSandboxState { if m != nil { return m.State } return PodSandboxState_SANDBOX_READY } func (m *PodSandbox) GetCreatedAt() int64 { if m != nil { return m.CreatedAt } return 0 } func (m *PodSandbox) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *PodSandbox) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } func (m *PodSandbox) GetRuntimeHandler() string { if m != nil { return m.RuntimeHandler } return "" } type ListPodSandboxResponse struct { // List of PodSandboxes. Items []*PodSandbox `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListPodSandboxResponse) Reset() { *m = ListPodSandboxResponse{} } func (*ListPodSandboxResponse) ProtoMessage() {} func (*ListPodSandboxResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{28} } func (m *ListPodSandboxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListPodSandboxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListPodSandboxResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListPodSandboxResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ListPodSandboxResponse.Merge(m, src) } func (m *ListPodSandboxResponse) XXX_Size() int { return m.Size() } func (m *ListPodSandboxResponse) XXX_DiscardUnknown() { xxx_messageInfo_ListPodSandboxResponse.DiscardUnknown(m) } var xxx_messageInfo_ListPodSandboxResponse proto.InternalMessageInfo func (m *ListPodSandboxResponse) GetItems() []*PodSandbox { if m != nil { return m.Items } return nil } // ImageSpec is an internal representation of an image. Currently, it wraps the // value of a Container's Image field (e.g. imageID or imageDigest), but in the // future it will include more detailed information about the different image types. type ImageSpec struct { Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ImageSpec) Reset() { *m = ImageSpec{} } func (*ImageSpec) ProtoMessage() {} func (*ImageSpec) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{29} } func (m *ImageSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ImageSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ImageSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ImageSpec) XXX_Merge(src proto.Message) { xxx_messageInfo_ImageSpec.Merge(m, src) } func (m *ImageSpec) XXX_Size() int { return m.Size() } func (m *ImageSpec) XXX_DiscardUnknown() { xxx_messageInfo_ImageSpec.DiscardUnknown(m) } var xxx_messageInfo_ImageSpec proto.InternalMessageInfo func (m *ImageSpec) GetImage() string { if m != nil { return m.Image } return "" } type KeyValue struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *KeyValue) Reset() { *m = KeyValue{} } func (*KeyValue) ProtoMessage() {} func (*KeyValue) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{30} } func (m *KeyValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *KeyValue) XXX_Merge(src proto.Message) { xxx_messageInfo_KeyValue.Merge(m, src) } func (m *KeyValue) XXX_Size() int { return m.Size() } func (m *KeyValue) XXX_DiscardUnknown() { xxx_messageInfo_KeyValue.DiscardUnknown(m) } var xxx_messageInfo_KeyValue proto.InternalMessageInfo func (m *KeyValue) GetKey() string { if m != nil { return m.Key } return "" } func (m *KeyValue) GetValue() string { if m != nil { return m.Value } return "" } // LinuxContainerResources specifies Linux specific configuration for // resources. // TODO: Consider using Resources from opencontainers/runtime-spec/specs-go // directly. type LinuxContainerResources struct { // CPU CFS (Completely Fair Scheduler) period. Default: 0 (not specified). CpuPeriod int64 `protobuf:"varint,1,opt,name=cpu_period,json=cpuPeriod,proto3" json:"cpu_period,omitempty"` // CPU CFS (Completely Fair Scheduler) quota. Default: 0 (not specified). CpuQuota int64 `protobuf:"varint,2,opt,name=cpu_quota,json=cpuQuota,proto3" json:"cpu_quota,omitempty"` // CPU shares (relative weight vs. other containers). Default: 0 (not specified). CpuShares int64 `protobuf:"varint,3,opt,name=cpu_shares,json=cpuShares,proto3" json:"cpu_shares,omitempty"` // Memory limit in bytes. Default: 0 (not specified). MemoryLimitInBytes int64 `protobuf:"varint,4,opt,name=memory_limit_in_bytes,json=memoryLimitInBytes,proto3" json:"memory_limit_in_bytes,omitempty"` // OOMScoreAdj adjusts the oom-killer score. Default: 0 (not specified). OomScoreAdj int64 `protobuf:"varint,5,opt,name=oom_score_adj,json=oomScoreAdj,proto3" json:"oom_score_adj,omitempty"` // CpusetCpus constrains the allowed set of logical CPUs. Default: "" (not specified). CpusetCpus string `protobuf:"bytes,6,opt,name=cpuset_cpus,json=cpusetCpus,proto3" json:"cpuset_cpus,omitempty"` // CpusetMems constrains the allowed set of memory nodes. Default: "" (not specified). CpusetMems string `protobuf:"bytes,7,opt,name=cpuset_mems,json=cpusetMems,proto3" json:"cpuset_mems,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LinuxContainerResources) Reset() { *m = LinuxContainerResources{} } func (*LinuxContainerResources) ProtoMessage() {} func (*LinuxContainerResources) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{31} } func (m *LinuxContainerResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *LinuxContainerResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_LinuxContainerResources.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *LinuxContainerResources) XXX_Merge(src proto.Message) { xxx_messageInfo_LinuxContainerResources.Merge(m, src) } func (m *LinuxContainerResources) XXX_Size() int { return m.Size() } func (m *LinuxContainerResources) XXX_DiscardUnknown() { xxx_messageInfo_LinuxContainerResources.DiscardUnknown(m) } var xxx_messageInfo_LinuxContainerResources proto.InternalMessageInfo func (m *LinuxContainerResources) GetCpuPeriod() int64 { if m != nil { return m.CpuPeriod } return 0 } func (m *LinuxContainerResources) GetCpuQuota() int64 { if m != nil { return m.CpuQuota } return 0 } func (m *LinuxContainerResources) GetCpuShares() int64 { if m != nil { return m.CpuShares } return 0 } func (m *LinuxContainerResources) GetMemoryLimitInBytes() int64 { if m != nil { return m.MemoryLimitInBytes } return 0 } func (m *LinuxContainerResources) GetOomScoreAdj() int64 { if m != nil { return m.OomScoreAdj } return 0 } func (m *LinuxContainerResources) GetCpusetCpus() string { if m != nil { return m.CpusetCpus } return "" } func (m *LinuxContainerResources) GetCpusetMems() string { if m != nil { return m.CpusetMems } return "" } // SELinuxOption are the labels to be applied to the container. type SELinuxOption struct { User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` Level string `protobuf:"bytes,4,opt,name=level,proto3" json:"level,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SELinuxOption) Reset() { *m = SELinuxOption{} } func (*SELinuxOption) ProtoMessage() {} func (*SELinuxOption) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{32} } func (m *SELinuxOption) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *SELinuxOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_SELinuxOption.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *SELinuxOption) XXX_Merge(src proto.Message) { xxx_messageInfo_SELinuxOption.Merge(m, src) } func (m *SELinuxOption) XXX_Size() int { return m.Size() } func (m *SELinuxOption) XXX_DiscardUnknown() { xxx_messageInfo_SELinuxOption.DiscardUnknown(m) } var xxx_messageInfo_SELinuxOption proto.InternalMessageInfo func (m *SELinuxOption) GetUser() string { if m != nil { return m.User } return "" } func (m *SELinuxOption) GetRole() string { if m != nil { return m.Role } return "" } func (m *SELinuxOption) GetType() string { if m != nil { return m.Type } return "" } func (m *SELinuxOption) GetLevel() string { if m != nil { return m.Level } return "" } // Capability contains the container capabilities to add or drop type Capability struct { // List of capabilities to add. AddCapabilities []string `protobuf:"bytes,1,rep,name=add_capabilities,json=addCapabilities,proto3" json:"add_capabilities,omitempty"` // List of capabilities to drop. DropCapabilities []string `protobuf:"bytes,2,rep,name=drop_capabilities,json=dropCapabilities,proto3" json:"drop_capabilities,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Capability) Reset() { *m = Capability{} } func (*Capability) ProtoMessage() {} func (*Capability) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{33} } func (m *Capability) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Capability) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Capability.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Capability) XXX_Merge(src proto.Message) { xxx_messageInfo_Capability.Merge(m, src) } func (m *Capability) XXX_Size() int { return m.Size() } func (m *Capability) XXX_DiscardUnknown() { xxx_messageInfo_Capability.DiscardUnknown(m) } var xxx_messageInfo_Capability proto.InternalMessageInfo func (m *Capability) GetAddCapabilities() []string { if m != nil { return m.AddCapabilities } return nil } func (m *Capability) GetDropCapabilities() []string { if m != nil { return m.DropCapabilities } return nil } // LinuxContainerSecurityContext holds linux security configuration that will be applied to a container. type LinuxContainerSecurityContext struct { // Capabilities to add or drop. Capabilities *Capability `protobuf:"bytes,1,opt,name=capabilities,proto3" json:"capabilities,omitempty"` // If set, run container in privileged mode. // Privileged mode is incompatible with the following options. If // privileged is set, the following features MAY have no effect: // 1. capabilities // 2. selinux_options // 4. seccomp // 5. apparmor // // Privileged mode implies the following specific options are applied: // 1. All capabilities are added. // 2. Sensitive paths, such as kernel module paths within sysfs, are not masked. // 3. Any sysfs and procfs mounts are mounted RW. // 4. Apparmor confinement is not applied. // 5. Seccomp restrictions are not applied. // 6. The device cgroup does not restrict access to any devices. // 7. All devices from the host's /dev are available within the container. // 8. SELinux restrictions are not applied (e.g. label=disabled). Privileged bool `protobuf:"varint,2,opt,name=privileged,proto3" json:"privileged,omitempty"` // Configurations for the container's namespaces. // Only used if the container uses namespace for isolation. NamespaceOptions *NamespaceOption `protobuf:"bytes,3,opt,name=namespace_options,json=namespaceOptions,proto3" json:"namespace_options,omitempty"` // SELinux context to be optionally applied. SelinuxOptions *SELinuxOption `protobuf:"bytes,4,opt,name=selinux_options,json=selinuxOptions,proto3" json:"selinux_options,omitempty"` // UID to run the container process as. Only one of run_as_user and // run_as_username can be specified at a time. RunAsUser *Int64Value `protobuf:"bytes,5,opt,name=run_as_user,json=runAsUser,proto3" json:"run_as_user,omitempty"` // GID to run the container process as. run_as_group should only be specified // when run_as_user or run_as_username is specified; otherwise, the runtime // MUST error. RunAsGroup *Int64Value `protobuf:"bytes,12,opt,name=run_as_group,json=runAsGroup,proto3" json:"run_as_group,omitempty"` // User name to run the container process as. If specified, the user MUST // exist in the container image (i.e. in the /etc/passwd inside the image), // and be resolved there by the runtime; otherwise, the runtime MUST error. RunAsUsername string `protobuf:"bytes,6,opt,name=run_as_username,json=runAsUsername,proto3" json:"run_as_username,omitempty"` // If set, the root filesystem of the container is read-only. ReadonlyRootfs bool `protobuf:"varint,7,opt,name=readonly_rootfs,json=readonlyRootfs,proto3" json:"readonly_rootfs,omitempty"` // List of groups applied to the first process run in the container, in // addition to the container's primary GID. SupplementalGroups []int64 `protobuf:"varint,8,rep,packed,name=supplemental_groups,json=supplementalGroups,proto3" json:"supplemental_groups,omitempty"` // AppArmor profile for the container, candidate values are: // * runtime/default: equivalent to not specifying a profile. // * unconfined: no profiles are loaded // * localhost/: profile loaded on the node // (localhost) by name. The possible profile names are detailed at // http://wiki.apparmor.net/index.php/AppArmor_Core_Policy_Reference ApparmorProfile string `protobuf:"bytes,9,opt,name=apparmor_profile,json=apparmorProfile,proto3" json:"apparmor_profile,omitempty"` // Seccomp profile for the container, candidate values are: // * runtime/default: the default profile for the container runtime // * unconfined: unconfined profile, ie, no seccomp sandboxing // * localhost/: the profile installed on the node. // is the full path of the profile. // Default: "", which is identical with unconfined. SeccompProfilePath string `protobuf:"bytes,10,opt,name=seccomp_profile_path,json=seccompProfilePath,proto3" json:"seccomp_profile_path,omitempty"` // no_new_privs defines if the flag for no_new_privs should be set on the // container. NoNewPrivs bool `protobuf:"varint,11,opt,name=no_new_privs,json=noNewPrivs,proto3" json:"no_new_privs,omitempty"` // masked_paths is a slice of paths that should be masked by the container // runtime, this can be passed directly to the OCI spec. MaskedPaths []string `protobuf:"bytes,13,rep,name=masked_paths,json=maskedPaths,proto3" json:"masked_paths,omitempty"` // readonly_paths is a slice of paths that should be set as readonly by the // container runtime, this can be passed directly to the OCI spec. ReadonlyPaths []string `protobuf:"bytes,14,rep,name=readonly_paths,json=readonlyPaths,proto3" json:"readonly_paths,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LinuxContainerSecurityContext) Reset() { *m = LinuxContainerSecurityContext{} } func (*LinuxContainerSecurityContext) ProtoMessage() {} func (*LinuxContainerSecurityContext) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{34} } func (m *LinuxContainerSecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *LinuxContainerSecurityContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_LinuxContainerSecurityContext.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *LinuxContainerSecurityContext) XXX_Merge(src proto.Message) { xxx_messageInfo_LinuxContainerSecurityContext.Merge(m, src) } func (m *LinuxContainerSecurityContext) XXX_Size() int { return m.Size() } func (m *LinuxContainerSecurityContext) XXX_DiscardUnknown() { xxx_messageInfo_LinuxContainerSecurityContext.DiscardUnknown(m) } var xxx_messageInfo_LinuxContainerSecurityContext proto.InternalMessageInfo func (m *LinuxContainerSecurityContext) GetCapabilities() *Capability { if m != nil { return m.Capabilities } return nil } func (m *LinuxContainerSecurityContext) GetPrivileged() bool { if m != nil { return m.Privileged } return false } func (m *LinuxContainerSecurityContext) GetNamespaceOptions() *NamespaceOption { if m != nil { return m.NamespaceOptions } return nil } func (m *LinuxContainerSecurityContext) GetSelinuxOptions() *SELinuxOption { if m != nil { return m.SelinuxOptions } return nil } func (m *LinuxContainerSecurityContext) GetRunAsUser() *Int64Value { if m != nil { return m.RunAsUser } return nil } func (m *LinuxContainerSecurityContext) GetRunAsGroup() *Int64Value { if m != nil { return m.RunAsGroup } return nil } func (m *LinuxContainerSecurityContext) GetRunAsUsername() string { if m != nil { return m.RunAsUsername } return "" } func (m *LinuxContainerSecurityContext) GetReadonlyRootfs() bool { if m != nil { return m.ReadonlyRootfs } return false } func (m *LinuxContainerSecurityContext) GetSupplementalGroups() []int64 { if m != nil { return m.SupplementalGroups } return nil } func (m *LinuxContainerSecurityContext) GetApparmorProfile() string { if m != nil { return m.ApparmorProfile } return "" } func (m *LinuxContainerSecurityContext) GetSeccompProfilePath() string { if m != nil { return m.SeccompProfilePath } return "" } func (m *LinuxContainerSecurityContext) GetNoNewPrivs() bool { if m != nil { return m.NoNewPrivs } return false } func (m *LinuxContainerSecurityContext) GetMaskedPaths() []string { if m != nil { return m.MaskedPaths } return nil } func (m *LinuxContainerSecurityContext) GetReadonlyPaths() []string { if m != nil { return m.ReadonlyPaths } return nil } // LinuxContainerConfig contains platform-specific configuration for // Linux-based containers. type LinuxContainerConfig struct { // Resources specification for the container. Resources *LinuxContainerResources `protobuf:"bytes,1,opt,name=resources,proto3" json:"resources,omitempty"` // LinuxContainerSecurityContext configuration for the container. SecurityContext *LinuxContainerSecurityContext `protobuf:"bytes,2,opt,name=security_context,json=securityContext,proto3" json:"security_context,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *LinuxContainerConfig) Reset() { *m = LinuxContainerConfig{} } func (*LinuxContainerConfig) ProtoMessage() {} func (*LinuxContainerConfig) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{35} } func (m *LinuxContainerConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *LinuxContainerConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_LinuxContainerConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *LinuxContainerConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_LinuxContainerConfig.Merge(m, src) } func (m *LinuxContainerConfig) XXX_Size() int { return m.Size() } func (m *LinuxContainerConfig) XXX_DiscardUnknown() { xxx_messageInfo_LinuxContainerConfig.DiscardUnknown(m) } var xxx_messageInfo_LinuxContainerConfig proto.InternalMessageInfo func (m *LinuxContainerConfig) GetResources() *LinuxContainerResources { if m != nil { return m.Resources } return nil } func (m *LinuxContainerConfig) GetSecurityContext() *LinuxContainerSecurityContext { if m != nil { return m.SecurityContext } return nil } // WindowsContainerSecurityContext holds windows security configuration that will be applied to a container. type WindowsContainerSecurityContext struct { // User name to run the container process as. If specified, the user MUST // exist in the container image and be resolved there by the runtime; // otherwise, the runtime MUST return error. RunAsUsername string `protobuf:"bytes,1,opt,name=run_as_username,json=runAsUsername,proto3" json:"run_as_username,omitempty"` // The contents of the GMSA credential spec to use to run this container. CredentialSpec string `protobuf:"bytes,2,opt,name=credential_spec,json=credentialSpec,proto3" json:"credential_spec,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *WindowsContainerSecurityContext) Reset() { *m = WindowsContainerSecurityContext{} } func (*WindowsContainerSecurityContext) ProtoMessage() {} func (*WindowsContainerSecurityContext) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{36} } func (m *WindowsContainerSecurityContext) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *WindowsContainerSecurityContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_WindowsContainerSecurityContext.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *WindowsContainerSecurityContext) XXX_Merge(src proto.Message) { xxx_messageInfo_WindowsContainerSecurityContext.Merge(m, src) } func (m *WindowsContainerSecurityContext) XXX_Size() int { return m.Size() } func (m *WindowsContainerSecurityContext) XXX_DiscardUnknown() { xxx_messageInfo_WindowsContainerSecurityContext.DiscardUnknown(m) } var xxx_messageInfo_WindowsContainerSecurityContext proto.InternalMessageInfo func (m *WindowsContainerSecurityContext) GetRunAsUsername() string { if m != nil { return m.RunAsUsername } return "" } func (m *WindowsContainerSecurityContext) GetCredentialSpec() string { if m != nil { return m.CredentialSpec } return "" } // WindowsContainerConfig contains platform-specific configuration for // Windows-based containers. type WindowsContainerConfig struct { // Resources specification for the container. Resources *WindowsContainerResources `protobuf:"bytes,1,opt,name=resources,proto3" json:"resources,omitempty"` // WindowsContainerSecurityContext configuration for the container. SecurityContext *WindowsContainerSecurityContext `protobuf:"bytes,2,opt,name=security_context,json=securityContext,proto3" json:"security_context,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *WindowsContainerConfig) Reset() { *m = WindowsContainerConfig{} } func (*WindowsContainerConfig) ProtoMessage() {} func (*WindowsContainerConfig) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{37} } func (m *WindowsContainerConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *WindowsContainerConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_WindowsContainerConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *WindowsContainerConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_WindowsContainerConfig.Merge(m, src) } func (m *WindowsContainerConfig) XXX_Size() int { return m.Size() } func (m *WindowsContainerConfig) XXX_DiscardUnknown() { xxx_messageInfo_WindowsContainerConfig.DiscardUnknown(m) } var xxx_messageInfo_WindowsContainerConfig proto.InternalMessageInfo func (m *WindowsContainerConfig) GetResources() *WindowsContainerResources { if m != nil { return m.Resources } return nil } func (m *WindowsContainerConfig) GetSecurityContext() *WindowsContainerSecurityContext { if m != nil { return m.SecurityContext } return nil } // WindowsContainerResources specifies Windows specific configuration for // resources. type WindowsContainerResources struct { // CPU shares (relative weight vs. other containers). Default: 0 (not specified). CpuShares int64 `protobuf:"varint,1,opt,name=cpu_shares,json=cpuShares,proto3" json:"cpu_shares,omitempty"` // Number of CPUs available to the container. Default: 0 (not specified). CpuCount int64 `protobuf:"varint,2,opt,name=cpu_count,json=cpuCount,proto3" json:"cpu_count,omitempty"` // Specifies the portion of processor cycles that this container can use as a percentage times 100. CpuMaximum int64 `protobuf:"varint,3,opt,name=cpu_maximum,json=cpuMaximum,proto3" json:"cpu_maximum,omitempty"` // Memory limit in bytes. Default: 0 (not specified). MemoryLimitInBytes int64 `protobuf:"varint,4,opt,name=memory_limit_in_bytes,json=memoryLimitInBytes,proto3" json:"memory_limit_in_bytes,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *WindowsContainerResources) Reset() { *m = WindowsContainerResources{} } func (*WindowsContainerResources) ProtoMessage() {} func (*WindowsContainerResources) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{38} } func (m *WindowsContainerResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *WindowsContainerResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_WindowsContainerResources.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *WindowsContainerResources) XXX_Merge(src proto.Message) { xxx_messageInfo_WindowsContainerResources.Merge(m, src) } func (m *WindowsContainerResources) XXX_Size() int { return m.Size() } func (m *WindowsContainerResources) XXX_DiscardUnknown() { xxx_messageInfo_WindowsContainerResources.DiscardUnknown(m) } var xxx_messageInfo_WindowsContainerResources proto.InternalMessageInfo func (m *WindowsContainerResources) GetCpuShares() int64 { if m != nil { return m.CpuShares } return 0 } func (m *WindowsContainerResources) GetCpuCount() int64 { if m != nil { return m.CpuCount } return 0 } func (m *WindowsContainerResources) GetCpuMaximum() int64 { if m != nil { return m.CpuMaximum } return 0 } func (m *WindowsContainerResources) GetMemoryLimitInBytes() int64 { if m != nil { return m.MemoryLimitInBytes } return 0 } // ContainerMetadata holds all necessary information for building the container // name. The container runtime is encouraged to expose the metadata in its user // interface for better user experience. E.g., runtime can construct a unique // container name based on the metadata. Note that (name, attempt) is unique // within a sandbox for the entire lifetime of the sandbox. type ContainerMetadata struct { // Name of the container. Same as the container name in the PodSpec. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Attempt number of creating the container. Default: 0. Attempt uint32 `protobuf:"varint,2,opt,name=attempt,proto3" json:"attempt,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerMetadata) Reset() { *m = ContainerMetadata{} } func (*ContainerMetadata) ProtoMessage() {} func (*ContainerMetadata) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{39} } func (m *ContainerMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerMetadata.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerMetadata) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerMetadata.Merge(m, src) } func (m *ContainerMetadata) XXX_Size() int { return m.Size() } func (m *ContainerMetadata) XXX_DiscardUnknown() { xxx_messageInfo_ContainerMetadata.DiscardUnknown(m) } var xxx_messageInfo_ContainerMetadata proto.InternalMessageInfo func (m *ContainerMetadata) GetName() string { if m != nil { return m.Name } return "" } func (m *ContainerMetadata) GetAttempt() uint32 { if m != nil { return m.Attempt } return 0 } // Device specifies a host device to mount into a container. type Device struct { // Path of the device within the container. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"` // Path of the device on the host. HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` // Cgroups permissions of the device, candidates are one or more of // * r - allows container to read from the specified device. // * w - allows container to write to the specified device. // * m - allows container to create device files that do not yet exist. Permissions string `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Device) Reset() { *m = Device{} } func (*Device) ProtoMessage() {} func (*Device) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{40} } func (m *Device) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Device.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Device) XXX_Merge(src proto.Message) { xxx_messageInfo_Device.Merge(m, src) } func (m *Device) XXX_Size() int { return m.Size() } func (m *Device) XXX_DiscardUnknown() { xxx_messageInfo_Device.DiscardUnknown(m) } var xxx_messageInfo_Device proto.InternalMessageInfo func (m *Device) GetContainerPath() string { if m != nil { return m.ContainerPath } return "" } func (m *Device) GetHostPath() string { if m != nil { return m.HostPath } return "" } func (m *Device) GetPermissions() string { if m != nil { return m.Permissions } return "" } // ContainerConfig holds all the required and optional fields for creating a // container. type ContainerConfig struct { // Metadata of the container. This information will uniquely identify the // container, and the runtime should leverage this to ensure correct // operation. The runtime may also use this information to improve UX, such // as by constructing a readable name. Metadata *ContainerMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` // Image to use. Image *ImageSpec `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` // Command to execute (i.e., entrypoint for docker) Command []string `protobuf:"bytes,3,rep,name=command,proto3" json:"command,omitempty"` // Args for the Command (i.e., command for docker) Args []string `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"` // Current working directory of the command. WorkingDir string `protobuf:"bytes,5,opt,name=working_dir,json=workingDir,proto3" json:"working_dir,omitempty"` // List of environment variable to set in the container. Envs []*KeyValue `protobuf:"bytes,6,rep,name=envs,proto3" json:"envs,omitempty"` // Mounts for the container. Mounts []*Mount `protobuf:"bytes,7,rep,name=mounts,proto3" json:"mounts,omitempty"` // Devices for the container. Devices []*Device `protobuf:"bytes,8,rep,name=devices,proto3" json:"devices,omitempty"` // Key-value pairs that may be used to scope and select individual resources. // Label keys are of the form: // label-key ::= prefixed-name | name // prefixed-name ::= prefix '/' name // prefix ::= DNS_SUBDOMAIN // name ::= DNS_LABEL Labels map[string]string `protobuf:"bytes,9,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map that may be used by the kubelet to store and // retrieve arbitrary metadata. // // Annotations MUST NOT be altered by the runtime; the annotations stored // here MUST be returned in the ContainerStatus associated with the container // this ContainerConfig creates. // // In general, in order to preserve a well-defined interface between the // kubelet and the container runtime, annotations SHOULD NOT influence // runtime behaviour. Annotations map[string]string `protobuf:"bytes,10,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Path relative to PodSandboxConfig.LogDirectory for container to store // the log (STDOUT and STDERR) on the host. // E.g., // PodSandboxConfig.LogDirectory = `/var/log/pods//` // ContainerConfig.LogPath = `containerName/Instance#.log` // // WARNING: Log management and how kubelet should interface with the // container logs are under active discussion in // https://issues.k8s.io/24677. There *may* be future change of direction // for logging as the discussion carries on. LogPath string `protobuf:"bytes,11,opt,name=log_path,json=logPath,proto3" json:"log_path,omitempty"` // Variables for interactive containers, these have very specialized // use-cases (e.g. debugging). // TODO: Determine if we need to continue supporting these fields that are // part of Kubernetes's Container Spec. Stdin bool `protobuf:"varint,12,opt,name=stdin,proto3" json:"stdin,omitempty"` StdinOnce bool `protobuf:"varint,13,opt,name=stdin_once,json=stdinOnce,proto3" json:"stdin_once,omitempty"` Tty bool `protobuf:"varint,14,opt,name=tty,proto3" json:"tty,omitempty"` // Configuration specific to Linux containers. Linux *LinuxContainerConfig `protobuf:"bytes,15,opt,name=linux,proto3" json:"linux,omitempty"` // Configuration specific to Windows containers. Windows *WindowsContainerConfig `protobuf:"bytes,16,opt,name=windows,proto3" json:"windows,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerConfig) Reset() { *m = ContainerConfig{} } func (*ContainerConfig) ProtoMessage() {} func (*ContainerConfig) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{41} } func (m *ContainerConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerConfig.Merge(m, src) } func (m *ContainerConfig) XXX_Size() int { return m.Size() } func (m *ContainerConfig) XXX_DiscardUnknown() { xxx_messageInfo_ContainerConfig.DiscardUnknown(m) } var xxx_messageInfo_ContainerConfig proto.InternalMessageInfo func (m *ContainerConfig) GetMetadata() *ContainerMetadata { if m != nil { return m.Metadata } return nil } func (m *ContainerConfig) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } func (m *ContainerConfig) GetCommand() []string { if m != nil { return m.Command } return nil } func (m *ContainerConfig) GetArgs() []string { if m != nil { return m.Args } return nil } func (m *ContainerConfig) GetWorkingDir() string { if m != nil { return m.WorkingDir } return "" } func (m *ContainerConfig) GetEnvs() []*KeyValue { if m != nil { return m.Envs } return nil } func (m *ContainerConfig) GetMounts() []*Mount { if m != nil { return m.Mounts } return nil } func (m *ContainerConfig) GetDevices() []*Device { if m != nil { return m.Devices } return nil } func (m *ContainerConfig) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *ContainerConfig) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } func (m *ContainerConfig) GetLogPath() string { if m != nil { return m.LogPath } return "" } func (m *ContainerConfig) GetStdin() bool { if m != nil { return m.Stdin } return false } func (m *ContainerConfig) GetStdinOnce() bool { if m != nil { return m.StdinOnce } return false } func (m *ContainerConfig) GetTty() bool { if m != nil { return m.Tty } return false } func (m *ContainerConfig) GetLinux() *LinuxContainerConfig { if m != nil { return m.Linux } return nil } func (m *ContainerConfig) GetWindows() *WindowsContainerConfig { if m != nil { return m.Windows } return nil } type CreateContainerRequest struct { // ID of the PodSandbox in which the container should be created. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // Config of the container. Config *ContainerConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` // Config of the PodSandbox. This is the same config that was passed // to RunPodSandboxRequest to create the PodSandbox. It is passed again // here just for easy reference. The PodSandboxConfig is immutable and // remains the same throughout the lifetime of the pod. SandboxConfig *PodSandboxConfig `protobuf:"bytes,3,opt,name=sandbox_config,json=sandboxConfig,proto3" json:"sandbox_config,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *CreateContainerRequest) Reset() { *m = CreateContainerRequest{} } func (*CreateContainerRequest) ProtoMessage() {} func (*CreateContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{42} } func (m *CreateContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *CreateContainerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CreateContainerRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *CreateContainerRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_CreateContainerRequest.Merge(m, src) } func (m *CreateContainerRequest) XXX_Size() int { return m.Size() } func (m *CreateContainerRequest) XXX_DiscardUnknown() { xxx_messageInfo_CreateContainerRequest.DiscardUnknown(m) } var xxx_messageInfo_CreateContainerRequest proto.InternalMessageInfo func (m *CreateContainerRequest) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *CreateContainerRequest) GetConfig() *ContainerConfig { if m != nil { return m.Config } return nil } func (m *CreateContainerRequest) GetSandboxConfig() *PodSandboxConfig { if m != nil { return m.SandboxConfig } return nil } type CreateContainerResponse struct { // ID of the created container. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *CreateContainerResponse) Reset() { *m = CreateContainerResponse{} } func (*CreateContainerResponse) ProtoMessage() {} func (*CreateContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{43} } func (m *CreateContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *CreateContainerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CreateContainerResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *CreateContainerResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_CreateContainerResponse.Merge(m, src) } func (m *CreateContainerResponse) XXX_Size() int { return m.Size() } func (m *CreateContainerResponse) XXX_DiscardUnknown() { xxx_messageInfo_CreateContainerResponse.DiscardUnknown(m) } var xxx_messageInfo_CreateContainerResponse proto.InternalMessageInfo func (m *CreateContainerResponse) GetContainerId() string { if m != nil { return m.ContainerId } return "" } type StartContainerRequest struct { // ID of the container to start. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *StartContainerRequest) Reset() { *m = StartContainerRequest{} } func (*StartContainerRequest) ProtoMessage() {} func (*StartContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{44} } func (m *StartContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *StartContainerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_StartContainerRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *StartContainerRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_StartContainerRequest.Merge(m, src) } func (m *StartContainerRequest) XXX_Size() int { return m.Size() } func (m *StartContainerRequest) XXX_DiscardUnknown() { xxx_messageInfo_StartContainerRequest.DiscardUnknown(m) } var xxx_messageInfo_StartContainerRequest proto.InternalMessageInfo func (m *StartContainerRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } type StartContainerResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *StartContainerResponse) Reset() { *m = StartContainerResponse{} } func (*StartContainerResponse) ProtoMessage() {} func (*StartContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{45} } func (m *StartContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *StartContainerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_StartContainerResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *StartContainerResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_StartContainerResponse.Merge(m, src) } func (m *StartContainerResponse) XXX_Size() int { return m.Size() } func (m *StartContainerResponse) XXX_DiscardUnknown() { xxx_messageInfo_StartContainerResponse.DiscardUnknown(m) } var xxx_messageInfo_StartContainerResponse proto.InternalMessageInfo type StopContainerRequest struct { // ID of the container to stop. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Timeout in seconds to wait for the container to stop before forcibly // terminating it. Default: 0 (forcibly terminate the container immediately) Timeout int64 `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *StopContainerRequest) Reset() { *m = StopContainerRequest{} } func (*StopContainerRequest) ProtoMessage() {} func (*StopContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{46} } func (m *StopContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *StopContainerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_StopContainerRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *StopContainerRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_StopContainerRequest.Merge(m, src) } func (m *StopContainerRequest) XXX_Size() int { return m.Size() } func (m *StopContainerRequest) XXX_DiscardUnknown() { xxx_messageInfo_StopContainerRequest.DiscardUnknown(m) } var xxx_messageInfo_StopContainerRequest proto.InternalMessageInfo func (m *StopContainerRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *StopContainerRequest) GetTimeout() int64 { if m != nil { return m.Timeout } return 0 } type StopContainerResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *StopContainerResponse) Reset() { *m = StopContainerResponse{} } func (*StopContainerResponse) ProtoMessage() {} func (*StopContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{47} } func (m *StopContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *StopContainerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_StopContainerResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *StopContainerResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_StopContainerResponse.Merge(m, src) } func (m *StopContainerResponse) XXX_Size() int { return m.Size() } func (m *StopContainerResponse) XXX_DiscardUnknown() { xxx_messageInfo_StopContainerResponse.DiscardUnknown(m) } var xxx_messageInfo_StopContainerResponse proto.InternalMessageInfo type RemoveContainerRequest struct { // ID of the container to remove. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RemoveContainerRequest) Reset() { *m = RemoveContainerRequest{} } func (*RemoveContainerRequest) ProtoMessage() {} func (*RemoveContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{48} } func (m *RemoveContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RemoveContainerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RemoveContainerRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RemoveContainerRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_RemoveContainerRequest.Merge(m, src) } func (m *RemoveContainerRequest) XXX_Size() int { return m.Size() } func (m *RemoveContainerRequest) XXX_DiscardUnknown() { xxx_messageInfo_RemoveContainerRequest.DiscardUnknown(m) } var xxx_messageInfo_RemoveContainerRequest proto.InternalMessageInfo func (m *RemoveContainerRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } type RemoveContainerResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RemoveContainerResponse) Reset() { *m = RemoveContainerResponse{} } func (*RemoveContainerResponse) ProtoMessage() {} func (*RemoveContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{49} } func (m *RemoveContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RemoveContainerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RemoveContainerResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RemoveContainerResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_RemoveContainerResponse.Merge(m, src) } func (m *RemoveContainerResponse) XXX_Size() int { return m.Size() } func (m *RemoveContainerResponse) XXX_DiscardUnknown() { xxx_messageInfo_RemoveContainerResponse.DiscardUnknown(m) } var xxx_messageInfo_RemoveContainerResponse proto.InternalMessageInfo // ContainerStateValue is the wrapper of ContainerState. type ContainerStateValue struct { // State of the container. State ContainerState `protobuf:"varint,1,opt,name=state,proto3,enum=runtime.v1alpha2.ContainerState" json:"state,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerStateValue) Reset() { *m = ContainerStateValue{} } func (*ContainerStateValue) ProtoMessage() {} func (*ContainerStateValue) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{50} } func (m *ContainerStateValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerStateValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerStateValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerStateValue) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerStateValue.Merge(m, src) } func (m *ContainerStateValue) XXX_Size() int { return m.Size() } func (m *ContainerStateValue) XXX_DiscardUnknown() { xxx_messageInfo_ContainerStateValue.DiscardUnknown(m) } var xxx_messageInfo_ContainerStateValue proto.InternalMessageInfo func (m *ContainerStateValue) GetState() ContainerState { if m != nil { return m.State } return ContainerState_CONTAINER_CREATED } // ContainerFilter is used to filter containers. // All those fields are combined with 'AND' type ContainerFilter struct { // ID of the container. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // State of the container. State *ContainerStateValue `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"` // ID of the PodSandbox. PodSandboxId string `protobuf:"bytes,3,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // LabelSelector to select matches. // Only api.MatchLabels is supported for now and the requirements // are ANDed. MatchExpressions is not supported yet. LabelSelector map[string]string `protobuf:"bytes,4,rep,name=label_selector,json=labelSelector,proto3" json:"label_selector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerFilter) Reset() { *m = ContainerFilter{} } func (*ContainerFilter) ProtoMessage() {} func (*ContainerFilter) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{51} } func (m *ContainerFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerFilter.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerFilter) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerFilter.Merge(m, src) } func (m *ContainerFilter) XXX_Size() int { return m.Size() } func (m *ContainerFilter) XXX_DiscardUnknown() { xxx_messageInfo_ContainerFilter.DiscardUnknown(m) } var xxx_messageInfo_ContainerFilter proto.InternalMessageInfo func (m *ContainerFilter) GetId() string { if m != nil { return m.Id } return "" } func (m *ContainerFilter) GetState() *ContainerStateValue { if m != nil { return m.State } return nil } func (m *ContainerFilter) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *ContainerFilter) GetLabelSelector() map[string]string { if m != nil { return m.LabelSelector } return nil } type ListContainersRequest struct { Filter *ContainerFilter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListContainersRequest) Reset() { *m = ListContainersRequest{} } func (*ListContainersRequest) ProtoMessage() {} func (*ListContainersRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{52} } func (m *ListContainersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListContainersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListContainersRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListContainersRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListContainersRequest.Merge(m, src) } func (m *ListContainersRequest) XXX_Size() int { return m.Size() } func (m *ListContainersRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListContainersRequest.DiscardUnknown(m) } var xxx_messageInfo_ListContainersRequest proto.InternalMessageInfo func (m *ListContainersRequest) GetFilter() *ContainerFilter { if m != nil { return m.Filter } return nil } // Container provides the runtime information for a container, such as ID, hash, // state of the container. type Container struct { // ID of the container, used by the container runtime to identify // a container. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // ID of the sandbox to which this container belongs. PodSandboxId string `protobuf:"bytes,2,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // Metadata of the container. Metadata *ContainerMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // Spec of the image. Image *ImageSpec `protobuf:"bytes,4,opt,name=image,proto3" json:"image,omitempty"` // Reference to the image in use. For most runtimes, this should be an // image ID. ImageRef string `protobuf:"bytes,5,opt,name=image_ref,json=imageRef,proto3" json:"image_ref,omitempty"` // State of the container. State ContainerState `protobuf:"varint,6,opt,name=state,proto3,enum=runtime.v1alpha2.ContainerState" json:"state,omitempty"` // Creation time of the container in nanoseconds. CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Key-value pairs that may be used to scope and select individual resources. Labels map[string]string `protobuf:"bytes,8,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map holding arbitrary metadata. // Annotations MUST NOT be altered by the runtime; the value of this field // MUST be identical to that of the corresponding ContainerConfig used to // instantiate this Container. Annotations map[string]string `protobuf:"bytes,9,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Container) Reset() { *m = Container{} } func (*Container) ProtoMessage() {} func (*Container) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{53} } func (m *Container) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Container) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Container.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Container) XXX_Merge(src proto.Message) { xxx_messageInfo_Container.Merge(m, src) } func (m *Container) XXX_Size() int { return m.Size() } func (m *Container) XXX_DiscardUnknown() { xxx_messageInfo_Container.DiscardUnknown(m) } var xxx_messageInfo_Container proto.InternalMessageInfo func (m *Container) GetId() string { if m != nil { return m.Id } return "" } func (m *Container) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *Container) GetMetadata() *ContainerMetadata { if m != nil { return m.Metadata } return nil } func (m *Container) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } func (m *Container) GetImageRef() string { if m != nil { return m.ImageRef } return "" } func (m *Container) GetState() ContainerState { if m != nil { return m.State } return ContainerState_CONTAINER_CREATED } func (m *Container) GetCreatedAt() int64 { if m != nil { return m.CreatedAt } return 0 } func (m *Container) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *Container) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } type ListContainersResponse struct { // List of containers. Containers []*Container `protobuf:"bytes,1,rep,name=containers,proto3" json:"containers,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListContainersResponse) Reset() { *m = ListContainersResponse{} } func (*ListContainersResponse) ProtoMessage() {} func (*ListContainersResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{54} } func (m *ListContainersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListContainersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListContainersResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListContainersResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ListContainersResponse.Merge(m, src) } func (m *ListContainersResponse) XXX_Size() int { return m.Size() } func (m *ListContainersResponse) XXX_DiscardUnknown() { xxx_messageInfo_ListContainersResponse.DiscardUnknown(m) } var xxx_messageInfo_ListContainersResponse proto.InternalMessageInfo func (m *ListContainersResponse) GetContainers() []*Container { if m != nil { return m.Containers } return nil } type ContainerStatusRequest struct { // ID of the container for which to retrieve status. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Verbose indicates whether to return extra information about the container. Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerStatusRequest) Reset() { *m = ContainerStatusRequest{} } func (*ContainerStatusRequest) ProtoMessage() {} func (*ContainerStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{55} } func (m *ContainerStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerStatusRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerStatusRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerStatusRequest.Merge(m, src) } func (m *ContainerStatusRequest) XXX_Size() int { return m.Size() } func (m *ContainerStatusRequest) XXX_DiscardUnknown() { xxx_messageInfo_ContainerStatusRequest.DiscardUnknown(m) } var xxx_messageInfo_ContainerStatusRequest proto.InternalMessageInfo func (m *ContainerStatusRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *ContainerStatusRequest) GetVerbose() bool { if m != nil { return m.Verbose } return false } // ContainerStatus represents the status of a container. type ContainerStatus struct { // ID of the container. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Metadata of the container. Metadata *ContainerMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` // Status of the container. State ContainerState `protobuf:"varint,3,opt,name=state,proto3,enum=runtime.v1alpha2.ContainerState" json:"state,omitempty"` // Creation time of the container in nanoseconds. CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Start time of the container in nanoseconds. Default: 0 (not specified). StartedAt int64 `protobuf:"varint,5,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` // Finish time of the container in nanoseconds. Default: 0 (not specified). FinishedAt int64 `protobuf:"varint,6,opt,name=finished_at,json=finishedAt,proto3" json:"finished_at,omitempty"` // Exit code of the container. Only required when finished_at != 0. Default: 0. ExitCode int32 `protobuf:"varint,7,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` // Spec of the image. Image *ImageSpec `protobuf:"bytes,8,opt,name=image,proto3" json:"image,omitempty"` // Reference to the image in use. For most runtimes, this should be an // image ID ImageRef string `protobuf:"bytes,9,opt,name=image_ref,json=imageRef,proto3" json:"image_ref,omitempty"` // Brief CamelCase string explaining why container is in its current state. Reason string `protobuf:"bytes,10,opt,name=reason,proto3" json:"reason,omitempty"` // Human-readable message indicating details about why container is in its // current state. Message string `protobuf:"bytes,11,opt,name=message,proto3" json:"message,omitempty"` // Key-value pairs that may be used to scope and select individual resources. Labels map[string]string `protobuf:"bytes,12,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map holding arbitrary metadata. // Annotations MUST NOT be altered by the runtime; the value of this field // MUST be identical to that of the corresponding ContainerConfig used to // instantiate the Container this status represents. Annotations map[string]string `protobuf:"bytes,13,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Mounts for the container. Mounts []*Mount `protobuf:"bytes,14,rep,name=mounts,proto3" json:"mounts,omitempty"` // Log path of container. LogPath string `protobuf:"bytes,15,opt,name=log_path,json=logPath,proto3" json:"log_path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerStatus) Reset() { *m = ContainerStatus{} } func (*ContainerStatus) ProtoMessage() {} func (*ContainerStatus) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{56} } func (m *ContainerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerStatus.Merge(m, src) } func (m *ContainerStatus) XXX_Size() int { return m.Size() } func (m *ContainerStatus) XXX_DiscardUnknown() { xxx_messageInfo_ContainerStatus.DiscardUnknown(m) } var xxx_messageInfo_ContainerStatus proto.InternalMessageInfo func (m *ContainerStatus) GetId() string { if m != nil { return m.Id } return "" } func (m *ContainerStatus) GetMetadata() *ContainerMetadata { if m != nil { return m.Metadata } return nil } func (m *ContainerStatus) GetState() ContainerState { if m != nil { return m.State } return ContainerState_CONTAINER_CREATED } func (m *ContainerStatus) GetCreatedAt() int64 { if m != nil { return m.CreatedAt } return 0 } func (m *ContainerStatus) GetStartedAt() int64 { if m != nil { return m.StartedAt } return 0 } func (m *ContainerStatus) GetFinishedAt() int64 { if m != nil { return m.FinishedAt } return 0 } func (m *ContainerStatus) GetExitCode() int32 { if m != nil { return m.ExitCode } return 0 } func (m *ContainerStatus) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } func (m *ContainerStatus) GetImageRef() string { if m != nil { return m.ImageRef } return "" } func (m *ContainerStatus) GetReason() string { if m != nil { return m.Reason } return "" } func (m *ContainerStatus) GetMessage() string { if m != nil { return m.Message } return "" } func (m *ContainerStatus) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *ContainerStatus) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } func (m *ContainerStatus) GetMounts() []*Mount { if m != nil { return m.Mounts } return nil } func (m *ContainerStatus) GetLogPath() string { if m != nil { return m.LogPath } return "" } type ContainerStatusResponse struct { // Status of the container. Status *ContainerStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` // Info is extra information of the Container. The key could be arbitrary string, and // value should be in json format. The information could include anything useful for // debug, e.g. pid for linux container based container runtime. // It should only be returned non-empty when Verbose is true. Info map[string]string `protobuf:"bytes,2,rep,name=info,proto3" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerStatusResponse) Reset() { *m = ContainerStatusResponse{} } func (*ContainerStatusResponse) ProtoMessage() {} func (*ContainerStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{57} } func (m *ContainerStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerStatusResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerStatusResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerStatusResponse.Merge(m, src) } func (m *ContainerStatusResponse) XXX_Size() int { return m.Size() } func (m *ContainerStatusResponse) XXX_DiscardUnknown() { xxx_messageInfo_ContainerStatusResponse.DiscardUnknown(m) } var xxx_messageInfo_ContainerStatusResponse proto.InternalMessageInfo func (m *ContainerStatusResponse) GetStatus() *ContainerStatus { if m != nil { return m.Status } return nil } func (m *ContainerStatusResponse) GetInfo() map[string]string { if m != nil { return m.Info } return nil } type UpdateContainerResourcesRequest struct { // ID of the container to update. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Resource configuration specific to Linux containers. Linux *LinuxContainerResources `protobuf:"bytes,2,opt,name=linux,proto3" json:"linux,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *UpdateContainerResourcesRequest) Reset() { *m = UpdateContainerResourcesRequest{} } func (*UpdateContainerResourcesRequest) ProtoMessage() {} func (*UpdateContainerResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{58} } func (m *UpdateContainerResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *UpdateContainerResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_UpdateContainerResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *UpdateContainerResourcesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_UpdateContainerResourcesRequest.Merge(m, src) } func (m *UpdateContainerResourcesRequest) XXX_Size() int { return m.Size() } func (m *UpdateContainerResourcesRequest) XXX_DiscardUnknown() { xxx_messageInfo_UpdateContainerResourcesRequest.DiscardUnknown(m) } var xxx_messageInfo_UpdateContainerResourcesRequest proto.InternalMessageInfo func (m *UpdateContainerResourcesRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *UpdateContainerResourcesRequest) GetLinux() *LinuxContainerResources { if m != nil { return m.Linux } return nil } type UpdateContainerResourcesResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *UpdateContainerResourcesResponse) Reset() { *m = UpdateContainerResourcesResponse{} } func (*UpdateContainerResourcesResponse) ProtoMessage() {} func (*UpdateContainerResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{59} } func (m *UpdateContainerResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *UpdateContainerResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_UpdateContainerResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *UpdateContainerResourcesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_UpdateContainerResourcesResponse.Merge(m, src) } func (m *UpdateContainerResourcesResponse) XXX_Size() int { return m.Size() } func (m *UpdateContainerResourcesResponse) XXX_DiscardUnknown() { xxx_messageInfo_UpdateContainerResourcesResponse.DiscardUnknown(m) } var xxx_messageInfo_UpdateContainerResourcesResponse proto.InternalMessageInfo type ExecSyncRequest struct { // ID of the container. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Command to execute. Cmd []string `protobuf:"bytes,2,rep,name=cmd,proto3" json:"cmd,omitempty"` // Timeout in seconds to stop the command. Default: 0 (run forever). Timeout int64 `protobuf:"varint,3,opt,name=timeout,proto3" json:"timeout,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ExecSyncRequest) Reset() { *m = ExecSyncRequest{} } func (*ExecSyncRequest) ProtoMessage() {} func (*ExecSyncRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{60} } func (m *ExecSyncRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ExecSyncRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ExecSyncRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ExecSyncRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ExecSyncRequest.Merge(m, src) } func (m *ExecSyncRequest) XXX_Size() int { return m.Size() } func (m *ExecSyncRequest) XXX_DiscardUnknown() { xxx_messageInfo_ExecSyncRequest.DiscardUnknown(m) } var xxx_messageInfo_ExecSyncRequest proto.InternalMessageInfo func (m *ExecSyncRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *ExecSyncRequest) GetCmd() []string { if m != nil { return m.Cmd } return nil } func (m *ExecSyncRequest) GetTimeout() int64 { if m != nil { return m.Timeout } return 0 } type ExecSyncResponse struct { // Captured command stdout output. Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3" json:"stdout,omitempty"` // Captured command stderr output. Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"` // Exit code the command finished with. Default: 0 (success). ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ExecSyncResponse) Reset() { *m = ExecSyncResponse{} } func (*ExecSyncResponse) ProtoMessage() {} func (*ExecSyncResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{61} } func (m *ExecSyncResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ExecSyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ExecSyncResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ExecSyncResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ExecSyncResponse.Merge(m, src) } func (m *ExecSyncResponse) XXX_Size() int { return m.Size() } func (m *ExecSyncResponse) XXX_DiscardUnknown() { xxx_messageInfo_ExecSyncResponse.DiscardUnknown(m) } var xxx_messageInfo_ExecSyncResponse proto.InternalMessageInfo func (m *ExecSyncResponse) GetStdout() []byte { if m != nil { return m.Stdout } return nil } func (m *ExecSyncResponse) GetStderr() []byte { if m != nil { return m.Stderr } return nil } func (m *ExecSyncResponse) GetExitCode() int32 { if m != nil { return m.ExitCode } return 0 } type ExecRequest struct { // ID of the container in which to execute the command. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Command to execute. Cmd []string `protobuf:"bytes,2,rep,name=cmd,proto3" json:"cmd,omitempty"` // Whether to exec the command in a TTY. Tty bool `protobuf:"varint,3,opt,name=tty,proto3" json:"tty,omitempty"` // Whether to stream stdin. // One of `stdin`, `stdout`, and `stderr` MUST be true. Stdin bool `protobuf:"varint,4,opt,name=stdin,proto3" json:"stdin,omitempty"` // Whether to stream stdout. // One of `stdin`, `stdout`, and `stderr` MUST be true. Stdout bool `protobuf:"varint,5,opt,name=stdout,proto3" json:"stdout,omitempty"` // Whether to stream stderr. // One of `stdin`, `stdout`, and `stderr` MUST be true. // If `tty` is true, `stderr` MUST be false. Multiplexing is not supported // in this case. The output of stdout and stderr will be combined to a // single stream. Stderr bool `protobuf:"varint,6,opt,name=stderr,proto3" json:"stderr,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ExecRequest) Reset() { *m = ExecRequest{} } func (*ExecRequest) ProtoMessage() {} func (*ExecRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{62} } func (m *ExecRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ExecRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ExecRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ExecRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ExecRequest.Merge(m, src) } func (m *ExecRequest) XXX_Size() int { return m.Size() } func (m *ExecRequest) XXX_DiscardUnknown() { xxx_messageInfo_ExecRequest.DiscardUnknown(m) } var xxx_messageInfo_ExecRequest proto.InternalMessageInfo func (m *ExecRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *ExecRequest) GetCmd() []string { if m != nil { return m.Cmd } return nil } func (m *ExecRequest) GetTty() bool { if m != nil { return m.Tty } return false } func (m *ExecRequest) GetStdin() bool { if m != nil { return m.Stdin } return false } func (m *ExecRequest) GetStdout() bool { if m != nil { return m.Stdout } return false } func (m *ExecRequest) GetStderr() bool { if m != nil { return m.Stderr } return false } type ExecResponse struct { // Fully qualified URL of the exec streaming server. Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ExecResponse) Reset() { *m = ExecResponse{} } func (*ExecResponse) ProtoMessage() {} func (*ExecResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{63} } func (m *ExecResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ExecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ExecResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ExecResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ExecResponse.Merge(m, src) } func (m *ExecResponse) XXX_Size() int { return m.Size() } func (m *ExecResponse) XXX_DiscardUnknown() { xxx_messageInfo_ExecResponse.DiscardUnknown(m) } var xxx_messageInfo_ExecResponse proto.InternalMessageInfo func (m *ExecResponse) GetUrl() string { if m != nil { return m.Url } return "" } type AttachRequest struct { // ID of the container to which to attach. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` // Whether to stream stdin. // One of `stdin`, `stdout`, and `stderr` MUST be true. Stdin bool `protobuf:"varint,2,opt,name=stdin,proto3" json:"stdin,omitempty"` // Whether the process being attached is running in a TTY. // This must match the TTY setting in the ContainerConfig. Tty bool `protobuf:"varint,3,opt,name=tty,proto3" json:"tty,omitempty"` // Whether to stream stdout. // One of `stdin`, `stdout`, and `stderr` MUST be true. Stdout bool `protobuf:"varint,4,opt,name=stdout,proto3" json:"stdout,omitempty"` // Whether to stream stderr. // One of `stdin`, `stdout`, and `stderr` MUST be true. // If `tty` is true, `stderr` MUST be false. Multiplexing is not supported // in this case. The output of stdout and stderr will be combined to a // single stream. Stderr bool `protobuf:"varint,5,opt,name=stderr,proto3" json:"stderr,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AttachRequest) Reset() { *m = AttachRequest{} } func (*AttachRequest) ProtoMessage() {} func (*AttachRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{64} } func (m *AttachRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AttachRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AttachRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *AttachRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_AttachRequest.Merge(m, src) } func (m *AttachRequest) XXX_Size() int { return m.Size() } func (m *AttachRequest) XXX_DiscardUnknown() { xxx_messageInfo_AttachRequest.DiscardUnknown(m) } var xxx_messageInfo_AttachRequest proto.InternalMessageInfo func (m *AttachRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } func (m *AttachRequest) GetStdin() bool { if m != nil { return m.Stdin } return false } func (m *AttachRequest) GetTty() bool { if m != nil { return m.Tty } return false } func (m *AttachRequest) GetStdout() bool { if m != nil { return m.Stdout } return false } func (m *AttachRequest) GetStderr() bool { if m != nil { return m.Stderr } return false } type AttachResponse struct { // Fully qualified URL of the attach streaming server. Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AttachResponse) Reset() { *m = AttachResponse{} } func (*AttachResponse) ProtoMessage() {} func (*AttachResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{65} } func (m *AttachResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AttachResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AttachResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *AttachResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_AttachResponse.Merge(m, src) } func (m *AttachResponse) XXX_Size() int { return m.Size() } func (m *AttachResponse) XXX_DiscardUnknown() { xxx_messageInfo_AttachResponse.DiscardUnknown(m) } var xxx_messageInfo_AttachResponse proto.InternalMessageInfo func (m *AttachResponse) GetUrl() string { if m != nil { return m.Url } return "" } type PortForwardRequest struct { // ID of the container to which to forward the port. PodSandboxId string `protobuf:"bytes,1,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // Port to forward. Port []int32 `protobuf:"varint,2,rep,packed,name=port,proto3" json:"port,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PortForwardRequest) Reset() { *m = PortForwardRequest{} } func (*PortForwardRequest) ProtoMessage() {} func (*PortForwardRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{66} } func (m *PortForwardRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PortForwardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PortForwardRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PortForwardRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_PortForwardRequest.Merge(m, src) } func (m *PortForwardRequest) XXX_Size() int { return m.Size() } func (m *PortForwardRequest) XXX_DiscardUnknown() { xxx_messageInfo_PortForwardRequest.DiscardUnknown(m) } var xxx_messageInfo_PortForwardRequest proto.InternalMessageInfo func (m *PortForwardRequest) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *PortForwardRequest) GetPort() []int32 { if m != nil { return m.Port } return nil } type PortForwardResponse struct { // Fully qualified URL of the port-forward streaming server. Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PortForwardResponse) Reset() { *m = PortForwardResponse{} } func (*PortForwardResponse) ProtoMessage() {} func (*PortForwardResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{67} } func (m *PortForwardResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PortForwardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PortForwardResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PortForwardResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_PortForwardResponse.Merge(m, src) } func (m *PortForwardResponse) XXX_Size() int { return m.Size() } func (m *PortForwardResponse) XXX_DiscardUnknown() { xxx_messageInfo_PortForwardResponse.DiscardUnknown(m) } var xxx_messageInfo_PortForwardResponse proto.InternalMessageInfo func (m *PortForwardResponse) GetUrl() string { if m != nil { return m.Url } return "" } type ImageFilter struct { // Spec of the image. Image *ImageSpec `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ImageFilter) Reset() { *m = ImageFilter{} } func (*ImageFilter) ProtoMessage() {} func (*ImageFilter) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{68} } func (m *ImageFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ImageFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ImageFilter.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ImageFilter) XXX_Merge(src proto.Message) { xxx_messageInfo_ImageFilter.Merge(m, src) } func (m *ImageFilter) XXX_Size() int { return m.Size() } func (m *ImageFilter) XXX_DiscardUnknown() { xxx_messageInfo_ImageFilter.DiscardUnknown(m) } var xxx_messageInfo_ImageFilter proto.InternalMessageInfo func (m *ImageFilter) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } type ListImagesRequest struct { // Filter to list images. Filter *ImageFilter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListImagesRequest) Reset() { *m = ListImagesRequest{} } func (*ListImagesRequest) ProtoMessage() {} func (*ListImagesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{69} } func (m *ListImagesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListImagesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListImagesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListImagesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListImagesRequest.Merge(m, src) } func (m *ListImagesRequest) XXX_Size() int { return m.Size() } func (m *ListImagesRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListImagesRequest.DiscardUnknown(m) } var xxx_messageInfo_ListImagesRequest proto.InternalMessageInfo func (m *ListImagesRequest) GetFilter() *ImageFilter { if m != nil { return m.Filter } return nil } // Basic information about a container image. type Image struct { // ID of the image. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Other names by which this image is known. RepoTags []string `protobuf:"bytes,2,rep,name=repo_tags,json=repoTags,proto3" json:"repo_tags,omitempty"` // Digests by which this image is known. RepoDigests []string `protobuf:"bytes,3,rep,name=repo_digests,json=repoDigests,proto3" json:"repo_digests,omitempty"` // Size of the image in bytes. Must be > 0. Size_ uint64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` // UID that will run the command(s). This is used as a default if no user is // specified when creating the container. UID and the following user name // are mutually exclusive. Uid *Int64Value `protobuf:"bytes,5,opt,name=uid,proto3" json:"uid,omitempty"` // User name that will run the command(s). This is used if UID is not set // and no user is specified when creating container. Username string `protobuf:"bytes,6,opt,name=username,proto3" json:"username,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Image) Reset() { *m = Image{} } func (*Image) ProtoMessage() {} func (*Image) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{70} } func (m *Image) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Image) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Image.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Image) XXX_Merge(src proto.Message) { xxx_messageInfo_Image.Merge(m, src) } func (m *Image) XXX_Size() int { return m.Size() } func (m *Image) XXX_DiscardUnknown() { xxx_messageInfo_Image.DiscardUnknown(m) } var xxx_messageInfo_Image proto.InternalMessageInfo func (m *Image) GetId() string { if m != nil { return m.Id } return "" } func (m *Image) GetRepoTags() []string { if m != nil { return m.RepoTags } return nil } func (m *Image) GetRepoDigests() []string { if m != nil { return m.RepoDigests } return nil } func (m *Image) GetSize_() uint64 { if m != nil { return m.Size_ } return 0 } func (m *Image) GetUid() *Int64Value { if m != nil { return m.Uid } return nil } func (m *Image) GetUsername() string { if m != nil { return m.Username } return "" } type ListImagesResponse struct { // List of images. Images []*Image `protobuf:"bytes,1,rep,name=images,proto3" json:"images,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListImagesResponse) Reset() { *m = ListImagesResponse{} } func (*ListImagesResponse) ProtoMessage() {} func (*ListImagesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{71} } func (m *ListImagesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListImagesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListImagesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListImagesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ListImagesResponse.Merge(m, src) } func (m *ListImagesResponse) XXX_Size() int { return m.Size() } func (m *ListImagesResponse) XXX_DiscardUnknown() { xxx_messageInfo_ListImagesResponse.DiscardUnknown(m) } var xxx_messageInfo_ListImagesResponse proto.InternalMessageInfo func (m *ListImagesResponse) GetImages() []*Image { if m != nil { return m.Images } return nil } type ImageStatusRequest struct { // Spec of the image. Image *ImageSpec `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` // Verbose indicates whether to return extra information about the image. Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ImageStatusRequest) Reset() { *m = ImageStatusRequest{} } func (*ImageStatusRequest) ProtoMessage() {} func (*ImageStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{72} } func (m *ImageStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ImageStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ImageStatusRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ImageStatusRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ImageStatusRequest.Merge(m, src) } func (m *ImageStatusRequest) XXX_Size() int { return m.Size() } func (m *ImageStatusRequest) XXX_DiscardUnknown() { xxx_messageInfo_ImageStatusRequest.DiscardUnknown(m) } var xxx_messageInfo_ImageStatusRequest proto.InternalMessageInfo func (m *ImageStatusRequest) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } func (m *ImageStatusRequest) GetVerbose() bool { if m != nil { return m.Verbose } return false } type ImageStatusResponse struct { // Status of the image. Image *Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` // Info is extra information of the Image. The key could be arbitrary string, and // value should be in json format. The information could include anything useful // for debug, e.g. image config for oci image based container runtime. // It should only be returned non-empty when Verbose is true. Info map[string]string `protobuf:"bytes,2,rep,name=info,proto3" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ImageStatusResponse) Reset() { *m = ImageStatusResponse{} } func (*ImageStatusResponse) ProtoMessage() {} func (*ImageStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{73} } func (m *ImageStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ImageStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ImageStatusResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ImageStatusResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ImageStatusResponse.Merge(m, src) } func (m *ImageStatusResponse) XXX_Size() int { return m.Size() } func (m *ImageStatusResponse) XXX_DiscardUnknown() { xxx_messageInfo_ImageStatusResponse.DiscardUnknown(m) } var xxx_messageInfo_ImageStatusResponse proto.InternalMessageInfo func (m *ImageStatusResponse) GetImage() *Image { if m != nil { return m.Image } return nil } func (m *ImageStatusResponse) GetInfo() map[string]string { if m != nil { return m.Info } return nil } // AuthConfig contains authorization information for connecting to a registry. type AuthConfig struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Auth string `protobuf:"bytes,3,opt,name=auth,proto3" json:"auth,omitempty"` ServerAddress string `protobuf:"bytes,4,opt,name=server_address,json=serverAddress,proto3" json:"server_address,omitempty"` // IdentityToken is used to authenticate the user and get // an access token for the registry. IdentityToken string `protobuf:"bytes,5,opt,name=identity_token,json=identityToken,proto3" json:"identity_token,omitempty"` // RegistryToken is a bearer token to be sent to a registry RegistryToken string `protobuf:"bytes,6,opt,name=registry_token,json=registryToken,proto3" json:"registry_token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AuthConfig) Reset() { *m = AuthConfig{} } func (*AuthConfig) ProtoMessage() {} func (*AuthConfig) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{74} } func (m *AuthConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AuthConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AuthConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *AuthConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_AuthConfig.Merge(m, src) } func (m *AuthConfig) XXX_Size() int { return m.Size() } func (m *AuthConfig) XXX_DiscardUnknown() { xxx_messageInfo_AuthConfig.DiscardUnknown(m) } var xxx_messageInfo_AuthConfig proto.InternalMessageInfo func (m *AuthConfig) GetUsername() string { if m != nil { return m.Username } return "" } func (m *AuthConfig) GetPassword() string { if m != nil { return m.Password } return "" } func (m *AuthConfig) GetAuth() string { if m != nil { return m.Auth } return "" } func (m *AuthConfig) GetServerAddress() string { if m != nil { return m.ServerAddress } return "" } func (m *AuthConfig) GetIdentityToken() string { if m != nil { return m.IdentityToken } return "" } func (m *AuthConfig) GetRegistryToken() string { if m != nil { return m.RegistryToken } return "" } type PullImageRequest struct { // Spec of the image. Image *ImageSpec `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` // Authentication configuration for pulling the image. Auth *AuthConfig `protobuf:"bytes,2,opt,name=auth,proto3" json:"auth,omitempty"` // Config of the PodSandbox, which is used to pull image in PodSandbox context. SandboxConfig *PodSandboxConfig `protobuf:"bytes,3,opt,name=sandbox_config,json=sandboxConfig,proto3" json:"sandbox_config,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PullImageRequest) Reset() { *m = PullImageRequest{} } func (*PullImageRequest) ProtoMessage() {} func (*PullImageRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{75} } func (m *PullImageRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PullImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PullImageRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PullImageRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_PullImageRequest.Merge(m, src) } func (m *PullImageRequest) XXX_Size() int { return m.Size() } func (m *PullImageRequest) XXX_DiscardUnknown() { xxx_messageInfo_PullImageRequest.DiscardUnknown(m) } var xxx_messageInfo_PullImageRequest proto.InternalMessageInfo func (m *PullImageRequest) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } func (m *PullImageRequest) GetAuth() *AuthConfig { if m != nil { return m.Auth } return nil } func (m *PullImageRequest) GetSandboxConfig() *PodSandboxConfig { if m != nil { return m.SandboxConfig } return nil } type PullImageResponse struct { // Reference to the image in use. For most runtimes, this should be an // image ID or digest. ImageRef string `protobuf:"bytes,1,opt,name=image_ref,json=imageRef,proto3" json:"image_ref,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PullImageResponse) Reset() { *m = PullImageResponse{} } func (*PullImageResponse) ProtoMessage() {} func (*PullImageResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{76} } func (m *PullImageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PullImageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PullImageResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PullImageResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_PullImageResponse.Merge(m, src) } func (m *PullImageResponse) XXX_Size() int { return m.Size() } func (m *PullImageResponse) XXX_DiscardUnknown() { xxx_messageInfo_PullImageResponse.DiscardUnknown(m) } var xxx_messageInfo_PullImageResponse proto.InternalMessageInfo func (m *PullImageResponse) GetImageRef() string { if m != nil { return m.ImageRef } return "" } type RemoveImageRequest struct { // Spec of the image to remove. Image *ImageSpec `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RemoveImageRequest) Reset() { *m = RemoveImageRequest{} } func (*RemoveImageRequest) ProtoMessage() {} func (*RemoveImageRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{77} } func (m *RemoveImageRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RemoveImageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RemoveImageRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RemoveImageRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_RemoveImageRequest.Merge(m, src) } func (m *RemoveImageRequest) XXX_Size() int { return m.Size() } func (m *RemoveImageRequest) XXX_DiscardUnknown() { xxx_messageInfo_RemoveImageRequest.DiscardUnknown(m) } var xxx_messageInfo_RemoveImageRequest proto.InternalMessageInfo func (m *RemoveImageRequest) GetImage() *ImageSpec { if m != nil { return m.Image } return nil } type RemoveImageResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RemoveImageResponse) Reset() { *m = RemoveImageResponse{} } func (*RemoveImageResponse) ProtoMessage() {} func (*RemoveImageResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{78} } func (m *RemoveImageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RemoveImageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RemoveImageResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RemoveImageResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_RemoveImageResponse.Merge(m, src) } func (m *RemoveImageResponse) XXX_Size() int { return m.Size() } func (m *RemoveImageResponse) XXX_DiscardUnknown() { xxx_messageInfo_RemoveImageResponse.DiscardUnknown(m) } var xxx_messageInfo_RemoveImageResponse proto.InternalMessageInfo type NetworkConfig struct { // CIDR to use for pod IP addresses. If the CIDR is empty, runtimes // should omit it. PodCidr string `protobuf:"bytes,1,opt,name=pod_cidr,json=podCidr,proto3" json:"pod_cidr,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NetworkConfig) Reset() { *m = NetworkConfig{} } func (*NetworkConfig) ProtoMessage() {} func (*NetworkConfig) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{79} } func (m *NetworkConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NetworkConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NetworkConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NetworkConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_NetworkConfig.Merge(m, src) } func (m *NetworkConfig) XXX_Size() int { return m.Size() } func (m *NetworkConfig) XXX_DiscardUnknown() { xxx_messageInfo_NetworkConfig.DiscardUnknown(m) } var xxx_messageInfo_NetworkConfig proto.InternalMessageInfo func (m *NetworkConfig) GetPodCidr() string { if m != nil { return m.PodCidr } return "" } type RuntimeConfig struct { NetworkConfig *NetworkConfig `protobuf:"bytes,1,opt,name=network_config,json=networkConfig,proto3" json:"network_config,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RuntimeConfig) Reset() { *m = RuntimeConfig{} } func (*RuntimeConfig) ProtoMessage() {} func (*RuntimeConfig) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{80} } func (m *RuntimeConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RuntimeConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RuntimeConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RuntimeConfig) XXX_Merge(src proto.Message) { xxx_messageInfo_RuntimeConfig.Merge(m, src) } func (m *RuntimeConfig) XXX_Size() int { return m.Size() } func (m *RuntimeConfig) XXX_DiscardUnknown() { xxx_messageInfo_RuntimeConfig.DiscardUnknown(m) } var xxx_messageInfo_RuntimeConfig proto.InternalMessageInfo func (m *RuntimeConfig) GetNetworkConfig() *NetworkConfig { if m != nil { return m.NetworkConfig } return nil } type UpdateRuntimeConfigRequest struct { RuntimeConfig *RuntimeConfig `protobuf:"bytes,1,opt,name=runtime_config,json=runtimeConfig,proto3" json:"runtime_config,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *UpdateRuntimeConfigRequest) Reset() { *m = UpdateRuntimeConfigRequest{} } func (*UpdateRuntimeConfigRequest) ProtoMessage() {} func (*UpdateRuntimeConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{81} } func (m *UpdateRuntimeConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *UpdateRuntimeConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_UpdateRuntimeConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *UpdateRuntimeConfigRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_UpdateRuntimeConfigRequest.Merge(m, src) } func (m *UpdateRuntimeConfigRequest) XXX_Size() int { return m.Size() } func (m *UpdateRuntimeConfigRequest) XXX_DiscardUnknown() { xxx_messageInfo_UpdateRuntimeConfigRequest.DiscardUnknown(m) } var xxx_messageInfo_UpdateRuntimeConfigRequest proto.InternalMessageInfo func (m *UpdateRuntimeConfigRequest) GetRuntimeConfig() *RuntimeConfig { if m != nil { return m.RuntimeConfig } return nil } type UpdateRuntimeConfigResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *UpdateRuntimeConfigResponse) Reset() { *m = UpdateRuntimeConfigResponse{} } func (*UpdateRuntimeConfigResponse) ProtoMessage() {} func (*UpdateRuntimeConfigResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{82} } func (m *UpdateRuntimeConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *UpdateRuntimeConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_UpdateRuntimeConfigResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *UpdateRuntimeConfigResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_UpdateRuntimeConfigResponse.Merge(m, src) } func (m *UpdateRuntimeConfigResponse) XXX_Size() int { return m.Size() } func (m *UpdateRuntimeConfigResponse) XXX_DiscardUnknown() { xxx_messageInfo_UpdateRuntimeConfigResponse.DiscardUnknown(m) } var xxx_messageInfo_UpdateRuntimeConfigResponse proto.InternalMessageInfo // RuntimeCondition contains condition information for the runtime. // There are 2 kinds of runtime conditions: // 1. Required conditions: Conditions are required for kubelet to work // properly. If any required condition is unmet, the node will be not ready. // The required conditions include: // * RuntimeReady: RuntimeReady means the runtime is up and ready to accept // basic containers e.g. container only needs host network. // * NetworkReady: NetworkReady means the runtime network is up and ready to // accept containers which require container network. // 2. Optional conditions: Conditions are informative to the user, but kubelet // will not rely on. Since condition type is an arbitrary string, all conditions // not required are optional. These conditions will be exposed to users to help // them understand the status of the system. type RuntimeCondition struct { // Type of runtime condition. Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Status of the condition, one of true/false. Default: false. Status bool `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` // Brief CamelCase string containing reason for the condition's last transition. Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` // Human-readable message indicating details about last transition. Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RuntimeCondition) Reset() { *m = RuntimeCondition{} } func (*RuntimeCondition) ProtoMessage() {} func (*RuntimeCondition) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{83} } func (m *RuntimeCondition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RuntimeCondition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RuntimeCondition.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RuntimeCondition) XXX_Merge(src proto.Message) { xxx_messageInfo_RuntimeCondition.Merge(m, src) } func (m *RuntimeCondition) XXX_Size() int { return m.Size() } func (m *RuntimeCondition) XXX_DiscardUnknown() { xxx_messageInfo_RuntimeCondition.DiscardUnknown(m) } var xxx_messageInfo_RuntimeCondition proto.InternalMessageInfo func (m *RuntimeCondition) GetType() string { if m != nil { return m.Type } return "" } func (m *RuntimeCondition) GetStatus() bool { if m != nil { return m.Status } return false } func (m *RuntimeCondition) GetReason() string { if m != nil { return m.Reason } return "" } func (m *RuntimeCondition) GetMessage() string { if m != nil { return m.Message } return "" } // RuntimeStatus is information about the current status of the runtime. type RuntimeStatus struct { // List of current observed runtime conditions. Conditions []*RuntimeCondition `protobuf:"bytes,1,rep,name=conditions,proto3" json:"conditions,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RuntimeStatus) Reset() { *m = RuntimeStatus{} } func (*RuntimeStatus) ProtoMessage() {} func (*RuntimeStatus) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{84} } func (m *RuntimeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RuntimeStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RuntimeStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RuntimeStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_RuntimeStatus.Merge(m, src) } func (m *RuntimeStatus) XXX_Size() int { return m.Size() } func (m *RuntimeStatus) XXX_DiscardUnknown() { xxx_messageInfo_RuntimeStatus.DiscardUnknown(m) } var xxx_messageInfo_RuntimeStatus proto.InternalMessageInfo func (m *RuntimeStatus) GetConditions() []*RuntimeCondition { if m != nil { return m.Conditions } return nil } type StatusRequest struct { // Verbose indicates whether to return extra information about the runtime. Verbose bool `protobuf:"varint,1,opt,name=verbose,proto3" json:"verbose,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *StatusRequest) Reset() { *m = StatusRequest{} } func (*StatusRequest) ProtoMessage() {} func (*StatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{85} } func (m *StatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *StatusRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_StatusRequest.Merge(m, src) } func (m *StatusRequest) XXX_Size() int { return m.Size() } func (m *StatusRequest) XXX_DiscardUnknown() { xxx_messageInfo_StatusRequest.DiscardUnknown(m) } var xxx_messageInfo_StatusRequest proto.InternalMessageInfo func (m *StatusRequest) GetVerbose() bool { if m != nil { return m.Verbose } return false } type StatusResponse struct { // Status of the Runtime. Status *RuntimeStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` // Info is extra information of the Runtime. The key could be arbitrary string, and // value should be in json format. The information could include anything useful for // debug, e.g. plugins used by the container runtime. // It should only be returned non-empty when Verbose is true. Info map[string]string `protobuf:"bytes,2,rep,name=info,proto3" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *StatusResponse) Reset() { *m = StatusResponse{} } func (*StatusResponse) ProtoMessage() {} func (*StatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{86} } func (m *StatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *StatusResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_StatusResponse.Merge(m, src) } func (m *StatusResponse) XXX_Size() int { return m.Size() } func (m *StatusResponse) XXX_DiscardUnknown() { xxx_messageInfo_StatusResponse.DiscardUnknown(m) } var xxx_messageInfo_StatusResponse proto.InternalMessageInfo func (m *StatusResponse) GetStatus() *RuntimeStatus { if m != nil { return m.Status } return nil } func (m *StatusResponse) GetInfo() map[string]string { if m != nil { return m.Info } return nil } type ImageFsInfoRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ImageFsInfoRequest) Reset() { *m = ImageFsInfoRequest{} } func (*ImageFsInfoRequest) ProtoMessage() {} func (*ImageFsInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{87} } func (m *ImageFsInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ImageFsInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ImageFsInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ImageFsInfoRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ImageFsInfoRequest.Merge(m, src) } func (m *ImageFsInfoRequest) XXX_Size() int { return m.Size() } func (m *ImageFsInfoRequest) XXX_DiscardUnknown() { xxx_messageInfo_ImageFsInfoRequest.DiscardUnknown(m) } var xxx_messageInfo_ImageFsInfoRequest proto.InternalMessageInfo // UInt64Value is the wrapper of uint64. type UInt64Value struct { // The value. Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *UInt64Value) Reset() { *m = UInt64Value{} } func (*UInt64Value) ProtoMessage() {} func (*UInt64Value) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{88} } func (m *UInt64Value) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *UInt64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *UInt64Value) XXX_Merge(src proto.Message) { xxx_messageInfo_UInt64Value.Merge(m, src) } func (m *UInt64Value) XXX_Size() int { return m.Size() } func (m *UInt64Value) XXX_DiscardUnknown() { xxx_messageInfo_UInt64Value.DiscardUnknown(m) } var xxx_messageInfo_UInt64Value proto.InternalMessageInfo func (m *UInt64Value) GetValue() uint64 { if m != nil { return m.Value } return 0 } // FilesystemIdentifier uniquely identify the filesystem. type FilesystemIdentifier struct { // Mountpoint of a filesystem. Mountpoint string `protobuf:"bytes,1,opt,name=mountpoint,proto3" json:"mountpoint,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *FilesystemIdentifier) Reset() { *m = FilesystemIdentifier{} } func (*FilesystemIdentifier) ProtoMessage() {} func (*FilesystemIdentifier) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{89} } func (m *FilesystemIdentifier) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *FilesystemIdentifier) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_FilesystemIdentifier.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *FilesystemIdentifier) XXX_Merge(src proto.Message) { xxx_messageInfo_FilesystemIdentifier.Merge(m, src) } func (m *FilesystemIdentifier) XXX_Size() int { return m.Size() } func (m *FilesystemIdentifier) XXX_DiscardUnknown() { xxx_messageInfo_FilesystemIdentifier.DiscardUnknown(m) } var xxx_messageInfo_FilesystemIdentifier proto.InternalMessageInfo func (m *FilesystemIdentifier) GetMountpoint() string { if m != nil { return m.Mountpoint } return "" } // FilesystemUsage provides the filesystem usage information. type FilesystemUsage struct { // Timestamp in nanoseconds at which the information were collected. Must be > 0. Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // The unique identifier of the filesystem. FsId *FilesystemIdentifier `protobuf:"bytes,2,opt,name=fs_id,json=fsId,proto3" json:"fs_id,omitempty"` // UsedBytes represents the bytes used for images on the filesystem. // This may differ from the total bytes used on the filesystem and may not // equal CapacityBytes - AvailableBytes. UsedBytes *UInt64Value `protobuf:"bytes,3,opt,name=used_bytes,json=usedBytes,proto3" json:"used_bytes,omitempty"` // InodesUsed represents the inodes used by the images. // This may not equal InodesCapacity - InodesAvailable because the underlying // filesystem may also be used for purposes other than storing images. InodesUsed *UInt64Value `protobuf:"bytes,4,opt,name=inodes_used,json=inodesUsed,proto3" json:"inodes_used,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *FilesystemUsage) Reset() { *m = FilesystemUsage{} } func (*FilesystemUsage) ProtoMessage() {} func (*FilesystemUsage) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{90} } func (m *FilesystemUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *FilesystemUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_FilesystemUsage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *FilesystemUsage) XXX_Merge(src proto.Message) { xxx_messageInfo_FilesystemUsage.Merge(m, src) } func (m *FilesystemUsage) XXX_Size() int { return m.Size() } func (m *FilesystemUsage) XXX_DiscardUnknown() { xxx_messageInfo_FilesystemUsage.DiscardUnknown(m) } var xxx_messageInfo_FilesystemUsage proto.InternalMessageInfo func (m *FilesystemUsage) GetTimestamp() int64 { if m != nil { return m.Timestamp } return 0 } func (m *FilesystemUsage) GetFsId() *FilesystemIdentifier { if m != nil { return m.FsId } return nil } func (m *FilesystemUsage) GetUsedBytes() *UInt64Value { if m != nil { return m.UsedBytes } return nil } func (m *FilesystemUsage) GetInodesUsed() *UInt64Value { if m != nil { return m.InodesUsed } return nil } type ImageFsInfoResponse struct { // Information of image filesystem(s). ImageFilesystems []*FilesystemUsage `protobuf:"bytes,1,rep,name=image_filesystems,json=imageFilesystems,proto3" json:"image_filesystems,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ImageFsInfoResponse) Reset() { *m = ImageFsInfoResponse{} } func (*ImageFsInfoResponse) ProtoMessage() {} func (*ImageFsInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{91} } func (m *ImageFsInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ImageFsInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ImageFsInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ImageFsInfoResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ImageFsInfoResponse.Merge(m, src) } func (m *ImageFsInfoResponse) XXX_Size() int { return m.Size() } func (m *ImageFsInfoResponse) XXX_DiscardUnknown() { xxx_messageInfo_ImageFsInfoResponse.DiscardUnknown(m) } var xxx_messageInfo_ImageFsInfoResponse proto.InternalMessageInfo func (m *ImageFsInfoResponse) GetImageFilesystems() []*FilesystemUsage { if m != nil { return m.ImageFilesystems } return nil } type ContainerStatsRequest struct { // ID of the container for which to retrieve stats. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerStatsRequest) Reset() { *m = ContainerStatsRequest{} } func (*ContainerStatsRequest) ProtoMessage() {} func (*ContainerStatsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{92} } func (m *ContainerStatsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerStatsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerStatsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerStatsRequest.Merge(m, src) } func (m *ContainerStatsRequest) XXX_Size() int { return m.Size() } func (m *ContainerStatsRequest) XXX_DiscardUnknown() { xxx_messageInfo_ContainerStatsRequest.DiscardUnknown(m) } var xxx_messageInfo_ContainerStatsRequest proto.InternalMessageInfo func (m *ContainerStatsRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } type ContainerStatsResponse struct { // Stats of the container. Stats *ContainerStats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerStatsResponse) Reset() { *m = ContainerStatsResponse{} } func (*ContainerStatsResponse) ProtoMessage() {} func (*ContainerStatsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{93} } func (m *ContainerStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerStatsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerStatsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerStatsResponse.Merge(m, src) } func (m *ContainerStatsResponse) XXX_Size() int { return m.Size() } func (m *ContainerStatsResponse) XXX_DiscardUnknown() { xxx_messageInfo_ContainerStatsResponse.DiscardUnknown(m) } var xxx_messageInfo_ContainerStatsResponse proto.InternalMessageInfo func (m *ContainerStatsResponse) GetStats() *ContainerStats { if m != nil { return m.Stats } return nil } type ListContainerStatsRequest struct { // Filter for the list request. Filter *ContainerStatsFilter `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListContainerStatsRequest) Reset() { *m = ListContainerStatsRequest{} } func (*ListContainerStatsRequest) ProtoMessage() {} func (*ListContainerStatsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{94} } func (m *ListContainerStatsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListContainerStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListContainerStatsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListContainerStatsRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListContainerStatsRequest.Merge(m, src) } func (m *ListContainerStatsRequest) XXX_Size() int { return m.Size() } func (m *ListContainerStatsRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListContainerStatsRequest.DiscardUnknown(m) } var xxx_messageInfo_ListContainerStatsRequest proto.InternalMessageInfo func (m *ListContainerStatsRequest) GetFilter() *ContainerStatsFilter { if m != nil { return m.Filter } return nil } // ContainerStatsFilter is used to filter containers. // All those fields are combined with 'AND' type ContainerStatsFilter struct { // ID of the container. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // ID of the PodSandbox. PodSandboxId string `protobuf:"bytes,2,opt,name=pod_sandbox_id,json=podSandboxId,proto3" json:"pod_sandbox_id,omitempty"` // LabelSelector to select matches. // Only api.MatchLabels is supported for now and the requirements // are ANDed. MatchExpressions is not supported yet. LabelSelector map[string]string `protobuf:"bytes,3,rep,name=label_selector,json=labelSelector,proto3" json:"label_selector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerStatsFilter) Reset() { *m = ContainerStatsFilter{} } func (*ContainerStatsFilter) ProtoMessage() {} func (*ContainerStatsFilter) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{95} } func (m *ContainerStatsFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerStatsFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerStatsFilter.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerStatsFilter) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerStatsFilter.Merge(m, src) } func (m *ContainerStatsFilter) XXX_Size() int { return m.Size() } func (m *ContainerStatsFilter) XXX_DiscardUnknown() { xxx_messageInfo_ContainerStatsFilter.DiscardUnknown(m) } var xxx_messageInfo_ContainerStatsFilter proto.InternalMessageInfo func (m *ContainerStatsFilter) GetId() string { if m != nil { return m.Id } return "" } func (m *ContainerStatsFilter) GetPodSandboxId() string { if m != nil { return m.PodSandboxId } return "" } func (m *ContainerStatsFilter) GetLabelSelector() map[string]string { if m != nil { return m.LabelSelector } return nil } type ListContainerStatsResponse struct { // Stats of the container. Stats []*ContainerStats `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListContainerStatsResponse) Reset() { *m = ListContainerStatsResponse{} } func (*ListContainerStatsResponse) ProtoMessage() {} func (*ListContainerStatsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{96} } func (m *ListContainerStatsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListContainerStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListContainerStatsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListContainerStatsResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ListContainerStatsResponse.Merge(m, src) } func (m *ListContainerStatsResponse) XXX_Size() int { return m.Size() } func (m *ListContainerStatsResponse) XXX_DiscardUnknown() { xxx_messageInfo_ListContainerStatsResponse.DiscardUnknown(m) } var xxx_messageInfo_ListContainerStatsResponse proto.InternalMessageInfo func (m *ListContainerStatsResponse) GetStats() []*ContainerStats { if m != nil { return m.Stats } return nil } // ContainerAttributes provides basic information of the container. type ContainerAttributes struct { // ID of the container. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Metadata of the container. Metadata *ContainerMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"` // Key-value pairs that may be used to scope and select individual resources. Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Unstructured key-value map holding arbitrary metadata. // Annotations MUST NOT be altered by the runtime; the value of this field // MUST be identical to that of the corresponding ContainerConfig used to // instantiate the Container this status represents. Annotations map[string]string `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerAttributes) Reset() { *m = ContainerAttributes{} } func (*ContainerAttributes) ProtoMessage() {} func (*ContainerAttributes) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{97} } func (m *ContainerAttributes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerAttributes.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerAttributes) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerAttributes.Merge(m, src) } func (m *ContainerAttributes) XXX_Size() int { return m.Size() } func (m *ContainerAttributes) XXX_DiscardUnknown() { xxx_messageInfo_ContainerAttributes.DiscardUnknown(m) } var xxx_messageInfo_ContainerAttributes proto.InternalMessageInfo func (m *ContainerAttributes) GetId() string { if m != nil { return m.Id } return "" } func (m *ContainerAttributes) GetMetadata() *ContainerMetadata { if m != nil { return m.Metadata } return nil } func (m *ContainerAttributes) GetLabels() map[string]string { if m != nil { return m.Labels } return nil } func (m *ContainerAttributes) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } // ContainerStats provides the resource usage statistics for a container. type ContainerStats struct { // Information of the container. Attributes *ContainerAttributes `protobuf:"bytes,1,opt,name=attributes,proto3" json:"attributes,omitempty"` // CPU usage gathered from the container. Cpu *CpuUsage `protobuf:"bytes,2,opt,name=cpu,proto3" json:"cpu,omitempty"` // Memory usage gathered from the container. Memory *MemoryUsage `protobuf:"bytes,3,opt,name=memory,proto3" json:"memory,omitempty"` // Usage of the writable layer. WritableLayer *FilesystemUsage `protobuf:"bytes,4,opt,name=writable_layer,json=writableLayer,proto3" json:"writable_layer,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerStats) Reset() { *m = ContainerStats{} } func (*ContainerStats) ProtoMessage() {} func (*ContainerStats) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{98} } func (m *ContainerStats) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerStats.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerStats) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerStats.Merge(m, src) } func (m *ContainerStats) XXX_Size() int { return m.Size() } func (m *ContainerStats) XXX_DiscardUnknown() { xxx_messageInfo_ContainerStats.DiscardUnknown(m) } var xxx_messageInfo_ContainerStats proto.InternalMessageInfo func (m *ContainerStats) GetAttributes() *ContainerAttributes { if m != nil { return m.Attributes } return nil } func (m *ContainerStats) GetCpu() *CpuUsage { if m != nil { return m.Cpu } return nil } func (m *ContainerStats) GetMemory() *MemoryUsage { if m != nil { return m.Memory } return nil } func (m *ContainerStats) GetWritableLayer() *FilesystemUsage { if m != nil { return m.WritableLayer } return nil } // CpuUsage provides the CPU usage information. type CpuUsage struct { // Timestamp in nanoseconds at which the information were collected. Must be > 0. Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Cumulative CPU usage (sum across all cores) since object creation. UsageCoreNanoSeconds *UInt64Value `protobuf:"bytes,2,opt,name=usage_core_nano_seconds,json=usageCoreNanoSeconds,proto3" json:"usage_core_nano_seconds,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *CpuUsage) Reset() { *m = CpuUsage{} } func (*CpuUsage) ProtoMessage() {} func (*CpuUsage) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{99} } func (m *CpuUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *CpuUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CpuUsage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *CpuUsage) XXX_Merge(src proto.Message) { xxx_messageInfo_CpuUsage.Merge(m, src) } func (m *CpuUsage) XXX_Size() int { return m.Size() } func (m *CpuUsage) XXX_DiscardUnknown() { xxx_messageInfo_CpuUsage.DiscardUnknown(m) } var xxx_messageInfo_CpuUsage proto.InternalMessageInfo func (m *CpuUsage) GetTimestamp() int64 { if m != nil { return m.Timestamp } return 0 } func (m *CpuUsage) GetUsageCoreNanoSeconds() *UInt64Value { if m != nil { return m.UsageCoreNanoSeconds } return nil } // MemoryUsage provides the memory usage information. type MemoryUsage struct { // Timestamp in nanoseconds at which the information were collected. Must be > 0. Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // The amount of working set memory in bytes. WorkingSetBytes *UInt64Value `protobuf:"bytes,2,opt,name=working_set_bytes,json=workingSetBytes,proto3" json:"working_set_bytes,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *MemoryUsage) Reset() { *m = MemoryUsage{} } func (*MemoryUsage) ProtoMessage() {} func (*MemoryUsage) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{100} } func (m *MemoryUsage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MemoryUsage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MemoryUsage.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *MemoryUsage) XXX_Merge(src proto.Message) { xxx_messageInfo_MemoryUsage.Merge(m, src) } func (m *MemoryUsage) XXX_Size() int { return m.Size() } func (m *MemoryUsage) XXX_DiscardUnknown() { xxx_messageInfo_MemoryUsage.DiscardUnknown(m) } var xxx_messageInfo_MemoryUsage proto.InternalMessageInfo func (m *MemoryUsage) GetTimestamp() int64 { if m != nil { return m.Timestamp } return 0 } func (m *MemoryUsage) GetWorkingSetBytes() *UInt64Value { if m != nil { return m.WorkingSetBytes } return nil } type ReopenContainerLogRequest struct { // ID of the container for which to reopen the log. ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ReopenContainerLogRequest) Reset() { *m = ReopenContainerLogRequest{} } func (*ReopenContainerLogRequest) ProtoMessage() {} func (*ReopenContainerLogRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{101} } func (m *ReopenContainerLogRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ReopenContainerLogRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ReopenContainerLogRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ReopenContainerLogRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ReopenContainerLogRequest.Merge(m, src) } func (m *ReopenContainerLogRequest) XXX_Size() int { return m.Size() } func (m *ReopenContainerLogRequest) XXX_DiscardUnknown() { xxx_messageInfo_ReopenContainerLogRequest.DiscardUnknown(m) } var xxx_messageInfo_ReopenContainerLogRequest proto.InternalMessageInfo func (m *ReopenContainerLogRequest) GetContainerId() string { if m != nil { return m.ContainerId } return "" } type ReopenContainerLogResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ReopenContainerLogResponse) Reset() { *m = ReopenContainerLogResponse{} } func (*ReopenContainerLogResponse) ProtoMessage() {} func (*ReopenContainerLogResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{102} } func (m *ReopenContainerLogResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ReopenContainerLogResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ReopenContainerLogResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ReopenContainerLogResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ReopenContainerLogResponse.Merge(m, src) } func (m *ReopenContainerLogResponse) XXX_Size() int { return m.Size() } func (m *ReopenContainerLogResponse) XXX_DiscardUnknown() { xxx_messageInfo_ReopenContainerLogResponse.DiscardUnknown(m) } var xxx_messageInfo_ReopenContainerLogResponse proto.InternalMessageInfo func init() { proto.RegisterEnum("runtime.v1alpha2.Protocol", Protocol_name, Protocol_value) proto.RegisterEnum("runtime.v1alpha2.MountPropagation", MountPropagation_name, MountPropagation_value) proto.RegisterEnum("runtime.v1alpha2.NamespaceMode", NamespaceMode_name, NamespaceMode_value) proto.RegisterEnum("runtime.v1alpha2.PodSandboxState", PodSandboxState_name, PodSandboxState_value) proto.RegisterEnum("runtime.v1alpha2.ContainerState", ContainerState_name, ContainerState_value) proto.RegisterType((*VersionRequest)(nil), "runtime.v1alpha2.VersionRequest") proto.RegisterType((*VersionResponse)(nil), "runtime.v1alpha2.VersionResponse") proto.RegisterType((*DNSConfig)(nil), "runtime.v1alpha2.DNSConfig") proto.RegisterType((*PortMapping)(nil), "runtime.v1alpha2.PortMapping") proto.RegisterType((*Mount)(nil), "runtime.v1alpha2.Mount") proto.RegisterType((*NamespaceOption)(nil), "runtime.v1alpha2.NamespaceOption") proto.RegisterType((*Int64Value)(nil), "runtime.v1alpha2.Int64Value") proto.RegisterType((*LinuxSandboxSecurityContext)(nil), "runtime.v1alpha2.LinuxSandboxSecurityContext") proto.RegisterType((*LinuxPodSandboxConfig)(nil), "runtime.v1alpha2.LinuxPodSandboxConfig") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.LinuxPodSandboxConfig.SysctlsEntry") proto.RegisterType((*PodSandboxMetadata)(nil), "runtime.v1alpha2.PodSandboxMetadata") proto.RegisterType((*PodSandboxConfig)(nil), "runtime.v1alpha2.PodSandboxConfig") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandboxConfig.AnnotationsEntry") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandboxConfig.LabelsEntry") proto.RegisterType((*RunPodSandboxRequest)(nil), "runtime.v1alpha2.RunPodSandboxRequest") proto.RegisterType((*RunPodSandboxResponse)(nil), "runtime.v1alpha2.RunPodSandboxResponse") proto.RegisterType((*StopPodSandboxRequest)(nil), "runtime.v1alpha2.StopPodSandboxRequest") proto.RegisterType((*StopPodSandboxResponse)(nil), "runtime.v1alpha2.StopPodSandboxResponse") proto.RegisterType((*RemovePodSandboxRequest)(nil), "runtime.v1alpha2.RemovePodSandboxRequest") proto.RegisterType((*RemovePodSandboxResponse)(nil), "runtime.v1alpha2.RemovePodSandboxResponse") proto.RegisterType((*PodSandboxStatusRequest)(nil), "runtime.v1alpha2.PodSandboxStatusRequest") proto.RegisterType((*PodIP)(nil), "runtime.v1alpha2.PodIP") proto.RegisterType((*PodSandboxNetworkStatus)(nil), "runtime.v1alpha2.PodSandboxNetworkStatus") proto.RegisterType((*Namespace)(nil), "runtime.v1alpha2.Namespace") proto.RegisterType((*LinuxPodSandboxStatus)(nil), "runtime.v1alpha2.LinuxPodSandboxStatus") proto.RegisterType((*PodSandboxStatus)(nil), "runtime.v1alpha2.PodSandboxStatus") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandboxStatus.AnnotationsEntry") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandboxStatus.LabelsEntry") proto.RegisterType((*PodSandboxStatusResponse)(nil), "runtime.v1alpha2.PodSandboxStatusResponse") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandboxStatusResponse.InfoEntry") proto.RegisterType((*PodSandboxStateValue)(nil), "runtime.v1alpha2.PodSandboxStateValue") proto.RegisterType((*PodSandboxFilter)(nil), "runtime.v1alpha2.PodSandboxFilter") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandboxFilter.LabelSelectorEntry") proto.RegisterType((*ListPodSandboxRequest)(nil), "runtime.v1alpha2.ListPodSandboxRequest") proto.RegisterType((*PodSandbox)(nil), "runtime.v1alpha2.PodSandbox") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandbox.AnnotationsEntry") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.PodSandbox.LabelsEntry") proto.RegisterType((*ListPodSandboxResponse)(nil), "runtime.v1alpha2.ListPodSandboxResponse") proto.RegisterType((*ImageSpec)(nil), "runtime.v1alpha2.ImageSpec") proto.RegisterType((*KeyValue)(nil), "runtime.v1alpha2.KeyValue") proto.RegisterType((*LinuxContainerResources)(nil), "runtime.v1alpha2.LinuxContainerResources") proto.RegisterType((*SELinuxOption)(nil), "runtime.v1alpha2.SELinuxOption") proto.RegisterType((*Capability)(nil), "runtime.v1alpha2.Capability") proto.RegisterType((*LinuxContainerSecurityContext)(nil), "runtime.v1alpha2.LinuxContainerSecurityContext") proto.RegisterType((*LinuxContainerConfig)(nil), "runtime.v1alpha2.LinuxContainerConfig") proto.RegisterType((*WindowsContainerSecurityContext)(nil), "runtime.v1alpha2.WindowsContainerSecurityContext") proto.RegisterType((*WindowsContainerConfig)(nil), "runtime.v1alpha2.WindowsContainerConfig") proto.RegisterType((*WindowsContainerResources)(nil), "runtime.v1alpha2.WindowsContainerResources") proto.RegisterType((*ContainerMetadata)(nil), "runtime.v1alpha2.ContainerMetadata") proto.RegisterType((*Device)(nil), "runtime.v1alpha2.Device") proto.RegisterType((*ContainerConfig)(nil), "runtime.v1alpha2.ContainerConfig") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ContainerConfig.AnnotationsEntry") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ContainerConfig.LabelsEntry") proto.RegisterType((*CreateContainerRequest)(nil), "runtime.v1alpha2.CreateContainerRequest") proto.RegisterType((*CreateContainerResponse)(nil), "runtime.v1alpha2.CreateContainerResponse") proto.RegisterType((*StartContainerRequest)(nil), "runtime.v1alpha2.StartContainerRequest") proto.RegisterType((*StartContainerResponse)(nil), "runtime.v1alpha2.StartContainerResponse") proto.RegisterType((*StopContainerRequest)(nil), "runtime.v1alpha2.StopContainerRequest") proto.RegisterType((*StopContainerResponse)(nil), "runtime.v1alpha2.StopContainerResponse") proto.RegisterType((*RemoveContainerRequest)(nil), "runtime.v1alpha2.RemoveContainerRequest") proto.RegisterType((*RemoveContainerResponse)(nil), "runtime.v1alpha2.RemoveContainerResponse") proto.RegisterType((*ContainerStateValue)(nil), "runtime.v1alpha2.ContainerStateValue") proto.RegisterType((*ContainerFilter)(nil), "runtime.v1alpha2.ContainerFilter") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ContainerFilter.LabelSelectorEntry") proto.RegisterType((*ListContainersRequest)(nil), "runtime.v1alpha2.ListContainersRequest") proto.RegisterType((*Container)(nil), "runtime.v1alpha2.Container") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.Container.AnnotationsEntry") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.Container.LabelsEntry") proto.RegisterType((*ListContainersResponse)(nil), "runtime.v1alpha2.ListContainersResponse") proto.RegisterType((*ContainerStatusRequest)(nil), "runtime.v1alpha2.ContainerStatusRequest") proto.RegisterType((*ContainerStatus)(nil), "runtime.v1alpha2.ContainerStatus") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ContainerStatus.AnnotationsEntry") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ContainerStatus.LabelsEntry") proto.RegisterType((*ContainerStatusResponse)(nil), "runtime.v1alpha2.ContainerStatusResponse") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ContainerStatusResponse.InfoEntry") proto.RegisterType((*UpdateContainerResourcesRequest)(nil), "runtime.v1alpha2.UpdateContainerResourcesRequest") proto.RegisterType((*UpdateContainerResourcesResponse)(nil), "runtime.v1alpha2.UpdateContainerResourcesResponse") proto.RegisterType((*ExecSyncRequest)(nil), "runtime.v1alpha2.ExecSyncRequest") proto.RegisterType((*ExecSyncResponse)(nil), "runtime.v1alpha2.ExecSyncResponse") proto.RegisterType((*ExecRequest)(nil), "runtime.v1alpha2.ExecRequest") proto.RegisterType((*ExecResponse)(nil), "runtime.v1alpha2.ExecResponse") proto.RegisterType((*AttachRequest)(nil), "runtime.v1alpha2.AttachRequest") proto.RegisterType((*AttachResponse)(nil), "runtime.v1alpha2.AttachResponse") proto.RegisterType((*PortForwardRequest)(nil), "runtime.v1alpha2.PortForwardRequest") proto.RegisterType((*PortForwardResponse)(nil), "runtime.v1alpha2.PortForwardResponse") proto.RegisterType((*ImageFilter)(nil), "runtime.v1alpha2.ImageFilter") proto.RegisterType((*ListImagesRequest)(nil), "runtime.v1alpha2.ListImagesRequest") proto.RegisterType((*Image)(nil), "runtime.v1alpha2.Image") proto.RegisterType((*ListImagesResponse)(nil), "runtime.v1alpha2.ListImagesResponse") proto.RegisterType((*ImageStatusRequest)(nil), "runtime.v1alpha2.ImageStatusRequest") proto.RegisterType((*ImageStatusResponse)(nil), "runtime.v1alpha2.ImageStatusResponse") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ImageStatusResponse.InfoEntry") proto.RegisterType((*AuthConfig)(nil), "runtime.v1alpha2.AuthConfig") proto.RegisterType((*PullImageRequest)(nil), "runtime.v1alpha2.PullImageRequest") proto.RegisterType((*PullImageResponse)(nil), "runtime.v1alpha2.PullImageResponse") proto.RegisterType((*RemoveImageRequest)(nil), "runtime.v1alpha2.RemoveImageRequest") proto.RegisterType((*RemoveImageResponse)(nil), "runtime.v1alpha2.RemoveImageResponse") proto.RegisterType((*NetworkConfig)(nil), "runtime.v1alpha2.NetworkConfig") proto.RegisterType((*RuntimeConfig)(nil), "runtime.v1alpha2.RuntimeConfig") proto.RegisterType((*UpdateRuntimeConfigRequest)(nil), "runtime.v1alpha2.UpdateRuntimeConfigRequest") proto.RegisterType((*UpdateRuntimeConfigResponse)(nil), "runtime.v1alpha2.UpdateRuntimeConfigResponse") proto.RegisterType((*RuntimeCondition)(nil), "runtime.v1alpha2.RuntimeCondition") proto.RegisterType((*RuntimeStatus)(nil), "runtime.v1alpha2.RuntimeStatus") proto.RegisterType((*StatusRequest)(nil), "runtime.v1alpha2.StatusRequest") proto.RegisterType((*StatusResponse)(nil), "runtime.v1alpha2.StatusResponse") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.StatusResponse.InfoEntry") proto.RegisterType((*ImageFsInfoRequest)(nil), "runtime.v1alpha2.ImageFsInfoRequest") proto.RegisterType((*UInt64Value)(nil), "runtime.v1alpha2.UInt64Value") proto.RegisterType((*FilesystemIdentifier)(nil), "runtime.v1alpha2.FilesystemIdentifier") proto.RegisterType((*FilesystemUsage)(nil), "runtime.v1alpha2.FilesystemUsage") proto.RegisterType((*ImageFsInfoResponse)(nil), "runtime.v1alpha2.ImageFsInfoResponse") proto.RegisterType((*ContainerStatsRequest)(nil), "runtime.v1alpha2.ContainerStatsRequest") proto.RegisterType((*ContainerStatsResponse)(nil), "runtime.v1alpha2.ContainerStatsResponse") proto.RegisterType((*ListContainerStatsRequest)(nil), "runtime.v1alpha2.ListContainerStatsRequest") proto.RegisterType((*ContainerStatsFilter)(nil), "runtime.v1alpha2.ContainerStatsFilter") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ContainerStatsFilter.LabelSelectorEntry") proto.RegisterType((*ListContainerStatsResponse)(nil), "runtime.v1alpha2.ListContainerStatsResponse") proto.RegisterType((*ContainerAttributes)(nil), "runtime.v1alpha2.ContainerAttributes") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ContainerAttributes.AnnotationsEntry") proto.RegisterMapType((map[string]string)(nil), "runtime.v1alpha2.ContainerAttributes.LabelsEntry") proto.RegisterType((*ContainerStats)(nil), "runtime.v1alpha2.ContainerStats") proto.RegisterType((*CpuUsage)(nil), "runtime.v1alpha2.CpuUsage") proto.RegisterType((*MemoryUsage)(nil), "runtime.v1alpha2.MemoryUsage") proto.RegisterType((*ReopenContainerLogRequest)(nil), "runtime.v1alpha2.ReopenContainerLogRequest") proto.RegisterType((*ReopenContainerLogResponse)(nil), "runtime.v1alpha2.ReopenContainerLogResponse") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 4770 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5c, 0xcd, 0x6f, 0x1b, 0x49, 0x76, 0x57, 0x93, 0xa2, 0x44, 0x3e, 0x8a, 0x14, 0x55, 0x96, 0x2d, 0x9a, 0x1e, 0x6b, 0xac, 0x9e, 0xf1, 0xe7, 0xcc, 0xc8, 0x63, 0xcd, 0xac, 0x27, 0xb6, 0x67, 0x6d, 0xd3, 0x92, 0x6c, 0x33, 0x6b, 0x53, 0x4c, 0x53, 0x9a, 0x8f, 0x9d, 0x01, 0x7a, 0x5b, 0xec, 0x12, 0xd5, 0x6b, 0xb2, 0xbb, 0xa7, 0xbb, 0x69, 0x5b, 0x09, 0x10, 0x2c, 0xb0, 0xc8, 0x1e, 0x02, 0x04, 0xc8, 0x39, 0xc7, 0xcd, 0x21, 0x87, 0xdc, 0x02, 0x04, 0x39, 0xe4, 0xb4, 0x41, 0x0e, 0x7b, 0x09, 0x90, 0xd3, 0x22, 0x41, 0x2e, 0x99, 0x49, 0x72, 0x09, 0x90, 0x20, 0x7f, 0x40, 0x0e, 0x41, 0x7d, 0xf5, 0x77, 0xf3, 0xc3, 0xe3, 0xdd, 0xd9, 0x9c, 0xd4, 0xf5, 0xfa, 0xbd, 0x57, 0xaf, 0x5f, 0xbd, 0x7a, 0xf5, 0xea, 0x57, 0x45, 0x41, 0x49, 0xb3, 0x8d, 0x4d, 0xdb, 0xb1, 0x3c, 0x0b, 0xd5, 0x9c, 0x91, 0xe9, 0x19, 0x43, 0xbc, 0xf9, 0xfc, 0x86, 0x36, 0xb0, 0x8f, 0xb5, 0xad, 0xc6, 0x7b, 0x7d, 0xc3, 0x3b, 0x1e, 0x1d, 0x6e, 0xf6, 0xac, 0xe1, 0xf5, 0xbe, 0xd5, 0xb7, 0xae, 0x53, 0xc6, 0xc3, 0xd1, 0x11, 0x6d, 0xd1, 0x06, 0x7d, 0x62, 0x0a, 0xe4, 0x6b, 0x50, 0xfd, 0x04, 0x3b, 0xae, 0x61, 0x99, 0x0a, 0xfe, 0x6a, 0x84, 0x5d, 0x0f, 0xd5, 0x61, 0xf1, 0x39, 0xa3, 0xd4, 0xa5, 0x0b, 0xd2, 0x95, 0x92, 0x22, 0x9a, 0xf2, 0x5f, 0x48, 0xb0, 0xec, 0x33, 0xbb, 0xb6, 0x65, 0xba, 0x38, 0x9b, 0x1b, 0x6d, 0xc0, 0x12, 0x37, 0x4e, 0x35, 0xb5, 0x21, 0xae, 0xe7, 0xe8, 0xeb, 0x32, 0xa7, 0xb5, 0xb5, 0x21, 0x46, 0x97, 0x61, 0x59, 0xb0, 0x08, 0x25, 0x79, 0xca, 0x55, 0xe5, 0x64, 0xde, 0x1b, 0xda, 0x84, 0x53, 0x82, 0x51, 0xb3, 0x0d, 0x9f, 0x79, 0x9e, 0x32, 0xaf, 0xf0, 0x57, 0x4d, 0xdb, 0xe0, 0xfc, 0xf2, 0x17, 0x50, 0xda, 0x69, 0x77, 0xb7, 0x2d, 0xf3, 0xc8, 0xe8, 0x13, 0x13, 0x5d, 0xec, 0x10, 0x99, 0xba, 0x74, 0x21, 0x4f, 0x4c, 0xe4, 0x4d, 0xd4, 0x80, 0xa2, 0x8b, 0x35, 0xa7, 0x77, 0x8c, 0xdd, 0x7a, 0x8e, 0xbe, 0xf2, 0xdb, 0x44, 0xca, 0xb2, 0x3d, 0xc3, 0x32, 0xdd, 0x7a, 0x9e, 0x49, 0xf1, 0xa6, 0xfc, 0x73, 0x09, 0xca, 0x1d, 0xcb, 0xf1, 0x9e, 0x6a, 0xb6, 0x6d, 0x98, 0x7d, 0x74, 0x13, 0x8a, 0xd4, 0x97, 0x3d, 0x6b, 0x40, 0x7d, 0x50, 0xdd, 0x6a, 0x6c, 0xc6, 0x87, 0x65, 0xb3, 0xc3, 0x39, 0x14, 0x9f, 0x17, 0x5d, 0x84, 0x6a, 0xcf, 0x32, 0x3d, 0xcd, 0x30, 0xb1, 0xa3, 0xda, 0x96, 0xe3, 0x51, 0x17, 0x15, 0x94, 0x8a, 0x4f, 0x25, 0xbd, 0xa0, 0x73, 0x50, 0x3a, 0xb6, 0x5c, 0x8f, 0x71, 0xe4, 0x29, 0x47, 0x91, 0x10, 0xe8, 0xcb, 0x35, 0x58, 0xa4, 0x2f, 0x0d, 0x9b, 0x3b, 0x63, 0x81, 0x34, 0x5b, 0xb6, 0xfc, 0x2b, 0x09, 0x0a, 0x4f, 0xad, 0x91, 0xe9, 0xc5, 0xba, 0xd1, 0xbc, 0x63, 0x3e, 0x50, 0xa1, 0x6e, 0x34, 0xef, 0x38, 0xe8, 0x86, 0x70, 0xb0, 0xb1, 0x62, 0xdd, 0x90, 0x97, 0x0d, 0x28, 0x3a, 0x58, 0xd3, 0x2d, 0x73, 0x70, 0x42, 0x4d, 0x28, 0x2a, 0x7e, 0x9b, 0x0c, 0xa2, 0x8b, 0x07, 0x86, 0x39, 0x7a, 0xa9, 0x3a, 0x78, 0xa0, 0x1d, 0xe2, 0x01, 0x35, 0xa5, 0xa8, 0x54, 0x39, 0x59, 0x61, 0x54, 0xb4, 0x03, 0x65, 0xdb, 0xb1, 0x6c, 0xad, 0xaf, 0x11, 0x3f, 0xd6, 0x0b, 0xd4, 0x55, 0x72, 0xd2, 0x55, 0xd4, 0xec, 0x4e, 0xc0, 0xa9, 0x84, 0xc5, 0xe4, 0xbf, 0x92, 0x60, 0x99, 0x04, 0x8f, 0x6b, 0x6b, 0x3d, 0xbc, 0x47, 0x87, 0x04, 0xdd, 0x82, 0x45, 0x13, 0x7b, 0x2f, 0x2c, 0xe7, 0x19, 0x1f, 0x80, 0x37, 0x93, 0x5a, 0x7d, 0x99, 0xa7, 0x96, 0x8e, 0x15, 0xc1, 0x8f, 0x6e, 0x40, 0xde, 0x36, 0x74, 0xfa, 0xc1, 0x53, 0x88, 0x11, 0x5e, 0x22, 0x62, 0xd8, 0x3d, 0xea, 0x87, 0x69, 0x44, 0x0c, 0xbb, 0x27, 0xcb, 0x00, 0x2d, 0xd3, 0xbb, 0xf9, 0xe1, 0x27, 0xda, 0x60, 0x84, 0xd1, 0x2a, 0x14, 0x9e, 0x93, 0x07, 0x6a, 0x6c, 0x5e, 0x61, 0x0d, 0xf9, 0xeb, 0x3c, 0x9c, 0x7b, 0x42, 0xfc, 0xd5, 0xd5, 0x4c, 0xfd, 0xd0, 0x7a, 0xd9, 0xc5, 0xbd, 0x91, 0x63, 0x78, 0x27, 0xdb, 0x96, 0xe9, 0xe1, 0x97, 0x1e, 0x6a, 0xc3, 0x8a, 0x29, 0x34, 0xab, 0x22, 0x34, 0x89, 0x86, 0xf2, 0xd6, 0xc6, 0x18, 0x23, 0x98, 0x8b, 0x94, 0x9a, 0x19, 0x25, 0xb8, 0xe8, 0x71, 0x30, 0x6e, 0x42, 0x5b, 0x8e, 0x6a, 0x4b, 0xf9, 0xa4, 0xee, 0x2e, 0xb5, 0x8c, 0xeb, 0x12, 0x03, 0x2b, 0x34, 0x7d, 0x0c, 0x64, 0x56, 0xab, 0x9a, 0xab, 0x8e, 0x5c, 0xec, 0x50, 0xc7, 0x94, 0xb7, 0xde, 0x48, 0x6a, 0x09, 0x5c, 0xa0, 0x94, 0x9c, 0x91, 0xd9, 0x74, 0x0f, 0x5c, 0xec, 0xa0, 0xbb, 0x34, 0x4f, 0x10, 0xe9, 0xbe, 0x63, 0x8d, 0xec, 0x7a, 0x71, 0x0a, 0x71, 0xa0, 0xe2, 0x8f, 0x08, 0x3f, 0x4d, 0x22, 0x3c, 0x16, 0x55, 0xc7, 0xb2, 0xbc, 0x23, 0x57, 0xc4, 0x9f, 0x20, 0x2b, 0x94, 0x8a, 0xae, 0xc3, 0x29, 0x77, 0x64, 0xdb, 0x03, 0x3c, 0xc4, 0xa6, 0xa7, 0x0d, 0x58, 0x77, 0x6e, 0xbd, 0x70, 0x21, 0x7f, 0x25, 0xaf, 0xa0, 0xf0, 0x2b, 0xaa, 0xd8, 0x45, 0xeb, 0x00, 0xb6, 0x63, 0x3c, 0x37, 0x06, 0xb8, 0x8f, 0xf5, 0xfa, 0x02, 0x55, 0x1a, 0xa2, 0xa0, 0xf7, 0x61, 0xd5, 0xc5, 0xbd, 0x9e, 0x35, 0xb4, 0x55, 0xdb, 0xb1, 0x8e, 0x8c, 0x01, 0x66, 0xb3, 0x67, 0x91, 0xce, 0x1e, 0xc4, 0xdf, 0x75, 0xd8, 0x2b, 0x32, 0x8f, 0xe4, 0x9f, 0xe7, 0xe0, 0x34, 0xf5, 0x64, 0xc7, 0xd2, 0xf9, 0x30, 0xf3, 0x24, 0xf5, 0x16, 0x54, 0x7a, 0xd4, 0x20, 0xd5, 0xd6, 0x1c, 0x6c, 0x7a, 0x7c, 0x92, 0x2e, 0x31, 0x62, 0x87, 0xd2, 0xd0, 0x67, 0x50, 0x73, 0x79, 0x54, 0xa8, 0x3d, 0x16, 0x16, 0x7c, 0xcc, 0xde, 0x4b, 0xba, 0x6b, 0x4c, 0x2c, 0x29, 0xcb, 0x6e, 0x22, 0xb8, 0x16, 0xdd, 0x13, 0xb7, 0xe7, 0x0d, 0x58, 0xb6, 0x2b, 0x6f, 0x7d, 0x98, 0xa1, 0x30, 0x6e, 0xf8, 0x66, 0x97, 0x89, 0xed, 0x9a, 0x9e, 0x73, 0xa2, 0x08, 0x25, 0x8d, 0xdb, 0xb0, 0x14, 0x7e, 0x81, 0x6a, 0x90, 0x7f, 0x86, 0x4f, 0xf8, 0x47, 0x91, 0xc7, 0x60, 0x12, 0xb0, 0x5c, 0xc3, 0x1a, 0xb7, 0x73, 0xbf, 0x23, 0xc9, 0x0e, 0xa0, 0xa0, 0x97, 0xa7, 0xd8, 0xd3, 0x74, 0xcd, 0xd3, 0x10, 0x82, 0x79, 0xba, 0x8c, 0x30, 0x15, 0xf4, 0x99, 0x68, 0x1d, 0xf1, 0xc9, 0x5b, 0x52, 0xc8, 0x23, 0x7a, 0x03, 0x4a, 0x7e, 0xa0, 0xf3, 0xb5, 0x24, 0x20, 0x90, 0x9c, 0xae, 0x79, 0x1e, 0x1e, 0xda, 0x1e, 0x0d, 0x91, 0x8a, 0x22, 0x9a, 0xf2, 0x7f, 0xcf, 0x43, 0x2d, 0x31, 0x26, 0xf7, 0xa1, 0x38, 0xe4, 0xdd, 0xf3, 0x89, 0xf6, 0x76, 0x4a, 0x62, 0x4f, 0x98, 0xaa, 0xf8, 0x52, 0x24, 0x6f, 0x92, 0x1c, 0x1a, 0x5a, 0xff, 0xfc, 0x36, 0x19, 0xf1, 0x81, 0xd5, 0x57, 0x75, 0xc3, 0xc1, 0x3d, 0xcf, 0x72, 0x4e, 0xb8, 0xb9, 0x4b, 0x03, 0xab, 0xbf, 0x23, 0x68, 0xe8, 0x36, 0x80, 0x6e, 0xba, 0x64, 0xb0, 0x8f, 0x8c, 0x3e, 0x35, 0xba, 0xbc, 0x75, 0x2e, 0x69, 0x84, 0xbf, 0xd8, 0x29, 0x25, 0xdd, 0x74, 0xb9, 0xf9, 0x0f, 0xa0, 0x42, 0xd6, 0x0c, 0x75, 0xc8, 0xd6, 0x29, 0x16, 0xe9, 0xe5, 0xad, 0xf3, 0x69, 0xdf, 0xe0, 0xaf, 0x66, 0xca, 0x92, 0x1d, 0x34, 0x5c, 0xf4, 0x10, 0x16, 0x68, 0xf2, 0x76, 0xeb, 0x0b, 0x54, 0x78, 0x73, 0x9c, 0x03, 0x78, 0x44, 0x3c, 0xa1, 0x02, 0x2c, 0x20, 0xb8, 0x34, 0x3a, 0x80, 0xb2, 0x66, 0x9a, 0x96, 0xa7, 0xb1, 0x44, 0xb3, 0x48, 0x95, 0x7d, 0x30, 0x85, 0xb2, 0x66, 0x20, 0xc5, 0x34, 0x86, 0xf5, 0xa0, 0xef, 0x43, 0x81, 0x66, 0x22, 0x9e, 0x34, 0x2e, 0x4f, 0x19, 0xb4, 0x0a, 0x93, 0x6a, 0xdc, 0x82, 0x72, 0xc8, 0xd8, 0x59, 0x82, 0xb4, 0x71, 0x17, 0x6a, 0x71, 0xd3, 0x66, 0x0a, 0xf2, 0x3f, 0x80, 0x55, 0x65, 0x64, 0x06, 0x86, 0x89, 0xea, 0xeb, 0x36, 0x2c, 0xf0, 0xc1, 0x66, 0x11, 0x27, 0x4f, 0xf6, 0x91, 0xc2, 0x25, 0xc2, 0xe5, 0xd4, 0xb1, 0x66, 0xea, 0x03, 0xec, 0xf0, 0x7e, 0x45, 0x39, 0xf5, 0x98, 0x51, 0xe5, 0xef, 0xc3, 0xe9, 0x58, 0xe7, 0xbc, 0x9a, 0x7b, 0x1b, 0xaa, 0xb6, 0xa5, 0xab, 0x2e, 0x23, 0xab, 0x86, 0x2e, 0xd2, 0x90, 0xed, 0xf3, 0xb6, 0x74, 0x22, 0xde, 0xf5, 0x2c, 0x3b, 0x69, 0xfc, 0x74, 0xe2, 0x75, 0x38, 0x13, 0x17, 0x67, 0xdd, 0xcb, 0xf7, 0x60, 0x4d, 0xc1, 0x43, 0xeb, 0x39, 0x7e, 0x55, 0xd5, 0x0d, 0xa8, 0x27, 0x15, 0x70, 0xe5, 0x9f, 0xc3, 0x5a, 0x40, 0xed, 0x7a, 0x9a, 0x37, 0x72, 0x67, 0x52, 0xce, 0x4b, 0xdd, 0x43, 0xcb, 0x65, 0xc3, 0x59, 0x54, 0x44, 0x53, 0x5e, 0x83, 0x42, 0xc7, 0xd2, 0x5b, 0x1d, 0x54, 0x85, 0x9c, 0x61, 0x73, 0xe1, 0x9c, 0x61, 0xcb, 0x46, 0xb8, 0xcf, 0x36, 0x2b, 0x39, 0x58, 0xd7, 0x71, 0x56, 0x74, 0x17, 0xaa, 0x9a, 0xae, 0x1b, 0x24, 0x9c, 0xb4, 0x81, 0x6a, 0xd8, 0xac, 0x22, 0x2d, 0x6f, 0xad, 0xa5, 0x06, 0x40, 0xab, 0xa3, 0x54, 0x02, 0xf6, 0x96, 0xed, 0xca, 0x8f, 0xa1, 0xe4, 0xaf, 0xf9, 0xe8, 0x4e, 0x50, 0xbc, 0xe6, 0xa6, 0xad, 0x10, 0xfc, 0xfa, 0x76, 0x3f, 0xb1, 0x46, 0x71, 0x93, 0xef, 0x00, 0xf8, 0xb9, 0x54, 0x94, 0x1e, 0xe7, 0xc6, 0x28, 0x56, 0x42, 0xec, 0xf2, 0x4f, 0x0b, 0xe1, 0x0c, 0x1b, 0x72, 0x82, 0xee, 0x3b, 0x41, 0x8f, 0x64, 0xdc, 0xdc, 0x2b, 0x65, 0xdc, 0x8f, 0xa0, 0xe0, 0x7a, 0x9a, 0x87, 0x79, 0x79, 0xb6, 0x31, 0x4e, 0x9c, 0x18, 0x81, 0x15, 0xc6, 0x8f, 0xce, 0x03, 0xf4, 0x1c, 0xac, 0x79, 0x58, 0x57, 0x35, 0xb6, 0x3c, 0xe4, 0x95, 0x12, 0xa7, 0x34, 0x3d, 0xb4, 0x1d, 0x94, 0x98, 0x05, 0x6a, 0xd8, 0xd5, 0x71, 0x9a, 0x23, 0x43, 0x1d, 0x14, 0x9b, 0x7e, 0xba, 0x5a, 0x98, 0x32, 0x5d, 0x71, 0x05, 0x4c, 0x2a, 0x94, 0x8c, 0x17, 0x27, 0x27, 0x63, 0x26, 0x3a, 0x4d, 0x32, 0x2e, 0x4e, 0x4e, 0xc6, 0x5c, 0xd9, 0xf8, 0x64, 0x9c, 0x92, 0x7e, 0x4a, 0x69, 0xe9, 0xe7, 0xbb, 0x4c, 0xbb, 0xff, 0x2c, 0x41, 0x3d, 0x99, 0x05, 0x78, 0xf6, 0xbb, 0x0d, 0x0b, 0x2e, 0xa5, 0x4c, 0x93, 0x7b, 0xb9, 0x2c, 0x97, 0x40, 0x8f, 0x61, 0xde, 0x30, 0x8f, 0x2c, 0x3e, 0x69, 0x3f, 0x9c, 0x42, 0x92, 0xf7, 0xba, 0xd9, 0x32, 0x8f, 0x2c, 0xe6, 0x4d, 0xaa, 0xa1, 0xf1, 0x11, 0x94, 0x7c, 0xd2, 0x4c, 0xdf, 0xb6, 0x07, 0xab, 0xb1, 0xd8, 0x66, 0xdb, 0x0d, 0x7f, 0x4a, 0x48, 0xb3, 0x4d, 0x09, 0xf9, 0x27, 0xb9, 0xf0, 0x94, 0x7d, 0x68, 0x0c, 0x3c, 0xec, 0x24, 0xa6, 0xec, 0xc7, 0x42, 0x3b, 0x9b, 0xaf, 0x97, 0x26, 0x6a, 0x67, 0x15, 0x3c, 0x9f, 0x75, 0x5f, 0x42, 0x95, 0x06, 0xa5, 0xea, 0xe2, 0x01, 0x2d, 0x79, 0x78, 0xf9, 0xf9, 0xbd, 0x71, 0x6a, 0x98, 0x25, 0x2c, 0xb4, 0xbb, 0x5c, 0x8e, 0x79, 0xb0, 0x32, 0x08, 0xd3, 0x1a, 0xf7, 0x01, 0x25, 0x99, 0x66, 0xf2, 0x69, 0x97, 0xe4, 0x42, 0xb2, 0xd7, 0x4e, 0x59, 0xa7, 0x8f, 0xa8, 0x19, 0xd3, 0xc4, 0x0a, 0x33, 0x58, 0xe1, 0x12, 0xf2, 0x7f, 0xe5, 0x01, 0x82, 0x97, 0xff, 0x8f, 0x92, 0xe0, 0x7d, 0x3f, 0x01, 0xb1, 0x52, 0xf2, 0xca, 0x38, 0xc5, 0xa9, 0xa9, 0x67, 0x2f, 0x9a, 0x7a, 0x58, 0x51, 0xf9, 0xde, 0x58, 0x35, 0x33, 0x27, 0x9d, 0xc5, 0xdf, 0xb6, 0xa4, 0xf3, 0x04, 0xce, 0xc4, 0x83, 0x88, 0x67, 0x9c, 0x2d, 0x28, 0x18, 0x1e, 0x1e, 0x32, 0x60, 0x2a, 0x75, 0xd3, 0x1b, 0x12, 0x62, 0xac, 0xf2, 0x06, 0x94, 0x5a, 0x43, 0xad, 0x8f, 0xbb, 0x36, 0xee, 0x91, 0x4e, 0x0d, 0xd2, 0xe0, 0x86, 0xb0, 0x86, 0xbc, 0x05, 0xc5, 0x1f, 0xe0, 0x13, 0x36, 0xfb, 0xa7, 0x34, 0x54, 0xfe, 0x93, 0x1c, 0xac, 0xd1, 0xd5, 0x67, 0x5b, 0xc0, 0x42, 0x0a, 0x76, 0xad, 0x91, 0xd3, 0xc3, 0x2e, 0x0d, 0x0b, 0x7b, 0xa4, 0xda, 0xd8, 0x31, 0x2c, 0x9d, 0xa3, 0x16, 0xa5, 0x9e, 0x3d, 0xea, 0x50, 0x02, 0x3a, 0x07, 0xa4, 0xa1, 0x7e, 0x35, 0xb2, 0x78, 0xc4, 0xe6, 0x95, 0x62, 0xcf, 0x1e, 0xfd, 0x1e, 0x69, 0x0b, 0x59, 0xf7, 0x58, 0x73, 0xb0, 0x4b, 0x03, 0x92, 0xc9, 0x76, 0x29, 0x01, 0xdd, 0x80, 0xd3, 0x43, 0x3c, 0xb4, 0x9c, 0x13, 0x75, 0x60, 0x0c, 0x0d, 0x4f, 0x35, 0x4c, 0xf5, 0xf0, 0xc4, 0xc3, 0x2e, 0x0f, 0x3e, 0xc4, 0x5e, 0x3e, 0x21, 0xef, 0x5a, 0xe6, 0x03, 0xf2, 0x06, 0xc9, 0x50, 0xb1, 0xac, 0xa1, 0xea, 0xf6, 0x2c, 0x07, 0xab, 0x9a, 0xfe, 0x63, 0xba, 0x20, 0xe7, 0x95, 0xb2, 0x65, 0x0d, 0xbb, 0x84, 0xd6, 0xd4, 0x7f, 0x8c, 0xde, 0x84, 0x72, 0xcf, 0x1e, 0xb9, 0xd8, 0x53, 0xc9, 0x1f, 0xba, 0xde, 0x96, 0x14, 0x60, 0xa4, 0x6d, 0x7b, 0xe4, 0x86, 0x18, 0x86, 0xc4, 0xff, 0x8b, 0x61, 0x86, 0xa7, 0xc4, 0xcd, 0x1a, 0x54, 0x22, 0xa8, 0x07, 0xd9, 0x80, 0x52, 0x78, 0x83, 0x6f, 0x40, 0xc9, 0x33, 0xa1, 0x39, 0xd6, 0x40, 0x78, 0x92, 0x3e, 0x13, 0x9a, 0x77, 0x62, 0x8b, 0xdd, 0x27, 0x7d, 0x26, 0x2e, 0x1f, 0xe0, 0xe7, 0x1c, 0x19, 0x2b, 0x29, 0xac, 0x21, 0xeb, 0x00, 0xdb, 0x9a, 0xad, 0x1d, 0x1a, 0x03, 0xc3, 0x3b, 0x41, 0x57, 0xa1, 0xa6, 0xe9, 0xba, 0xda, 0x13, 0x14, 0x03, 0x0b, 0xbc, 0x72, 0x59, 0xd3, 0xf5, 0xed, 0x10, 0x19, 0xbd, 0x03, 0x2b, 0xba, 0x63, 0xd9, 0x51, 0x5e, 0x06, 0x60, 0xd6, 0xc8, 0x8b, 0x30, 0xb3, 0xfc, 0xef, 0x05, 0x38, 0x1f, 0x1d, 0xd8, 0x38, 0xb2, 0x74, 0x1f, 0x96, 0x62, 0xbd, 0x66, 0x20, 0x30, 0x81, 0xb5, 0x4a, 0x44, 0x22, 0x86, 0x94, 0xe4, 0x12, 0x48, 0x49, 0x2a, 0x76, 0x95, 0x7f, 0xad, 0xd8, 0xd5, 0xfc, 0x6b, 0xc1, 0xae, 0x0a, 0xdf, 0x0e, 0xbb, 0x5a, 0x9a, 0x11, 0xbb, 0xba, 0x44, 0xb3, 0x97, 0xe8, 0x9d, 0xc2, 0x04, 0x2c, 0x54, 0x2b, 0x7e, 0x1f, 0xa6, 0x00, 0xca, 0x63, 0x18, 0xd7, 0xe2, 0x2c, 0x18, 0x57, 0x31, 0x13, 0xe3, 0x22, 0x51, 0x67, 0xdb, 0x9a, 0x33, 0xb4, 0x1c, 0x01, 0x62, 0xf1, 0xaa, 0x6d, 0x59, 0xd0, 0x39, 0x80, 0x95, 0x09, 0x77, 0x41, 0x16, 0xdc, 0x85, 0x2e, 0xc0, 0x92, 0x69, 0xa9, 0x26, 0x7e, 0xa1, 0x92, 0x58, 0x70, 0xeb, 0x65, 0x16, 0x18, 0xa6, 0xd5, 0xc6, 0x2f, 0x3a, 0x84, 0x82, 0x36, 0x60, 0x69, 0xa8, 0xb9, 0xcf, 0xb0, 0x4e, 0x55, 0xb9, 0xf5, 0x0a, 0x0d, 0xe2, 0x32, 0xa3, 0x11, 0x1d, 0x2e, 0xba, 0x08, 0xfe, 0x47, 0x72, 0xa6, 0x2a, 0x65, 0xaa, 0x08, 0x2a, 0x65, 0x93, 0xff, 0x56, 0x82, 0xd5, 0x68, 0x98, 0x73, 0x18, 0xe4, 0x11, 0x94, 0x1c, 0x91, 0xc9, 0x78, 0x68, 0x5f, 0xcd, 0x28, 0xbc, 0x93, 0xa9, 0x4f, 0x09, 0x64, 0xd1, 0x0f, 0x33, 0xd1, 0xb7, 0xeb, 0x93, 0xf4, 0x4d, 0xc2, 0xdf, 0x64, 0x07, 0xde, 0xfc, 0xd4, 0x30, 0x75, 0xeb, 0x85, 0x9b, 0x39, 0x4b, 0x53, 0x62, 0x45, 0xca, 0x88, 0x95, 0x9e, 0x83, 0x75, 0x6c, 0x7a, 0x86, 0x36, 0x50, 0x5d, 0x1b, 0xf7, 0x04, 0x0a, 0x10, 0x90, 0xc9, 0xda, 0x21, 0xff, 0x42, 0x82, 0x33, 0xf1, 0x4e, 0xb9, 0xcf, 0x5a, 0x49, 0x9f, 0xbd, 0x93, 0xfc, 0xc6, 0xb8, 0x70, 0xaa, 0xd7, 0xbe, 0xcc, 0xf4, 0xda, 0x8d, 0xc9, 0x1a, 0x27, 0xfa, 0xed, 0x2f, 0x25, 0x38, 0x9b, 0x69, 0x46, 0x6c, 0xed, 0x91, 0xe2, 0x6b, 0x0f, 0x5f, 0xb7, 0x7a, 0xd6, 0xc8, 0xf4, 0x42, 0xeb, 0xd6, 0x36, 0x3d, 0x36, 0x61, 0x0b, 0x84, 0x3a, 0xd4, 0x5e, 0x1a, 0xc3, 0xd1, 0x90, 0x2f, 0x5c, 0x44, 0xdd, 0x53, 0x46, 0x79, 0x85, 0x95, 0x4b, 0x6e, 0xc2, 0x8a, 0x6f, 0xe5, 0x58, 0x60, 0x33, 0x04, 0x54, 0xe6, 0xa2, 0x40, 0xa5, 0x09, 0x0b, 0x3b, 0xf8, 0xb9, 0xd1, 0xc3, 0xaf, 0xe5, 0x5c, 0xe7, 0x02, 0x94, 0x6d, 0xec, 0x0c, 0x0d, 0xd7, 0xf5, 0x33, 0x72, 0x49, 0x09, 0x93, 0xe4, 0xff, 0x58, 0x80, 0xe5, 0x78, 0x74, 0xdc, 0x4b, 0xe0, 0xa2, 0x6f, 0xa5, 0xac, 0x15, 0xf1, 0x0f, 0x0d, 0xd5, 0xa7, 0x37, 0x44, 0xd5, 0x92, 0xcb, 0xc2, 0x10, 0xfc, 0x0a, 0x87, 0x97, 0x34, 0xc4, 0x23, 0x3d, 0x6b, 0x38, 0xd4, 0x4c, 0x5d, 0x1c, 0xc7, 0xf1, 0x26, 0xf1, 0x9f, 0xe6, 0xf4, 0x89, 0xdb, 0x09, 0x99, 0x3e, 0x93, 0xc1, 0x23, 0x1b, 0x6e, 0xc3, 0xa4, 0xf8, 0x2a, 0xcd, 0xea, 0x25, 0x05, 0x38, 0x69, 0xc7, 0x70, 0xd0, 0x26, 0xcc, 0x63, 0xf3, 0xb9, 0x28, 0x40, 0x53, 0xce, 0xeb, 0x44, 0xfd, 0xa4, 0x50, 0x3e, 0x74, 0x1d, 0x16, 0x86, 0x24, 0x2c, 0xc4, 0xd6, 0x7b, 0x2d, 0xe3, 0xd8, 0x4a, 0xe1, 0x6c, 0x68, 0x0b, 0x16, 0x75, 0x3a, 0x4e, 0x62, 0x7f, 0x5d, 0x4f, 0x41, 0x6d, 0x29, 0x83, 0x22, 0x18, 0xd1, 0xae, 0x5f, 0x5e, 0x97, 0xb2, 0xea, 0xe2, 0xd8, 0x50, 0xa4, 0xd6, 0xd8, 0xfb, 0xd1, 0x1a, 0x1b, 0xa8, 0xae, 0xad, 0xc9, 0xba, 0xc6, 0x17, 0xda, 0x67, 0xa1, 0x38, 0xb0, 0xfa, 0x2c, 0x8c, 0xca, 0xec, 0xa4, 0x77, 0x60, 0xf5, 0x69, 0x14, 0xad, 0x92, 0xed, 0x86, 0x6e, 0x98, 0x74, 0xf9, 0x2b, 0x2a, 0xac, 0x41, 0x26, 0x1f, 0x7d, 0x50, 0x2d, 0xb3, 0x87, 0xeb, 0x15, 0xfa, 0xaa, 0x44, 0x29, 0x7b, 0x66, 0x8f, 0xd6, 0xa5, 0x9e, 0x77, 0x52, 0xaf, 0x52, 0x3a, 0x79, 0x24, 0x3b, 0x49, 0x86, 0x8e, 0x2c, 0x67, 0xed, 0x24, 0xd3, 0xf2, 0xbb, 0x00, 0x47, 0x1e, 0xc0, 0xe2, 0x0b, 0x96, 0x08, 0xea, 0x35, 0x2a, 0x7f, 0x65, 0x72, 0x7a, 0xe1, 0x1a, 0x84, 0xe0, 0x77, 0xb9, 0x47, 0xf8, 0x7b, 0x09, 0xce, 0x6c, 0xd3, 0x8d, 0x56, 0x28, 0x8f, 0xcd, 0x82, 0x4e, 0xde, 0xf2, 0x81, 0xe3, 0x4c, 0xc4, 0x2f, 0xfe, 0xdd, 0x02, 0x37, 0x6e, 0x41, 0x55, 0x28, 0xe7, 0x2a, 0xf2, 0x53, 0x63, 0xcf, 0x15, 0x37, 0xdc, 0x94, 0x3f, 0x86, 0xb5, 0xc4, 0x57, 0xf0, 0xbd, 0xce, 0x06, 0x2c, 0x05, 0xf9, 0xca, 0xff, 0x88, 0xb2, 0x4f, 0x6b, 0xe9, 0xf2, 0x6d, 0x38, 0xdd, 0xf5, 0x34, 0xc7, 0x4b, 0xb8, 0x60, 0x0a, 0x59, 0x8a, 0x2a, 0x47, 0x65, 0x39, 0xf0, 0xdb, 0x85, 0xd5, 0xae, 0x67, 0xd9, 0xaf, 0xa0, 0x94, 0x64, 0x1d, 0xf2, 0xfd, 0xd6, 0x48, 0xac, 0x0f, 0xa2, 0x29, 0xaf, 0x31, 0x0c, 0x3c, 0xd9, 0xdb, 0x1d, 0x38, 0xc3, 0x20, 0xe8, 0x57, 0xf9, 0x88, 0xb3, 0x02, 0x00, 0x4f, 0xea, 0x7d, 0x0a, 0xa7, 0x82, 0x65, 0x31, 0x00, 0x77, 0x6e, 0x46, 0xc1, 0x9d, 0x0b, 0x63, 0x46, 0x3d, 0x82, 0xed, 0xfc, 0x79, 0x2e, 0x94, 0xd7, 0x33, 0xa0, 0x9d, 0x3b, 0x51, 0x68, 0xe7, 0xe2, 0x24, 0xdd, 0x11, 0x64, 0x27, 0x19, 0xb5, 0xf9, 0x94, 0xa8, 0xfd, 0x22, 0x81, 0xff, 0xcc, 0x67, 0x01, 0x68, 0x31, 0x6b, 0x7f, 0x23, 0xf0, 0x8f, 0xc2, 0xe0, 0x1f, 0xbf, 0x6b, 0xff, 0xc4, 0xe0, 0x56, 0x0c, 0xfe, 0xd9, 0x98, 0x68, 0xaf, 0x8f, 0xfe, 0xfc, 0xf5, 0x3c, 0x94, 0xfc, 0x77, 0x09, 0x9f, 0x27, 0xdd, 0x96, 0x4b, 0x71, 0x5b, 0x78, 0x05, 0xce, 0x7f, 0xab, 0x15, 0x78, 0x7e, 0xea, 0x15, 0xf8, 0x1c, 0x94, 0xe8, 0x83, 0xea, 0xe0, 0x23, 0xbe, 0xa2, 0x16, 0x29, 0x41, 0xc1, 0x47, 0x41, 0x18, 0x2e, 0xcc, 0x14, 0x86, 0x31, 0xc0, 0x69, 0x31, 0x0e, 0x38, 0xdd, 0xf3, 0x57, 0x44, 0xb6, 0x88, 0x5e, 0x1e, 0xa3, 0x37, 0x75, 0x2d, 0x6c, 0x47, 0xd7, 0x42, 0xb6, 0xae, 0xbe, 0x3b, 0x4e, 0xcb, 0xd8, 0x55, 0xf0, 0xbb, 0x5c, 0x21, 0x0e, 0x18, 0x8a, 0x14, 0x8e, 0x45, 0x9e, 0x59, 0xef, 0x00, 0xf8, 0x49, 0x44, 0x40, 0x49, 0xe7, 0xc6, 0x7c, 0xa3, 0x12, 0x62, 0x27, 0x6a, 0x23, 0x43, 0x13, 0x9c, 0x8a, 0x4d, 0x97, 0x1f, 0x33, 0x8e, 0xc4, 0xfe, 0xb7, 0x10, 0xca, 0x2f, 0x19, 0xa7, 0x3d, 0xf7, 0x12, 0x40, 0xe7, 0x8c, 0x51, 0x7c, 0x33, 0x8a, 0x73, 0xbe, 0x62, 0xd4, 0x25, 0x60, 0x4e, 0x5a, 0xb9, 0x68, 0x0e, 0x7f, 0xcd, 0xd0, 0xa5, 0x12, 0xa7, 0x34, 0xe9, 0xce, 0xe0, 0xc8, 0x30, 0x0d, 0xf7, 0x98, 0xbd, 0x5f, 0x60, 0x3b, 0x03, 0x41, 0x6a, 0xd2, 0x1b, 0x5b, 0xf8, 0xa5, 0xe1, 0xa9, 0x3d, 0x4b, 0xc7, 0x34, 0xa6, 0x0b, 0x4a, 0x91, 0x10, 0xb6, 0x2d, 0x1d, 0x07, 0x33, 0xaf, 0xf8, 0x6a, 0x33, 0xaf, 0x14, 0x9b, 0x79, 0x67, 0x60, 0xc1, 0xc1, 0x9a, 0x6b, 0x99, 0x7c, 0x1f, 0xce, 0x5b, 0x64, 0x68, 0x86, 0xd8, 0x75, 0x49, 0x4f, 0xbc, 0x5c, 0xe3, 0xcd, 0x50, 0x99, 0xb9, 0x34, 0xb1, 0xcc, 0x1c, 0x73, 0x8a, 0x14, 0x2b, 0x33, 0x2b, 0x13, 0xcb, 0xcc, 0xa9, 0x0e, 0x91, 0x82, 0x42, 0xbb, 0x3a, 0x5d, 0xa1, 0x1d, 0xae, 0x4b, 0x97, 0x23, 0x75, 0xe9, 0x77, 0x39, 0x59, 0x7f, 0x25, 0xc1, 0x5a, 0x62, 0x5a, 0xf1, 0xe9, 0x7a, 0x2b, 0x76, 0xcc, 0xb4, 0x31, 0xd1, 0x67, 0xfe, 0x29, 0xd3, 0xa3, 0xc8, 0x29, 0xd3, 0x07, 0x93, 0x05, 0x5f, 0xfb, 0x21, 0xd3, 0x1f, 0x49, 0xf0, 0xe6, 0x81, 0xad, 0xc7, 0x2a, 0x3c, 0xbe, 0xed, 0x9f, 0x3e, 0x71, 0xdc, 0x13, 0xb5, 0x7e, 0x6e, 0x56, 0x40, 0x86, 0xc9, 0xc9, 0x32, 0x5c, 0xc8, 0x36, 0x83, 0x97, 0x4c, 0x3f, 0x82, 0xe5, 0xdd, 0x97, 0xb8, 0xd7, 0x3d, 0x31, 0x7b, 0x33, 0x98, 0x56, 0x83, 0x7c, 0x6f, 0xa8, 0x73, 0x38, 0x95, 0x3c, 0x86, 0xab, 0xc0, 0x7c, 0xb4, 0x0a, 0x54, 0xa1, 0x16, 0xf4, 0xc0, 0x87, 0xf7, 0x0c, 0x19, 0x5e, 0x9d, 0x30, 0x13, 0xe5, 0x4b, 0x0a, 0x6f, 0x71, 0x3a, 0x76, 0xd8, 0xa5, 0x0c, 0x46, 0xc7, 0x8e, 0x13, 0xcd, 0x16, 0xf9, 0x68, 0xb6, 0x90, 0xff, 0x4c, 0x82, 0x32, 0xe9, 0xe1, 0x5b, 0xd9, 0xcf, 0xb7, 0x5a, 0xf9, 0x60, 0xab, 0xe5, 0xef, 0xd8, 0xe6, 0xc3, 0x3b, 0xb6, 0xc0, 0xf2, 0x02, 0x25, 0x27, 0x2d, 0x5f, 0xf0, 0xe9, 0xd8, 0x71, 0xe4, 0x0b, 0xb0, 0xc4, 0x6c, 0xe3, 0x5f, 0x5e, 0x83, 0xfc, 0xc8, 0x19, 0x88, 0x38, 0x1a, 0x39, 0x03, 0xf9, 0x8f, 0x25, 0xa8, 0x34, 0x3d, 0x4f, 0xeb, 0x1d, 0xcf, 0xf0, 0x01, 0xbe, 0x71, 0xb9, 0xb0, 0x71, 0xc9, 0x8f, 0x08, 0xcc, 0x9d, 0xcf, 0x30, 0xb7, 0x10, 0x31, 0x57, 0x86, 0xaa, 0xb0, 0x25, 0xd3, 0xe0, 0x36, 0xa0, 0x8e, 0xe5, 0x78, 0x0f, 0x2d, 0xe7, 0x85, 0xe6, 0xe8, 0xb3, 0xed, 0xc0, 0x10, 0xcc, 0xf3, 0x5b, 0xbc, 0xf9, 0x2b, 0x05, 0x85, 0x3e, 0xcb, 0x97, 0xe1, 0x54, 0x44, 0x5f, 0x66, 0xc7, 0xf7, 0xa1, 0x4c, 0xf3, 0x3e, 0x2f, 0xc5, 0x6f, 0x84, 0xcf, 0x75, 0xa6, 0x5a, 0x25, 0xe4, 0xdf, 0x85, 0x15, 0x52, 0x1f, 0x50, 0xba, 0x3f, 0x15, 0xbf, 0x17, 0xab, 0x53, 0xcf, 0x67, 0x28, 0x8a, 0xd5, 0xa8, 0x7f, 0x23, 0x41, 0x81, 0xd2, 0x13, 0x6b, 0xf6, 0x39, 0x28, 0x39, 0xd8, 0xb6, 0x54, 0x4f, 0xeb, 0xfb, 0x77, 0xa6, 0x09, 0x61, 0x5f, 0xeb, 0x53, 0x34, 0x97, 0xbe, 0xd4, 0x8d, 0x3e, 0x76, 0x3d, 0x71, 0x71, 0xba, 0x4c, 0x68, 0x3b, 0x8c, 0x44, 0x9c, 0xe4, 0x1a, 0xbf, 0xcf, 0xea, 0xce, 0x79, 0x85, 0x3e, 0xa3, 0x4d, 0x76, 0x8d, 0x6f, 0x1a, 0xec, 0x9d, 0x5e, 0xf2, 0x6b, 0x40, 0x31, 0x06, 0x97, 0xfb, 0x6d, 0x79, 0x17, 0x50, 0xd8, 0x0b, 0xdc, 0xdf, 0xd7, 0x61, 0x81, 0x3a, 0x49, 0x54, 0x47, 0x6b, 0x19, 0x6e, 0x50, 0x38, 0x9b, 0xac, 0x01, 0x62, 0x0e, 0x8e, 0x54, 0x44, 0xb3, 0x8f, 0xca, 0x98, 0x0a, 0xe9, 0xef, 0x24, 0x38, 0x15, 0xe9, 0x83, 0xdb, 0xfa, 0x5e, 0xb4, 0x93, 0x4c, 0x53, 0x79, 0x07, 0xdb, 0x91, 0x25, 0xe1, 0x7a, 0x96, 0x49, 0xbf, 0xa6, 0xe5, 0xe0, 0x1f, 0x24, 0x80, 0xe6, 0xc8, 0x3b, 0xe6, 0xc8, 0x60, 0x78, 0x64, 0xa4, 0xe8, 0xc8, 0x90, 0x77, 0xb6, 0xe6, 0xba, 0x2f, 0x2c, 0x47, 0xec, 0x69, 0xfc, 0x36, 0xc5, 0xf0, 0x46, 0xde, 0xb1, 0x38, 0x33, 0x23, 0xcf, 0xe8, 0x22, 0x54, 0xd9, 0x3d, 0x7d, 0x55, 0xd3, 0x75, 0x07, 0xbb, 0x2e, 0x3f, 0x3c, 0xab, 0x30, 0x6a, 0x93, 0x11, 0x09, 0x9b, 0x41, 0x51, 0x6d, 0xef, 0x44, 0xf5, 0xac, 0x67, 0xd8, 0xe4, 0x7b, 0x93, 0x8a, 0xa0, 0xee, 0x13, 0x22, 0x3b, 0x45, 0xe8, 0x1b, 0xae, 0xe7, 0x08, 0x36, 0x71, 0xd0, 0xc2, 0xa9, 0x94, 0x8d, 0x0c, 0x4a, 0xad, 0x33, 0x1a, 0x0c, 0x98, 0x8b, 0x5f, 0x7d, 0xd8, 0xdf, 0xe7, 0x1f, 0x94, 0xcb, 0x8a, 0xe9, 0xc0, 0x69, 0xfc, 0x73, 0x5f, 0x23, 0x08, 0xf3, 0x3e, 0xac, 0x84, 0xbe, 0x81, 0x87, 0x55, 0xa4, 0x88, 0x94, 0xa2, 0x45, 0xa4, 0xfc, 0x08, 0x10, 0xc3, 0x1d, 0xbe, 0xe5, 0x77, 0xcb, 0xa7, 0xe1, 0x54, 0x44, 0x11, 0x5f, 0x89, 0xaf, 0x41, 0x85, 0x5f, 0x89, 0xe2, 0x81, 0x72, 0x16, 0x8a, 0x24, 0xa3, 0xf6, 0x0c, 0x5d, 0x1c, 0xa8, 0x2e, 0xda, 0x96, 0xbe, 0x6d, 0xe8, 0x8e, 0xfc, 0x29, 0x54, 0x14, 0xd6, 0x0f, 0xe7, 0x7d, 0x08, 0x55, 0x7e, 0x81, 0x4a, 0x8d, 0x5c, 0x8d, 0x4c, 0xbb, 0x7a, 0x1f, 0xee, 0x44, 0xa9, 0x98, 0xe1, 0xa6, 0xac, 0x43, 0x83, 0x95, 0x0c, 0x11, 0xf5, 0xe2, 0x63, 0x1f, 0x82, 0xb8, 0x31, 0x30, 0xb1, 0x97, 0xa8, 0x7c, 0xc5, 0x09, 0x37, 0xe5, 0xf3, 0x70, 0x2e, 0xb5, 0x17, 0xee, 0x09, 0x1b, 0x6a, 0xc1, 0x0b, 0x76, 0x7f, 0xcf, 0x3f, 0x31, 0x96, 0x42, 0x27, 0xc6, 0x67, 0xfc, 0x22, 0x31, 0x27, 0x16, 0x31, 0x5a, 0x01, 0x06, 0xe5, 0x7e, 0x3e, 0xab, 0xdc, 0x9f, 0x8f, 0x94, 0xfb, 0x72, 0xd7, 0xf7, 0x27, 0xdf, 0x86, 0x3d, 0xa0, 0xdb, 0x45, 0xd6, 0xb7, 0x48, 0x88, 0xf2, 0xb8, 0xaf, 0x64, 0xac, 0x4a, 0x48, 0x4a, 0xbe, 0x0a, 0x95, 0x68, 0x6a, 0x0c, 0xe5, 0x39, 0x29, 0x91, 0xe7, 0xaa, 0xb1, 0x14, 0xf7, 0x51, 0xac, 0x02, 0xce, 0xf6, 0x71, 0xac, 0xfe, 0xbd, 0x1b, 0x49, 0x76, 0xd7, 0x52, 0x0e, 0x7b, 0x7f, 0x4d, 0x79, 0x6e, 0x95, 0xaf, 0x07, 0x0f, 0x5d, 0x22, 0xcf, 0x3f, 0x5a, 0x7e, 0x0b, 0xca, 0x07, 0x59, 0xbf, 0xeb, 0x98, 0x17, 0x17, 0x2b, 0x6e, 0xc2, 0xea, 0x43, 0x63, 0x80, 0xdd, 0x13, 0xd7, 0xc3, 0xc3, 0x16, 0x4d, 0x4a, 0x47, 0x06, 0x76, 0xd0, 0x3a, 0x00, 0xdd, 0xc2, 0xd8, 0x96, 0xe1, 0x5f, 0xf7, 0x0f, 0x51, 0xe4, 0xff, 0x94, 0x60, 0x39, 0x10, 0x3c, 0xa0, 0x5b, 0xb7, 0x37, 0xa0, 0x44, 0xbe, 0xd7, 0xf5, 0xb4, 0xa1, 0x2d, 0xce, 0xb3, 0x7c, 0x02, 0xba, 0x03, 0x85, 0x23, 0x57, 0x40, 0x46, 0xa9, 0x00, 0x7a, 0x9a, 0x21, 0xca, 0xfc, 0x91, 0xdb, 0xd2, 0xd1, 0xc7, 0x00, 0x23, 0x17, 0xeb, 0xfc, 0x0c, 0x2b, 0x9f, 0x55, 0x2d, 0x1c, 0x84, 0x0f, 0xc2, 0x89, 0x00, 0xbb, 0x93, 0x71, 0x17, 0xca, 0x86, 0x69, 0xe9, 0x98, 0x1e, 0x4e, 0xea, 0x1c, 0x55, 0x9a, 0x20, 0x0e, 0x4c, 0xe2, 0xc0, 0xc5, 0xba, 0x8c, 0xf9, 0x5a, 0x28, 0xfc, 0xcb, 0x03, 0xa5, 0x0d, 0x2b, 0x2c, 0x69, 0x1d, 0xf9, 0x86, 0x8b, 0x88, 0xdd, 0x18, 0xf7, 0x75, 0xd4, 0x5b, 0x4a, 0xcd, 0xe0, 0xa5, 0x8d, 0x10, 0x95, 0x6f, 0xc3, 0xe9, 0xc8, 0x0e, 0x69, 0x86, 0x2d, 0x8b, 0xdc, 0x89, 0x01, 0x25, 0x41, 0x38, 0x73, 0x18, 0x42, 0x44, 0xf3, 0x24, 0x18, 0xc2, 0x65, 0x30, 0x84, 0x2b, 0x7f, 0x01, 0x67, 0x23, 0x88, 0x4e, 0xc4, 0xa2, 0xbb, 0xb1, 0xca, 0xed, 0xd2, 0x24, 0xad, 0xb1, 0x12, 0xee, 0x7f, 0x24, 0x58, 0x4d, 0x63, 0x78, 0x45, 0xc4, 0xf1, 0x47, 0x19, 0x17, 0xf5, 0x6e, 0x4d, 0x67, 0xd6, 0x6f, 0x04, 0xad, 0xdd, 0x87, 0x46, 0x9a, 0x3f, 0x93, 0xa3, 0x94, 0x9f, 0x65, 0x94, 0x7e, 0x96, 0x0f, 0x21, 0xef, 0x4d, 0xcf, 0x73, 0x8c, 0xc3, 0x11, 0x09, 0xf9, 0xd7, 0x8e, 0x66, 0xb5, 0x7c, 0x5c, 0x86, 0xb9, 0xf6, 0xc6, 0x18, 0xf1, 0xc0, 0x8e, 0x54, 0x6c, 0xe6, 0xb3, 0x28, 0x36, 0xc3, 0x30, 0xf5, 0x9b, 0xd3, 0xe9, 0xfb, 0xad, 0x05, 0x40, 0x7f, 0x96, 0x83, 0x6a, 0x74, 0x88, 0xd0, 0x2e, 0x80, 0xe6, 0x5b, 0xce, 0x27, 0xca, 0xc5, 0xa9, 0x3e, 0x53, 0x09, 0x09, 0xa2, 0x77, 0x21, 0xdf, 0xb3, 0x47, 0x7c, 0xd4, 0x52, 0x0e, 0x83, 0xb7, 0xed, 0x11, 0xcb, 0x28, 0x84, 0x8d, 0xec, 0xa9, 0xd8, 0xd9, 0x7e, 0x76, 0x96, 0x7c, 0x4a, 0xdf, 0x33, 0x19, 0xce, 0x8c, 0x1e, 0x43, 0xf5, 0x85, 0x63, 0x78, 0xda, 0xe1, 0x00, 0xab, 0x03, 0xed, 0x04, 0x3b, 0x3c, 0x4b, 0x4e, 0x91, 0xc8, 0x2a, 0x42, 0xf0, 0x09, 0x91, 0x93, 0xff, 0x10, 0x8a, 0xc2, 0xa2, 0x09, 0x2b, 0xc2, 0x3e, 0xac, 0x8d, 0x08, 0x9b, 0x4a, 0xef, 0xca, 0x99, 0x9a, 0x69, 0xa9, 0x2e, 0x26, 0xcb, 0xb8, 0xf8, 0x5d, 0xc0, 0x84, 0x14, 0xbd, 0x4a, 0xa5, 0xb7, 0x2d, 0x07, 0xb7, 0x35, 0xd3, 0xea, 0x32, 0x51, 0xf9, 0x39, 0x94, 0x43, 0x1f, 0x38, 0xc1, 0x84, 0x16, 0xac, 0x88, 0xa3, 0x78, 0x17, 0x7b, 0x7c, 0x79, 0x99, 0xaa, 0xf3, 0x65, 0x2e, 0xd7, 0xc5, 0x1e, 0xbb, 0x3e, 0x71, 0x17, 0xce, 0x2a, 0xd8, 0xb2, 0xb1, 0xe9, 0x8f, 0xe7, 0x13, 0xab, 0x3f, 0x43, 0x06, 0x7f, 0x03, 0x1a, 0x69, 0xf2, 0x2c, 0x3f, 0x5c, 0xbb, 0x04, 0x45, 0xf1, 0x23, 0x5d, 0xb4, 0x08, 0xf9, 0xfd, 0xed, 0x4e, 0x6d, 0x8e, 0x3c, 0x1c, 0xec, 0x74, 0x6a, 0x12, 0x2a, 0xc2, 0x7c, 0x77, 0x7b, 0xbf, 0x53, 0xcb, 0x5d, 0x1b, 0x42, 0x2d, 0xfe, 0x0b, 0x55, 0xb4, 0x06, 0xa7, 0x3a, 0xca, 0x5e, 0xa7, 0xf9, 0xa8, 0xb9, 0xdf, 0xda, 0x6b, 0xab, 0x1d, 0xa5, 0xf5, 0x49, 0x73, 0x7f, 0xb7, 0x36, 0x87, 0x36, 0xe0, 0x7c, 0xf8, 0xc5, 0xe3, 0xbd, 0xee, 0xbe, 0xba, 0xbf, 0xa7, 0x6e, 0xef, 0xb5, 0xf7, 0x9b, 0xad, 0xf6, 0xae, 0x52, 0x93, 0xd0, 0x79, 0x38, 0x1b, 0x66, 0x79, 0xd0, 0xda, 0x69, 0x29, 0xbb, 0xdb, 0xe4, 0xb9, 0xf9, 0xa4, 0x96, 0xbb, 0x76, 0x03, 0x2a, 0x91, 0x1f, 0x94, 0x12, 0x93, 0x3a, 0x7b, 0x3b, 0xb5, 0x39, 0x54, 0x81, 0x52, 0x58, 0x4f, 0x11, 0xe6, 0xdb, 0x7b, 0x3b, 0xbb, 0xb5, 0xdc, 0xb5, 0xdb, 0xb0, 0x1c, 0xbb, 0xdf, 0x8b, 0x56, 0xa0, 0xd2, 0x6d, 0xb6, 0x77, 0x1e, 0xec, 0x7d, 0xa6, 0x2a, 0xbb, 0xcd, 0x9d, 0xcf, 0x6b, 0x73, 0x68, 0x15, 0x6a, 0x82, 0xd4, 0xde, 0xdb, 0x67, 0x54, 0xe9, 0xda, 0xb3, 0xd8, 0x1c, 0xc3, 0xe8, 0x34, 0xac, 0xf8, 0xdd, 0xa8, 0xdb, 0xca, 0x6e, 0x73, 0x7f, 0x97, 0xf4, 0x1e, 0x21, 0x2b, 0x07, 0xed, 0x76, 0xab, 0xfd, 0xa8, 0x26, 0x11, 0xad, 0x01, 0x79, 0xf7, 0xb3, 0x16, 0x61, 0xce, 0x45, 0x99, 0x0f, 0xda, 0x3f, 0x68, 0xef, 0x7d, 0xda, 0xae, 0xe5, 0xb7, 0x7e, 0xb1, 0x02, 0x55, 0x51, 0xe8, 0x61, 0x87, 0xde, 0x6a, 0xe9, 0xc0, 0xa2, 0xf8, 0xd1, 0x77, 0x4a, 0x86, 0x8e, 0xfe, 0x54, 0xbd, 0xb1, 0x31, 0x86, 0x83, 0xd7, 0xdb, 0x73, 0xe8, 0x90, 0xd6, 0xbf, 0xa1, 0xfb, 0xd6, 0x97, 0x52, 0xab, 0xcd, 0xc4, 0x15, 0xef, 0xc6, 0xe5, 0x89, 0x7c, 0x7e, 0x1f, 0x98, 0x94, 0xb8, 0xe1, 0x9f, 0x34, 0xa1, 0xcb, 0x69, 0xb5, 0x69, 0xca, 0x6f, 0xa6, 0x1a, 0x57, 0x26, 0x33, 0xfa, 0xdd, 0x3c, 0x83, 0x5a, 0xfc, 0xe7, 0x4d, 0x28, 0x05, 0x3a, 0xcd, 0xf8, 0x0d, 0x55, 0xe3, 0xda, 0x34, 0xac, 0xe1, 0xce, 0x12, 0xbf, 0xd7, 0xb9, 0x3a, 0xcd, 0xef, 0x1a, 0x32, 0x3b, 0xcb, 0xfa, 0x09, 0x04, 0x73, 0x60, 0xf4, 0x8a, 0x34, 0x4a, 0xfd, 0x71, 0x4c, 0xca, 0x4d, 0xfc, 0x34, 0x07, 0xa6, 0xdf, 0xb6, 0x96, 0xe7, 0xd0, 0x31, 0x2c, 0xc7, 0xae, 0x27, 0xa0, 0x14, 0xf1, 0xf4, 0x7b, 0x18, 0x8d, 0xab, 0x53, 0x70, 0x46, 0x23, 0x22, 0x7c, 0x1d, 0x21, 0x3d, 0x22, 0x52, 0x2e, 0x3b, 0xa4, 0x47, 0x44, 0xea, 0xcd, 0x06, 0x1a, 0xdc, 0x91, 0x6b, 0x08, 0x69, 0xc1, 0x9d, 0x76, 0xf9, 0xa1, 0x71, 0x79, 0x22, 0x5f, 0xd8, 0x69, 0xb1, 0x4b, 0x09, 0x69, 0x4e, 0x4b, 0xbf, 0xf4, 0xd0, 0xb8, 0x3a, 0x05, 0x67, 0x3c, 0x0a, 0x82, 0x23, 0xce, 0xac, 0x28, 0x48, 0x1c, 0xc8, 0x67, 0x45, 0x41, 0xf2, 0xb4, 0x94, 0x47, 0x41, 0xec, 0x68, 0xf2, 0xca, 0x14, 0x47, 0x29, 0xd9, 0x51, 0x90, 0x7e, 0xe8, 0x22, 0xcf, 0xa1, 0x9f, 0x4a, 0x50, 0xcf, 0x3a, 0xa6, 0x40, 0x29, 0xf5, 0xdd, 0x84, 0x93, 0x95, 0xc6, 0xd6, 0x2c, 0x22, 0xbe, 0x15, 0x5f, 0x01, 0x4a, 0xae, 0x7b, 0xe8, 0x9d, 0xb4, 0x91, 0xc9, 0x58, 0x5d, 0x1b, 0xef, 0x4e, 0xc7, 0xec, 0x77, 0xd9, 0x85, 0xa2, 0x38, 0x18, 0x41, 0x29, 0x59, 0x3a, 0x76, 0x2c, 0xd3, 0x90, 0xc7, 0xb1, 0xf8, 0x4a, 0x1f, 0xc1, 0x3c, 0xa1, 0xa2, 0xf3, 0xe9, 0xdc, 0x42, 0xd9, 0x7a, 0xd6, 0x6b, 0x5f, 0xd1, 0x53, 0x58, 0x60, 0x27, 0x01, 0x28, 0x05, 0x79, 0x88, 0x9c, 0x57, 0x34, 0x2e, 0x64, 0x33, 0xf8, 0xea, 0xbe, 0x64, 0xff, 0x0f, 0x84, 0x83, 0xfc, 0xe8, 0xed, 0xf4, 0x1f, 0x58, 0x47, 0xcf, 0x14, 0x1a, 0x17, 0x27, 0x70, 0x85, 0x27, 0x45, 0xac, 0xea, 0xbd, 0x3c, 0x71, 0xeb, 0x92, 0x3d, 0x29, 0xd2, 0x37, 0x47, 0x2c, 0x48, 0x92, 0x9b, 0xa7, 0xb4, 0x20, 0xc9, 0xdc, 0xb2, 0xa6, 0x05, 0x49, 0xf6, 0x7e, 0x4c, 0x9e, 0x43, 0x1e, 0x9c, 0x4a, 0x81, 0xca, 0xd0, 0xbb, 0x59, 0x41, 0x9e, 0x86, 0xdb, 0x35, 0xde, 0x9b, 0x92, 0x3b, 0x3c, 0xf8, 0x7c, 0xd2, 0xbf, 0x99, 0x8d, 0x1f, 0x65, 0x0e, 0x7e, 0x7c, 0x8a, 0x6f, 0xfd, 0x4b, 0x1e, 0x96, 0x18, 0x0c, 0xca, 0x2b, 0x98, 0xcf, 0x01, 0x82, 0x13, 0x08, 0xf4, 0x56, 0xba, 0x4f, 0x22, 0xa7, 0x34, 0x8d, 0xb7, 0xc7, 0x33, 0x85, 0x03, 0x2d, 0x84, 0xe6, 0xa7, 0x05, 0x5a, 0xf2, 0xd0, 0x22, 0x2d, 0xd0, 0x52, 0x8e, 0x04, 0xe4, 0x39, 0xf4, 0x09, 0x94, 0x7c, 0xd8, 0x18, 0xa5, 0xc1, 0xce, 0x31, 0x5c, 0xbc, 0xf1, 0xd6, 0x58, 0x9e, 0xb0, 0xd5, 0x21, 0x4c, 0x38, 0xcd, 0xea, 0x24, 0xf6, 0x9c, 0x66, 0x75, 0x1a, 0xb0, 0x1c, 0xf8, 0x84, 0x21, 0x47, 0x99, 0x3e, 0x89, 0x00, 0x77, 0x99, 0x3e, 0x89, 0xc2, 0x4f, 0xf2, 0xdc, 0x83, 0x4b, 0xbf, 0xfc, 0x7a, 0x5d, 0xfa, 0xa7, 0xaf, 0xd7, 0xe7, 0x7e, 0xf2, 0xcd, 0xba, 0xf4, 0xcb, 0x6f, 0xd6, 0xa5, 0x7f, 0xfc, 0x66, 0x5d, 0xfa, 0xd7, 0x6f, 0xd6, 0xa5, 0x3f, 0xfd, 0xb7, 0xf5, 0xb9, 0x1f, 0x16, 0x85, 0xf4, 0xe1, 0x02, 0xfd, 0xaf, 0x3e, 0x1f, 0xfc, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1a, 0xde, 0xe7, 0x02, 0x9b, 0x49, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // RuntimeServiceClient is the client API for RuntimeService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type RuntimeServiceClient interface { // Version returns the runtime name, runtime version, and runtime API version. Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) // RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure // the sandbox is in the ready state on success. RunPodSandbox(ctx context.Context, in *RunPodSandboxRequest, opts ...grpc.CallOption) (*RunPodSandboxResponse, error) // StopPodSandbox stops any running process that is part of the sandbox and // reclaims network resources (e.g., IP addresses) allocated to the sandbox. // If there are any running containers in the sandbox, they must be forcibly // terminated. // This call is idempotent, and must not return an error if all relevant // resources have already been reclaimed. kubelet will call StopPodSandbox // at least once before calling RemovePodSandbox. It will also attempt to // reclaim resources eagerly, as soon as a sandbox is not needed. Hence, // multiple StopPodSandbox calls are expected. StopPodSandbox(ctx context.Context, in *StopPodSandboxRequest, opts ...grpc.CallOption) (*StopPodSandboxResponse, error) // RemovePodSandbox removes the sandbox. If there are any running containers // in the sandbox, they must be forcibly terminated and removed. // This call is idempotent, and must not return an error if the sandbox has // already been removed. RemovePodSandbox(ctx context.Context, in *RemovePodSandboxRequest, opts ...grpc.CallOption) (*RemovePodSandboxResponse, error) // PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not // present, returns an error. PodSandboxStatus(ctx context.Context, in *PodSandboxStatusRequest, opts ...grpc.CallOption) (*PodSandboxStatusResponse, error) // ListPodSandbox returns a list of PodSandboxes. ListPodSandbox(ctx context.Context, in *ListPodSandboxRequest, opts ...grpc.CallOption) (*ListPodSandboxResponse, error) // CreateContainer creates a new container in specified PodSandbox CreateContainer(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error) // StartContainer starts the container. StartContainer(ctx context.Context, in *StartContainerRequest, opts ...grpc.CallOption) (*StartContainerResponse, error) // StopContainer stops a running container with a grace period (i.e., timeout). // This call is idempotent, and must not return an error if the container has // already been stopped. // TODO: what must the runtime do after the grace period is reached? StopContainer(ctx context.Context, in *StopContainerRequest, opts ...grpc.CallOption) (*StopContainerResponse, error) // RemoveContainer removes the container. If the container is running, the // container must be forcibly removed. // This call is idempotent, and must not return an error if the container has // already been removed. RemoveContainer(ctx context.Context, in *RemoveContainerRequest, opts ...grpc.CallOption) (*RemoveContainerResponse, error) // ListContainers lists all containers by filters. ListContainers(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error) // ContainerStatus returns status of the container. If the container is not // present, returns an error. ContainerStatus(ctx context.Context, in *ContainerStatusRequest, opts ...grpc.CallOption) (*ContainerStatusResponse, error) // UpdateContainerResources updates ContainerConfig of the container. UpdateContainerResources(ctx context.Context, in *UpdateContainerResourcesRequest, opts ...grpc.CallOption) (*UpdateContainerResourcesResponse, error) // ReopenContainerLog asks runtime to reopen the stdout/stderr log file // for the container. This is often called after the log file has been // rotated. If the container is not running, container runtime can choose // to either create a new log file and return nil, or return an error. // Once it returns error, new container log file MUST NOT be created. ReopenContainerLog(ctx context.Context, in *ReopenContainerLogRequest, opts ...grpc.CallOption) (*ReopenContainerLogResponse, error) // ExecSync runs a command in a container synchronously. ExecSync(ctx context.Context, in *ExecSyncRequest, opts ...grpc.CallOption) (*ExecSyncResponse, error) // Exec prepares a streaming endpoint to execute a command in the container. Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error) // Attach prepares a streaming endpoint to attach to a running container. Attach(ctx context.Context, in *AttachRequest, opts ...grpc.CallOption) (*AttachResponse, error) // PortForward prepares a streaming endpoint to forward ports from a PodSandbox. PortForward(ctx context.Context, in *PortForwardRequest, opts ...grpc.CallOption) (*PortForwardResponse, error) // ContainerStats returns stats of the container. If the container does not // exist, the call returns an error. ContainerStats(ctx context.Context, in *ContainerStatsRequest, opts ...grpc.CallOption) (*ContainerStatsResponse, error) // ListContainerStats returns stats of all running containers. ListContainerStats(ctx context.Context, in *ListContainerStatsRequest, opts ...grpc.CallOption) (*ListContainerStatsResponse, error) // UpdateRuntimeConfig updates the runtime configuration based on the given request. UpdateRuntimeConfig(ctx context.Context, in *UpdateRuntimeConfigRequest, opts ...grpc.CallOption) (*UpdateRuntimeConfigResponse, error) // Status returns the status of the runtime. Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) } type runtimeServiceClient struct { cc *grpc.ClientConn } func NewRuntimeServiceClient(cc *grpc.ClientConn) RuntimeServiceClient { return &runtimeServiceClient{cc} } func (c *runtimeServiceClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) { out := new(VersionResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/Version", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) RunPodSandbox(ctx context.Context, in *RunPodSandboxRequest, opts ...grpc.CallOption) (*RunPodSandboxResponse, error) { out := new(RunPodSandboxResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/RunPodSandbox", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) StopPodSandbox(ctx context.Context, in *StopPodSandboxRequest, opts ...grpc.CallOption) (*StopPodSandboxResponse, error) { out := new(StopPodSandboxResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/StopPodSandbox", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) RemovePodSandbox(ctx context.Context, in *RemovePodSandboxRequest, opts ...grpc.CallOption) (*RemovePodSandboxResponse, error) { out := new(RemovePodSandboxResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/RemovePodSandbox", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) PodSandboxStatus(ctx context.Context, in *PodSandboxStatusRequest, opts ...grpc.CallOption) (*PodSandboxStatusResponse, error) { out := new(PodSandboxStatusResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/PodSandboxStatus", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ListPodSandbox(ctx context.Context, in *ListPodSandboxRequest, opts ...grpc.CallOption) (*ListPodSandboxResponse, error) { out := new(ListPodSandboxResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/ListPodSandbox", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) CreateContainer(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error) { out := new(CreateContainerResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/CreateContainer", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) StartContainer(ctx context.Context, in *StartContainerRequest, opts ...grpc.CallOption) (*StartContainerResponse, error) { out := new(StartContainerResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/StartContainer", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) StopContainer(ctx context.Context, in *StopContainerRequest, opts ...grpc.CallOption) (*StopContainerResponse, error) { out := new(StopContainerResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/StopContainer", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) RemoveContainer(ctx context.Context, in *RemoveContainerRequest, opts ...grpc.CallOption) (*RemoveContainerResponse, error) { out := new(RemoveContainerResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/RemoveContainer", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ListContainers(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error) { out := new(ListContainersResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/ListContainers", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ContainerStatus(ctx context.Context, in *ContainerStatusRequest, opts ...grpc.CallOption) (*ContainerStatusResponse, error) { out := new(ContainerStatusResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/ContainerStatus", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) UpdateContainerResources(ctx context.Context, in *UpdateContainerResourcesRequest, opts ...grpc.CallOption) (*UpdateContainerResourcesResponse, error) { out := new(UpdateContainerResourcesResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/UpdateContainerResources", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ReopenContainerLog(ctx context.Context, in *ReopenContainerLogRequest, opts ...grpc.CallOption) (*ReopenContainerLogResponse, error) { out := new(ReopenContainerLogResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/ReopenContainerLog", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ExecSync(ctx context.Context, in *ExecSyncRequest, opts ...grpc.CallOption) (*ExecSyncResponse, error) { out := new(ExecSyncResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/ExecSync", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error) { out := new(ExecResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/Exec", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) Attach(ctx context.Context, in *AttachRequest, opts ...grpc.CallOption) (*AttachResponse, error) { out := new(AttachResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/Attach", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) PortForward(ctx context.Context, in *PortForwardRequest, opts ...grpc.CallOption) (*PortForwardResponse, error) { out := new(PortForwardResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/PortForward", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ContainerStats(ctx context.Context, in *ContainerStatsRequest, opts ...grpc.CallOption) (*ContainerStatsResponse, error) { out := new(ContainerStatsResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/ContainerStats", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) ListContainerStats(ctx context.Context, in *ListContainerStatsRequest, opts ...grpc.CallOption) (*ListContainerStatsResponse, error) { out := new(ListContainerStatsResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/ListContainerStats", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) UpdateRuntimeConfig(ctx context.Context, in *UpdateRuntimeConfigRequest, opts ...grpc.CallOption) (*UpdateRuntimeConfigResponse, error) { out := new(UpdateRuntimeConfigResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/UpdateRuntimeConfig", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *runtimeServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { out := new(StatusResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.RuntimeService/Status", in, out, opts...) if err != nil { return nil, err } return out, nil } // RuntimeServiceServer is the server API for RuntimeService service. type RuntimeServiceServer interface { // Version returns the runtime name, runtime version, and runtime API version. Version(context.Context, *VersionRequest) (*VersionResponse, error) // RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure // the sandbox is in the ready state on success. RunPodSandbox(context.Context, *RunPodSandboxRequest) (*RunPodSandboxResponse, error) // StopPodSandbox stops any running process that is part of the sandbox and // reclaims network resources (e.g., IP addresses) allocated to the sandbox. // If there are any running containers in the sandbox, they must be forcibly // terminated. // This call is idempotent, and must not return an error if all relevant // resources have already been reclaimed. kubelet will call StopPodSandbox // at least once before calling RemovePodSandbox. It will also attempt to // reclaim resources eagerly, as soon as a sandbox is not needed. Hence, // multiple StopPodSandbox calls are expected. StopPodSandbox(context.Context, *StopPodSandboxRequest) (*StopPodSandboxResponse, error) // RemovePodSandbox removes the sandbox. If there are any running containers // in the sandbox, they must be forcibly terminated and removed. // This call is idempotent, and must not return an error if the sandbox has // already been removed. RemovePodSandbox(context.Context, *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error) // PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not // present, returns an error. PodSandboxStatus(context.Context, *PodSandboxStatusRequest) (*PodSandboxStatusResponse, error) // ListPodSandbox returns a list of PodSandboxes. ListPodSandbox(context.Context, *ListPodSandboxRequest) (*ListPodSandboxResponse, error) // CreateContainer creates a new container in specified PodSandbox CreateContainer(context.Context, *CreateContainerRequest) (*CreateContainerResponse, error) // StartContainer starts the container. StartContainer(context.Context, *StartContainerRequest) (*StartContainerResponse, error) // StopContainer stops a running container with a grace period (i.e., timeout). // This call is idempotent, and must not return an error if the container has // already been stopped. // TODO: what must the runtime do after the grace period is reached? StopContainer(context.Context, *StopContainerRequest) (*StopContainerResponse, error) // RemoveContainer removes the container. If the container is running, the // container must be forcibly removed. // This call is idempotent, and must not return an error if the container has // already been removed. RemoveContainer(context.Context, *RemoveContainerRequest) (*RemoveContainerResponse, error) // ListContainers lists all containers by filters. ListContainers(context.Context, *ListContainersRequest) (*ListContainersResponse, error) // ContainerStatus returns status of the container. If the container is not // present, returns an error. ContainerStatus(context.Context, *ContainerStatusRequest) (*ContainerStatusResponse, error) // UpdateContainerResources updates ContainerConfig of the container. UpdateContainerResources(context.Context, *UpdateContainerResourcesRequest) (*UpdateContainerResourcesResponse, error) // ReopenContainerLog asks runtime to reopen the stdout/stderr log file // for the container. This is often called after the log file has been // rotated. If the container is not running, container runtime can choose // to either create a new log file and return nil, or return an error. // Once it returns error, new container log file MUST NOT be created. ReopenContainerLog(context.Context, *ReopenContainerLogRequest) (*ReopenContainerLogResponse, error) // ExecSync runs a command in a container synchronously. ExecSync(context.Context, *ExecSyncRequest) (*ExecSyncResponse, error) // Exec prepares a streaming endpoint to execute a command in the container. Exec(context.Context, *ExecRequest) (*ExecResponse, error) // Attach prepares a streaming endpoint to attach to a running container. Attach(context.Context, *AttachRequest) (*AttachResponse, error) // PortForward prepares a streaming endpoint to forward ports from a PodSandbox. PortForward(context.Context, *PortForwardRequest) (*PortForwardResponse, error) // ContainerStats returns stats of the container. If the container does not // exist, the call returns an error. ContainerStats(context.Context, *ContainerStatsRequest) (*ContainerStatsResponse, error) // ListContainerStats returns stats of all running containers. ListContainerStats(context.Context, *ListContainerStatsRequest) (*ListContainerStatsResponse, error) // UpdateRuntimeConfig updates the runtime configuration based on the given request. UpdateRuntimeConfig(context.Context, *UpdateRuntimeConfigRequest) (*UpdateRuntimeConfigResponse, error) // Status returns the status of the runtime. Status(context.Context, *StatusRequest) (*StatusResponse, error) } // UnimplementedRuntimeServiceServer can be embedded to have forward compatible implementations. type UnimplementedRuntimeServiceServer struct { } func (*UnimplementedRuntimeServiceServer) Version(ctx context.Context, req *VersionRequest) (*VersionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Version not implemented") } func (*UnimplementedRuntimeServiceServer) RunPodSandbox(ctx context.Context, req *RunPodSandboxRequest) (*RunPodSandboxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RunPodSandbox not implemented") } func (*UnimplementedRuntimeServiceServer) StopPodSandbox(ctx context.Context, req *StopPodSandboxRequest) (*StopPodSandboxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StopPodSandbox not implemented") } func (*UnimplementedRuntimeServiceServer) RemovePodSandbox(ctx context.Context, req *RemovePodSandboxRequest) (*RemovePodSandboxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemovePodSandbox not implemented") } func (*UnimplementedRuntimeServiceServer) PodSandboxStatus(ctx context.Context, req *PodSandboxStatusRequest) (*PodSandboxStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PodSandboxStatus not implemented") } func (*UnimplementedRuntimeServiceServer) ListPodSandbox(ctx context.Context, req *ListPodSandboxRequest) (*ListPodSandboxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListPodSandbox not implemented") } func (*UnimplementedRuntimeServiceServer) CreateContainer(ctx context.Context, req *CreateContainerRequest) (*CreateContainerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateContainer not implemented") } func (*UnimplementedRuntimeServiceServer) StartContainer(ctx context.Context, req *StartContainerRequest) (*StartContainerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StartContainer not implemented") } func (*UnimplementedRuntimeServiceServer) StopContainer(ctx context.Context, req *StopContainerRequest) (*StopContainerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StopContainer not implemented") } func (*UnimplementedRuntimeServiceServer) RemoveContainer(ctx context.Context, req *RemoveContainerRequest) (*RemoveContainerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveContainer not implemented") } func (*UnimplementedRuntimeServiceServer) ListContainers(ctx context.Context, req *ListContainersRequest) (*ListContainersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListContainers not implemented") } func (*UnimplementedRuntimeServiceServer) ContainerStatus(ctx context.Context, req *ContainerStatusRequest) (*ContainerStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ContainerStatus not implemented") } func (*UnimplementedRuntimeServiceServer) UpdateContainerResources(ctx context.Context, req *UpdateContainerResourcesRequest) (*UpdateContainerResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateContainerResources not implemented") } func (*UnimplementedRuntimeServiceServer) ReopenContainerLog(ctx context.Context, req *ReopenContainerLogRequest) (*ReopenContainerLogResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ReopenContainerLog not implemented") } func (*UnimplementedRuntimeServiceServer) ExecSync(ctx context.Context, req *ExecSyncRequest) (*ExecSyncResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExecSync not implemented") } func (*UnimplementedRuntimeServiceServer) Exec(ctx context.Context, req *ExecRequest) (*ExecResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented") } func (*UnimplementedRuntimeServiceServer) Attach(ctx context.Context, req *AttachRequest) (*AttachResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Attach not implemented") } func (*UnimplementedRuntimeServiceServer) PortForward(ctx context.Context, req *PortForwardRequest) (*PortForwardResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PortForward not implemented") } func (*UnimplementedRuntimeServiceServer) ContainerStats(ctx context.Context, req *ContainerStatsRequest) (*ContainerStatsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ContainerStats not implemented") } func (*UnimplementedRuntimeServiceServer) ListContainerStats(ctx context.Context, req *ListContainerStatsRequest) (*ListContainerStatsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListContainerStats not implemented") } func (*UnimplementedRuntimeServiceServer) UpdateRuntimeConfig(ctx context.Context, req *UpdateRuntimeConfigRequest) (*UpdateRuntimeConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateRuntimeConfig not implemented") } func (*UnimplementedRuntimeServiceServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") } func RegisterRuntimeServiceServer(s *grpc.Server, srv RuntimeServiceServer) { s.RegisterService(&_RuntimeService_serviceDesc, srv) } func _RuntimeService_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(VersionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).Version(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/Version", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).Version(ctx, req.(*VersionRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_RunPodSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RunPodSandboxRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).RunPodSandbox(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/RunPodSandbox", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).RunPodSandbox(ctx, req.(*RunPodSandboxRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_StopPodSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StopPodSandboxRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).StopPodSandbox(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/StopPodSandbox", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).StopPodSandbox(ctx, req.(*StopPodSandboxRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_RemovePodSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RemovePodSandboxRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).RemovePodSandbox(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/RemovePodSandbox", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).RemovePodSandbox(ctx, req.(*RemovePodSandboxRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_PodSandboxStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PodSandboxStatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).PodSandboxStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/PodSandboxStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).PodSandboxStatus(ctx, req.(*PodSandboxStatusRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ListPodSandbox_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListPodSandboxRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ListPodSandbox(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/ListPodSandbox", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ListPodSandbox(ctx, req.(*ListPodSandboxRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_CreateContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateContainerRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).CreateContainer(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/CreateContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).CreateContainer(ctx, req.(*CreateContainerRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_StartContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StartContainerRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).StartContainer(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/StartContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).StartContainer(ctx, req.(*StartContainerRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_StopContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StopContainerRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).StopContainer(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/StopContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).StopContainer(ctx, req.(*StopContainerRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_RemoveContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RemoveContainerRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).RemoveContainer(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/RemoveContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).RemoveContainer(ctx, req.(*RemoveContainerRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ListContainers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListContainersRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ListContainers(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/ListContainers", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ListContainers(ctx, req.(*ListContainersRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ContainerStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ContainerStatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ContainerStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/ContainerStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ContainerStatus(ctx, req.(*ContainerStatusRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_UpdateContainerResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateContainerResourcesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).UpdateContainerResources(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/UpdateContainerResources", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).UpdateContainerResources(ctx, req.(*UpdateContainerResourcesRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ReopenContainerLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ReopenContainerLogRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ReopenContainerLog(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/ReopenContainerLog", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ReopenContainerLog(ctx, req.(*ReopenContainerLogRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ExecSync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ExecSyncRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ExecSync(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/ExecSync", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ExecSync(ctx, req.(*ExecSyncRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ExecRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).Exec(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/Exec", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).Exec(ctx, req.(*ExecRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_Attach_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AttachRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).Attach(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/Attach", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).Attach(ctx, req.(*AttachRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_PortForward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PortForwardRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).PortForward(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/PortForward", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).PortForward(ctx, req.(*PortForwardRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ContainerStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ContainerStatsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ContainerStats(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/ContainerStats", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ContainerStats(ctx, req.(*ContainerStatsRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_ListContainerStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListContainerStatsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).ListContainerStats(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/ListContainerStats", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).ListContainerStats(ctx, req.(*ListContainerStatsRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_UpdateRuntimeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateRuntimeConfigRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).UpdateRuntimeConfig(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/UpdateRuntimeConfig", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).UpdateRuntimeConfig(ctx, req.(*UpdateRuntimeConfigRequest)) } return interceptor(ctx, in, info, handler) } func _RuntimeService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(RuntimeServiceServer).Status(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.RuntimeService/Status", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RuntimeServiceServer).Status(ctx, req.(*StatusRequest)) } return interceptor(ctx, in, info, handler) } var _RuntimeService_serviceDesc = grpc.ServiceDesc{ ServiceName: "runtime.v1alpha2.RuntimeService", HandlerType: (*RuntimeServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Version", Handler: _RuntimeService_Version_Handler, }, { MethodName: "RunPodSandbox", Handler: _RuntimeService_RunPodSandbox_Handler, }, { MethodName: "StopPodSandbox", Handler: _RuntimeService_StopPodSandbox_Handler, }, { MethodName: "RemovePodSandbox", Handler: _RuntimeService_RemovePodSandbox_Handler, }, { MethodName: "PodSandboxStatus", Handler: _RuntimeService_PodSandboxStatus_Handler, }, { MethodName: "ListPodSandbox", Handler: _RuntimeService_ListPodSandbox_Handler, }, { MethodName: "CreateContainer", Handler: _RuntimeService_CreateContainer_Handler, }, { MethodName: "StartContainer", Handler: _RuntimeService_StartContainer_Handler, }, { MethodName: "StopContainer", Handler: _RuntimeService_StopContainer_Handler, }, { MethodName: "RemoveContainer", Handler: _RuntimeService_RemoveContainer_Handler, }, { MethodName: "ListContainers", Handler: _RuntimeService_ListContainers_Handler, }, { MethodName: "ContainerStatus", Handler: _RuntimeService_ContainerStatus_Handler, }, { MethodName: "UpdateContainerResources", Handler: _RuntimeService_UpdateContainerResources_Handler, }, { MethodName: "ReopenContainerLog", Handler: _RuntimeService_ReopenContainerLog_Handler, }, { MethodName: "ExecSync", Handler: _RuntimeService_ExecSync_Handler, }, { MethodName: "Exec", Handler: _RuntimeService_Exec_Handler, }, { MethodName: "Attach", Handler: _RuntimeService_Attach_Handler, }, { MethodName: "PortForward", Handler: _RuntimeService_PortForward_Handler, }, { MethodName: "ContainerStats", Handler: _RuntimeService_ContainerStats_Handler, }, { MethodName: "ListContainerStats", Handler: _RuntimeService_ListContainerStats_Handler, }, { MethodName: "UpdateRuntimeConfig", Handler: _RuntimeService_UpdateRuntimeConfig_Handler, }, { MethodName: "Status", Handler: _RuntimeService_Status_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } // ImageServiceClient is the client API for ImageService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ImageServiceClient interface { // ListImages lists existing images. ListImages(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error) // ImageStatus returns the status of the image. If the image is not // present, returns a response with ImageStatusResponse.Image set to // nil. ImageStatus(ctx context.Context, in *ImageStatusRequest, opts ...grpc.CallOption) (*ImageStatusResponse, error) // PullImage pulls an image with authentication config. PullImage(ctx context.Context, in *PullImageRequest, opts ...grpc.CallOption) (*PullImageResponse, error) // RemoveImage removes the image. // This call is idempotent, and must not return an error if the image has // already been removed. RemoveImage(ctx context.Context, in *RemoveImageRequest, opts ...grpc.CallOption) (*RemoveImageResponse, error) // ImageFSInfo returns information of the filesystem that is used to store images. ImageFsInfo(ctx context.Context, in *ImageFsInfoRequest, opts ...grpc.CallOption) (*ImageFsInfoResponse, error) } type imageServiceClient struct { cc *grpc.ClientConn } func NewImageServiceClient(cc *grpc.ClientConn) ImageServiceClient { return &imageServiceClient{cc} } func (c *imageServiceClient) ListImages(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error) { out := new(ListImagesResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.ImageService/ListImages", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *imageServiceClient) ImageStatus(ctx context.Context, in *ImageStatusRequest, opts ...grpc.CallOption) (*ImageStatusResponse, error) { out := new(ImageStatusResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.ImageService/ImageStatus", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *imageServiceClient) PullImage(ctx context.Context, in *PullImageRequest, opts ...grpc.CallOption) (*PullImageResponse, error) { out := new(PullImageResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.ImageService/PullImage", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *imageServiceClient) RemoveImage(ctx context.Context, in *RemoveImageRequest, opts ...grpc.CallOption) (*RemoveImageResponse, error) { out := new(RemoveImageResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.ImageService/RemoveImage", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *imageServiceClient) ImageFsInfo(ctx context.Context, in *ImageFsInfoRequest, opts ...grpc.CallOption) (*ImageFsInfoResponse, error) { out := new(ImageFsInfoResponse) err := c.cc.Invoke(ctx, "/runtime.v1alpha2.ImageService/ImageFsInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } // ImageServiceServer is the server API for ImageService service. type ImageServiceServer interface { // ListImages lists existing images. ListImages(context.Context, *ListImagesRequest) (*ListImagesResponse, error) // ImageStatus returns the status of the image. If the image is not // present, returns a response with ImageStatusResponse.Image set to // nil. ImageStatus(context.Context, *ImageStatusRequest) (*ImageStatusResponse, error) // PullImage pulls an image with authentication config. PullImage(context.Context, *PullImageRequest) (*PullImageResponse, error) // RemoveImage removes the image. // This call is idempotent, and must not return an error if the image has // already been removed. RemoveImage(context.Context, *RemoveImageRequest) (*RemoveImageResponse, error) // ImageFSInfo returns information of the filesystem that is used to store images. ImageFsInfo(context.Context, *ImageFsInfoRequest) (*ImageFsInfoResponse, error) } // UnimplementedImageServiceServer can be embedded to have forward compatible implementations. type UnimplementedImageServiceServer struct { } func (*UnimplementedImageServiceServer) ListImages(ctx context.Context, req *ListImagesRequest) (*ListImagesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListImages not implemented") } func (*UnimplementedImageServiceServer) ImageStatus(ctx context.Context, req *ImageStatusRequest) (*ImageStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ImageStatus not implemented") } func (*UnimplementedImageServiceServer) PullImage(ctx context.Context, req *PullImageRequest) (*PullImageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PullImage not implemented") } func (*UnimplementedImageServiceServer) RemoveImage(ctx context.Context, req *RemoveImageRequest) (*RemoveImageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveImage not implemented") } func (*UnimplementedImageServiceServer) ImageFsInfo(ctx context.Context, req *ImageFsInfoRequest) (*ImageFsInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ImageFsInfo not implemented") } func RegisterImageServiceServer(s *grpc.Server, srv ImageServiceServer) { s.RegisterService(&_ImageService_serviceDesc, srv) } func _ImageService_ListImages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListImagesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ImageServiceServer).ListImages(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.ImageService/ListImages", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ImageServiceServer).ListImages(ctx, req.(*ListImagesRequest)) } return interceptor(ctx, in, info, handler) } func _ImageService_ImageStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ImageStatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ImageServiceServer).ImageStatus(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.ImageService/ImageStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ImageServiceServer).ImageStatus(ctx, req.(*ImageStatusRequest)) } return interceptor(ctx, in, info, handler) } func _ImageService_PullImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PullImageRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ImageServiceServer).PullImage(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.ImageService/PullImage", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ImageServiceServer).PullImage(ctx, req.(*PullImageRequest)) } return interceptor(ctx, in, info, handler) } func _ImageService_RemoveImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RemoveImageRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ImageServiceServer).RemoveImage(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.ImageService/RemoveImage", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ImageServiceServer).RemoveImage(ctx, req.(*RemoveImageRequest)) } return interceptor(ctx, in, info, handler) } func _ImageService_ImageFsInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ImageFsInfoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ImageServiceServer).ImageFsInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/runtime.v1alpha2.ImageService/ImageFsInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ImageServiceServer).ImageFsInfo(ctx, req.(*ImageFsInfoRequest)) } return interceptor(ctx, in, info, handler) } var _ImageService_serviceDesc = grpc.ServiceDesc{ ServiceName: "runtime.v1alpha2.ImageService", HandlerType: (*ImageServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListImages", Handler: _ImageService_ListImages_Handler, }, { MethodName: "ImageStatus", Handler: _ImageService_ImageStatus_Handler, }, { MethodName: "PullImage", Handler: _ImageService_PullImage_Handler, }, { MethodName: "RemoveImage", Handler: _ImageService_RemoveImage_Handler, }, { MethodName: "ImageFsInfo", Handler: _ImageService_ImageFsInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } func (m *VersionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *VersionRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *VersionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Version) > 0 { i -= len(m.Version) copy(dAtA[i:], m.Version) i = encodeVarintApi(dAtA, i, uint64(len(m.Version))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *VersionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *VersionResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *VersionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.RuntimeApiVersion) > 0 { i -= len(m.RuntimeApiVersion) copy(dAtA[i:], m.RuntimeApiVersion) i = encodeVarintApi(dAtA, i, uint64(len(m.RuntimeApiVersion))) i-- dAtA[i] = 0x22 } if len(m.RuntimeVersion) > 0 { i -= len(m.RuntimeVersion) copy(dAtA[i:], m.RuntimeVersion) i = encodeVarintApi(dAtA, i, uint64(len(m.RuntimeVersion))) i-- dAtA[i] = 0x1a } if len(m.RuntimeName) > 0 { i -= len(m.RuntimeName) copy(dAtA[i:], m.RuntimeName) i = encodeVarintApi(dAtA, i, uint64(len(m.RuntimeName))) i-- dAtA[i] = 0x12 } if len(m.Version) > 0 { i -= len(m.Version) copy(dAtA[i:], m.Version) i = encodeVarintApi(dAtA, i, uint64(len(m.Version))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *DNSConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DNSConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DNSConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Options) > 0 { for iNdEx := len(m.Options) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Options[iNdEx]) copy(dAtA[i:], m.Options[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.Options[iNdEx]))) i-- dAtA[i] = 0x1a } } if len(m.Searches) > 0 { for iNdEx := len(m.Searches) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Searches[iNdEx]) copy(dAtA[i:], m.Searches[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.Searches[iNdEx]))) i-- dAtA[i] = 0x12 } } if len(m.Servers) > 0 { for iNdEx := len(m.Servers) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Servers[iNdEx]) copy(dAtA[i:], m.Servers[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.Servers[iNdEx]))) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *PortMapping) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PortMapping) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PortMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.HostIp) > 0 { i -= len(m.HostIp) copy(dAtA[i:], m.HostIp) i = encodeVarintApi(dAtA, i, uint64(len(m.HostIp))) i-- dAtA[i] = 0x22 } if m.HostPort != 0 { i = encodeVarintApi(dAtA, i, uint64(m.HostPort)) i-- dAtA[i] = 0x18 } if m.ContainerPort != 0 { i = encodeVarintApi(dAtA, i, uint64(m.ContainerPort)) i-- dAtA[i] = 0x10 } if m.Protocol != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Protocol)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *Mount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Mount) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Propagation != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Propagation)) i-- dAtA[i] = 0x28 } if m.SelinuxRelabel { i-- if m.SelinuxRelabel { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x20 } if m.Readonly { i-- if m.Readonly { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if len(m.HostPath) > 0 { i -= len(m.HostPath) copy(dAtA[i:], m.HostPath) i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath))) i-- dAtA[i] = 0x12 } if len(m.ContainerPath) > 0 { i -= len(m.ContainerPath) copy(dAtA[i:], m.ContainerPath) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *NamespaceOption) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NamespaceOption) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NamespaceOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Ipc != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Ipc)) i-- dAtA[i] = 0x18 } if m.Pid != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Pid)) i-- dAtA[i] = 0x10 } if m.Network != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Network)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *Int64Value) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Int64Value) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Int64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Value != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *LinuxSandboxSecurityContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxSandboxSecurityContext) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *LinuxSandboxSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.RunAsGroup != nil { { size, err := m.RunAsGroup.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 } if len(m.SeccompProfilePath) > 0 { i -= len(m.SeccompProfilePath) copy(dAtA[i:], m.SeccompProfilePath) i = encodeVarintApi(dAtA, i, uint64(len(m.SeccompProfilePath))) i-- dAtA[i] = 0x3a } if m.Privileged { i-- if m.Privileged { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x30 } if len(m.SupplementalGroups) > 0 { dAtA3 := make([]byte, len(m.SupplementalGroups)*10) var j2 int for _, num1 := range m.SupplementalGroups { num := uint64(num1) for num >= 1<<7 { dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 j2++ } dAtA3[j2] = uint8(num) j2++ } i -= j2 copy(dAtA[i:], dAtA3[:j2]) i = encodeVarintApi(dAtA, i, uint64(j2)) i-- dAtA[i] = 0x2a } if m.ReadonlyRootfs { i-- if m.ReadonlyRootfs { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x20 } if m.RunAsUser != nil { { size, err := m.RunAsUser.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.SelinuxOptions != nil { { size, err := m.SelinuxOptions.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.NamespaceOptions != nil { { size, err := m.NamespaceOptions.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *LinuxPodSandboxConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxPodSandboxConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *LinuxPodSandboxConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Sysctls) > 0 { for k := range m.Sysctls { v := m.Sysctls[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x1a } } if m.SecurityContext != nil { { size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.CgroupParent) > 0 { i -= len(m.CgroupParent) copy(dAtA[i:], m.CgroupParent) i = encodeVarintApi(dAtA, i, uint64(len(m.CgroupParent))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PodSandboxMetadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxMetadata) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodSandboxMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Attempt != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Attempt)) i-- dAtA[i] = 0x20 } if len(m.Namespace) > 0 { i -= len(m.Namespace) copy(dAtA[i:], m.Namespace) i = encodeVarintApi(dAtA, i, uint64(len(m.Namespace))) i-- dAtA[i] = 0x1a } if len(m.Uid) > 0 { i -= len(m.Uid) copy(dAtA[i:], m.Uid) i = encodeVarintApi(dAtA, i, uint64(len(m.Uid))) i-- dAtA[i] = 0x12 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PodSandboxConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodSandboxConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Linux != nil { { size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 } if len(m.Annotations) > 0 { for k := range m.Annotations { v := m.Annotations[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3a } } if len(m.Labels) > 0 { for k := range m.Labels { v := m.Labels[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x32 } } if len(m.PortMappings) > 0 { for iNdEx := len(m.PortMappings) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.PortMappings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } } if m.DnsConfig != nil { { size, err := m.DnsConfig.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } if len(m.LogDirectory) > 0 { i -= len(m.LogDirectory) copy(dAtA[i:], m.LogDirectory) i = encodeVarintApi(dAtA, i, uint64(len(m.LogDirectory))) i-- dAtA[i] = 0x1a } if len(m.Hostname) > 0 { i -= len(m.Hostname) copy(dAtA[i:], m.Hostname) i = encodeVarintApi(dAtA, i, uint64(len(m.Hostname))) i-- dAtA[i] = 0x12 } if m.Metadata != nil { { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RunPodSandboxRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RunPodSandboxRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RunPodSandboxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.RuntimeHandler) > 0 { i -= len(m.RuntimeHandler) copy(dAtA[i:], m.RuntimeHandler) i = encodeVarintApi(dAtA, i, uint64(len(m.RuntimeHandler))) i-- dAtA[i] = 0x12 } if m.Config != nil { { size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RunPodSandboxResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RunPodSandboxResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RunPodSandboxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.PodSandboxId) > 0 { i -= len(m.PodSandboxId) copy(dAtA[i:], m.PodSandboxId) i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *StopPodSandboxRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StopPodSandboxRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *StopPodSandboxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.PodSandboxId) > 0 { i -= len(m.PodSandboxId) copy(dAtA[i:], m.PodSandboxId) i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *StopPodSandboxResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StopPodSandboxResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *StopPodSandboxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *RemovePodSandboxRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemovePodSandboxRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RemovePodSandboxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.PodSandboxId) > 0 { i -= len(m.PodSandboxId) copy(dAtA[i:], m.PodSandboxId) i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RemovePodSandboxResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemovePodSandboxResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RemovePodSandboxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *PodSandboxStatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxStatusRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodSandboxStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Verbose { i-- if m.Verbose { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if len(m.PodSandboxId) > 0 { i -= len(m.PodSandboxId) copy(dAtA[i:], m.PodSandboxId) i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PodIP) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodIP) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodIP) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Ip) > 0 { i -= len(m.Ip) copy(dAtA[i:], m.Ip) i = encodeVarintApi(dAtA, i, uint64(len(m.Ip))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PodSandboxNetworkStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxNetworkStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodSandboxNetworkStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.AdditionalIps) > 0 { for iNdEx := len(m.AdditionalIps) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.AdditionalIps[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } } if len(m.Ip) > 0 { i -= len(m.Ip) copy(dAtA[i:], m.Ip) i = encodeVarintApi(dAtA, i, uint64(len(m.Ip))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Namespace) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Namespace) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Namespace) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Options != nil { { size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } return len(dAtA) - i, nil } func (m *LinuxPodSandboxStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxPodSandboxStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *LinuxPodSandboxStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Namespaces != nil { { size, err := m.Namespaces.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PodSandboxStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodSandboxStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.RuntimeHandler) > 0 { i -= len(m.RuntimeHandler) copy(dAtA[i:], m.RuntimeHandler) i = encodeVarintApi(dAtA, i, uint64(len(m.RuntimeHandler))) i-- dAtA[i] = 0x4a } if len(m.Annotations) > 0 { for k := range m.Annotations { v := m.Annotations[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x42 } } if len(m.Labels) > 0 { for k := range m.Labels { v := m.Labels[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3a } } if m.Linux != nil { { size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x32 } if m.Network != nil { { size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } if m.CreatedAt != 0 { i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) i-- dAtA[i] = 0x20 } if m.State != 0 { i = encodeVarintApi(dAtA, i, uint64(m.State)) i-- dAtA[i] = 0x18 } if m.Metadata != nil { { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PodSandboxStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxStatusResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodSandboxStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Info) > 0 { for k := range m.Info { v := m.Info[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x12 } } if m.Status != nil { { size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PodSandboxStateValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxStateValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodSandboxStateValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.State != 0 { i = encodeVarintApi(dAtA, i, uint64(m.State)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *PodSandboxFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandboxFilter) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodSandboxFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.LabelSelector) > 0 { for k := range m.LabelSelector { v := m.LabelSelector[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x1a } } if m.State != nil { { size, err := m.State.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListPodSandboxRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListPodSandboxRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListPodSandboxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Filter != nil { { size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PodSandbox) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodSandbox) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodSandbox) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.RuntimeHandler) > 0 { i -= len(m.RuntimeHandler) copy(dAtA[i:], m.RuntimeHandler) i = encodeVarintApi(dAtA, i, uint64(len(m.RuntimeHandler))) i-- dAtA[i] = 0x3a } if len(m.Annotations) > 0 { for k := range m.Annotations { v := m.Annotations[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x32 } } if len(m.Labels) > 0 { for k := range m.Labels { v := m.Labels[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x2a } } if m.CreatedAt != 0 { i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) i-- dAtA[i] = 0x20 } if m.State != 0 { i = encodeVarintApi(dAtA, i, uint64(m.State)) i-- dAtA[i] = 0x18 } if m.Metadata != nil { { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListPodSandboxResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListPodSandboxResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListPodSandboxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Items) > 0 { for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ImageSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ImageSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Image) > 0 { i -= len(m.Image) copy(dAtA[i:], m.Image) i = encodeVarintApi(dAtA, i, uint64(len(m.Image))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *KeyValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Value) > 0 { i -= len(m.Value) copy(dAtA[i:], m.Value) i = encodeVarintApi(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0x12 } if len(m.Key) > 0 { i -= len(m.Key) copy(dAtA[i:], m.Key) i = encodeVarintApi(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *LinuxContainerResources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxContainerResources) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *LinuxContainerResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.CpusetMems) > 0 { i -= len(m.CpusetMems) copy(dAtA[i:], m.CpusetMems) i = encodeVarintApi(dAtA, i, uint64(len(m.CpusetMems))) i-- dAtA[i] = 0x3a } if len(m.CpusetCpus) > 0 { i -= len(m.CpusetCpus) copy(dAtA[i:], m.CpusetCpus) i = encodeVarintApi(dAtA, i, uint64(len(m.CpusetCpus))) i-- dAtA[i] = 0x32 } if m.OomScoreAdj != 0 { i = encodeVarintApi(dAtA, i, uint64(m.OomScoreAdj)) i-- dAtA[i] = 0x28 } if m.MemoryLimitInBytes != 0 { i = encodeVarintApi(dAtA, i, uint64(m.MemoryLimitInBytes)) i-- dAtA[i] = 0x20 } if m.CpuShares != 0 { i = encodeVarintApi(dAtA, i, uint64(m.CpuShares)) i-- dAtA[i] = 0x18 } if m.CpuQuota != 0 { i = encodeVarintApi(dAtA, i, uint64(m.CpuQuota)) i-- dAtA[i] = 0x10 } if m.CpuPeriod != 0 { i = encodeVarintApi(dAtA, i, uint64(m.CpuPeriod)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *SELinuxOption) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *SELinuxOption) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *SELinuxOption) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Level) > 0 { i -= len(m.Level) copy(dAtA[i:], m.Level) i = encodeVarintApi(dAtA, i, uint64(len(m.Level))) i-- dAtA[i] = 0x22 } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) i-- dAtA[i] = 0x1a } if len(m.Role) > 0 { i -= len(m.Role) copy(dAtA[i:], m.Role) i = encodeVarintApi(dAtA, i, uint64(len(m.Role))) i-- dAtA[i] = 0x12 } if len(m.User) > 0 { i -= len(m.User) copy(dAtA[i:], m.User) i = encodeVarintApi(dAtA, i, uint64(len(m.User))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Capability) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Capability) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Capability) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.DropCapabilities) > 0 { for iNdEx := len(m.DropCapabilities) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.DropCapabilities[iNdEx]) copy(dAtA[i:], m.DropCapabilities[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.DropCapabilities[iNdEx]))) i-- dAtA[i] = 0x12 } } if len(m.AddCapabilities) > 0 { for iNdEx := len(m.AddCapabilities) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.AddCapabilities[iNdEx]) copy(dAtA[i:], m.AddCapabilities[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.AddCapabilities[iNdEx]))) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *LinuxContainerSecurityContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxContainerSecurityContext) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *LinuxContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ReadonlyPaths) > 0 { for iNdEx := len(m.ReadonlyPaths) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.ReadonlyPaths[iNdEx]) copy(dAtA[i:], m.ReadonlyPaths[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.ReadonlyPaths[iNdEx]))) i-- dAtA[i] = 0x72 } } if len(m.MaskedPaths) > 0 { for iNdEx := len(m.MaskedPaths) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.MaskedPaths[iNdEx]) copy(dAtA[i:], m.MaskedPaths[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.MaskedPaths[iNdEx]))) i-- dAtA[i] = 0x6a } } if m.RunAsGroup != nil { { size, err := m.RunAsGroup.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x62 } if m.NoNewPrivs { i-- if m.NoNewPrivs { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x58 } if len(m.SeccompProfilePath) > 0 { i -= len(m.SeccompProfilePath) copy(dAtA[i:], m.SeccompProfilePath) i = encodeVarintApi(dAtA, i, uint64(len(m.SeccompProfilePath))) i-- dAtA[i] = 0x52 } if len(m.ApparmorProfile) > 0 { i -= len(m.ApparmorProfile) copy(dAtA[i:], m.ApparmorProfile) i = encodeVarintApi(dAtA, i, uint64(len(m.ApparmorProfile))) i-- dAtA[i] = 0x4a } if len(m.SupplementalGroups) > 0 { dAtA23 := make([]byte, len(m.SupplementalGroups)*10) var j22 int for _, num1 := range m.SupplementalGroups { num := uint64(num1) for num >= 1<<7 { dAtA23[j22] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 j22++ } dAtA23[j22] = uint8(num) j22++ } i -= j22 copy(dAtA[i:], dAtA23[:j22]) i = encodeVarintApi(dAtA, i, uint64(j22)) i-- dAtA[i] = 0x42 } if m.ReadonlyRootfs { i-- if m.ReadonlyRootfs { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x38 } if len(m.RunAsUsername) > 0 { i -= len(m.RunAsUsername) copy(dAtA[i:], m.RunAsUsername) i = encodeVarintApi(dAtA, i, uint64(len(m.RunAsUsername))) i-- dAtA[i] = 0x32 } if m.RunAsUser != nil { { size, err := m.RunAsUser.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } if m.SelinuxOptions != nil { { size, err := m.SelinuxOptions.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } if m.NamespaceOptions != nil { { size, err := m.NamespaceOptions.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.Privileged { i-- if m.Privileged { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if m.Capabilities != nil { { size, err := m.Capabilities.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *LinuxContainerConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LinuxContainerConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *LinuxContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.SecurityContext != nil { { size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Resources != nil { { size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *WindowsContainerSecurityContext) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *WindowsContainerSecurityContext) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *WindowsContainerSecurityContext) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.CredentialSpec) > 0 { i -= len(m.CredentialSpec) copy(dAtA[i:], m.CredentialSpec) i = encodeVarintApi(dAtA, i, uint64(len(m.CredentialSpec))) i-- dAtA[i] = 0x12 } if len(m.RunAsUsername) > 0 { i -= len(m.RunAsUsername) copy(dAtA[i:], m.RunAsUsername) i = encodeVarintApi(dAtA, i, uint64(len(m.RunAsUsername))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *WindowsContainerConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *WindowsContainerConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *WindowsContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.SecurityContext != nil { { size, err := m.SecurityContext.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Resources != nil { { size, err := m.Resources.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *WindowsContainerResources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *WindowsContainerResources) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *WindowsContainerResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.MemoryLimitInBytes != 0 { i = encodeVarintApi(dAtA, i, uint64(m.MemoryLimitInBytes)) i-- dAtA[i] = 0x20 } if m.CpuMaximum != 0 { i = encodeVarintApi(dAtA, i, uint64(m.CpuMaximum)) i-- dAtA[i] = 0x18 } if m.CpuCount != 0 { i = encodeVarintApi(dAtA, i, uint64(m.CpuCount)) i-- dAtA[i] = 0x10 } if m.CpuShares != 0 { i = encodeVarintApi(dAtA, i, uint64(m.CpuShares)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *ContainerMetadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerMetadata) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Attempt != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Attempt)) i-- dAtA[i] = 0x10 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Device) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Device) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Permissions) > 0 { i -= len(m.Permissions) copy(dAtA[i:], m.Permissions) i = encodeVarintApi(dAtA, i, uint64(len(m.Permissions))) i-- dAtA[i] = 0x1a } if len(m.HostPath) > 0 { i -= len(m.HostPath) copy(dAtA[i:], m.HostPath) i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath))) i-- dAtA[i] = 0x12 } if len(m.ContainerPath) > 0 { i -= len(m.ContainerPath) copy(dAtA[i:], m.ContainerPath) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Windows != nil { { size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1 i-- dAtA[i] = 0x82 } if m.Linux != nil { { size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x7a } if m.Tty { i-- if m.Tty { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x70 } if m.StdinOnce { i-- if m.StdinOnce { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x68 } if m.Stdin { i-- if m.Stdin { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x60 } if len(m.LogPath) > 0 { i -= len(m.LogPath) copy(dAtA[i:], m.LogPath) i = encodeVarintApi(dAtA, i, uint64(len(m.LogPath))) i-- dAtA[i] = 0x5a } if len(m.Annotations) > 0 { for k := range m.Annotations { v := m.Annotations[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x52 } } if len(m.Labels) > 0 { for k := range m.Labels { v := m.Labels[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4a } } if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 } } if len(m.Mounts) > 0 { for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a } } if len(m.Envs) > 0 { for iNdEx := len(m.Envs) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Envs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x32 } } if len(m.WorkingDir) > 0 { i -= len(m.WorkingDir) copy(dAtA[i:], m.WorkingDir) i = encodeVarintApi(dAtA, i, uint64(len(m.WorkingDir))) i-- dAtA[i] = 0x2a } if len(m.Args) > 0 { for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Args[iNdEx]) copy(dAtA[i:], m.Args[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.Args[iNdEx]))) i-- dAtA[i] = 0x22 } } if len(m.Command) > 0 { for iNdEx := len(m.Command) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Command[iNdEx]) copy(dAtA[i:], m.Command[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.Command[iNdEx]))) i-- dAtA[i] = 0x1a } } if m.Image != nil { { size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Metadata != nil { { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *CreateContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CreateContainerRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *CreateContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.SandboxConfig != nil { { size, err := m.SandboxConfig.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.Config != nil { { size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.PodSandboxId) > 0 { i -= len(m.PodSandboxId) copy(dAtA[i:], m.PodSandboxId) i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *CreateContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CreateContainerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *CreateContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *StartContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StartContainerRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *StartContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *StartContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StartContainerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *StartContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *StopContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StopContainerRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *StopContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Timeout != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Timeout)) i-- dAtA[i] = 0x10 } if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *StopContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StopContainerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *StopContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *RemoveContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemoveContainerRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RemoveContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RemoveContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemoveContainerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RemoveContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *ContainerStateValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStateValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerStateValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.State != 0 { i = encodeVarintApi(dAtA, i, uint64(m.State)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *ContainerFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerFilter) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.LabelSelector) > 0 { for k := range m.LabelSelector { v := m.LabelSelector[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x22 } } if len(m.PodSandboxId) > 0 { i -= len(m.PodSandboxId) copy(dAtA[i:], m.PodSandboxId) i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0x1a } if m.State != nil { { size, err := m.State.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListContainersRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListContainersRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListContainersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Filter != nil { { size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Container) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Container) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Container) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Annotations) > 0 { for k := range m.Annotations { v := m.Annotations[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x4a } } if len(m.Labels) > 0 { for k := range m.Labels { v := m.Labels[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x42 } } if m.CreatedAt != 0 { i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) i-- dAtA[i] = 0x38 } if m.State != 0 { i = encodeVarintApi(dAtA, i, uint64(m.State)) i-- dAtA[i] = 0x30 } if len(m.ImageRef) > 0 { i -= len(m.ImageRef) copy(dAtA[i:], m.ImageRef) i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) i-- dAtA[i] = 0x2a } if m.Image != nil { { size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } if m.Metadata != nil { { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if len(m.PodSandboxId) > 0 { i -= len(m.PodSandboxId) copy(dAtA[i:], m.PodSandboxId) i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListContainersResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListContainersResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListContainersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Containers) > 0 { for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Containers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ContainerStatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatusRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Verbose { i-- if m.Verbose { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.LogPath) > 0 { i -= len(m.LogPath) copy(dAtA[i:], m.LogPath) i = encodeVarintApi(dAtA, i, uint64(len(m.LogPath))) i-- dAtA[i] = 0x7a } if len(m.Mounts) > 0 { for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x72 } } if len(m.Annotations) > 0 { for k := range m.Annotations { v := m.Annotations[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x6a } } if len(m.Labels) > 0 { for k := range m.Labels { v := m.Labels[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x62 } } if len(m.Message) > 0 { i -= len(m.Message) copy(dAtA[i:], m.Message) i = encodeVarintApi(dAtA, i, uint64(len(m.Message))) i-- dAtA[i] = 0x5a } if len(m.Reason) > 0 { i -= len(m.Reason) copy(dAtA[i:], m.Reason) i = encodeVarintApi(dAtA, i, uint64(len(m.Reason))) i-- dAtA[i] = 0x52 } if len(m.ImageRef) > 0 { i -= len(m.ImageRef) copy(dAtA[i:], m.ImageRef) i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) i-- dAtA[i] = 0x4a } if m.Image != nil { { size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 } if m.ExitCode != 0 { i = encodeVarintApi(dAtA, i, uint64(m.ExitCode)) i-- dAtA[i] = 0x38 } if m.FinishedAt != 0 { i = encodeVarintApi(dAtA, i, uint64(m.FinishedAt)) i-- dAtA[i] = 0x30 } if m.StartedAt != 0 { i = encodeVarintApi(dAtA, i, uint64(m.StartedAt)) i-- dAtA[i] = 0x28 } if m.CreatedAt != 0 { i = encodeVarintApi(dAtA, i, uint64(m.CreatedAt)) i-- dAtA[i] = 0x20 } if m.State != 0 { i = encodeVarintApi(dAtA, i, uint64(m.State)) i-- dAtA[i] = 0x18 } if m.Metadata != nil { { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatusResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Info) > 0 { for k := range m.Info { v := m.Info[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x12 } } if m.Status != nil { { size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *UpdateContainerResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UpdateContainerResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *UpdateContainerResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Linux != nil { { size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *UpdateContainerResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UpdateContainerResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *UpdateContainerResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *ExecSyncRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ExecSyncRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ExecSyncRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Timeout != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Timeout)) i-- dAtA[i] = 0x18 } if len(m.Cmd) > 0 { for iNdEx := len(m.Cmd) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Cmd[iNdEx]) copy(dAtA[i:], m.Cmd[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.Cmd[iNdEx]))) i-- dAtA[i] = 0x12 } } if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ExecSyncResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ExecSyncResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ExecSyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.ExitCode != 0 { i = encodeVarintApi(dAtA, i, uint64(m.ExitCode)) i-- dAtA[i] = 0x18 } if len(m.Stderr) > 0 { i -= len(m.Stderr) copy(dAtA[i:], m.Stderr) i = encodeVarintApi(dAtA, i, uint64(len(m.Stderr))) i-- dAtA[i] = 0x12 } if len(m.Stdout) > 0 { i -= len(m.Stdout) copy(dAtA[i:], m.Stdout) i = encodeVarintApi(dAtA, i, uint64(len(m.Stdout))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ExecRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ExecRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ExecRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Stderr { i-- if m.Stderr { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x30 } if m.Stdout { i-- if m.Stdout { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x28 } if m.Stdin { i-- if m.Stdin { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x20 } if m.Tty { i-- if m.Tty { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if len(m.Cmd) > 0 { for iNdEx := len(m.Cmd) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Cmd[iNdEx]) copy(dAtA[i:], m.Cmd[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.Cmd[iNdEx]))) i-- dAtA[i] = 0x12 } } if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ExecResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ExecResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Url) > 0 { i -= len(m.Url) copy(dAtA[i:], m.Url) i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *AttachRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AttachRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *AttachRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Stderr { i-- if m.Stderr { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x28 } if m.Stdout { i-- if m.Stdout { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x20 } if m.Tty { i-- if m.Tty { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if m.Stdin { i-- if m.Stdin { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *AttachResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AttachResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *AttachResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Url) > 0 { i -= len(m.Url) copy(dAtA[i:], m.Url) i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PortForwardRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PortForwardRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PortForwardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Port) > 0 { dAtA47 := make([]byte, len(m.Port)*10) var j46 int for _, num1 := range m.Port { num := uint64(num1) for num >= 1<<7 { dAtA47[j46] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 j46++ } dAtA47[j46] = uint8(num) j46++ } i -= j46 copy(dAtA[i:], dAtA47[:j46]) i = encodeVarintApi(dAtA, i, uint64(j46)) i-- dAtA[i] = 0x12 } if len(m.PodSandboxId) > 0 { i -= len(m.PodSandboxId) copy(dAtA[i:], m.PodSandboxId) i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PortForwardResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PortForwardResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PortForwardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Url) > 0 { i -= len(m.Url) copy(dAtA[i:], m.Url) i = encodeVarintApi(dAtA, i, uint64(len(m.Url))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ImageFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageFilter) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ImageFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Image != nil { { size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListImagesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListImagesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListImagesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Filter != nil { { size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Image) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Image) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Image) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Username) > 0 { i -= len(m.Username) copy(dAtA[i:], m.Username) i = encodeVarintApi(dAtA, i, uint64(len(m.Username))) i-- dAtA[i] = 0x32 } if m.Uid != nil { { size, err := m.Uid.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } if m.Size_ != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Size_)) i-- dAtA[i] = 0x20 } if len(m.RepoDigests) > 0 { for iNdEx := len(m.RepoDigests) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepoDigests[iNdEx]) copy(dAtA[i:], m.RepoDigests[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.RepoDigests[iNdEx]))) i-- dAtA[i] = 0x1a } } if len(m.RepoTags) > 0 { for iNdEx := len(m.RepoTags) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RepoTags[iNdEx]) copy(dAtA[i:], m.RepoTags[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.RepoTags[iNdEx]))) i-- dAtA[i] = 0x12 } } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListImagesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListImagesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListImagesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Images) > 0 { for iNdEx := len(m.Images) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Images[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ImageStatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageStatusRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ImageStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Verbose { i-- if m.Verbose { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if m.Image != nil { { size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ImageStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageStatusResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ImageStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Info) > 0 { for k := range m.Info { v := m.Info[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x12 } } if m.Image != nil { { size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *AuthConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *AuthConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.RegistryToken) > 0 { i -= len(m.RegistryToken) copy(dAtA[i:], m.RegistryToken) i = encodeVarintApi(dAtA, i, uint64(len(m.RegistryToken))) i-- dAtA[i] = 0x32 } if len(m.IdentityToken) > 0 { i -= len(m.IdentityToken) copy(dAtA[i:], m.IdentityToken) i = encodeVarintApi(dAtA, i, uint64(len(m.IdentityToken))) i-- dAtA[i] = 0x2a } if len(m.ServerAddress) > 0 { i -= len(m.ServerAddress) copy(dAtA[i:], m.ServerAddress) i = encodeVarintApi(dAtA, i, uint64(len(m.ServerAddress))) i-- dAtA[i] = 0x22 } if len(m.Auth) > 0 { i -= len(m.Auth) copy(dAtA[i:], m.Auth) i = encodeVarintApi(dAtA, i, uint64(len(m.Auth))) i-- dAtA[i] = 0x1a } if len(m.Password) > 0 { i -= len(m.Password) copy(dAtA[i:], m.Password) i = encodeVarintApi(dAtA, i, uint64(len(m.Password))) i-- dAtA[i] = 0x12 } if len(m.Username) > 0 { i -= len(m.Username) copy(dAtA[i:], m.Username) i = encodeVarintApi(dAtA, i, uint64(len(m.Username))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PullImageRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PullImageRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PullImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.SandboxConfig != nil { { size, err := m.SandboxConfig.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.Auth != nil { { size, err := m.Auth.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Image != nil { { size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PullImageResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PullImageResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PullImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ImageRef) > 0 { i -= len(m.ImageRef) copy(dAtA[i:], m.ImageRef) i = encodeVarintApi(dAtA, i, uint64(len(m.ImageRef))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RemoveImageRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemoveImageRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RemoveImageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Image != nil { { size, err := m.Image.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RemoveImageResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RemoveImageResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RemoveImageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *NetworkConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NetworkConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NetworkConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.PodCidr) > 0 { i -= len(m.PodCidr) copy(dAtA[i:], m.PodCidr) i = encodeVarintApi(dAtA, i, uint64(len(m.PodCidr))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RuntimeConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RuntimeConfig) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RuntimeConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.NetworkConfig != nil { { size, err := m.NetworkConfig.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *UpdateRuntimeConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UpdateRuntimeConfigRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *UpdateRuntimeConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.RuntimeConfig != nil { { size, err := m.RuntimeConfig.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *UpdateRuntimeConfigResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UpdateRuntimeConfigResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *UpdateRuntimeConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *RuntimeCondition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RuntimeCondition) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RuntimeCondition) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Message) > 0 { i -= len(m.Message) copy(dAtA[i:], m.Message) i = encodeVarintApi(dAtA, i, uint64(len(m.Message))) i-- dAtA[i] = 0x22 } if len(m.Reason) > 0 { i -= len(m.Reason) copy(dAtA[i:], m.Reason) i = encodeVarintApi(dAtA, i, uint64(len(m.Reason))) i-- dAtA[i] = 0x1a } if m.Status { i-- if m.Status { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RuntimeStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RuntimeStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RuntimeStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Conditions) > 0 { for iNdEx := len(m.Conditions) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Conditions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *StatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Verbose { i-- if m.Verbose { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *StatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Info) > 0 { for k := range m.Info { v := m.Info[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x12 } } if m.Status != nil { { size, err := m.Status.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ImageFsInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageFsInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ImageFsInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *UInt64Value) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UInt64Value) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *UInt64Value) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Value != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *FilesystemIdentifier) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *FilesystemIdentifier) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *FilesystemIdentifier) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Mountpoint) > 0 { i -= len(m.Mountpoint) copy(dAtA[i:], m.Mountpoint) i = encodeVarintApi(dAtA, i, uint64(len(m.Mountpoint))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *FilesystemUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *FilesystemUsage) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *FilesystemUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.InodesUsed != nil { { size, err := m.InodesUsed.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } if m.UsedBytes != nil { { size, err := m.UsedBytes.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.FsId != nil { { size, err := m.FsId.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Timestamp != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *ImageFsInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ImageFsInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ImageFsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ImageFilesystems) > 0 { for iNdEx := len(m.ImageFilesystems) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.ImageFilesystems[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ContainerStatsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerStatsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerStatsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Stats != nil { { size, err := m.Stats.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListContainerStatsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListContainerStatsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListContainerStatsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Filter != nil { { size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerStatsFilter) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStatsFilter) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerStatsFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.LabelSelector) > 0 { for k := range m.LabelSelector { v := m.LabelSelector[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x1a } } if len(m.PodSandboxId) > 0 { i -= len(m.PodSandboxId) copy(dAtA[i:], m.PodSandboxId) i = encodeVarintApi(dAtA, i, uint64(len(m.PodSandboxId))) i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ListContainerStatsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListContainerStatsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListContainerStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Stats) > 0 { for iNdEx := len(m.Stats) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Stats[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ContainerAttributes) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerAttributes) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Annotations) > 0 { for k := range m.Annotations { v := m.Annotations[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x22 } } if len(m.Labels) > 0 { for k := range m.Labels { v := m.Labels[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x1a } } if m.Metadata != nil { { size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) i = encodeVarintApi(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerStats) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.WritableLayer != nil { { size, err := m.WritableLayer.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } if m.Memory != nil { { size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.Cpu != nil { { size, err := m.Cpu.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Attributes != nil { { size, err := m.Attributes.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *CpuUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CpuUsage) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *CpuUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.UsageCoreNanoSeconds != nil { { size, err := m.UsageCoreNanoSeconds.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Timestamp != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *MemoryUsage) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MemoryUsage) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *MemoryUsage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.WorkingSetBytes != nil { { size, err := m.WorkingSetBytes.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.Timestamp != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *ReopenContainerLogRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ReopenContainerLogRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ReopenContainerLogRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ContainerId) > 0 { i -= len(m.ContainerId) copy(dAtA[i:], m.ContainerId) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ReopenContainerLogResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ReopenContainerLogResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ReopenContainerLogResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *VersionRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Version) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *VersionResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Version) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.RuntimeName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.RuntimeVersion) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.RuntimeApiVersion) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *DNSConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Servers) > 0 { for _, s := range m.Servers { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.Searches) > 0 { for _, s := range m.Searches { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.Options) > 0 { for _, s := range m.Options { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *PortMapping) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Protocol != 0 { n += 1 + sovApi(uint64(m.Protocol)) } if m.ContainerPort != 0 { n += 1 + sovApi(uint64(m.ContainerPort)) } if m.HostPort != 0 { n += 1 + sovApi(uint64(m.HostPort)) } l = len(m.HostIp) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *Mount) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.HostPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Readonly { n += 2 } if m.SelinuxRelabel { n += 2 } if m.Propagation != 0 { n += 1 + sovApi(uint64(m.Propagation)) } return n } func (m *NamespaceOption) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Network != 0 { n += 1 + sovApi(uint64(m.Network)) } if m.Pid != 0 { n += 1 + sovApi(uint64(m.Pid)) } if m.Ipc != 0 { n += 1 + sovApi(uint64(m.Ipc)) } return n } func (m *Int64Value) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Value != 0 { n += 1 + sovApi(uint64(m.Value)) } return n } func (m *LinuxSandboxSecurityContext) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.NamespaceOptions != nil { l = m.NamespaceOptions.Size() n += 1 + l + sovApi(uint64(l)) } if m.SelinuxOptions != nil { l = m.SelinuxOptions.Size() n += 1 + l + sovApi(uint64(l)) } if m.RunAsUser != nil { l = m.RunAsUser.Size() n += 1 + l + sovApi(uint64(l)) } if m.ReadonlyRootfs { n += 2 } if len(m.SupplementalGroups) > 0 { l = 0 for _, e := range m.SupplementalGroups { l += sovApi(uint64(e)) } n += 1 + sovApi(uint64(l)) + l } if m.Privileged { n += 2 } l = len(m.SeccompProfilePath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.RunAsGroup != nil { l = m.RunAsGroup.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *LinuxPodSandboxConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.CgroupParent) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.SecurityContext != nil { l = m.SecurityContext.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Sysctls) > 0 { for k, v := range m.Sysctls { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *PodSandboxMetadata) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Uid) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Namespace) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Attempt != 0 { n += 1 + sovApi(uint64(m.Attempt)) } return n } func (m *PodSandboxConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.Hostname) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.LogDirectory) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.DnsConfig != nil { l = m.DnsConfig.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.PortMappings) > 0 { for _, e := range m.PortMappings { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if m.Linux != nil { l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *RunPodSandboxRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Config != nil { l = m.Config.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.RuntimeHandler) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RunPodSandboxResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *StopPodSandboxRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *StopPodSandboxResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *RemovePodSandboxRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RemovePodSandboxResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *PodSandboxStatusRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Verbose { n += 2 } return n } func (m *PodIP) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Ip) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *PodSandboxNetworkStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Ip) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.AdditionalIps) > 0 { for _, e := range m.AdditionalIps { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *Namespace) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Options != nil { l = m.Options.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *LinuxPodSandboxStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Namespaces != nil { l = m.Namespaces.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *PodSandboxStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } if m.CreatedAt != 0 { n += 1 + sovApi(uint64(m.CreatedAt)) } if m.Network != nil { l = m.Network.Size() n += 1 + l + sovApi(uint64(l)) } if m.Linux != nil { l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } l = len(m.RuntimeHandler) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *PodSandboxStatusResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Status != nil { l = m.Status.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Info) > 0 { for k, v := range m.Info { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *PodSandboxStateValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } return n } func (m *PodSandboxFilter) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.State != nil { l = m.State.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.LabelSelector) > 0 { for k, v := range m.LabelSelector { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ListPodSandboxRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Filter != nil { l = m.Filter.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *PodSandbox) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } if m.CreatedAt != 0 { n += 1 + sovApi(uint64(m.CreatedAt)) } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } l = len(m.RuntimeHandler) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ListPodSandboxResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Items) > 0 { for _, e := range m.Items { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ImageSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Image) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *KeyValue) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Value) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *LinuxContainerResources) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.CpuPeriod != 0 { n += 1 + sovApi(uint64(m.CpuPeriod)) } if m.CpuQuota != 0 { n += 1 + sovApi(uint64(m.CpuQuota)) } if m.CpuShares != 0 { n += 1 + sovApi(uint64(m.CpuShares)) } if m.MemoryLimitInBytes != 0 { n += 1 + sovApi(uint64(m.MemoryLimitInBytes)) } if m.OomScoreAdj != 0 { n += 1 + sovApi(uint64(m.OomScoreAdj)) } l = len(m.CpusetCpus) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.CpusetMems) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *SELinuxOption) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.User) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Role) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Type) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Level) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *Capability) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.AddCapabilities) > 0 { for _, s := range m.AddCapabilities { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.DropCapabilities) > 0 { for _, s := range m.DropCapabilities { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *LinuxContainerSecurityContext) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Capabilities != nil { l = m.Capabilities.Size() n += 1 + l + sovApi(uint64(l)) } if m.Privileged { n += 2 } if m.NamespaceOptions != nil { l = m.NamespaceOptions.Size() n += 1 + l + sovApi(uint64(l)) } if m.SelinuxOptions != nil { l = m.SelinuxOptions.Size() n += 1 + l + sovApi(uint64(l)) } if m.RunAsUser != nil { l = m.RunAsUser.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.RunAsUsername) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.ReadonlyRootfs { n += 2 } if len(m.SupplementalGroups) > 0 { l = 0 for _, e := range m.SupplementalGroups { l += sovApi(uint64(e)) } n += 1 + sovApi(uint64(l)) + l } l = len(m.ApparmorProfile) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.SeccompProfilePath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.NoNewPrivs { n += 2 } if m.RunAsGroup != nil { l = m.RunAsGroup.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.MaskedPaths) > 0 { for _, s := range m.MaskedPaths { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.ReadonlyPaths) > 0 { for _, s := range m.ReadonlyPaths { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *LinuxContainerConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Resources != nil { l = m.Resources.Size() n += 1 + l + sovApi(uint64(l)) } if m.SecurityContext != nil { l = m.SecurityContext.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *WindowsContainerSecurityContext) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.RunAsUsername) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.CredentialSpec) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *WindowsContainerConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Resources != nil { l = m.Resources.Size() n += 1 + l + sovApi(uint64(l)) } if m.SecurityContext != nil { l = m.SecurityContext.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *WindowsContainerResources) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.CpuShares != 0 { n += 1 + sovApi(uint64(m.CpuShares)) } if m.CpuCount != 0 { n += 1 + sovApi(uint64(m.CpuCount)) } if m.CpuMaximum != 0 { n += 1 + sovApi(uint64(m.CpuMaximum)) } if m.MemoryLimitInBytes != 0 { n += 1 + sovApi(uint64(m.MemoryLimitInBytes)) } return n } func (m *ContainerMetadata) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Attempt != 0 { n += 1 + sovApi(uint64(m.Attempt)) } return n } func (m *Device) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.HostPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Permissions) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ContainerConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Command) > 0 { for _, s := range m.Command { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.Args) > 0 { for _, s := range m.Args { l = len(s) n += 1 + l + sovApi(uint64(l)) } } l = len(m.WorkingDir) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Envs) > 0 { for _, e := range m.Envs { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Mounts) > 0 { for _, e := range m.Mounts { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } l = len(m.LogPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Stdin { n += 2 } if m.StdinOnce { n += 2 } if m.Tty { n += 2 } if m.Linux != nil { l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } if m.Windows != nil { l = m.Windows.Size() n += 2 + l + sovApi(uint64(l)) } return n } func (m *CreateContainerRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Config != nil { l = m.Config.Size() n += 1 + l + sovApi(uint64(l)) } if m.SandboxConfig != nil { l = m.SandboxConfig.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *CreateContainerResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *StartContainerRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *StartContainerResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *StopContainerRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Timeout != 0 { n += 1 + sovApi(uint64(m.Timeout)) } return n } func (m *StopContainerResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *RemoveContainerRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RemoveContainerResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *ContainerStateValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } return n } func (m *ContainerFilter) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.State != nil { l = m.State.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.LabelSelector) > 0 { for k, v := range m.LabelSelector { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ListContainersRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Filter != nil { l = m.Filter.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *Container) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.ImageRef) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } if m.CreatedAt != 0 { n += 1 + sovApi(uint64(m.CreatedAt)) } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ListContainersResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Containers) > 0 { for _, e := range m.Containers { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerStatusRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Verbose { n += 2 } return n } func (m *ContainerStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if m.State != 0 { n += 1 + sovApi(uint64(m.State)) } if m.CreatedAt != 0 { n += 1 + sovApi(uint64(m.CreatedAt)) } if m.StartedAt != 0 { n += 1 + sovApi(uint64(m.StartedAt)) } if m.FinishedAt != 0 { n += 1 + sovApi(uint64(m.FinishedAt)) } if m.ExitCode != 0 { n += 1 + sovApi(uint64(m.ExitCode)) } if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.ImageRef) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Reason) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Message) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Mounts) > 0 { for _, e := range m.Mounts { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } l = len(m.LogPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ContainerStatusResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Status != nil { l = m.Status.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Info) > 0 { for k, v := range m.Info { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *UpdateContainerResourcesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Linux != nil { l = m.Linux.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *UpdateContainerResourcesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *ExecSyncRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Cmd) > 0 { for _, s := range m.Cmd { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if m.Timeout != 0 { n += 1 + sovApi(uint64(m.Timeout)) } return n } func (m *ExecSyncResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Stdout) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Stderr) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.ExitCode != 0 { n += 1 + sovApi(uint64(m.ExitCode)) } return n } func (m *ExecRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Cmd) > 0 { for _, s := range m.Cmd { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if m.Tty { n += 2 } if m.Stdin { n += 2 } if m.Stdout { n += 2 } if m.Stderr { n += 2 } return n } func (m *ExecResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Url) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *AttachRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Stdin { n += 2 } if m.Tty { n += 2 } if m.Stdout { n += 2 } if m.Stderr { n += 2 } return n } func (m *AttachResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Url) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *PortForwardRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Port) > 0 { l = 0 for _, e := range m.Port { l += sovApi(uint64(e)) } n += 1 + sovApi(uint64(l)) + l } return n } func (m *PortForwardResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Url) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ImageFilter) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ListImagesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Filter != nil { l = m.Filter.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *Image) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.RepoTags) > 0 { for _, s := range m.RepoTags { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.RepoDigests) > 0 { for _, s := range m.RepoDigests { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if m.Size_ != 0 { n += 1 + sovApi(uint64(m.Size_)) } if m.Uid != nil { l = m.Uid.Size() n += 1 + l + sovApi(uint64(l)) } l = len(m.Username) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ListImagesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Images) > 0 { for _, e := range m.Images { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ImageStatusRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } if m.Verbose { n += 2 } return n } func (m *ImageStatusResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Info) > 0 { for k, v := range m.Info { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *AuthConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Username) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Password) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Auth) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.ServerAddress) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.IdentityToken) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.RegistryToken) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *PullImageRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } if m.Auth != nil { l = m.Auth.Size() n += 1 + l + sovApi(uint64(l)) } if m.SandboxConfig != nil { l = m.SandboxConfig.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *PullImageResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ImageRef) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RemoveImageRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Image != nil { l = m.Image.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *RemoveImageResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *NetworkConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.PodCidr) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RuntimeConfig) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.NetworkConfig != nil { l = m.NetworkConfig.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *UpdateRuntimeConfigRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.RuntimeConfig != nil { l = m.RuntimeConfig.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *UpdateRuntimeConfigResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *RuntimeCondition) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Type) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Status { n += 2 } l = len(m.Reason) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Message) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RuntimeStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Conditions) > 0 { for _, e := range m.Conditions { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *StatusRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Verbose { n += 2 } return n } func (m *StatusResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Status != nil { l = m.Status.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Info) > 0 { for k, v := range m.Info { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ImageFsInfoRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *UInt64Value) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Value != 0 { n += 1 + sovApi(uint64(m.Value)) } return n } func (m *FilesystemIdentifier) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Mountpoint) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *FilesystemUsage) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Timestamp != 0 { n += 1 + sovApi(uint64(m.Timestamp)) } if m.FsId != nil { l = m.FsId.Size() n += 1 + l + sovApi(uint64(l)) } if m.UsedBytes != nil { l = m.UsedBytes.Size() n += 1 + l + sovApi(uint64(l)) } if m.InodesUsed != nil { l = m.InodesUsed.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ImageFsInfoResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.ImageFilesystems) > 0 { for _, e := range m.ImageFilesystems { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerStatsRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ContainerStatsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Stats != nil { l = m.Stats.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ListContainerStatsRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Filter != nil { l = m.Filter.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ContainerStatsFilter) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.PodSandboxId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.LabelSelector) > 0 { for k, v := range m.LabelSelector { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ListContainerStatsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Stats) > 0 { for _, e := range m.Stats { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerAttributes) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Id) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Metadata != nil { l = m.Metadata.Size() n += 1 + l + sovApi(uint64(l)) } if len(m.Labels) > 0 { for k, v := range m.Labels { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *ContainerStats) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Attributes != nil { l = m.Attributes.Size() n += 1 + l + sovApi(uint64(l)) } if m.Cpu != nil { l = m.Cpu.Size() n += 1 + l + sovApi(uint64(l)) } if m.Memory != nil { l = m.Memory.Size() n += 1 + l + sovApi(uint64(l)) } if m.WritableLayer != nil { l = m.WritableLayer.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *CpuUsage) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Timestamp != 0 { n += 1 + sovApi(uint64(m.Timestamp)) } if m.UsageCoreNanoSeconds != nil { l = m.UsageCoreNanoSeconds.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *MemoryUsage) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Timestamp != 0 { n += 1 + sovApi(uint64(m.Timestamp)) } if m.WorkingSetBytes != nil { l = m.WorkingSetBytes.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ReopenContainerLogRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerId) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *ReopenContainerLogResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *VersionRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&VersionRequest{`, `Version:` + fmt.Sprintf("%v", this.Version) + `,`, `}`, }, "") return s } func (this *VersionResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&VersionResponse{`, `Version:` + fmt.Sprintf("%v", this.Version) + `,`, `RuntimeName:` + fmt.Sprintf("%v", this.RuntimeName) + `,`, `RuntimeVersion:` + fmt.Sprintf("%v", this.RuntimeVersion) + `,`, `RuntimeApiVersion:` + fmt.Sprintf("%v", this.RuntimeApiVersion) + `,`, `}`, }, "") return s } func (this *DNSConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&DNSConfig{`, `Servers:` + fmt.Sprintf("%v", this.Servers) + `,`, `Searches:` + fmt.Sprintf("%v", this.Searches) + `,`, `Options:` + fmt.Sprintf("%v", this.Options) + `,`, `}`, }, "") return s } func (this *PortMapping) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PortMapping{`, `Protocol:` + fmt.Sprintf("%v", this.Protocol) + `,`, `ContainerPort:` + fmt.Sprintf("%v", this.ContainerPort) + `,`, `HostPort:` + fmt.Sprintf("%v", this.HostPort) + `,`, `HostIp:` + fmt.Sprintf("%v", this.HostIp) + `,`, `}`, }, "") return s } func (this *Mount) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Mount{`, `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, `Readonly:` + fmt.Sprintf("%v", this.Readonly) + `,`, `SelinuxRelabel:` + fmt.Sprintf("%v", this.SelinuxRelabel) + `,`, `Propagation:` + fmt.Sprintf("%v", this.Propagation) + `,`, `}`, }, "") return s } func (this *NamespaceOption) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&NamespaceOption{`, `Network:` + fmt.Sprintf("%v", this.Network) + `,`, `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, `Ipc:` + fmt.Sprintf("%v", this.Ipc) + `,`, `}`, }, "") return s } func (this *Int64Value) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Int64Value{`, `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `}`, }, "") return s } func (this *LinuxSandboxSecurityContext) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LinuxSandboxSecurityContext{`, `NamespaceOptions:` + strings.Replace(this.NamespaceOptions.String(), "NamespaceOption", "NamespaceOption", 1) + `,`, `SelinuxOptions:` + strings.Replace(this.SelinuxOptions.String(), "SELinuxOption", "SELinuxOption", 1) + `,`, `RunAsUser:` + strings.Replace(this.RunAsUser.String(), "Int64Value", "Int64Value", 1) + `,`, `ReadonlyRootfs:` + fmt.Sprintf("%v", this.ReadonlyRootfs) + `,`, `SupplementalGroups:` + fmt.Sprintf("%v", this.SupplementalGroups) + `,`, `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, `SeccompProfilePath:` + fmt.Sprintf("%v", this.SeccompProfilePath) + `,`, `RunAsGroup:` + strings.Replace(this.RunAsGroup.String(), "Int64Value", "Int64Value", 1) + `,`, `}`, }, "") return s } func (this *LinuxPodSandboxConfig) String() string { if this == nil { return "nil" } keysForSysctls := make([]string, 0, len(this.Sysctls)) for k := range this.Sysctls { keysForSysctls = append(keysForSysctls, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForSysctls) mapStringForSysctls := "map[string]string{" for _, k := range keysForSysctls { mapStringForSysctls += fmt.Sprintf("%v: %v,", k, this.Sysctls[k]) } mapStringForSysctls += "}" s := strings.Join([]string{`&LinuxPodSandboxConfig{`, `CgroupParent:` + fmt.Sprintf("%v", this.CgroupParent) + `,`, `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "LinuxSandboxSecurityContext", "LinuxSandboxSecurityContext", 1) + `,`, `Sysctls:` + mapStringForSysctls + `,`, `}`, }, "") return s } func (this *PodSandboxMetadata) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PodSandboxMetadata{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Uid:` + fmt.Sprintf("%v", this.Uid) + `,`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `Attempt:` + fmt.Sprintf("%v", this.Attempt) + `,`, `}`, }, "") return s } func (this *PodSandboxConfig) String() string { if this == nil { return "nil" } repeatedStringForPortMappings := "[]*PortMapping{" for _, f := range this.PortMappings { repeatedStringForPortMappings += strings.Replace(f.String(), "PortMapping", "PortMapping", 1) + "," } repeatedStringForPortMappings += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&PodSandboxConfig{`, `Metadata:` + strings.Replace(this.Metadata.String(), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, `Hostname:` + fmt.Sprintf("%v", this.Hostname) + `,`, `LogDirectory:` + fmt.Sprintf("%v", this.LogDirectory) + `,`, `DnsConfig:` + strings.Replace(this.DnsConfig.String(), "DNSConfig", "DNSConfig", 1) + `,`, `PortMappings:` + repeatedStringForPortMappings + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `Linux:` + strings.Replace(this.Linux.String(), "LinuxPodSandboxConfig", "LinuxPodSandboxConfig", 1) + `,`, `}`, }, "") return s } func (this *RunPodSandboxRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RunPodSandboxRequest{`, `Config:` + strings.Replace(this.Config.String(), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, `RuntimeHandler:` + fmt.Sprintf("%v", this.RuntimeHandler) + `,`, `}`, }, "") return s } func (this *RunPodSandboxResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RunPodSandboxResponse{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `}`, }, "") return s } func (this *StopPodSandboxRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StopPodSandboxRequest{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `}`, }, "") return s } func (this *StopPodSandboxResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StopPodSandboxResponse{`, `}`, }, "") return s } func (this *RemovePodSandboxRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemovePodSandboxRequest{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `}`, }, "") return s } func (this *RemovePodSandboxResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemovePodSandboxResponse{`, `}`, }, "") return s } func (this *PodSandboxStatusRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PodSandboxStatusRequest{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, `}`, }, "") return s } func (this *PodIP) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PodIP{`, `Ip:` + fmt.Sprintf("%v", this.Ip) + `,`, `}`, }, "") return s } func (this *PodSandboxNetworkStatus) String() string { if this == nil { return "nil" } repeatedStringForAdditionalIps := "[]*PodIP{" for _, f := range this.AdditionalIps { repeatedStringForAdditionalIps += strings.Replace(f.String(), "PodIP", "PodIP", 1) + "," } repeatedStringForAdditionalIps += "}" s := strings.Join([]string{`&PodSandboxNetworkStatus{`, `Ip:` + fmt.Sprintf("%v", this.Ip) + `,`, `AdditionalIps:` + repeatedStringForAdditionalIps + `,`, `}`, }, "") return s } func (this *Namespace) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Namespace{`, `Options:` + strings.Replace(this.Options.String(), "NamespaceOption", "NamespaceOption", 1) + `,`, `}`, }, "") return s } func (this *LinuxPodSandboxStatus) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LinuxPodSandboxStatus{`, `Namespaces:` + strings.Replace(this.Namespaces.String(), "Namespace", "Namespace", 1) + `,`, `}`, }, "") return s } func (this *PodSandboxStatus) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&PodSandboxStatus{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `Metadata:` + strings.Replace(this.Metadata.String(), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, `Network:` + strings.Replace(this.Network.String(), "PodSandboxNetworkStatus", "PodSandboxNetworkStatus", 1) + `,`, `Linux:` + strings.Replace(this.Linux.String(), "LinuxPodSandboxStatus", "LinuxPodSandboxStatus", 1) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `RuntimeHandler:` + fmt.Sprintf("%v", this.RuntimeHandler) + `,`, `}`, }, "") return s } func (this *PodSandboxStatusResponse) String() string { if this == nil { return "nil" } keysForInfo := make([]string, 0, len(this.Info)) for k := range this.Info { keysForInfo = append(keysForInfo, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) mapStringForInfo := "map[string]string{" for _, k := range keysForInfo { mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) } mapStringForInfo += "}" s := strings.Join([]string{`&PodSandboxStatusResponse{`, `Status:` + strings.Replace(this.Status.String(), "PodSandboxStatus", "PodSandboxStatus", 1) + `,`, `Info:` + mapStringForInfo + `,`, `}`, }, "") return s } func (this *PodSandboxStateValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PodSandboxStateValue{`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `}`, }, "") return s } func (this *PodSandboxFilter) String() string { if this == nil { return "nil" } keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) for k := range this.LabelSelector { keysForLabelSelector = append(keysForLabelSelector, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) mapStringForLabelSelector := "map[string]string{" for _, k := range keysForLabelSelector { mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) } mapStringForLabelSelector += "}" s := strings.Join([]string{`&PodSandboxFilter{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `State:` + strings.Replace(this.State.String(), "PodSandboxStateValue", "PodSandboxStateValue", 1) + `,`, `LabelSelector:` + mapStringForLabelSelector + `,`, `}`, }, "") return s } func (this *ListPodSandboxRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListPodSandboxRequest{`, `Filter:` + strings.Replace(this.Filter.String(), "PodSandboxFilter", "PodSandboxFilter", 1) + `,`, `}`, }, "") return s } func (this *PodSandbox) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&PodSandbox{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `Metadata:` + strings.Replace(this.Metadata.String(), "PodSandboxMetadata", "PodSandboxMetadata", 1) + `,`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `RuntimeHandler:` + fmt.Sprintf("%v", this.RuntimeHandler) + `,`, `}`, }, "") return s } func (this *ListPodSandboxResponse) String() string { if this == nil { return "nil" } repeatedStringForItems := "[]*PodSandbox{" for _, f := range this.Items { repeatedStringForItems += strings.Replace(f.String(), "PodSandbox", "PodSandbox", 1) + "," } repeatedStringForItems += "}" s := strings.Join([]string{`&ListPodSandboxResponse{`, `Items:` + repeatedStringForItems + `,`, `}`, }, "") return s } func (this *ImageSpec) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ImageSpec{`, `Image:` + fmt.Sprintf("%v", this.Image) + `,`, `}`, }, "") return s } func (this *KeyValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&KeyValue{`, `Key:` + fmt.Sprintf("%v", this.Key) + `,`, `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `}`, }, "") return s } func (this *LinuxContainerResources) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LinuxContainerResources{`, `CpuPeriod:` + fmt.Sprintf("%v", this.CpuPeriod) + `,`, `CpuQuota:` + fmt.Sprintf("%v", this.CpuQuota) + `,`, `CpuShares:` + fmt.Sprintf("%v", this.CpuShares) + `,`, `MemoryLimitInBytes:` + fmt.Sprintf("%v", this.MemoryLimitInBytes) + `,`, `OomScoreAdj:` + fmt.Sprintf("%v", this.OomScoreAdj) + `,`, `CpusetCpus:` + fmt.Sprintf("%v", this.CpusetCpus) + `,`, `CpusetMems:` + fmt.Sprintf("%v", this.CpusetMems) + `,`, `}`, }, "") return s } func (this *SELinuxOption) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&SELinuxOption{`, `User:` + fmt.Sprintf("%v", this.User) + `,`, `Role:` + fmt.Sprintf("%v", this.Role) + `,`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Level:` + fmt.Sprintf("%v", this.Level) + `,`, `}`, }, "") return s } func (this *Capability) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Capability{`, `AddCapabilities:` + fmt.Sprintf("%v", this.AddCapabilities) + `,`, `DropCapabilities:` + fmt.Sprintf("%v", this.DropCapabilities) + `,`, `}`, }, "") return s } func (this *LinuxContainerSecurityContext) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LinuxContainerSecurityContext{`, `Capabilities:` + strings.Replace(this.Capabilities.String(), "Capability", "Capability", 1) + `,`, `Privileged:` + fmt.Sprintf("%v", this.Privileged) + `,`, `NamespaceOptions:` + strings.Replace(this.NamespaceOptions.String(), "NamespaceOption", "NamespaceOption", 1) + `,`, `SelinuxOptions:` + strings.Replace(this.SelinuxOptions.String(), "SELinuxOption", "SELinuxOption", 1) + `,`, `RunAsUser:` + strings.Replace(this.RunAsUser.String(), "Int64Value", "Int64Value", 1) + `,`, `RunAsUsername:` + fmt.Sprintf("%v", this.RunAsUsername) + `,`, `ReadonlyRootfs:` + fmt.Sprintf("%v", this.ReadonlyRootfs) + `,`, `SupplementalGroups:` + fmt.Sprintf("%v", this.SupplementalGroups) + `,`, `ApparmorProfile:` + fmt.Sprintf("%v", this.ApparmorProfile) + `,`, `SeccompProfilePath:` + fmt.Sprintf("%v", this.SeccompProfilePath) + `,`, `NoNewPrivs:` + fmt.Sprintf("%v", this.NoNewPrivs) + `,`, `RunAsGroup:` + strings.Replace(this.RunAsGroup.String(), "Int64Value", "Int64Value", 1) + `,`, `MaskedPaths:` + fmt.Sprintf("%v", this.MaskedPaths) + `,`, `ReadonlyPaths:` + fmt.Sprintf("%v", this.ReadonlyPaths) + `,`, `}`, }, "") return s } func (this *LinuxContainerConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&LinuxContainerConfig{`, `Resources:` + strings.Replace(this.Resources.String(), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "LinuxContainerSecurityContext", "LinuxContainerSecurityContext", 1) + `,`, `}`, }, "") return s } func (this *WindowsContainerSecurityContext) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&WindowsContainerSecurityContext{`, `RunAsUsername:` + fmt.Sprintf("%v", this.RunAsUsername) + `,`, `CredentialSpec:` + fmt.Sprintf("%v", this.CredentialSpec) + `,`, `}`, }, "") return s } func (this *WindowsContainerConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&WindowsContainerConfig{`, `Resources:` + strings.Replace(this.Resources.String(), "WindowsContainerResources", "WindowsContainerResources", 1) + `,`, `SecurityContext:` + strings.Replace(this.SecurityContext.String(), "WindowsContainerSecurityContext", "WindowsContainerSecurityContext", 1) + `,`, `}`, }, "") return s } func (this *WindowsContainerResources) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&WindowsContainerResources{`, `CpuShares:` + fmt.Sprintf("%v", this.CpuShares) + `,`, `CpuCount:` + fmt.Sprintf("%v", this.CpuCount) + `,`, `CpuMaximum:` + fmt.Sprintf("%v", this.CpuMaximum) + `,`, `MemoryLimitInBytes:` + fmt.Sprintf("%v", this.MemoryLimitInBytes) + `,`, `}`, }, "") return s } func (this *ContainerMetadata) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerMetadata{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Attempt:` + fmt.Sprintf("%v", this.Attempt) + `,`, `}`, }, "") return s } func (this *Device) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Device{`, `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, `Permissions:` + fmt.Sprintf("%v", this.Permissions) + `,`, `}`, }, "") return s } func (this *ContainerConfig) String() string { if this == nil { return "nil" } repeatedStringForEnvs := "[]*KeyValue{" for _, f := range this.Envs { repeatedStringForEnvs += strings.Replace(f.String(), "KeyValue", "KeyValue", 1) + "," } repeatedStringForEnvs += "}" repeatedStringForMounts := "[]*Mount{" for _, f := range this.Mounts { repeatedStringForMounts += strings.Replace(f.String(), "Mount", "Mount", 1) + "," } repeatedStringForMounts += "}" repeatedStringForDevices := "[]*Device{" for _, f := range this.Devices { repeatedStringForDevices += strings.Replace(f.String(), "Device", "Device", 1) + "," } repeatedStringForDevices += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&ContainerConfig{`, `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, `Command:` + fmt.Sprintf("%v", this.Command) + `,`, `Args:` + fmt.Sprintf("%v", this.Args) + `,`, `WorkingDir:` + fmt.Sprintf("%v", this.WorkingDir) + `,`, `Envs:` + repeatedStringForEnvs + `,`, `Mounts:` + repeatedStringForMounts + `,`, `Devices:` + repeatedStringForDevices + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `LogPath:` + fmt.Sprintf("%v", this.LogPath) + `,`, `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, `StdinOnce:` + fmt.Sprintf("%v", this.StdinOnce) + `,`, `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, `Linux:` + strings.Replace(this.Linux.String(), "LinuxContainerConfig", "LinuxContainerConfig", 1) + `,`, `Windows:` + strings.Replace(this.Windows.String(), "WindowsContainerConfig", "WindowsContainerConfig", 1) + `,`, `}`, }, "") return s } func (this *CreateContainerRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CreateContainerRequest{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `Config:` + strings.Replace(this.Config.String(), "ContainerConfig", "ContainerConfig", 1) + `,`, `SandboxConfig:` + strings.Replace(this.SandboxConfig.String(), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, `}`, }, "") return s } func (this *CreateContainerResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CreateContainerResponse{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } func (this *StartContainerRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StartContainerRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } func (this *StartContainerResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StartContainerResponse{`, `}`, }, "") return s } func (this *StopContainerRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StopContainerRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, `}`, }, "") return s } func (this *StopContainerResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StopContainerResponse{`, `}`, }, "") return s } func (this *RemoveContainerRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemoveContainerRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } func (this *RemoveContainerResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemoveContainerResponse{`, `}`, }, "") return s } func (this *ContainerStateValue) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerStateValue{`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `}`, }, "") return s } func (this *ContainerFilter) String() string { if this == nil { return "nil" } keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) for k := range this.LabelSelector { keysForLabelSelector = append(keysForLabelSelector, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) mapStringForLabelSelector := "map[string]string{" for _, k := range keysForLabelSelector { mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) } mapStringForLabelSelector += "}" s := strings.Join([]string{`&ContainerFilter{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `State:` + strings.Replace(this.State.String(), "ContainerStateValue", "ContainerStateValue", 1) + `,`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `LabelSelector:` + mapStringForLabelSelector + `,`, `}`, }, "") return s } func (this *ListContainersRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListContainersRequest{`, `Filter:` + strings.Replace(this.Filter.String(), "ContainerFilter", "ContainerFilter", 1) + `,`, `}`, }, "") return s } func (this *Container) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&Container{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } func (this *ListContainersResponse) String() string { if this == nil { return "nil" } repeatedStringForContainers := "[]*Container{" for _, f := range this.Containers { repeatedStringForContainers += strings.Replace(f.String(), "Container", "Container", 1) + "," } repeatedStringForContainers += "}" s := strings.Join([]string{`&ListContainersResponse{`, `Containers:` + repeatedStringForContainers + `,`, `}`, }, "") return s } func (this *ContainerStatusRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerStatusRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, `}`, }, "") return s } func (this *ContainerStatus) String() string { if this == nil { return "nil" } repeatedStringForMounts := "[]*Mount{" for _, f := range this.Mounts { repeatedStringForMounts += strings.Replace(f.String(), "Mount", "Mount", 1) + "," } repeatedStringForMounts += "}" keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&ContainerStatus{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, `State:` + fmt.Sprintf("%v", this.State) + `,`, `CreatedAt:` + fmt.Sprintf("%v", this.CreatedAt) + `,`, `StartedAt:` + fmt.Sprintf("%v", this.StartedAt) + `,`, `FinishedAt:` + fmt.Sprintf("%v", this.FinishedAt) + `,`, `ExitCode:` + fmt.Sprintf("%v", this.ExitCode) + `,`, `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `Mounts:` + repeatedStringForMounts + `,`, `LogPath:` + fmt.Sprintf("%v", this.LogPath) + `,`, `}`, }, "") return s } func (this *ContainerStatusResponse) String() string { if this == nil { return "nil" } keysForInfo := make([]string, 0, len(this.Info)) for k := range this.Info { keysForInfo = append(keysForInfo, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) mapStringForInfo := "map[string]string{" for _, k := range keysForInfo { mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) } mapStringForInfo += "}" s := strings.Join([]string{`&ContainerStatusResponse{`, `Status:` + strings.Replace(this.Status.String(), "ContainerStatus", "ContainerStatus", 1) + `,`, `Info:` + mapStringForInfo + `,`, `}`, }, "") return s } func (this *UpdateContainerResourcesRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UpdateContainerResourcesRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Linux:` + strings.Replace(this.Linux.String(), "LinuxContainerResources", "LinuxContainerResources", 1) + `,`, `}`, }, "") return s } func (this *UpdateContainerResourcesResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UpdateContainerResourcesResponse{`, `}`, }, "") return s } func (this *ExecSyncRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ExecSyncRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Cmd:` + fmt.Sprintf("%v", this.Cmd) + `,`, `Timeout:` + fmt.Sprintf("%v", this.Timeout) + `,`, `}`, }, "") return s } func (this *ExecSyncResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ExecSyncResponse{`, `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, `ExitCode:` + fmt.Sprintf("%v", this.ExitCode) + `,`, `}`, }, "") return s } func (this *ExecRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ExecRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Cmd:` + fmt.Sprintf("%v", this.Cmd) + `,`, `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, `}`, }, "") return s } func (this *ExecResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ExecResponse{`, `Url:` + fmt.Sprintf("%v", this.Url) + `,`, `}`, }, "") return s } func (this *AttachRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&AttachRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, `Tty:` + fmt.Sprintf("%v", this.Tty) + `,`, `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, `}`, }, "") return s } func (this *AttachResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&AttachResponse{`, `Url:` + fmt.Sprintf("%v", this.Url) + `,`, `}`, }, "") return s } func (this *PortForwardRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PortForwardRequest{`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `Port:` + fmt.Sprintf("%v", this.Port) + `,`, `}`, }, "") return s } func (this *PortForwardResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PortForwardResponse{`, `Url:` + fmt.Sprintf("%v", this.Url) + `,`, `}`, }, "") return s } func (this *ImageFilter) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ImageFilter{`, `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, `}`, }, "") return s } func (this *ListImagesRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListImagesRequest{`, `Filter:` + strings.Replace(this.Filter.String(), "ImageFilter", "ImageFilter", 1) + `,`, `}`, }, "") return s } func (this *Image) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Image{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `RepoTags:` + fmt.Sprintf("%v", this.RepoTags) + `,`, `RepoDigests:` + fmt.Sprintf("%v", this.RepoDigests) + `,`, `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`, `Uid:` + strings.Replace(this.Uid.String(), "Int64Value", "Int64Value", 1) + `,`, `Username:` + fmt.Sprintf("%v", this.Username) + `,`, `}`, }, "") return s } func (this *ListImagesResponse) String() string { if this == nil { return "nil" } repeatedStringForImages := "[]*Image{" for _, f := range this.Images { repeatedStringForImages += strings.Replace(f.String(), "Image", "Image", 1) + "," } repeatedStringForImages += "}" s := strings.Join([]string{`&ListImagesResponse{`, `Images:` + repeatedStringForImages + `,`, `}`, }, "") return s } func (this *ImageStatusRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ImageStatusRequest{`, `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, `}`, }, "") return s } func (this *ImageStatusResponse) String() string { if this == nil { return "nil" } keysForInfo := make([]string, 0, len(this.Info)) for k := range this.Info { keysForInfo = append(keysForInfo, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) mapStringForInfo := "map[string]string{" for _, k := range keysForInfo { mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) } mapStringForInfo += "}" s := strings.Join([]string{`&ImageStatusResponse{`, `Image:` + strings.Replace(this.Image.String(), "Image", "Image", 1) + `,`, `Info:` + mapStringForInfo + `,`, `}`, }, "") return s } func (this *AuthConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&AuthConfig{`, `Username:` + fmt.Sprintf("%v", this.Username) + `,`, `Password:` + fmt.Sprintf("%v", this.Password) + `,`, `Auth:` + fmt.Sprintf("%v", this.Auth) + `,`, `ServerAddress:` + fmt.Sprintf("%v", this.ServerAddress) + `,`, `IdentityToken:` + fmt.Sprintf("%v", this.IdentityToken) + `,`, `RegistryToken:` + fmt.Sprintf("%v", this.RegistryToken) + `,`, `}`, }, "") return s } func (this *PullImageRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PullImageRequest{`, `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, `Auth:` + strings.Replace(this.Auth.String(), "AuthConfig", "AuthConfig", 1) + `,`, `SandboxConfig:` + strings.Replace(this.SandboxConfig.String(), "PodSandboxConfig", "PodSandboxConfig", 1) + `,`, `}`, }, "") return s } func (this *PullImageResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PullImageResponse{`, `ImageRef:` + fmt.Sprintf("%v", this.ImageRef) + `,`, `}`, }, "") return s } func (this *RemoveImageRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemoveImageRequest{`, `Image:` + strings.Replace(this.Image.String(), "ImageSpec", "ImageSpec", 1) + `,`, `}`, }, "") return s } func (this *RemoveImageResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RemoveImageResponse{`, `}`, }, "") return s } func (this *NetworkConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&NetworkConfig{`, `PodCidr:` + fmt.Sprintf("%v", this.PodCidr) + `,`, `}`, }, "") return s } func (this *RuntimeConfig) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RuntimeConfig{`, `NetworkConfig:` + strings.Replace(this.NetworkConfig.String(), "NetworkConfig", "NetworkConfig", 1) + `,`, `}`, }, "") return s } func (this *UpdateRuntimeConfigRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UpdateRuntimeConfigRequest{`, `RuntimeConfig:` + strings.Replace(this.RuntimeConfig.String(), "RuntimeConfig", "RuntimeConfig", 1) + `,`, `}`, }, "") return s } func (this *UpdateRuntimeConfigResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UpdateRuntimeConfigResponse{`, `}`, }, "") return s } func (this *RuntimeCondition) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RuntimeCondition{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Status:` + fmt.Sprintf("%v", this.Status) + `,`, `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `}`, }, "") return s } func (this *RuntimeStatus) String() string { if this == nil { return "nil" } repeatedStringForConditions := "[]*RuntimeCondition{" for _, f := range this.Conditions { repeatedStringForConditions += strings.Replace(f.String(), "RuntimeCondition", "RuntimeCondition", 1) + "," } repeatedStringForConditions += "}" s := strings.Join([]string{`&RuntimeStatus{`, `Conditions:` + repeatedStringForConditions + `,`, `}`, }, "") return s } func (this *StatusRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&StatusRequest{`, `Verbose:` + fmt.Sprintf("%v", this.Verbose) + `,`, `}`, }, "") return s } func (this *StatusResponse) String() string { if this == nil { return "nil" } keysForInfo := make([]string, 0, len(this.Info)) for k := range this.Info { keysForInfo = append(keysForInfo, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForInfo) mapStringForInfo := "map[string]string{" for _, k := range keysForInfo { mapStringForInfo += fmt.Sprintf("%v: %v,", k, this.Info[k]) } mapStringForInfo += "}" s := strings.Join([]string{`&StatusResponse{`, `Status:` + strings.Replace(this.Status.String(), "RuntimeStatus", "RuntimeStatus", 1) + `,`, `Info:` + mapStringForInfo + `,`, `}`, }, "") return s } func (this *ImageFsInfoRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ImageFsInfoRequest{`, `}`, }, "") return s } func (this *UInt64Value) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&UInt64Value{`, `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `}`, }, "") return s } func (this *FilesystemIdentifier) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&FilesystemIdentifier{`, `Mountpoint:` + fmt.Sprintf("%v", this.Mountpoint) + `,`, `}`, }, "") return s } func (this *FilesystemUsage) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&FilesystemUsage{`, `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, `FsId:` + strings.Replace(this.FsId.String(), "FilesystemIdentifier", "FilesystemIdentifier", 1) + `,`, `UsedBytes:` + strings.Replace(this.UsedBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, `InodesUsed:` + strings.Replace(this.InodesUsed.String(), "UInt64Value", "UInt64Value", 1) + `,`, `}`, }, "") return s } func (this *ImageFsInfoResponse) String() string { if this == nil { return "nil" } repeatedStringForImageFilesystems := "[]*FilesystemUsage{" for _, f := range this.ImageFilesystems { repeatedStringForImageFilesystems += strings.Replace(f.String(), "FilesystemUsage", "FilesystemUsage", 1) + "," } repeatedStringForImageFilesystems += "}" s := strings.Join([]string{`&ImageFsInfoResponse{`, `ImageFilesystems:` + repeatedStringForImageFilesystems + `,`, `}`, }, "") return s } func (this *ContainerStatsRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerStatsRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } func (this *ContainerStatsResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerStatsResponse{`, `Stats:` + strings.Replace(this.Stats.String(), "ContainerStats", "ContainerStats", 1) + `,`, `}`, }, "") return s } func (this *ListContainerStatsRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListContainerStatsRequest{`, `Filter:` + strings.Replace(this.Filter.String(), "ContainerStatsFilter", "ContainerStatsFilter", 1) + `,`, `}`, }, "") return s } func (this *ContainerStatsFilter) String() string { if this == nil { return "nil" } keysForLabelSelector := make([]string, 0, len(this.LabelSelector)) for k := range this.LabelSelector { keysForLabelSelector = append(keysForLabelSelector, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabelSelector) mapStringForLabelSelector := "map[string]string{" for _, k := range keysForLabelSelector { mapStringForLabelSelector += fmt.Sprintf("%v: %v,", k, this.LabelSelector[k]) } mapStringForLabelSelector += "}" s := strings.Join([]string{`&ContainerStatsFilter{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `PodSandboxId:` + fmt.Sprintf("%v", this.PodSandboxId) + `,`, `LabelSelector:` + mapStringForLabelSelector + `,`, `}`, }, "") return s } func (this *ListContainerStatsResponse) String() string { if this == nil { return "nil" } repeatedStringForStats := "[]*ContainerStats{" for _, f := range this.Stats { repeatedStringForStats += strings.Replace(f.String(), "ContainerStats", "ContainerStats", 1) + "," } repeatedStringForStats += "}" s := strings.Join([]string{`&ListContainerStatsResponse{`, `Stats:` + repeatedStringForStats + `,`, `}`, }, "") return s } func (this *ContainerAttributes) String() string { if this == nil { return "nil" } keysForLabels := make([]string, 0, len(this.Labels)) for k := range this.Labels { keysForLabels = append(keysForLabels, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForLabels) mapStringForLabels := "map[string]string{" for _, k := range keysForLabels { mapStringForLabels += fmt.Sprintf("%v: %v,", k, this.Labels[k]) } mapStringForLabels += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&ContainerAttributes{`, `Id:` + fmt.Sprintf("%v", this.Id) + `,`, `Metadata:` + strings.Replace(this.Metadata.String(), "ContainerMetadata", "ContainerMetadata", 1) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } func (this *ContainerStats) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerStats{`, `Attributes:` + strings.Replace(this.Attributes.String(), "ContainerAttributes", "ContainerAttributes", 1) + `,`, `Cpu:` + strings.Replace(this.Cpu.String(), "CpuUsage", "CpuUsage", 1) + `,`, `Memory:` + strings.Replace(this.Memory.String(), "MemoryUsage", "MemoryUsage", 1) + `,`, `WritableLayer:` + strings.Replace(this.WritableLayer.String(), "FilesystemUsage", "FilesystemUsage", 1) + `,`, `}`, }, "") return s } func (this *CpuUsage) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CpuUsage{`, `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, `UsageCoreNanoSeconds:` + strings.Replace(this.UsageCoreNanoSeconds.String(), "UInt64Value", "UInt64Value", 1) + `,`, `}`, }, "") return s } func (this *MemoryUsage) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&MemoryUsage{`, `Timestamp:` + fmt.Sprintf("%v", this.Timestamp) + `,`, `WorkingSetBytes:` + strings.Replace(this.WorkingSetBytes.String(), "UInt64Value", "UInt64Value", 1) + `,`, `}`, }, "") return s } func (this *ReopenContainerLogRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ReopenContainerLogRequest{`, `ContainerId:` + fmt.Sprintf("%v", this.ContainerId) + `,`, `}`, }, "") return s } func (this *ReopenContainerLogResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ReopenContainerLogResponse{`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *VersionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: VersionRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: VersionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *VersionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: VersionResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: VersionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RuntimeName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeVersion", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RuntimeVersion = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeApiVersion", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RuntimeApiVersion = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DNSConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DNSConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DNSConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Servers", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Servers = append(m.Servers, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Searches", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Searches = append(m.Searches, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Options = append(m.Options, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PortMapping) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PortMapping: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PortMapping: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) } m.Protocol = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Protocol |= Protocol(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerPort", wireType) } m.ContainerPort = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ContainerPort |= int32(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field HostPort", wireType) } m.HostPort = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.HostPort |= int32(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HostIp", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.HostIp = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Mount) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Mount: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Mount: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.HostPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Readonly", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Readonly = bool(v != 0) case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SelinuxRelabel", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.SelinuxRelabel = bool(v != 0) case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Propagation", wireType) } m.Propagation = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Propagation |= MountPropagation(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NamespaceOption) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NamespaceOption: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NamespaceOption: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) } m.Network = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Network |= NamespaceMode(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType) } m.Pid = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Pid |= NamespaceMode(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Ipc", wireType) } m.Ipc = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Ipc |= NamespaceMode(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Int64Value) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Int64Value: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Int64Value: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Value |= int64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxSandboxSecurityContext) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxSandboxSecurityContext: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxSandboxSecurityContext: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NamespaceOptions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.NamespaceOptions == nil { m.NamespaceOptions = &NamespaceOption{} } if err := m.NamespaceOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SelinuxOptions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.SelinuxOptions == nil { m.SelinuxOptions = &SELinuxOption{} } if err := m.SelinuxOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RunAsUser", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.RunAsUser == nil { m.RunAsUser = &Int64Value{} } if err := m.RunAsUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ReadonlyRootfs", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.ReadonlyRootfs = bool(v != 0) case 5: if wireType == 0 { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int64(b&0x7F) << shift if b < 0x80 { break } } m.SupplementalGroups = append(m.SupplementalGroups, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= int(b&0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + packedLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } var elementCount int var count int for _, integer := range dAtA[iNdEx:postIndex] { if integer < 128 { count++ } } elementCount = count if elementCount != 0 && len(m.SupplementalGroups) == 0 { m.SupplementalGroups = make([]int64, 0, elementCount) } for iNdEx < postIndex { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int64(b&0x7F) << shift if b < 0x80 { break } } m.SupplementalGroups = append(m.SupplementalGroups, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroups", wireType) } case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Privileged = bool(v != 0) case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SeccompProfilePath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.SeccompProfilePath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RunAsGroup", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.RunAsGroup == nil { m.RunAsGroup = &Int64Value{} } if err := m.RunAsGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxPodSandboxConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxPodSandboxConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxPodSandboxConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CgroupParent", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.CgroupParent = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.SecurityContext == nil { m.SecurityContext = &LinuxSandboxSecurityContext{} } if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Sysctls", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Sysctls == nil { m.Sysctls = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Sysctls[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxMetadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxMetadata: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxMetadata: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Uid = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Namespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Attempt", wireType) } m.Attempt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Attempt |= uint32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &PodSandboxMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Hostname = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LogDirectory", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.LogDirectory = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DnsConfig", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.DnsConfig == nil { m.DnsConfig = &DNSConfig{} } if err := m.DnsConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PortMappings", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PortMappings = append(m.PortMappings, &PortMapping{}) if err := m.PortMappings[len(m.PortMappings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Labels == nil { m.Labels = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Labels[mapkey] = mapvalue iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Annotations == nil { m.Annotations = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Annotations[mapkey] = mapvalue iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Linux == nil { m.Linux = &LinuxPodSandboxConfig{} } if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RunPodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RunPodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RunPodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Config == nil { m.Config = &PodSandboxConfig{} } if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeHandler", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RuntimeHandler = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RunPodSandboxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RunPodSandboxResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RunPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StopPodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StopPodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StopPodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StopPodSandboxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StopPodSandboxResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StopPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemovePodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemovePodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemovePodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemovePodSandboxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemovePodSandboxResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemovePodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxStatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxStatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Verbose", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Verbose = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodIP) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodIP: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodIP: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Ip = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxNetworkStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxNetworkStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxNetworkStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Ip = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AdditionalIps", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.AdditionalIps = append(m.AdditionalIps, &PodIP{}) if err := m.AdditionalIps[len(m.AdditionalIps)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Namespace) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Namespace: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Namespace: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Options == nil { m.Options = &NamespaceOption{} } if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxPodSandboxStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxPodSandboxStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxPodSandboxStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Namespaces == nil { m.Namespaces = &Namespace{} } if err := m.Namespaces.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &PodSandboxMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= PodSandboxState(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) } m.CreatedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CreatedAt |= int64(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Network == nil { m.Network = &PodSandboxNetworkStatus{} } if err := m.Network.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Linux == nil { m.Linux = &LinuxPodSandboxStatus{} } if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Labels == nil { m.Labels = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Labels[mapkey] = mapvalue iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Annotations == nil { m.Annotations = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Annotations[mapkey] = mapvalue iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeHandler", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RuntimeHandler = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Status == nil { m.Status = &PodSandboxStatus{} } if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Info == nil { m.Info = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Info[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxStateValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxStateValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxStateValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= PodSandboxState(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandboxFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandboxFilter: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandboxFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.State == nil { m.State = &PodSandboxStateValue{} } if err := m.State.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.LabelSelector == nil { m.LabelSelector = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.LabelSelector[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListPodSandboxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListPodSandboxRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListPodSandboxRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Filter == nil { m.Filter = &PodSandboxFilter{} } if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodSandbox) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodSandbox: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodSandbox: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &PodSandboxMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= PodSandboxState(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) } m.CreatedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CreatedAt |= int64(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Labels == nil { m.Labels = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Labels[mapkey] = mapvalue iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Annotations == nil { m.Annotations = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Annotations[mapkey] = mapvalue iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeHandler", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RuntimeHandler = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListPodSandboxResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListPodSandboxResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListPodSandboxResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Items = append(m.Items, &PodSandbox{}) if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageSpec: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Image = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *KeyValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: KeyValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxContainerResources) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxContainerResources: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxContainerResources: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CpuPeriod", wireType) } m.CpuPeriod = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CpuPeriod |= int64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CpuQuota", wireType) } m.CpuQuota = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CpuQuota |= int64(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CpuShares", wireType) } m.CpuShares = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CpuShares |= int64(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MemoryLimitInBytes", wireType) } m.MemoryLimitInBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.MemoryLimitInBytes |= int64(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field OomScoreAdj", wireType) } m.OomScoreAdj = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.OomScoreAdj |= int64(b&0x7F) << shift if b < 0x80 { break } } case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CpusetCpus", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.CpusetCpus = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CpusetMems", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.CpusetMems = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *SELinuxOption) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: SELinuxOption: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: SELinuxOption: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.User = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Level", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Level = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Capability) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Capability: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Capability: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AddCapabilities", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.AddCapabilities = append(m.AddCapabilities, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DropCapabilities", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DropCapabilities = append(m.DropCapabilities, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxContainerSecurityContext) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxContainerSecurityContext: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxContainerSecurityContext: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Capabilities", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Capabilities == nil { m.Capabilities = &Capability{} } if err := m.Capabilities.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Privileged", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Privileged = bool(v != 0) case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NamespaceOptions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.NamespaceOptions == nil { m.NamespaceOptions = &NamespaceOption{} } if err := m.NamespaceOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SelinuxOptions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.SelinuxOptions == nil { m.SelinuxOptions = &SELinuxOption{} } if err := m.SelinuxOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RunAsUser", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.RunAsUser == nil { m.RunAsUser = &Int64Value{} } if err := m.RunAsUser.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RunAsUsername", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RunAsUsername = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ReadonlyRootfs", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.ReadonlyRootfs = bool(v != 0) case 8: if wireType == 0 { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int64(b&0x7F) << shift if b < 0x80 { break } } m.SupplementalGroups = append(m.SupplementalGroups, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= int(b&0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + packedLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } var elementCount int var count int for _, integer := range dAtA[iNdEx:postIndex] { if integer < 128 { count++ } } elementCount = count if elementCount != 0 && len(m.SupplementalGroups) == 0 { m.SupplementalGroups = make([]int64, 0, elementCount) } for iNdEx < postIndex { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int64(b&0x7F) << shift if b < 0x80 { break } } m.SupplementalGroups = append(m.SupplementalGroups, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field SupplementalGroups", wireType) } case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ApparmorProfile", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ApparmorProfile = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SeccompProfilePath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.SeccompProfilePath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NoNewPrivs", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.NoNewPrivs = bool(v != 0) case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RunAsGroup", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.RunAsGroup == nil { m.RunAsGroup = &Int64Value{} } if err := m.RunAsGroup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MaskedPaths", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.MaskedPaths = append(m.MaskedPaths, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 14: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ReadonlyPaths", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ReadonlyPaths = append(m.ReadonlyPaths, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LinuxContainerConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LinuxContainerConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LinuxContainerConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Resources == nil { m.Resources = &LinuxContainerResources{} } if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.SecurityContext == nil { m.SecurityContext = &LinuxContainerSecurityContext{} } if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *WindowsContainerSecurityContext) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: WindowsContainerSecurityContext: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: WindowsContainerSecurityContext: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RunAsUsername", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RunAsUsername = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CredentialSpec", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.CredentialSpec = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *WindowsContainerConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: WindowsContainerConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: WindowsContainerConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Resources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Resources == nil { m.Resources = &WindowsContainerResources{} } if err := m.Resources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SecurityContext", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.SecurityContext == nil { m.SecurityContext = &WindowsContainerSecurityContext{} } if err := m.SecurityContext.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *WindowsContainerResources) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: WindowsContainerResources: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: WindowsContainerResources: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CpuShares", wireType) } m.CpuShares = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CpuShares |= int64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CpuCount", wireType) } m.CpuCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CpuCount |= int64(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CpuMaximum", wireType) } m.CpuMaximum = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CpuMaximum |= int64(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MemoryLimitInBytes", wireType) } m.MemoryLimitInBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.MemoryLimitInBytes |= int64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerMetadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerMetadata: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerMetadata: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Attempt", wireType) } m.Attempt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Attempt |= uint32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Device) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Device: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.HostPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Permissions = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &ContainerMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Command", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Command = append(m.Command, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WorkingDir", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.WorkingDir = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Envs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Envs = append(m.Envs, &KeyValue{}) if err := m.Envs[len(m.Envs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Mounts = append(m.Mounts, &Mount{}) if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &Device{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Labels == nil { m.Labels = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Labels[mapkey] = mapvalue iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Annotations == nil { m.Annotations = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Annotations[mapkey] = mapvalue iNdEx = postIndex case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LogPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.LogPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 12: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Stdin = bool(v != 0) case 13: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StdinOnce", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.StdinOnce = bool(v != 0) case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Tty", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Tty = bool(v != 0) case 15: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Linux == nil { m.Linux = &LinuxContainerConfig{} } if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 16: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Windows", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Windows == nil { m.Windows = &WindowsContainerConfig{} } if err := m.Windows.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CreateContainerRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CreateContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Config", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Config == nil { m.Config = &ContainerConfig{} } if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SandboxConfig", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.SandboxConfig == nil { m.SandboxConfig = &PodSandboxConfig{} } if err := m.SandboxConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CreateContainerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CreateContainerResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CreateContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StartContainerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StartContainerRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StartContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StartContainerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StartContainerResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StartContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StopContainerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StopContainerRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StopContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) } m.Timeout = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timeout |= int64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StopContainerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StopContainerResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StopContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemoveContainerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemoveContainerRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemoveContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemoveContainerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemoveContainerResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemoveContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStateValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStateValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStateValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= ContainerState(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerFilter: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.State == nil { m.State = &ContainerStateValue{} } if err := m.State.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.LabelSelector == nil { m.LabelSelector = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.LabelSelector[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListContainersRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListContainersRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListContainersRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Filter == nil { m.Filter = &ContainerFilter{} } if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Container) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Container: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Container: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &ContainerMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ImageRef", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ImageRef = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= ContainerState(b&0x7F) << shift if b < 0x80 { break } } case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) } m.CreatedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CreatedAt |= int64(b&0x7F) << shift if b < 0x80 { break } } case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Labels == nil { m.Labels = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Labels[mapkey] = mapvalue iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Annotations == nil { m.Annotations = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Annotations[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListContainersResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListContainersResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListContainersResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Containers", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Containers = append(m.Containers, &Container{}) if err := m.Containers[len(m.Containers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Verbose", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Verbose = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &ContainerMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) } m.State = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.State |= ContainerState(b&0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) } m.CreatedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CreatedAt |= int64(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StartedAt", wireType) } m.StartedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.StartedAt |= int64(b&0x7F) << shift if b < 0x80 { break } } case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field FinishedAt", wireType) } m.FinishedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.FinishedAt |= int64(b&0x7F) << shift if b < 0x80 { break } } case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ExitCode", wireType) } m.ExitCode = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ExitCode |= int32(b&0x7F) << shift if b < 0x80 { break } } case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ImageRef", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ImageRef = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Reason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Labels == nil { m.Labels = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Labels[mapkey] = mapvalue iNdEx = postIndex case 13: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Annotations == nil { m.Annotations = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Annotations[mapkey] = mapvalue iNdEx = postIndex case 14: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Mounts = append(m.Mounts, &Mount{}) if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 15: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LogPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.LogPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Status == nil { m.Status = &ContainerStatus{} } if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Info == nil { m.Info = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Info[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UpdateContainerResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UpdateContainerResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UpdateContainerResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Linux", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Linux == nil { m.Linux = &LinuxContainerResources{} } if err := m.Linux.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UpdateContainerResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UpdateContainerResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UpdateContainerResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ExecSyncRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ExecSyncRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ExecSyncRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Cmd", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Cmd = append(m.Cmd, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) } m.Timeout = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timeout |= int64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ExecSyncResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ExecSyncResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ExecSyncResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Stdout = append(m.Stdout[:0], dAtA[iNdEx:postIndex]...) if m.Stdout == nil { m.Stdout = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Stderr = append(m.Stderr[:0], dAtA[iNdEx:postIndex]...) if m.Stderr == nil { m.Stderr = []byte{} } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ExitCode", wireType) } m.ExitCode = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ExitCode |= int32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ExecRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ExecRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ExecRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Cmd", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Cmd = append(m.Cmd, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Tty", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Tty = bool(v != 0) case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Stdin = bool(v != 0) case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Stdout = bool(v != 0) case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Stderr = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ExecResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ExecResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ExecResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Url = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AttachRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AttachRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AttachRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdin", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Stdin = bool(v != 0) case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Tty", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Tty = bool(v != 0) case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stdout", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Stdout = bool(v != 0) case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stderr", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Stderr = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AttachResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AttachResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AttachResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Url = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PortForwardRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PortForwardRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PortForwardRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType == 0 { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int32(b&0x7F) << shift if b < 0x80 { break } } m.Port = append(m.Port, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= int(b&0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + packedLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } var elementCount int var count int for _, integer := range dAtA[iNdEx:postIndex] { if integer < 128 { count++ } } elementCount = count if elementCount != 0 && len(m.Port) == 0 { m.Port = make([]int32, 0, elementCount) } for iNdEx < postIndex { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int32(b&0x7F) << shift if b < 0x80 { break } } m.Port = append(m.Port, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PortForwardResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PortForwardResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PortForwardResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Url", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Url = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageFilter: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListImagesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListImagesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListImagesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Filter == nil { m.Filter = &ImageFilter{} } if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Image) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Image: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Image: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RepoTags", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RepoTags = append(m.RepoTags, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RepoDigests", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RepoDigests = append(m.RepoDigests, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) } m.Size_ = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Size_ |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Uid == nil { m.Uid = &Int64Value{} } if err := m.Uid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Username = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListImagesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListImagesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListImagesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Images", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Images = append(m.Images, &Image{}) if err := m.Images[len(m.Images)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageStatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageStatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Verbose", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Verbose = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &Image{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Info == nil { m.Info = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Info[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Username = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Password = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Auth = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ServerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ServerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field IdentityToken", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.IdentityToken = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RegistryToken", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RegistryToken = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PullImageRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PullImageRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PullImageRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Auth", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Auth == nil { m.Auth = &AuthConfig{} } if err := m.Auth.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SandboxConfig", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.SandboxConfig == nil { m.SandboxConfig = &PodSandboxConfig{} } if err := m.SandboxConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PullImageResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PullImageResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PullImageResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ImageRef", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ImageRef = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemoveImageRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemoveImageRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemoveImageRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Image", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Image == nil { m.Image = &ImageSpec{} } if err := m.Image.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RemoveImageResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RemoveImageResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RemoveImageResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NetworkConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NetworkConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NetworkConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodCidr", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodCidr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RuntimeConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RuntimeConfig: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RuntimeConfig: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field NetworkConfig", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.NetworkConfig == nil { m.NetworkConfig = &NetworkConfig{} } if err := m.NetworkConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UpdateRuntimeConfigRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UpdateRuntimeConfigRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UpdateRuntimeConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RuntimeConfig", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.RuntimeConfig == nil { m.RuntimeConfig = &RuntimeConfig{} } if err := m.RuntimeConfig.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UpdateRuntimeConfigResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UpdateRuntimeConfigResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UpdateRuntimeConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RuntimeCondition) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RuntimeCondition: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RuntimeCondition: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Status = bool(v != 0) case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Reason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RuntimeStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RuntimeStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RuntimeStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Conditions = append(m.Conditions, &RuntimeCondition{}) if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Verbose", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Verbose = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Status == nil { m.Status = &RuntimeStatus{} } if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Info == nil { m.Info = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Info[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageFsInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageFsInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageFsInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *UInt64Value) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UInt64Value: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UInt64Value: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Value |= uint64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *FilesystemIdentifier) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: FilesystemIdentifier: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: FilesystemIdentifier: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Mountpoint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Mountpoint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *FilesystemUsage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: FilesystemUsage: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: FilesystemUsage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timestamp |= int64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FsId", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.FsId == nil { m.FsId = &FilesystemIdentifier{} } if err := m.FsId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UsedBytes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.UsedBytes == nil { m.UsedBytes = &UInt64Value{} } if err := m.UsedBytes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field InodesUsed", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.InodesUsed == nil { m.InodesUsed = &UInt64Value{} } if err := m.InodesUsed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ImageFsInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ImageFsInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ImageFsInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ImageFilesystems", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ImageFilesystems = append(m.ImageFilesystems, &FilesystemUsage{}) if err := m.ImageFilesystems[len(m.ImageFilesystems)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatsRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatsResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Stats == nil { m.Stats = &ContainerStats{} } if err := m.Stats.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListContainerStatsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListContainerStatsRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListContainerStatsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Filter == nil { m.Filter = &ContainerStatsFilter{} } if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStatsFilter) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStatsFilter: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStatsFilter: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodSandboxId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodSandboxId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.LabelSelector == nil { m.LabelSelector = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.LabelSelector[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListContainerStatsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListContainerStatsResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListContainerStatsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Stats = append(m.Stats, &ContainerStats{}) if err := m.Stats[len(m.Stats)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerAttributes) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerAttributes: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerAttributes: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Metadata == nil { m.Metadata = &ContainerMetadata{} } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Labels == nil { m.Labels = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Labels[mapkey] = mapvalue iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Annotations == nil { m.Annotations = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Annotations[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerStats) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerStats: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerStats: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Attributes == nil { m.Attributes = &ContainerAttributes{} } if err := m.Attributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Cpu", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Cpu == nil { m.Cpu = &CpuUsage{} } if err := m.Cpu.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Memory == nil { m.Memory = &MemoryUsage{} } if err := m.Memory.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WritableLayer", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.WritableLayer == nil { m.WritableLayer = &FilesystemUsage{} } if err := m.WritableLayer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CpuUsage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CpuUsage: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CpuUsage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timestamp |= int64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UsageCoreNanoSeconds", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.UsageCoreNanoSeconds == nil { m.UsageCoreNanoSeconds = &UInt64Value{} } if err := m.UsageCoreNanoSeconds.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MemoryUsage) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MemoryUsage: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MemoryUsage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timestamp |= int64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field WorkingSetBytes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.WorkingSetBytes == nil { m.WorkingSetBytes = &UInt64Value{} } if err := m.WorkingSetBytes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ReopenContainerLogRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ReopenContainerLogRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ReopenContainerLogRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ReopenContainerLogResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ReopenContainerLogResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ReopenContainerLogResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthApi } iNdEx += length if iNdEx < 0 { return 0, ErrInvalidLengthApi } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipApi(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next if iNdEx < 0 { return 0, ErrInvalidLengthApi } } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ) ================================================ FILE: pkg/checkpoint/cri/v1alpha2/constants.go ================================================ /* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1alpha2 // This file contains all constants defined in CRI. // Required runtime condition type. const ( // RuntimeReady means the runtime is up and ready to accept basic containers. RuntimeReady = "RuntimeReady" // NetworkReady means the runtime network is up and ready to accept containers which require network. NetworkReady = "NetworkReady" ) // LogStreamType is the type of the stream in CRI container log. type LogStreamType string const ( // Stdout is the stream type for stdout. Stdout LogStreamType = "stdout" // Stderr is the stream type for stderr. Stderr LogStreamType = "stderr" ) // LogTag is the tag of a log line in CRI container log. // Currently defined log tags: // * First tag: Partial/Full - P/F. // The field in the container log format can be extended to include multiple // tags by using a delimiter, but changes should be rare. If it becomes clear // that better extensibility is desired, a more extensible format (e.g., json) // should be adopted as a replacement and/or addition. type LogTag string const ( // LogTagPartial means the line is part of multiple lines. LogTagPartial LogTag = "P" // LogTagFull means the line is a single full line or the end of multiple lines. LogTagFull LogTag = "F" // LogTagDelimiter is the delimiter for different log tags. LogTagDelimiter = ":" ) ================================================ FILE: pkg/checkpoint/internal/README.md ================================================ Copied from pkg/kubelet/util to prevent importing kubernetes ``` wget https://raw.githubusercontent.com/kubernetes/kubernetes/v1.16.2/pkg/kubelet/util/util_unix.go wget https://raw.githubusercontent.com/kubernetes/kubernetes/v1.16.2/pkg/kubelet/util/util.go ``` ================================================ FILE: pkg/checkpoint/internal/util.go ================================================ /* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package internal import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // FromApiserverCache modifies so that the GET request will // be served from apiserver cache instead of from etcd. func FromApiserverCache(opts *metav1.GetOptions) { opts.ResourceVersion = "0" } ================================================ FILE: pkg/checkpoint/internal/util_unix.go ================================================ // +build freebsd linux darwin /* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package internal import ( "fmt" "net" "net/url" "os" "path/filepath" "time" "golang.org/x/sys/unix" "k8s.io/klog" ) const ( // unixProtocol is the network protocol of unix socket. unixProtocol = "unix" ) func CreateListener(endpoint string) (net.Listener, error) { protocol, addr, err := parseEndpointWithFallbackProtocol(endpoint, unixProtocol) if err != nil { return nil, err } if protocol != unixProtocol { return nil, fmt.Errorf("only support unix socket endpoint") } // Unlink to cleanup the previous socket file. err = unix.Unlink(addr) if err != nil && !os.IsNotExist(err) { return nil, fmt.Errorf("failed to unlink socket file %q: %v", addr, err) } return net.Listen(protocol, addr) } func GetAddressAndDialer(endpoint string) (string, func(addr string, timeout time.Duration) (net.Conn, error), error) { protocol, addr, err := parseEndpointWithFallbackProtocol(endpoint, unixProtocol) if err != nil { return "", nil, err } if protocol != unixProtocol { return "", nil, fmt.Errorf("only support unix socket endpoint") } return addr, dial, nil } func dial(addr string, timeout time.Duration) (net.Conn, error) { return net.DialTimeout(unixProtocol, addr, timeout) } func parseEndpointWithFallbackProtocol(endpoint string, fallbackProtocol string) (protocol string, addr string, err error) { if protocol, addr, err = parseEndpoint(endpoint); err != nil && protocol == "" { fallbackEndpoint := fallbackProtocol + "://" + endpoint protocol, addr, err = parseEndpoint(fallbackEndpoint) if err == nil { klog.Warningf("Using %q as endpoint is deprecated, please consider using full url format %q.", endpoint, fallbackEndpoint) } } return } func parseEndpoint(endpoint string) (string, string, error) { u, err := url.Parse(endpoint) if err != nil { return "", "", err } switch u.Scheme { case "tcp": return "tcp", u.Host, nil case "unix": return "unix", u.Path, nil case "": return "", "", fmt.Errorf("Using %q as endpoint is deprecated, please consider using full url format", endpoint) default: return u.Scheme, "", fmt.Errorf("protocol %q not supported", u.Scheme) } } // LocalEndpoint returns the full path to a unix socket at the given endpoint func LocalEndpoint(path, file string) string { u := url.URL{ Scheme: unixProtocol, Path: path, } return filepath.Join(u.String(), file+".sock") } ================================================ FILE: pkg/checkpoint/kubelet.go ================================================ package checkpoint import ( "context" "fmt" "os" "time" "github.com/golang/glog" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" ) // A minimal kubelet client. It assumes the kubelet can be reached the kubelet's insecure API at // HOST_IP:10255 and the secure API at HOST_IP:10250 or localhost at the same ports. type kubeletClient struct { insecureClient *rest.RESTClient secureClient *rest.RESTClient } func newKubeletClient(config *rest.Config) (*kubeletClient, error) { // Use the core API group serializer. Same logic as client-go. // https://github.com/kubernetes/client-go/blob/v3.0.0/kubernetes/typed/core/v1/core_client.go#L147 config.NegotiatedSerializer = serializer.WithoutConversionCodecFactory{CodecFactory: scheme.Codecs} // Kubelet is using a self-signed cert. config.TLSClientConfig.Insecure = true config.TLSClientConfig.CAFile = "" config.TLSClientConfig.CAData = nil hostIP := os.Getenv("HOST_IP") // Default to previous behaviour of using localhost. if hostIP == "" { hostIP = "127.0.0.1" } // Shallow copy. insecureConfig := *config secureConfig := *config insecureConfig.Host = fmt.Sprintf("http://%s:10255", hostIP) secureConfig.Host = fmt.Sprintf("https://%s:10250", hostIP) client := new(kubeletClient) var err error if client.insecureClient, err = rest.UnversionedRESTClientFor(&insecureConfig); err != nil { return nil, fmt.Errorf("failed creating kubelet client for debug endpoints: %v", err) } if client.secureClient, err = rest.UnversionedRESTClientFor(&secureConfig); err != nil { return nil, fmt.Errorf("failed creating kubelet client: %v", err) } return client, nil } // localParentPods will retrieve all pods from kubelet api that are parents & should be checkpointed func (k *kubeletClient) localParentPods() map[string]*corev1.Pod { podList := new(corev1.PodList) timeout := 15 * time.Second if err := k.secureClient.Get().AbsPath("/pods/").Timeout(timeout).Do(context.TODO()).Into(podList); err != nil { glog.Errorf("failed to secure list local parent pods, fallback to insecure: %v", err) if err := k.insecureClient.Get().AbsPath("/pods/").Timeout(timeout).Do(context.TODO()).Into(podList); err != nil { // Assume there are no local parent pods. glog.Errorf("failed to insecure list local parent pods, assuming none are running: %v", err) } } return podListToParentPods(podList) } ================================================ FILE: pkg/checkpoint/manifest.go ================================================ package checkpoint import ( "bytes" "io/ioutil" "os" "path/filepath" "strings" "github.com/golang/glog" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" ) // getFileCheckpoints will retrieve all checkpoint manifests from a given filepath. func getFileCheckpoints(path string) map[string]*corev1.Pod { checkpoints := make(map[string]*corev1.Pod) fi, err := ioutil.ReadDir(path) if err != nil { glog.Fatalf("Failed to read checkpoint manifest path: %v", err) } for _, f := range fi { manifest := filepath.Join(path, f.Name()) // Check for leftover temporary checkpoints. if strings.HasPrefix(filepath.Base(manifest), ".") { glog.V(4).Infof("Found temporary checkpoint %s, removing.", manifest) if err := os.Remove(manifest); err != nil { glog.V(4).Infof("Error removing temporary checkpoint %s: %v.", manifest, err) } continue } b, err := ioutil.ReadFile(manifest) if err != nil { glog.Errorf("Error reading manifest: %v", err) continue } cp := &corev1.Pod{} if err := runtime.DecodeInto(scheme.Codecs.UniversalDecoder(), b, cp); err != nil { glog.Errorf("Error unmarshalling manifest from %s: %v", filepath.Join(path, f.Name()), err) continue } if isCheckpoint(cp) { if _, ok := checkpoints[podFullName(cp)]; ok { // sanity check glog.Warningf("Found multiple checkpoint pods in %s with same id: %s", path, podFullName(cp)) } checkpoints[podFullName(cp)] = cp } } return checkpoints } // writeCheckpointManifest will save the pod to the inactive checkpoint location if it doesn't already exist. func writeCheckpointManifest(pod *corev1.Pod) (bool, error) { buff := &bytes.Buffer{} if err := podSerializer.Encode(pod, buff); err != nil { return false, err } path := filepath.Join(inactiveCheckpointPath, pod.Namespace+"-"+pod.Name+".json") return writeManifestIfDifferent(path, podFullName(pod), buff.Bytes()) } // writeManifestIfDifferent writes `data` to `path` if data is different from the existing content. // The `name` parameter is used for debug output. func writeManifestIfDifferent(path, name string, data []byte) (bool, error) { existing, err := ioutil.ReadFile(path) if err != nil && !os.IsNotExist(err) { return false, err } if bytes.Equal(existing, data) { glog.V(4).Infof("Checkpoint manifest for %q already exists. Skipping", name) return false, nil } glog.Infof("Writing manifest for %q to %q", name, path) return true, writeAndAtomicRename(path, data, rootUID, rootGID, 0644) } func writeAndAtomicRename(path string, data []byte, uid, gid int, perm os.FileMode) error { // Ensure that the temporary file is on the same filesystem so that os.Rename() does not error. tmpfile, err := ioutil.TempFile(filepath.Dir(path), ".") if err != nil { return err } if _, err := tmpfile.Write(data); err != nil { return err } if err := tmpfile.Chmod(perm); err != nil { return err } if err := tmpfile.Close(); err != nil { return err } if err := os.Rename(tmpfile.Name(), path); err != nil { return err } return os.Chown(path, uid, gid) } ================================================ FILE: pkg/checkpoint/pod.go ================================================ package checkpoint import ( "errors" "path/filepath" "strings" "github.com/golang/glog" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/serializer/json" "k8s.io/client-go/kubernetes/scheme" ) var ( // podSerializer is an encoder for writing checkpointed pods. // // Perfer this instead of json.Marshal because it corrects metadata before // serializing. For example it automatically fills in the "apiVersion" field. podSerializer = scheme.Codecs.EncoderForVersion( json.NewSerializer( json.DefaultMetaFactory, scheme.Scheme, // client-go's default scheme. scheme.Scheme, false, // don't pretty print. ), corev1.SchemeGroupVersion, ) ) func sanitizeCheckpointPod(cp *corev1.Pod) *corev1.Pod { trueVar := true // Check if this is already sanitized, i.e. it was read back from a checkpoint on disk. if _, ok := cp.Annotations[checkpointParentAnnotation]; ok { return cp } // Keep same name, namespace, and labels as parent. cp.ObjectMeta = metav1.ObjectMeta{ Name: cp.Name, Namespace: cp.Namespace, Annotations: make(map[string]string), Labels: cp.Labels, // Set the ownerRef to the parent pod. We do this because: // If the ownerRef stays the same (e.g. the original deployment), then the deployment controller will try to manage the static/mirror pod. // If we clear the ownerRef, then a higher-level object will adopt this pod based on the label selector (e.g. the original deployment). OwnerReferences: []metav1.OwnerReference{ { APIVersion: cp.APIVersion, Kind: cp.Kind, Name: cp.Name, UID: cp.UID, Controller: &trueVar, }, }, } // Track this checkpoint's parent pod cp.Annotations[checkpointParentAnnotation] = cp.Name // Remove Service Account cp.Spec.ServiceAccountName = "" cp.Spec.DeprecatedServiceAccount = "" // Remove affinity cp.Spec.Affinity = nil // Remove node selector cp.Spec.NodeSelector = nil // Sanitize the volumes for i := range cp.Spec.Volumes { v := &cp.Spec.Volumes[i] if v.Secret != nil { v.HostPath = &corev1.HostPathVolumeSource{Path: secretPath(cp.Namespace, cp.Name, v.Secret.SecretName)} v.Secret = nil } else if v.ConfigMap != nil { v.HostPath = &corev1.HostPathVolumeSource{Path: configMapPath(cp.Namespace, cp.Name, v.ConfigMap.Name)} v.ConfigMap = nil } } // Clear pod status cp.Status.Reset() return cp } // isPodCheckpointer returns true if the manifest is the pod checkpointer (has the same name as the parent). // For example, the pod.Name would be "pod-checkpointer". // The podName would be "pod-checkpointer" or "pod-checkpointer-172.17.4.201" where // "172.17.4.201" is the nodeName. func isPodCheckpointer(pod *corev1.Pod, cp CheckpointerPod) bool { if pod.Namespace != cp.PodNamespace { return false } return pod.Name == strings.TrimSuffix(cp.PodName, "-"+cp.NodeName) } func podListToParentPods(pl *corev1.PodList) map[string]*corev1.Pod { return podListToMap(pl, isValidParent) } func filterNone(p *corev1.Pod) bool { return true } type filterFn func(*corev1.Pod) bool func podListToMap(pl *corev1.PodList, filter filterFn) map[string]*corev1.Pod { pods := make(map[string]*corev1.Pod) for i := range pl.Items { if !filter(&pl.Items[i]) { continue } pod := &pl.Items[i] id := podFullName(pod) if _, ok := pods[id]; ok { // TODO(aaron): likely not be necessary (shouldn't ever happen) - but sanity check glog.Warningf("Found multiple local parent pods with same id: %s", id) } // Pods from Kubelet API do not have TypeMeta populated - set it here either way. pods[id] = pod pods[id].TypeMeta = metav1.TypeMeta{ APIVersion: "v1", Kind: "Pod", } } return pods } // A valid checkpoint parent: // has the checkpoint=true annotation // is not a static pod itself // is not a checkpoint pod itself func isValidParent(pod *corev1.Pod) bool { if pod.Annotations == nil { return false } shouldCheckpoint := pod.Annotations[shouldCheckpointAnnotation] == shouldCheckpoint isStatic := pod.Annotations[podSourceAnnotation] == podSourceFile return shouldCheckpoint && !isStatic && !isCheckpoint(pod) } func isCheckpoint(pod *corev1.Pod) bool { if pod.Annotations == nil { return false } _, ok := pod.Annotations[checkpointParentAnnotation] return ok } func podFullName(pod *corev1.Pod) string { return pod.Namespace + "/" + pod.Name } func podFullNameToInactiveCheckpointPath(id string) string { return filepath.Join(inactiveCheckpointPath, strings.Replace(id, "/", "-", -1)+".json") } func podFullNameToActiveCheckpointPath(id string) string { return filepath.Join(activeCheckpointPath, strings.Replace(id, "/", "-", -1)+".json") } // ErrorConflictingSecurityContexts is returned when a pod has a PodSecurityContext and/or // SecurityContext(s) that have conflicting RunAsUser values. var ErrorConflictingSecurityContexts = errors.New("pod and/or container(s) have conflicting SecurityContext.RunAsUser values") // podUserAndGroup returns the ids of the user and group for the pod by scanning the // PodSecurityContext and the SecurityContexts of its Containers. Returns // ErrorConflictingSecurityContexts if the pod and/or its containers have different users/groups // set. func podUserAndGroup(pod *corev1.Pod) (int, int, error) { var uid, gid *int64 // Check PodSecurityContext. if psc := pod.Spec.SecurityContext; psc != nil { uid = psc.RunAsUser gid = psc.FSGroup } // Check Container SecurityContexts. If there is a conflict return error. // TODO(diegs): maybe resolve conflicts by returning per-container uids. for _, c := range pod.Spec.Containers { if sc := c.SecurityContext; sc != nil { if sc.RunAsUser != nil { // Fail if a different user was previously seen. if uid != nil && *uid != *sc.RunAsUser { return -1, -1, ErrorConflictingSecurityContexts } uid = sc.RunAsUser } } } // Return root uid/gid by default. if uid == nil { tmpUID := int64(rootUID) uid = &tmpUID } if gid == nil { tmpGID := int64(rootGID) gid = &tmpGID } return int(*uid), int(*gid), nil } ================================================ FILE: pkg/checkpoint/pod_test.go ================================================ package checkpoint import ( "fmt" "testing" "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestSanitizeCheckpointPod(t *testing.T) { type testCase struct { desc string pod *v1.Pod expected *v1.Pod } trueVar := true cases := []testCase{ { desc: "Pod name and namespace are preserved, checkpoint annotation added, owner points to parent", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", }, }, expected: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Annotations: map[string]string{checkpointParentAnnotation: "podname"}, OwnerReferences: []metav1.OwnerReference{{Name: "podname", Controller: &trueVar}}, }, }, }, { desc: "Existing annotations are removed, checkpoint annotation added, owner points to parent", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Annotations: map[string]string{"foo": "bar"}, }, }, expected: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Annotations: map[string]string{checkpointParentAnnotation: "podname"}, OwnerReferences: []metav1.OwnerReference{{Name: "podname", Controller: &trueVar}}, }, }, }, { desc: "Pod status is reset", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", }, Status: v1.PodStatus{Phase: "Pending"}, }, expected: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Annotations: map[string]string{checkpointParentAnnotation: "podname"}, OwnerReferences: []metav1.OwnerReference{{Name: "podname", Controller: &trueVar}}, }, }, }, { desc: "Service acounts are cleared", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", }, Spec: v1.PodSpec{ServiceAccountName: "foo", DeprecatedServiceAccount: "bar"}, }, expected: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Annotations: map[string]string{checkpointParentAnnotation: "podname"}, OwnerReferences: []metav1.OwnerReference{{Name: "podname", Controller: &trueVar}}, }, }, }, { desc: "Labels are preserved", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Labels: map[string]string{"foo": "bar"}, }, }, expected: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Labels: map[string]string{"foo": "bar"}, Annotations: map[string]string{checkpointParentAnnotation: "podname"}, OwnerReferences: []metav1.OwnerReference{{Name: "podname", Controller: &trueVar}}, }, }, }, { desc: "OwnerReference of checkpoint points to parent pod", pod: &v1.Pod{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "Pod", }, ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", UID: "pod-uid", OwnerReferences: []metav1.OwnerReference{ {APIVersion: "v1", Kind: "Daemonset", Name: "daemonname", UID: "daemon-uid"}, }, }, }, expected: &v1.Pod{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "Pod", }, ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Annotations: map[string]string{checkpointParentAnnotation: "podname"}, OwnerReferences: []metav1.OwnerReference{ {APIVersion: "v1", Kind: "Pod", Name: "podname", UID: "pod-uid", Controller: &trueVar}, }, }, }, }, { desc: "Pod is already sanitized.", pod: &v1.Pod{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "Pod", }, ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Annotations: map[string]string{checkpointParentAnnotation: "podname"}, OwnerReferences: []metav1.OwnerReference{ {APIVersion: "v1", Kind: "Pod", Name: "podname", UID: "pod-uid", Controller: &trueVar}, }, }, }, expected: &v1.Pod{ TypeMeta: metav1.TypeMeta{ APIVersion: "v1", Kind: "Pod", }, ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Annotations: map[string]string{checkpointParentAnnotation: "podname"}, OwnerReferences: []metav1.OwnerReference{ {APIVersion: "v1", Kind: "Pod", Name: "podname", UID: "pod-uid", Controller: &trueVar}, }, }, }, }, } for _, tc := range cases { got := sanitizeCheckpointPod(tc.pod) if !apiequality.Semantic.DeepEqual(tc.expected, got) { t.Errorf("\nFor Test: %s\n\nExpected:\n%#v\nGot:\n%#v\n", tc.desc, tc.expected, got) } } } func TestPodListToParentPods(t *testing.T) { parentAPod := v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "A", Namespace: "A", Annotations: map[string]string{shouldCheckpointAnnotation: "true"}}} parentBPod := v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "B", Namespace: "B", Annotations: map[string]string{shouldCheckpointAnnotation: "true"}}} checkpointPod := v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "C", Namespace: "C", Annotations: map[string]string{checkpointParentAnnotation: "foo/bar"}}} regularPod := v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "D", Namespace: "D", Annotations: map[string]string{"meta": "data"}}} type testCase struct { desc string podList *v1.PodList expected map[string]*v1.Pod } cases := []testCase{ { desc: "Both regular pods, none are parents", podList: &v1.PodList{Items: []v1.Pod{regularPod, regularPod}}, expected: nil, }, { desc: "Regular and checkpoint pods, none are parents", podList: &v1.PodList{Items: []v1.Pod{regularPod, checkpointPod}}, expected: nil, }, { desc: "One parent and one regular pod: Should return only parent", podList: &v1.PodList{Items: []v1.Pod{parentAPod, regularPod}}, expected: map[string]*v1.Pod{"A/A": {}}, }, { desc: "Two parent pods, should return both", podList: &v1.PodList{Items: []v1.Pod{parentAPod, parentBPod}}, expected: map[string]*v1.Pod{"A/A": {}, "B/B": {}}, }, } for _, tc := range cases { got := podListToParentPods(tc.podList) if len(got) != len(tc.expected) { t.Errorf("Expected: %d pods but got %d for test: %s", len(tc.expected), len(got), tc.desc) } for e := range tc.expected { if _, ok := got[e]; !ok { t.Errorf("Missing expected podFullName %s", e) } } } } func podWithAnnotations(a map[string]string) *v1.Pod { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", Annotations: a, }, } } func TestIsValidParent(t *testing.T) { type testCase struct { desc string pod *v1.Pod expected bool } cases := []testCase{ { desc: "Checkpoint pod", pod: podWithAnnotations(map[string]string{checkpointParentAnnotation: "foo/bar"}), expected: false, }, { desc: "Static pod", pod: podWithAnnotations(map[string]string{podSourceAnnotation: "file"}), expected: false, }, { desc: "Normal pod", pod: podWithAnnotations(map[string]string{"foo": "bar"}), expected: false, }, { desc: "Parent pod", pod: podWithAnnotations(map[string]string{shouldCheckpointAnnotation: "true"}), expected: true, }, { desc: "No annotation / normal pod", pod: podWithAnnotations(nil), expected: false, }, { desc: "Parent and static pod", pod: podWithAnnotations(map[string]string{ shouldCheckpointAnnotation: "true", podSourceAnnotation: "file", }), expected: false, }, { desc: "Parent and checkpoint", // This should never happen pod: podWithAnnotations(map[string]string{ shouldCheckpointAnnotation: "true", checkpointParentAnnotation: "foo/bar", }), expected: false, }, } for _, tc := range cases { got := isValidParent(tc.pod) if tc.expected != got { t.Errorf("Expected: %t Got: %t For test: %s", tc.expected, got, tc.desc) } } } func TestIsCheckpoint(t *testing.T) { type testCase struct { desc string pod *v1.Pod expected bool } cases := []testCase{ { desc: fmt.Sprintf("Pod is checkpoint and contains %s annotation key and value", checkpointParentAnnotation), pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{checkpointParentAnnotation: "podnamespace/podname"}, }, }, expected: true, }, { desc: fmt.Sprintf("Pod is checkpoint contains %s annotation key and no value", checkpointParentAnnotation), pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{checkpointParentAnnotation: ""}, }, }, expected: true, }, { desc: "Pod is not checkpoint & contains unrelated annotations", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Annotations: map[string]string{"foo": "bar"}, }, }, expected: false, }, { desc: "Pod is not checkpoint & contains no annotations", pod: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{}, }, expected: false, }, } for _, tc := range cases { got := isCheckpoint(tc.pod) if tc.expected != got { t.Errorf("Expected: %t Got: %t for test: %s", tc.expected, got, tc.desc) } } } func TestPodID(t *testing.T) { pod := &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "podname", Namespace: "podnamespace", }, } expected := "podnamespace/podname" got := podFullName(pod) if expected != got { t.Errorf("Expected: %s Got: %s", expected, got) } } func TestPodIDToInactiveCheckpointPath(t *testing.T) { id := "foo/bar" expected := inactiveCheckpointPath + "/foo-bar.json" got := podFullNameToInactiveCheckpointPath(id) if expected != got { t.Errorf("Expected: %s Got: %s", expected, got) } } func TestPodIDToActiveCheckpointPath(t *testing.T) { id := "foo/bar" expected := activeCheckpointPath + "/foo-bar.json" got := podFullNameToActiveCheckpointPath(id) if expected != got { t.Errorf("Expected: %s Got: %s", expected, got) } } func TestPodIDToSecretPath(t *testing.T) { id := "foo/bar" expected := checkpointSecretPath + "/foo/bar" got := podFullNameToSecretPath(id) if expected != got { t.Errorf("Expected %s Got %s", expected, got) } } func TestPodIDToConfigMapPath(t *testing.T) { id := "foo/bar" expected := checkpointConfigMapPath + "/foo/bar" got := podFullNameToConfigMapPath(id) if expected != got { t.Errorf("Expected %s Got %s", expected, got) } } func TestPodUserAndGroup(t *testing.T) { user1 := int64(1) user2 := int64(2) group1 := int64(10) for _, tc := range []struct { name string pod *v1.Pod wantUID int wantGID int wantErr bool }{{ name: "empty pod", pod: &v1.Pod{}, wantUID: rootUID, }, { name: "normal pod", pod: &v1.Pod{ Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "container", }}, }, }, wantUID: rootUID, }, { name: "pod with PodSecurityContext", pod: &v1.Pod{ Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "container", }}, SecurityContext: &v1.PodSecurityContext{RunAsUser: &user1, FSGroup: &group1}, }, }, wantUID: int(user1), wantGID: int(group1), }, { name: "pod with Container.SecurityContext", pod: &v1.Pod{ Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "container", SecurityContext: &v1.SecurityContext{RunAsUser: &user1}, }}, }, }, wantUID: int(user1), }, { name: "pod with matching SecurityContexts", pod: &v1.Pod{ Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "container1", SecurityContext: &v1.SecurityContext{RunAsUser: &user1}, }, { Name: "container2", SecurityContext: &v1.SecurityContext{RunAsUser: &user1}, }}, SecurityContext: &v1.PodSecurityContext{RunAsUser: &user1, FSGroup: &group1}, }, }, wantUID: int(user1), wantGID: int(group1), }, { name: "pod with conflicting PodSecurityContext and SecurityContext", pod: &v1.Pod{ Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "container", SecurityContext: &v1.SecurityContext{RunAsUser: &user1}, }}, SecurityContext: &v1.PodSecurityContext{RunAsUser: &user2}, }, }, wantErr: true, }, { name: "pod with conflicting SecurityContexts", pod: &v1.Pod{ Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "container1", SecurityContext: &v1.SecurityContext{RunAsUser: &user1}, }, { Name: "container2", SecurityContext: &v1.SecurityContext{RunAsUser: &user2}, }}, }, }, wantErr: true, }} { uid, gid, err := podUserAndGroup(tc.pod) if (err != nil) != tc.wantErr { t.Errorf("%s podUser() = err: %v, want: %v", tc.name, err != nil, tc.wantErr) } else if !tc.wantErr && (uid != tc.wantUID || gid != tc.wantGID) { t.Errorf("%s podUser() = %v, %v, want: %v, %v", tc.name, uid, gid, tc.wantUID, tc.wantGID) } } } ================================================ FILE: pkg/checkpoint/process.go ================================================ package checkpoint import ( "fmt" "io/ioutil" "os" "sort" "time" "github.com/golang/glog" "k8s.io/api/core/v1" ) // checkpoint holds the state of a single checkpointed pod. A checkpoint can move between states // based on the apiCondition that the checkpointer sees. type checkpoint struct { // name is the name of the checkpointed pod. name string // pod is the most up-to-date v1.Pod data. pod *v1.Pod // state is the current state of the checkpoint. state checkpointState } // String() implements fmt.Stringer.String(). func (c checkpoint) String() string { return fmt.Sprintf("%s (%s)", c.name, c.state) } // checkpoints holds the state of the checkpoints. type checkpoints struct { checkpoints map[string]*checkpoint selfCheckpoint *checkpoint } // update updates the checkpoints using the information retrieved from the various API endpoints. func (cs *checkpoints) update(localRunningPods, localParentPods, apiParentPods, activeCheckpoints, inactiveCheckpoints map[string]*v1.Pod, checkpointerPod CheckpointerPod) { if cs.checkpoints == nil { cs.checkpoints = make(map[string]*checkpoint) } // Temporarily add the self-checkpointer into the map so it is updated as well. if cs.selfCheckpoint != nil { cs.checkpoints[cs.selfCheckpoint.name] = cs.selfCheckpoint } // Make sure all on-disk checkpoints are represented in memory, i.e. if we are restarting from a // crash. for name, pod := range activeCheckpoints { if _, ok := cs.checkpoints[name]; !ok { cs.checkpoints[name] = &checkpoint{ name: name, state: stateActive{}, pod: pod, } // Override the state for the self-checkpointer. if isPodCheckpointer(pod, checkpointerPod) { cs.checkpoints[name].state = stateSelfCheckpointActive{} } } } for name, pod := range inactiveCheckpoints { if _, ok := cs.checkpoints[name]; !ok { cs.checkpoints[name] = &checkpoint{ name: name, state: stateInactive{}, pod: pod, } // Override the state for the self-checkpointer. if isPodCheckpointer(pod, checkpointerPod) { cs.checkpoints[name].state = stateSelfCheckpointActive{} } } } // Add union of parent pods from other sources. for name, pod := range localParentPods { if _, ok := cs.checkpoints[name]; !ok { cs.checkpoints[name] = &checkpoint{ name: name, state: stateNone{}, } } // Always overwrite with the localParentPod since it is a better source of truth. cs.checkpoints[name].pod = pod } for name, pod := range apiParentPods { if _, ok := cs.checkpoints[name]; !ok { cs.checkpoints[name] = &checkpoint{ name: name, state: stateNone{}, } } // Always overwrite with the apiParentPod since it is a better source of truth. cs.checkpoints[name].pod = pod } // Find the self-checkpointer pod if it exists and remove it from the map. for _, cp := range cs.checkpoints { if isPodCheckpointer(cp.pod, checkpointerPod) { // Separate the self-checkpoint from the map, as it is handled separately. cs.selfCheckpoint = cp delete(cs.checkpoints, cp.name) // If this is a new self-checkpoint make sure the state is set correctly. if cp.state.action() == none { cp.state = stateSelfCheckpointActive{} } } } } // process uses the apiserver inputs and curren time to determine which checkpoints to start, stop, // or remove. func (cs *checkpoints) process(now time.Time, apiAvailable bool, localRunningPods, localParentPods, apiParentPods map[string]*v1.Pod) (starts, stops, removes []string) { // The checkpointer must be handled specially: the checkpoint always needs to remain active, and // if it is removed from the apiserver then all other checkpoints need to be removed first. if cs.selfCheckpoint != nil { state := cs.selfCheckpoint.state.transition(now, apiCondition{ apiAvailable: apiAvailable, apiParent: apiParentPods[cs.selfCheckpoint.name] != nil, localRunning: localRunningPods[cs.selfCheckpoint.name] != nil, localParent: localParentPods[cs.selfCheckpoint.name] != nil, }) if state != cs.selfCheckpoint.state { glog.Infof("Self-checkpoint %s transitioning from state %s -> state %s", cs.selfCheckpoint, cs.selfCheckpoint.state, state) cs.selfCheckpoint.state = state } switch cs.selfCheckpoint.state.action() { case none: glog.Errorf("Unexpected transition to state %s with action 'none'", state) case start: // The selfCheckpoint must always be active to ensure that it can perform its functions in // the face of a full control plane restart. starts = append(starts, cs.selfCheckpoint.name) case stop: // If the checkpointer is stopped then stop all checkpoints. Next cycle they may restart. for name, cp := range cs.checkpoints { if cp.state.action() != none { stops = append(stops, name) } } sort.Strings(stops) // Ensure stable ordering. stops = append(stops, cs.selfCheckpoint.name) return starts, stops, removes case remove: // If the checkpointer is removed then remove all checkpoints, putting the selfCheckpoint // last and removing all state. for name, cp := range cs.checkpoints { if cp.state.action() != none { removes = append(removes, name) delete(cs.checkpoints, name) } } sort.Strings(removes) // Ensure stable ordering. removes = append(removes, cs.selfCheckpoint.name) delete(cs.checkpoints, cs.selfCheckpoint.name) cs.selfCheckpoint = nil return starts, stops, removes default: panic(fmt.Sprintf("unhandled action: %s", cs.selfCheckpoint.state.action())) } } // Update states for all the checkpoints and compute which to start / stop / remove. for name, cp := range cs.checkpoints { state := cp.state.transition(now, apiCondition{ apiAvailable: apiAvailable, apiParent: apiParentPods[name] != nil, localRunning: localRunningPods[name] != nil, localParent: localParentPods[name] != nil, }) if state != cp.state { // Apply state transition. // TODO(diegs): always apply this. if cp.state.action() != state.action() { switch state.action() { case none: glog.Errorf("Unexpected transition to state %s with action 'none'", state) case start: starts = append(starts, cp.name) case stop: stops = append(stops, cp.name) case remove: removes = append(removes, cp.name) delete(cs.checkpoints, cp.name) default: panic(fmt.Sprintf("unhandled action: %s", state.action())) } } glog.Infof("Checkpoint %s transitioning from state %s -> state %s", cp, cp.state, state) cp.state = state } } return starts, stops, removes } // createCheckpointsForValidParents will iterate through pods which are candidates for checkpointing, then: // - checkpoint any remote assets they need (e.g. secrets, configmaps) // - sanitize their podSpec, removing unnecessary information // - store the manifest on disk in an "inactive" checkpoint location func (c *checkpointer) createCheckpointsForValidParents() { // Assemble the list of parent pods to checkpoint. var parents []*v1.Pod for _, cp := range c.checkpoints.checkpoints { parents = append(parents, cp.pod) } if c.checkpoints.selfCheckpoint != nil { parents = append(parents, c.checkpoints.selfCheckpoint.pod) } // Update the checkpoints. needsCheckpointUpdate := lastCheckpoint.IsZero() || time.Since(lastCheckpoint) >= defaultCheckpointTimeout for _, pod := range parents { id := podFullName(pod) cp := pod.DeepCopy() cp = sanitizeCheckpointPod(cp) podChanged, err := writeCheckpointManifest(cp) if err != nil { glog.Errorf("Failed to write checkpoint for %s: %v", id, err) continue } // Check for secret and configmap changes if the pods have change or they haven't been checked in a while if podChanged || needsCheckpointUpdate { _, err = c.checkpointSecretVolumes(pod) if err != nil { //TODO(aaron): This can end up spamming logs at times when api-server is unavailable. To reduce spam // we could only log error if api-server can't be contacted and existing secret doesn't exist. glog.Errorf("Failed to checkpoint secrets for pod %s: %v", id, err) continue } _, err = c.checkpointConfigMapVolumes(pod) if err != nil { //TODO(aaron): This can end up spamming logs at times when api-server is unavailable. To reduce spam // we could only log error if api-server can't be contacted and existing configmap doesn't exist. glog.Errorf("Failed to checkpoint configMaps for pod %s: %v", id, err) continue } } } // If the secrets/manifests were checked update the lastCheckpoint if needsCheckpointUpdate { lastCheckpoint = time.Now() } } func handleRemove(remove []string) { for _, id := range remove { glog.Infof("Removing checkpoint of: %s", id) // Remove Secrets p := podFullNameToSecretPath(id) if err := os.RemoveAll(p); err != nil { glog.Errorf("Failed to remove pod secrets from %s: %s", p, err) } // Remove ConfipMaps p = podFullNameToConfigMapPath(id) if err := os.RemoveAll(p); err != nil { glog.Errorf("Failed to remove pod configMaps from %s: %s", p, err) } // Remove inactive checkpoints p = podFullNameToInactiveCheckpointPath(id) if err := os.Remove(p); err != nil && !os.IsNotExist(err) { glog.Errorf("Failed to remove inactive checkpoint %s: %v", p, err) continue } // Remove active checkpoints. // We do this as the last step because we want to clean up // resources before the checkpointer itself exits. // // TODO(yifan): Removing the pods after removing the secrets/configmaps // might disturb other pods since they might want to use the configmap // or secrets during termination. // // However, since we are not waiting for them to terminate anyway, so it's // ok to just leave as is for now. We can handle this more gracefully later. p = podFullNameToActiveCheckpointPath(id) if err := os.Remove(p); err != nil && !os.IsNotExist(err) { glog.Errorf("Failed to remove active checkpoint %s: %v", p, err) continue } } } func handleStop(stop []string) { for _, id := range stop { glog.Infof("Stopping active checkpoint: %s", id) p := podFullNameToActiveCheckpointPath(id) if err := os.Remove(p); err != nil { if os.IsNotExist(err) { // Sanity check (it's fine - just want to surface this if it's occurring) glog.Warningf("Attempted to remove active checkpoint, but manifest no longer exists: %s", p) } else { glog.Errorf("Failed to stop active checkpoint %s: %v", p, err) } } } } func handleStart(start []string) { for _, id := range start { src := podFullNameToInactiveCheckpointPath(id) data, err := ioutil.ReadFile(src) if err != nil { glog.Errorf("Failed to read checkpoint source: %v", err) continue } dst := podFullNameToActiveCheckpointPath(id) if _, err := writeManifestIfDifferent(dst, id, data); err != nil { glog.Errorf("Failed to write active checkpoint manifest: %v", err) } } } ================================================ FILE: pkg/checkpoint/process_test.go ================================================ package checkpoint import ( "reflect" "testing" "time" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestProcess(t *testing.T) { type testCase struct { desc string localRunning map[string]*v1.Pod localParents map[string]*v1.Pod apiParents map[string]*v1.Pod activeCheckpoints map[string]*v1.Pod inactiveCheckpoints map[string]*v1.Pod expectStart []string expectStop []string expectRemove []string expectGraceStart []string expectGraceStop []string expectGraceRemove []string podName string } cases := []testCase{ { desc: "Inactive checkpoint and no local running: should start", inactiveCheckpoints: map[string]*v1.Pod{"AA": {}}, expectStart: []string{"AA"}, }, { desc: "Inactive checkpoint and local running: no change", inactiveCheckpoints: map[string]*v1.Pod{"AA": {}}, localRunning: map[string]*v1.Pod{"AA": {}}, }, { desc: "Inactive checkpoint and no api parent: should remove", inactiveCheckpoints: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"BB": {}}, expectGraceRemove: []string{"AA"}, }, { desc: "Inactive checkpoint and both api & local running: no change", inactiveCheckpoints: map[string]*v1.Pod{"AA": {}}, localRunning: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"AA": {}}, }, { desc: "Inactive checkpoint and only api parent: should start", inactiveCheckpoints: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"AA": {}}, expectStart: []string{"AA"}, }, { desc: "Inactive checkpoint and only api and kubelet parents: should start", inactiveCheckpoints: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"AA": {}}, localParents: map[string]*v1.Pod{"AA": {}}, expectStart: []string{"AA"}, }, { desc: "Active checkpoint and no local running: no change", activeCheckpoints: map[string]*v1.Pod{"AA": {}}, }, { desc: "Active checkpoint and local running: should stop", activeCheckpoints: map[string]*v1.Pod{"AA": {}}, localRunning: map[string]*v1.Pod{"AA": {}}, expectStop: []string{"AA"}, }, { desc: "Active checkpoint and api parent: no change", activeCheckpoints: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"AA": {}}, }, { desc: "Active checkpoint and no api parent: should remove", activeCheckpoints: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"BB": {}}, expectGraceRemove: []string{"AA"}, }, { desc: "Active checkpoint with local running, and api parent: should stop", activeCheckpoints: map[string]*v1.Pod{"AA": {}}, localRunning: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"AA": {}}, expectStop: []string{"AA"}, }, { desc: "Active checkpoint with local parent, and no api parent: should remove", activeCheckpoints: map[string]*v1.Pod{"AA": {}}, localParents: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"BB": {}}, expectGraceRemove: []string{"AA"}, }, { desc: "Both active and inactive checkpoints, with no api parent: remove both", activeCheckpoints: map[string]*v1.Pod{"AA": {}}, inactiveCheckpoints: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"BB": {}}, expectGraceRemove: []string{"AA"}, // Only need single remove, we should clean up both active/inactive }, { desc: "Inactive checkpoint, local parent, local running, no api parent: no change", // Safety check - don't GC if local parent still exists (even if possibly stale) inactiveCheckpoints: map[string]*v1.Pod{"AA": {}}, localRunning: map[string]*v1.Pod{"AA": {}}, localParents: map[string]*v1.Pod{"AA": {}}, }, { desc: "Active checkpoint, local parent, no local running, no api parent: no change", // Safety check - don't GC if local parent still exists (even if possibly stale) activeCheckpoints: map[string]*v1.Pod{"AA": {}}, localParents: map[string]*v1.Pod{"AA": {}}, }, { desc: "Inactive pod-checkpointer, local parent, local running, api parent: should start", localRunning: map[string]*v1.Pod{"kube-system/pod-checkpointer": {}}, localParents: map[string]*v1.Pod{"kube-system/pod-checkpointer": {}}, apiParents: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, }, inactiveCheckpoints: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, }, expectStart: []string{"kube-system/pod-checkpointer"}, expectGraceStart: []string{"kube-system/pod-checkpointer"}, }, { desc: "Inactive pod-checkpointer, local parent, no local running, api not reachable: should start", localParents: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, }, inactiveCheckpoints: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, }, expectStart: []string{"kube-system/pod-checkpointer"}, expectGraceStart: []string{"kube-system/pod-checkpointer"}, }, { desc: "Inactive pod-checkpointer, no local parent, no api parent: should remove in the last", localRunning: map[string]*v1.Pod{"kube-system/pod-checkpointer": {}, "AA": {}, "BB": {}}, localParents: map[string]*v1.Pod{"BB": {}}, apiParents: map[string]*v1.Pod{"BB": {}}, inactiveCheckpoints: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, "AA": {}, }, expectStart: []string{"kube-system/pod-checkpointer"}, expectStop: []string{"BB"}, expectGraceRemove: []string{"AA", "BB", "kube-system/pod-checkpointer"}, }, { desc: "Inactive pod-checkpointer, no local parent, no api parent: should remove all", localRunning: map[string]*v1.Pod{"kube-system/pod-checkpointer": {}, "AA": {}}, localParents: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"AA": {}}, inactiveCheckpoints: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, "AA": {}, }, expectStart: []string{"kube-system/pod-checkpointer"}, expectGraceRemove: []string{"AA", "kube-system/pod-checkpointer"}, }, { desc: "Active pod-checkpointer, no local parent, no api parent: should remove all", localRunning: map[string]*v1.Pod{"kube-system/pod-checkpointer": {}, "AA": {}}, localParents: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"AA": {}}, activeCheckpoints: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, "AA": {}, }, expectStart: []string{"kube-system/pod-checkpointer"}, expectStop: []string{"AA"}, expectGraceRemove: []string{"AA", "kube-system/pod-checkpointer"}, }, { desc: "Running as an on-disk checkpointer: Inactive pod-checkpointer, local parent, local running, api parent: should start", podName: "pod-checkpointer-mynode", localRunning: map[string]*v1.Pod{"kube-system/pod-checkpointer": {}}, localParents: map[string]*v1.Pod{"kube-system/pod-checkpointer": {}}, apiParents: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, }, inactiveCheckpoints: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, }, expectStart: []string{"kube-system/pod-checkpointer"}, expectGraceStart: []string{"kube-system/pod-checkpointer"}, }, { desc: "Running as an on-disk checkpointer: Inactive pod-checkpointer, local parent, no local running, api not reachable: should start", podName: "pod-checkpointer-mynode", localParents: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, }, inactiveCheckpoints: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, }, expectStart: []string{"kube-system/pod-checkpointer"}, expectGraceStart: []string{"kube-system/pod-checkpointer"}, }, { desc: "Running as an on-disk checkpointer: Inactive pod-checkpointer, no local parent, no api parent: should remove in the last", podName: "pod-checkpointer-mynode", localRunning: map[string]*v1.Pod{"kube-system/pod-checkpointer": {}, "AA": {}}, localParents: map[string]*v1.Pod{"BB": {}}, apiParents: map[string]*v1.Pod{"BB": {}}, inactiveCheckpoints: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, "AA": {}, }, expectStart: []string{"kube-system/pod-checkpointer", "BB"}, expectGraceRemove: []string{"AA", "BB", "kube-system/pod-checkpointer"}, }, { desc: "Running as an on-disk checkpointer: Inactive pod-checkpointer, no local parent, no api parent: should remove all", podName: "pod-checkpointer-mynode", localRunning: map[string]*v1.Pod{"kube-system/pod-checkpointer": {}, "AA": {}}, localParents: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"AA": {}}, inactiveCheckpoints: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, "AA": {}, }, expectStart: []string{"kube-system/pod-checkpointer"}, expectGraceRemove: []string{"AA", "kube-system/pod-checkpointer"}, }, { desc: "Running as an on-disk checkpointer: Active pod-checkpointer, no local parent, no api parent: should remove all", podName: "pod-checkpointer-mynode", localRunning: map[string]*v1.Pod{"kube-system/pod-checkpointer": {}, "AA": {}}, localParents: map[string]*v1.Pod{"AA": {}}, apiParents: map[string]*v1.Pod{"AA": {}}, activeCheckpoints: map[string]*v1.Pod{ "kube-system/pod-checkpointer": { ObjectMeta: metav1.ObjectMeta{ Namespace: "kube-system", Name: "pod-checkpointer", }, }, "AA": {}, }, expectStart: []string{"kube-system/pod-checkpointer"}, expectStop: []string{"AA"}, expectGraceRemove: []string{"AA", "kube-system/pod-checkpointer"}, }, } for _, tc := range cases { // Set up test state. cp := CheckpointerPod{ NodeName: "mynode", PodName: "pod-checkpointer", PodNamespace: "kube-system", } if tc.podName != "" { cp.PodName = tc.podName } c := checkpoints{} // Run test now. now := time.Time{} c.update(tc.localRunning, tc.localParents, tc.apiParents, tc.activeCheckpoints, tc.inactiveCheckpoints, cp) gotStart, gotStop, gotRemove := c.process(now, tc.apiParents != nil, tc.localRunning, tc.localParents, tc.apiParents) // Advance past grace period and test again. now = now.Add(checkpointGracePeriod) c.update(tc.localRunning, tc.localParents, tc.apiParents, tc.activeCheckpoints, tc.inactiveCheckpoints, cp) gotGraceStart, gotGraceStop, gotGraceRemove := c.process(now, tc.apiParents != nil, tc.localRunning, tc.localParents, tc.apiParents) if !reflect.DeepEqual(tc.expectStart, gotStart) || !reflect.DeepEqual(tc.expectStop, gotStop) || !reflect.DeepEqual(tc.expectRemove, gotRemove) || !reflect.DeepEqual(tc.expectGraceStart, gotGraceStart) || !reflect.DeepEqual(tc.expectGraceStop, gotGraceStop) || !reflect.DeepEqual(tc.expectGraceRemove, gotGraceRemove) { t.Errorf("For test: %s\nExpected start: %s Got: %s\nExpected stop: %s Got: %s\nExpected remove: %s Got: %s\nExpected grace period start: %s Got: %s\nExpected grace period stop: %s Got: %s\nExpected grace period remove: %s Got: %s\n", tc.desc, tc.expectStart, gotStart, tc.expectStop, gotStop, tc.expectRemove, gotRemove, tc.expectGraceStart, gotGraceStart, tc.expectGraceStop, gotGraceStop, tc.expectGraceRemove, gotGraceRemove) } } } ================================================ FILE: pkg/checkpoint/runtime_service.go ================================================ package checkpoint import ( "context" "time" "github.com/golang/glog" "google.golang.org/grpc" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "github.com/kubernetes-sigs/bootkube/pkg/checkpoint/cri/v1alpha1" "github.com/kubernetes-sigs/bootkube/pkg/checkpoint/cri/v1alpha2" "github.com/kubernetes-sigs/bootkube/pkg/checkpoint/internal" ) // Copied from "k8s.io/kubernetes/pkg/kubelet/types" const ( kubernetesPodNameLabel = "io.kubernetes.pod.name" kubernetesPodNamespaceLabel = "io.kubernetes.pod.namespace" kubernetesPodUIDLabel = "io.kubernetes.pod.uid" kubernetesContainerNameLabel = "io.kubernetes.container.name" kubernetesContainerTypeLabel = "io.kubernetes.container.type" ) type remoteRuntimeService struct { timeout time.Duration v1alpha1Client v1alpha1.RuntimeServiceClient v1alpha2Client v1alpha2.RuntimeServiceClient } func newRemoteRuntimeService(endpoint string, connectionTimeout time.Duration) (*remoteRuntimeService, error) { glog.Infof("Connecting to runtime service %s", endpoint) addr, dialer, err := internal.GetAddressAndDialer(endpoint) if err != nil { return nil, err } conn, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithTimeout(connectionTimeout), grpc.WithDialer(dialer)) if err != nil { glog.Errorf("Connect remote runtime %s failed: %v", addr, err) return nil, err } return &remoteRuntimeService{ timeout: connectionTimeout, v1alpha1Client: v1alpha1.NewRuntimeServiceClient(conn), v1alpha2Client: v1alpha2.NewRuntimeServiceClient(conn), }, nil } // localRunningPods uses the CRI shim to retrieve the local container runtime pod state func (r *remoteRuntimeService) localRunningPods() map[string]*v1.Pod { pods := make(map[string]*v1.Pod) // Retrieving sandboxes is likely redundant but is done to maintain sameness with what the kubelet does sandboxes, err := r.getRunningKubeletSandboxes() if err != nil { glog.Errorf("failed to list running sandboxes: %v", err) return nil } // Add pods from all sandboxes for _, s := range sandboxes { podName := s.Namespace + "/" + s.Name if _, ok := pods[podName]; !ok { p := &v1.Pod{} p.UID = types.UID(s.Uid) p.Name = s.Name p.Namespace = s.Namespace pods[podName] = p } } containers, err := r.getRunningKubeletContainers() if err != nil { glog.Errorf("failed to list running containers: %v", err) return nil } // Add all pods that containers are apart of for _, c := range containers { podName := c.Labels[kubernetesPodNamespaceLabel] + "/" + c.Labels[kubernetesPodNameLabel] if _, ok := pods[podName]; !ok { p := &v1.Pod{} p.UID = types.UID(c.Labels[kubernetesPodUIDLabel]) p.Name = c.Labels[kubernetesPodNameLabel] p.Namespace = c.Labels[kubernetesPodNamespaceLabel] pods[podName] = p } } return pods } type criContainer struct { Labels map[string]string } type criSandbox struct { Uid string Name string Namespace string Labels map[string]string } func (r *remoteRuntimeService) getRunningKubeletContainers() ([]criContainer, error) { ctx, cancel := context.WithTimeout(context.Background(), r.timeout) defer cancel() var containers []criContainer if _, err := r.v1alpha1Client.Version(ctx, &v1alpha1.VersionRequest{}); err == nil { resp, err := r.v1alpha1Client.ListContainers(ctx, &v1alpha1.ListContainersRequest{ Filter: &v1alpha1.ContainerFilter{ State: &v1alpha1.ContainerStateValue{ // Filter out non-running containers State: v1alpha1.ContainerState_CONTAINER_RUNNING, }, }, }) if err != nil { glog.Errorf("ListContainers with filter from runtime service failed: %v", err) return nil, err } for _, c := range resp.Containers { if c.Metadata == nil { glog.V(4).Infof("Container does not have metadata: %+v", c) continue } containers = append(containers, criContainer{Labels: c.Labels}) } return containers, nil } // Try v1alpha2 resp, err := r.v1alpha2Client.ListContainers(ctx, &v1alpha2.ListContainersRequest{ Filter: &v1alpha2.ContainerFilter{ State: &v1alpha2.ContainerStateValue{ // Filter out non-running containers State: v1alpha2.ContainerState_CONTAINER_RUNNING, }, }, }) if err != nil { glog.Errorf("ListContainers with filter from runtime service failed: %v", err) return nil, err } for _, c := range resp.Containers { if c.Metadata == nil { glog.V(4).Infof("Container does not have metadata: %+v", c) continue } containers = append(containers, criContainer{Labels: c.Labels}) } return containers, nil } func (r *remoteRuntimeService) getRunningKubeletSandboxes() ([]criSandbox, error) { ctx, cancel := context.WithTimeout(context.Background(), r.timeout) defer cancel() var sandboxes []criSandbox if _, err := r.v1alpha1Client.Version(ctx, &v1alpha1.VersionRequest{}); err == nil { resp, err := r.v1alpha1Client.ListPodSandbox(ctx, &v1alpha1.ListPodSandboxRequest{ Filter: &v1alpha1.PodSandboxFilter{ // Filter out non-running sandboxes State: &v1alpha1.PodSandboxStateValue{ State: v1alpha1.PodSandboxState_SANDBOX_READY, }, }, }) if err != nil { glog.Errorf("ListPodSandbox with filter from runtime service failed: %v", err) return nil, err } for _, c := range resp.Items { if c.Metadata == nil { glog.V(4).Infof("Sandbox does not have metadata: %+v", c) continue } sandboxes = append(sandboxes, criSandbox{ Uid: c.Metadata.Uid, Name: c.Metadata.Name, Namespace: c.Metadata.Namespace, Labels: c.Labels, }) } return sandboxes, nil } resp, err := r.v1alpha2Client.ListPodSandbox(ctx, &v1alpha2.ListPodSandboxRequest{ Filter: &v1alpha2.PodSandboxFilter{ // Filter out non-running sandboxes State: &v1alpha2.PodSandboxStateValue{ State: v1alpha2.PodSandboxState_SANDBOX_READY, }, }, }) if err != nil { glog.Errorf("ListPodSandbox with filter from runtime service failed: %v", err) return nil, err } for _, c := range resp.Items { if c.Metadata == nil { glog.V(4).Infof("Sandbox does not have metadata: %+v", c) continue } sandboxes = append(sandboxes, criSandbox{ Uid: c.Metadata.Uid, Name: c.Metadata.Name, Namespace: c.Metadata.Namespace, Labels: c.Labels, }) } return sandboxes, nil } ================================================ FILE: pkg/checkpoint/secret.go ================================================ package checkpoint import ( "context" "fmt" "os" "path" "path/filepath" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // checkpointSecretVolumes ensures that all pod secrets are checkpointed locally, then converts the secret volume to a hostpath. func (c *checkpointer) checkpointSecretVolumes(pod *corev1.Pod) (*corev1.Pod, error) { uid, gid, err := podUserAndGroup(pod) if err != nil { return nil, fmt.Errorf("failed to checkpoint secret for pod %s/%s: %v", pod.Namespace, pod.Name, err) } for i := range pod.Spec.Volumes { v := &pod.Spec.Volumes[i] if v.Secret == nil { continue } _, err := c.checkpointSecret(pod.Namespace, pod.Name, v.Secret.SecretName, uid, gid) if err != nil { return nil, fmt.Errorf("failed to checkpoint secret for pod %s/%s: %v", pod.Namespace, pod.Name, err) } } return pod, nil } // checkpointSecret will locally store secret data. // The path to the secret data becomes: checkpointSecretPath/namespace/podname/secretName/secret.file // Where each "secret.file" is a key from the secret.Data field. func (c *checkpointer) checkpointSecret(namespace, podName, secretName string, uid, gid int) (string, error) { secret, err := c.apiserver.CoreV1().Secrets(namespace).Get(context.TODO(), secretName, metav1.GetOptions{}) if err != nil { return "", fmt.Errorf("failed to retrieve secret %s/%s: %v", namespace, secretName, err) } basePath := secretPath(namespace, podName, secretName) if err := os.MkdirAll(basePath, 0700); err != nil { return "", fmt.Errorf("failed to create secret checkpoint path %s: %v", basePath, err) } if err := os.Chown(basePath, uid, gid); err != nil { return "", fmt.Errorf("failed to chown secret checkpoint path %s: %v", basePath, err) } // TODO(aaron): No need to store if already exists for f, d := range secret.Data { if err := writeAndAtomicRename(filepath.Join(basePath, f), d, uid, gid, 0600); err != nil { return "", fmt.Errorf("failed to write secret %s: %v", secret.Name, err) } } return basePath, nil } func secretPath(namespace, podName, secretName string) string { return filepath.Join(checkpointSecretPath, namespace, podName, secretName) } func podFullNameToSecretPath(id string) string { namespace, podname := path.Split(id) return filepath.Join(checkpointSecretPath, namespace, podname) } ================================================ FILE: pkg/checkpoint/state.go ================================================ package checkpoint import ( "fmt" "time" "github.com/golang/glog" ) // apiCondition represents information returned from the various api endpoints for a given pod. type apiCondition struct { // apiAvailable is true if the apiserver was reachable. apiAvailable bool // apiParent is true if the api parent pod exists. apiParent bool // localRunning is true if the CRI shim reports that the pod is running locally. localRunning bool // localParent is true if the kubelet parent pod exists. localParent bool } // String() implements fmt.Stringer.String(). func (a apiCondition) String() string { return fmt.Sprintf("apiAvailable=%t, apiParent=%t, localRunning=%t, localParent=%t", a.apiAvailable, a.apiParent, a.localRunning, a.localParent) } // action represents the action to be taken based on the state of a checkpoint. type action int const ( // none is the default action of "do nothing". none = iota // start means that the checkpoint should be started. start // stop means that the checkpoint should be stopped. stop // remove means that the checkpoint should be garbage collected. remove ) // String() implements fmt.Stringer.String(). func (a action) String() string { switch a { case none: return "none" case start: return "start" case stop: return "stop" case remove: return "remove" default: return "[unknown action]" } } // checkpointState represents the current state of a checkpoint. type checkpointState interface { // transition computes the new state for the current time and information from various apis. transition(time.Time, apiCondition) checkpointState // action returns the action that should be taken for this state. action() action } // stateSelfCheckpointActive represents a checkpoint of the checkpointer itself, which has special // behavior. // // stateSelfCheckpointActive can transition to stateActiveGracePeriod. type stateSelfCheckpointActive struct{} // transition implements state.transition() func (s stateSelfCheckpointActive) transition(now time.Time, apis apiCondition) checkpointState { if !apis.apiAvailable { // If the apiserver is unavailable always stay in the selfCheckpoint state. return s } if apis.apiParent { // If the parent pod exists always stay in the selfCheckpoint state. return s } // The apiserver parent pod is deleted, transition to stateActiveGracePeriod. // TODO(diegs): this is a little hacky, perhaps clean it up with a constructor. return stateActiveGracePeriod{gracePeriodEnd: now.Add(checkpointGracePeriod)}.checkGracePeriod(now, apis) } // action implements state.action() func (s stateSelfCheckpointActive) action() action { // The self-checkpoint should always be started. return start } // String() implements fmt.Stringer.String(). func (s stateSelfCheckpointActive) String() string { return "self-checkpoint" } // stateNone represents a new pod that has not been processed yet, so it has no checkpoint state. // // stateNone can transition to stateInactive, stateInactiveGracePeriod, or stateActive. type stateNone struct{} // transition implements state.transition() func (s stateNone) transition(now time.Time, apis apiCondition) checkpointState { // Newly discovered pods are treated as mostly inactive, but only if there is either a local // running pod or kubelet parent pod. In other words, if the new pod is only reflected in the // apiserver we do not checkpoint it yet. if apis.localRunning || apis.localParent { return stateInactive{}.transition(now, apis) } return s } // action implements state.action() func (s stateNone) action() action { return none } // String() implements fmt.Stringer.String(). func (s stateNone) String() string { return "none" } // stateInactive is a checkpoint that is currently sitting inactive on disk. // // stateInactive can transition to stateActive or stateInactiveGracePeriod. type stateInactive struct{} // transition implements state.transition() func (s stateInactive) transition(now time.Time, apis apiCondition) checkpointState { if !apis.apiAvailable { // The apiserver is unavailable but the local copy is running, remain in stateInactive. if apis.localRunning { return s } // The apiserver is unavailable and the local pod is not running, transition to stateActive. return stateActive{} } if apis.apiParent { // The parent pod exists and the kubelet is running it, remain in stateInactive. if apis.localRunning { return s } // The parent pod exists but the kubelet is not running it, transition to stateActive. return stateActive{} } // The apiserver parent pod is deleted, transition to stateInactiveGracePeriod. // TODO(diegs): this is a little hacky, perhaps clean it up with a constructor. return stateInactiveGracePeriod{gracePeriodEnd: now.Add(checkpointGracePeriod)}.checkGracePeriod(now, apis) } // action implements state.action() func (s stateInactive) action() action { return stop } // String() implements fmt.Stringer.String(). func (s stateInactive) String() string { return "inactive" } // stateInactiveGracePeriod is a checkpoint that is inactive but will be garbage collected after a // grace period. // // stateInactiveGracePeriod can transition to stateInactive, stateActive, or stateRemove. type stateInactiveGracePeriod struct { // gracePeriodEnd is the time when the grace period for this checkpoint is over and it should be // garbage collected. gracePeriodEnd time.Time } // transition implements state.transition() func (s stateInactiveGracePeriod) transition(now time.Time, apis apiCondition) checkpointState { if !apis.apiAvailable { // The apiserver is unavailable but the local copy is running, remain in // stateInactiveGracePeriod. if apis.localRunning { return s.checkGracePeriod(now, apis) } // The apiserver is unavailable and the local pod is not running, transition to stateActive. return stateActive{} } if apis.apiParent { // The parent pod exists and the kubelet is running it, remain in inactive. if apis.localRunning { return stateInactive{} } // The parent pod exists but the kubelet is not running it, transition to stateActive. return stateActive{} } // The apiserver pod is still deleted, remain in stateInactiveGracePeriod. return s.checkGracePeriod(now, apis) } func (s stateInactiveGracePeriod) checkGracePeriod(now time.Time, apis apiCondition) checkpointState { // Override state to remove if the grace period has passed. if now.Equal(s.gracePeriodEnd) || now.After(s.gracePeriodEnd) { glog.Infof("Grace period exceeded for state %s", s) return stateRemove{} } return s } // action implements state.action() func (s stateInactiveGracePeriod) action() action { return stop } // String() implements fmt.Stringer.String(). func (s stateInactiveGracePeriod) String() string { return "inactive (grace period)" } // stateActive is a checkpoint that is currently activated. // // stateActive can transition to stateInactive or stateActiveGracePeriod. type stateActive struct{} // transition implements state.transition() func (s stateActive) transition(now time.Time, apis apiCondition) checkpointState { if !apis.apiAvailable { // The apiserver is unavailable but the local copy is running, transition to inactive. if apis.localRunning { return stateInactive{} } // The apiserver is unavailable and the local pod is not running, remain in stateActive. return s } if apis.apiParent { // The parent pod exists and the kubelet is running it, transition to inactive. if apis.localRunning { return stateInactive{} } // The parent pod exists but the kubelet is not running it, remain in stateActive. return s } // The apiserver pod is deleted, transition to stateActiveGracePeriod. // TODO(diegs): this is a little hacky, perhaps clean it up with a constructor. return stateActiveGracePeriod{gracePeriodEnd: now.Add(checkpointGracePeriod)}.checkGracePeriod(now, apis) } // action implements state.action() func (s stateActive) action() action { return start } // String() implements fmt.Stringer.String(). func (s stateActive) String() string { return "active" } // stateActiveGracePeriod is a checkpoint that is active but will be garbage collected after a grace // period. // // stateActiveGracePeriod can transition to stateActive or stateInactive. type stateActiveGracePeriod struct { // gracePeriodEnd is the time when the grace period for this checkpoint is over and it should be // garbage collected. gracePeriodEnd time.Time } // transition implements state.transition() func (s stateActiveGracePeriod) transition(now time.Time, apis apiCondition) checkpointState { if !apis.apiAvailable { // The apiserver is unavailable but the local copy is running, transition to stateInactive. if apis.localRunning { return stateInactive{} } // The apiserver is unavailable and the local pod is not running, remain in // stateActiveGracePeriod. return s.checkGracePeriod(now, apis) } if apis.apiParent { // The parent pod exists and the kubelet is running it, transition to stateInactive. if apis.localRunning { return stateInactive{} } // The parent pod exists but the kubelet is not running it, transition to stateActive. return stateActive{} } // The apiserver pod is still deleted, remain in stateActiveGracePeriod. return s.checkGracePeriod(now, apis) } func (s stateActiveGracePeriod) checkGracePeriod(now time.Time, apis apiCondition) checkpointState { // Override state to stateInactiveGracePeriod.transition() as if the grace period has passed. This // has the effect of either transitioning to stateInactive or stateRemove. if now.Equal(s.gracePeriodEnd) || now.After(s.gracePeriodEnd) { glog.Infof("Grace period exceeded for state %s", s) return stateInactiveGracePeriod{gracePeriodEnd: now}.transition(now, apis) } return s } // action implements state.action() func (s stateActiveGracePeriod) action() action { return start } // String() implements fmt.Stringer.String(). func (s stateActiveGracePeriod) String() string { return "active (grace period)" } // stateRemove is a checkpoint that is being garbage collected. // // It is a terminal state that can never transition to other states; checkpoints in this state are // removed as part of the update loop. type stateRemove struct{} // transition implements state.transition() func (s stateRemove) transition(now time.Time, apis apiCondition) checkpointState { // Remove is a terminal state. This should never actually be called. glog.Errorf("Unexpected call to transition() for state %s", s) return s } // action implements state.action() func (s stateRemove) action() action { return remove } // String() implements fmt.Stringer.String(). func (s stateRemove) String() string { return "remove" } ================================================ FILE: pkg/checkpoint/state_test.go ================================================ package checkpoint import ( "reflect" "testing" "time" ) var ( allAPIConditions []apiCondition ) func init() { checkpointGracePeriod = time.Second bools := []bool{true, false} for _, apiAvailable := range bools { for _, apiParent := range bools { for _, localRunning := range bools { for _, localParent := range bools { allAPIConditions = append(allAPIConditions, apiCondition{ apiAvailable, apiParent, localRunning, localParent, }) } } } } } func TestAllowedStateTransitions(t *testing.T) { for _, tc := range []struct { state checkpointState want []checkpointState }{{ state: stateSelfCheckpointActive{}, want: []checkpointState{stateSelfCheckpointActive{}, stateActiveGracePeriod{}}, }, { state: stateNone{}, want: []checkpointState{stateNone{}, stateInactive{}, stateInactiveGracePeriod{}, stateActive{}}, }, { state: stateInactive{}, want: []checkpointState{stateInactive{}, stateInactiveGracePeriod{}, stateActive{}}, }, { state: stateInactiveGracePeriod{}, want: []checkpointState{stateInactive{}, stateInactiveGracePeriod{}, stateActive{}, stateRemove{}}, }, { state: stateActive{}, want: []checkpointState{stateActive{}, stateActiveGracePeriod{}, stateInactive{}}, }, { state: stateActiveGracePeriod{}, want: []checkpointState{stateActiveGracePeriod{}, stateActive{}, stateInactive{}, stateRemove{}}, }, { state: stateRemove{}, want: []checkpointState{stateRemove{}}, }} { for _, apis := range allAPIConditions { now := time.Time{} got := tc.state.transition(time.Time{}, apis) allowed := false for _, want := range tc.want { if reflect.TypeOf(got) == reflect.TypeOf(want) { allowed = true break } } if !allowed { t.Errorf("%s.transition(%s, %s) = %s, want: %s", tc.state, now.Format("04:05"), apis, got, tc.want) } } } } ================================================ FILE: pkg/plugin/plugin.go ================================================ package plugin // Options represents the set of options that are common to all plugins. type Options struct { AssetDir string } // Renderer defines the requirements to render manifests. type Renderer interface { // Render is a method for creating the manifests required to exist in the // assets directory. Render(*Options, []string) error } ================================================ FILE: pkg/recovery/apiserver.go ================================================ package recovery import ( "context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/clientcmd" ) type apiServerBackend struct { client *kubernetes.Clientset } // NewAPIServerBackend constructs a new backend to talk to the API server using the given // kubeConfig. // // TODO(diegs): support using a service account instead of a kubeconfig. func NewAPIServerBackend(kubeConfigPath string) (Backend, error) { kubeConfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig( &clientcmd.ClientConfigLoadingRules{ExplicitPath: kubeConfigPath}, &clientcmd.ConfigOverrides{}) config, err := kubeConfig.ClientConfig() if err != nil { return nil, err } client, err := kubernetes.NewForConfig(config) if err != nil { return nil, err } return &apiServerBackend{ client: client, }, nil } // read implements Backend.read(). func (b *apiServerBackend) read(ctx context.Context) (*controlPlane, error) { cp := &controlPlane{} configMaps, err := b.client.CoreV1().ConfigMaps("kube-system").List(ctx, metav1.ListOptions{}) if err != nil { return nil, err } cp.configMaps = *configMaps deployments, err := b.client.AppsV1().Deployments("kube-system").List(ctx, metav1.ListOptions{}) if err != nil { return nil, err } cp.deployments = *deployments daemonSets, err := b.client.AppsV1().DaemonSets("kube-system").List(ctx, metav1.ListOptions{}) if err != nil { return nil, err } cp.daemonSets = *daemonSets secrets, err := b.client.CoreV1().Secrets("kube-system").List(ctx, metav1.ListOptions{}) if err != nil { return nil, err } cp.secrets = *secrets return cp, nil } ================================================ FILE: pkg/recovery/etcd.go ================================================ // The etcd backend fetches control plane objects directly from etcd. This is adapted heavily from // kubernetes/staging/src/k8s.io/apiserver/pkg/storage/etcd3/store.go. package recovery import ( "context" "fmt" "os" "path" "strings" "go.etcd.io/etcd/clientv3" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" "github.com/kubernetes-sigs/bootkube/cmd/render/plugin/default/asset" ) // TransformerFromStorage handles decryption and any other transformation from raw etcd value. type TransformerFromStorage func(value []byte) ([]byte, error) func identityTransformer(value []byte) ([]byte, error) { return value, nil } // etcdBackend is a backend that extracts a controlPlane from an etcd instance. type etcdBackend struct { client *clientv3.Client decoder runtime.Decoder pathPrefix string tranformer TransformerFromStorage } // NewEtcdBackend constructs a new etcdBackend for the given client and pathPrefix. func NewEtcdBackend(client *clientv3.Client, pathPrefix string) Backend { return NewEtcdBackendWithTransformer(client, pathPrefix, identityTransformer) } // NewEtcdBackendWithTransformer constructs a new etcdBackend for the given client, pathPrefix and transformer. func NewEtcdBackendWithTransformer(client *clientv3.Client, pathPrefix string, transformer TransformerFromStorage) Backend { return &etcdBackend{ client: client, decoder: scheme.Codecs.UniversalDecoder(), pathPrefix: pathPrefix, tranformer: transformer, } } // read implements Backend.read(). func (s *etcdBackend) read(ctx context.Context) (*controlPlane, error) { cp := &controlPlane{} for _, r := range []struct { etcdKeyName string obj runtime.Object }{{ etcdKeyName: "configmaps", obj: &cp.configMaps, }, { etcdKeyName: "daemonsets", obj: &cp.daemonSets, }, { etcdKeyName: "deployments", obj: &cp.deployments, }, { etcdKeyName: "secrets", obj: &cp.secrets, }} { if err := s.list(ctx, r.etcdKeyName, r.obj); err != nil { return nil, err } } return cp, nil } // get fetches a single runtime.Object with key `key` from etcd. func (s *etcdBackend) get(ctx context.Context, key string, out runtime.Object, ignoreNotFound bool) error { key = path.Join(s.pathPrefix, key, "kube-system") getResp, err := s.client.KV.Get(ctx, key) if err != nil { return err } if len(getResp.Kvs) == 0 { if ignoreNotFound { return runtime.SetZeroValue(out) } return fmt.Errorf("key not found: %s", key) } kv := getResp.Kvs[0] value, err := s.tranformer(kv.Value) if err != nil { return err } return decode(s.decoder, value, out) } func (s *etcdBackend) getBytes(ctx context.Context, key string) ([]byte, error) { key = path.Join(s.pathPrefix, key) getResp, err := s.client.KV.Get(ctx, key) if err != nil { return nil, err } if len(getResp.Kvs) == 0 { return nil, fmt.Errorf("key not found: %s", key) } kv := getResp.Kvs[0] value, err := s.tranformer(kv.Value) if err != nil { return nil, err } return value, nil } // list fetches a list runtime.Object from etcd located at key prefix `key`. func (s *etcdBackend) list(ctx context.Context, key string, listObj runtime.Object) error { listPtr, err := meta.GetItemsPtr(listObj) if err != nil { return err } key = path.Join(s.pathPrefix, key, "kube-system") if !strings.HasSuffix(key, "/") { key += "/" } getResp, err := s.client.KV.Get(ctx, key, clientv3.WithPrefix()) if err != nil { return err } elems := make([][]byte, len(getResp.Kvs)) for i, kv := range getResp.Kvs { elems[i], err = s.tranformer(kv.Value) if err != nil { return err } } return decodeList(elems, listPtr, s.decoder) } const ( assetPathRecoveryEtcd = "recovery-etcd.yaml" etcdCRDKey = "etcd.database.coreos.com/etcdclusters/kube-system/kube-etcd" etcdMemberPodPrefix = "pods/kube-system/kube-etcd-" RecoveryEtcdClientAddr = "http://localhost:52379" ) // StartRecoveryEtcdForBackup starts a recovery etcd container using given backup. // The started etcd server listens on RecoveryEtcdClientAddr. func StartRecoveryEtcdForBackup(p, backupPath string) error { d, f := path.Split(backupPath) config := struct { Image string BackupFile string BackupDir string ClientAddr string }{ Image: asset.DefaultImages.Etcd, BackupFile: f, BackupDir: d, ClientAddr: RecoveryEtcdClientAddr, } as := asset.MustCreateAssetFromTemplate(assetPathRecoveryEtcd, recoveryEtcdTemplate, config) return as.WriteFile(p) } // CleanRecoveryEtcd removes the recovery etcd static pod manifest and stops the recovery // etcd container. func CleanRecoveryEtcd(p string) error { return os.Remove(path.Join(p, assetPathRecoveryEtcd)) } func stripPort(hostport string) string { colon := strings.IndexByte(hostport, ':') if colon == -1 { return hostport } if i := strings.IndexByte(hostport, ']'); i != -1 { return strings.TrimPrefix(hostport[:i], "[") } return hostport[:colon] } ================================================ FILE: pkg/recovery/etcd_template.go ================================================ package recovery var recoveryEtcdTemplate = []byte(`apiVersion: v1 kind: Pod metadata: name: recovery-etcd namespace: kube-system labels: k8s-app: recovery-etcd spec: initContainers: - name: recovery image: {{ .Image }} command: - /usr/local/bin/etcdctl - snapshot - restore - --data-dir=/var/etcd/recovery - --name=recovery-etcd - --initial-cluster=recovery-etcd=http://localhost:52380 - --initial-cluster-token=bootkube-recovery - --initial-advertise-peer-urls=http://localhost:52380 - --skip-hash-check=true - /var/etcd-backupdir/{{ .BackupFile }} env: - name: ETCDCTL_API value: "3" volumeMounts: - mountPath: /var/etcd name: etcd readOnly: false - mountPath: /var/etcd-backupdir name: etcdbackup readOnly: false containers: - name: etcd image: {{ .Image }} command: - /usr/local/bin/etcd - --name=recovery-etcd - --listen-client-urls={{ .ClientAddr }} - --listen-peer-urls=http://0.0.0.0:52380 - --advertise-client-urls={{ .ClientAddr }} - --data-dir=/var/etcd/recovery volumeMounts: - mountPath: /var/etcd name: etcd readOnly: false hostNetwork: true restartPolicy: Never volumes: - name: etcd emptyDir: {} - name: etcdbackup hostPath: path: {{ .BackupDir }} `) var bootFromBackupEtcdTemplate = []byte(`apiVersion: v1 kind: Pod metadata: name: bootstrap-etcd namespace: kube-system labels: k8s-app: boot-etcd spec: initContainers: - name: recovery image: {{ .Image }} command: - /bin/sh - -ec - | etcdctl snapshot restore \ /var/etcd-backupdir/{{ .BackupFile }} \ --data-dir=/var/etcd/data \ --name=boot-etcd \ --initial-cluster=boot-etcd=https://{{ .BootEtcdServiceIP }}:12380 \ --initial-cluster-token={{ .ClusterToken }} \ --initial-advertise-peer-urls=https://{{ .BootEtcdServiceIP }}:12380 \ --skip-hash-check=true env: - name: ETCDCTL_API value: "3" volumeMounts: - mountPath: /var/etcd name: etcd readOnly: false - mountPath: /var/etcd-backupdir name: etcdbackup readOnly: false - name: cleanup image: {{ .Image }} command: - /bin/sh - -ec - | (/usr/local/bin/etcd \ --listen-client-urls=http://0.0.0.0:32379 \ --listen-peer-urls=http://0.0.0.0:32380 \ --advertise-client-urls=http://localhost:32379 \ --data-dir=/var/etcd/data &) && sleep 30 && \ etcdctl \ --endpoints=http://localhost:32379 \ del {{ .CRDKey }} && \ etcdctl \ --endpoints=http://localhost:32379 \ del --prefix {{ .MemberPodPrefix }} env: - name: ETCDCTL_API value: "3" volumeMounts: - mountPath: /var/etcd name: etcd readOnly: false containers: - name: etcd image: {{ .Image }} command: - /usr/local/bin/etcd - --name=boot-etcd - --listen-client-urls=https://0.0.0.0:12379 - --listen-peer-urls=https://0.0.0.0:12380 - --advertise-client-urls=https://{{ .BootEtcdServiceIP }}:12379 - --data-dir=/var/etcd/data - --peer-client-cert-auth=true - --peer-trusted-ca-file=/etc/kubernetes/secrets/etcd/peer-ca.crt - --peer-cert-file=/etc/kubernetes/secrets/etcd/peer.crt - --peer-key-file=/etc/kubernetes/secrets/etcd/peer.key - --client-cert-auth=true - --trusted-ca-file=/etc/kubernetes/secrets/etcd/server-ca.crt - --cert-file=/etc/kubernetes/secrets/etcd/server.crt - --key-file=/etc/kubernetes/secrets/etcd/server.key volumeMounts: - mountPath: /var/etcd name: etcd readOnly: false - mountPath: /etc/kubernetes/secrets name: secrets readOnly: true hostNetwork: true dnsPolicy: ClusterFirstWithHostNet restartPolicy: Never volumes: - name: etcd emptyDir: {} - name: etcdbackup hostPath: path: {{ .BackupDir }} - name: secrets hostPath: path: /etc/kubernetes/bootstrap-secrets `) var recoveryEtcdSvcTemplate = []byte(`{ "apiVersion": "v1", "kind": "Service", "metadata": { "name": "bootstrap-etcd-service", "namespace": "kube-system" }, "spec": { "selector": { "k8s-app": "boot-etcd" }, "clusterIP": "{{ .BootEtcdServiceIP }}", "ports": [ { "name": "client", "port": 12379, "protocol": "TCP" }, { "name": "peers", "port": 12380, "protocol": "TCP" } ] } }`) ================================================ FILE: pkg/recovery/recover.go ================================================ // Package recovery provides tooling to help with control plane disaster recovery. Recover() uses a // Backend to extract the control plane from a store, such as etcd, and use those to write assets // that can be used by `bootkube start` to reboot the control plane. // // The recovery tool assumes that the component names for the control plane elements are the same as // what is output by `bootkube render`. The `bootkube start` command also makes this assumption. // It also assumes that kubeconfig on the kubelet is located at /etc/kubernetes/kubeconfig, though // that can be changed in the bootstrap manifests that are rendered. package recovery import ( "context" "fmt" "io/ioutil" "path" "path/filepath" "reflect" "github.com/ghodss/yaml" "github.com/kubernetes-sigs/bootkube/cmd/render/plugin/default/asset" v1apps "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) const ( k8sAppLabel = "k8s-app" // The label used in versions > v0.4.2 componentAppLabel = "component" // The label used in versions <= v0.4.2 kubeletKubeConfigPath = "/etc/kubernetes" apiServerContainerName = "kube-apiserver" ) var ( // bootstrapK8sApps contains the components (as identified by the label "k8s-app") that we // will extract to construct the temporary bootstrap control plane. bootstrapK8sApps = map[string]struct{}{ apiServerContainerName: {}, "kube-controller-manager": {}, "kube-scheduler": {}, } // kubeConfigK8sContainers contains the names of the bootstrap container specs that need to add a // --kubeconfig flag to run in non-self-hosted mode. kubeConfigK8sContainers = map[string]struct{}{ "kube-controller-manager": {}, "kube-scheduler": {}, } // typeMetas contains a mapping from API object types to the TypeMeta struct that should be // populated for them when they are serialized. typeMetas = make(map[reflect.Type]metav1.TypeMeta) metaAccessor = meta.NewAccessor() ) func init() { addTypeMeta := func(obj runtime.Object, gv schema.GroupVersion) { t := reflect.TypeOf(obj) typeMetas[t] = metav1.TypeMeta{ APIVersion: gv.String(), Kind: t.Elem().Name(), } } addTypeMeta(&v1.ConfigMap{}, v1.SchemeGroupVersion) addTypeMeta(&v1apps.DaemonSet{}, v1apps.SchemeGroupVersion) addTypeMeta(&v1apps.Deployment{}, v1apps.SchemeGroupVersion) addTypeMeta(&v1.Pod{}, v1.SchemeGroupVersion) addTypeMeta(&v1.Secret{}, v1.SchemeGroupVersion) } // Backend defines an interface for any backend that can populate a controlPlane struct. type Backend interface { read(context.Context) (*controlPlane, error) } // controlPlane holds the control plane objects that are recovered from a backend. type controlPlane struct { configMaps v1.ConfigMapList daemonSets v1apps.DaemonSetList deployments v1apps.DeploymentList secrets v1.SecretList } // Recover recovers a control plane using the provided backend and kubeConfigPath, returning assets // for the existing control plane and a bootstrap control plane that can be used with `bootkube // start` to re-bootstrap the control plane. func Recover(ctx context.Context, backend Backend, kubeConfigPath string) (asset.Assets, error) { cp, err := backend.read(ctx) if err != nil { return nil, err } as, err := cp.renderBootstrap() if err != nil { return nil, err } kc, err := renderKubeConfig(kubeConfigPath) if err != nil { return nil, err } as = append(as, kc) return as, nil } // renderBootstrap returns assets for a bootstrap control plane that can be used with `bootkube // start` to re-bootstrap a control plane. These assets are derived from the self-hosted control // plane that was recovered by the backend, but modified for direct injection into a kubelet. func (cp *controlPlane) renderBootstrap() (asset.Assets, error) { pods, err := extractBootstrapPods(cp.daemonSets.Items, cp.deployments.Items) if err != nil { return nil, err } requiredConfigMaps, requiredSecrets := fixUpBootstrapPods(pods) as, err := outputBootstrapPods(pods) if err != nil { return nil, err } configMaps, err := outputBootstrapConfigMaps(cp.configMaps, requiredConfigMaps) if err != nil { return nil, err } as = append(as, configMaps...) secrets, err := outputBootstrapSecrets(cp.secrets, requiredSecrets) if err != nil { return nil, err } as = append(as, secrets...) return as, nil } // extractBootstrapPods extracts bootstrap pod specs from daemonsets and deployments. func extractBootstrapPods(daemonSets []v1apps.DaemonSet, deployments []v1apps.Deployment) ([]v1.Pod, error) { var pods []v1.Pod for _, ds := range daemonSets { if isBootstrapApp(ds.Labels) { pod := v1.Pod{Spec: ds.Spec.Template.Spec} if err := setBootstrapPodMetadata(&pod, ds.ObjectMeta); err != nil { return nil, err } pods = append(pods, pod) } } for _, ds := range deployments { if isBootstrapApp(ds.Labels) { pod := v1.Pod{Spec: ds.Spec.Template.Spec} if err := setBootstrapPodMetadata(&pod, ds.ObjectMeta); err != nil { return nil, err } pods = append(pods, pod) } } return pods, nil } // isBootstrapApp returns true if this app belongs to the bootstrap control plane, based on its // labels. func isBootstrapApp(labels map[string]string) bool { k8sApp := labels[k8sAppLabel] if k8sApp == "" { k8sApp = labels[componentAppLabel] } _, ok := bootstrapK8sApps[k8sApp] return ok } // setBootstrapPodMetadata creates valid metadata for a bootstrap pod. Currently it sets the // TypeMeta and Name, Namespace, and Annotations on the ObjectMeta. func setBootstrapPodMetadata(pod *v1.Pod, parent metav1.ObjectMeta) error { if err := setTypeMeta(pod); err != nil { return err } pod.ObjectMeta = metav1.ObjectMeta{ Annotations: parent.Annotations, Name: "bootstrap-" + parent.Name, Namespace: parent.Namespace, } return nil } // fixUpBootstrapPods modifies extracted bootstrap pod specs to have correct metadata and point to // filesystem-mount-based secrets, and removes any security contexts that might prevent the pods // from accessing those secrets. It returns mappings from configMap and secret names to output // paths that must also be rendered in order for the bootstrap pods to be functional. func fixUpBootstrapPods(pods []v1.Pod) (requiredConfigMaps, requiredSecrets map[string]string) { requiredConfigMaps, requiredSecrets = make(map[string]string), make(map[string]string) for i := range pods { pod := &pods[i] // Fix SecurityContext to ensure the pod runs as root. if pod.Spec.SecurityContext != nil { pod.Spec.SecurityContext.RunAsNonRoot = nil pod.Spec.SecurityContext.RunAsUser = nil } // Fix hostNetwork: true because bootstrap assets can not rely on overlay networks. if pod.Spec.HostNetwork == false { pod.Spec.HostNetwork = true } // Change secret volumes to point to file mounts. for i := range pod.Spec.Volumes { vol := &pod.Spec.Volumes[i] if vol.Secret != nil { pathSuffix := filepath.Join("secrets", vol.Secret.SecretName) requiredSecrets[vol.Secret.SecretName] = filepath.Join(asset.AssetPathSecrets, pathSuffix) vol.HostPath = &v1.HostPathVolumeSource{Path: filepath.Join(asset.BootstrapSecretsDir, pathSuffix)} vol.Secret = nil } else if vol.ConfigMap != nil { pathSuffix := filepath.Join("config-maps", vol.ConfigMap.Name) requiredConfigMaps[vol.ConfigMap.Name] = filepath.Join(asset.AssetPathSecrets, pathSuffix) vol.HostPath = &v1.HostPathVolumeSource{Path: path.Join(asset.BootstrapSecretsDir, pathSuffix)} vol.ConfigMap = nil } } // Make sure the kubeconfig is in the commandline. for i := range pod.Spec.Containers { cn := &pod.Spec.Containers[i] // Fix SecurityContext to ensure the container runs as root. if cn.SecurityContext != nil { cn.SecurityContext.RunAsNonRoot = nil cn.SecurityContext.RunAsUser = nil } // Assumes the bootkube naming convention is used. Could also just make sure the image uses hyperkube. if _, ok := kubeConfigK8sContainers[cn.Name]; ok { cn.Command = append(cn.Command, "--kubeconfig=/kubeconfig/kubeconfig") cn.VolumeMounts = append(cn.VolumeMounts, v1.VolumeMount{ MountPath: "/kubeconfig", Name: "kubeconfig", ReadOnly: true, }) } } // Add a mount for the kubeconfig. pod.Spec.Volumes = append(pod.Spec.Volumes, v1.Volume{ VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: kubeletKubeConfigPath}}, Name: "kubeconfig", }) } return } // outputBootstrapPods outputs the bootstrap pod definitions. func outputBootstrapPods(pods []v1.Pod) (asset.Assets, error) { var as asset.Assets for _, pod := range pods { a, err := serializeObjToYAML(path.Join(asset.AssetPathBootstrapManifests, pod.Name+".yaml"), &pod) if err != nil { return nil, err } as = append(as, a) } return as, nil } // outputBootstrapConfigMaps creates assets for all the configMap names in the requiredConfigMaps // set. It returns an error if any configMap cannot be found in the provided configMaps list. func outputBootstrapConfigMaps(configMaps v1.ConfigMapList, requiredConfigMaps map[string]string) (asset.Assets, error) { return outputKeyValueData(&configMaps, requiredConfigMaps, func(obj runtime.Object) map[string][]byte { configMap, ok := obj.(*v1.ConfigMap) if !ok || configMap == nil { return nil } output := make(map[string][]byte) for k, v := range configMap.Data { output[k] = []byte(v) } return output }) } // outputBootstrapSecrets creates assets for all the secret names in the requiredSecrets set. It // returns an error if any secret cannot be found in the provided secrets list. func outputBootstrapSecrets(secrets v1.SecretList, requiredSecrets map[string]string) (asset.Assets, error) { return outputKeyValueData(&secrets, requiredSecrets, func(obj runtime.Object) map[string][]byte { if secret, ok := obj.(*v1.Secret); ok && secret != nil { return secret.Data } return nil }) } // outputKeyValueData takes a key-value object (such as a Secret or ConfigMap) and outputs assets // for each key-value pair. See outputBootstrapConfigMaps or outputBootstrapSecrets for usage. func outputKeyValueData(objList runtime.Object, requiredObjs map[string]string, extractData func(runtime.Object) map[string][]byte) (asset.Assets, error) { var as asset.Assets objs, err := meta.ExtractList(objList) if err != nil { return nil, err } for _, obj := range objs { name, err := metaAccessor.Name(obj) if err != nil { return nil, err } if namePrefix, ok := requiredObjs[name]; ok { for key, data := range extractData(obj) { as = append(as, asset.Asset{ Name: path.Join(namePrefix, key), Data: data, }) } delete(requiredObjs, name) } } if len(requiredObjs) > 0 { var missingObjs []string for obj := range requiredObjs { missingObjs = append(missingObjs, obj) } return nil, fmt.Errorf("failed to extract some required objects: %v", missingObjs) } return as, nil } // renderKubeConfig outputs kubeconfig assets to ensure that the kubeconfig will be rendered to the // assetDir for use by `bootkube start`. func renderKubeConfig(kubeConfigPath string) (asset.Asset, error) { kubeConfig, err := ioutil.ReadFile(kubeConfigPath) if err != nil { return asset.Asset{}, err } return asset.Asset{ Name: asset.AssetPathAdminKubeConfig, // used by `bootkube start`. Data: kubeConfig, }, nil } // setTypeMeta sets the TypeMeta for a runtime.Object. // TODO(diegs): find the apimachinery code that does this, and use that instead. func setTypeMeta(obj runtime.Object) error { typeMeta, ok := typeMetas[reflect.TypeOf(obj)] if !ok { return fmt.Errorf("don't know about type: %T", obj) } metaAccessor.SetAPIVersion(obj, typeMeta.APIVersion) metaAccessor.SetKind(obj, typeMeta.Kind) return nil } // serializeObjToYAML serializes a runtime.Object into a YAML asset. func serializeObjToYAML(assetName string, obj runtime.Object) (asset.Asset, error) { data, err := yaml.Marshal(obj) if err != nil { return asset.Asset{}, err } return asset.Asset{ Name: assetName, Data: data, }, nil } ================================================ FILE: pkg/recovery/recover_test.go ================================================ package recovery import ( "reflect" "testing" "github.com/kubernetes-sigs/bootkube/cmd/render/plugin/default/asset" v1apps "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) var ( secretData = []byte("this is very secret") cp = &controlPlane{ configMaps: v1.ConfigMapList{ Items: []v1.ConfigMap{{ ObjectMeta: metav1.ObjectMeta{ Name: "kube-apiserver", Namespace: "kube-system", }, Data: map[string]string{"key": "value"}, }}, }, daemonSets: v1apps.DaemonSetList{ Items: []v1apps.DaemonSet{{ ObjectMeta: metav1.ObjectMeta{ Name: "kube-apiserver", Namespace: "kube-system", Labels: map[string]string{ "tier": "control-plane", "k8s-app": "kube-apiserver", }, }, Spec: v1apps.DaemonSetSpec{ Template: v1.PodTemplateSpec{ Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "kube-apiserver", Image: "quay.io/coreos/hyperkube:v1.6.4_coreos.0", Command: []string{"/hyperkube", "apiserver", "--secure-port=6443"}, VolumeMounts: []v1.VolumeMount{{ Name: "ssl-certs-host", MountPath: "/etc/ssl/certs", ReadOnly: true, }, { Name: "secrets", MountPath: "/etc/kubernetes/secrets", ReadOnly: true, }}, }}, Volumes: []v1.Volume{{ Name: "ssl-certs-host", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/usr/share/ca-certificates"}}, }, { Name: "secrets", VolumeSource: v1.VolumeSource{Secret: &v1.SecretVolumeSource{SecretName: "kube-apiserver"}}, }}, }, }, }, }}, }, deployments: v1apps.DeploymentList{ Items: []v1apps.Deployment{{ ObjectMeta: metav1.ObjectMeta{ Name: "kube-scheduler", Namespace: "kube-system", Labels: map[string]string{ "tier": "control-plane", "k8s-app": "kube-scheduler", }, }, Spec: v1apps.DeploymentSpec{ Template: v1.PodTemplateSpec{ Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "kube-scheduler", Image: "quay.io/coreos/hyperkube:v1.6.4_coreos.0", Command: []string{"/hyperkube", "scheduler"}, }}, }, }, }, }}, }, secrets: v1.SecretList{ Items: []v1.Secret{{ ObjectMeta: metav1.ObjectMeta{ Name: "kube-apiserver", Namespace: "kube-system", }, Data: map[string][]byte{"apiserver.crt": secretData}, }}, }, } ) func TestExtractBootstrapPods(t *testing.T) { got, err := extractBootstrapPods(cp.daemonSets.Items, cp.deployments.Items) want := []v1.Pod{{ TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "bootstrap-kube-apiserver", Namespace: "kube-system", }, Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "kube-apiserver", Image: "quay.io/coreos/hyperkube:v1.6.4_coreos.0", Command: []string{"/hyperkube", "apiserver", "--secure-port=6443"}, VolumeMounts: []v1.VolumeMount{{ Name: "ssl-certs-host", MountPath: "/etc/ssl/certs", ReadOnly: true, }, { Name: "secrets", MountPath: "/etc/kubernetes/secrets", ReadOnly: true, }}, }}, Volumes: []v1.Volume{{ Name: "ssl-certs-host", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/usr/share/ca-certificates"}}, }, { Name: "secrets", VolumeSource: v1.VolumeSource{Secret: &v1.SecretVolumeSource{SecretName: "kube-apiserver"}}, }}, }, }, { TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "bootstrap-kube-scheduler", Namespace: "kube-system", }, Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "kube-scheduler", Image: "quay.io/coreos/hyperkube:v1.6.4_coreos.0", Command: []string{"/hyperkube", "scheduler"}, }}, }, }} if err != nil { t.Errorf("extractBootstrapPods(%v, %v) = %v, want: %v", cp.daemonSets.Items, cp.deployments.Items, err, nil) } else if !reflect.DeepEqual(got, want) { t.Errorf("extractBootstrapPods(%v, %v) = %v, want: %v", cp.daemonSets.Items, cp.deployments.Items, got, want) } } func TestFixUpBootstrapPods(t *testing.T) { pods := []v1.Pod{{ TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "bootstrap-kube-apiserver", Namespace: "kube-system", }, Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "kube-apiserver", Image: "quay.io/coreos/hyperkube:v1.6.4_coreos.0", Command: []string{"/hyperkube", "apiserver", "--secure-port=6443"}, VolumeMounts: []v1.VolumeMount{{ Name: "ssl-certs-host", MountPath: "/etc/ssl/certs", ReadOnly: true, }, { Name: "configs", MountPath: "/etc/kubernetes/config-maps", ReadOnly: true, }, { Name: "secrets", MountPath: "/etc/kubernetes/secrets", ReadOnly: true, }}, }}, Volumes: []v1.Volume{{ Name: "ssl-certs-host", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/usr/share/ca-certificates"}}, }, { Name: "configs", VolumeSource: v1.VolumeSource{ConfigMap: &v1.ConfigMapVolumeSource{LocalObjectReference: v1.LocalObjectReference{Name: "kube-apiserver"}}}, }, { Name: "secrets", VolumeSource: v1.VolumeSource{Secret: &v1.SecretVolumeSource{SecretName: "kube-apiserver"}}, }}, }, }, { TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "bootstrap-kube-controller-manager", Namespace: "kube-system", }, Spec: v1.PodSpec{ SecurityContext: &v1.PodSecurityContext{RunAsNonRoot: boolPtr(true), RunAsUser: int64Ptr(65543)}, Containers: []v1.Container{{ Name: "kube-controller-manager", Image: "quay.io/coreos/hyperkube:v1.6.4_coreos.0", Command: []string{"/hyperkube", "controller-manager"}, }}, }, }, { TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "bootstrap-kube-scheduler", Namespace: "kube-system", }, Spec: v1.PodSpec{ SecurityContext: &v1.PodSecurityContext{RunAsNonRoot: boolPtr(true), RunAsUser: int64Ptr(65543)}, Containers: []v1.Container{{ Name: "kube-scheduler", Image: "quay.io/coreos/hyperkube:v1.6.4_coreos.0", Command: []string{"/hyperkube", "scheduler"}, }}, }, }} // assertions go here: wantPods := []v1.Pod{{ TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "bootstrap-kube-apiserver", Namespace: "kube-system", }, Spec: v1.PodSpec{ Containers: []v1.Container{{ Name: "kube-apiserver", Image: "quay.io/coreos/hyperkube:v1.6.4_coreos.0", Command: []string{"/hyperkube", "apiserver", "--secure-port=6443"}, VolumeMounts: []v1.VolumeMount{{ Name: "ssl-certs-host", MountPath: "/etc/ssl/certs", ReadOnly: true, }, { Name: "configs", MountPath: "/etc/kubernetes/config-maps", ReadOnly: true, }, { Name: "secrets", MountPath: "/etc/kubernetes/secrets", ReadOnly: true, }}, }}, HostNetwork: true, Volumes: []v1.Volume{{ Name: "ssl-certs-host", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/usr/share/ca-certificates"}}, }, { Name: "configs", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/etc/kubernetes/bootstrap-secrets/config-maps/kube-apiserver"}}, }, { Name: "secrets", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/etc/kubernetes/bootstrap-secrets/secrets/kube-apiserver"}}, }, { Name: "kubeconfig", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/etc/kubernetes"}}, }}, }, }, { TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "bootstrap-kube-controller-manager", Namespace: "kube-system", }, Spec: v1.PodSpec{ SecurityContext: &v1.PodSecurityContext{}, Containers: []v1.Container{{ Name: "kube-controller-manager", Image: "quay.io/coreos/hyperkube:v1.6.4_coreos.0", Command: []string{"/hyperkube", "controller-manager", "--kubeconfig=/kubeconfig/kubeconfig"}, VolumeMounts: []v1.VolumeMount{{ Name: "kubeconfig", MountPath: "/kubeconfig", ReadOnly: true, }}, }}, HostNetwork: true, Volumes: []v1.Volume{{ Name: "kubeconfig", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/etc/kubernetes"}}, }}, }, }, { TypeMeta: metav1.TypeMeta{ Kind: "Pod", APIVersion: "v1", }, ObjectMeta: metav1.ObjectMeta{ Name: "bootstrap-kube-scheduler", Namespace: "kube-system", }, Spec: v1.PodSpec{ SecurityContext: &v1.PodSecurityContext{}, Containers: []v1.Container{{ Name: "kube-scheduler", Image: "quay.io/coreos/hyperkube:v1.6.4_coreos.0", Command: []string{"/hyperkube", "scheduler", "--kubeconfig=/kubeconfig/kubeconfig"}, VolumeMounts: []v1.VolumeMount{{ Name: "kubeconfig", MountPath: "/kubeconfig", ReadOnly: true, }}, }}, HostNetwork: true, Volumes: []v1.Volume{{ Name: "kubeconfig", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/etc/kubernetes"}}, }}, }, }} wantConfigMaps := map[string]string{"kube-apiserver": "tls/config-maps/kube-apiserver"} wantSecrets := map[string]string{"kube-apiserver": "tls/secrets/kube-apiserver"} gotConfigMaps, gotSecrets := fixUpBootstrapPods(pods) if !reflect.DeepEqual(gotSecrets, wantSecrets) || !reflect.DeepEqual(gotConfigMaps, wantConfigMaps) { t.Errorf("fixUpBootstrapPods(%v) = %v, %v, want: %v, %v", pods, gotConfigMaps, gotSecrets, wantConfigMaps, wantSecrets) } else if !reflect.DeepEqual(pods, wantPods) { t.Errorf("fixUpBootstrapPods(%v) = %v, want: %v", pods, pods, wantPods) } } func TestOutputConfigMaps(t *testing.T) { requiredSecrets := map[string]string{"kube-apiserver": "tls/kube-apiserver"} want := asset.Assets{{ Name: "tls/kube-apiserver/apiserver.crt", Data: secretData, }} if got, err := outputBootstrapSecrets(cp.secrets, requiredSecrets); err != nil { t.Errorf("outputBootstrapSecrets(%v, %v) = %v, want: nil", cp.secrets.Items, requiredSecrets, err) } else if !reflect.DeepEqual(got, want) { t.Errorf("outputBootstrapSecrets(%v, %v) = %v, want: %v", cp.secrets.Items, requiredSecrets, got, want) } } func TestOutputBootstrapSecrets(t *testing.T) { requiredSecrets := map[string]string{"kube-apiserver": "tls/kube-apiserver"} want := asset.Assets{{ Name: "tls/kube-apiserver/apiserver.crt", Data: secretData, }} if got, err := outputBootstrapSecrets(cp.secrets, requiredSecrets); err != nil { t.Errorf("outputBootstrapSecrets(%v, %v) = %v, want: nil", cp.secrets.Items, requiredSecrets, err) } else if !reflect.DeepEqual(got, want) { t.Errorf("outputBootstrapSecrets(%v, %v) = %v, want: %v", cp.secrets.Items, requiredSecrets, got, want) } } func TestOutputKeyValueDataKeyMissing(t *testing.T) { objList := &v1.SecretList{} requiredObjs := map[string]string{"missing-key": "some-path"} if as, err := outputKeyValueData(objList, requiredObjs, func(obj runtime.Object) map[string][]byte { return obj.(*v1.Secret).Data }); err == nil { t.Errorf("outputKeyValueData(%v, %v) = %v, %v, want: nil, non-nil", objList, requiredObjs, as, err) } } func TestIsBootstrapApp(t *testing.T) { for app := range bootstrapK8sApps { labels := map[string]string{ "tier": "control-plane", k8sAppLabel: app, } if !isBootstrapApp(labels) { t.Errorf("isBootstrapApp(%v) = false, want: true", labels) } labels = map[string]string{ "tier": "control-plane", componentAppLabel: app, } if !isBootstrapApp(labels) { t.Errorf("isBootstrapApp(%v) = false, want: true", labels) } } } func TestIsNotBootstrapApp(t *testing.T) { for _, labels := range []map[string]string{{ "tier": "control-plane", k8sAppLabel: "wrong-app", }, { "tier": "control-plane", "wrong-label": "kube-apiserver", }} { if isBootstrapApp(labels) { t.Errorf("isBootstrapApp(%v) = true, want: false", labels) } } } func TestSetTypeMeta(t *testing.T) { for _, obj := range []runtime.Object{ &v1.ConfigMap{}, &v1apps.DaemonSet{}, &v1apps.Deployment{}, &v1.Pod{}, &v1.Secret{}, } { if err := setTypeMeta(obj); err != nil { t.Errorf("setTypeMeta(%v) = %v, want: nil", obj, err) } if apiVersion, err := metaAccessor.APIVersion(obj); apiVersion == "" || err != nil { t.Errorf("APIVersion(%v) = %v, %v, want: , nil", obj, apiVersion, err) } if kind, err := metaAccessor.Kind(obj); kind == "" || err != nil { t.Errorf("Kind(%v) = %v, %v, want: , nil", obj, kind, err) } } } func boolPtr(b bool) *bool { return &b } func int64Ptr(i int64) *int64 { return &i } ================================================ FILE: pkg/recovery/util.go ================================================ package recovery import ( "fmt" "reflect" "k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/runtime" ) // decode decodes value of bytes into object. func decode(decoder runtime.Decoder, value []byte, objPtr runtime.Object) error { if _, err := conversion.EnforcePtr(objPtr); err != nil { return fmt.Errorf("objPtr must be pointer, got: %T", objPtr) } _, _, err := decoder.Decode(value, nil, objPtr) if err != nil { return err } return nil } // decodeList decodes a list of values into a list of objects. func decodeList(elems [][]byte, listPtr interface{}, decoder runtime.Decoder) error { v, err := conversion.EnforcePtr(listPtr) if err != nil || v.Kind() != reflect.Slice { return fmt.Errorf("listPtr must be pointer to slice, got: %T", listPtr) } for _, elem := range elems { obj, _, err := decoder.Decode(elem, nil, reflect.New(v.Type().Elem()).Interface().(runtime.Object)) if err != nil { return err } v.Set(reflect.Append(v, reflect.ValueOf(obj).Elem())) } return nil } ================================================ FILE: pkg/tlsutil/tlsutil.go ================================================ package tlsutil import ( "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "errors" "math" "math/big" "net" "time" ) const ( RSAKeySize = 2048 Duration365d = time.Hour * 24 * 365 ) type CertConfig struct { CommonName string Organization []string OrganizationalUnit []string AltNames AltNames } // AltNames contains the domain names and IP addresses that will be added // to the API Server's x509 certificate SubAltNames field. The values will // be passed directly to the x509.Certificate object. type AltNames struct { DNSNames []string IPs []net.IP } func NewPrivateKey() (*rsa.PrivateKey, error) { return rsa.GenerateKey(rand.Reader, RSAKeySize) } func EncodePublicKeyPEM(key *rsa.PublicKey) ([]byte, error) { der, err := x509.MarshalPKIXPublicKey(key) if err != nil { return []byte{}, err } block := pem.Block{ Type: "PUBLIC KEY", Bytes: der, } return pem.EncodeToMemory(&block), nil } func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte { block := pem.Block{ Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(key), } return pem.EncodeToMemory(&block) } func EncodeCertificatePEM(cert *x509.Certificate) []byte { block := pem.Block{ Type: "CERTIFICATE", Bytes: cert.Raw, } return pem.EncodeToMemory(&block) } func NewSelfSignedCACertificate(cfg CertConfig, key *rsa.PrivateKey) (*x509.Certificate, error) { now := time.Now() tmpl := x509.Certificate{ SerialNumber: new(big.Int).SetInt64(0), Subject: pkix.Name{ CommonName: cfg.CommonName, Organization: cfg.Organization, OrganizationalUnit: cfg.OrganizationalUnit, }, NotBefore: now.UTC(), NotAfter: now.Add(Duration365d * 10).UTC(), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, BasicConstraintsValid: true, IsCA: true, } certDERBytes, err := x509.CreateCertificate(rand.Reader, &tmpl, &tmpl, key.Public(), key) if err != nil { return nil, err } return x509.ParseCertificate(certDERBytes) } func ParsePEMEncodedCACert(pemdata []byte) (*x509.Certificate, error) { decoded, _ := pem.Decode(pemdata) if decoded == nil { return nil, errors.New("no PEM data found") } return x509.ParseCertificate(decoded.Bytes) } func ParsePEMEncodedPrivateKey(pemdata []byte) (*rsa.PrivateKey, error) { decoded, _ := pem.Decode(pemdata) if decoded == nil { return nil, errors.New("no PEM data found") } return x509.ParsePKCS1PrivateKey(decoded.Bytes) } func NewSignedCertificate(cfg CertConfig, key *rsa.PrivateKey, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, error) { serial, err := rand.Int(rand.Reader, new(big.Int).SetInt64(math.MaxInt64)) if err != nil { return nil, err } certTmpl := x509.Certificate{ Subject: pkix.Name{ CommonName: cfg.CommonName, Organization: cfg.Organization, }, DNSNames: cfg.AltNames.DNSNames, IPAddresses: cfg.AltNames.IPs, SerialNumber: serial, NotBefore: caCert.NotBefore, NotAfter: time.Now().Add(Duration365d).UTC(), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth}, } certDERBytes, err := x509.CreateCertificate(rand.Reader, &certTmpl, caCert, key.Public(), caKey) if err != nil { return nil, err } return x509.ParseCertificate(certDERBytes) } ================================================ FILE: pkg/util/log.go ================================================ package util import ( "flag" "log" "time" "github.com/golang/glog" "k8s.io/apimachinery/pkg/util/wait" ) type GlogWriter struct{} func init() { flag.Set("logtostderr", "true") } func (writer GlogWriter) Write(data []byte) (n int, err error) { glog.Info(string(data)) return len(data), nil } func InitLogs() { log.SetOutput(GlogWriter{}) log.SetFlags(log.LUTC | log.Ldate | log.Ltime) flushFreq := 5 * time.Second go wait.Until(glog.Flush, flushFreq, wait.NeverStop) } func FlushLogs() { glog.Flush() } ================================================ FILE: pkg/version/version.go ================================================ package version var Version string = "none" ================================================ FILE: vendor/github.com/coreos/etcd/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/coreos/etcd/NOTICE ================================================ CoreOS Project Copyright 2014 CoreOS, Inc This product includes software developed at CoreOS, Inc. (http://www.coreos.com/). ================================================ FILE: vendor/github.com/coreos/etcd/auth/authpb/auth.pb.go ================================================ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: auth.proto /* Package authpb is a generated protocol buffer package. It is generated from these files: auth.proto It has these top-level messages: User Permission Role */ package authpb import ( "fmt" proto "github.com/golang/protobuf/proto" math "math" _ "github.com/gogo/protobuf/gogoproto" io "io" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Permission_Type int32 const ( READ Permission_Type = 0 WRITE Permission_Type = 1 READWRITE Permission_Type = 2 ) var Permission_Type_name = map[int32]string{ 0: "READ", 1: "WRITE", 2: "READWRITE", } var Permission_Type_value = map[string]int32{ "READ": 0, "WRITE": 1, "READWRITE": 2, } func (x Permission_Type) String() string { return proto.EnumName(Permission_Type_name, int32(x)) } func (Permission_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptorAuth, []int{1, 0} } // User is a single entry in the bucket authUsers type User struct { Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Password []byte `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Roles []string `protobuf:"bytes,3,rep,name=roles" json:"roles,omitempty"` } func (m *User) Reset() { *m = User{} } func (m *User) String() string { return proto.CompactTextString(m) } func (*User) ProtoMessage() {} func (*User) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{0} } // Permission is a single entity type Permission struct { PermType Permission_Type `protobuf:"varint,1,opt,name=permType,proto3,enum=authpb.Permission_Type" json:"permType,omitempty"` Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` RangeEnd []byte `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` } func (m *Permission) Reset() { *m = Permission{} } func (m *Permission) String() string { return proto.CompactTextString(m) } func (*Permission) ProtoMessage() {} func (*Permission) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{1} } // Role is a single entry in the bucket authRoles type Role struct { Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` KeyPermission []*Permission `protobuf:"bytes,2,rep,name=keyPermission" json:"keyPermission,omitempty"` } func (m *Role) Reset() { *m = Role{} } func (m *Role) String() string { return proto.CompactTextString(m) } func (*Role) ProtoMessage() {} func (*Role) Descriptor() ([]byte, []int) { return fileDescriptorAuth, []int{2} } func init() { proto.RegisterType((*User)(nil), "authpb.User") proto.RegisterType((*Permission)(nil), "authpb.Permission") proto.RegisterType((*Role)(nil), "authpb.Role") proto.RegisterEnum("authpb.Permission_Type", Permission_Type_name, Permission_Type_value) } func (m *User) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *User) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if len(m.Password) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintAuth(dAtA, i, uint64(len(m.Password))) i += copy(dAtA[i:], m.Password) } if len(m.Roles) > 0 { for _, s := range m.Roles { dAtA[i] = 0x1a i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } return i, nil } func (m *Permission) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Permission) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.PermType != 0 { dAtA[i] = 0x8 i++ i = encodeVarintAuth(dAtA, i, uint64(m.PermType)) } if len(m.Key) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintAuth(dAtA, i, uint64(len(m.Key))) i += copy(dAtA[i:], m.Key) } if len(m.RangeEnd) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintAuth(dAtA, i, uint64(len(m.RangeEnd))) i += copy(dAtA[i:], m.RangeEnd) } return i, nil } func (m *Role) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Role) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintAuth(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if len(m.KeyPermission) > 0 { for _, msg := range m.KeyPermission { dAtA[i] = 0x12 i++ i = encodeVarintAuth(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func encodeVarintAuth(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return offset + 1 } func (m *User) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovAuth(uint64(l)) } l = len(m.Password) if l > 0 { n += 1 + l + sovAuth(uint64(l)) } if len(m.Roles) > 0 { for _, s := range m.Roles { l = len(s) n += 1 + l + sovAuth(uint64(l)) } } return n } func (m *Permission) Size() (n int) { var l int _ = l if m.PermType != 0 { n += 1 + sovAuth(uint64(m.PermType)) } l = len(m.Key) if l > 0 { n += 1 + l + sovAuth(uint64(l)) } l = len(m.RangeEnd) if l > 0 { n += 1 + l + sovAuth(uint64(l)) } return n } func (m *Role) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovAuth(uint64(l)) } if len(m.KeyPermission) > 0 { for _, e := range m.KeyPermission { l = e.Size() n += 1 + l + sovAuth(uint64(l)) } } return n } func sovAuth(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozAuth(x uint64) (n int) { return sovAuth(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *User) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: User: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthAuth } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) if m.Name == nil { m.Name = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthAuth } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Password = append(m.Password[:0], dAtA[iNdEx:postIndex]...) if m.Password == nil { m.Password = []byte{} } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthAuth } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAuth(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Permission) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Permission: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Permission: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PermType", wireType) } m.PermType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.PermType |= (Permission_Type(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthAuth } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthAuth } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) if m.RangeEnd == nil { m.RangeEnd = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAuth(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Role) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Role: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Role: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthAuth } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) if m.Name == nil { m.Name = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field KeyPermission", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuth } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthAuth } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.KeyPermission = append(m.KeyPermission, &Permission{}) if err := m.KeyPermission[len(m.KeyPermission)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAuth(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthAuth } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipAuth(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowAuth } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowAuth } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowAuth } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthAuth } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowAuth } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipAuth(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthAuth = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAuth = fmt.Errorf("proto: integer overflow") ) func init() { proto.RegisterFile("auth.proto", fileDescriptorAuth) } var fileDescriptorAuth = []byte{ // 288 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4a, 0xc3, 0x30, 0x1c, 0xc6, 0x9b, 0xb6, 0x1b, 0xed, 0x5f, 0x27, 0x25, 0x0c, 0x0c, 0x13, 0x42, 0xe9, 0xa9, 0x78, 0xa8, 0xb0, 0x5d, 0xbc, 0x2a, 0xf6, 0x20, 0x78, 0x90, 0x50, 0xf1, 0x28, 0x1d, 0x0d, 0x75, 0x6c, 0x6d, 0x4a, 0x32, 0x91, 0xbe, 0x89, 0x07, 0x1f, 0x68, 0xc7, 0x3d, 0x82, 0xab, 0x2f, 0x22, 0x4d, 0x64, 0x43, 0xdc, 0xed, 0xfb, 0xbe, 0xff, 0x97, 0xe4, 0x97, 0x3f, 0x40, 0xfe, 0xb6, 0x7e, 0x4d, 0x1a, 0x29, 0xd6, 0x02, 0x0f, 0x7b, 0xdd, 0xcc, 0x27, 0xe3, 0x52, 0x94, 0x42, 0x47, 0x57, 0xbd, 0x32, 0xd3, 0xe8, 0x01, 0xdc, 0x27, 0xc5, 0x25, 0xc6, 0xe0, 0xd6, 0x79, 0xc5, 0x09, 0x0a, 0x51, 0x7c, 0xca, 0xb4, 0xc6, 0x13, 0xf0, 0x9a, 0x5c, 0xa9, 0x77, 0x21, 0x0b, 0x62, 0xeb, 0x7c, 0xef, 0xf1, 0x18, 0x06, 0x52, 0xac, 0xb8, 0x22, 0x4e, 0xe8, 0xc4, 0x3e, 0x33, 0x26, 0xfa, 0x44, 0x00, 0x8f, 0x5c, 0x56, 0x0b, 0xa5, 0x16, 0xa2, 0xc6, 0x33, 0xf0, 0x1a, 0x2e, 0xab, 0xac, 0x6d, 0xcc, 0xc5, 0x67, 0xd3, 0xf3, 0xc4, 0xd0, 0x24, 0x87, 0x56, 0xd2, 0x8f, 0xd9, 0xbe, 0x88, 0x03, 0x70, 0x96, 0xbc, 0xfd, 0x7d, 0xb0, 0x97, 0xf8, 0x02, 0x7c, 0x99, 0xd7, 0x25, 0x7f, 0xe1, 0x75, 0x41, 0x1c, 0x03, 0xa2, 0x83, 0xb4, 0x2e, 0xa2, 0x4b, 0x70, 0xf5, 0x31, 0x0f, 0x5c, 0x96, 0xde, 0xdc, 0x05, 0x16, 0xf6, 0x61, 0xf0, 0xcc, 0xee, 0xb3, 0x34, 0x40, 0x78, 0x04, 0x7e, 0x1f, 0x1a, 0x6b, 0x47, 0x19, 0xb8, 0x4c, 0xac, 0xf8, 0xd1, 0xcf, 0x5e, 0xc3, 0x68, 0xc9, 0xdb, 0x03, 0x16, 0xb1, 0x43, 0x27, 0x3e, 0x99, 0xe2, 0xff, 0xc0, 0xec, 0x6f, 0xf1, 0x96, 0x6c, 0x76, 0xd4, 0xda, 0xee, 0xa8, 0xb5, 0xe9, 0x28, 0xda, 0x76, 0x14, 0x7d, 0x75, 0x14, 0x7d, 0x7c, 0x53, 0x6b, 0x3e, 0xd4, 0x3b, 0x9e, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x76, 0x8d, 0x4f, 0x8f, 0x01, 0x00, 0x00, } ================================================ FILE: vendor/github.com/coreos/etcd/auth/authpb/auth.proto ================================================ syntax = "proto3"; package authpb; import "gogoproto/gogo.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_getters_all) = false; option (gogoproto.goproto_enum_prefix_all) = false; // User is a single entry in the bucket authUsers message User { bytes name = 1; bytes password = 2; repeated string roles = 3; } // Permission is a single entity message Permission { enum Type { READ = 0; WRITE = 1; READWRITE = 2; } Type permType = 1; bytes key = 2; bytes range_end = 3; } // Role is a single entry in the bucket authRoles message Role { bytes name = 1; repeated Permission keyPermission = 2; } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/README.md ================================================ # etcd/clientv3 [![Godoc](https://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/go.etcd.io/etcd/clientv3) `etcd/clientv3` is the official Go etcd client for v3. ## Install ```bash go get go.etcd.io/etcd/clientv3 ``` ## Get started Create client using `clientv3.New`: ```go cli, err := clientv3.New(clientv3.Config{ Endpoints: []string{"localhost:2379", "localhost:22379", "localhost:32379"}, DialTimeout: 5 * time.Second, }) if err != nil { // handle error! } defer cli.Close() ``` etcd v3 uses [`gRPC`](http://www.grpc.io) for remote procedure calls. And `clientv3` uses [`grpc-go`](https://github.com/grpc/grpc-go) to connect to etcd. Make sure to close the client after using it. If the client is not closed, the connection will have leaky goroutines. To specify client request timeout, pass `context.WithTimeout` to APIs: ```go ctx, cancel := context.WithTimeout(context.Background(), timeout) resp, err := cli.Put(ctx, "sample_key", "sample_value") cancel() if err != nil { // handle error! } // use the response ``` etcd uses `cmd/vendor` directory to store external dependencies, which are to be compiled into etcd release binaries. `client` can be imported without vendoring. For full compatibility, it is recommended to vendor builds using etcd's vendored packages, using tools like godep, as in [vendor directories](https://golang.org/cmd/go/#hdr-Vendor_Directories). For more detail, please read [Go vendor design](https://golang.org/s/go15vendor). ## Error Handling etcd client returns 2 types of errors: 1. context error: canceled or deadline exceeded. 2. gRPC error: see [api/v3rpc/rpctypes](https://godoc.org/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes). Here is the example code to handle client errors: ```go resp, err := cli.Put(ctx, "", "") if err != nil { switch err { case context.Canceled: log.Fatalf("ctx is canceled by another routine: %v", err) case context.DeadlineExceeded: log.Fatalf("ctx is attached with a deadline is exceeded: %v", err) case rpctypes.ErrEmptyKey: log.Fatalf("client-side error: %v", err) default: log.Fatalf("bad cluster endpoints, which are not etcd servers: %v", err) } } ``` ## Metrics The etcd client optionally exposes RPC metrics through [go-grpc-prometheus](https://github.com/grpc-ecosystem/go-grpc-prometheus). See the [examples](https://github.com/coreos/etcd/blob/master/clientv3/example_metrics_test.go). ## Namespacing The [namespace](https://godoc.org/go.etcd.io/etcd/clientv3/namespace) package provides `clientv3` interface wrappers to transparently isolate client requests to a user-defined prefix. ## Examples More code examples can be found at [GoDoc](https://godoc.org/go.etcd.io/etcd/clientv3). ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/auth.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" "fmt" "strings" "github.com/coreos/etcd/auth/authpb" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" "google.golang.org/grpc" ) type ( AuthEnableResponse pb.AuthEnableResponse AuthDisableResponse pb.AuthDisableResponse AuthenticateResponse pb.AuthenticateResponse AuthUserAddResponse pb.AuthUserAddResponse AuthUserDeleteResponse pb.AuthUserDeleteResponse AuthUserChangePasswordResponse pb.AuthUserChangePasswordResponse AuthUserGrantRoleResponse pb.AuthUserGrantRoleResponse AuthUserGetResponse pb.AuthUserGetResponse AuthUserRevokeRoleResponse pb.AuthUserRevokeRoleResponse AuthRoleAddResponse pb.AuthRoleAddResponse AuthRoleGrantPermissionResponse pb.AuthRoleGrantPermissionResponse AuthRoleGetResponse pb.AuthRoleGetResponse AuthRoleRevokePermissionResponse pb.AuthRoleRevokePermissionResponse AuthRoleDeleteResponse pb.AuthRoleDeleteResponse AuthUserListResponse pb.AuthUserListResponse AuthRoleListResponse pb.AuthRoleListResponse PermissionType authpb.Permission_Type Permission authpb.Permission ) const ( PermRead = authpb.READ PermWrite = authpb.WRITE PermReadWrite = authpb.READWRITE ) type Auth interface { // AuthEnable enables auth of an etcd cluster. AuthEnable(ctx context.Context) (*AuthEnableResponse, error) // AuthDisable disables auth of an etcd cluster. AuthDisable(ctx context.Context) (*AuthDisableResponse, error) // UserAdd adds a new user to an etcd cluster. UserAdd(ctx context.Context, name string, password string) (*AuthUserAddResponse, error) // UserDelete deletes a user from an etcd cluster. UserDelete(ctx context.Context, name string) (*AuthUserDeleteResponse, error) // UserChangePassword changes a password of a user. UserChangePassword(ctx context.Context, name string, password string) (*AuthUserChangePasswordResponse, error) // UserGrantRole grants a role to a user. UserGrantRole(ctx context.Context, user string, role string) (*AuthUserGrantRoleResponse, error) // UserGet gets a detailed information of a user. UserGet(ctx context.Context, name string) (*AuthUserGetResponse, error) // UserList gets a list of all users. UserList(ctx context.Context) (*AuthUserListResponse, error) // UserRevokeRole revokes a role of a user. UserRevokeRole(ctx context.Context, name string, role string) (*AuthUserRevokeRoleResponse, error) // RoleAdd adds a new role to an etcd cluster. RoleAdd(ctx context.Context, name string) (*AuthRoleAddResponse, error) // RoleGrantPermission grants a permission to a role. RoleGrantPermission(ctx context.Context, name string, key, rangeEnd string, permType PermissionType) (*AuthRoleGrantPermissionResponse, error) // RoleGet gets a detailed information of a role. RoleGet(ctx context.Context, role string) (*AuthRoleGetResponse, error) // RoleList gets a list of all roles. RoleList(ctx context.Context) (*AuthRoleListResponse, error) // RoleRevokePermission revokes a permission from a role. RoleRevokePermission(ctx context.Context, role string, key, rangeEnd string) (*AuthRoleRevokePermissionResponse, error) // RoleDelete deletes a role. RoleDelete(ctx context.Context, role string) (*AuthRoleDeleteResponse, error) } type auth struct { remote pb.AuthClient callOpts []grpc.CallOption } func NewAuth(c *Client) Auth { api := &auth{remote: RetryAuthClient(c)} if c != nil { api.callOpts = c.callOpts } return api } func (auth *auth) AuthEnable(ctx context.Context) (*AuthEnableResponse, error) { resp, err := auth.remote.AuthEnable(ctx, &pb.AuthEnableRequest{}, auth.callOpts...) return (*AuthEnableResponse)(resp), toErr(ctx, err) } func (auth *auth) AuthDisable(ctx context.Context) (*AuthDisableResponse, error) { resp, err := auth.remote.AuthDisable(ctx, &pb.AuthDisableRequest{}, auth.callOpts...) return (*AuthDisableResponse)(resp), toErr(ctx, err) } func (auth *auth) UserAdd(ctx context.Context, name string, password string) (*AuthUserAddResponse, error) { resp, err := auth.remote.UserAdd(ctx, &pb.AuthUserAddRequest{Name: name, Password: password}, auth.callOpts...) return (*AuthUserAddResponse)(resp), toErr(ctx, err) } func (auth *auth) UserDelete(ctx context.Context, name string) (*AuthUserDeleteResponse, error) { resp, err := auth.remote.UserDelete(ctx, &pb.AuthUserDeleteRequest{Name: name}, auth.callOpts...) return (*AuthUserDeleteResponse)(resp), toErr(ctx, err) } func (auth *auth) UserChangePassword(ctx context.Context, name string, password string) (*AuthUserChangePasswordResponse, error) { resp, err := auth.remote.UserChangePassword(ctx, &pb.AuthUserChangePasswordRequest{Name: name, Password: password}, auth.callOpts...) return (*AuthUserChangePasswordResponse)(resp), toErr(ctx, err) } func (auth *auth) UserGrantRole(ctx context.Context, user string, role string) (*AuthUserGrantRoleResponse, error) { resp, err := auth.remote.UserGrantRole(ctx, &pb.AuthUserGrantRoleRequest{User: user, Role: role}, auth.callOpts...) return (*AuthUserGrantRoleResponse)(resp), toErr(ctx, err) } func (auth *auth) UserGet(ctx context.Context, name string) (*AuthUserGetResponse, error) { resp, err := auth.remote.UserGet(ctx, &pb.AuthUserGetRequest{Name: name}, auth.callOpts...) return (*AuthUserGetResponse)(resp), toErr(ctx, err) } func (auth *auth) UserList(ctx context.Context) (*AuthUserListResponse, error) { resp, err := auth.remote.UserList(ctx, &pb.AuthUserListRequest{}, auth.callOpts...) return (*AuthUserListResponse)(resp), toErr(ctx, err) } func (auth *auth) UserRevokeRole(ctx context.Context, name string, role string) (*AuthUserRevokeRoleResponse, error) { resp, err := auth.remote.UserRevokeRole(ctx, &pb.AuthUserRevokeRoleRequest{Name: name, Role: role}, auth.callOpts...) return (*AuthUserRevokeRoleResponse)(resp), toErr(ctx, err) } func (auth *auth) RoleAdd(ctx context.Context, name string) (*AuthRoleAddResponse, error) { resp, err := auth.remote.RoleAdd(ctx, &pb.AuthRoleAddRequest{Name: name}, auth.callOpts...) return (*AuthRoleAddResponse)(resp), toErr(ctx, err) } func (auth *auth) RoleGrantPermission(ctx context.Context, name string, key, rangeEnd string, permType PermissionType) (*AuthRoleGrantPermissionResponse, error) { perm := &authpb.Permission{ Key: []byte(key), RangeEnd: []byte(rangeEnd), PermType: authpb.Permission_Type(permType), } resp, err := auth.remote.RoleGrantPermission(ctx, &pb.AuthRoleGrantPermissionRequest{Name: name, Perm: perm}, auth.callOpts...) return (*AuthRoleGrantPermissionResponse)(resp), toErr(ctx, err) } func (auth *auth) RoleGet(ctx context.Context, role string) (*AuthRoleGetResponse, error) { resp, err := auth.remote.RoleGet(ctx, &pb.AuthRoleGetRequest{Role: role}, auth.callOpts...) return (*AuthRoleGetResponse)(resp), toErr(ctx, err) } func (auth *auth) RoleList(ctx context.Context) (*AuthRoleListResponse, error) { resp, err := auth.remote.RoleList(ctx, &pb.AuthRoleListRequest{}, auth.callOpts...) return (*AuthRoleListResponse)(resp), toErr(ctx, err) } func (auth *auth) RoleRevokePermission(ctx context.Context, role string, key, rangeEnd string) (*AuthRoleRevokePermissionResponse, error) { resp, err := auth.remote.RoleRevokePermission(ctx, &pb.AuthRoleRevokePermissionRequest{Role: role, Key: key, RangeEnd: rangeEnd}, auth.callOpts...) return (*AuthRoleRevokePermissionResponse)(resp), toErr(ctx, err) } func (auth *auth) RoleDelete(ctx context.Context, role string) (*AuthRoleDeleteResponse, error) { resp, err := auth.remote.RoleDelete(ctx, &pb.AuthRoleDeleteRequest{Role: role}, auth.callOpts...) return (*AuthRoleDeleteResponse)(resp), toErr(ctx, err) } func StrToPermissionType(s string) (PermissionType, error) { val, ok := authpb.Permission_Type_value[strings.ToUpper(s)] if ok { return PermissionType(val), nil } return PermissionType(-1), fmt.Errorf("invalid permission type: %s", s) } type authenticator struct { conn *grpc.ClientConn // conn in-use remote pb.AuthClient callOpts []grpc.CallOption } func (auth *authenticator) authenticate(ctx context.Context, name string, password string) (*AuthenticateResponse, error) { resp, err := auth.remote.Authenticate(ctx, &pb.AuthenticateRequest{Name: name, Password: password}, auth.callOpts...) return (*AuthenticateResponse)(resp), toErr(ctx, err) } func (auth *authenticator) close() { auth.conn.Close() } func newAuthenticator(endpoint string, opts []grpc.DialOption, c *Client) (*authenticator, error) { conn, err := grpc.Dial(endpoint, opts...) if err != nil { return nil, err } api := &authenticator{ conn: conn, remote: pb.NewAuthClient(conn), } if c != nil { api.callOpts = c.callOpts } return api, nil } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/client.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" "crypto/tls" "errors" "fmt" "net" "net/url" "strconv" "strings" "sync" "time" "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) var ( ErrNoAvailableEndpoints = errors.New("etcdclient: no available endpoints") ErrOldCluster = errors.New("etcdclient: old cluster version") ) // Client provides and manages an etcd v3 client session. type Client struct { Cluster KV Lease Watcher Auth Maintenance conn *grpc.ClientConn dialerrc chan error cfg Config creds *credentials.TransportCredentials balancer *healthBalancer mu *sync.Mutex ctx context.Context cancel context.CancelFunc // Username is a user name for authentication. Username string // Password is a password for authentication. Password string // tokenCred is an instance of WithPerRPCCredentials()'s argument tokenCred *authTokenCredential callOpts []grpc.CallOption } // New creates a new etcdv3 client from a given configuration. func New(cfg Config) (*Client, error) { if len(cfg.Endpoints) == 0 { return nil, ErrNoAvailableEndpoints } return newClient(&cfg) } // NewCtxClient creates a client with a context but no underlying grpc // connection. This is useful for embedded cases that override the // service interface implementations and do not need connection management. func NewCtxClient(ctx context.Context) *Client { cctx, cancel := context.WithCancel(ctx) return &Client{ctx: cctx, cancel: cancel} } // NewFromURL creates a new etcdv3 client from a URL. func NewFromURL(url string) (*Client, error) { return New(Config{Endpoints: []string{url}}) } // Close shuts down the client's etcd connections. func (c *Client) Close() error { c.cancel() c.Watcher.Close() c.Lease.Close() if c.conn != nil { return toErr(c.ctx, c.conn.Close()) } return c.ctx.Err() } // Ctx is a context for "out of band" messages (e.g., for sending // "clean up" message when another context is canceled). It is // canceled on client Close(). func (c *Client) Ctx() context.Context { return c.ctx } // Endpoints lists the registered endpoints for the client. func (c *Client) Endpoints() (eps []string) { // copy the slice; protect original endpoints from being changed eps = make([]string, len(c.cfg.Endpoints)) copy(eps, c.cfg.Endpoints) return } // SetEndpoints updates client's endpoints. func (c *Client) SetEndpoints(eps ...string) { c.mu.Lock() c.cfg.Endpoints = eps c.mu.Unlock() c.balancer.updateAddrs(eps...) // updating notifyCh can trigger new connections, // need update addrs if all connections are down // or addrs does not include pinAddr. c.balancer.mu.RLock() update := !hasAddr(c.balancer.addrs, c.balancer.pinAddr) c.balancer.mu.RUnlock() if update { select { case c.balancer.updateAddrsC <- notifyNext: case <-c.balancer.stopc: } } } // Sync synchronizes client's endpoints with the known endpoints from the etcd membership. func (c *Client) Sync(ctx context.Context) error { mresp, err := c.MemberList(ctx) if err != nil { return err } var eps []string for _, m := range mresp.Members { eps = append(eps, m.ClientURLs...) } c.SetEndpoints(eps...) return nil } func (c *Client) autoSync() { if c.cfg.AutoSyncInterval == time.Duration(0) { return } for { select { case <-c.ctx.Done(): return case <-time.After(c.cfg.AutoSyncInterval): ctx, cancel := context.WithTimeout(c.ctx, 5*time.Second) err := c.Sync(ctx) cancel() if err != nil && err != c.ctx.Err() { logger.Println("Auto sync endpoints failed:", err) } } } } type authTokenCredential struct { token string tokenMu *sync.RWMutex } func (cred authTokenCredential) RequireTransportSecurity() bool { return false } func (cred authTokenCredential) GetRequestMetadata(ctx context.Context, s ...string) (map[string]string, error) { cred.tokenMu.RLock() defer cred.tokenMu.RUnlock() return map[string]string{ "token": cred.token, }, nil } func parseEndpoint(endpoint string) (proto string, host string, scheme string) { proto = "tcp" host = endpoint url, uerr := url.Parse(endpoint) if uerr != nil || !strings.Contains(endpoint, "://") { return proto, host, scheme } scheme = url.Scheme // strip scheme:// prefix since grpc dials by host host = url.Host switch url.Scheme { case "http", "https": case "unix", "unixs": proto = "unix" host = url.Host + url.Path default: proto, host = "", "" } return proto, host, scheme } func (c *Client) processCreds(scheme string) (creds *credentials.TransportCredentials) { creds = c.creds switch scheme { case "unix": case "http": creds = nil case "https", "unixs": if creds != nil { break } tlsconfig := &tls.Config{} emptyCreds := credentials.NewTLS(tlsconfig) creds = &emptyCreds default: creds = nil } return creds } // dialSetupOpts gives the dial opts prior to any authentication func (c *Client) dialSetupOpts(endpoint string, dopts ...grpc.DialOption) (opts []grpc.DialOption) { if c.cfg.DialTimeout > 0 { opts = []grpc.DialOption{grpc.WithTimeout(c.cfg.DialTimeout)} } if c.cfg.DialKeepAliveTime > 0 { params := keepalive.ClientParameters{ Time: c.cfg.DialKeepAliveTime, Timeout: c.cfg.DialKeepAliveTimeout, } opts = append(opts, grpc.WithKeepaliveParams(params)) } opts = append(opts, dopts...) f := func(host string, t time.Duration) (net.Conn, error) { proto, host, _ := parseEndpoint(c.balancer.endpoint(host)) if host == "" && endpoint != "" { // dialing an endpoint not in the balancer; use // endpoint passed into dial proto, host, _ = parseEndpoint(endpoint) } if proto == "" { return nil, fmt.Errorf("unknown scheme for %q", host) } select { case <-c.ctx.Done(): return nil, c.ctx.Err() default: } dialer := &net.Dialer{Timeout: t} conn, err := dialer.DialContext(c.ctx, proto, host) if err != nil { select { case c.dialerrc <- err: default: } } return conn, err } opts = append(opts, grpc.WithDialer(f)) creds := c.creds if _, _, scheme := parseEndpoint(endpoint); len(scheme) != 0 { creds = c.processCreds(scheme) } if creds != nil { opts = append(opts, grpc.WithTransportCredentials(*creds)) } else { opts = append(opts, grpc.WithInsecure()) } return opts } // Dial connects to a single endpoint using the client's config. func (c *Client) Dial(endpoint string) (*grpc.ClientConn, error) { return c.dial(endpoint) } func (c *Client) getToken(ctx context.Context) error { var err error // return last error in a case of fail var auth *authenticator for i := 0; i < len(c.cfg.Endpoints); i++ { endpoint := c.cfg.Endpoints[i] host := getHost(endpoint) // use dial options without dopts to avoid reusing the client balancer auth, err = newAuthenticator(host, c.dialSetupOpts(endpoint), c) if err != nil { continue } defer auth.close() var resp *AuthenticateResponse resp, err = auth.authenticate(ctx, c.Username, c.Password) if err != nil { continue } c.tokenCred.tokenMu.Lock() c.tokenCred.token = resp.Token c.tokenCred.tokenMu.Unlock() return nil } return err } func (c *Client) dial(endpoint string, dopts ...grpc.DialOption) (*grpc.ClientConn, error) { opts := c.dialSetupOpts(endpoint, dopts...) host := getHost(endpoint) if c.Username != "" && c.Password != "" { c.tokenCred = &authTokenCredential{ tokenMu: &sync.RWMutex{}, } ctx := c.ctx if c.cfg.DialTimeout > 0 { cctx, cancel := context.WithTimeout(ctx, c.cfg.DialTimeout) defer cancel() ctx = cctx } err := c.getToken(ctx) if err != nil { if toErr(ctx, err) != rpctypes.ErrAuthNotEnabled { if err == ctx.Err() && ctx.Err() != c.ctx.Err() { err = context.DeadlineExceeded } return nil, err } } else { opts = append(opts, grpc.WithPerRPCCredentials(c.tokenCred)) } } opts = append(opts, c.cfg.DialOptions...) conn, err := grpc.DialContext(c.ctx, host, opts...) if err != nil { return nil, err } return conn, nil } // WithRequireLeader requires client requests to only succeed // when the cluster has a leader. func WithRequireLeader(ctx context.Context) context.Context { md := metadata.Pairs(rpctypes.MetadataRequireLeaderKey, rpctypes.MetadataHasLeader) return metadata.NewOutgoingContext(ctx, md) } func newClient(cfg *Config) (*Client, error) { if cfg == nil { cfg = &Config{} } var creds *credentials.TransportCredentials if cfg.TLS != nil { c := credentials.NewTLS(cfg.TLS) creds = &c } // use a temporary skeleton client to bootstrap first connection baseCtx := context.TODO() if cfg.Context != nil { baseCtx = cfg.Context } ctx, cancel := context.WithCancel(baseCtx) client := &Client{ conn: nil, dialerrc: make(chan error, 1), cfg: *cfg, creds: creds, ctx: ctx, cancel: cancel, mu: new(sync.Mutex), callOpts: defaultCallOpts, } if cfg.Username != "" && cfg.Password != "" { client.Username = cfg.Username client.Password = cfg.Password } if cfg.MaxCallSendMsgSize > 0 || cfg.MaxCallRecvMsgSize > 0 { if cfg.MaxCallRecvMsgSize > 0 && cfg.MaxCallSendMsgSize > cfg.MaxCallRecvMsgSize { return nil, fmt.Errorf("gRPC message recv limit (%d bytes) must be greater than send limit (%d bytes)", cfg.MaxCallRecvMsgSize, cfg.MaxCallSendMsgSize) } callOpts := []grpc.CallOption{ defaultFailFast, defaultMaxCallSendMsgSize, defaultMaxCallRecvMsgSize, } if cfg.MaxCallSendMsgSize > 0 { callOpts[1] = grpc.MaxCallSendMsgSize(cfg.MaxCallSendMsgSize) } if cfg.MaxCallRecvMsgSize > 0 { callOpts[2] = grpc.MaxCallRecvMsgSize(cfg.MaxCallRecvMsgSize) } client.callOpts = callOpts } client.balancer = newHealthBalancer(cfg.Endpoints, cfg.DialTimeout, func(ep string) (bool, error) { return grpcHealthCheck(client, ep) }) // use Endpoints[0] so that for https:// without any tls config given, then // grpc will assume the certificate server name is the endpoint host. conn, err := client.dial(cfg.Endpoints[0], grpc.WithBalancer(client.balancer)) if err != nil { client.cancel() client.balancer.Close() return nil, err } client.conn = conn // wait for a connection if cfg.DialTimeout > 0 { hasConn := false waitc := time.After(cfg.DialTimeout) select { case <-client.balancer.ready(): hasConn = true case <-ctx.Done(): case <-waitc: } if !hasConn { err := context.DeadlineExceeded select { case err = <-client.dialerrc: default: } client.cancel() client.balancer.Close() conn.Close() return nil, err } } client.Cluster = NewCluster(client) client.KV = NewKV(client) client.Lease = NewLease(client) client.Watcher = NewWatcher(client) client.Auth = NewAuth(client) client.Maintenance = NewMaintenance(client) if cfg.RejectOldCluster { if err := client.checkVersion(); err != nil { client.Close() return nil, err } } go client.autoSync() return client, nil } func (c *Client) checkVersion() (err error) { var wg sync.WaitGroup errc := make(chan error, len(c.cfg.Endpoints)) ctx, cancel := context.WithCancel(c.ctx) if c.cfg.DialTimeout > 0 { ctx, cancel = context.WithTimeout(ctx, c.cfg.DialTimeout) } wg.Add(len(c.cfg.Endpoints)) for _, ep := range c.cfg.Endpoints { // if cluster is current, any endpoint gives a recent version go func(e string) { defer wg.Done() resp, rerr := c.Status(ctx, e) if rerr != nil { errc <- rerr return } vs := strings.Split(resp.Version, ".") maj, min := 0, 0 if len(vs) >= 2 { maj, _ = strconv.Atoi(vs[0]) min, rerr = strconv.Atoi(vs[1]) } if maj < 3 || (maj == 3 && min < 2) { rerr = ErrOldCluster } errc <- rerr }(ep) } // wait for success for i := 0; i < len(c.cfg.Endpoints); i++ { if err = <-errc; err == nil { break } } cancel() wg.Wait() return err } // ActiveConnection returns the current in-use connection func (c *Client) ActiveConnection() *grpc.ClientConn { return c.conn } // isHaltErr returns true if the given error and context indicate no forward // progress can be made, even after reconnecting. func isHaltErr(ctx context.Context, err error) bool { if ctx != nil && ctx.Err() != nil { return true } if err == nil { return false } ev, _ := status.FromError(err) // Unavailable codes mean the system will be right back. // (e.g., can't connect, lost leader) // Treat Internal codes as if something failed, leaving the // system in an inconsistent state, but retrying could make progress. // (e.g., failed in middle of send, corrupted frame) // TODO: are permanent Internal errors possible from grpc? return ev.Code() != codes.Unavailable && ev.Code() != codes.Internal } // isUnavailableErr returns true if the given error is an unavailable error func isUnavailableErr(ctx context.Context, err error) bool { if ctx != nil && ctx.Err() != nil { return false } if err == nil { return false } ev, _ := status.FromError(err) // Unavailable codes mean the system will be right back. // (e.g., can't connect, lost leader) return ev.Code() == codes.Unavailable } func toErr(ctx context.Context, err error) error { if err == nil { return nil } err = rpctypes.Error(err) if _, ok := err.(rpctypes.EtcdError); ok { return err } ev, _ := status.FromError(err) code := ev.Code() switch code { case codes.DeadlineExceeded: fallthrough case codes.Canceled: if ctx.Err() != nil { err = ctx.Err() } case codes.Unavailable: case codes.FailedPrecondition: err = grpc.ErrClientConnClosing } return err } func canceledByCaller(stopCtx context.Context, err error) bool { if stopCtx.Err() == nil || err == nil { return false } return err == context.Canceled || err == context.DeadlineExceeded } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/cluster.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" "github.com/coreos/etcd/pkg/types" "google.golang.org/grpc" ) type ( Member pb.Member MemberListResponse pb.MemberListResponse MemberAddResponse pb.MemberAddResponse MemberRemoveResponse pb.MemberRemoveResponse MemberUpdateResponse pb.MemberUpdateResponse ) type Cluster interface { // MemberList lists the current cluster membership. MemberList(ctx context.Context) (*MemberListResponse, error) // MemberAdd adds a new member into the cluster. MemberAdd(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error) // MemberRemove removes an existing member from the cluster. MemberRemove(ctx context.Context, id uint64) (*MemberRemoveResponse, error) // MemberUpdate updates the peer addresses of the member. MemberUpdate(ctx context.Context, id uint64, peerAddrs []string) (*MemberUpdateResponse, error) } type cluster struct { remote pb.ClusterClient callOpts []grpc.CallOption } func NewCluster(c *Client) Cluster { api := &cluster{remote: RetryClusterClient(c)} if c != nil { api.callOpts = c.callOpts } return api } func NewClusterFromClusterClient(remote pb.ClusterClient, c *Client) Cluster { api := &cluster{remote: remote} if c != nil { api.callOpts = c.callOpts } return api } func (c *cluster) MemberAdd(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error) { // fail-fast before panic in rafthttp if _, err := types.NewURLs(peerAddrs); err != nil { return nil, err } r := &pb.MemberAddRequest{PeerURLs: peerAddrs} resp, err := c.remote.MemberAdd(ctx, r, c.callOpts...) if err != nil { return nil, toErr(ctx, err) } return (*MemberAddResponse)(resp), nil } func (c *cluster) MemberRemove(ctx context.Context, id uint64) (*MemberRemoveResponse, error) { r := &pb.MemberRemoveRequest{ID: id} resp, err := c.remote.MemberRemove(ctx, r, c.callOpts...) if err != nil { return nil, toErr(ctx, err) } return (*MemberRemoveResponse)(resp), nil } func (c *cluster) MemberUpdate(ctx context.Context, id uint64, peerAddrs []string) (*MemberUpdateResponse, error) { // fail-fast before panic in rafthttp if _, err := types.NewURLs(peerAddrs); err != nil { return nil, err } // it is safe to retry on update. r := &pb.MemberUpdateRequest{ID: id, PeerURLs: peerAddrs} resp, err := c.remote.MemberUpdate(ctx, r, c.callOpts...) if err == nil { return (*MemberUpdateResponse)(resp), nil } return nil, toErr(ctx, err) } func (c *cluster) MemberList(ctx context.Context) (*MemberListResponse, error) { // it is safe to retry on list. resp, err := c.remote.MemberList(ctx, &pb.MemberListRequest{}, c.callOpts...) if err == nil { return (*MemberListResponse)(resp), nil } return nil, toErr(ctx, err) } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/compact_op.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( pb "github.com/coreos/etcd/etcdserver/etcdserverpb" ) // CompactOp represents a compact operation. type CompactOp struct { revision int64 physical bool } // CompactOption configures compact operation. type CompactOption func(*CompactOp) func (op *CompactOp) applyCompactOpts(opts []CompactOption) { for _, opt := range opts { opt(op) } } // OpCompact wraps slice CompactOption to create a CompactOp. func OpCompact(rev int64, opts ...CompactOption) CompactOp { ret := CompactOp{revision: rev} ret.applyCompactOpts(opts) return ret } func (op CompactOp) toRequest() *pb.CompactionRequest { return &pb.CompactionRequest{Revision: op.revision, Physical: op.physical} } // WithCompactPhysical makes Compact wait until all compacted entries are // removed from the etcd server's storage. func WithCompactPhysical() CompactOption { return func(op *CompactOp) { op.physical = true } } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/compare.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( pb "github.com/coreos/etcd/etcdserver/etcdserverpb" ) type CompareTarget int type CompareResult int const ( CompareVersion CompareTarget = iota CompareCreated CompareModified CompareValue ) type Cmp pb.Compare func Compare(cmp Cmp, result string, v interface{}) Cmp { var r pb.Compare_CompareResult switch result { case "=": r = pb.Compare_EQUAL case "!=": r = pb.Compare_NOT_EQUAL case ">": r = pb.Compare_GREATER case "<": r = pb.Compare_LESS default: panic("Unknown result op") } cmp.Result = r switch cmp.Target { case pb.Compare_VALUE: val, ok := v.(string) if !ok { panic("bad compare value") } cmp.TargetUnion = &pb.Compare_Value{Value: []byte(val)} case pb.Compare_VERSION: cmp.TargetUnion = &pb.Compare_Version{Version: mustInt64(v)} case pb.Compare_CREATE: cmp.TargetUnion = &pb.Compare_CreateRevision{CreateRevision: mustInt64(v)} case pb.Compare_MOD: cmp.TargetUnion = &pb.Compare_ModRevision{ModRevision: mustInt64(v)} case pb.Compare_LEASE: cmp.TargetUnion = &pb.Compare_Lease{Lease: mustInt64orLeaseID(v)} default: panic("Unknown compare type") } return cmp } func Value(key string) Cmp { return Cmp{Key: []byte(key), Target: pb.Compare_VALUE} } func Version(key string) Cmp { return Cmp{Key: []byte(key), Target: pb.Compare_VERSION} } func CreateRevision(key string) Cmp { return Cmp{Key: []byte(key), Target: pb.Compare_CREATE} } func ModRevision(key string) Cmp { return Cmp{Key: []byte(key), Target: pb.Compare_MOD} } // LeaseValue compares a key's LeaseID to a value of your choosing. The empty // LeaseID is 0, otherwise known as `NoLease`. func LeaseValue(key string) Cmp { return Cmp{Key: []byte(key), Target: pb.Compare_LEASE} } // KeyBytes returns the byte slice holding with the comparison key. func (cmp *Cmp) KeyBytes() []byte { return cmp.Key } // WithKeyBytes sets the byte slice for the comparison key. func (cmp *Cmp) WithKeyBytes(key []byte) { cmp.Key = key } // ValueBytes returns the byte slice holding the comparison value, if any. func (cmp *Cmp) ValueBytes() []byte { if tu, ok := cmp.TargetUnion.(*pb.Compare_Value); ok { return tu.Value } return nil } // WithValueBytes sets the byte slice for the comparison's value. func (cmp *Cmp) WithValueBytes(v []byte) { cmp.TargetUnion.(*pb.Compare_Value).Value = v } // WithRange sets the comparison to scan the range [key, end). func (cmp Cmp) WithRange(end string) Cmp { cmp.RangeEnd = []byte(end) return cmp } // WithPrefix sets the comparison to scan all keys prefixed by the key. func (cmp Cmp) WithPrefix() Cmp { cmp.RangeEnd = getPrefix(cmp.Key) return cmp } // mustInt64 panics if val isn't an int or int64. It returns an int64 otherwise. func mustInt64(val interface{}) int64 { if v, ok := val.(int64); ok { return v } if v, ok := val.(int); ok { return int64(v) } panic("bad value") } // mustInt64orLeaseID panics if val isn't a LeaseID, int or int64. It returns an // int64 otherwise. func mustInt64orLeaseID(val interface{}) int64 { if v, ok := val.(LeaseID); ok { return int64(v) } return mustInt64(val) } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/config.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" "crypto/tls" "time" "google.golang.org/grpc" ) type Config struct { // Endpoints is a list of URLs. Endpoints []string `json:"endpoints"` // AutoSyncInterval is the interval to update endpoints with its latest members. // 0 disables auto-sync. By default auto-sync is disabled. AutoSyncInterval time.Duration `json:"auto-sync-interval"` // DialTimeout is the timeout for failing to establish a connection. DialTimeout time.Duration `json:"dial-timeout"` // DialKeepAliveTime is the time after which client pings the server to see if // transport is alive. DialKeepAliveTime time.Duration `json:"dial-keep-alive-time"` // DialKeepAliveTimeout is the time that the client waits for a response for the // keep-alive probe. If the response is not received in this time, the connection is closed. DialKeepAliveTimeout time.Duration `json:"dial-keep-alive-timeout"` // MaxCallSendMsgSize is the client-side request send limit in bytes. // If 0, it defaults to 2.0 MiB (2 * 1024 * 1024). // Make sure that "MaxCallSendMsgSize" < server-side default send/recv limit. // ("--max-request-bytes" flag to etcd or "embed.Config.MaxRequestBytes"). MaxCallSendMsgSize int // MaxCallRecvMsgSize is the client-side response receive limit. // If 0, it defaults to "math.MaxInt32", because range response can // easily exceed request send limits. // Make sure that "MaxCallRecvMsgSize" >= server-side default send/recv limit. // ("--max-request-bytes" flag to etcd or "embed.Config.MaxRequestBytes"). MaxCallRecvMsgSize int // TLS holds the client secure credentials, if any. TLS *tls.Config // Username is a user name for authentication. Username string `json:"username"` // Password is a password for authentication. Password string `json:"password"` // RejectOldCluster when set will refuse to create a client against an outdated cluster. RejectOldCluster bool `json:"reject-old-cluster"` // DialOptions is a list of dial options for the grpc client (e.g., for interceptors). DialOptions []grpc.DialOption // Context is the default client context; it can be used to cancel grpc dial out and // other operations that do not have an explicit context. Context context.Context } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/doc.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package clientv3 implements the official Go etcd client for v3. // // Create client using `clientv3.New`: // // // expect dial time-out on ipv4 blackhole // _, err := clientv3.New(clientv3.Config{ // Endpoints: []string{"http://254.0.0.1:12345"}, // DialTimeout: 2 * time.Second // }) // // // etcd clientv3 >= v3.2.10, grpc/grpc-go >= v1.7.3 // if err == context.DeadlineExceeded { // // handle errors // } // // // etcd clientv3 <= v3.2.9, grpc/grpc-go <= v1.2.1 // if err == grpc.ErrClientConnTimeout { // // handle errors // } // // cli, err := clientv3.New(clientv3.Config{ // Endpoints: []string{"localhost:2379", "localhost:22379", "localhost:32379"}, // DialTimeout: 5 * time.Second, // }) // if err != nil { // // handle error! // } // defer cli.Close() // // Make sure to close the client after using it. If the client is not closed, the // connection will have leaky goroutines. // // To specify a client request timeout, wrap the context with context.WithTimeout: // // ctx, cancel := context.WithTimeout(context.Background(), timeout) // resp, err := kvc.Put(ctx, "sample_key", "sample_value") // cancel() // if err != nil { // // handle error! // } // // use the response // // The Client has internal state (watchers and leases), so Clients should be reused instead of created as needed. // Clients are safe for concurrent use by multiple goroutines. // // etcd client returns 3 types of errors: // // 1. context error: canceled or deadline exceeded. // 2. gRPC status error: e.g. when clock drifts in server-side before client's context deadline exceeded. // 3. gRPC error: see https://github.com/coreos/etcd/blob/master/etcdserver/api/v3rpc/rpctypes/error.go // // Here is the example code to handle client errors: // // resp, err := kvc.Put(ctx, "", "") // if err != nil { // if err == context.Canceled { // // ctx is canceled by another routine // } else if err == context.DeadlineExceeded { // // ctx is attached with a deadline and it exceeded // } else if ev, ok := status.FromError(err); ok { // code := ev.Code() // if code == codes.DeadlineExceeded { // // server-side context might have timed-out first (due to clock skew) // // while original client-side context is not timed-out yet // } // } else if verr, ok := err.(*v3rpc.ErrEmptyKey); ok { // // process (verr.Errors) // } else { // // bad cluster endpoints, which are not etcd servers // } // } // // go func() { cli.Close() }() // _, err := kvc.Get(ctx, "a") // if err != nil { // if err == context.Canceled { // // grpc balancer calls 'Get' with an inflight client.Close // } else if err == grpc.ErrClientConnClosing { // // grpc balancer calls 'Get' after client.Close. // } // } // package clientv3 ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/health_balancer.go ================================================ // Copyright 2017 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" "errors" "net/url" "strings" "sync" "time" "google.golang.org/grpc" "google.golang.org/grpc/codes" healthpb "google.golang.org/grpc/health/grpc_health_v1" "google.golang.org/grpc/status" ) const ( minHealthRetryDuration = 3 * time.Second unknownService = "unknown service grpc.health.v1.Health" ) // ErrNoAddrAvilable is returned by Get() when the balancer does not have // any active connection to endpoints at the time. // This error is returned only when opts.BlockingWait is true. var ErrNoAddrAvilable = status.Error(codes.Unavailable, "there is no address available") type healthCheckFunc func(ep string) (bool, error) type notifyMsg int const ( notifyReset notifyMsg = iota notifyNext ) // healthBalancer does the bare minimum to expose multiple eps // to the grpc reconnection code path type healthBalancer struct { // addrs are the client's endpoint addresses for grpc addrs []grpc.Address // eps holds the raw endpoints from the client eps []string // notifyCh notifies grpc of the set of addresses for connecting notifyCh chan []grpc.Address // readyc closes once the first connection is up readyc chan struct{} readyOnce sync.Once // healthCheck checks an endpoint's health. healthCheck healthCheckFunc healthCheckTimeout time.Duration unhealthyMu sync.RWMutex unhealthyHostPorts map[string]time.Time // mu protects all fields below. mu sync.RWMutex // upc closes when pinAddr transitions from empty to non-empty or the balancer closes. upc chan struct{} // downc closes when grpc calls down() on pinAddr downc chan struct{} // stopc is closed to signal updateNotifyLoop should stop. stopc chan struct{} stopOnce sync.Once wg sync.WaitGroup // donec closes when all goroutines are exited donec chan struct{} // updateAddrsC notifies updateNotifyLoop to update addrs. updateAddrsC chan notifyMsg // grpc issues TLS cert checks using the string passed into dial so // that string must be the host. To recover the full scheme://host URL, // have a map from hosts to the original endpoint. hostPort2ep map[string]string // pinAddr is the currently pinned address; set to the empty string on // initialization and shutdown. pinAddr string closed bool } func newHealthBalancer(eps []string, timeout time.Duration, hc healthCheckFunc) *healthBalancer { notifyCh := make(chan []grpc.Address) addrs := eps2addrs(eps) hb := &healthBalancer{ addrs: addrs, eps: eps, notifyCh: notifyCh, readyc: make(chan struct{}), healthCheck: hc, unhealthyHostPorts: make(map[string]time.Time), upc: make(chan struct{}), stopc: make(chan struct{}), downc: make(chan struct{}), donec: make(chan struct{}), updateAddrsC: make(chan notifyMsg), hostPort2ep: getHostPort2ep(eps), } if timeout < minHealthRetryDuration { timeout = minHealthRetryDuration } hb.healthCheckTimeout = timeout close(hb.downc) go hb.updateNotifyLoop() hb.wg.Add(1) go func() { defer hb.wg.Done() hb.updateUnhealthy() }() return hb } func (b *healthBalancer) Start(target string, config grpc.BalancerConfig) error { return nil } func (b *healthBalancer) ConnectNotify() <-chan struct{} { b.mu.Lock() defer b.mu.Unlock() return b.upc } func (b *healthBalancer) ready() <-chan struct{} { return b.readyc } func (b *healthBalancer) endpoint(hostPort string) string { b.mu.RLock() defer b.mu.RUnlock() return b.hostPort2ep[hostPort] } func (b *healthBalancer) pinned() string { b.mu.RLock() defer b.mu.RUnlock() return b.pinAddr } func (b *healthBalancer) hostPortError(hostPort string, err error) { if b.endpoint(hostPort) == "" { logger.Lvl(4).Infof("clientv3/balancer: %q is stale (skip marking as unhealthy on %q)", hostPort, err.Error()) return } b.unhealthyMu.Lock() b.unhealthyHostPorts[hostPort] = time.Now() b.unhealthyMu.Unlock() logger.Lvl(4).Infof("clientv3/balancer: %q is marked unhealthy (%q)", hostPort, err.Error()) } func (b *healthBalancer) removeUnhealthy(hostPort, msg string) { if b.endpoint(hostPort) == "" { logger.Lvl(4).Infof("clientv3/balancer: %q was not in unhealthy (%q)", hostPort, msg) return } b.unhealthyMu.Lock() delete(b.unhealthyHostPorts, hostPort) b.unhealthyMu.Unlock() logger.Lvl(4).Infof("clientv3/balancer: %q is removed from unhealthy (%q)", hostPort, msg) } func (b *healthBalancer) countUnhealthy() (count int) { b.unhealthyMu.RLock() count = len(b.unhealthyHostPorts) b.unhealthyMu.RUnlock() return count } func (b *healthBalancer) isUnhealthy(hostPort string) (unhealthy bool) { b.unhealthyMu.RLock() _, unhealthy = b.unhealthyHostPorts[hostPort] b.unhealthyMu.RUnlock() return unhealthy } func (b *healthBalancer) cleanupUnhealthy() { b.unhealthyMu.Lock() for k, v := range b.unhealthyHostPorts { if time.Since(v) > b.healthCheckTimeout { delete(b.unhealthyHostPorts, k) logger.Lvl(4).Infof("clientv3/balancer: removed %q from unhealthy after %v", k, b.healthCheckTimeout) } } b.unhealthyMu.Unlock() } func (b *healthBalancer) liveAddrs() ([]grpc.Address, map[string]struct{}) { unhealthyCnt := b.countUnhealthy() b.mu.RLock() defer b.mu.RUnlock() hbAddrs := b.addrs if len(b.addrs) == 1 || unhealthyCnt == 0 || unhealthyCnt == len(b.addrs) { liveHostPorts := make(map[string]struct{}, len(b.hostPort2ep)) for k := range b.hostPort2ep { liveHostPorts[k] = struct{}{} } return hbAddrs, liveHostPorts } addrs := make([]grpc.Address, 0, len(b.addrs)-unhealthyCnt) liveHostPorts := make(map[string]struct{}, len(addrs)) for _, addr := range b.addrs { if !b.isUnhealthy(addr.Addr) { addrs = append(addrs, addr) liveHostPorts[addr.Addr] = struct{}{} } } return addrs, liveHostPorts } func (b *healthBalancer) updateUnhealthy() { for { select { case <-time.After(b.healthCheckTimeout): b.cleanupUnhealthy() pinned := b.pinned() if pinned == "" || b.isUnhealthy(pinned) { select { case b.updateAddrsC <- notifyNext: case <-b.stopc: return } } case <-b.stopc: return } } } func (b *healthBalancer) updateAddrs(eps ...string) { np := getHostPort2ep(eps) b.mu.Lock() defer b.mu.Unlock() match := len(np) == len(b.hostPort2ep) if match { for k, v := range np { if b.hostPort2ep[k] != v { match = false break } } } if match { // same endpoints, so no need to update address return } b.hostPort2ep = np b.addrs, b.eps = eps2addrs(eps), eps b.unhealthyMu.Lock() b.unhealthyHostPorts = make(map[string]time.Time) b.unhealthyMu.Unlock() } func (b *healthBalancer) next() { b.mu.RLock() downc := b.downc b.mu.RUnlock() select { case b.updateAddrsC <- notifyNext: case <-b.stopc: } // wait until disconnect so new RPCs are not issued on old connection select { case <-downc: case <-b.stopc: } } func (b *healthBalancer) updateNotifyLoop() { defer close(b.donec) for { b.mu.RLock() upc, downc, addr := b.upc, b.downc, b.pinAddr b.mu.RUnlock() // downc or upc should be closed select { case <-downc: downc = nil default: } select { case <-upc: upc = nil default: } switch { case downc == nil && upc == nil: // stale select { case <-b.stopc: return default: } case downc == nil: b.notifyAddrs(notifyReset) select { case <-upc: case msg := <-b.updateAddrsC: b.notifyAddrs(msg) case <-b.stopc: return } case upc == nil: select { // close connections that are not the pinned address case b.notifyCh <- []grpc.Address{{Addr: addr}}: case <-downc: case <-b.stopc: return } select { case <-downc: b.notifyAddrs(notifyReset) case msg := <-b.updateAddrsC: b.notifyAddrs(msg) case <-b.stopc: return } } } } func (b *healthBalancer) notifyAddrs(msg notifyMsg) { if msg == notifyNext { select { case b.notifyCh <- []grpc.Address{}: case <-b.stopc: return } } b.mu.RLock() pinAddr := b.pinAddr downc := b.downc b.mu.RUnlock() addrs, hostPorts := b.liveAddrs() var waitDown bool if pinAddr != "" { _, ok := hostPorts[pinAddr] waitDown = !ok } select { case b.notifyCh <- addrs: if waitDown { select { case <-downc: case <-b.stopc: } } case <-b.stopc: } } func (b *healthBalancer) Up(addr grpc.Address) func(error) { if !b.mayPin(addr) { return func(err error) {} } b.mu.Lock() defer b.mu.Unlock() // gRPC might call Up after it called Close. We add this check // to "fix" it up at application layer. Otherwise, will panic // if b.upc is already closed. if b.closed { return func(err error) {} } // gRPC might call Up on a stale address. // Prevent updating pinAddr with a stale address. if !hasAddr(b.addrs, addr.Addr) { return func(err error) {} } if b.pinAddr != "" { logger.Lvl(4).Infof("clientv3/balancer: %q is up but not pinned (already pinned %q)", addr.Addr, b.pinAddr) return func(err error) {} } // notify waiting Get()s and pin first connected address close(b.upc) b.downc = make(chan struct{}) b.pinAddr = addr.Addr logger.Lvl(4).Infof("clientv3/balancer: pin %q", addr.Addr) // notify client that a connection is up b.readyOnce.Do(func() { close(b.readyc) }) return func(err error) { // If connected to a black hole endpoint or a killed server, the gRPC ping // timeout will induce a network I/O error, and retrying until success; // finding healthy endpoint on retry could take several timeouts and redials. // To avoid wasting retries, gray-list unhealthy endpoints. b.hostPortError(addr.Addr, err) b.mu.Lock() b.upc = make(chan struct{}) close(b.downc) b.pinAddr = "" b.mu.Unlock() logger.Lvl(4).Infof("clientv3/balancer: unpin %q (%q)", addr.Addr, err.Error()) } } func (b *healthBalancer) mayPin(addr grpc.Address) bool { if b.endpoint(addr.Addr) == "" { // stale host:port return false } b.unhealthyMu.RLock() unhealthyCnt := len(b.unhealthyHostPorts) failedTime, bad := b.unhealthyHostPorts[addr.Addr] b.unhealthyMu.RUnlock() b.mu.RLock() skip := len(b.addrs) == 1 || unhealthyCnt == 0 || len(b.addrs) == unhealthyCnt b.mu.RUnlock() if skip || !bad { return true } // prevent isolated member's endpoint from being infinitely retried, as follows: // 1. keepalive pings detects GoAway with http2.ErrCodeEnhanceYourCalm // 2. balancer 'Up' unpins with grpc: failed with network I/O error // 3. grpc-healthcheck still SERVING, thus retry to pin // instead, return before grpc-healthcheck if failed within healthcheck timeout if elapsed := time.Since(failedTime); elapsed < b.healthCheckTimeout { logger.Lvl(4).Infof("clientv3/balancer: %q is up but not pinned (failed %v ago, require minimum %v after failure)", addr.Addr, elapsed, b.healthCheckTimeout) return false } if ok, _ := b.healthCheck(addr.Addr); ok { b.removeUnhealthy(addr.Addr, "health check success") return true } b.hostPortError(addr.Addr, errors.New("health check failed")) return false } func (b *healthBalancer) Get(ctx context.Context, opts grpc.BalancerGetOptions) (grpc.Address, func(), error) { var ( addr string closed bool ) // If opts.BlockingWait is false (for fail-fast RPCs), it should return // an address it has notified via Notify immediately instead of blocking. if !opts.BlockingWait { b.mu.RLock() closed = b.closed addr = b.pinAddr b.mu.RUnlock() if closed { return grpc.Address{Addr: ""}, nil, grpc.ErrClientConnClosing } if addr == "" { return grpc.Address{Addr: ""}, nil, ErrNoAddrAvilable } return grpc.Address{Addr: addr}, func() {}, nil } for { b.mu.RLock() ch := b.upc b.mu.RUnlock() select { case <-ch: case <-b.donec: return grpc.Address{Addr: ""}, nil, grpc.ErrClientConnClosing case <-ctx.Done(): return grpc.Address{Addr: ""}, nil, ctx.Err() } b.mu.RLock() closed = b.closed addr = b.pinAddr b.mu.RUnlock() // Close() which sets b.closed = true can be called before Get(), Get() must exit if balancer is closed. if closed { return grpc.Address{Addr: ""}, nil, grpc.ErrClientConnClosing } if addr != "" { break } } return grpc.Address{Addr: addr}, func() {}, nil } func (b *healthBalancer) Notify() <-chan []grpc.Address { return b.notifyCh } func (b *healthBalancer) Close() error { b.mu.Lock() // In case gRPC calls close twice. TODO: remove the checking // when we are sure that gRPC wont call close twice. if b.closed { b.mu.Unlock() <-b.donec return nil } b.closed = true b.stopOnce.Do(func() { close(b.stopc) }) b.pinAddr = "" // In the case of following scenario: // 1. upc is not closed; no pinned address // 2. client issues an RPC, calling invoke(), which calls Get(), enters for loop, blocks // 3. client.conn.Close() calls balancer.Close(); closed = true // 4. for loop in Get() never exits since ctx is the context passed in by the client and may not be canceled // we must close upc so Get() exits from blocking on upc select { case <-b.upc: default: // terminate all waiting Get()s close(b.upc) } b.mu.Unlock() b.wg.Wait() // wait for updateNotifyLoop to finish <-b.donec close(b.notifyCh) return nil } func grpcHealthCheck(client *Client, ep string) (bool, error) { conn, err := client.dial(ep) if err != nil { return false, err } defer conn.Close() cli := healthpb.NewHealthClient(conn) ctx, cancel := context.WithTimeout(context.Background(), time.Second) resp, err := cli.Check(ctx, &healthpb.HealthCheckRequest{}) cancel() if err != nil { if s, ok := status.FromError(err); ok && s.Code() == codes.Unavailable { if s.Message() == unknownService { // etcd < v3.3.0 return true, nil } } return false, err } return resp.Status == healthpb.HealthCheckResponse_SERVING, nil } func hasAddr(addrs []grpc.Address, targetAddr string) bool { for _, addr := range addrs { if targetAddr == addr.Addr { return true } } return false } func getHost(ep string) string { url, uerr := url.Parse(ep) if uerr != nil || !strings.Contains(ep, "://") { return ep } return url.Host } func eps2addrs(eps []string) []grpc.Address { addrs := make([]grpc.Address, len(eps)) for i := range eps { addrs[i].Addr = getHost(eps[i]) } return addrs } func getHostPort2ep(eps []string) map[string]string { hm := make(map[string]string, len(eps)) for i := range eps { _, host, _ := parseEndpoint(eps[i]) hm[host] = eps[i] } return hm } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/kv.go ================================================ // Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" "google.golang.org/grpc" ) type ( CompactResponse pb.CompactionResponse PutResponse pb.PutResponse GetResponse pb.RangeResponse DeleteResponse pb.DeleteRangeResponse TxnResponse pb.TxnResponse ) type KV interface { // Put puts a key-value pair into etcd. // Note that key,value can be plain bytes array and string is // an immutable representation of that bytes array. // To get a string of bytes, do string([]byte{0x10, 0x20}). Put(ctx context.Context, key, val string, opts ...OpOption) (*PutResponse, error) // Get retrieves keys. // By default, Get will return the value for "key", if any. // When passed WithRange(end), Get will return the keys in the range [key, end). // When passed WithFromKey(), Get returns keys greater than or equal to key. // When passed WithRev(rev) with rev > 0, Get retrieves keys at the given revision; // if the required revision is compacted, the request will fail with ErrCompacted . // When passed WithLimit(limit), the number of returned keys is bounded by limit. // When passed WithSort(), the keys will be sorted. Get(ctx context.Context, key string, opts ...OpOption) (*GetResponse, error) // Delete deletes a key, or optionally using WithRange(end), [key, end). Delete(ctx context.Context, key string, opts ...OpOption) (*DeleteResponse, error) // Compact compacts etcd KV history before the given rev. Compact(ctx context.Context, rev int64, opts ...CompactOption) (*CompactResponse, error) // Do applies a single Op on KV without a transaction. // Do is useful when creating arbitrary operations to be issued at a // later time; the user can range over the operations, calling Do to // execute them. Get/Put/Delete, on the other hand, are best suited // for when the operation should be issued at the time of declaration. Do(ctx context.Context, op Op) (OpResponse, error) // Txn creates a transaction. Txn(ctx context.Context) Txn } type OpResponse struct { put *PutResponse get *GetResponse del *DeleteResponse txn *TxnResponse } func (op OpResponse) Put() *PutResponse { return op.put } func (op OpResponse) Get() *GetResponse { return op.get } func (op OpResponse) Del() *DeleteResponse { return op.del } func (op OpResponse) Txn() *TxnResponse { return op.txn } func (resp *PutResponse) OpResponse() OpResponse { return OpResponse{put: resp} } func (resp *GetResponse) OpResponse() OpResponse { return OpResponse{get: resp} } func (resp *DeleteResponse) OpResponse() OpResponse { return OpResponse{del: resp} } func (resp *TxnResponse) OpResponse() OpResponse { return OpResponse{txn: resp} } type kv struct { remote pb.KVClient callOpts []grpc.CallOption } func NewKV(c *Client) KV { api := &kv{remote: RetryKVClient(c)} if c != nil { api.callOpts = c.callOpts } return api } func NewKVFromKVClient(remote pb.KVClient, c *Client) KV { api := &kv{remote: remote} if c != nil { api.callOpts = c.callOpts } return api } func (kv *kv) Put(ctx context.Context, key, val string, opts ...OpOption) (*PutResponse, error) { r, err := kv.Do(ctx, OpPut(key, val, opts...)) return r.put, toErr(ctx, err) } func (kv *kv) Get(ctx context.Context, key string, opts ...OpOption) (*GetResponse, error) { r, err := kv.Do(ctx, OpGet(key, opts...)) return r.get, toErr(ctx, err) } func (kv *kv) Delete(ctx context.Context, key string, opts ...OpOption) (*DeleteResponse, error) { r, err := kv.Do(ctx, OpDelete(key, opts...)) return r.del, toErr(ctx, err) } func (kv *kv) Compact(ctx context.Context, rev int64, opts ...CompactOption) (*CompactResponse, error) { resp, err := kv.remote.Compact(ctx, OpCompact(rev, opts...).toRequest(), kv.callOpts...) if err != nil { return nil, toErr(ctx, err) } return (*CompactResponse)(resp), err } func (kv *kv) Txn(ctx context.Context) Txn { return &txn{ kv: kv, ctx: ctx, callOpts: kv.callOpts, } } func (kv *kv) Do(ctx context.Context, op Op) (OpResponse, error) { var err error switch op.t { case tRange: var resp *pb.RangeResponse resp, err = kv.remote.Range(ctx, op.toRangeRequest(), kv.callOpts...) if err == nil { return OpResponse{get: (*GetResponse)(resp)}, nil } case tPut: var resp *pb.PutResponse r := &pb.PutRequest{Key: op.key, Value: op.val, Lease: int64(op.leaseID), PrevKv: op.prevKV, IgnoreValue: op.ignoreValue, IgnoreLease: op.ignoreLease} resp, err = kv.remote.Put(ctx, r, kv.callOpts...) if err == nil { return OpResponse{put: (*PutResponse)(resp)}, nil } case tDeleteRange: var resp *pb.DeleteRangeResponse r := &pb.DeleteRangeRequest{Key: op.key, RangeEnd: op.end, PrevKv: op.prevKV} resp, err = kv.remote.DeleteRange(ctx, r, kv.callOpts...) if err == nil { return OpResponse{del: (*DeleteResponse)(resp)}, nil } case tTxn: var resp *pb.TxnResponse resp, err = kv.remote.Txn(ctx, op.toTxnRequest(), kv.callOpts...) if err == nil { return OpResponse{txn: (*TxnResponse)(resp)}, nil } default: panic("Unknown op") } return OpResponse{}, toErr(ctx, err) } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/lease.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" "sync" "time" "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) type ( LeaseRevokeResponse pb.LeaseRevokeResponse LeaseID int64 ) // LeaseGrantResponse wraps the protobuf message LeaseGrantResponse. type LeaseGrantResponse struct { *pb.ResponseHeader ID LeaseID TTL int64 Error string } // LeaseKeepAliveResponse wraps the protobuf message LeaseKeepAliveResponse. type LeaseKeepAliveResponse struct { *pb.ResponseHeader ID LeaseID TTL int64 } // LeaseTimeToLiveResponse wraps the protobuf message LeaseTimeToLiveResponse. type LeaseTimeToLiveResponse struct { *pb.ResponseHeader ID LeaseID `json:"id"` // TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds. Expired lease will return -1. TTL int64 `json:"ttl"` // GrantedTTL is the initial granted time in seconds upon lease creation/renewal. GrantedTTL int64 `json:"granted-ttl"` // Keys is the list of keys attached to this lease. Keys [][]byte `json:"keys"` } // LeaseStatus represents a lease status. type LeaseStatus struct { ID LeaseID `json:"id"` // TODO: TTL int64 } // LeaseLeasesResponse wraps the protobuf message LeaseLeasesResponse. type LeaseLeasesResponse struct { *pb.ResponseHeader Leases []LeaseStatus `json:"leases"` } const ( // defaultTTL is the assumed lease TTL used for the first keepalive // deadline before the actual TTL is known to the client. defaultTTL = 5 * time.Second // NoLease is a lease ID for the absence of a lease. NoLease LeaseID = 0 // retryConnWait is how long to wait before retrying request due to an error retryConnWait = 500 * time.Millisecond ) // LeaseResponseChSize is the size of buffer to store unsent lease responses. // WARNING: DO NOT UPDATE. // Only for testing purposes. var LeaseResponseChSize = 16 // ErrKeepAliveHalted is returned if client keep alive loop halts with an unexpected error. // // This usually means that automatic lease renewal via KeepAlive is broken, but KeepAliveOnce will still work as expected. type ErrKeepAliveHalted struct { Reason error } func (e ErrKeepAliveHalted) Error() string { s := "etcdclient: leases keep alive halted" if e.Reason != nil { s += ": " + e.Reason.Error() } return s } type Lease interface { // Grant creates a new lease. Grant(ctx context.Context, ttl int64) (*LeaseGrantResponse, error) // Revoke revokes the given lease. Revoke(ctx context.Context, id LeaseID) (*LeaseRevokeResponse, error) // TimeToLive retrieves the lease information of the given lease ID. TimeToLive(ctx context.Context, id LeaseID, opts ...LeaseOption) (*LeaseTimeToLiveResponse, error) // Leases retrieves all leases. Leases(ctx context.Context) (*LeaseLeasesResponse, error) // KeepAlive keeps the given lease alive forever. If the keepalive response // posted to the channel is not consumed immediately, the lease client will // continue sending keep alive requests to the etcd server at least every // second until latest response is consumed. // // The returned "LeaseKeepAliveResponse" channel closes if underlying keep // alive stream is interrupted in some way the client cannot handle itself; // given context "ctx" is canceled or timed out. "LeaseKeepAliveResponse" // from this closed channel is nil. // // If client keep alive loop halts with an unexpected error (e.g. "etcdserver: // no leader") or canceled by the caller (e.g. context.Canceled), the error // is returned. Otherwise, it retries. // // TODO(v4.0): post errors to last keep alive message before closing // (see https://github.com/coreos/etcd/pull/7866) KeepAlive(ctx context.Context, id LeaseID) (<-chan *LeaseKeepAliveResponse, error) // KeepAliveOnce renews the lease once. The response corresponds to the // first message from calling KeepAlive. If the response has a recoverable // error, KeepAliveOnce will retry the RPC with a new keep alive message. // // In most of the cases, Keepalive should be used instead of KeepAliveOnce. KeepAliveOnce(ctx context.Context, id LeaseID) (*LeaseKeepAliveResponse, error) // Close releases all resources Lease keeps for efficient communication // with the etcd server. Close() error } type lessor struct { mu sync.Mutex // guards all fields // donec is closed and loopErr is set when recvKeepAliveLoop stops donec chan struct{} loopErr error remote pb.LeaseClient stream pb.Lease_LeaseKeepAliveClient streamCancel context.CancelFunc stopCtx context.Context stopCancel context.CancelFunc keepAlives map[LeaseID]*keepAlive // firstKeepAliveTimeout is the timeout for the first keepalive request // before the actual TTL is known to the lease client firstKeepAliveTimeout time.Duration // firstKeepAliveOnce ensures stream starts after first KeepAlive call. firstKeepAliveOnce sync.Once callOpts []grpc.CallOption } // keepAlive multiplexes a keepalive for a lease over multiple channels type keepAlive struct { chs []chan<- *LeaseKeepAliveResponse ctxs []context.Context // deadline is the time the keep alive channels close if no response deadline time.Time // nextKeepAlive is when to send the next keep alive message nextKeepAlive time.Time // donec is closed on lease revoke, expiration, or cancel. donec chan struct{} } func NewLease(c *Client) Lease { return NewLeaseFromLeaseClient(RetryLeaseClient(c), c, c.cfg.DialTimeout+time.Second) } func NewLeaseFromLeaseClient(remote pb.LeaseClient, c *Client, keepAliveTimeout time.Duration) Lease { l := &lessor{ donec: make(chan struct{}), keepAlives: make(map[LeaseID]*keepAlive), remote: remote, firstKeepAliveTimeout: keepAliveTimeout, } if l.firstKeepAliveTimeout == time.Second { l.firstKeepAliveTimeout = defaultTTL } if c != nil { l.callOpts = c.callOpts } reqLeaderCtx := WithRequireLeader(context.Background()) l.stopCtx, l.stopCancel = context.WithCancel(reqLeaderCtx) return l } func (l *lessor) Grant(ctx context.Context, ttl int64) (*LeaseGrantResponse, error) { r := &pb.LeaseGrantRequest{TTL: ttl} resp, err := l.remote.LeaseGrant(ctx, r, l.callOpts...) if err == nil { gresp := &LeaseGrantResponse{ ResponseHeader: resp.GetHeader(), ID: LeaseID(resp.ID), TTL: resp.TTL, Error: resp.Error, } return gresp, nil } return nil, toErr(ctx, err) } func (l *lessor) Revoke(ctx context.Context, id LeaseID) (*LeaseRevokeResponse, error) { r := &pb.LeaseRevokeRequest{ID: int64(id)} resp, err := l.remote.LeaseRevoke(ctx, r, l.callOpts...) if err == nil { return (*LeaseRevokeResponse)(resp), nil } return nil, toErr(ctx, err) } func (l *lessor) TimeToLive(ctx context.Context, id LeaseID, opts ...LeaseOption) (*LeaseTimeToLiveResponse, error) { r := toLeaseTimeToLiveRequest(id, opts...) resp, err := l.remote.LeaseTimeToLive(ctx, r, l.callOpts...) if err == nil { gresp := &LeaseTimeToLiveResponse{ ResponseHeader: resp.GetHeader(), ID: LeaseID(resp.ID), TTL: resp.TTL, GrantedTTL: resp.GrantedTTL, Keys: resp.Keys, } return gresp, nil } return nil, toErr(ctx, err) } func (l *lessor) Leases(ctx context.Context) (*LeaseLeasesResponse, error) { resp, err := l.remote.LeaseLeases(ctx, &pb.LeaseLeasesRequest{}, l.callOpts...) if err == nil { leases := make([]LeaseStatus, len(resp.Leases)) for i := range resp.Leases { leases[i] = LeaseStatus{ID: LeaseID(resp.Leases[i].ID)} } return &LeaseLeasesResponse{ResponseHeader: resp.GetHeader(), Leases: leases}, nil } return nil, toErr(ctx, err) } func (l *lessor) KeepAlive(ctx context.Context, id LeaseID) (<-chan *LeaseKeepAliveResponse, error) { ch := make(chan *LeaseKeepAliveResponse, LeaseResponseChSize) l.mu.Lock() // ensure that recvKeepAliveLoop is still running select { case <-l.donec: err := l.loopErr l.mu.Unlock() close(ch) return ch, ErrKeepAliveHalted{Reason: err} default: } ka, ok := l.keepAlives[id] if !ok { // create fresh keep alive ka = &keepAlive{ chs: []chan<- *LeaseKeepAliveResponse{ch}, ctxs: []context.Context{ctx}, deadline: time.Now().Add(l.firstKeepAliveTimeout), nextKeepAlive: time.Now(), donec: make(chan struct{}), } l.keepAlives[id] = ka } else { // add channel and context to existing keep alive ka.ctxs = append(ka.ctxs, ctx) ka.chs = append(ka.chs, ch) } l.mu.Unlock() go l.keepAliveCtxCloser(id, ctx, ka.donec) l.firstKeepAliveOnce.Do(func() { go l.recvKeepAliveLoop() go l.deadlineLoop() }) return ch, nil } func (l *lessor) KeepAliveOnce(ctx context.Context, id LeaseID) (*LeaseKeepAliveResponse, error) { for { resp, err := l.keepAliveOnce(ctx, id) if err == nil { if resp.TTL <= 0 { err = rpctypes.ErrLeaseNotFound } return resp, err } if isHaltErr(ctx, err) { return nil, toErr(ctx, err) } } } func (l *lessor) Close() error { l.stopCancel() // close for synchronous teardown if stream goroutines never launched l.firstKeepAliveOnce.Do(func() { close(l.donec) }) <-l.donec return nil } func (l *lessor) keepAliveCtxCloser(id LeaseID, ctx context.Context, donec <-chan struct{}) { select { case <-donec: return case <-l.donec: return case <-ctx.Done(): } l.mu.Lock() defer l.mu.Unlock() ka, ok := l.keepAlives[id] if !ok { return } // close channel and remove context if still associated with keep alive for i, c := range ka.ctxs { if c == ctx { close(ka.chs[i]) ka.ctxs = append(ka.ctxs[:i], ka.ctxs[i+1:]...) ka.chs = append(ka.chs[:i], ka.chs[i+1:]...) break } } // remove if no one more listeners if len(ka.chs) == 0 { delete(l.keepAlives, id) } } // closeRequireLeader scans keepAlives for ctxs that have require leader // and closes the associated channels. func (l *lessor) closeRequireLeader() { l.mu.Lock() defer l.mu.Unlock() for _, ka := range l.keepAlives { reqIdxs := 0 // find all required leader channels, close, mark as nil for i, ctx := range ka.ctxs { md, ok := metadata.FromOutgoingContext(ctx) if !ok { continue } ks := md[rpctypes.MetadataRequireLeaderKey] if len(ks) < 1 || ks[0] != rpctypes.MetadataHasLeader { continue } close(ka.chs[i]) ka.chs[i] = nil reqIdxs++ } if reqIdxs == 0 { continue } // remove all channels that required a leader from keepalive newChs := make([]chan<- *LeaseKeepAliveResponse, len(ka.chs)-reqIdxs) newCtxs := make([]context.Context, len(newChs)) newIdx := 0 for i := range ka.chs { if ka.chs[i] == nil { continue } newChs[newIdx], newCtxs[newIdx] = ka.chs[i], ka.ctxs[newIdx] newIdx++ } ka.chs, ka.ctxs = newChs, newCtxs } } func (l *lessor) keepAliveOnce(ctx context.Context, id LeaseID) (*LeaseKeepAliveResponse, error) { cctx, cancel := context.WithCancel(ctx) defer cancel() stream, err := l.remote.LeaseKeepAlive(cctx, l.callOpts...) if err != nil { return nil, toErr(ctx, err) } err = stream.Send(&pb.LeaseKeepAliveRequest{ID: int64(id)}) if err != nil { return nil, toErr(ctx, err) } resp, rerr := stream.Recv() if rerr != nil { return nil, toErr(ctx, rerr) } karesp := &LeaseKeepAliveResponse{ ResponseHeader: resp.GetHeader(), ID: LeaseID(resp.ID), TTL: resp.TTL, } return karesp, nil } func (l *lessor) recvKeepAliveLoop() (gerr error) { defer func() { l.mu.Lock() close(l.donec) l.loopErr = gerr for _, ka := range l.keepAlives { ka.close() } l.keepAlives = make(map[LeaseID]*keepAlive) l.mu.Unlock() }() for { stream, err := l.resetRecv() if err != nil { if canceledByCaller(l.stopCtx, err) { return err } } else { for { resp, err := stream.Recv() if err != nil { if canceledByCaller(l.stopCtx, err) { return err } if toErr(l.stopCtx, err) == rpctypes.ErrNoLeader { l.closeRequireLeader() } break } l.recvKeepAlive(resp) } } select { case <-time.After(retryConnWait): continue case <-l.stopCtx.Done(): return l.stopCtx.Err() } } } // resetRecv opens a new lease stream and starts sending keep alive requests. func (l *lessor) resetRecv() (pb.Lease_LeaseKeepAliveClient, error) { sctx, cancel := context.WithCancel(l.stopCtx) stream, err := l.remote.LeaseKeepAlive(sctx, l.callOpts...) if err != nil { cancel() return nil, err } l.mu.Lock() defer l.mu.Unlock() if l.stream != nil && l.streamCancel != nil { l.streamCancel() } l.streamCancel = cancel l.stream = stream go l.sendKeepAliveLoop(stream) return stream, nil } // recvKeepAlive updates a lease based on its LeaseKeepAliveResponse func (l *lessor) recvKeepAlive(resp *pb.LeaseKeepAliveResponse) { karesp := &LeaseKeepAliveResponse{ ResponseHeader: resp.GetHeader(), ID: LeaseID(resp.ID), TTL: resp.TTL, } l.mu.Lock() defer l.mu.Unlock() ka, ok := l.keepAlives[karesp.ID] if !ok { return } if karesp.TTL <= 0 { // lease expired; close all keep alive channels delete(l.keepAlives, karesp.ID) ka.close() return } // send update to all channels nextKeepAlive := time.Now().Add((time.Duration(karesp.TTL) * time.Second) / 3.0) ka.deadline = time.Now().Add(time.Duration(karesp.TTL) * time.Second) for _, ch := range ka.chs { select { case ch <- karesp: default: } // still advance in order to rate-limit keep-alive sends ka.nextKeepAlive = nextKeepAlive } } // deadlineLoop reaps any keep alive channels that have not received a response // within the lease TTL func (l *lessor) deadlineLoop() { for { select { case <-time.After(time.Second): case <-l.donec: return } now := time.Now() l.mu.Lock() for id, ka := range l.keepAlives { if ka.deadline.Before(now) { // waited too long for response; lease may be expired ka.close() delete(l.keepAlives, id) } } l.mu.Unlock() } } // sendKeepAliveLoop sends keep alive requests for the lifetime of the given stream. func (l *lessor) sendKeepAliveLoop(stream pb.Lease_LeaseKeepAliveClient) { for { var tosend []LeaseID now := time.Now() l.mu.Lock() for id, ka := range l.keepAlives { if ka.nextKeepAlive.Before(now) { tosend = append(tosend, id) } } l.mu.Unlock() for _, id := range tosend { r := &pb.LeaseKeepAliveRequest{ID: int64(id)} if err := stream.Send(r); err != nil { // TODO do something with this error? return } } select { case <-time.After(500 * time.Millisecond): case <-stream.Context().Done(): return case <-l.donec: return case <-l.stopCtx.Done(): return } } } func (ka *keepAlive) close() { close(ka.donec) for _, ch := range ka.chs { close(ch) } } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/logger.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "io/ioutil" "sync" "google.golang.org/grpc/grpclog" ) // Logger is the logger used by client library. // It implements grpclog.LoggerV2 interface. type Logger interface { grpclog.LoggerV2 // Lvl returns logger if logger's verbosity level >= "lvl". // Otherwise, logger that discards all logs. Lvl(lvl int) Logger // to satisfy capnslog Print(args ...interface{}) Printf(format string, args ...interface{}) Println(args ...interface{}) } var ( loggerMu sync.RWMutex logger Logger ) type settableLogger struct { l grpclog.LoggerV2 mu sync.RWMutex } func init() { // disable client side logs by default logger = &settableLogger{} SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard)) } // SetLogger sets client-side Logger. func SetLogger(l grpclog.LoggerV2) { loggerMu.Lock() logger = NewLogger(l) // override grpclog so that any changes happen with locking grpclog.SetLoggerV2(logger) loggerMu.Unlock() } // GetLogger returns the current logger. func GetLogger() Logger { loggerMu.RLock() l := logger loggerMu.RUnlock() return l } // NewLogger returns a new Logger with grpclog.LoggerV2. func NewLogger(gl grpclog.LoggerV2) Logger { return &settableLogger{l: gl} } func (s *settableLogger) get() grpclog.LoggerV2 { s.mu.RLock() l := s.l s.mu.RUnlock() return l } // implement the grpclog.LoggerV2 interface func (s *settableLogger) Info(args ...interface{}) { s.get().Info(args...) } func (s *settableLogger) Infof(format string, args ...interface{}) { s.get().Infof(format, args...) } func (s *settableLogger) Infoln(args ...interface{}) { s.get().Infoln(args...) } func (s *settableLogger) Warning(args ...interface{}) { s.get().Warning(args...) } func (s *settableLogger) Warningf(format string, args ...interface{}) { s.get().Warningf(format, args...) } func (s *settableLogger) Warningln(args ...interface{}) { s.get().Warningln(args...) } func (s *settableLogger) Error(args ...interface{}) { s.get().Error(args...) } func (s *settableLogger) Errorf(format string, args ...interface{}) { s.get().Errorf(format, args...) } func (s *settableLogger) Errorln(args ...interface{}) { s.get().Errorln(args...) } func (s *settableLogger) Fatal(args ...interface{}) { s.get().Fatal(args...) } func (s *settableLogger) Fatalf(format string, args ...interface{}) { s.get().Fatalf(format, args...) } func (s *settableLogger) Fatalln(args ...interface{}) { s.get().Fatalln(args...) } func (s *settableLogger) Print(args ...interface{}) { s.get().Info(args...) } func (s *settableLogger) Printf(format string, args ...interface{}) { s.get().Infof(format, args...) } func (s *settableLogger) Println(args ...interface{}) { s.get().Infoln(args...) } func (s *settableLogger) V(l int) bool { return s.get().V(l) } func (s *settableLogger) Lvl(lvl int) Logger { s.mu.RLock() l := s.l s.mu.RUnlock() if l.V(lvl) { return s } return &noLogger{} } type noLogger struct{} func (*noLogger) Info(args ...interface{}) {} func (*noLogger) Infof(format string, args ...interface{}) {} func (*noLogger) Infoln(args ...interface{}) {} func (*noLogger) Warning(args ...interface{}) {} func (*noLogger) Warningf(format string, args ...interface{}) {} func (*noLogger) Warningln(args ...interface{}) {} func (*noLogger) Error(args ...interface{}) {} func (*noLogger) Errorf(format string, args ...interface{}) {} func (*noLogger) Errorln(args ...interface{}) {} func (*noLogger) Fatal(args ...interface{}) {} func (*noLogger) Fatalf(format string, args ...interface{}) {} func (*noLogger) Fatalln(args ...interface{}) {} func (*noLogger) Print(args ...interface{}) {} func (*noLogger) Printf(format string, args ...interface{}) {} func (*noLogger) Println(args ...interface{}) {} func (*noLogger) V(l int) bool { return false } func (ng *noLogger) Lvl(lvl int) Logger { return ng } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/maintenance.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" "io" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" "google.golang.org/grpc" ) type ( DefragmentResponse pb.DefragmentResponse AlarmResponse pb.AlarmResponse AlarmMember pb.AlarmMember StatusResponse pb.StatusResponse HashKVResponse pb.HashKVResponse MoveLeaderResponse pb.MoveLeaderResponse ) type Maintenance interface { // AlarmList gets all active alarms. AlarmList(ctx context.Context) (*AlarmResponse, error) // AlarmDisarm disarms a given alarm. AlarmDisarm(ctx context.Context, m *AlarmMember) (*AlarmResponse, error) // Defragment releases wasted space from internal fragmentation on a given etcd member. // Defragment is only needed when deleting a large number of keys and want to reclaim // the resources. // Defragment is an expensive operation. User should avoid defragmenting multiple members // at the same time. // To defragment multiple members in the cluster, user need to call defragment multiple // times with different endpoints. Defragment(ctx context.Context, endpoint string) (*DefragmentResponse, error) // Status gets the status of the endpoint. Status(ctx context.Context, endpoint string) (*StatusResponse, error) // HashKV returns a hash of the KV state at the time of the RPC. // If revision is zero, the hash is computed on all keys. If the revision // is non-zero, the hash is computed on all keys at or below the given revision. HashKV(ctx context.Context, endpoint string, rev int64) (*HashKVResponse, error) // Snapshot provides a reader for a point-in-time snapshot of etcd. Snapshot(ctx context.Context) (io.ReadCloser, error) // MoveLeader requests current leader to transfer its leadership to the transferee. // Request must be made to the leader. MoveLeader(ctx context.Context, transfereeID uint64) (*MoveLeaderResponse, error) } type maintenance struct { dial func(endpoint string) (pb.MaintenanceClient, func(), error) remote pb.MaintenanceClient callOpts []grpc.CallOption } func NewMaintenance(c *Client) Maintenance { api := &maintenance{ dial: func(endpoint string) (pb.MaintenanceClient, func(), error) { conn, err := c.dial(endpoint) if err != nil { return nil, nil, err } cancel := func() { conn.Close() } return RetryMaintenanceClient(c, conn), cancel, nil }, remote: RetryMaintenanceClient(c, c.conn), } if c != nil { api.callOpts = c.callOpts } return api } func NewMaintenanceFromMaintenanceClient(remote pb.MaintenanceClient, c *Client) Maintenance { api := &maintenance{ dial: func(string) (pb.MaintenanceClient, func(), error) { return remote, func() {}, nil }, remote: remote, } if c != nil { api.callOpts = c.callOpts } return api } func (m *maintenance) AlarmList(ctx context.Context) (*AlarmResponse, error) { req := &pb.AlarmRequest{ Action: pb.AlarmRequest_GET, MemberID: 0, // all Alarm: pb.AlarmType_NONE, // all } resp, err := m.remote.Alarm(ctx, req, m.callOpts...) if err == nil { return (*AlarmResponse)(resp), nil } return nil, toErr(ctx, err) } func (m *maintenance) AlarmDisarm(ctx context.Context, am *AlarmMember) (*AlarmResponse, error) { req := &pb.AlarmRequest{ Action: pb.AlarmRequest_DEACTIVATE, MemberID: am.MemberID, Alarm: am.Alarm, } if req.MemberID == 0 && req.Alarm == pb.AlarmType_NONE { ar, err := m.AlarmList(ctx) if err != nil { return nil, toErr(ctx, err) } ret := AlarmResponse{} for _, am := range ar.Alarms { dresp, derr := m.AlarmDisarm(ctx, (*AlarmMember)(am)) if derr != nil { return nil, toErr(ctx, derr) } ret.Alarms = append(ret.Alarms, dresp.Alarms...) } return &ret, nil } resp, err := m.remote.Alarm(ctx, req, m.callOpts...) if err == nil { return (*AlarmResponse)(resp), nil } return nil, toErr(ctx, err) } func (m *maintenance) Defragment(ctx context.Context, endpoint string) (*DefragmentResponse, error) { remote, cancel, err := m.dial(endpoint) if err != nil { return nil, toErr(ctx, err) } defer cancel() resp, err := remote.Defragment(ctx, &pb.DefragmentRequest{}, m.callOpts...) if err != nil { return nil, toErr(ctx, err) } return (*DefragmentResponse)(resp), nil } func (m *maintenance) Status(ctx context.Context, endpoint string) (*StatusResponse, error) { remote, cancel, err := m.dial(endpoint) if err != nil { return nil, toErr(ctx, err) } defer cancel() resp, err := remote.Status(ctx, &pb.StatusRequest{}, m.callOpts...) if err != nil { return nil, toErr(ctx, err) } return (*StatusResponse)(resp), nil } func (m *maintenance) HashKV(ctx context.Context, endpoint string, rev int64) (*HashKVResponse, error) { remote, cancel, err := m.dial(endpoint) if err != nil { return nil, toErr(ctx, err) } defer cancel() resp, err := remote.HashKV(ctx, &pb.HashKVRequest{Revision: rev}, m.callOpts...) if err != nil { return nil, toErr(ctx, err) } return (*HashKVResponse)(resp), nil } func (m *maintenance) Snapshot(ctx context.Context) (io.ReadCloser, error) { ss, err := m.remote.Snapshot(ctx, &pb.SnapshotRequest{}, m.callOpts...) if err != nil { return nil, toErr(ctx, err) } pr, pw := io.Pipe() go func() { for { resp, err := ss.Recv() if err != nil { pw.CloseWithError(err) return } if resp == nil && err == nil { break } if _, werr := pw.Write(resp.Blob); werr != nil { pw.CloseWithError(werr) return } } pw.Close() }() return &snapshotReadCloser{ctx: ctx, ReadCloser: pr}, nil } type snapshotReadCloser struct { ctx context.Context io.ReadCloser } func (rc *snapshotReadCloser) Read(p []byte) (n int, err error) { n, err = rc.ReadCloser.Read(p) return n, toErr(rc.ctx, err) } func (m *maintenance) MoveLeader(ctx context.Context, transfereeID uint64) (*MoveLeaderResponse, error) { resp, err := m.remote.MoveLeader(ctx, &pb.MoveLeaderRequest{TargetID: transfereeID}, m.callOpts...) return (*MoveLeaderResponse)(resp), toErr(ctx, err) } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/op.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import pb "github.com/coreos/etcd/etcdserver/etcdserverpb" type opType int const ( // A default Op has opType 0, which is invalid. tRange opType = iota + 1 tPut tDeleteRange tTxn ) var ( noPrefixEnd = []byte{0} ) // Op represents an Operation that kv can execute. type Op struct { t opType key []byte end []byte // for range limit int64 sort *SortOption serializable bool keysOnly bool countOnly bool minModRev int64 maxModRev int64 minCreateRev int64 maxCreateRev int64 // for range, watch rev int64 // for watch, put, delete prevKV bool // for put ignoreValue bool ignoreLease bool // progressNotify is for progress updates. progressNotify bool // createdNotify is for created event createdNotify bool // filters for watchers filterPut bool filterDelete bool // for put val []byte leaseID LeaseID // txn cmps []Cmp thenOps []Op elseOps []Op } // accessors / mutators func (op Op) IsTxn() bool { return op.t == tTxn } func (op Op) Txn() ([]Cmp, []Op, []Op) { return op.cmps, op.thenOps, op.elseOps } // KeyBytes returns the byte slice holding the Op's key. func (op Op) KeyBytes() []byte { return op.key } // WithKeyBytes sets the byte slice for the Op's key. func (op *Op) WithKeyBytes(key []byte) { op.key = key } // RangeBytes returns the byte slice holding with the Op's range end, if any. func (op Op) RangeBytes() []byte { return op.end } // Rev returns the requested revision, if any. func (op Op) Rev() int64 { return op.rev } // IsPut returns true iff the operation is a Put. func (op Op) IsPut() bool { return op.t == tPut } // IsGet returns true iff the operation is a Get. func (op Op) IsGet() bool { return op.t == tRange } // IsDelete returns true iff the operation is a Delete. func (op Op) IsDelete() bool { return op.t == tDeleteRange } // IsSerializable returns true if the serializable field is true. func (op Op) IsSerializable() bool { return op.serializable == true } // IsKeysOnly returns whether keysOnly is set. func (op Op) IsKeysOnly() bool { return op.keysOnly == true } // IsCountOnly returns whether countOnly is set. func (op Op) IsCountOnly() bool { return op.countOnly == true } // MinModRev returns the operation's minimum modify revision. func (op Op) MinModRev() int64 { return op.minModRev } // MaxModRev returns the operation's maximum modify revision. func (op Op) MaxModRev() int64 { return op.maxModRev } // MinCreateRev returns the operation's minimum create revision. func (op Op) MinCreateRev() int64 { return op.minCreateRev } // MaxCreateRev returns the operation's maximum create revision. func (op Op) MaxCreateRev() int64 { return op.maxCreateRev } // WithRangeBytes sets the byte slice for the Op's range end. func (op *Op) WithRangeBytes(end []byte) { op.end = end } // ValueBytes returns the byte slice holding the Op's value, if any. func (op Op) ValueBytes() []byte { return op.val } // WithValueBytes sets the byte slice for the Op's value. func (op *Op) WithValueBytes(v []byte) { op.val = v } func (op Op) toRangeRequest() *pb.RangeRequest { if op.t != tRange { panic("op.t != tRange") } r := &pb.RangeRequest{ Key: op.key, RangeEnd: op.end, Limit: op.limit, Revision: op.rev, Serializable: op.serializable, KeysOnly: op.keysOnly, CountOnly: op.countOnly, MinModRevision: op.minModRev, MaxModRevision: op.maxModRev, MinCreateRevision: op.minCreateRev, MaxCreateRevision: op.maxCreateRev, } if op.sort != nil { r.SortOrder = pb.RangeRequest_SortOrder(op.sort.Order) r.SortTarget = pb.RangeRequest_SortTarget(op.sort.Target) } return r } func (op Op) toTxnRequest() *pb.TxnRequest { thenOps := make([]*pb.RequestOp, len(op.thenOps)) for i, tOp := range op.thenOps { thenOps[i] = tOp.toRequestOp() } elseOps := make([]*pb.RequestOp, len(op.elseOps)) for i, eOp := range op.elseOps { elseOps[i] = eOp.toRequestOp() } cmps := make([]*pb.Compare, len(op.cmps)) for i := range op.cmps { cmps[i] = (*pb.Compare)(&op.cmps[i]) } return &pb.TxnRequest{Compare: cmps, Success: thenOps, Failure: elseOps} } func (op Op) toRequestOp() *pb.RequestOp { switch op.t { case tRange: return &pb.RequestOp{Request: &pb.RequestOp_RequestRange{RequestRange: op.toRangeRequest()}} case tPut: r := &pb.PutRequest{Key: op.key, Value: op.val, Lease: int64(op.leaseID), PrevKv: op.prevKV, IgnoreValue: op.ignoreValue, IgnoreLease: op.ignoreLease} return &pb.RequestOp{Request: &pb.RequestOp_RequestPut{RequestPut: r}} case tDeleteRange: r := &pb.DeleteRangeRequest{Key: op.key, RangeEnd: op.end, PrevKv: op.prevKV} return &pb.RequestOp{Request: &pb.RequestOp_RequestDeleteRange{RequestDeleteRange: r}} case tTxn: return &pb.RequestOp{Request: &pb.RequestOp_RequestTxn{RequestTxn: op.toTxnRequest()}} default: panic("Unknown Op") } } func (op Op) isWrite() bool { if op.t == tTxn { for _, tOp := range op.thenOps { if tOp.isWrite() { return true } } for _, tOp := range op.elseOps { if tOp.isWrite() { return true } } return false } return op.t != tRange } func OpGet(key string, opts ...OpOption) Op { ret := Op{t: tRange, key: []byte(key)} ret.applyOpts(opts) return ret } func OpDelete(key string, opts ...OpOption) Op { ret := Op{t: tDeleteRange, key: []byte(key)} ret.applyOpts(opts) switch { case ret.leaseID != 0: panic("unexpected lease in delete") case ret.limit != 0: panic("unexpected limit in delete") case ret.rev != 0: panic("unexpected revision in delete") case ret.sort != nil: panic("unexpected sort in delete") case ret.serializable: panic("unexpected serializable in delete") case ret.countOnly: panic("unexpected countOnly in delete") case ret.minModRev != 0, ret.maxModRev != 0: panic("unexpected mod revision filter in delete") case ret.minCreateRev != 0, ret.maxCreateRev != 0: panic("unexpected create revision filter in delete") case ret.filterDelete, ret.filterPut: panic("unexpected filter in delete") case ret.createdNotify: panic("unexpected createdNotify in delete") } return ret } func OpPut(key, val string, opts ...OpOption) Op { ret := Op{t: tPut, key: []byte(key), val: []byte(val)} ret.applyOpts(opts) switch { case ret.end != nil: panic("unexpected range in put") case ret.limit != 0: panic("unexpected limit in put") case ret.rev != 0: panic("unexpected revision in put") case ret.sort != nil: panic("unexpected sort in put") case ret.serializable: panic("unexpected serializable in put") case ret.countOnly: panic("unexpected countOnly in put") case ret.minModRev != 0, ret.maxModRev != 0: panic("unexpected mod revision filter in put") case ret.minCreateRev != 0, ret.maxCreateRev != 0: panic("unexpected create revision filter in put") case ret.filterDelete, ret.filterPut: panic("unexpected filter in put") case ret.createdNotify: panic("unexpected createdNotify in put") } return ret } func OpTxn(cmps []Cmp, thenOps []Op, elseOps []Op) Op { return Op{t: tTxn, cmps: cmps, thenOps: thenOps, elseOps: elseOps} } func opWatch(key string, opts ...OpOption) Op { ret := Op{t: tRange, key: []byte(key)} ret.applyOpts(opts) switch { case ret.leaseID != 0: panic("unexpected lease in watch") case ret.limit != 0: panic("unexpected limit in watch") case ret.sort != nil: panic("unexpected sort in watch") case ret.serializable: panic("unexpected serializable in watch") case ret.countOnly: panic("unexpected countOnly in watch") case ret.minModRev != 0, ret.maxModRev != 0: panic("unexpected mod revision filter in watch") case ret.minCreateRev != 0, ret.maxCreateRev != 0: panic("unexpected create revision filter in watch") } return ret } func (op *Op) applyOpts(opts []OpOption) { for _, opt := range opts { opt(op) } } // OpOption configures Operations like Get, Put, Delete. type OpOption func(*Op) // WithLease attaches a lease ID to a key in 'Put' request. func WithLease(leaseID LeaseID) OpOption { return func(op *Op) { op.leaseID = leaseID } } // WithLimit limits the number of results to return from 'Get' request. // If WithLimit is given a 0 limit, it is treated as no limit. func WithLimit(n int64) OpOption { return func(op *Op) { op.limit = n } } // WithRev specifies the store revision for 'Get' request. // Or the start revision of 'Watch' request. func WithRev(rev int64) OpOption { return func(op *Op) { op.rev = rev } } // WithSort specifies the ordering in 'Get' request. It requires // 'WithRange' and/or 'WithPrefix' to be specified too. // 'target' specifies the target to sort by: key, version, revisions, value. // 'order' can be either 'SortNone', 'SortAscend', 'SortDescend'. func WithSort(target SortTarget, order SortOrder) OpOption { return func(op *Op) { if target == SortByKey && order == SortAscend { // If order != SortNone, server fetches the entire key-space, // and then applies the sort and limit, if provided. // Since by default the server returns results sorted by keys // in lexicographically ascending order, the client should ignore // SortOrder if the target is SortByKey. order = SortNone } op.sort = &SortOption{target, order} } } // GetPrefixRangeEnd gets the range end of the prefix. // 'Get(foo, WithPrefix())' is equal to 'Get(foo, WithRange(GetPrefixRangeEnd(foo))'. func GetPrefixRangeEnd(prefix string) string { return string(getPrefix([]byte(prefix))) } func getPrefix(key []byte) []byte { end := make([]byte, len(key)) copy(end, key) for i := len(end) - 1; i >= 0; i-- { if end[i] < 0xff { end[i] = end[i] + 1 end = end[:i+1] return end } } // next prefix does not exist (e.g., 0xffff); // default to WithFromKey policy return noPrefixEnd } // WithPrefix enables 'Get', 'Delete', or 'Watch' requests to operate // on the keys with matching prefix. For example, 'Get(foo, WithPrefix())' // can return 'foo1', 'foo2', and so on. func WithPrefix() OpOption { return func(op *Op) { if len(op.key) == 0 { op.key, op.end = []byte{0}, []byte{0} return } op.end = getPrefix(op.key) } } // WithRange specifies the range of 'Get', 'Delete', 'Watch' requests. // For example, 'Get' requests with 'WithRange(end)' returns // the keys in the range [key, end). // endKey must be lexicographically greater than start key. func WithRange(endKey string) OpOption { return func(op *Op) { op.end = []byte(endKey) } } // WithFromKey specifies the range of 'Get', 'Delete', 'Watch' requests // to be equal or greater than the key in the argument. func WithFromKey() OpOption { return WithRange("\x00") } // WithSerializable makes 'Get' request serializable. By default, // it's linearizable. Serializable requests are better for lower latency // requirement. func WithSerializable() OpOption { return func(op *Op) { op.serializable = true } } // WithKeysOnly makes the 'Get' request return only the keys and the corresponding // values will be omitted. func WithKeysOnly() OpOption { return func(op *Op) { op.keysOnly = true } } // WithCountOnly makes the 'Get' request return only the count of keys. func WithCountOnly() OpOption { return func(op *Op) { op.countOnly = true } } // WithMinModRev filters out keys for Get with modification revisions less than the given revision. func WithMinModRev(rev int64) OpOption { return func(op *Op) { op.minModRev = rev } } // WithMaxModRev filters out keys for Get with modification revisions greater than the given revision. func WithMaxModRev(rev int64) OpOption { return func(op *Op) { op.maxModRev = rev } } // WithMinCreateRev filters out keys for Get with creation revisions less than the given revision. func WithMinCreateRev(rev int64) OpOption { return func(op *Op) { op.minCreateRev = rev } } // WithMaxCreateRev filters out keys for Get with creation revisions greater than the given revision. func WithMaxCreateRev(rev int64) OpOption { return func(op *Op) { op.maxCreateRev = rev } } // WithFirstCreate gets the key with the oldest creation revision in the request range. func WithFirstCreate() []OpOption { return withTop(SortByCreateRevision, SortAscend) } // WithLastCreate gets the key with the latest creation revision in the request range. func WithLastCreate() []OpOption { return withTop(SortByCreateRevision, SortDescend) } // WithFirstKey gets the lexically first key in the request range. func WithFirstKey() []OpOption { return withTop(SortByKey, SortAscend) } // WithLastKey gets the lexically last key in the request range. func WithLastKey() []OpOption { return withTop(SortByKey, SortDescend) } // WithFirstRev gets the key with the oldest modification revision in the request range. func WithFirstRev() []OpOption { return withTop(SortByModRevision, SortAscend) } // WithLastRev gets the key with the latest modification revision in the request range. func WithLastRev() []OpOption { return withTop(SortByModRevision, SortDescend) } // withTop gets the first key over the get's prefix given a sort order func withTop(target SortTarget, order SortOrder) []OpOption { return []OpOption{WithPrefix(), WithSort(target, order), WithLimit(1)} } // WithProgressNotify makes watch server send periodic progress updates // every 10 minutes when there is no incoming events. // Progress updates have zero events in WatchResponse. func WithProgressNotify() OpOption { return func(op *Op) { op.progressNotify = true } } // WithCreatedNotify makes watch server sends the created event. func WithCreatedNotify() OpOption { return func(op *Op) { op.createdNotify = true } } // WithFilterPut discards PUT events from the watcher. func WithFilterPut() OpOption { return func(op *Op) { op.filterPut = true } } // WithFilterDelete discards DELETE events from the watcher. func WithFilterDelete() OpOption { return func(op *Op) { op.filterDelete = true } } // WithPrevKV gets the previous key-value pair before the event happens. If the previous KV is already compacted, // nothing will be returned. func WithPrevKV() OpOption { return func(op *Op) { op.prevKV = true } } // WithIgnoreValue updates the key using its current value. // This option can not be combined with non-empty values. // Returns an error if the key does not exist. func WithIgnoreValue() OpOption { return func(op *Op) { op.ignoreValue = true } } // WithIgnoreLease updates the key using its current lease. // This option can not be combined with WithLease. // Returns an error if the key does not exist. func WithIgnoreLease() OpOption { return func(op *Op) { op.ignoreLease = true } } // LeaseOp represents an Operation that lease can execute. type LeaseOp struct { id LeaseID // for TimeToLive attachedKeys bool } // LeaseOption configures lease operations. type LeaseOption func(*LeaseOp) func (op *LeaseOp) applyOpts(opts []LeaseOption) { for _, opt := range opts { opt(op) } } // WithAttachedKeys makes TimeToLive list the keys attached to the given lease ID. func WithAttachedKeys() LeaseOption { return func(op *LeaseOp) { op.attachedKeys = true } } func toLeaseTimeToLiveRequest(id LeaseID, opts ...LeaseOption) *pb.LeaseTimeToLiveRequest { ret := &LeaseOp{id: id} ret.applyOpts(opts) return &pb.LeaseTimeToLiveRequest{ID: int64(id), Keys: ret.attachedKeys} } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/options.go ================================================ // Copyright 2017 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "math" "google.golang.org/grpc" ) var ( // Disable gRPC internal retrial logic // TODO: enable when gRPC retry is stable (FailFast=false) // Reference: // - https://github.com/grpc/grpc-go/issues/1532 // - https://github.com/grpc/proposal/blob/master/A6-client-retries.md defaultFailFast = grpc.FailFast(true) // client-side request send limit, gRPC default is math.MaxInt32 // Make sure that "client-side send limit < server-side default send/recv limit" // Same value as "embed.DefaultMaxRequestBytes" plus gRPC overhead bytes defaultMaxCallSendMsgSize = grpc.MaxCallSendMsgSize(2 * 1024 * 1024) // client-side response receive limit, gRPC default is 4MB // Make sure that "client-side receive limit >= server-side default send/recv limit" // because range response can easily exceed request send limits // Default to math.MaxInt32; writes exceeding server-side send limit fails anyway defaultMaxCallRecvMsgSize = grpc.MaxCallRecvMsgSize(math.MaxInt32) ) // defaultCallOpts defines a list of default "gRPC.CallOption". // Some options are exposed to "clientv3.Config". // Defaults will be overridden by the settings in "clientv3.Config". var defaultCallOpts = []grpc.CallOption{defaultFailFast, defaultMaxCallSendMsgSize, defaultMaxCallRecvMsgSize} // MaxLeaseTTL is the maximum lease TTL value const MaxLeaseTTL = 9000000000 ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/ready_wait.go ================================================ // Copyright 2017 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import "context" // TODO: remove this when "FailFast=false" is fixed. // See https://github.com/grpc/grpc-go/issues/1532. func readyWait(rpcCtx, clientCtx context.Context, ready <-chan struct{}) error { select { case <-ready: return nil case <-rpcCtx.Done(): return rpcCtx.Err() case <-clientCtx.Done(): return clientCtx.Err() } } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/retry.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) type retryPolicy uint8 const ( repeatable retryPolicy = iota nonRepeatable ) type rpcFunc func(ctx context.Context) error type retryRPCFunc func(context.Context, rpcFunc, retryPolicy) error type retryStopErrFunc func(error) bool // immutable requests (e.g. Get) should be retried unless it's // an obvious server-side error (e.g. rpctypes.ErrRequestTooLarge). // // "isRepeatableStopError" returns "true" when an immutable request // is interrupted by server-side or gRPC-side error and its status // code is not transient (!= codes.Unavailable). // // Returning "true" means retry should stop, since client cannot // handle itself even with retries. func isRepeatableStopError(err error) bool { eErr := rpctypes.Error(err) // always stop retry on etcd errors if serverErr, ok := eErr.(rpctypes.EtcdError); ok && serverErr.Code() != codes.Unavailable { return true } // only retry if unavailable ev, _ := status.FromError(err) return ev.Code() != codes.Unavailable } // mutable requests (e.g. Put, Delete, Txn) should only be retried // when the status code is codes.Unavailable when initial connection // has not been established (no pinned endpoint). // // "isNonRepeatableStopError" returns "true" when a mutable request // is interrupted by non-transient error that client cannot handle itself, // or transient error while the connection has already been established // (pinned endpoint exists). // // Returning "true" means retry should stop, otherwise it violates // write-at-most-once semantics. func isNonRepeatableStopError(err error) bool { ev, _ := status.FromError(err) if ev.Code() != codes.Unavailable { return true } desc := rpctypes.ErrorDesc(err) return desc != "there is no address available" && desc != "there is no connection available" } func (c *Client) newRetryWrapper() retryRPCFunc { return func(rpcCtx context.Context, f rpcFunc, rp retryPolicy) error { var isStop retryStopErrFunc switch rp { case repeatable: isStop = isRepeatableStopError case nonRepeatable: isStop = isNonRepeatableStopError } for { if err := readyWait(rpcCtx, c.ctx, c.balancer.ConnectNotify()); err != nil { return err } pinned := c.balancer.pinned() err := f(rpcCtx) if err == nil { return nil } logger.Lvl(4).Infof("clientv3/retry: error %q on pinned endpoint %q", err.Error(), pinned) if s, ok := status.FromError(err); ok && (s.Code() == codes.Unavailable || s.Code() == codes.DeadlineExceeded || s.Code() == codes.Internal) { // mark this before endpoint switch is triggered c.balancer.hostPortError(pinned, err) c.balancer.next() logger.Lvl(4).Infof("clientv3/retry: switching from %q due to error %q", pinned, err.Error()) } if isStop(err) { return err } } } } func (c *Client) newAuthRetryWrapper(retryf retryRPCFunc) retryRPCFunc { return func(rpcCtx context.Context, f rpcFunc, rp retryPolicy) error { for { pinned := c.balancer.pinned() err := retryf(rpcCtx, f, rp) if err == nil { return nil } logger.Lvl(4).Infof("clientv3/auth-retry: error %q on pinned endpoint %q", err.Error(), pinned) // always stop retry on etcd errors other than invalid auth token if rpctypes.Error(err) == rpctypes.ErrInvalidAuthToken { gterr := c.getToken(rpcCtx) if gterr != nil { logger.Lvl(4).Infof("clientv3/auth-retry: cannot retry due to error %q(%q) on pinned endpoint %q", err.Error(), gterr.Error(), pinned) return err // return the original error for simplicity } continue } return err } } } type retryKVClient struct { kc pb.KVClient retryf retryRPCFunc } // RetryKVClient implements a KVClient. func RetryKVClient(c *Client) pb.KVClient { return &retryKVClient{ kc: pb.NewKVClient(c.conn), retryf: c.newAuthRetryWrapper(c.newRetryWrapper()), } } func (rkv *retryKVClient) Range(ctx context.Context, in *pb.RangeRequest, opts ...grpc.CallOption) (resp *pb.RangeResponse, err error) { err = rkv.retryf(ctx, func(rctx context.Context) error { resp, err = rkv.kc.Range(rctx, in, opts...) return err }, repeatable) return resp, err } func (rkv *retryKVClient) Put(ctx context.Context, in *pb.PutRequest, opts ...grpc.CallOption) (resp *pb.PutResponse, err error) { err = rkv.retryf(ctx, func(rctx context.Context) error { resp, err = rkv.kc.Put(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rkv *retryKVClient) DeleteRange(ctx context.Context, in *pb.DeleteRangeRequest, opts ...grpc.CallOption) (resp *pb.DeleteRangeResponse, err error) { err = rkv.retryf(ctx, func(rctx context.Context) error { resp, err = rkv.kc.DeleteRange(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rkv *retryKVClient) Txn(ctx context.Context, in *pb.TxnRequest, opts ...grpc.CallOption) (resp *pb.TxnResponse, err error) { // TODO: "repeatable" for read-only txn err = rkv.retryf(ctx, func(rctx context.Context) error { resp, err = rkv.kc.Txn(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rkv *retryKVClient) Compact(ctx context.Context, in *pb.CompactionRequest, opts ...grpc.CallOption) (resp *pb.CompactionResponse, err error) { err = rkv.retryf(ctx, func(rctx context.Context) error { resp, err = rkv.kc.Compact(rctx, in, opts...) return err }, nonRepeatable) return resp, err } type retryLeaseClient struct { lc pb.LeaseClient retryf retryRPCFunc } // RetryLeaseClient implements a LeaseClient. func RetryLeaseClient(c *Client) pb.LeaseClient { return &retryLeaseClient{ lc: pb.NewLeaseClient(c.conn), retryf: c.newAuthRetryWrapper(c.newRetryWrapper()), } } func (rlc *retryLeaseClient) LeaseTimeToLive(ctx context.Context, in *pb.LeaseTimeToLiveRequest, opts ...grpc.CallOption) (resp *pb.LeaseTimeToLiveResponse, err error) { err = rlc.retryf(ctx, func(rctx context.Context) error { resp, err = rlc.lc.LeaseTimeToLive(rctx, in, opts...) return err }, repeatable) return resp, err } func (rlc *retryLeaseClient) LeaseLeases(ctx context.Context, in *pb.LeaseLeasesRequest, opts ...grpc.CallOption) (resp *pb.LeaseLeasesResponse, err error) { err = rlc.retryf(ctx, func(rctx context.Context) error { resp, err = rlc.lc.LeaseLeases(rctx, in, opts...) return err }, repeatable) return resp, err } func (rlc *retryLeaseClient) LeaseGrant(ctx context.Context, in *pb.LeaseGrantRequest, opts ...grpc.CallOption) (resp *pb.LeaseGrantResponse, err error) { err = rlc.retryf(ctx, func(rctx context.Context) error { resp, err = rlc.lc.LeaseGrant(rctx, in, opts...) return err }, repeatable) return resp, err } func (rlc *retryLeaseClient) LeaseRevoke(ctx context.Context, in *pb.LeaseRevokeRequest, opts ...grpc.CallOption) (resp *pb.LeaseRevokeResponse, err error) { err = rlc.retryf(ctx, func(rctx context.Context) error { resp, err = rlc.lc.LeaseRevoke(rctx, in, opts...) return err }, repeatable) return resp, err } func (rlc *retryLeaseClient) LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (stream pb.Lease_LeaseKeepAliveClient, err error) { err = rlc.retryf(ctx, func(rctx context.Context) error { stream, err = rlc.lc.LeaseKeepAlive(rctx, opts...) return err }, repeatable) return stream, err } type retryClusterClient struct { cc pb.ClusterClient retryf retryRPCFunc } // RetryClusterClient implements a ClusterClient. func RetryClusterClient(c *Client) pb.ClusterClient { return &retryClusterClient{ cc: pb.NewClusterClient(c.conn), retryf: c.newRetryWrapper(), } } func (rcc *retryClusterClient) MemberList(ctx context.Context, in *pb.MemberListRequest, opts ...grpc.CallOption) (resp *pb.MemberListResponse, err error) { err = rcc.retryf(ctx, func(rctx context.Context) error { resp, err = rcc.cc.MemberList(rctx, in, opts...) return err }, repeatable) return resp, err } func (rcc *retryClusterClient) MemberAdd(ctx context.Context, in *pb.MemberAddRequest, opts ...grpc.CallOption) (resp *pb.MemberAddResponse, err error) { err = rcc.retryf(ctx, func(rctx context.Context) error { resp, err = rcc.cc.MemberAdd(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rcc *retryClusterClient) MemberRemove(ctx context.Context, in *pb.MemberRemoveRequest, opts ...grpc.CallOption) (resp *pb.MemberRemoveResponse, err error) { err = rcc.retryf(ctx, func(rctx context.Context) error { resp, err = rcc.cc.MemberRemove(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rcc *retryClusterClient) MemberUpdate(ctx context.Context, in *pb.MemberUpdateRequest, opts ...grpc.CallOption) (resp *pb.MemberUpdateResponse, err error) { err = rcc.retryf(ctx, func(rctx context.Context) error { resp, err = rcc.cc.MemberUpdate(rctx, in, opts...) return err }, nonRepeatable) return resp, err } type retryMaintenanceClient struct { mc pb.MaintenanceClient retryf retryRPCFunc } // RetryMaintenanceClient implements a Maintenance. func RetryMaintenanceClient(c *Client, conn *grpc.ClientConn) pb.MaintenanceClient { return &retryMaintenanceClient{ mc: pb.NewMaintenanceClient(conn), retryf: c.newRetryWrapper(), } } func (rmc *retryMaintenanceClient) Alarm(ctx context.Context, in *pb.AlarmRequest, opts ...grpc.CallOption) (resp *pb.AlarmResponse, err error) { err = rmc.retryf(ctx, func(rctx context.Context) error { resp, err = rmc.mc.Alarm(rctx, in, opts...) return err }, repeatable) return resp, err } func (rmc *retryMaintenanceClient) Status(ctx context.Context, in *pb.StatusRequest, opts ...grpc.CallOption) (resp *pb.StatusResponse, err error) { err = rmc.retryf(ctx, func(rctx context.Context) error { resp, err = rmc.mc.Status(rctx, in, opts...) return err }, repeatable) return resp, err } func (rmc *retryMaintenanceClient) Hash(ctx context.Context, in *pb.HashRequest, opts ...grpc.CallOption) (resp *pb.HashResponse, err error) { err = rmc.retryf(ctx, func(rctx context.Context) error { resp, err = rmc.mc.Hash(rctx, in, opts...) return err }, repeatable) return resp, err } func (rmc *retryMaintenanceClient) HashKV(ctx context.Context, in *pb.HashKVRequest, opts ...grpc.CallOption) (resp *pb.HashKVResponse, err error) { err = rmc.retryf(ctx, func(rctx context.Context) error { resp, err = rmc.mc.HashKV(rctx, in, opts...) return err }, repeatable) return resp, err } func (rmc *retryMaintenanceClient) Snapshot(ctx context.Context, in *pb.SnapshotRequest, opts ...grpc.CallOption) (stream pb.Maintenance_SnapshotClient, err error) { err = rmc.retryf(ctx, func(rctx context.Context) error { stream, err = rmc.mc.Snapshot(rctx, in, opts...) return err }, repeatable) return stream, err } func (rmc *retryMaintenanceClient) MoveLeader(ctx context.Context, in *pb.MoveLeaderRequest, opts ...grpc.CallOption) (resp *pb.MoveLeaderResponse, err error) { err = rmc.retryf(ctx, func(rctx context.Context) error { resp, err = rmc.mc.MoveLeader(rctx, in, opts...) return err }, repeatable) return resp, err } func (rmc *retryMaintenanceClient) Defragment(ctx context.Context, in *pb.DefragmentRequest, opts ...grpc.CallOption) (resp *pb.DefragmentResponse, err error) { err = rmc.retryf(ctx, func(rctx context.Context) error { resp, err = rmc.mc.Defragment(rctx, in, opts...) return err }, nonRepeatable) return resp, err } type retryAuthClient struct { ac pb.AuthClient retryf retryRPCFunc } // RetryAuthClient implements a AuthClient. func RetryAuthClient(c *Client) pb.AuthClient { return &retryAuthClient{ ac: pb.NewAuthClient(c.conn), retryf: c.newRetryWrapper(), } } func (rac *retryAuthClient) UserList(ctx context.Context, in *pb.AuthUserListRequest, opts ...grpc.CallOption) (resp *pb.AuthUserListResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.UserList(rctx, in, opts...) return err }, repeatable) return resp, err } func (rac *retryAuthClient) UserGet(ctx context.Context, in *pb.AuthUserGetRequest, opts ...grpc.CallOption) (resp *pb.AuthUserGetResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.UserGet(rctx, in, opts...) return err }, repeatable) return resp, err } func (rac *retryAuthClient) RoleGet(ctx context.Context, in *pb.AuthRoleGetRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleGetResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.RoleGet(rctx, in, opts...) return err }, repeatable) return resp, err } func (rac *retryAuthClient) RoleList(ctx context.Context, in *pb.AuthRoleListRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleListResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.RoleList(rctx, in, opts...) return err }, repeatable) return resp, err } func (rac *retryAuthClient) AuthEnable(ctx context.Context, in *pb.AuthEnableRequest, opts ...grpc.CallOption) (resp *pb.AuthEnableResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.AuthEnable(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) AuthDisable(ctx context.Context, in *pb.AuthDisableRequest, opts ...grpc.CallOption) (resp *pb.AuthDisableResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.AuthDisable(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) UserAdd(ctx context.Context, in *pb.AuthUserAddRequest, opts ...grpc.CallOption) (resp *pb.AuthUserAddResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.UserAdd(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) UserDelete(ctx context.Context, in *pb.AuthUserDeleteRequest, opts ...grpc.CallOption) (resp *pb.AuthUserDeleteResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.UserDelete(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) UserChangePassword(ctx context.Context, in *pb.AuthUserChangePasswordRequest, opts ...grpc.CallOption) (resp *pb.AuthUserChangePasswordResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.UserChangePassword(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) UserGrantRole(ctx context.Context, in *pb.AuthUserGrantRoleRequest, opts ...grpc.CallOption) (resp *pb.AuthUserGrantRoleResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.UserGrantRole(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) UserRevokeRole(ctx context.Context, in *pb.AuthUserRevokeRoleRequest, opts ...grpc.CallOption) (resp *pb.AuthUserRevokeRoleResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.UserRevokeRole(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) RoleAdd(ctx context.Context, in *pb.AuthRoleAddRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleAddResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.RoleAdd(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) RoleDelete(ctx context.Context, in *pb.AuthRoleDeleteRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleDeleteResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.RoleDelete(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) RoleGrantPermission(ctx context.Context, in *pb.AuthRoleGrantPermissionRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleGrantPermissionResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.RoleGrantPermission(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) RoleRevokePermission(ctx context.Context, in *pb.AuthRoleRevokePermissionRequest, opts ...grpc.CallOption) (resp *pb.AuthRoleRevokePermissionResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.RoleRevokePermission(rctx, in, opts...) return err }, nonRepeatable) return resp, err } func (rac *retryAuthClient) Authenticate(ctx context.Context, in *pb.AuthenticateRequest, opts ...grpc.CallOption) (resp *pb.AuthenticateResponse, err error) { err = rac.retryf(ctx, func(rctx context.Context) error { resp, err = rac.ac.Authenticate(rctx, in, opts...) return err }, nonRepeatable) return resp, err } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/sort.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 type SortTarget int type SortOrder int const ( SortNone SortOrder = iota SortAscend SortDescend ) const ( SortByKey SortTarget = iota SortByVersion SortByCreateRevision SortByModRevision SortByValue ) type SortOption struct { Target SortTarget Order SortOrder } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/txn.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" "sync" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" "google.golang.org/grpc" ) // Txn is the interface that wraps mini-transactions. // // Txn(context.TODO()).If( // Compare(Value(k1), ">", v1), // Compare(Version(k1), "=", 2) // ).Then( // OpPut(k2,v2), OpPut(k3,v3) // ).Else( // OpPut(k4,v4), OpPut(k5,v5) // ).Commit() // type Txn interface { // If takes a list of comparison. If all comparisons passed in succeed, // the operations passed into Then() will be executed. Or the operations // passed into Else() will be executed. If(cs ...Cmp) Txn // Then takes a list of operations. The Ops list will be executed, if the // comparisons passed in If() succeed. Then(ops ...Op) Txn // Else takes a list of operations. The Ops list will be executed, if the // comparisons passed in If() fail. Else(ops ...Op) Txn // Commit tries to commit the transaction. Commit() (*TxnResponse, error) } type txn struct { kv *kv ctx context.Context mu sync.Mutex cif bool cthen bool celse bool isWrite bool cmps []*pb.Compare sus []*pb.RequestOp fas []*pb.RequestOp callOpts []grpc.CallOption } func (txn *txn) If(cs ...Cmp) Txn { txn.mu.Lock() defer txn.mu.Unlock() if txn.cif { panic("cannot call If twice!") } if txn.cthen { panic("cannot call If after Then!") } if txn.celse { panic("cannot call If after Else!") } txn.cif = true for i := range cs { txn.cmps = append(txn.cmps, (*pb.Compare)(&cs[i])) } return txn } func (txn *txn) Then(ops ...Op) Txn { txn.mu.Lock() defer txn.mu.Unlock() if txn.cthen { panic("cannot call Then twice!") } if txn.celse { panic("cannot call Then after Else!") } txn.cthen = true for _, op := range ops { txn.isWrite = txn.isWrite || op.isWrite() txn.sus = append(txn.sus, op.toRequestOp()) } return txn } func (txn *txn) Else(ops ...Op) Txn { txn.mu.Lock() defer txn.mu.Unlock() if txn.celse { panic("cannot call Else twice!") } txn.celse = true for _, op := range ops { txn.isWrite = txn.isWrite || op.isWrite() txn.fas = append(txn.fas, op.toRequestOp()) } return txn } func (txn *txn) Commit() (*TxnResponse, error) { txn.mu.Lock() defer txn.mu.Unlock() r := &pb.TxnRequest{Compare: txn.cmps, Success: txn.sus, Failure: txn.fas} var resp *pb.TxnResponse var err error resp, err = txn.kv.remote.Txn(txn.ctx, r, txn.callOpts...) if err != nil { return nil, toErr(txn.ctx, err) } return (*TxnResponse)(resp), nil } ================================================ FILE: vendor/github.com/coreos/etcd/clientv3/watch.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package clientv3 import ( "context" "fmt" "sync" "time" v3rpc "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes" pb "github.com/coreos/etcd/etcdserver/etcdserverpb" mvccpb "github.com/coreos/etcd/mvcc/mvccpb" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) const ( EventTypeDelete = mvccpb.DELETE EventTypePut = mvccpb.PUT closeSendErrTimeout = 250 * time.Millisecond ) type Event mvccpb.Event type WatchChan <-chan WatchResponse type Watcher interface { // Watch watches on a key or prefix. The watched events will be returned // through the returned channel. If revisions waiting to be sent over the // watch are compacted, then the watch will be canceled by the server, the // client will post a compacted error watch response, and the channel will close. Watch(ctx context.Context, key string, opts ...OpOption) WatchChan // Close closes the watcher and cancels all watch requests. Close() error } type WatchResponse struct { Header pb.ResponseHeader Events []*Event // CompactRevision is the minimum revision the watcher may receive. CompactRevision int64 // Canceled is used to indicate watch failure. // If the watch failed and the stream was about to close, before the channel is closed, // the channel sends a final response that has Canceled set to true with a non-nil Err(). Canceled bool // Created is used to indicate the creation of the watcher. Created bool closeErr error // cancelReason is a reason of canceling watch cancelReason string } // IsCreate returns true if the event tells that the key is newly created. func (e *Event) IsCreate() bool { return e.Type == EventTypePut && e.Kv.CreateRevision == e.Kv.ModRevision } // IsModify returns true if the event tells that a new value is put on existing key. func (e *Event) IsModify() bool { return e.Type == EventTypePut && e.Kv.CreateRevision != e.Kv.ModRevision } // Err is the error value if this WatchResponse holds an error. func (wr *WatchResponse) Err() error { switch { case wr.closeErr != nil: return v3rpc.Error(wr.closeErr) case wr.CompactRevision != 0: return v3rpc.ErrCompacted case wr.Canceled: if len(wr.cancelReason) != 0 { return v3rpc.Error(status.Error(codes.FailedPrecondition, wr.cancelReason)) } return v3rpc.ErrFutureRev } return nil } // IsProgressNotify returns true if the WatchResponse is progress notification. func (wr *WatchResponse) IsProgressNotify() bool { return len(wr.Events) == 0 && !wr.Canceled && !wr.Created && wr.CompactRevision == 0 && wr.Header.Revision != 0 } // watcher implements the Watcher interface type watcher struct { remote pb.WatchClient callOpts []grpc.CallOption // mu protects the grpc streams map mu sync.RWMutex // streams holds all the active grpc streams keyed by ctx value. streams map[string]*watchGrpcStream } // watchGrpcStream tracks all watch resources attached to a single grpc stream. type watchGrpcStream struct { owner *watcher remote pb.WatchClient callOpts []grpc.CallOption // ctx controls internal remote.Watch requests ctx context.Context // ctxKey is the key used when looking up this stream's context ctxKey string cancel context.CancelFunc // substreams holds all active watchers on this grpc stream substreams map[int64]*watcherStream // resuming holds all resuming watchers on this grpc stream resuming []*watcherStream // reqc sends a watch request from Watch() to the main goroutine reqc chan *watchRequest // respc receives data from the watch client respc chan *pb.WatchResponse // donec closes to broadcast shutdown donec chan struct{} // errc transmits errors from grpc Recv to the watch stream reconnect logic errc chan error // closingc gets the watcherStream of closing watchers closingc chan *watcherStream // wg is Done when all substream goroutines have exited wg sync.WaitGroup // resumec closes to signal that all substreams should begin resuming resumec chan struct{} // closeErr is the error that closed the watch stream closeErr error } // watchRequest is issued by the subscriber to start a new watcher type watchRequest struct { ctx context.Context key string end string rev int64 // send created notification event if this field is true createdNotify bool // progressNotify is for progress updates progressNotify bool // filters is the list of events to filter out filters []pb.WatchCreateRequest_FilterType // get the previous key-value pair before the event happens prevKV bool // retc receives a chan WatchResponse once the watcher is established retc chan chan WatchResponse } // watcherStream represents a registered watcher type watcherStream struct { // initReq is the request that initiated this request initReq watchRequest // outc publishes watch responses to subscriber outc chan WatchResponse // recvc buffers watch responses before publishing recvc chan *WatchResponse // donec closes when the watcherStream goroutine stops. donec chan struct{} // closing is set to true when stream should be scheduled to shutdown. closing bool // id is the registered watch id on the grpc stream id int64 // buf holds all events received from etcd but not yet consumed by the client buf []*WatchResponse } func NewWatcher(c *Client) Watcher { return NewWatchFromWatchClient(pb.NewWatchClient(c.conn), c) } func NewWatchFromWatchClient(wc pb.WatchClient, c *Client) Watcher { w := &watcher{ remote: wc, streams: make(map[string]*watchGrpcStream), } if c != nil { w.callOpts = c.callOpts } return w } // never closes var valCtxCh = make(chan struct{}) var zeroTime = time.Unix(0, 0) // ctx with only the values; never Done type valCtx struct{ context.Context } func (vc *valCtx) Deadline() (time.Time, bool) { return zeroTime, false } func (vc *valCtx) Done() <-chan struct{} { return valCtxCh } func (vc *valCtx) Err() error { return nil } func (w *watcher) newWatcherGrpcStream(inctx context.Context) *watchGrpcStream { ctx, cancel := context.WithCancel(&valCtx{inctx}) wgs := &watchGrpcStream{ owner: w, remote: w.remote, callOpts: w.callOpts, ctx: ctx, ctxKey: streamKeyFromCtx(inctx), cancel: cancel, substreams: make(map[int64]*watcherStream), respc: make(chan *pb.WatchResponse), reqc: make(chan *watchRequest), donec: make(chan struct{}), errc: make(chan error, 1), closingc: make(chan *watcherStream), resumec: make(chan struct{}), } go wgs.run() return wgs } // Watch posts a watch request to run() and waits for a new watcher channel func (w *watcher) Watch(ctx context.Context, key string, opts ...OpOption) WatchChan { ow := opWatch(key, opts...) var filters []pb.WatchCreateRequest_FilterType if ow.filterPut { filters = append(filters, pb.WatchCreateRequest_NOPUT) } if ow.filterDelete { filters = append(filters, pb.WatchCreateRequest_NODELETE) } wr := &watchRequest{ ctx: ctx, createdNotify: ow.createdNotify, key: string(ow.key), end: string(ow.end), rev: ow.rev, progressNotify: ow.progressNotify, filters: filters, prevKV: ow.prevKV, retc: make(chan chan WatchResponse, 1), } ok := false ctxKey := streamKeyFromCtx(ctx) // find or allocate appropriate grpc watch stream w.mu.Lock() if w.streams == nil { // closed w.mu.Unlock() ch := make(chan WatchResponse) close(ch) return ch } wgs := w.streams[ctxKey] if wgs == nil { wgs = w.newWatcherGrpcStream(ctx) w.streams[ctxKey] = wgs } donec := wgs.donec reqc := wgs.reqc w.mu.Unlock() // couldn't create channel; return closed channel closeCh := make(chan WatchResponse, 1) // submit request select { case reqc <- wr: ok = true case <-wr.ctx.Done(): case <-donec: if wgs.closeErr != nil { closeCh <- WatchResponse{closeErr: wgs.closeErr} break } // retry; may have dropped stream from no ctxs return w.Watch(ctx, key, opts...) } // receive channel if ok { select { case ret := <-wr.retc: return ret case <-ctx.Done(): case <-donec: if wgs.closeErr != nil { closeCh <- WatchResponse{closeErr: wgs.closeErr} break } // retry; may have dropped stream from no ctxs return w.Watch(ctx, key, opts...) } } close(closeCh) return closeCh } func (w *watcher) Close() (err error) { w.mu.Lock() streams := w.streams w.streams = nil w.mu.Unlock() for _, wgs := range streams { if werr := wgs.close(); werr != nil { err = werr } } return err } func (w *watchGrpcStream) close() (err error) { w.cancel() <-w.donec select { case err = <-w.errc: default: } return toErr(w.ctx, err) } func (w *watcher) closeStream(wgs *watchGrpcStream) { w.mu.Lock() close(wgs.donec) wgs.cancel() if w.streams != nil { delete(w.streams, wgs.ctxKey) } w.mu.Unlock() } func (w *watchGrpcStream) addSubstream(resp *pb.WatchResponse, ws *watcherStream) { if resp.WatchId == -1 { // failed; no channel close(ws.recvc) return } ws.id = resp.WatchId w.substreams[ws.id] = ws } func (w *watchGrpcStream) sendCloseSubstream(ws *watcherStream, resp *WatchResponse) { select { case ws.outc <- *resp: case <-ws.initReq.ctx.Done(): case <-time.After(closeSendErrTimeout): } close(ws.outc) } func (w *watchGrpcStream) closeSubstream(ws *watcherStream) { // send channel response in case stream was never established select { case ws.initReq.retc <- ws.outc: default: } // close subscriber's channel if closeErr := w.closeErr; closeErr != nil && ws.initReq.ctx.Err() == nil { go w.sendCloseSubstream(ws, &WatchResponse{closeErr: w.closeErr}) } else if ws.outc != nil { close(ws.outc) } if ws.id != -1 { delete(w.substreams, ws.id) return } for i := range w.resuming { if w.resuming[i] == ws { w.resuming[i] = nil return } } } // run is the root of the goroutines for managing a watcher client func (w *watchGrpcStream) run() { var wc pb.Watch_WatchClient var closeErr error // substreams marked to close but goroutine still running; needed for // avoiding double-closing recvc on grpc stream teardown closing := make(map[*watcherStream]struct{}) defer func() { w.closeErr = closeErr // shutdown substreams and resuming substreams for _, ws := range w.substreams { if _, ok := closing[ws]; !ok { close(ws.recvc) closing[ws] = struct{}{} } } for _, ws := range w.resuming { if _, ok := closing[ws]; ws != nil && !ok { close(ws.recvc) closing[ws] = struct{}{} } } w.joinSubstreams() for range closing { w.closeSubstream(<-w.closingc) } w.wg.Wait() w.owner.closeStream(w) }() // start a stream with the etcd grpc server if wc, closeErr = w.newWatchClient(); closeErr != nil { return } cancelSet := make(map[int64]struct{}) for { select { // Watch() requested case wreq := <-w.reqc: outc := make(chan WatchResponse, 1) ws := &watcherStream{ initReq: *wreq, id: -1, outc: outc, // unbuffered so resumes won't cause repeat events recvc: make(chan *WatchResponse), } ws.donec = make(chan struct{}) w.wg.Add(1) go w.serveSubstream(ws, w.resumec) // queue up for watcher creation/resume w.resuming = append(w.resuming, ws) if len(w.resuming) == 1 { // head of resume queue, can register a new watcher wc.Send(ws.initReq.toPB()) } // New events from the watch client case pbresp := <-w.respc: switch { case pbresp.Created: // response to head of queue creation if ws := w.resuming[0]; ws != nil { w.addSubstream(pbresp, ws) w.dispatchEvent(pbresp) w.resuming[0] = nil } if ws := w.nextResume(); ws != nil { wc.Send(ws.initReq.toPB()) } case pbresp.Canceled && pbresp.CompactRevision == 0: delete(cancelSet, pbresp.WatchId) if ws, ok := w.substreams[pbresp.WatchId]; ok { // signal to stream goroutine to update closingc close(ws.recvc) closing[ws] = struct{}{} } default: // dispatch to appropriate watch stream if ok := w.dispatchEvent(pbresp); ok { break } // watch response on unexpected watch id; cancel id if _, ok := cancelSet[pbresp.WatchId]; ok { break } cancelSet[pbresp.WatchId] = struct{}{} cr := &pb.WatchRequest_CancelRequest{ CancelRequest: &pb.WatchCancelRequest{ WatchId: pbresp.WatchId, }, } req := &pb.WatchRequest{RequestUnion: cr} wc.Send(req) } // watch client failed on Recv; spawn another if possible case err := <-w.errc: if isHaltErr(w.ctx, err) || toErr(w.ctx, err) == v3rpc.ErrNoLeader { closeErr = err return } if wc, closeErr = w.newWatchClient(); closeErr != nil { return } if ws := w.nextResume(); ws != nil { wc.Send(ws.initReq.toPB()) } cancelSet = make(map[int64]struct{}) case <-w.ctx.Done(): return case ws := <-w.closingc: w.closeSubstream(ws) delete(closing, ws) if len(w.substreams)+len(w.resuming) == 0 { // no more watchers on this stream, shutdown return } } } } // nextResume chooses the next resuming to register with the grpc stream. Abandoned // streams are marked as nil in the queue since the head must wait for its inflight registration. func (w *watchGrpcStream) nextResume() *watcherStream { for len(w.resuming) != 0 { if w.resuming[0] != nil { return w.resuming[0] } w.resuming = w.resuming[1:len(w.resuming)] } return nil } // dispatchEvent sends a WatchResponse to the appropriate watcher stream func (w *watchGrpcStream) dispatchEvent(pbresp *pb.WatchResponse) bool { events := make([]*Event, len(pbresp.Events)) for i, ev := range pbresp.Events { events[i] = (*Event)(ev) } wr := &WatchResponse{ Header: *pbresp.Header, Events: events, CompactRevision: pbresp.CompactRevision, Created: pbresp.Created, Canceled: pbresp.Canceled, cancelReason: pbresp.CancelReason, } ws, ok := w.substreams[pbresp.WatchId] if !ok { return false } select { case ws.recvc <- wr: case <-ws.donec: return false } return true } // serveWatchClient forwards messages from the grpc stream to run() func (w *watchGrpcStream) serveWatchClient(wc pb.Watch_WatchClient) { for { resp, err := wc.Recv() if err != nil { select { case w.errc <- err: case <-w.donec: } return } select { case w.respc <- resp: case <-w.donec: return } } } // serveSubstream forwards watch responses from run() to the subscriber func (w *watchGrpcStream) serveSubstream(ws *watcherStream, resumec chan struct{}) { if ws.closing { panic("created substream goroutine but substream is closing") } // nextRev is the minimum expected next revision nextRev := ws.initReq.rev resuming := false defer func() { if !resuming { ws.closing = true } close(ws.donec) if !resuming { w.closingc <- ws } w.wg.Done() }() emptyWr := &WatchResponse{} for { curWr := emptyWr outc := ws.outc if len(ws.buf) > 0 { curWr = ws.buf[0] } else { outc = nil } select { case outc <- *curWr: if ws.buf[0].Err() != nil { return } ws.buf[0] = nil ws.buf = ws.buf[1:] case wr, ok := <-ws.recvc: if !ok { // shutdown from closeSubstream return } if wr.Created { if ws.initReq.retc != nil { ws.initReq.retc <- ws.outc // to prevent next write from taking the slot in buffered channel // and posting duplicate create events ws.initReq.retc = nil // send first creation event only if requested if ws.initReq.createdNotify { ws.outc <- *wr } // once the watch channel is returned, a current revision // watch must resume at the store revision. This is necessary // for the following case to work as expected: // wch := m1.Watch("a") // m2.Put("a", "b") // <-wch // If the revision is only bound on the first observed event, // if wch is disconnected before the Put is issued, then reconnects // after it is committed, it'll miss the Put. if ws.initReq.rev == 0 { nextRev = wr.Header.Revision } } } else { // current progress of watch; <= store revision nextRev = wr.Header.Revision } if len(wr.Events) > 0 { nextRev = wr.Events[len(wr.Events)-1].Kv.ModRevision + 1 } ws.initReq.rev = nextRev // created event is already sent above, // watcher should not post duplicate events if wr.Created { continue } // TODO pause channel if buffer gets too large ws.buf = append(ws.buf, wr) case <-w.ctx.Done(): return case <-ws.initReq.ctx.Done(): return case <-resumec: resuming = true return } } // lazily send cancel message if events on missing id } func (w *watchGrpcStream) newWatchClient() (pb.Watch_WatchClient, error) { // mark all substreams as resuming close(w.resumec) w.resumec = make(chan struct{}) w.joinSubstreams() for _, ws := range w.substreams { ws.id = -1 w.resuming = append(w.resuming, ws) } // strip out nils, if any var resuming []*watcherStream for _, ws := range w.resuming { if ws != nil { resuming = append(resuming, ws) } } w.resuming = resuming w.substreams = make(map[int64]*watcherStream) // connect to grpc stream while accepting watcher cancelation stopc := make(chan struct{}) donec := w.waitCancelSubstreams(stopc) wc, err := w.openWatchClient() close(stopc) <-donec // serve all non-closing streams, even if there's a client error // so that the teardown path can shutdown the streams as expected. for _, ws := range w.resuming { if ws.closing { continue } ws.donec = make(chan struct{}) w.wg.Add(1) go w.serveSubstream(ws, w.resumec) } if err != nil { return nil, v3rpc.Error(err) } // receive data from new grpc stream go w.serveWatchClient(wc) return wc, nil } func (w *watchGrpcStream) waitCancelSubstreams(stopc <-chan struct{}) <-chan struct{} { var wg sync.WaitGroup wg.Add(len(w.resuming)) donec := make(chan struct{}) for i := range w.resuming { go func(ws *watcherStream) { defer wg.Done() if ws.closing { if ws.initReq.ctx.Err() != nil && ws.outc != nil { close(ws.outc) ws.outc = nil } return } select { case <-ws.initReq.ctx.Done(): // closed ws will be removed from resuming ws.closing = true close(ws.outc) ws.outc = nil w.wg.Add(1) go func() { defer w.wg.Done() w.closingc <- ws }() case <-stopc: } }(w.resuming[i]) } go func() { defer close(donec) wg.Wait() }() return donec } // joinSubstreams waits for all substream goroutines to complete. func (w *watchGrpcStream) joinSubstreams() { for _, ws := range w.substreams { <-ws.donec } for _, ws := range w.resuming { if ws != nil { <-ws.donec } } } var maxBackoff = 100 * time.Millisecond // openWatchClient retries opening a watch client until success or halt. // manually retry in case "ws==nil && err==nil" // TODO: remove FailFast=false func (w *watchGrpcStream) openWatchClient() (ws pb.Watch_WatchClient, err error) { backoff := time.Millisecond for { select { case <-w.ctx.Done(): if err == nil { return nil, w.ctx.Err() } return nil, err default: } if ws, err = w.remote.Watch(w.ctx, w.callOpts...); ws != nil && err == nil { break } if isHaltErr(w.ctx, err) { return nil, v3rpc.Error(err) } if isUnavailableErr(w.ctx, err) { // retry, but backoff if backoff < maxBackoff { // 25% backoff factor backoff = backoff + backoff/4 if backoff > maxBackoff { backoff = maxBackoff } } time.Sleep(backoff) } } return ws, nil } // toPB converts an internal watch request structure to its protobuf WatchRequest structure. func (wr *watchRequest) toPB() *pb.WatchRequest { req := &pb.WatchCreateRequest{ StartRevision: wr.rev, Key: []byte(wr.key), RangeEnd: []byte(wr.end), ProgressNotify: wr.progressNotify, Filters: wr.filters, PrevKv: wr.prevKV, } cr := &pb.WatchRequest_CreateRequest{CreateRequest: req} return &pb.WatchRequest{RequestUnion: cr} } func streamKeyFromCtx(ctx context.Context) string { if md, ok := metadata.FromOutgoingContext(ctx); ok { return fmt.Sprintf("%+v", md) } return "" } ================================================ FILE: vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/doc.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package rpctypes has types and values shared by the etcd server and client for v3 RPC interaction. package rpctypes ================================================ FILE: vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/error.go ================================================ // Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package rpctypes import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) // server-side error var ( ErrGRPCEmptyKey = status.New(codes.InvalidArgument, "etcdserver: key is not provided").Err() ErrGRPCKeyNotFound = status.New(codes.InvalidArgument, "etcdserver: key not found").Err() ErrGRPCValueProvided = status.New(codes.InvalidArgument, "etcdserver: value is provided").Err() ErrGRPCLeaseProvided = status.New(codes.InvalidArgument, "etcdserver: lease is provided").Err() ErrGRPCTooManyOps = status.New(codes.InvalidArgument, "etcdserver: too many operations in txn request").Err() ErrGRPCDuplicateKey = status.New(codes.InvalidArgument, "etcdserver: duplicate key given in txn request").Err() ErrGRPCCompacted = status.New(codes.OutOfRange, "etcdserver: mvcc: required revision has been compacted").Err() ErrGRPCFutureRev = status.New(codes.OutOfRange, "etcdserver: mvcc: required revision is a future revision").Err() ErrGRPCNoSpace = status.New(codes.ResourceExhausted, "etcdserver: mvcc: database space exceeded").Err() ErrGRPCLeaseNotFound = status.New(codes.NotFound, "etcdserver: requested lease not found").Err() ErrGRPCLeaseExist = status.New(codes.FailedPrecondition, "etcdserver: lease already exists").Err() ErrGRPCLeaseTTLTooLarge = status.New(codes.OutOfRange, "etcdserver: too large lease TTL").Err() ErrGRPCMemberExist = status.New(codes.FailedPrecondition, "etcdserver: member ID already exist").Err() ErrGRPCPeerURLExist = status.New(codes.FailedPrecondition, "etcdserver: Peer URLs already exists").Err() ErrGRPCMemberNotEnoughStarted = status.New(codes.FailedPrecondition, "etcdserver: re-configuration failed due to not enough started members").Err() ErrGRPCMemberBadURLs = status.New(codes.InvalidArgument, "etcdserver: given member URLs are invalid").Err() ErrGRPCMemberNotFound = status.New(codes.NotFound, "etcdserver: member not found").Err() ErrGRPCRequestTooLarge = status.New(codes.InvalidArgument, "etcdserver: request is too large").Err() ErrGRPCRequestTooManyRequests = status.New(codes.ResourceExhausted, "etcdserver: too many requests").Err() ErrGRPCRootUserNotExist = status.New(codes.FailedPrecondition, "etcdserver: root user does not exist").Err() ErrGRPCRootRoleNotExist = status.New(codes.FailedPrecondition, "etcdserver: root user does not have root role").Err() ErrGRPCUserAlreadyExist = status.New(codes.FailedPrecondition, "etcdserver: user name already exists").Err() ErrGRPCUserEmpty = status.New(codes.InvalidArgument, "etcdserver: user name is empty").Err() ErrGRPCUserNotFound = status.New(codes.FailedPrecondition, "etcdserver: user name not found").Err() ErrGRPCRoleAlreadyExist = status.New(codes.FailedPrecondition, "etcdserver: role name already exists").Err() ErrGRPCRoleNotFound = status.New(codes.FailedPrecondition, "etcdserver: role name not found").Err() ErrGRPCAuthFailed = status.New(codes.InvalidArgument, "etcdserver: authentication failed, invalid user ID or password").Err() ErrGRPCPermissionDenied = status.New(codes.PermissionDenied, "etcdserver: permission denied").Err() ErrGRPCRoleNotGranted = status.New(codes.FailedPrecondition, "etcdserver: role is not granted to the user").Err() ErrGRPCPermissionNotGranted = status.New(codes.FailedPrecondition, "etcdserver: permission is not granted to the role").Err() ErrGRPCAuthNotEnabled = status.New(codes.FailedPrecondition, "etcdserver: authentication is not enabled").Err() ErrGRPCInvalidAuthToken = status.New(codes.Unauthenticated, "etcdserver: invalid auth token").Err() ErrGRPCInvalidAuthMgmt = status.New(codes.InvalidArgument, "etcdserver: invalid auth management").Err() ErrGRPCNoLeader = status.New(codes.Unavailable, "etcdserver: no leader").Err() ErrGRPCNotLeader = status.New(codes.FailedPrecondition, "etcdserver: not leader").Err() ErrGRPCNotCapable = status.New(codes.Unavailable, "etcdserver: not capable").Err() ErrGRPCStopped = status.New(codes.Unavailable, "etcdserver: server stopped").Err() ErrGRPCTimeout = status.New(codes.Unavailable, "etcdserver: request timed out").Err() ErrGRPCTimeoutDueToLeaderFail = status.New(codes.Unavailable, "etcdserver: request timed out, possibly due to previous leader failure").Err() ErrGRPCTimeoutDueToConnectionLost = status.New(codes.Unavailable, "etcdserver: request timed out, possibly due to connection lost").Err() ErrGRPCUnhealthy = status.New(codes.Unavailable, "etcdserver: unhealthy cluster").Err() ErrGRPCCorrupt = status.New(codes.DataLoss, "etcdserver: corrupt cluster").Err() errStringToError = map[string]error{ ErrorDesc(ErrGRPCEmptyKey): ErrGRPCEmptyKey, ErrorDesc(ErrGRPCKeyNotFound): ErrGRPCKeyNotFound, ErrorDesc(ErrGRPCValueProvided): ErrGRPCValueProvided, ErrorDesc(ErrGRPCLeaseProvided): ErrGRPCLeaseProvided, ErrorDesc(ErrGRPCTooManyOps): ErrGRPCTooManyOps, ErrorDesc(ErrGRPCDuplicateKey): ErrGRPCDuplicateKey, ErrorDesc(ErrGRPCCompacted): ErrGRPCCompacted, ErrorDesc(ErrGRPCFutureRev): ErrGRPCFutureRev, ErrorDesc(ErrGRPCNoSpace): ErrGRPCNoSpace, ErrorDesc(ErrGRPCLeaseNotFound): ErrGRPCLeaseNotFound, ErrorDesc(ErrGRPCLeaseExist): ErrGRPCLeaseExist, ErrorDesc(ErrGRPCLeaseTTLTooLarge): ErrGRPCLeaseTTLTooLarge, ErrorDesc(ErrGRPCMemberExist): ErrGRPCMemberExist, ErrorDesc(ErrGRPCPeerURLExist): ErrGRPCPeerURLExist, ErrorDesc(ErrGRPCMemberNotEnoughStarted): ErrGRPCMemberNotEnoughStarted, ErrorDesc(ErrGRPCMemberBadURLs): ErrGRPCMemberBadURLs, ErrorDesc(ErrGRPCMemberNotFound): ErrGRPCMemberNotFound, ErrorDesc(ErrGRPCRequestTooLarge): ErrGRPCRequestTooLarge, ErrorDesc(ErrGRPCRequestTooManyRequests): ErrGRPCRequestTooManyRequests, ErrorDesc(ErrGRPCRootUserNotExist): ErrGRPCRootUserNotExist, ErrorDesc(ErrGRPCRootRoleNotExist): ErrGRPCRootRoleNotExist, ErrorDesc(ErrGRPCUserAlreadyExist): ErrGRPCUserAlreadyExist, ErrorDesc(ErrGRPCUserEmpty): ErrGRPCUserEmpty, ErrorDesc(ErrGRPCUserNotFound): ErrGRPCUserNotFound, ErrorDesc(ErrGRPCRoleAlreadyExist): ErrGRPCRoleAlreadyExist, ErrorDesc(ErrGRPCRoleNotFound): ErrGRPCRoleNotFound, ErrorDesc(ErrGRPCAuthFailed): ErrGRPCAuthFailed, ErrorDesc(ErrGRPCPermissionDenied): ErrGRPCPermissionDenied, ErrorDesc(ErrGRPCRoleNotGranted): ErrGRPCRoleNotGranted, ErrorDesc(ErrGRPCPermissionNotGranted): ErrGRPCPermissionNotGranted, ErrorDesc(ErrGRPCAuthNotEnabled): ErrGRPCAuthNotEnabled, ErrorDesc(ErrGRPCInvalidAuthToken): ErrGRPCInvalidAuthToken, ErrorDesc(ErrGRPCInvalidAuthMgmt): ErrGRPCInvalidAuthMgmt, ErrorDesc(ErrGRPCNoLeader): ErrGRPCNoLeader, ErrorDesc(ErrGRPCNotLeader): ErrGRPCNotLeader, ErrorDesc(ErrGRPCNotCapable): ErrGRPCNotCapable, ErrorDesc(ErrGRPCStopped): ErrGRPCStopped, ErrorDesc(ErrGRPCTimeout): ErrGRPCTimeout, ErrorDesc(ErrGRPCTimeoutDueToLeaderFail): ErrGRPCTimeoutDueToLeaderFail, ErrorDesc(ErrGRPCTimeoutDueToConnectionLost): ErrGRPCTimeoutDueToConnectionLost, ErrorDesc(ErrGRPCUnhealthy): ErrGRPCUnhealthy, ErrorDesc(ErrGRPCCorrupt): ErrGRPCCorrupt, } ) // client-side error var ( ErrEmptyKey = Error(ErrGRPCEmptyKey) ErrKeyNotFound = Error(ErrGRPCKeyNotFound) ErrValueProvided = Error(ErrGRPCValueProvided) ErrLeaseProvided = Error(ErrGRPCLeaseProvided) ErrTooManyOps = Error(ErrGRPCTooManyOps) ErrDuplicateKey = Error(ErrGRPCDuplicateKey) ErrCompacted = Error(ErrGRPCCompacted) ErrFutureRev = Error(ErrGRPCFutureRev) ErrNoSpace = Error(ErrGRPCNoSpace) ErrLeaseNotFound = Error(ErrGRPCLeaseNotFound) ErrLeaseExist = Error(ErrGRPCLeaseExist) ErrLeaseTTLTooLarge = Error(ErrGRPCLeaseTTLTooLarge) ErrMemberExist = Error(ErrGRPCMemberExist) ErrPeerURLExist = Error(ErrGRPCPeerURLExist) ErrMemberNotEnoughStarted = Error(ErrGRPCMemberNotEnoughStarted) ErrMemberBadURLs = Error(ErrGRPCMemberBadURLs) ErrMemberNotFound = Error(ErrGRPCMemberNotFound) ErrRequestTooLarge = Error(ErrGRPCRequestTooLarge) ErrTooManyRequests = Error(ErrGRPCRequestTooManyRequests) ErrRootUserNotExist = Error(ErrGRPCRootUserNotExist) ErrRootRoleNotExist = Error(ErrGRPCRootRoleNotExist) ErrUserAlreadyExist = Error(ErrGRPCUserAlreadyExist) ErrUserEmpty = Error(ErrGRPCUserEmpty) ErrUserNotFound = Error(ErrGRPCUserNotFound) ErrRoleAlreadyExist = Error(ErrGRPCRoleAlreadyExist) ErrRoleNotFound = Error(ErrGRPCRoleNotFound) ErrAuthFailed = Error(ErrGRPCAuthFailed) ErrPermissionDenied = Error(ErrGRPCPermissionDenied) ErrRoleNotGranted = Error(ErrGRPCRoleNotGranted) ErrPermissionNotGranted = Error(ErrGRPCPermissionNotGranted) ErrAuthNotEnabled = Error(ErrGRPCAuthNotEnabled) ErrInvalidAuthToken = Error(ErrGRPCInvalidAuthToken) ErrInvalidAuthMgmt = Error(ErrGRPCInvalidAuthMgmt) ErrNoLeader = Error(ErrGRPCNoLeader) ErrNotLeader = Error(ErrGRPCNotLeader) ErrNotCapable = Error(ErrGRPCNotCapable) ErrStopped = Error(ErrGRPCStopped) ErrTimeout = Error(ErrGRPCTimeout) ErrTimeoutDueToLeaderFail = Error(ErrGRPCTimeoutDueToLeaderFail) ErrTimeoutDueToConnectionLost = Error(ErrGRPCTimeoutDueToConnectionLost) ErrUnhealthy = Error(ErrGRPCUnhealthy) ErrCorrupt = Error(ErrGRPCCorrupt) ) // EtcdError defines gRPC server errors. // (https://github.com/grpc/grpc-go/blob/master/rpc_util.go#L319-L323) type EtcdError struct { code codes.Code desc string } // Code returns grpc/codes.Code. // TODO: define clientv3/codes.Code. func (e EtcdError) Code() codes.Code { return e.code } func (e EtcdError) Error() string { return e.desc } func Error(err error) error { if err == nil { return nil } verr, ok := errStringToError[ErrorDesc(err)] if !ok { // not gRPC error return err } ev, ok := status.FromError(verr) var desc string if ok { desc = ev.Message() } else { desc = verr.Error() } return EtcdError{code: ev.Code(), desc: desc} } func ErrorDesc(err error) string { if s, ok := status.FromError(err); ok { return s.Message() } return err.Error() } ================================================ FILE: vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/md.go ================================================ // Copyright 2016 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package rpctypes var ( MetadataRequireLeaderKey = "hasleader" MetadataHasLeader = "true" ) ================================================ FILE: vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/etcdserver.pb.go ================================================ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: etcdserver.proto /* Package etcdserverpb is a generated protocol buffer package. It is generated from these files: etcdserver.proto raft_internal.proto rpc.proto It has these top-level messages: Request Metadata RequestHeader InternalRaftRequest EmptyResponse InternalAuthenticateRequest ResponseHeader RangeRequest RangeResponse PutRequest PutResponse DeleteRangeRequest DeleteRangeResponse RequestOp ResponseOp Compare TxnRequest TxnResponse CompactionRequest CompactionResponse HashRequest HashKVRequest HashKVResponse HashResponse SnapshotRequest SnapshotResponse WatchRequest WatchCreateRequest WatchCancelRequest WatchResponse LeaseGrantRequest LeaseGrantResponse LeaseRevokeRequest LeaseRevokeResponse LeaseKeepAliveRequest LeaseKeepAliveResponse LeaseTimeToLiveRequest LeaseTimeToLiveResponse LeaseLeasesRequest LeaseStatus LeaseLeasesResponse Member MemberAddRequest MemberAddResponse MemberRemoveRequest MemberRemoveResponse MemberUpdateRequest MemberUpdateResponse MemberListRequest MemberListResponse DefragmentRequest DefragmentResponse MoveLeaderRequest MoveLeaderResponse AlarmRequest AlarmMember AlarmResponse StatusRequest StatusResponse AuthEnableRequest AuthDisableRequest AuthenticateRequest AuthUserAddRequest AuthUserGetRequest AuthUserDeleteRequest AuthUserChangePasswordRequest AuthUserGrantRoleRequest AuthUserRevokeRoleRequest AuthRoleAddRequest AuthRoleGetRequest AuthUserListRequest AuthRoleListRequest AuthRoleDeleteRequest AuthRoleGrantPermissionRequest AuthRoleRevokePermissionRequest AuthEnableResponse AuthDisableResponse AuthenticateResponse AuthUserAddResponse AuthUserGetResponse AuthUserDeleteResponse AuthUserChangePasswordResponse AuthUserGrantRoleResponse AuthUserRevokeRoleResponse AuthRoleAddResponse AuthRoleGetResponse AuthRoleListResponse AuthUserListResponse AuthRoleDeleteResponse AuthRoleGrantPermissionResponse AuthRoleRevokePermissionResponse */ package etcdserverpb import ( "fmt" proto "github.com/golang/protobuf/proto" math "math" _ "github.com/gogo/protobuf/gogoproto" io "io" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Request struct { ID uint64 `protobuf:"varint,1,opt,name=ID" json:"ID"` Method string `protobuf:"bytes,2,opt,name=Method" json:"Method"` Path string `protobuf:"bytes,3,opt,name=Path" json:"Path"` Val string `protobuf:"bytes,4,opt,name=Val" json:"Val"` Dir bool `protobuf:"varint,5,opt,name=Dir" json:"Dir"` PrevValue string `protobuf:"bytes,6,opt,name=PrevValue" json:"PrevValue"` PrevIndex uint64 `protobuf:"varint,7,opt,name=PrevIndex" json:"PrevIndex"` PrevExist *bool `protobuf:"varint,8,opt,name=PrevExist" json:"PrevExist,omitempty"` Expiration int64 `protobuf:"varint,9,opt,name=Expiration" json:"Expiration"` Wait bool `protobuf:"varint,10,opt,name=Wait" json:"Wait"` Since uint64 `protobuf:"varint,11,opt,name=Since" json:"Since"` Recursive bool `protobuf:"varint,12,opt,name=Recursive" json:"Recursive"` Sorted bool `protobuf:"varint,13,opt,name=Sorted" json:"Sorted"` Quorum bool `protobuf:"varint,14,opt,name=Quorum" json:"Quorum"` Time int64 `protobuf:"varint,15,opt,name=Time" json:"Time"` Stream bool `protobuf:"varint,16,opt,name=Stream" json:"Stream"` Refresh *bool `protobuf:"varint,17,opt,name=Refresh" json:"Refresh,omitempty"` XXX_unrecognized []byte `json:"-"` } func (m *Request) Reset() { *m = Request{} } func (m *Request) String() string { return proto.CompactTextString(m) } func (*Request) ProtoMessage() {} func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorEtcdserver, []int{0} } type Metadata struct { NodeID uint64 `protobuf:"varint,1,opt,name=NodeID" json:"NodeID"` ClusterID uint64 `protobuf:"varint,2,opt,name=ClusterID" json:"ClusterID"` XXX_unrecognized []byte `json:"-"` } func (m *Metadata) Reset() { *m = Metadata{} } func (m *Metadata) String() string { return proto.CompactTextString(m) } func (*Metadata) ProtoMessage() {} func (*Metadata) Descriptor() ([]byte, []int) { return fileDescriptorEtcdserver, []int{1} } func init() { proto.RegisterType((*Request)(nil), "etcdserverpb.Request") proto.RegisterType((*Metadata)(nil), "etcdserverpb.Metadata") } func (m *Request) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Request) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l dAtA[i] = 0x8 i++ i = encodeVarintEtcdserver(dAtA, i, uint64(m.ID)) dAtA[i] = 0x12 i++ i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Method))) i += copy(dAtA[i:], m.Method) dAtA[i] = 0x1a i++ i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Path))) i += copy(dAtA[i:], m.Path) dAtA[i] = 0x22 i++ i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.Val))) i += copy(dAtA[i:], m.Val) dAtA[i] = 0x28 i++ if m.Dir { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ dAtA[i] = 0x32 i++ i = encodeVarintEtcdserver(dAtA, i, uint64(len(m.PrevValue))) i += copy(dAtA[i:], m.PrevValue) dAtA[i] = 0x38 i++ i = encodeVarintEtcdserver(dAtA, i, uint64(m.PrevIndex)) if m.PrevExist != nil { dAtA[i] = 0x40 i++ if *m.PrevExist { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } dAtA[i] = 0x48 i++ i = encodeVarintEtcdserver(dAtA, i, uint64(m.Expiration)) dAtA[i] = 0x50 i++ if m.Wait { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ dAtA[i] = 0x58 i++ i = encodeVarintEtcdserver(dAtA, i, uint64(m.Since)) dAtA[i] = 0x60 i++ if m.Recursive { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ dAtA[i] = 0x68 i++ if m.Sorted { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ dAtA[i] = 0x70 i++ if m.Quorum { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ dAtA[i] = 0x78 i++ i = encodeVarintEtcdserver(dAtA, i, uint64(m.Time)) dAtA[i] = 0x80 i++ dAtA[i] = 0x1 i++ if m.Stream { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ if m.Refresh != nil { dAtA[i] = 0x88 i++ dAtA[i] = 0x1 i++ if *m.Refresh { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } return i, nil } func (m *Metadata) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l dAtA[i] = 0x8 i++ i = encodeVarintEtcdserver(dAtA, i, uint64(m.NodeID)) dAtA[i] = 0x10 i++ i = encodeVarintEtcdserver(dAtA, i, uint64(m.ClusterID)) if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) } return i, nil } func encodeVarintEtcdserver(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return offset + 1 } func (m *Request) Size() (n int) { var l int _ = l n += 1 + sovEtcdserver(uint64(m.ID)) l = len(m.Method) n += 1 + l + sovEtcdserver(uint64(l)) l = len(m.Path) n += 1 + l + sovEtcdserver(uint64(l)) l = len(m.Val) n += 1 + l + sovEtcdserver(uint64(l)) n += 2 l = len(m.PrevValue) n += 1 + l + sovEtcdserver(uint64(l)) n += 1 + sovEtcdserver(uint64(m.PrevIndex)) if m.PrevExist != nil { n += 2 } n += 1 + sovEtcdserver(uint64(m.Expiration)) n += 2 n += 1 + sovEtcdserver(uint64(m.Since)) n += 2 n += 2 n += 2 n += 1 + sovEtcdserver(uint64(m.Time)) n += 3 if m.Refresh != nil { n += 3 } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func (m *Metadata) Size() (n int) { var l int _ = l n += 1 + sovEtcdserver(uint64(m.NodeID)) n += 1 + sovEtcdserver(uint64(m.ClusterID)) if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } func sovEtcdserver(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozEtcdserver(x uint64) (n int) { return sovEtcdserver(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *Request) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Request: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Request: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthEtcdserver } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Method = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthEtcdserver } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Path = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Val", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthEtcdserver } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Val = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Dir", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Dir = bool(v != 0) case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PrevValue", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthEtcdserver } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PrevValue = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PrevIndex", wireType) } m.PrevIndex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.PrevIndex |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PrevExist", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.PrevExist = &b case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) } m.Expiration = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Expiration |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Wait", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Wait = bool(v != 0) case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Since", wireType) } m.Since = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Since |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 12: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Recursive = bool(v != 0) case 13: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Sorted", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Sorted = bool(v != 0) case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Quorum", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Quorum = bool(v != 0) case 15: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) } m.Time = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Time |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 16: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Stream", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Stream = bool(v != 0) case 17: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Refresh", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } b := bool(v != 0) m.Refresh = &b default: iNdEx = preIndex skippy, err := skipEtcdserver(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthEtcdserver } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Metadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Metadata: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType) } m.NodeID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.NodeID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ClusterID", wireType) } m.ClusterID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEtcdserver } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ClusterID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipEtcdserver(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthEtcdserver } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipEtcdserver(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowEtcdserver } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowEtcdserver } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowEtcdserver } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthEtcdserver } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowEtcdserver } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipEtcdserver(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthEtcdserver = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowEtcdserver = fmt.Errorf("proto: integer overflow") ) func init() { proto.RegisterFile("etcdserver.proto", fileDescriptorEtcdserver) } var fileDescriptorEtcdserver = []byte{ // 380 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0xd2, 0xdd, 0x6e, 0xda, 0x30, 0x14, 0x07, 0x70, 0x0c, 0xe1, 0xcb, 0x63, 0x1b, 0xb3, 0xd0, 0x74, 0x84, 0xa6, 0x2c, 0x42, 0xbb, 0xc8, 0xd5, 0xf6, 0x0e, 0x2c, 0x5c, 0x44, 0x2a, 0x15, 0x0d, 0x15, 0xbd, 0x76, 0xc9, 0x29, 0x58, 0x02, 0x4c, 0x1d, 0x07, 0xf1, 0x06, 0x7d, 0x85, 0x3e, 0x12, 0x97, 0x7d, 0x82, 0xaa, 0xa5, 0x2f, 0x52, 0x39, 0x24, 0xc4, 0xed, 0x5d, 0xf4, 0xfb, 0x9f, 0x1c, 0x1f, 0x7f, 0xd0, 0x2e, 0xea, 0x79, 0x9c, 0xa0, 0xda, 0xa1, 0xfa, 0xbb, 0x55, 0x52, 0x4b, 0xd6, 0x29, 0x65, 0x7b, 0xdb, 0xef, 0x2d, 0xe4, 0x42, 0x66, 0xc1, 0x3f, 0xf3, 0x75, 0xaa, 0x19, 0x3c, 0x38, 0xb4, 0x19, 0xe1, 0x7d, 0x8a, 0x89, 0x66, 0x3d, 0x5a, 0x0d, 0x03, 0x20, 0x1e, 0xf1, 0x9d, 0xa1, 0x73, 0x78, 0xfe, 0x5d, 0x89, 0xaa, 0x61, 0xc0, 0x7e, 0xd1, 0xc6, 0x18, 0xf5, 0x52, 0xc6, 0x50, 0xf5, 0x88, 0xdf, 0xce, 0x93, 0xdc, 0x18, 0x50, 0x67, 0xc2, 0xf5, 0x12, 0x6a, 0x56, 0x96, 0x09, 0xfb, 0x49, 0x6b, 0x33, 0xbe, 0x02, 0xc7, 0x0a, 0x0c, 0x18, 0x0f, 0x84, 0x82, 0xba, 0x47, 0xfc, 0x56, 0xe1, 0x81, 0x50, 0x6c, 0x40, 0xdb, 0x13, 0x85, 0xbb, 0x19, 0x5f, 0xa5, 0x08, 0x0d, 0xeb, 0xaf, 0x92, 0x8b, 0x9a, 0x70, 0x13, 0xe3, 0x1e, 0x9a, 0xd6, 0xa0, 0x25, 0x17, 0x35, 0xa3, 0xbd, 0x48, 0x34, 0xb4, 0xce, 0xab, 0x90, 0xa8, 0x64, 0xf6, 0x87, 0xd2, 0xd1, 0x7e, 0x2b, 0x14, 0xd7, 0x42, 0x6e, 0xa0, 0xed, 0x11, 0xbf, 0x96, 0x37, 0xb2, 0xdc, 0xec, 0xed, 0x86, 0x0b, 0x0d, 0xd4, 0x1a, 0x35, 0x13, 0xd6, 0xa7, 0xf5, 0xa9, 0xd8, 0xcc, 0x11, 0xbe, 0x58, 0x33, 0x9c, 0xc8, 0xac, 0x1f, 0xe1, 0x3c, 0x55, 0x89, 0xd8, 0x21, 0x74, 0xac, 0x5f, 0x4b, 0x36, 0x67, 0x3a, 0x95, 0x4a, 0x63, 0x0c, 0x5f, 0xad, 0x82, 0xdc, 0x4c, 0x7a, 0x95, 0x4a, 0x95, 0xae, 0xe1, 0x9b, 0x9d, 0x9e, 0xcc, 0x4c, 0x75, 0x2d, 0xd6, 0x08, 0xdf, 0xad, 0xa9, 0x33, 0xc9, 0xba, 0x6a, 0x85, 0x7c, 0x0d, 0xdd, 0x0f, 0x5d, 0x33, 0x63, 0xae, 0xb9, 0xe8, 0x3b, 0x85, 0xc9, 0x12, 0x7e, 0x58, 0xa7, 0x52, 0xe0, 0xe0, 0x82, 0xb6, 0xc6, 0xa8, 0x79, 0xcc, 0x35, 0x37, 0x9d, 0x2e, 0x65, 0x8c, 0x9f, 0x5e, 0x43, 0x6e, 0x66, 0x87, 0xff, 0x57, 0x69, 0xa2, 0x51, 0x85, 0x41, 0xf6, 0x28, 0xce, 0xb7, 0x70, 0xe6, 0x61, 0xef, 0xf0, 0xea, 0x56, 0x0e, 0x47, 0x97, 0x3c, 0x1d, 0x5d, 0xf2, 0x72, 0x74, 0xc9, 0xe3, 0x9b, 0x5b, 0x79, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xee, 0x40, 0xba, 0xd6, 0xa4, 0x02, 0x00, 0x00, } ================================================ FILE: vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/etcdserver.proto ================================================ syntax = "proto2"; package etcdserverpb; import "gogoproto/gogo.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_getters_all) = false; message Request { optional uint64 ID = 1 [(gogoproto.nullable) = false]; optional string Method = 2 [(gogoproto.nullable) = false]; optional string Path = 3 [(gogoproto.nullable) = false]; optional string Val = 4 [(gogoproto.nullable) = false]; optional bool Dir = 5 [(gogoproto.nullable) = false]; optional string PrevValue = 6 [(gogoproto.nullable) = false]; optional uint64 PrevIndex = 7 [(gogoproto.nullable) = false]; optional bool PrevExist = 8 [(gogoproto.nullable) = true]; optional int64 Expiration = 9 [(gogoproto.nullable) = false]; optional bool Wait = 10 [(gogoproto.nullable) = false]; optional uint64 Since = 11 [(gogoproto.nullable) = false]; optional bool Recursive = 12 [(gogoproto.nullable) = false]; optional bool Sorted = 13 [(gogoproto.nullable) = false]; optional bool Quorum = 14 [(gogoproto.nullable) = false]; optional int64 Time = 15 [(gogoproto.nullable) = false]; optional bool Stream = 16 [(gogoproto.nullable) = false]; optional bool Refresh = 17 [(gogoproto.nullable) = true]; } message Metadata { optional uint64 NodeID = 1 [(gogoproto.nullable) = false]; optional uint64 ClusterID = 2 [(gogoproto.nullable) = false]; } ================================================ FILE: vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.pb.go ================================================ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: raft_internal.proto package etcdserverpb import ( "fmt" proto "github.com/golang/protobuf/proto" math "math" _ "github.com/gogo/protobuf/gogoproto" io "io" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf type RequestHeader struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // username is a username that is associated with an auth token of gRPC connection Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // auth_revision is a revision number of auth.authStore. It is not related to mvcc AuthRevision uint64 `protobuf:"varint,3,opt,name=auth_revision,json=authRevision,proto3" json:"auth_revision,omitempty"` } func (m *RequestHeader) Reset() { *m = RequestHeader{} } func (m *RequestHeader) String() string { return proto.CompactTextString(m) } func (*RequestHeader) ProtoMessage() {} func (*RequestHeader) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{0} } // An InternalRaftRequest is the union of all requests which can be // sent via raft. type InternalRaftRequest struct { Header *RequestHeader `protobuf:"bytes,100,opt,name=header" json:"header,omitempty"` ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` V2 *Request `protobuf:"bytes,2,opt,name=v2" json:"v2,omitempty"` Range *RangeRequest `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"` Put *PutRequest `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"` DeleteRange *DeleteRangeRequest `protobuf:"bytes,5,opt,name=delete_range,json=deleteRange" json:"delete_range,omitempty"` Txn *TxnRequest `protobuf:"bytes,6,opt,name=txn" json:"txn,omitempty"` Compaction *CompactionRequest `protobuf:"bytes,7,opt,name=compaction" json:"compaction,omitempty"` LeaseGrant *LeaseGrantRequest `protobuf:"bytes,8,opt,name=lease_grant,json=leaseGrant" json:"lease_grant,omitempty"` LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke,json=leaseRevoke" json:"lease_revoke,omitempty"` Alarm *AlarmRequest `protobuf:"bytes,10,opt,name=alarm" json:"alarm,omitempty"` AuthEnable *AuthEnableRequest `protobuf:"bytes,1000,opt,name=auth_enable,json=authEnable" json:"auth_enable,omitempty"` AuthDisable *AuthDisableRequest `protobuf:"bytes,1011,opt,name=auth_disable,json=authDisable" json:"auth_disable,omitempty"` Authenticate *InternalAuthenticateRequest `protobuf:"bytes,1012,opt,name=authenticate" json:"authenticate,omitempty"` AuthUserAdd *AuthUserAddRequest `protobuf:"bytes,1100,opt,name=auth_user_add,json=authUserAdd" json:"auth_user_add,omitempty"` AuthUserDelete *AuthUserDeleteRequest `protobuf:"bytes,1101,opt,name=auth_user_delete,json=authUserDelete" json:"auth_user_delete,omitempty"` AuthUserGet *AuthUserGetRequest `protobuf:"bytes,1102,opt,name=auth_user_get,json=authUserGet" json:"auth_user_get,omitempty"` AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,1103,opt,name=auth_user_change_password,json=authUserChangePassword" json:"auth_user_change_password,omitempty"` AuthUserGrantRole *AuthUserGrantRoleRequest `protobuf:"bytes,1104,opt,name=auth_user_grant_role,json=authUserGrantRole" json:"auth_user_grant_role,omitempty"` AuthUserRevokeRole *AuthUserRevokeRoleRequest `protobuf:"bytes,1105,opt,name=auth_user_revoke_role,json=authUserRevokeRole" json:"auth_user_revoke_role,omitempty"` AuthUserList *AuthUserListRequest `protobuf:"bytes,1106,opt,name=auth_user_list,json=authUserList" json:"auth_user_list,omitempty"` AuthRoleList *AuthRoleListRequest `protobuf:"bytes,1107,opt,name=auth_role_list,json=authRoleList" json:"auth_role_list,omitempty"` AuthRoleAdd *AuthRoleAddRequest `protobuf:"bytes,1200,opt,name=auth_role_add,json=authRoleAdd" json:"auth_role_add,omitempty"` AuthRoleDelete *AuthRoleDeleteRequest `protobuf:"bytes,1201,opt,name=auth_role_delete,json=authRoleDelete" json:"auth_role_delete,omitempty"` AuthRoleGet *AuthRoleGetRequest `protobuf:"bytes,1202,opt,name=auth_role_get,json=authRoleGet" json:"auth_role_get,omitempty"` AuthRoleGrantPermission *AuthRoleGrantPermissionRequest `protobuf:"bytes,1203,opt,name=auth_role_grant_permission,json=authRoleGrantPermission" json:"auth_role_grant_permission,omitempty"` AuthRoleRevokePermission *AuthRoleRevokePermissionRequest `protobuf:"bytes,1204,opt,name=auth_role_revoke_permission,json=authRoleRevokePermission" json:"auth_role_revoke_permission,omitempty"` } func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} } func (m *InternalRaftRequest) String() string { return proto.CompactTextString(m) } func (*InternalRaftRequest) ProtoMessage() {} func (*InternalRaftRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{1} } type EmptyResponse struct { } func (m *EmptyResponse) Reset() { *m = EmptyResponse{} } func (m *EmptyResponse) String() string { return proto.CompactTextString(m) } func (*EmptyResponse) ProtoMessage() {} func (*EmptyResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{2} } // What is the difference between AuthenticateRequest (defined in rpc.proto) and InternalAuthenticateRequest? // InternalAuthenticateRequest has a member that is filled by etcdserver and shouldn't be user-facing. // For avoiding misusage the field, we have an internal version of AuthenticateRequest. type InternalAuthenticateRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // simple_token is generated in API layer (etcdserver/v3_server.go) SimpleToken string `protobuf:"bytes,3,opt,name=simple_token,json=simpleToken,proto3" json:"simple_token,omitempty"` } func (m *InternalAuthenticateRequest) Reset() { *m = InternalAuthenticateRequest{} } func (m *InternalAuthenticateRequest) String() string { return proto.CompactTextString(m) } func (*InternalAuthenticateRequest) ProtoMessage() {} func (*InternalAuthenticateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftInternal, []int{3} } func init() { proto.RegisterType((*RequestHeader)(nil), "etcdserverpb.RequestHeader") proto.RegisterType((*InternalRaftRequest)(nil), "etcdserverpb.InternalRaftRequest") proto.RegisterType((*EmptyResponse)(nil), "etcdserverpb.EmptyResponse") proto.RegisterType((*InternalAuthenticateRequest)(nil), "etcdserverpb.InternalAuthenticateRequest") } func (m *RequestHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RequestHeader) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.ID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.ID)) } if len(m.Username) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Username))) i += copy(dAtA[i:], m.Username) } if m.AuthRevision != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRevision)) } return i, nil } func (m *InternalRaftRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.ID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.ID)) } if m.V2 != nil { dAtA[i] = 0x12 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.V2.Size())) n1, err := m.V2.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n1 } if m.Range != nil { dAtA[i] = 0x1a i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.Range.Size())) n2, err := m.Range.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n2 } if m.Put != nil { dAtA[i] = 0x22 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.Put.Size())) n3, err := m.Put.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n3 } if m.DeleteRange != nil { dAtA[i] = 0x2a i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.DeleteRange.Size())) n4, err := m.DeleteRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n4 } if m.Txn != nil { dAtA[i] = 0x32 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.Txn.Size())) n5, err := m.Txn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n5 } if m.Compaction != nil { dAtA[i] = 0x3a i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.Compaction.Size())) n6, err := m.Compaction.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n6 } if m.LeaseGrant != nil { dAtA[i] = 0x42 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.LeaseGrant.Size())) n7, err := m.LeaseGrant.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n7 } if m.LeaseRevoke != nil { dAtA[i] = 0x4a i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.LeaseRevoke.Size())) n8, err := m.LeaseRevoke.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n8 } if m.Alarm != nil { dAtA[i] = 0x52 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.Alarm.Size())) n9, err := m.Alarm.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n9 } if m.Header != nil { dAtA[i] = 0xa2 i++ dAtA[i] = 0x6 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.Header.Size())) n10, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n10 } if m.AuthEnable != nil { dAtA[i] = 0xc2 i++ dAtA[i] = 0x3e i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthEnable.Size())) n11, err := m.AuthEnable.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n11 } if m.AuthDisable != nil { dAtA[i] = 0x9a i++ dAtA[i] = 0x3f i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthDisable.Size())) n12, err := m.AuthDisable.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n12 } if m.Authenticate != nil { dAtA[i] = 0xa2 i++ dAtA[i] = 0x3f i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.Authenticate.Size())) n13, err := m.Authenticate.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n13 } if m.AuthUserAdd != nil { dAtA[i] = 0xe2 i++ dAtA[i] = 0x44 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserAdd.Size())) n14, err := m.AuthUserAdd.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n14 } if m.AuthUserDelete != nil { dAtA[i] = 0xea i++ dAtA[i] = 0x44 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserDelete.Size())) n15, err := m.AuthUserDelete.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n15 } if m.AuthUserGet != nil { dAtA[i] = 0xf2 i++ dAtA[i] = 0x44 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGet.Size())) n16, err := m.AuthUserGet.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n16 } if m.AuthUserChangePassword != nil { dAtA[i] = 0xfa i++ dAtA[i] = 0x44 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserChangePassword.Size())) n17, err := m.AuthUserChangePassword.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n17 } if m.AuthUserGrantRole != nil { dAtA[i] = 0x82 i++ dAtA[i] = 0x45 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGrantRole.Size())) n18, err := m.AuthUserGrantRole.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n18 } if m.AuthUserRevokeRole != nil { dAtA[i] = 0x8a i++ dAtA[i] = 0x45 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserRevokeRole.Size())) n19, err := m.AuthUserRevokeRole.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n19 } if m.AuthUserList != nil { dAtA[i] = 0x92 i++ dAtA[i] = 0x45 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserList.Size())) n20, err := m.AuthUserList.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n20 } if m.AuthRoleList != nil { dAtA[i] = 0x9a i++ dAtA[i] = 0x45 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleList.Size())) n21, err := m.AuthRoleList.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n21 } if m.AuthRoleAdd != nil { dAtA[i] = 0x82 i++ dAtA[i] = 0x4b i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleAdd.Size())) n22, err := m.AuthRoleAdd.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n22 } if m.AuthRoleDelete != nil { dAtA[i] = 0x8a i++ dAtA[i] = 0x4b i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleDelete.Size())) n23, err := m.AuthRoleDelete.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n23 } if m.AuthRoleGet != nil { dAtA[i] = 0x92 i++ dAtA[i] = 0x4b i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGet.Size())) n24, err := m.AuthRoleGet.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n24 } if m.AuthRoleGrantPermission != nil { dAtA[i] = 0x9a i++ dAtA[i] = 0x4b i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGrantPermission.Size())) n25, err := m.AuthRoleGrantPermission.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n25 } if m.AuthRoleRevokePermission != nil { dAtA[i] = 0xa2 i++ dAtA[i] = 0x4b i++ i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleRevokePermission.Size())) n26, err := m.AuthRoleRevokePermission.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n26 } return i, nil } func (m *EmptyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *EmptyResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *InternalAuthenticateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *InternalAuthenticateRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if len(m.Password) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.Password))) i += copy(dAtA[i:], m.Password) } if len(m.SimpleToken) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintRaftInternal(dAtA, i, uint64(len(m.SimpleToken))) i += copy(dAtA[i:], m.SimpleToken) } return i, nil } func encodeVarintRaftInternal(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return offset + 1 } func (m *RequestHeader) Size() (n int) { var l int _ = l if m.ID != 0 { n += 1 + sovRaftInternal(uint64(m.ID)) } l = len(m.Username) if l > 0 { n += 1 + l + sovRaftInternal(uint64(l)) } if m.AuthRevision != 0 { n += 1 + sovRaftInternal(uint64(m.AuthRevision)) } return n } func (m *InternalRaftRequest) Size() (n int) { var l int _ = l if m.ID != 0 { n += 1 + sovRaftInternal(uint64(m.ID)) } if m.V2 != nil { l = m.V2.Size() n += 1 + l + sovRaftInternal(uint64(l)) } if m.Range != nil { l = m.Range.Size() n += 1 + l + sovRaftInternal(uint64(l)) } if m.Put != nil { l = m.Put.Size() n += 1 + l + sovRaftInternal(uint64(l)) } if m.DeleteRange != nil { l = m.DeleteRange.Size() n += 1 + l + sovRaftInternal(uint64(l)) } if m.Txn != nil { l = m.Txn.Size() n += 1 + l + sovRaftInternal(uint64(l)) } if m.Compaction != nil { l = m.Compaction.Size() n += 1 + l + sovRaftInternal(uint64(l)) } if m.LeaseGrant != nil { l = m.LeaseGrant.Size() n += 1 + l + sovRaftInternal(uint64(l)) } if m.LeaseRevoke != nil { l = m.LeaseRevoke.Size() n += 1 + l + sovRaftInternal(uint64(l)) } if m.Alarm != nil { l = m.Alarm.Size() n += 1 + l + sovRaftInternal(uint64(l)) } if m.Header != nil { l = m.Header.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthEnable != nil { l = m.AuthEnable.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthDisable != nil { l = m.AuthDisable.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.Authenticate != nil { l = m.Authenticate.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthUserAdd != nil { l = m.AuthUserAdd.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthUserDelete != nil { l = m.AuthUserDelete.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthUserGet != nil { l = m.AuthUserGet.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthUserChangePassword != nil { l = m.AuthUserChangePassword.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthUserGrantRole != nil { l = m.AuthUserGrantRole.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthUserRevokeRole != nil { l = m.AuthUserRevokeRole.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthUserList != nil { l = m.AuthUserList.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthRoleList != nil { l = m.AuthRoleList.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthRoleAdd != nil { l = m.AuthRoleAdd.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthRoleDelete != nil { l = m.AuthRoleDelete.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthRoleGet != nil { l = m.AuthRoleGet.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthRoleGrantPermission != nil { l = m.AuthRoleGrantPermission.Size() n += 2 + l + sovRaftInternal(uint64(l)) } if m.AuthRoleRevokePermission != nil { l = m.AuthRoleRevokePermission.Size() n += 2 + l + sovRaftInternal(uint64(l)) } return n } func (m *EmptyResponse) Size() (n int) { var l int _ = l return n } func (m *InternalAuthenticateRequest) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRaftInternal(uint64(l)) } l = len(m.Password) if l > 0 { n += 1 + l + sovRaftInternal(uint64(l)) } l = len(m.SimpleToken) if l > 0 { n += 1 + l + sovRaftInternal(uint64(l)) } return n } func sovRaftInternal(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozRaftInternal(x uint64) (n int) { return sovRaftInternal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *RequestHeader) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RequestHeader: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RequestHeader: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Username = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AuthRevision", wireType) } m.AuthRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.AuthRevision |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRaftInternal(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRaftInternal } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: InternalRaftRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: InternalRaftRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field V2", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.V2 == nil { m.V2 = &Request{} } if err := m.V2.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Range == nil { m.Range = &RangeRequest{} } if err := m.Range.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Put", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Put == nil { m.Put = &PutRequest{} } if err := m.Put.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DeleteRange", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.DeleteRange == nil { m.DeleteRange = &DeleteRangeRequest{} } if err := m.DeleteRange.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Txn", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Txn == nil { m.Txn = &TxnRequest{} } if err := m.Txn.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Compaction", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Compaction == nil { m.Compaction = &CompactionRequest{} } if err := m.Compaction.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LeaseGrant", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.LeaseGrant == nil { m.LeaseGrant = &LeaseGrantRequest{} } if err := m.LeaseGrant.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LeaseRevoke", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.LeaseRevoke == nil { m.LeaseRevoke = &LeaseRevokeRequest{} } if err := m.LeaseRevoke.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Alarm == nil { m.Alarm = &AlarmRequest{} } if err := m.Alarm.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 100: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &RequestHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1000: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthEnable", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthEnable == nil { m.AuthEnable = &AuthEnableRequest{} } if err := m.AuthEnable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1011: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthDisable", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthDisable == nil { m.AuthDisable = &AuthDisableRequest{} } if err := m.AuthDisable.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1012: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Authenticate", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Authenticate == nil { m.Authenticate = &InternalAuthenticateRequest{} } if err := m.Authenticate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1100: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthUserAdd", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthUserAdd == nil { m.AuthUserAdd = &AuthUserAddRequest{} } if err := m.AuthUserAdd.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1101: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthUserDelete", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthUserDelete == nil { m.AuthUserDelete = &AuthUserDeleteRequest{} } if err := m.AuthUserDelete.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1102: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthUserGet", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthUserGet == nil { m.AuthUserGet = &AuthUserGetRequest{} } if err := m.AuthUserGet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1103: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthUserChangePassword", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthUserChangePassword == nil { m.AuthUserChangePassword = &AuthUserChangePasswordRequest{} } if err := m.AuthUserChangePassword.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1104: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthUserGrantRole", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthUserGrantRole == nil { m.AuthUserGrantRole = &AuthUserGrantRoleRequest{} } if err := m.AuthUserGrantRole.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1105: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthUserRevokeRole", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthUserRevokeRole == nil { m.AuthUserRevokeRole = &AuthUserRevokeRoleRequest{} } if err := m.AuthUserRevokeRole.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1106: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthUserList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthUserList == nil { m.AuthUserList = &AuthUserListRequest{} } if err := m.AuthUserList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1107: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleList", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthRoleList == nil { m.AuthRoleList = &AuthRoleListRequest{} } if err := m.AuthRoleList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1200: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleAdd", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthRoleAdd == nil { m.AuthRoleAdd = &AuthRoleAddRequest{} } if err := m.AuthRoleAdd.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1201: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleDelete", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthRoleDelete == nil { m.AuthRoleDelete = &AuthRoleDeleteRequest{} } if err := m.AuthRoleDelete.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1202: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleGet", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthRoleGet == nil { m.AuthRoleGet = &AuthRoleGetRequest{} } if err := m.AuthRoleGet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1203: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleGrantPermission", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthRoleGrantPermission == nil { m.AuthRoleGrantPermission = &AuthRoleGrantPermissionRequest{} } if err := m.AuthRoleGrantPermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 1204: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthRoleRevokePermission", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.AuthRoleRevokePermission == nil { m.AuthRoleRevokePermission = &AuthRoleRevokePermissionRequest{} } if err := m.AuthRoleRevokePermission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRaftInternal(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRaftInternal } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *EmptyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: EmptyResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: EmptyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRaftInternal(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRaftInternal } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *InternalAuthenticateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: InternalAuthenticateRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: InternalAuthenticateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Password = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SimpleToken", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRaftInternal } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRaftInternal } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.SimpleToken = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRaftInternal(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRaftInternal } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipRaftInternal(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowRaftInternal } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowRaftInternal } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowRaftInternal } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthRaftInternal } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowRaftInternal } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipRaftInternal(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthRaftInternal = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRaftInternal = fmt.Errorf("proto: integer overflow") ) func init() { proto.RegisterFile("raft_internal.proto", fileDescriptorRaftInternal) } var fileDescriptorRaftInternal = []byte{ // 837 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x96, 0xdd, 0x52, 0xd3, 0x40, 0x14, 0xc7, 0x69, 0xf9, 0xec, 0xb6, 0x54, 0x5c, 0x40, 0xd7, 0x32, 0x53, 0xa1, 0x8c, 0x8a, 0x5f, 0xe8, 0x94, 0x07, 0xd0, 0x4a, 0x19, 0x60, 0x86, 0x61, 0x98, 0x0c, 0xce, 0x38, 0xe3, 0x45, 0x5c, 0x9a, 0x43, 0x1b, 0x49, 0x93, 0xb8, 0xd9, 0x56, 0x7c, 0x13, 0x1f, 0xc3, 0xaf, 0x87, 0xe0, 0xc2, 0x0f, 0xd4, 0x17, 0x50, 0xbc, 0xf1, 0xca, 0x1b, 0x7d, 0x00, 0x67, 0x3f, 0x92, 0x34, 0x6d, 0xca, 0x5d, 0x72, 0xce, 0xff, 0xfc, 0xce, 0xd9, 0xec, 0x7f, 0xbb, 0x45, 0xb3, 0x8c, 0x1e, 0x72, 0xd3, 0x76, 0x39, 0x30, 0x97, 0x3a, 0xab, 0x3e, 0xf3, 0xb8, 0x87, 0x0b, 0xc0, 0x1b, 0x56, 0x00, 0xac, 0x0b, 0xcc, 0x3f, 0x28, 0xcd, 0x35, 0xbd, 0xa6, 0x27, 0x13, 0xf7, 0xc4, 0x93, 0xd2, 0x94, 0x66, 0x62, 0x8d, 0x8e, 0xe4, 0x98, 0xdf, 0x50, 0x8f, 0x95, 0x67, 0x68, 0xda, 0x80, 0x17, 0x1d, 0x08, 0xf8, 0x16, 0x50, 0x0b, 0x18, 0x2e, 0xa2, 0xec, 0x76, 0x9d, 0x64, 0x16, 0x33, 0x2b, 0x63, 0x46, 0x76, 0xbb, 0x8e, 0x4b, 0x68, 0xaa, 0x13, 0x88, 0x96, 0x6d, 0x20, 0xd9, 0xc5, 0xcc, 0x4a, 0xce, 0x88, 0xde, 0xf1, 0x32, 0x9a, 0xa6, 0x1d, 0xde, 0x32, 0x19, 0x74, 0xed, 0xc0, 0xf6, 0x5c, 0x32, 0x2a, 0xcb, 0x0a, 0x22, 0x68, 0xe8, 0x58, 0xe5, 0x4f, 0x11, 0xcd, 0x6e, 0xeb, 0xa9, 0x0d, 0x7a, 0xc8, 0x75, 0xbb, 0x81, 0x46, 0xd7, 0x50, 0xb6, 0x5b, 0x95, 0x2d, 0xf2, 0xd5, 0xf9, 0xd5, 0xde, 0x75, 0xad, 0xea, 0x12, 0x23, 0xdb, 0xad, 0xe2, 0xfb, 0x68, 0x9c, 0x51, 0xb7, 0x09, 0xb2, 0x57, 0xbe, 0x5a, 0xea, 0x53, 0x8a, 0x54, 0x28, 0x57, 0x42, 0x7c, 0x0b, 0x8d, 0xfa, 0x1d, 0x4e, 0xc6, 0xa4, 0x9e, 0x24, 0xf5, 0x7b, 0x9d, 0x70, 0x1e, 0x43, 0x88, 0xf0, 0x3a, 0x2a, 0x58, 0xe0, 0x00, 0x07, 0x53, 0x35, 0x19, 0x97, 0x45, 0x8b, 0xc9, 0xa2, 0xba, 0x54, 0x24, 0x5a, 0xe5, 0xad, 0x38, 0x26, 0x1a, 0xf2, 0x63, 0x97, 0x4c, 0xa4, 0x35, 0xdc, 0x3f, 0x76, 0xa3, 0x86, 0xfc, 0xd8, 0xc5, 0x0f, 0x10, 0x6a, 0x78, 0x6d, 0x9f, 0x36, 0xb8, 0xf8, 0x7e, 0x93, 0xb2, 0xe4, 0x6a, 0xb2, 0x64, 0x3d, 0xca, 0x87, 0x95, 0x3d, 0x25, 0xf8, 0x21, 0xca, 0x3b, 0x40, 0x03, 0x30, 0x9b, 0x8c, 0xba, 0x9c, 0x4c, 0xa5, 0x11, 0x76, 0x84, 0x60, 0x53, 0xe4, 0x23, 0x82, 0x13, 0x85, 0xc4, 0x9a, 0x15, 0x81, 0x41, 0xd7, 0x3b, 0x02, 0x92, 0x4b, 0x5b, 0xb3, 0x44, 0x18, 0x52, 0x10, 0xad, 0xd9, 0x89, 0x63, 0x62, 0x5b, 0xa8, 0x43, 0x59, 0x9b, 0xa0, 0xb4, 0x6d, 0xa9, 0x89, 0x54, 0xb4, 0x2d, 0x52, 0x88, 0xd7, 0xd0, 0x44, 0x4b, 0x5a, 0x8e, 0x58, 0xb2, 0x64, 0x21, 0x75, 0xcf, 0x95, 0x2b, 0x0d, 0x2d, 0xc5, 0x35, 0x94, 0x97, 0x8e, 0x03, 0x97, 0x1e, 0x38, 0x40, 0x7e, 0xa7, 0x7e, 0xb0, 0x5a, 0x87, 0xb7, 0x36, 0xa4, 0x20, 0x5a, 0x2e, 0x8d, 0x42, 0xb8, 0x8e, 0xa4, 0x3f, 0x4d, 0xcb, 0x0e, 0x24, 0xe3, 0xef, 0x64, 0xda, 0x7a, 0x05, 0xa3, 0xae, 0x14, 0xd1, 0x7a, 0x69, 0x1c, 0xc3, 0xbb, 0x8a, 0x02, 0x2e, 0xb7, 0x1b, 0x94, 0x03, 0xf9, 0xa7, 0x28, 0x37, 0x93, 0x94, 0xd0, 0xf7, 0xb5, 0x1e, 0x69, 0x88, 0x4b, 0xd4, 0xe3, 0x0d, 0x7d, 0x94, 0xc4, 0xd9, 0x32, 0xa9, 0x65, 0x91, 0x8f, 0x53, 0xc3, 0xc6, 0x7a, 0x1c, 0x00, 0xab, 0x59, 0x56, 0x62, 0x2c, 0x1d, 0xc3, 0xbb, 0x68, 0x26, 0xc6, 0x28, 0x4f, 0x92, 0x4f, 0x8a, 0xb4, 0x9c, 0x4e, 0xd2, 0x66, 0xd6, 0xb0, 0x22, 0x4d, 0x84, 0x93, 0x63, 0x35, 0x81, 0x93, 0xcf, 0xe7, 0x8e, 0xb5, 0x09, 0x7c, 0x60, 0xac, 0x4d, 0xe0, 0xb8, 0x89, 0xae, 0xc4, 0x98, 0x46, 0x4b, 0x9c, 0x12, 0xd3, 0xa7, 0x41, 0xf0, 0xd2, 0x63, 0x16, 0xf9, 0xa2, 0x90, 0xb7, 0xd3, 0x91, 0xeb, 0x52, 0xbd, 0xa7, 0xc5, 0x21, 0xfd, 0x12, 0x4d, 0x4d, 0xe3, 0x27, 0x68, 0xae, 0x67, 0x5e, 0x61, 0x6f, 0x93, 0x79, 0x0e, 0x90, 0x53, 0xd5, 0xe3, 0xfa, 0x90, 0xb1, 0xe5, 0xd1, 0xf0, 0xe2, 0xad, 0xbe, 0x48, 0xfb, 0x33, 0xf8, 0x29, 0x9a, 0x8f, 0xc9, 0xea, 0xa4, 0x28, 0xf4, 0x57, 0x85, 0xbe, 0x91, 0x8e, 0xd6, 0x47, 0xa6, 0x87, 0x8d, 0xe9, 0x40, 0x0a, 0x6f, 0xa1, 0x62, 0x0c, 0x77, 0xec, 0x80, 0x93, 0x6f, 0x8a, 0xba, 0x94, 0x4e, 0xdd, 0xb1, 0x03, 0x9e, 0xf0, 0x51, 0x18, 0x8c, 0x48, 0x62, 0x34, 0x45, 0xfa, 0x3e, 0x94, 0x24, 0x5a, 0x0f, 0x90, 0xc2, 0x60, 0xb4, 0xf5, 0x92, 0x24, 0x1c, 0xf9, 0x26, 0x37, 0x6c, 0xeb, 0x45, 0x4d, 0xbf, 0x23, 0x75, 0x2c, 0x72, 0xa4, 0xc4, 0x68, 0x47, 0xbe, 0xcd, 0x0d, 0x73, 0xa4, 0xa8, 0x4a, 0x71, 0x64, 0x1c, 0x4e, 0x8e, 0x25, 0x1c, 0xf9, 0xee, 0xdc, 0xb1, 0xfa, 0x1d, 0xa9, 0x63, 0xf8, 0x39, 0x2a, 0xf5, 0x60, 0xa4, 0x51, 0x7c, 0x60, 0x6d, 0x3b, 0x90, 0xf7, 0xd8, 0x7b, 0xc5, 0xbc, 0x33, 0x84, 0x29, 0xe4, 0x7b, 0x91, 0x3a, 0xe4, 0x5f, 0xa6, 0xe9, 0x79, 0xdc, 0x46, 0x0b, 0x71, 0x2f, 0x6d, 0x9d, 0x9e, 0x66, 0x1f, 0x54, 0xb3, 0xbb, 0xe9, 0xcd, 0x94, 0x4b, 0x06, 0xbb, 0x11, 0x3a, 0x44, 0x50, 0xb9, 0x80, 0xa6, 0x37, 0xda, 0x3e, 0x7f, 0x65, 0x40, 0xe0, 0x7b, 0x6e, 0x00, 0x15, 0x1f, 0x2d, 0x9c, 0xf3, 0x43, 0x84, 0x31, 0x1a, 0x93, 0xb7, 0x7b, 0x46, 0xde, 0xee, 0xf2, 0x59, 0xdc, 0xfa, 0xd1, 0xf9, 0xd4, 0xb7, 0x7e, 0xf8, 0x8e, 0x97, 0x50, 0x21, 0xb0, 0xdb, 0xbe, 0x03, 0x26, 0xf7, 0x8e, 0x40, 0x5d, 0xfa, 0x39, 0x23, 0xaf, 0x62, 0xfb, 0x22, 0xf4, 0x68, 0xee, 0xe4, 0x67, 0x79, 0xe4, 0xe4, 0xac, 0x9c, 0x39, 0x3d, 0x2b, 0x67, 0x7e, 0x9c, 0x95, 0x33, 0xaf, 0x7f, 0x95, 0x47, 0x0e, 0x26, 0xe4, 0x5f, 0x8e, 0xb5, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xc9, 0xfc, 0x0e, 0xca, 0x08, 0x00, 0x00, } ================================================ FILE: vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal.proto ================================================ syntax = "proto3"; package etcdserverpb; import "gogoproto/gogo.proto"; import "etcdserver.proto"; import "rpc.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_getters_all) = false; message RequestHeader { uint64 ID = 1; // username is a username that is associated with an auth token of gRPC connection string username = 2; // auth_revision is a revision number of auth.authStore. It is not related to mvcc uint64 auth_revision = 3; } // An InternalRaftRequest is the union of all requests which can be // sent via raft. message InternalRaftRequest { RequestHeader header = 100; uint64 ID = 1; Request v2 = 2; RangeRequest range = 3; PutRequest put = 4; DeleteRangeRequest delete_range = 5; TxnRequest txn = 6; CompactionRequest compaction = 7; LeaseGrantRequest lease_grant = 8; LeaseRevokeRequest lease_revoke = 9; AlarmRequest alarm = 10; AuthEnableRequest auth_enable = 1000; AuthDisableRequest auth_disable = 1011; InternalAuthenticateRequest authenticate = 1012; AuthUserAddRequest auth_user_add = 1100; AuthUserDeleteRequest auth_user_delete = 1101; AuthUserGetRequest auth_user_get = 1102; AuthUserChangePasswordRequest auth_user_change_password = 1103; AuthUserGrantRoleRequest auth_user_grant_role = 1104; AuthUserRevokeRoleRequest auth_user_revoke_role = 1105; AuthUserListRequest auth_user_list = 1106; AuthRoleListRequest auth_role_list = 1107; AuthRoleAddRequest auth_role_add = 1200; AuthRoleDeleteRequest auth_role_delete = 1201; AuthRoleGetRequest auth_role_get = 1202; AuthRoleGrantPermissionRequest auth_role_grant_permission = 1203; AuthRoleRevokePermissionRequest auth_role_revoke_permission = 1204; } message EmptyResponse { } // What is the difference between AuthenticateRequest (defined in rpc.proto) and InternalAuthenticateRequest? // InternalAuthenticateRequest has a member that is filled by etcdserver and shouldn't be user-facing. // For avoiding misusage the field, we have an internal version of AuthenticateRequest. message InternalAuthenticateRequest { string name = 1; string password = 2; // simple_token is generated in API layer (etcdserver/v3_server.go) string simple_token = 3; } ================================================ FILE: vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/raft_internal_stringer.go ================================================ // Copyright 2018 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package etcdserverpb import ( "fmt" "strings" proto "github.com/golang/protobuf/proto" ) // InternalRaftStringer implements custom proto Stringer: // redact password, replace value fields with value_size fields. type InternalRaftStringer struct { Request *InternalRaftRequest } func (as *InternalRaftStringer) String() string { switch { case as.Request.LeaseGrant != nil: return fmt.Sprintf("header:<%s> lease_grant:", as.Request.Header.String(), as.Request.LeaseGrant.TTL, as.Request.LeaseGrant.ID, ) case as.Request.LeaseRevoke != nil: return fmt.Sprintf("header:<%s> lease_revoke:", as.Request.Header.String(), as.Request.LeaseRevoke.ID, ) case as.Request.Authenticate != nil: return fmt.Sprintf("header:<%s> authenticate:", as.Request.Header.String(), as.Request.Authenticate.Name, as.Request.Authenticate.SimpleToken, ) case as.Request.AuthUserAdd != nil: return fmt.Sprintf("header:<%s> auth_user_add:", as.Request.Header.String(), as.Request.AuthUserAdd.Name, ) case as.Request.AuthUserChangePassword != nil: return fmt.Sprintf("header:<%s> auth_user_change_password:", as.Request.Header.String(), as.Request.AuthUserChangePassword.Name, ) case as.Request.Put != nil: return fmt.Sprintf("header:<%s> put:<%s>", as.Request.Header.String(), NewLoggablePutRequest(as.Request.Put).String(), ) case as.Request.Txn != nil: return fmt.Sprintf("header:<%s> txn:<%s>", as.Request.Header.String(), NewLoggableTxnRequest(as.Request.Txn).String(), ) default: // nothing to redact } return as.Request.String() } // txnRequestStringer implements a custom proto String to replace value bytes fields with value size // fields in any nested txn and put operations. type txnRequestStringer struct { Request *TxnRequest } func NewLoggableTxnRequest(request *TxnRequest) *txnRequestStringer { return &txnRequestStringer{request} } func (as *txnRequestStringer) String() string { var compare []string for _, c := range as.Request.Compare { switch cv := c.TargetUnion.(type) { case *Compare_Value: compare = append(compare, newLoggableValueCompare(c, cv).String()) default: // nothing to redact compare = append(compare, c.String()) } } var success []string for _, s := range as.Request.Success { success = append(success, newLoggableRequestOp(s).String()) } var failure []string for _, f := range as.Request.Failure { failure = append(failure, newLoggableRequestOp(f).String()) } return fmt.Sprintf("compare:<%s> success:<%s> failure:<%s>", strings.Join(compare, " "), strings.Join(success, " "), strings.Join(failure, " "), ) } // requestOpStringer implements a custom proto String to replace value bytes fields with value // size fields in any nested txn and put operations. type requestOpStringer struct { Op *RequestOp } func newLoggableRequestOp(op *RequestOp) *requestOpStringer { return &requestOpStringer{op} } func (as *requestOpStringer) String() string { switch op := as.Op.Request.(type) { case *RequestOp_RequestPut: return fmt.Sprintf("request_put:<%s>", NewLoggablePutRequest(op.RequestPut).String()) case *RequestOp_RequestTxn: return fmt.Sprintf("request_txn:<%s>", NewLoggableTxnRequest(op.RequestTxn).String()) default: // nothing to redact } return as.Op.String() } // loggableValueCompare implements a custom proto String for Compare.Value union member types to // replace the value bytes field with a value size field. // To preserve proto encoding of the key and range_end bytes, a faked out proto type is used here. type loggableValueCompare struct { Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult"` Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget"` Key []byte `protobuf:"bytes,3,opt,name=key,proto3"` ValueSize int `protobuf:"bytes,7,opt,name=value_size,proto3"` RangeEnd []byte `protobuf:"bytes,64,opt,name=range_end,proto3"` } func newLoggableValueCompare(c *Compare, cv *Compare_Value) *loggableValueCompare { return &loggableValueCompare{ c.Result, c.Target, c.Key, len(cv.Value), c.RangeEnd, } } func (m *loggableValueCompare) Reset() { *m = loggableValueCompare{} } func (m *loggableValueCompare) String() string { return proto.CompactTextString(m) } func (*loggableValueCompare) ProtoMessage() {} // loggablePutRequest implements a custom proto String to replace value bytes field with a value // size field. // To preserve proto encoding of the key bytes, a faked out proto type is used here. type loggablePutRequest struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3"` ValueSize int `protobuf:"varint,2,opt,name=value_size,proto3"` Lease int64 `protobuf:"varint,3,opt,name=lease,proto3"` PrevKv bool `protobuf:"varint,4,opt,name=prev_kv,proto3"` IgnoreValue bool `protobuf:"varint,5,opt,name=ignore_value,proto3"` IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,proto3"` } func NewLoggablePutRequest(request *PutRequest) *loggablePutRequest { return &loggablePutRequest{ request.Key, len(request.Value), request.Lease, request.PrevKv, request.IgnoreValue, request.IgnoreLease, } } func (m *loggablePutRequest) Reset() { *m = loggablePutRequest{} } func (m *loggablePutRequest) String() string { return proto.CompactTextString(m) } func (*loggablePutRequest) ProtoMessage() {} ================================================ FILE: vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go ================================================ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: rpc.proto package etcdserverpb import ( "fmt" proto "github.com/golang/protobuf/proto" math "math" _ "github.com/gogo/protobuf/gogoproto" mvccpb "github.com/coreos/etcd/mvcc/mvccpb" authpb "github.com/coreos/etcd/auth/authpb" context "golang.org/x/net/context" grpc "google.golang.org/grpc" io "io" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf type AlarmType int32 const ( AlarmType_NONE AlarmType = 0 AlarmType_NOSPACE AlarmType = 1 AlarmType_CORRUPT AlarmType = 2 ) var AlarmType_name = map[int32]string{ 0: "NONE", 1: "NOSPACE", 2: "CORRUPT", } var AlarmType_value = map[string]int32{ "NONE": 0, "NOSPACE": 1, "CORRUPT": 2, } func (x AlarmType) String() string { return proto.EnumName(AlarmType_name, int32(x)) } func (AlarmType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{0} } type RangeRequest_SortOrder int32 const ( RangeRequest_NONE RangeRequest_SortOrder = 0 RangeRequest_ASCEND RangeRequest_SortOrder = 1 RangeRequest_DESCEND RangeRequest_SortOrder = 2 ) var RangeRequest_SortOrder_name = map[int32]string{ 0: "NONE", 1: "ASCEND", 2: "DESCEND", } var RangeRequest_SortOrder_value = map[string]int32{ "NONE": 0, "ASCEND": 1, "DESCEND": 2, } func (x RangeRequest_SortOrder) String() string { return proto.EnumName(RangeRequest_SortOrder_name, int32(x)) } func (RangeRequest_SortOrder) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1, 0} } type RangeRequest_SortTarget int32 const ( RangeRequest_KEY RangeRequest_SortTarget = 0 RangeRequest_VERSION RangeRequest_SortTarget = 1 RangeRequest_CREATE RangeRequest_SortTarget = 2 RangeRequest_MOD RangeRequest_SortTarget = 3 RangeRequest_VALUE RangeRequest_SortTarget = 4 ) var RangeRequest_SortTarget_name = map[int32]string{ 0: "KEY", 1: "VERSION", 2: "CREATE", 3: "MOD", 4: "VALUE", } var RangeRequest_SortTarget_value = map[string]int32{ "KEY": 0, "VERSION": 1, "CREATE": 2, "MOD": 3, "VALUE": 4, } func (x RangeRequest_SortTarget) String() string { return proto.EnumName(RangeRequest_SortTarget_name, int32(x)) } func (RangeRequest_SortTarget) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1, 1} } type Compare_CompareResult int32 const ( Compare_EQUAL Compare_CompareResult = 0 Compare_GREATER Compare_CompareResult = 1 Compare_LESS Compare_CompareResult = 2 Compare_NOT_EQUAL Compare_CompareResult = 3 ) var Compare_CompareResult_name = map[int32]string{ 0: "EQUAL", 1: "GREATER", 2: "LESS", 3: "NOT_EQUAL", } var Compare_CompareResult_value = map[string]int32{ "EQUAL": 0, "GREATER": 1, "LESS": 2, "NOT_EQUAL": 3, } func (x Compare_CompareResult) String() string { return proto.EnumName(Compare_CompareResult_name, int32(x)) } func (Compare_CompareResult) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9, 0} } type Compare_CompareTarget int32 const ( Compare_VERSION Compare_CompareTarget = 0 Compare_CREATE Compare_CompareTarget = 1 Compare_MOD Compare_CompareTarget = 2 Compare_VALUE Compare_CompareTarget = 3 Compare_LEASE Compare_CompareTarget = 4 ) var Compare_CompareTarget_name = map[int32]string{ 0: "VERSION", 1: "CREATE", 2: "MOD", 3: "VALUE", 4: "LEASE", } var Compare_CompareTarget_value = map[string]int32{ "VERSION": 0, "CREATE": 1, "MOD": 2, "VALUE": 3, "LEASE": 4, } func (x Compare_CompareTarget) String() string { return proto.EnumName(Compare_CompareTarget_name, int32(x)) } func (Compare_CompareTarget) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9, 1} } type WatchCreateRequest_FilterType int32 const ( // filter out put event. WatchCreateRequest_NOPUT WatchCreateRequest_FilterType = 0 // filter out delete event. WatchCreateRequest_NODELETE WatchCreateRequest_FilterType = 1 ) var WatchCreateRequest_FilterType_name = map[int32]string{ 0: "NOPUT", 1: "NODELETE", } var WatchCreateRequest_FilterType_value = map[string]int32{ "NOPUT": 0, "NODELETE": 1, } func (x WatchCreateRequest_FilterType) String() string { return proto.EnumName(WatchCreateRequest_FilterType_name, int32(x)) } func (WatchCreateRequest_FilterType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{21, 0} } type AlarmRequest_AlarmAction int32 const ( AlarmRequest_GET AlarmRequest_AlarmAction = 0 AlarmRequest_ACTIVATE AlarmRequest_AlarmAction = 1 AlarmRequest_DEACTIVATE AlarmRequest_AlarmAction = 2 ) var AlarmRequest_AlarmAction_name = map[int32]string{ 0: "GET", 1: "ACTIVATE", 2: "DEACTIVATE", } var AlarmRequest_AlarmAction_value = map[string]int32{ "GET": 0, "ACTIVATE": 1, "DEACTIVATE": 2, } func (x AlarmRequest_AlarmAction) String() string { return proto.EnumName(AlarmRequest_AlarmAction_name, int32(x)) } func (AlarmRequest_AlarmAction) EnumDescriptor() ([]byte, []int) { return fileDescriptorRpc, []int{48, 0} } type ResponseHeader struct { // cluster_id is the ID of the cluster which sent the response. ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` // member_id is the ID of the member which sent the response. MemberId uint64 `protobuf:"varint,2,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"` // revision is the key-value store revision when the request was applied. Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"` // raft_term is the raft term when the request was applied. RaftTerm uint64 `protobuf:"varint,4,opt,name=raft_term,json=raftTerm,proto3" json:"raft_term,omitempty"` } func (m *ResponseHeader) Reset() { *m = ResponseHeader{} } func (m *ResponseHeader) String() string { return proto.CompactTextString(m) } func (*ResponseHeader) ProtoMessage() {} func (*ResponseHeader) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{0} } func (m *ResponseHeader) GetClusterId() uint64 { if m != nil { return m.ClusterId } return 0 } func (m *ResponseHeader) GetMemberId() uint64 { if m != nil { return m.MemberId } return 0 } func (m *ResponseHeader) GetRevision() int64 { if m != nil { return m.Revision } return 0 } func (m *ResponseHeader) GetRaftTerm() uint64 { if m != nil { return m.RaftTerm } return 0 } type RangeRequest struct { // key is the first key for the range. If range_end is not given, the request only looks up key. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // range_end is the upper bound on the requested range [key, range_end). // If range_end is '\0', the range is all keys >= key. // If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), // then the range request gets all keys prefixed with key. // If both key and range_end are '\0', then the range request returns all keys. RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` // limit is a limit on the number of keys returned for the request. When limit is set to 0, // it is treated as no limit. Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` // revision is the point-in-time of the key-value store to use for the range. // If revision is less or equal to zero, the range is over the newest key-value store. // If the revision has been compacted, ErrCompacted is returned as a response. Revision int64 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"` // sort_order is the order for returned sorted results. SortOrder RangeRequest_SortOrder `protobuf:"varint,5,opt,name=sort_order,json=sortOrder,proto3,enum=etcdserverpb.RangeRequest_SortOrder" json:"sort_order,omitempty"` // sort_target is the key-value field to use for sorting. SortTarget RangeRequest_SortTarget `protobuf:"varint,6,opt,name=sort_target,json=sortTarget,proto3,enum=etcdserverpb.RangeRequest_SortTarget" json:"sort_target,omitempty"` // serializable sets the range request to use serializable member-local reads. // Range requests are linearizable by default; linearizable requests have higher // latency and lower throughput than serializable requests but reflect the current // consensus of the cluster. For better performance, in exchange for possible stale reads, // a serializable range request is served locally without needing to reach consensus // with other nodes in the cluster. Serializable bool `protobuf:"varint,7,opt,name=serializable,proto3" json:"serializable,omitempty"` // keys_only when set returns only the keys and not the values. KeysOnly bool `protobuf:"varint,8,opt,name=keys_only,json=keysOnly,proto3" json:"keys_only,omitempty"` // count_only when set returns only the count of the keys in the range. CountOnly bool `protobuf:"varint,9,opt,name=count_only,json=countOnly,proto3" json:"count_only,omitempty"` // min_mod_revision is the lower bound for returned key mod revisions; all keys with // lesser mod revisions will be filtered away. MinModRevision int64 `protobuf:"varint,10,opt,name=min_mod_revision,json=minModRevision,proto3" json:"min_mod_revision,omitempty"` // max_mod_revision is the upper bound for returned key mod revisions; all keys with // greater mod revisions will be filtered away. MaxModRevision int64 `protobuf:"varint,11,opt,name=max_mod_revision,json=maxModRevision,proto3" json:"max_mod_revision,omitempty"` // min_create_revision is the lower bound for returned key create revisions; all keys with // lesser create trevisions will be filtered away. MinCreateRevision int64 `protobuf:"varint,12,opt,name=min_create_revision,json=minCreateRevision,proto3" json:"min_create_revision,omitempty"` // max_create_revision is the upper bound for returned key create revisions; all keys with // greater create revisions will be filtered away. MaxCreateRevision int64 `protobuf:"varint,13,opt,name=max_create_revision,json=maxCreateRevision,proto3" json:"max_create_revision,omitempty"` } func (m *RangeRequest) Reset() { *m = RangeRequest{} } func (m *RangeRequest) String() string { return proto.CompactTextString(m) } func (*RangeRequest) ProtoMessage() {} func (*RangeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{1} } func (m *RangeRequest) GetKey() []byte { if m != nil { return m.Key } return nil } func (m *RangeRequest) GetRangeEnd() []byte { if m != nil { return m.RangeEnd } return nil } func (m *RangeRequest) GetLimit() int64 { if m != nil { return m.Limit } return 0 } func (m *RangeRequest) GetRevision() int64 { if m != nil { return m.Revision } return 0 } func (m *RangeRequest) GetSortOrder() RangeRequest_SortOrder { if m != nil { return m.SortOrder } return RangeRequest_NONE } func (m *RangeRequest) GetSortTarget() RangeRequest_SortTarget { if m != nil { return m.SortTarget } return RangeRequest_KEY } func (m *RangeRequest) GetSerializable() bool { if m != nil { return m.Serializable } return false } func (m *RangeRequest) GetKeysOnly() bool { if m != nil { return m.KeysOnly } return false } func (m *RangeRequest) GetCountOnly() bool { if m != nil { return m.CountOnly } return false } func (m *RangeRequest) GetMinModRevision() int64 { if m != nil { return m.MinModRevision } return 0 } func (m *RangeRequest) GetMaxModRevision() int64 { if m != nil { return m.MaxModRevision } return 0 } func (m *RangeRequest) GetMinCreateRevision() int64 { if m != nil { return m.MinCreateRevision } return 0 } func (m *RangeRequest) GetMaxCreateRevision() int64 { if m != nil { return m.MaxCreateRevision } return 0 } type RangeResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // kvs is the list of key-value pairs matched by the range request. // kvs is empty when count is requested. Kvs []*mvccpb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"` // more indicates if there are more keys to return in the requested range. More bool `protobuf:"varint,3,opt,name=more,proto3" json:"more,omitempty"` // count is set to the number of keys within the range when requested. Count int64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` } func (m *RangeResponse) Reset() { *m = RangeResponse{} } func (m *RangeResponse) String() string { return proto.CompactTextString(m) } func (*RangeResponse) ProtoMessage() {} func (*RangeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{2} } func (m *RangeResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *RangeResponse) GetKvs() []*mvccpb.KeyValue { if m != nil { return m.Kvs } return nil } func (m *RangeResponse) GetMore() bool { if m != nil { return m.More } return false } func (m *RangeResponse) GetCount() int64 { if m != nil { return m.Count } return 0 } type PutRequest struct { // key is the key, in bytes, to put into the key-value store. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // value is the value, in bytes, to associate with the key in the key-value store. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // lease is the lease ID to associate with the key in the key-value store. A lease // value of 0 indicates no lease. Lease int64 `protobuf:"varint,3,opt,name=lease,proto3" json:"lease,omitempty"` // If prev_kv is set, etcd gets the previous key-value pair before changing it. // The previous key-value pair will be returned in the put response. PrevKv bool `protobuf:"varint,4,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` // If ignore_value is set, etcd updates the key using its current value. // Returns an error if the key does not exist. IgnoreValue bool `protobuf:"varint,5,opt,name=ignore_value,json=ignoreValue,proto3" json:"ignore_value,omitempty"` // If ignore_lease is set, etcd updates the key using its current lease. // Returns an error if the key does not exist. IgnoreLease bool `protobuf:"varint,6,opt,name=ignore_lease,json=ignoreLease,proto3" json:"ignore_lease,omitempty"` } func (m *PutRequest) Reset() { *m = PutRequest{} } func (m *PutRequest) String() string { return proto.CompactTextString(m) } func (*PutRequest) ProtoMessage() {} func (*PutRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{3} } func (m *PutRequest) GetKey() []byte { if m != nil { return m.Key } return nil } func (m *PutRequest) GetValue() []byte { if m != nil { return m.Value } return nil } func (m *PutRequest) GetLease() int64 { if m != nil { return m.Lease } return 0 } func (m *PutRequest) GetPrevKv() bool { if m != nil { return m.PrevKv } return false } func (m *PutRequest) GetIgnoreValue() bool { if m != nil { return m.IgnoreValue } return false } func (m *PutRequest) GetIgnoreLease() bool { if m != nil { return m.IgnoreLease } return false } type PutResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // if prev_kv is set in the request, the previous key-value pair will be returned. PrevKv *mvccpb.KeyValue `protobuf:"bytes,2,opt,name=prev_kv,json=prevKv" json:"prev_kv,omitempty"` } func (m *PutResponse) Reset() { *m = PutResponse{} } func (m *PutResponse) String() string { return proto.CompactTextString(m) } func (*PutResponse) ProtoMessage() {} func (*PutResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{4} } func (m *PutResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *PutResponse) GetPrevKv() *mvccpb.KeyValue { if m != nil { return m.PrevKv } return nil } type DeleteRangeRequest struct { // key is the first key to delete in the range. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // range_end is the key following the last key to delete for the range [key, range_end). // If range_end is not given, the range is defined to contain only the key argument. // If range_end is one bit larger than the given key, then the range is all the keys // with the prefix (the given key). // If range_end is '\0', the range is all keys greater than or equal to the key argument. RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` // If prev_kv is set, etcd gets the previous key-value pairs before deleting it. // The previous key-value pairs will be returned in the delete response. PrevKv bool `protobuf:"varint,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` } func (m *DeleteRangeRequest) Reset() { *m = DeleteRangeRequest{} } func (m *DeleteRangeRequest) String() string { return proto.CompactTextString(m) } func (*DeleteRangeRequest) ProtoMessage() {} func (*DeleteRangeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{5} } func (m *DeleteRangeRequest) GetKey() []byte { if m != nil { return m.Key } return nil } func (m *DeleteRangeRequest) GetRangeEnd() []byte { if m != nil { return m.RangeEnd } return nil } func (m *DeleteRangeRequest) GetPrevKv() bool { if m != nil { return m.PrevKv } return false } type DeleteRangeResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // deleted is the number of keys deleted by the delete range request. Deleted int64 `protobuf:"varint,2,opt,name=deleted,proto3" json:"deleted,omitempty"` // if prev_kv is set in the request, the previous key-value pairs will be returned. PrevKvs []*mvccpb.KeyValue `protobuf:"bytes,3,rep,name=prev_kvs,json=prevKvs" json:"prev_kvs,omitempty"` } func (m *DeleteRangeResponse) Reset() { *m = DeleteRangeResponse{} } func (m *DeleteRangeResponse) String() string { return proto.CompactTextString(m) } func (*DeleteRangeResponse) ProtoMessage() {} func (*DeleteRangeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{6} } func (m *DeleteRangeResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *DeleteRangeResponse) GetDeleted() int64 { if m != nil { return m.Deleted } return 0 } func (m *DeleteRangeResponse) GetPrevKvs() []*mvccpb.KeyValue { if m != nil { return m.PrevKvs } return nil } type RequestOp struct { // request is a union of request types accepted by a transaction. // // Types that are valid to be assigned to Request: // *RequestOp_RequestRange // *RequestOp_RequestPut // *RequestOp_RequestDeleteRange // *RequestOp_RequestTxn Request isRequestOp_Request `protobuf_oneof:"request"` } func (m *RequestOp) Reset() { *m = RequestOp{} } func (m *RequestOp) String() string { return proto.CompactTextString(m) } func (*RequestOp) ProtoMessage() {} func (*RequestOp) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{7} } type isRequestOp_Request interface { isRequestOp_Request() MarshalTo([]byte) (int, error) Size() int } type RequestOp_RequestRange struct { RequestRange *RangeRequest `protobuf:"bytes,1,opt,name=request_range,json=requestRange,oneof"` } type RequestOp_RequestPut struct { RequestPut *PutRequest `protobuf:"bytes,2,opt,name=request_put,json=requestPut,oneof"` } type RequestOp_RequestDeleteRange struct { RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range,json=requestDeleteRange,oneof"` } type RequestOp_RequestTxn struct { RequestTxn *TxnRequest `protobuf:"bytes,4,opt,name=request_txn,json=requestTxn,oneof"` } func (*RequestOp_RequestRange) isRequestOp_Request() {} func (*RequestOp_RequestPut) isRequestOp_Request() {} func (*RequestOp_RequestDeleteRange) isRequestOp_Request() {} func (*RequestOp_RequestTxn) isRequestOp_Request() {} func (m *RequestOp) GetRequest() isRequestOp_Request { if m != nil { return m.Request } return nil } func (m *RequestOp) GetRequestRange() *RangeRequest { if x, ok := m.GetRequest().(*RequestOp_RequestRange); ok { return x.RequestRange } return nil } func (m *RequestOp) GetRequestPut() *PutRequest { if x, ok := m.GetRequest().(*RequestOp_RequestPut); ok { return x.RequestPut } return nil } func (m *RequestOp) GetRequestDeleteRange() *DeleteRangeRequest { if x, ok := m.GetRequest().(*RequestOp_RequestDeleteRange); ok { return x.RequestDeleteRange } return nil } func (m *RequestOp) GetRequestTxn() *TxnRequest { if x, ok := m.GetRequest().(*RequestOp_RequestTxn); ok { return x.RequestTxn } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*RequestOp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _RequestOp_OneofMarshaler, _RequestOp_OneofUnmarshaler, _RequestOp_OneofSizer, []interface{}{ (*RequestOp_RequestRange)(nil), (*RequestOp_RequestPut)(nil), (*RequestOp_RequestDeleteRange)(nil), (*RequestOp_RequestTxn)(nil), } } func _RequestOp_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*RequestOp) // request switch x := m.Request.(type) { case *RequestOp_RequestRange: _ = b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.RequestRange); err != nil { return err } case *RequestOp_RequestPut: _ = b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.RequestPut); err != nil { return err } case *RequestOp_RequestDeleteRange: _ = b.EncodeVarint(3<<3 | proto.WireBytes) if err := b.EncodeMessage(x.RequestDeleteRange); err != nil { return err } case *RequestOp_RequestTxn: _ = b.EncodeVarint(4<<3 | proto.WireBytes) if err := b.EncodeMessage(x.RequestTxn); err != nil { return err } case nil: default: return fmt.Errorf("RequestOp.Request has unexpected type %T", x) } return nil } func _RequestOp_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*RequestOp) switch tag { case 1: // request.request_range if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(RangeRequest) err := b.DecodeMessage(msg) m.Request = &RequestOp_RequestRange{msg} return true, err case 2: // request.request_put if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(PutRequest) err := b.DecodeMessage(msg) m.Request = &RequestOp_RequestPut{msg} return true, err case 3: // request.request_delete_range if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(DeleteRangeRequest) err := b.DecodeMessage(msg) m.Request = &RequestOp_RequestDeleteRange{msg} return true, err case 4: // request.request_txn if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(TxnRequest) err := b.DecodeMessage(msg) m.Request = &RequestOp_RequestTxn{msg} return true, err default: return false, nil } } func _RequestOp_OneofSizer(msg proto.Message) (n int) { m := msg.(*RequestOp) // request switch x := m.Request.(type) { case *RequestOp_RequestRange: s := proto.Size(x.RequestRange) n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *RequestOp_RequestPut: s := proto.Size(x.RequestPut) n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *RequestOp_RequestDeleteRange: s := proto.Size(x.RequestDeleteRange) n += proto.SizeVarint(3<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *RequestOp_RequestTxn: s := proto.Size(x.RequestTxn) n += proto.SizeVarint(4<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } type ResponseOp struct { // response is a union of response types returned by a transaction. // // Types that are valid to be assigned to Response: // *ResponseOp_ResponseRange // *ResponseOp_ResponsePut // *ResponseOp_ResponseDeleteRange // *ResponseOp_ResponseTxn Response isResponseOp_Response `protobuf_oneof:"response"` } func (m *ResponseOp) Reset() { *m = ResponseOp{} } func (m *ResponseOp) String() string { return proto.CompactTextString(m) } func (*ResponseOp) ProtoMessage() {} func (*ResponseOp) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{8} } type isResponseOp_Response interface { isResponseOp_Response() MarshalTo([]byte) (int, error) Size() int } type ResponseOp_ResponseRange struct { ResponseRange *RangeResponse `protobuf:"bytes,1,opt,name=response_range,json=responseRange,oneof"` } type ResponseOp_ResponsePut struct { ResponsePut *PutResponse `protobuf:"bytes,2,opt,name=response_put,json=responsePut,oneof"` } type ResponseOp_ResponseDeleteRange struct { ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range,json=responseDeleteRange,oneof"` } type ResponseOp_ResponseTxn struct { ResponseTxn *TxnResponse `protobuf:"bytes,4,opt,name=response_txn,json=responseTxn,oneof"` } func (*ResponseOp_ResponseRange) isResponseOp_Response() {} func (*ResponseOp_ResponsePut) isResponseOp_Response() {} func (*ResponseOp_ResponseDeleteRange) isResponseOp_Response() {} func (*ResponseOp_ResponseTxn) isResponseOp_Response() {} func (m *ResponseOp) GetResponse() isResponseOp_Response { if m != nil { return m.Response } return nil } func (m *ResponseOp) GetResponseRange() *RangeResponse { if x, ok := m.GetResponse().(*ResponseOp_ResponseRange); ok { return x.ResponseRange } return nil } func (m *ResponseOp) GetResponsePut() *PutResponse { if x, ok := m.GetResponse().(*ResponseOp_ResponsePut); ok { return x.ResponsePut } return nil } func (m *ResponseOp) GetResponseDeleteRange() *DeleteRangeResponse { if x, ok := m.GetResponse().(*ResponseOp_ResponseDeleteRange); ok { return x.ResponseDeleteRange } return nil } func (m *ResponseOp) GetResponseTxn() *TxnResponse { if x, ok := m.GetResponse().(*ResponseOp_ResponseTxn); ok { return x.ResponseTxn } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*ResponseOp) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _ResponseOp_OneofMarshaler, _ResponseOp_OneofUnmarshaler, _ResponseOp_OneofSizer, []interface{}{ (*ResponseOp_ResponseRange)(nil), (*ResponseOp_ResponsePut)(nil), (*ResponseOp_ResponseDeleteRange)(nil), (*ResponseOp_ResponseTxn)(nil), } } func _ResponseOp_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*ResponseOp) // response switch x := m.Response.(type) { case *ResponseOp_ResponseRange: _ = b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.ResponseRange); err != nil { return err } case *ResponseOp_ResponsePut: _ = b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.ResponsePut); err != nil { return err } case *ResponseOp_ResponseDeleteRange: _ = b.EncodeVarint(3<<3 | proto.WireBytes) if err := b.EncodeMessage(x.ResponseDeleteRange); err != nil { return err } case *ResponseOp_ResponseTxn: _ = b.EncodeVarint(4<<3 | proto.WireBytes) if err := b.EncodeMessage(x.ResponseTxn); err != nil { return err } case nil: default: return fmt.Errorf("ResponseOp.Response has unexpected type %T", x) } return nil } func _ResponseOp_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*ResponseOp) switch tag { case 1: // response.response_range if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(RangeResponse) err := b.DecodeMessage(msg) m.Response = &ResponseOp_ResponseRange{msg} return true, err case 2: // response.response_put if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(PutResponse) err := b.DecodeMessage(msg) m.Response = &ResponseOp_ResponsePut{msg} return true, err case 3: // response.response_delete_range if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(DeleteRangeResponse) err := b.DecodeMessage(msg) m.Response = &ResponseOp_ResponseDeleteRange{msg} return true, err case 4: // response.response_txn if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(TxnResponse) err := b.DecodeMessage(msg) m.Response = &ResponseOp_ResponseTxn{msg} return true, err default: return false, nil } } func _ResponseOp_OneofSizer(msg proto.Message) (n int) { m := msg.(*ResponseOp) // response switch x := m.Response.(type) { case *ResponseOp_ResponseRange: s := proto.Size(x.ResponseRange) n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *ResponseOp_ResponsePut: s := proto.Size(x.ResponsePut) n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *ResponseOp_ResponseDeleteRange: s := proto.Size(x.ResponseDeleteRange) n += proto.SizeVarint(3<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *ResponseOp_ResponseTxn: s := proto.Size(x.ResponseTxn) n += proto.SizeVarint(4<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } type Compare struct { // result is logical comparison operation for this comparison. Result Compare_CompareResult `protobuf:"varint,1,opt,name=result,proto3,enum=etcdserverpb.Compare_CompareResult" json:"result,omitempty"` // target is the key-value field to inspect for the comparison. Target Compare_CompareTarget `protobuf:"varint,2,opt,name=target,proto3,enum=etcdserverpb.Compare_CompareTarget" json:"target,omitempty"` // key is the subject key for the comparison operation. Key []byte `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"` // Types that are valid to be assigned to TargetUnion: // *Compare_Version // *Compare_CreateRevision // *Compare_ModRevision // *Compare_Value // *Compare_Lease TargetUnion isCompare_TargetUnion `protobuf_oneof:"target_union"` // range_end compares the given target to all keys in the range [key, range_end). // See RangeRequest for more details on key ranges. RangeEnd []byte `protobuf:"bytes,64,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` } func (m *Compare) Reset() { *m = Compare{} } func (m *Compare) String() string { return proto.CompactTextString(m) } func (*Compare) ProtoMessage() {} func (*Compare) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{9} } type isCompare_TargetUnion interface { isCompare_TargetUnion() MarshalTo([]byte) (int, error) Size() int } type Compare_Version struct { Version int64 `protobuf:"varint,4,opt,name=version,proto3,oneof"` } type Compare_CreateRevision struct { CreateRevision int64 `protobuf:"varint,5,opt,name=create_revision,json=createRevision,proto3,oneof"` } type Compare_ModRevision struct { ModRevision int64 `protobuf:"varint,6,opt,name=mod_revision,json=modRevision,proto3,oneof"` } type Compare_Value struct { Value []byte `protobuf:"bytes,7,opt,name=value,proto3,oneof"` } type Compare_Lease struct { Lease int64 `protobuf:"varint,8,opt,name=lease,proto3,oneof"` } func (*Compare_Version) isCompare_TargetUnion() {} func (*Compare_CreateRevision) isCompare_TargetUnion() {} func (*Compare_ModRevision) isCompare_TargetUnion() {} func (*Compare_Value) isCompare_TargetUnion() {} func (*Compare_Lease) isCompare_TargetUnion() {} func (m *Compare) GetTargetUnion() isCompare_TargetUnion { if m != nil { return m.TargetUnion } return nil } func (m *Compare) GetResult() Compare_CompareResult { if m != nil { return m.Result } return Compare_EQUAL } func (m *Compare) GetTarget() Compare_CompareTarget { if m != nil { return m.Target } return Compare_VERSION } func (m *Compare) GetKey() []byte { if m != nil { return m.Key } return nil } func (m *Compare) GetVersion() int64 { if x, ok := m.GetTargetUnion().(*Compare_Version); ok { return x.Version } return 0 } func (m *Compare) GetCreateRevision() int64 { if x, ok := m.GetTargetUnion().(*Compare_CreateRevision); ok { return x.CreateRevision } return 0 } func (m *Compare) GetModRevision() int64 { if x, ok := m.GetTargetUnion().(*Compare_ModRevision); ok { return x.ModRevision } return 0 } func (m *Compare) GetValue() []byte { if x, ok := m.GetTargetUnion().(*Compare_Value); ok { return x.Value } return nil } func (m *Compare) GetLease() int64 { if x, ok := m.GetTargetUnion().(*Compare_Lease); ok { return x.Lease } return 0 } func (m *Compare) GetRangeEnd() []byte { if m != nil { return m.RangeEnd } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*Compare) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Compare_OneofMarshaler, _Compare_OneofUnmarshaler, _Compare_OneofSizer, []interface{}{ (*Compare_Version)(nil), (*Compare_CreateRevision)(nil), (*Compare_ModRevision)(nil), (*Compare_Value)(nil), (*Compare_Lease)(nil), } } func _Compare_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*Compare) // target_union switch x := m.TargetUnion.(type) { case *Compare_Version: _ = b.EncodeVarint(4<<3 | proto.WireVarint) _ = b.EncodeVarint(uint64(x.Version)) case *Compare_CreateRevision: _ = b.EncodeVarint(5<<3 | proto.WireVarint) _ = b.EncodeVarint(uint64(x.CreateRevision)) case *Compare_ModRevision: _ = b.EncodeVarint(6<<3 | proto.WireVarint) _ = b.EncodeVarint(uint64(x.ModRevision)) case *Compare_Value: _ = b.EncodeVarint(7<<3 | proto.WireBytes) _ = b.EncodeRawBytes(x.Value) case *Compare_Lease: _ = b.EncodeVarint(8<<3 | proto.WireVarint) _ = b.EncodeVarint(uint64(x.Lease)) case nil: default: return fmt.Errorf("Compare.TargetUnion has unexpected type %T", x) } return nil } func _Compare_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*Compare) switch tag { case 4: // target_union.version if wire != proto.WireVarint { return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() m.TargetUnion = &Compare_Version{int64(x)} return true, err case 5: // target_union.create_revision if wire != proto.WireVarint { return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() m.TargetUnion = &Compare_CreateRevision{int64(x)} return true, err case 6: // target_union.mod_revision if wire != proto.WireVarint { return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() m.TargetUnion = &Compare_ModRevision{int64(x)} return true, err case 7: // target_union.value if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } x, err := b.DecodeRawBytes(true) m.TargetUnion = &Compare_Value{x} return true, err case 8: // target_union.lease if wire != proto.WireVarint { return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() m.TargetUnion = &Compare_Lease{int64(x)} return true, err default: return false, nil } } func _Compare_OneofSizer(msg proto.Message) (n int) { m := msg.(*Compare) // target_union switch x := m.TargetUnion.(type) { case *Compare_Version: n += proto.SizeVarint(4<<3 | proto.WireVarint) n += proto.SizeVarint(uint64(x.Version)) case *Compare_CreateRevision: n += proto.SizeVarint(5<<3 | proto.WireVarint) n += proto.SizeVarint(uint64(x.CreateRevision)) case *Compare_ModRevision: n += proto.SizeVarint(6<<3 | proto.WireVarint) n += proto.SizeVarint(uint64(x.ModRevision)) case *Compare_Value: n += proto.SizeVarint(7<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(len(x.Value))) n += len(x.Value) case *Compare_Lease: n += proto.SizeVarint(8<<3 | proto.WireVarint) n += proto.SizeVarint(uint64(x.Lease)) case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } // From google paxosdb paper: // Our implementation hinges around a powerful primitive which we call MultiOp. All other database // operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically // and consists of three components: // 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check // for the absence or presence of a value, or compare with a given value. Two different tests in the guard // may apply to the same or different entries in the database. All tests in the guard are applied and // MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise // it executes f op (see item 3 below). // 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or // lookup operation, and applies to a single database entry. Two different operations in the list may apply // to the same or different entries in the database. These operations are executed // if guard evaluates to // true. // 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false. type TxnRequest struct { // compare is a list of predicates representing a conjunction of terms. // If the comparisons succeed, then the success requests will be processed in order, // and the response will contain their respective responses in order. // If the comparisons fail, then the failure requests will be processed in order, // and the response will contain their respective responses in order. Compare []*Compare `protobuf:"bytes,1,rep,name=compare" json:"compare,omitempty"` // success is a list of requests which will be applied when compare evaluates to true. Success []*RequestOp `protobuf:"bytes,2,rep,name=success" json:"success,omitempty"` // failure is a list of requests which will be applied when compare evaluates to false. Failure []*RequestOp `protobuf:"bytes,3,rep,name=failure" json:"failure,omitempty"` } func (m *TxnRequest) Reset() { *m = TxnRequest{} } func (m *TxnRequest) String() string { return proto.CompactTextString(m) } func (*TxnRequest) ProtoMessage() {} func (*TxnRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{10} } func (m *TxnRequest) GetCompare() []*Compare { if m != nil { return m.Compare } return nil } func (m *TxnRequest) GetSuccess() []*RequestOp { if m != nil { return m.Success } return nil } func (m *TxnRequest) GetFailure() []*RequestOp { if m != nil { return m.Failure } return nil } type TxnResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // succeeded is set to true if the compare evaluated to true or false otherwise. Succeeded bool `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"` // responses is a list of responses corresponding to the results from applying // success if succeeded is true or failure if succeeded is false. Responses []*ResponseOp `protobuf:"bytes,3,rep,name=responses" json:"responses,omitempty"` } func (m *TxnResponse) Reset() { *m = TxnResponse{} } func (m *TxnResponse) String() string { return proto.CompactTextString(m) } func (*TxnResponse) ProtoMessage() {} func (*TxnResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{11} } func (m *TxnResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *TxnResponse) GetSucceeded() bool { if m != nil { return m.Succeeded } return false } func (m *TxnResponse) GetResponses() []*ResponseOp { if m != nil { return m.Responses } return nil } // CompactionRequest compacts the key-value store up to a given revision. All superseded keys // with a revision less than the compaction revision will be removed. type CompactionRequest struct { // revision is the key-value store revision for the compaction operation. Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` // physical is set so the RPC will wait until the compaction is physically // applied to the local database such that compacted entries are totally // removed from the backend database. Physical bool `protobuf:"varint,2,opt,name=physical,proto3" json:"physical,omitempty"` } func (m *CompactionRequest) Reset() { *m = CompactionRequest{} } func (m *CompactionRequest) String() string { return proto.CompactTextString(m) } func (*CompactionRequest) ProtoMessage() {} func (*CompactionRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{12} } func (m *CompactionRequest) GetRevision() int64 { if m != nil { return m.Revision } return 0 } func (m *CompactionRequest) GetPhysical() bool { if m != nil { return m.Physical } return false } type CompactionResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *CompactionResponse) Reset() { *m = CompactionResponse{} } func (m *CompactionResponse) String() string { return proto.CompactTextString(m) } func (*CompactionResponse) ProtoMessage() {} func (*CompactionResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{13} } func (m *CompactionResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type HashRequest struct { } func (m *HashRequest) Reset() { *m = HashRequest{} } func (m *HashRequest) String() string { return proto.CompactTextString(m) } func (*HashRequest) ProtoMessage() {} func (*HashRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{14} } type HashKVRequest struct { // revision is the key-value store revision for the hash operation. Revision int64 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"` } func (m *HashKVRequest) Reset() { *m = HashKVRequest{} } func (m *HashKVRequest) String() string { return proto.CompactTextString(m) } func (*HashKVRequest) ProtoMessage() {} func (*HashKVRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{15} } func (m *HashKVRequest) GetRevision() int64 { if m != nil { return m.Revision } return 0 } type HashKVResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // hash is the hash value computed from the responding member's MVCC keys up to a given revision. Hash uint32 `protobuf:"varint,2,opt,name=hash,proto3" json:"hash,omitempty"` // compact_revision is the compacted revision of key-value store when hash begins. CompactRevision int64 `protobuf:"varint,3,opt,name=compact_revision,json=compactRevision,proto3" json:"compact_revision,omitempty"` } func (m *HashKVResponse) Reset() { *m = HashKVResponse{} } func (m *HashKVResponse) String() string { return proto.CompactTextString(m) } func (*HashKVResponse) ProtoMessage() {} func (*HashKVResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{16} } func (m *HashKVResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *HashKVResponse) GetHash() uint32 { if m != nil { return m.Hash } return 0 } func (m *HashKVResponse) GetCompactRevision() int64 { if m != nil { return m.CompactRevision } return 0 } type HashResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // hash is the hash value computed from the responding member's KV's backend. Hash uint32 `protobuf:"varint,2,opt,name=hash,proto3" json:"hash,omitempty"` } func (m *HashResponse) Reset() { *m = HashResponse{} } func (m *HashResponse) String() string { return proto.CompactTextString(m) } func (*HashResponse) ProtoMessage() {} func (*HashResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{17} } func (m *HashResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *HashResponse) GetHash() uint32 { if m != nil { return m.Hash } return 0 } type SnapshotRequest struct { } func (m *SnapshotRequest) Reset() { *m = SnapshotRequest{} } func (m *SnapshotRequest) String() string { return proto.CompactTextString(m) } func (*SnapshotRequest) ProtoMessage() {} func (*SnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{18} } type SnapshotResponse struct { // header has the current key-value store information. The first header in the snapshot // stream indicates the point in time of the snapshot. Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // remaining_bytes is the number of blob bytes to be sent after this message RemainingBytes uint64 `protobuf:"varint,2,opt,name=remaining_bytes,json=remainingBytes,proto3" json:"remaining_bytes,omitempty"` // blob contains the next chunk of the snapshot in the snapshot stream. Blob []byte `protobuf:"bytes,3,opt,name=blob,proto3" json:"blob,omitempty"` } func (m *SnapshotResponse) Reset() { *m = SnapshotResponse{} } func (m *SnapshotResponse) String() string { return proto.CompactTextString(m) } func (*SnapshotResponse) ProtoMessage() {} func (*SnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{19} } func (m *SnapshotResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *SnapshotResponse) GetRemainingBytes() uint64 { if m != nil { return m.RemainingBytes } return 0 } func (m *SnapshotResponse) GetBlob() []byte { if m != nil { return m.Blob } return nil } type WatchRequest struct { // request_union is a request to either create a new watcher or cancel an existing watcher. // // Types that are valid to be assigned to RequestUnion: // *WatchRequest_CreateRequest // *WatchRequest_CancelRequest RequestUnion isWatchRequest_RequestUnion `protobuf_oneof:"request_union"` } func (m *WatchRequest) Reset() { *m = WatchRequest{} } func (m *WatchRequest) String() string { return proto.CompactTextString(m) } func (*WatchRequest) ProtoMessage() {} func (*WatchRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{20} } type isWatchRequest_RequestUnion interface { isWatchRequest_RequestUnion() MarshalTo([]byte) (int, error) Size() int } type WatchRequest_CreateRequest struct { CreateRequest *WatchCreateRequest `protobuf:"bytes,1,opt,name=create_request,json=createRequest,oneof"` } type WatchRequest_CancelRequest struct { CancelRequest *WatchCancelRequest `protobuf:"bytes,2,opt,name=cancel_request,json=cancelRequest,oneof"` } func (*WatchRequest_CreateRequest) isWatchRequest_RequestUnion() {} func (*WatchRequest_CancelRequest) isWatchRequest_RequestUnion() {} func (m *WatchRequest) GetRequestUnion() isWatchRequest_RequestUnion { if m != nil { return m.RequestUnion } return nil } func (m *WatchRequest) GetCreateRequest() *WatchCreateRequest { if x, ok := m.GetRequestUnion().(*WatchRequest_CreateRequest); ok { return x.CreateRequest } return nil } func (m *WatchRequest) GetCancelRequest() *WatchCancelRequest { if x, ok := m.GetRequestUnion().(*WatchRequest_CancelRequest); ok { return x.CancelRequest } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*WatchRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _WatchRequest_OneofMarshaler, _WatchRequest_OneofUnmarshaler, _WatchRequest_OneofSizer, []interface{}{ (*WatchRequest_CreateRequest)(nil), (*WatchRequest_CancelRequest)(nil), } } func _WatchRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*WatchRequest) // request_union switch x := m.RequestUnion.(type) { case *WatchRequest_CreateRequest: _ = b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.CreateRequest); err != nil { return err } case *WatchRequest_CancelRequest: _ = b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.CancelRequest); err != nil { return err } case nil: default: return fmt.Errorf("WatchRequest.RequestUnion has unexpected type %T", x) } return nil } func _WatchRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*WatchRequest) switch tag { case 1: // request_union.create_request if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(WatchCreateRequest) err := b.DecodeMessage(msg) m.RequestUnion = &WatchRequest_CreateRequest{msg} return true, err case 2: // request_union.cancel_request if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(WatchCancelRequest) err := b.DecodeMessage(msg) m.RequestUnion = &WatchRequest_CancelRequest{msg} return true, err default: return false, nil } } func _WatchRequest_OneofSizer(msg proto.Message) (n int) { m := msg.(*WatchRequest) // request_union switch x := m.RequestUnion.(type) { case *WatchRequest_CreateRequest: s := proto.Size(x.CreateRequest) n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *WatchRequest_CancelRequest: s := proto.Size(x.CancelRequest) n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } type WatchCreateRequest struct { // key is the key to register for watching. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // range_end is the end of the range [key, range_end) to watch. If range_end is not given, // only the key argument is watched. If range_end is equal to '\0', all keys greater than // or equal to the key argument are watched. // If the range_end is one bit larger than the given key, // then all keys with the prefix (the given key) will be watched. RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` // start_revision is an optional revision to watch from (inclusive). No start_revision is "now". StartRevision int64 `protobuf:"varint,3,opt,name=start_revision,json=startRevision,proto3" json:"start_revision,omitempty"` // progress_notify is set so that the etcd server will periodically send a WatchResponse with // no events to the new watcher if there are no recent events. It is useful when clients // wish to recover a disconnected watcher starting from a recent known revision. // The etcd server may decide how often it will send notifications based on current load. ProgressNotify bool `protobuf:"varint,4,opt,name=progress_notify,json=progressNotify,proto3" json:"progress_notify,omitempty"` // filters filter the events at server side before it sends back to the watcher. Filters []WatchCreateRequest_FilterType `protobuf:"varint,5,rep,packed,name=filters,enum=etcdserverpb.WatchCreateRequest_FilterType" json:"filters,omitempty"` // If prev_kv is set, created watcher gets the previous KV before the event happens. // If the previous KV is already compacted, nothing will be returned. PrevKv bool `protobuf:"varint,6,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` } func (m *WatchCreateRequest) Reset() { *m = WatchCreateRequest{} } func (m *WatchCreateRequest) String() string { return proto.CompactTextString(m) } func (*WatchCreateRequest) ProtoMessage() {} func (*WatchCreateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{21} } func (m *WatchCreateRequest) GetKey() []byte { if m != nil { return m.Key } return nil } func (m *WatchCreateRequest) GetRangeEnd() []byte { if m != nil { return m.RangeEnd } return nil } func (m *WatchCreateRequest) GetStartRevision() int64 { if m != nil { return m.StartRevision } return 0 } func (m *WatchCreateRequest) GetProgressNotify() bool { if m != nil { return m.ProgressNotify } return false } func (m *WatchCreateRequest) GetFilters() []WatchCreateRequest_FilterType { if m != nil { return m.Filters } return nil } func (m *WatchCreateRequest) GetPrevKv() bool { if m != nil { return m.PrevKv } return false } type WatchCancelRequest struct { // watch_id is the watcher id to cancel so that no more events are transmitted. WatchId int64 `protobuf:"varint,1,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` } func (m *WatchCancelRequest) Reset() { *m = WatchCancelRequest{} } func (m *WatchCancelRequest) String() string { return proto.CompactTextString(m) } func (*WatchCancelRequest) ProtoMessage() {} func (*WatchCancelRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{22} } func (m *WatchCancelRequest) GetWatchId() int64 { if m != nil { return m.WatchId } return 0 } type WatchResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // watch_id is the ID of the watcher that corresponds to the response. WatchId int64 `protobuf:"varint,2,opt,name=watch_id,json=watchId,proto3" json:"watch_id,omitempty"` // created is set to true if the response is for a create watch request. // The client should record the watch_id and expect to receive events for // the created watcher from the same stream. // All events sent to the created watcher will attach with the same watch_id. Created bool `protobuf:"varint,3,opt,name=created,proto3" json:"created,omitempty"` // canceled is set to true if the response is for a cancel watch request. // No further events will be sent to the canceled watcher. Canceled bool `protobuf:"varint,4,opt,name=canceled,proto3" json:"canceled,omitempty"` // compact_revision is set to the minimum index if a watcher tries to watch // at a compacted index. // // This happens when creating a watcher at a compacted revision or the watcher cannot // catch up with the progress of the key-value store. // // The client should treat the watcher as canceled and should not try to create any // watcher with the same start_revision again. CompactRevision int64 `protobuf:"varint,5,opt,name=compact_revision,json=compactRevision,proto3" json:"compact_revision,omitempty"` // cancel_reason indicates the reason for canceling the watcher. CancelReason string `protobuf:"bytes,6,opt,name=cancel_reason,json=cancelReason,proto3" json:"cancel_reason,omitempty"` Events []*mvccpb.Event `protobuf:"bytes,11,rep,name=events" json:"events,omitempty"` } func (m *WatchResponse) Reset() { *m = WatchResponse{} } func (m *WatchResponse) String() string { return proto.CompactTextString(m) } func (*WatchResponse) ProtoMessage() {} func (*WatchResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{23} } func (m *WatchResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *WatchResponse) GetWatchId() int64 { if m != nil { return m.WatchId } return 0 } func (m *WatchResponse) GetCreated() bool { if m != nil { return m.Created } return false } func (m *WatchResponse) GetCanceled() bool { if m != nil { return m.Canceled } return false } func (m *WatchResponse) GetCompactRevision() int64 { if m != nil { return m.CompactRevision } return 0 } func (m *WatchResponse) GetCancelReason() string { if m != nil { return m.CancelReason } return "" } func (m *WatchResponse) GetEvents() []*mvccpb.Event { if m != nil { return m.Events } return nil } type LeaseGrantRequest struct { // TTL is the advisory time-to-live in seconds. Expired lease will return -1. TTL int64 `protobuf:"varint,1,opt,name=TTL,proto3" json:"TTL,omitempty"` // ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` } func (m *LeaseGrantRequest) Reset() { *m = LeaseGrantRequest{} } func (m *LeaseGrantRequest) String() string { return proto.CompactTextString(m) } func (*LeaseGrantRequest) ProtoMessage() {} func (*LeaseGrantRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{24} } func (m *LeaseGrantRequest) GetTTL() int64 { if m != nil { return m.TTL } return 0 } func (m *LeaseGrantRequest) GetID() int64 { if m != nil { return m.ID } return 0 } type LeaseGrantResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // ID is the lease ID for the granted lease. ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` // TTL is the server chosen lease time-to-live in seconds. TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` } func (m *LeaseGrantResponse) Reset() { *m = LeaseGrantResponse{} } func (m *LeaseGrantResponse) String() string { return proto.CompactTextString(m) } func (*LeaseGrantResponse) ProtoMessage() {} func (*LeaseGrantResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{25} } func (m *LeaseGrantResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *LeaseGrantResponse) GetID() int64 { if m != nil { return m.ID } return 0 } func (m *LeaseGrantResponse) GetTTL() int64 { if m != nil { return m.TTL } return 0 } func (m *LeaseGrantResponse) GetError() string { if m != nil { return m.Error } return "" } type LeaseRevokeRequest struct { // ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` } func (m *LeaseRevokeRequest) Reset() { *m = LeaseRevokeRequest{} } func (m *LeaseRevokeRequest) String() string { return proto.CompactTextString(m) } func (*LeaseRevokeRequest) ProtoMessage() {} func (*LeaseRevokeRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{26} } func (m *LeaseRevokeRequest) GetID() int64 { if m != nil { return m.ID } return 0 } type LeaseRevokeResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *LeaseRevokeResponse) Reset() { *m = LeaseRevokeResponse{} } func (m *LeaseRevokeResponse) String() string { return proto.CompactTextString(m) } func (*LeaseRevokeResponse) ProtoMessage() {} func (*LeaseRevokeResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{27} } func (m *LeaseRevokeResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type LeaseKeepAliveRequest struct { // ID is the lease ID for the lease to keep alive. ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` } func (m *LeaseKeepAliveRequest) Reset() { *m = LeaseKeepAliveRequest{} } func (m *LeaseKeepAliveRequest) String() string { return proto.CompactTextString(m) } func (*LeaseKeepAliveRequest) ProtoMessage() {} func (*LeaseKeepAliveRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{28} } func (m *LeaseKeepAliveRequest) GetID() int64 { if m != nil { return m.ID } return 0 } type LeaseKeepAliveResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // ID is the lease ID from the keep alive request. ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` // TTL is the new time-to-live for the lease. TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` } func (m *LeaseKeepAliveResponse) Reset() { *m = LeaseKeepAliveResponse{} } func (m *LeaseKeepAliveResponse) String() string { return proto.CompactTextString(m) } func (*LeaseKeepAliveResponse) ProtoMessage() {} func (*LeaseKeepAliveResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{29} } func (m *LeaseKeepAliveResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *LeaseKeepAliveResponse) GetID() int64 { if m != nil { return m.ID } return 0 } func (m *LeaseKeepAliveResponse) GetTTL() int64 { if m != nil { return m.TTL } return 0 } type LeaseTimeToLiveRequest struct { // ID is the lease ID for the lease. ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // keys is true to query all the keys attached to this lease. Keys bool `protobuf:"varint,2,opt,name=keys,proto3" json:"keys,omitempty"` } func (m *LeaseTimeToLiveRequest) Reset() { *m = LeaseTimeToLiveRequest{} } func (m *LeaseTimeToLiveRequest) String() string { return proto.CompactTextString(m) } func (*LeaseTimeToLiveRequest) ProtoMessage() {} func (*LeaseTimeToLiveRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{30} } func (m *LeaseTimeToLiveRequest) GetID() int64 { if m != nil { return m.ID } return 0 } func (m *LeaseTimeToLiveRequest) GetKeys() bool { if m != nil { return m.Keys } return false } type LeaseTimeToLiveResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // ID is the lease ID from the keep alive request. ID int64 `protobuf:"varint,2,opt,name=ID,proto3" json:"ID,omitempty"` // TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds. TTL int64 `protobuf:"varint,3,opt,name=TTL,proto3" json:"TTL,omitempty"` // GrantedTTL is the initial granted time in seconds upon lease creation/renewal. GrantedTTL int64 `protobuf:"varint,4,opt,name=grantedTTL,proto3" json:"grantedTTL,omitempty"` // Keys is the list of keys attached to this lease. Keys [][]byte `protobuf:"bytes,5,rep,name=keys" json:"keys,omitempty"` } func (m *LeaseTimeToLiveResponse) Reset() { *m = LeaseTimeToLiveResponse{} } func (m *LeaseTimeToLiveResponse) String() string { return proto.CompactTextString(m) } func (*LeaseTimeToLiveResponse) ProtoMessage() {} func (*LeaseTimeToLiveResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{31} } func (m *LeaseTimeToLiveResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *LeaseTimeToLiveResponse) GetID() int64 { if m != nil { return m.ID } return 0 } func (m *LeaseTimeToLiveResponse) GetTTL() int64 { if m != nil { return m.TTL } return 0 } func (m *LeaseTimeToLiveResponse) GetGrantedTTL() int64 { if m != nil { return m.GrantedTTL } return 0 } func (m *LeaseTimeToLiveResponse) GetKeys() [][]byte { if m != nil { return m.Keys } return nil } type LeaseLeasesRequest struct { } func (m *LeaseLeasesRequest) Reset() { *m = LeaseLeasesRequest{} } func (m *LeaseLeasesRequest) String() string { return proto.CompactTextString(m) } func (*LeaseLeasesRequest) ProtoMessage() {} func (*LeaseLeasesRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{32} } type LeaseStatus struct { ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` } func (m *LeaseStatus) Reset() { *m = LeaseStatus{} } func (m *LeaseStatus) String() string { return proto.CompactTextString(m) } func (*LeaseStatus) ProtoMessage() {} func (*LeaseStatus) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{33} } func (m *LeaseStatus) GetID() int64 { if m != nil { return m.ID } return 0 } type LeaseLeasesResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` Leases []*LeaseStatus `protobuf:"bytes,2,rep,name=leases" json:"leases,omitempty"` } func (m *LeaseLeasesResponse) Reset() { *m = LeaseLeasesResponse{} } func (m *LeaseLeasesResponse) String() string { return proto.CompactTextString(m) } func (*LeaseLeasesResponse) ProtoMessage() {} func (*LeaseLeasesResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{34} } func (m *LeaseLeasesResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *LeaseLeasesResponse) GetLeases() []*LeaseStatus { if m != nil { return m.Leases } return nil } type Member struct { // ID is the member ID for this member. ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // name is the human-readable name of the member. If the member is not started, the name will be an empty string. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // peerURLs is the list of URLs the member exposes to the cluster for communication. PeerURLs []string `protobuf:"bytes,3,rep,name=peerURLs" json:"peerURLs,omitempty"` // clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty. ClientURLs []string `protobuf:"bytes,4,rep,name=clientURLs" json:"clientURLs,omitempty"` } func (m *Member) Reset() { *m = Member{} } func (m *Member) String() string { return proto.CompactTextString(m) } func (*Member) ProtoMessage() {} func (*Member) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{35} } func (m *Member) GetID() uint64 { if m != nil { return m.ID } return 0 } func (m *Member) GetName() string { if m != nil { return m.Name } return "" } func (m *Member) GetPeerURLs() []string { if m != nil { return m.PeerURLs } return nil } func (m *Member) GetClientURLs() []string { if m != nil { return m.ClientURLs } return nil } type MemberAddRequest struct { // peerURLs is the list of URLs the added member will use to communicate with the cluster. PeerURLs []string `protobuf:"bytes,1,rep,name=peerURLs" json:"peerURLs,omitempty"` } func (m *MemberAddRequest) Reset() { *m = MemberAddRequest{} } func (m *MemberAddRequest) String() string { return proto.CompactTextString(m) } func (*MemberAddRequest) ProtoMessage() {} func (*MemberAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{36} } func (m *MemberAddRequest) GetPeerURLs() []string { if m != nil { return m.PeerURLs } return nil } type MemberAddResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // member is the member information for the added member. Member *Member `protobuf:"bytes,2,opt,name=member" json:"member,omitempty"` // members is a list of all members after adding the new member. Members []*Member `protobuf:"bytes,3,rep,name=members" json:"members,omitempty"` } func (m *MemberAddResponse) Reset() { *m = MemberAddResponse{} } func (m *MemberAddResponse) String() string { return proto.CompactTextString(m) } func (*MemberAddResponse) ProtoMessage() {} func (*MemberAddResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{37} } func (m *MemberAddResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *MemberAddResponse) GetMember() *Member { if m != nil { return m.Member } return nil } func (m *MemberAddResponse) GetMembers() []*Member { if m != nil { return m.Members } return nil } type MemberRemoveRequest struct { // ID is the member ID of the member to remove. ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` } func (m *MemberRemoveRequest) Reset() { *m = MemberRemoveRequest{} } func (m *MemberRemoveRequest) String() string { return proto.CompactTextString(m) } func (*MemberRemoveRequest) ProtoMessage() {} func (*MemberRemoveRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{38} } func (m *MemberRemoveRequest) GetID() uint64 { if m != nil { return m.ID } return 0 } type MemberRemoveResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // members is a list of all members after removing the member. Members []*Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` } func (m *MemberRemoveResponse) Reset() { *m = MemberRemoveResponse{} } func (m *MemberRemoveResponse) String() string { return proto.CompactTextString(m) } func (*MemberRemoveResponse) ProtoMessage() {} func (*MemberRemoveResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{39} } func (m *MemberRemoveResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *MemberRemoveResponse) GetMembers() []*Member { if m != nil { return m.Members } return nil } type MemberUpdateRequest struct { // ID is the member ID of the member to update. ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` // peerURLs is the new list of URLs the member will use to communicate with the cluster. PeerURLs []string `protobuf:"bytes,2,rep,name=peerURLs" json:"peerURLs,omitempty"` } func (m *MemberUpdateRequest) Reset() { *m = MemberUpdateRequest{} } func (m *MemberUpdateRequest) String() string { return proto.CompactTextString(m) } func (*MemberUpdateRequest) ProtoMessage() {} func (*MemberUpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{40} } func (m *MemberUpdateRequest) GetID() uint64 { if m != nil { return m.ID } return 0 } func (m *MemberUpdateRequest) GetPeerURLs() []string { if m != nil { return m.PeerURLs } return nil } type MemberUpdateResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // members is a list of all members after updating the member. Members []*Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` } func (m *MemberUpdateResponse) Reset() { *m = MemberUpdateResponse{} } func (m *MemberUpdateResponse) String() string { return proto.CompactTextString(m) } func (*MemberUpdateResponse) ProtoMessage() {} func (*MemberUpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{41} } func (m *MemberUpdateResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *MemberUpdateResponse) GetMembers() []*Member { if m != nil { return m.Members } return nil } type MemberListRequest struct { } func (m *MemberListRequest) Reset() { *m = MemberListRequest{} } func (m *MemberListRequest) String() string { return proto.CompactTextString(m) } func (*MemberListRequest) ProtoMessage() {} func (*MemberListRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{42} } type MemberListResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // members is a list of all members associated with the cluster. Members []*Member `protobuf:"bytes,2,rep,name=members" json:"members,omitempty"` } func (m *MemberListResponse) Reset() { *m = MemberListResponse{} } func (m *MemberListResponse) String() string { return proto.CompactTextString(m) } func (*MemberListResponse) ProtoMessage() {} func (*MemberListResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{43} } func (m *MemberListResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *MemberListResponse) GetMembers() []*Member { if m != nil { return m.Members } return nil } type DefragmentRequest struct { } func (m *DefragmentRequest) Reset() { *m = DefragmentRequest{} } func (m *DefragmentRequest) String() string { return proto.CompactTextString(m) } func (*DefragmentRequest) ProtoMessage() {} func (*DefragmentRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{44} } type DefragmentResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *DefragmentResponse) Reset() { *m = DefragmentResponse{} } func (m *DefragmentResponse) String() string { return proto.CompactTextString(m) } func (*DefragmentResponse) ProtoMessage() {} func (*DefragmentResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{45} } func (m *DefragmentResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type MoveLeaderRequest struct { // targetID is the node ID for the new leader. TargetID uint64 `protobuf:"varint,1,opt,name=targetID,proto3" json:"targetID,omitempty"` } func (m *MoveLeaderRequest) Reset() { *m = MoveLeaderRequest{} } func (m *MoveLeaderRequest) String() string { return proto.CompactTextString(m) } func (*MoveLeaderRequest) ProtoMessage() {} func (*MoveLeaderRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{46} } func (m *MoveLeaderRequest) GetTargetID() uint64 { if m != nil { return m.TargetID } return 0 } type MoveLeaderResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *MoveLeaderResponse) Reset() { *m = MoveLeaderResponse{} } func (m *MoveLeaderResponse) String() string { return proto.CompactTextString(m) } func (*MoveLeaderResponse) ProtoMessage() {} func (*MoveLeaderResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{47} } func (m *MoveLeaderResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AlarmRequest struct { // action is the kind of alarm request to issue. The action // may GET alarm statuses, ACTIVATE an alarm, or DEACTIVATE a // raised alarm. Action AlarmRequest_AlarmAction `protobuf:"varint,1,opt,name=action,proto3,enum=etcdserverpb.AlarmRequest_AlarmAction" json:"action,omitempty"` // memberID is the ID of the member associated with the alarm. If memberID is 0, the // alarm request covers all members. MemberID uint64 `protobuf:"varint,2,opt,name=memberID,proto3" json:"memberID,omitempty"` // alarm is the type of alarm to consider for this request. Alarm AlarmType `protobuf:"varint,3,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"` } func (m *AlarmRequest) Reset() { *m = AlarmRequest{} } func (m *AlarmRequest) String() string { return proto.CompactTextString(m) } func (*AlarmRequest) ProtoMessage() {} func (*AlarmRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{48} } func (m *AlarmRequest) GetAction() AlarmRequest_AlarmAction { if m != nil { return m.Action } return AlarmRequest_GET } func (m *AlarmRequest) GetMemberID() uint64 { if m != nil { return m.MemberID } return 0 } func (m *AlarmRequest) GetAlarm() AlarmType { if m != nil { return m.Alarm } return AlarmType_NONE } type AlarmMember struct { // memberID is the ID of the member associated with the raised alarm. MemberID uint64 `protobuf:"varint,1,opt,name=memberID,proto3" json:"memberID,omitempty"` // alarm is the type of alarm which has been raised. Alarm AlarmType `protobuf:"varint,2,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"` } func (m *AlarmMember) Reset() { *m = AlarmMember{} } func (m *AlarmMember) String() string { return proto.CompactTextString(m) } func (*AlarmMember) ProtoMessage() {} func (*AlarmMember) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{49} } func (m *AlarmMember) GetMemberID() uint64 { if m != nil { return m.MemberID } return 0 } func (m *AlarmMember) GetAlarm() AlarmType { if m != nil { return m.Alarm } return AlarmType_NONE } type AlarmResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // alarms is a list of alarms associated with the alarm request. Alarms []*AlarmMember `protobuf:"bytes,2,rep,name=alarms" json:"alarms,omitempty"` } func (m *AlarmResponse) Reset() { *m = AlarmResponse{} } func (m *AlarmResponse) String() string { return proto.CompactTextString(m) } func (*AlarmResponse) ProtoMessage() {} func (*AlarmResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{50} } func (m *AlarmResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *AlarmResponse) GetAlarms() []*AlarmMember { if m != nil { return m.Alarms } return nil } type StatusRequest struct { } func (m *StatusRequest) Reset() { *m = StatusRequest{} } func (m *StatusRequest) String() string { return proto.CompactTextString(m) } func (*StatusRequest) ProtoMessage() {} func (*StatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{51} } type StatusResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // version is the cluster protocol version used by the responding member. Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // dbSize is the size of the backend database, in bytes, of the responding member. DbSize int64 `protobuf:"varint,3,opt,name=dbSize,proto3" json:"dbSize,omitempty"` // leader is the member ID which the responding member believes is the current leader. Leader uint64 `protobuf:"varint,4,opt,name=leader,proto3" json:"leader,omitempty"` // raftIndex is the current raft index of the responding member. RaftIndex uint64 `protobuf:"varint,5,opt,name=raftIndex,proto3" json:"raftIndex,omitempty"` // raftTerm is the current raft term of the responding member. RaftTerm uint64 `protobuf:"varint,6,opt,name=raftTerm,proto3" json:"raftTerm,omitempty"` } func (m *StatusResponse) Reset() { *m = StatusResponse{} } func (m *StatusResponse) String() string { return proto.CompactTextString(m) } func (*StatusResponse) ProtoMessage() {} func (*StatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{52} } func (m *StatusResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *StatusResponse) GetVersion() string { if m != nil { return m.Version } return "" } func (m *StatusResponse) GetDbSize() int64 { if m != nil { return m.DbSize } return 0 } func (m *StatusResponse) GetLeader() uint64 { if m != nil { return m.Leader } return 0 } func (m *StatusResponse) GetRaftIndex() uint64 { if m != nil { return m.RaftIndex } return 0 } func (m *StatusResponse) GetRaftTerm() uint64 { if m != nil { return m.RaftTerm } return 0 } type AuthEnableRequest struct { } func (m *AuthEnableRequest) Reset() { *m = AuthEnableRequest{} } func (m *AuthEnableRequest) String() string { return proto.CompactTextString(m) } func (*AuthEnableRequest) ProtoMessage() {} func (*AuthEnableRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{53} } type AuthDisableRequest struct { } func (m *AuthDisableRequest) Reset() { *m = AuthDisableRequest{} } func (m *AuthDisableRequest) String() string { return proto.CompactTextString(m) } func (*AuthDisableRequest) ProtoMessage() {} func (*AuthDisableRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{54} } type AuthenticateRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` } func (m *AuthenticateRequest) Reset() { *m = AuthenticateRequest{} } func (m *AuthenticateRequest) String() string { return proto.CompactTextString(m) } func (*AuthenticateRequest) ProtoMessage() {} func (*AuthenticateRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{55} } func (m *AuthenticateRequest) GetName() string { if m != nil { return m.Name } return "" } func (m *AuthenticateRequest) GetPassword() string { if m != nil { return m.Password } return "" } type AuthUserAddRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` } func (m *AuthUserAddRequest) Reset() { *m = AuthUserAddRequest{} } func (m *AuthUserAddRequest) String() string { return proto.CompactTextString(m) } func (*AuthUserAddRequest) ProtoMessage() {} func (*AuthUserAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{56} } func (m *AuthUserAddRequest) GetName() string { if m != nil { return m.Name } return "" } func (m *AuthUserAddRequest) GetPassword() string { if m != nil { return m.Password } return "" } type AuthUserGetRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (m *AuthUserGetRequest) Reset() { *m = AuthUserGetRequest{} } func (m *AuthUserGetRequest) String() string { return proto.CompactTextString(m) } func (*AuthUserGetRequest) ProtoMessage() {} func (*AuthUserGetRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{57} } func (m *AuthUserGetRequest) GetName() string { if m != nil { return m.Name } return "" } type AuthUserDeleteRequest struct { // name is the name of the user to delete. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (m *AuthUserDeleteRequest) Reset() { *m = AuthUserDeleteRequest{} } func (m *AuthUserDeleteRequest) String() string { return proto.CompactTextString(m) } func (*AuthUserDeleteRequest) ProtoMessage() {} func (*AuthUserDeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{58} } func (m *AuthUserDeleteRequest) GetName() string { if m != nil { return m.Name } return "" } type AuthUserChangePasswordRequest struct { // name is the name of the user whose password is being changed. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // password is the new password for the user. Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` } func (m *AuthUserChangePasswordRequest) Reset() { *m = AuthUserChangePasswordRequest{} } func (m *AuthUserChangePasswordRequest) String() string { return proto.CompactTextString(m) } func (*AuthUserChangePasswordRequest) ProtoMessage() {} func (*AuthUserChangePasswordRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{59} } func (m *AuthUserChangePasswordRequest) GetName() string { if m != nil { return m.Name } return "" } func (m *AuthUserChangePasswordRequest) GetPassword() string { if m != nil { return m.Password } return "" } type AuthUserGrantRoleRequest struct { // user is the name of the user which should be granted a given role. User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // role is the name of the role to grant to the user. Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` } func (m *AuthUserGrantRoleRequest) Reset() { *m = AuthUserGrantRoleRequest{} } func (m *AuthUserGrantRoleRequest) String() string { return proto.CompactTextString(m) } func (*AuthUserGrantRoleRequest) ProtoMessage() {} func (*AuthUserGrantRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{60} } func (m *AuthUserGrantRoleRequest) GetUser() string { if m != nil { return m.User } return "" } func (m *AuthUserGrantRoleRequest) GetRole() string { if m != nil { return m.Role } return "" } type AuthUserRevokeRoleRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Role string `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` } func (m *AuthUserRevokeRoleRequest) Reset() { *m = AuthUserRevokeRoleRequest{} } func (m *AuthUserRevokeRoleRequest) String() string { return proto.CompactTextString(m) } func (*AuthUserRevokeRoleRequest) ProtoMessage() {} func (*AuthUserRevokeRoleRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{61} } func (m *AuthUserRevokeRoleRequest) GetName() string { if m != nil { return m.Name } return "" } func (m *AuthUserRevokeRoleRequest) GetRole() string { if m != nil { return m.Role } return "" } type AuthRoleAddRequest struct { // name is the name of the role to add to the authentication system. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (m *AuthRoleAddRequest) Reset() { *m = AuthRoleAddRequest{} } func (m *AuthRoleAddRequest) String() string { return proto.CompactTextString(m) } func (*AuthRoleAddRequest) ProtoMessage() {} func (*AuthRoleAddRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{62} } func (m *AuthRoleAddRequest) GetName() string { if m != nil { return m.Name } return "" } type AuthRoleGetRequest struct { Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` } func (m *AuthRoleGetRequest) Reset() { *m = AuthRoleGetRequest{} } func (m *AuthRoleGetRequest) String() string { return proto.CompactTextString(m) } func (*AuthRoleGetRequest) ProtoMessage() {} func (*AuthRoleGetRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{63} } func (m *AuthRoleGetRequest) GetRole() string { if m != nil { return m.Role } return "" } type AuthUserListRequest struct { } func (m *AuthUserListRequest) Reset() { *m = AuthUserListRequest{} } func (m *AuthUserListRequest) String() string { return proto.CompactTextString(m) } func (*AuthUserListRequest) ProtoMessage() {} func (*AuthUserListRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{64} } type AuthRoleListRequest struct { } func (m *AuthRoleListRequest) Reset() { *m = AuthRoleListRequest{} } func (m *AuthRoleListRequest) String() string { return proto.CompactTextString(m) } func (*AuthRoleListRequest) ProtoMessage() {} func (*AuthRoleListRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{65} } type AuthRoleDeleteRequest struct { Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` } func (m *AuthRoleDeleteRequest) Reset() { *m = AuthRoleDeleteRequest{} } func (m *AuthRoleDeleteRequest) String() string { return proto.CompactTextString(m) } func (*AuthRoleDeleteRequest) ProtoMessage() {} func (*AuthRoleDeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{66} } func (m *AuthRoleDeleteRequest) GetRole() string { if m != nil { return m.Role } return "" } type AuthRoleGrantPermissionRequest struct { // name is the name of the role which will be granted the permission. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // perm is the permission to grant to the role. Perm *authpb.Permission `protobuf:"bytes,2,opt,name=perm" json:"perm,omitempty"` } func (m *AuthRoleGrantPermissionRequest) Reset() { *m = AuthRoleGrantPermissionRequest{} } func (m *AuthRoleGrantPermissionRequest) String() string { return proto.CompactTextString(m) } func (*AuthRoleGrantPermissionRequest) ProtoMessage() {} func (*AuthRoleGrantPermissionRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{67} } func (m *AuthRoleGrantPermissionRequest) GetName() string { if m != nil { return m.Name } return "" } func (m *AuthRoleGrantPermissionRequest) GetPerm() *authpb.Permission { if m != nil { return m.Perm } return nil } type AuthRoleRevokePermissionRequest struct { Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` RangeEnd string `protobuf:"bytes,3,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` } func (m *AuthRoleRevokePermissionRequest) Reset() { *m = AuthRoleRevokePermissionRequest{} } func (m *AuthRoleRevokePermissionRequest) String() string { return proto.CompactTextString(m) } func (*AuthRoleRevokePermissionRequest) ProtoMessage() {} func (*AuthRoleRevokePermissionRequest) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{68} } func (m *AuthRoleRevokePermissionRequest) GetRole() string { if m != nil { return m.Role } return "" } func (m *AuthRoleRevokePermissionRequest) GetKey() string { if m != nil { return m.Key } return "" } func (m *AuthRoleRevokePermissionRequest) GetRangeEnd() string { if m != nil { return m.RangeEnd } return "" } type AuthEnableResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthEnableResponse) Reset() { *m = AuthEnableResponse{} } func (m *AuthEnableResponse) String() string { return proto.CompactTextString(m) } func (*AuthEnableResponse) ProtoMessage() {} func (*AuthEnableResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{69} } func (m *AuthEnableResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AuthDisableResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthDisableResponse) Reset() { *m = AuthDisableResponse{} } func (m *AuthDisableResponse) String() string { return proto.CompactTextString(m) } func (*AuthDisableResponse) ProtoMessage() {} func (*AuthDisableResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{70} } func (m *AuthDisableResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AuthenticateResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` // token is an authorized token that can be used in succeeding RPCs Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` } func (m *AuthenticateResponse) Reset() { *m = AuthenticateResponse{} } func (m *AuthenticateResponse) String() string { return proto.CompactTextString(m) } func (*AuthenticateResponse) ProtoMessage() {} func (*AuthenticateResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{71} } func (m *AuthenticateResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *AuthenticateResponse) GetToken() string { if m != nil { return m.Token } return "" } type AuthUserAddResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthUserAddResponse) Reset() { *m = AuthUserAddResponse{} } func (m *AuthUserAddResponse) String() string { return proto.CompactTextString(m) } func (*AuthUserAddResponse) ProtoMessage() {} func (*AuthUserAddResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{72} } func (m *AuthUserAddResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AuthUserGetResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` Roles []string `protobuf:"bytes,2,rep,name=roles" json:"roles,omitempty"` } func (m *AuthUserGetResponse) Reset() { *m = AuthUserGetResponse{} } func (m *AuthUserGetResponse) String() string { return proto.CompactTextString(m) } func (*AuthUserGetResponse) ProtoMessage() {} func (*AuthUserGetResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{73} } func (m *AuthUserGetResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *AuthUserGetResponse) GetRoles() []string { if m != nil { return m.Roles } return nil } type AuthUserDeleteResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthUserDeleteResponse) Reset() { *m = AuthUserDeleteResponse{} } func (m *AuthUserDeleteResponse) String() string { return proto.CompactTextString(m) } func (*AuthUserDeleteResponse) ProtoMessage() {} func (*AuthUserDeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{74} } func (m *AuthUserDeleteResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AuthUserChangePasswordResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthUserChangePasswordResponse) Reset() { *m = AuthUserChangePasswordResponse{} } func (m *AuthUserChangePasswordResponse) String() string { return proto.CompactTextString(m) } func (*AuthUserChangePasswordResponse) ProtoMessage() {} func (*AuthUserChangePasswordResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{75} } func (m *AuthUserChangePasswordResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AuthUserGrantRoleResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthUserGrantRoleResponse) Reset() { *m = AuthUserGrantRoleResponse{} } func (m *AuthUserGrantRoleResponse) String() string { return proto.CompactTextString(m) } func (*AuthUserGrantRoleResponse) ProtoMessage() {} func (*AuthUserGrantRoleResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{76} } func (m *AuthUserGrantRoleResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AuthUserRevokeRoleResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthUserRevokeRoleResponse) Reset() { *m = AuthUserRevokeRoleResponse{} } func (m *AuthUserRevokeRoleResponse) String() string { return proto.CompactTextString(m) } func (*AuthUserRevokeRoleResponse) ProtoMessage() {} func (*AuthUserRevokeRoleResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{77} } func (m *AuthUserRevokeRoleResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AuthRoleAddResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthRoleAddResponse) Reset() { *m = AuthRoleAddResponse{} } func (m *AuthRoleAddResponse) String() string { return proto.CompactTextString(m) } func (*AuthRoleAddResponse) ProtoMessage() {} func (*AuthRoleAddResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{78} } func (m *AuthRoleAddResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AuthRoleGetResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` Perm []*authpb.Permission `protobuf:"bytes,2,rep,name=perm" json:"perm,omitempty"` } func (m *AuthRoleGetResponse) Reset() { *m = AuthRoleGetResponse{} } func (m *AuthRoleGetResponse) String() string { return proto.CompactTextString(m) } func (*AuthRoleGetResponse) ProtoMessage() {} func (*AuthRoleGetResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{79} } func (m *AuthRoleGetResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *AuthRoleGetResponse) GetPerm() []*authpb.Permission { if m != nil { return m.Perm } return nil } type AuthRoleListResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` Roles []string `protobuf:"bytes,2,rep,name=roles" json:"roles,omitempty"` } func (m *AuthRoleListResponse) Reset() { *m = AuthRoleListResponse{} } func (m *AuthRoleListResponse) String() string { return proto.CompactTextString(m) } func (*AuthRoleListResponse) ProtoMessage() {} func (*AuthRoleListResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{80} } func (m *AuthRoleListResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *AuthRoleListResponse) GetRoles() []string { if m != nil { return m.Roles } return nil } type AuthUserListResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` Users []string `protobuf:"bytes,2,rep,name=users" json:"users,omitempty"` } func (m *AuthUserListResponse) Reset() { *m = AuthUserListResponse{} } func (m *AuthUserListResponse) String() string { return proto.CompactTextString(m) } func (*AuthUserListResponse) ProtoMessage() {} func (*AuthUserListResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{81} } func (m *AuthUserListResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func (m *AuthUserListResponse) GetUsers() []string { if m != nil { return m.Users } return nil } type AuthRoleDeleteResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthRoleDeleteResponse) Reset() { *m = AuthRoleDeleteResponse{} } func (m *AuthRoleDeleteResponse) String() string { return proto.CompactTextString(m) } func (*AuthRoleDeleteResponse) ProtoMessage() {} func (*AuthRoleDeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{82} } func (m *AuthRoleDeleteResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AuthRoleGrantPermissionResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthRoleGrantPermissionResponse) Reset() { *m = AuthRoleGrantPermissionResponse{} } func (m *AuthRoleGrantPermissionResponse) String() string { return proto.CompactTextString(m) } func (*AuthRoleGrantPermissionResponse) ProtoMessage() {} func (*AuthRoleGrantPermissionResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{83} } func (m *AuthRoleGrantPermissionResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } type AuthRoleRevokePermissionResponse struct { Header *ResponseHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"` } func (m *AuthRoleRevokePermissionResponse) Reset() { *m = AuthRoleRevokePermissionResponse{} } func (m *AuthRoleRevokePermissionResponse) String() string { return proto.CompactTextString(m) } func (*AuthRoleRevokePermissionResponse) ProtoMessage() {} func (*AuthRoleRevokePermissionResponse) Descriptor() ([]byte, []int) { return fileDescriptorRpc, []int{84} } func (m *AuthRoleRevokePermissionResponse) GetHeader() *ResponseHeader { if m != nil { return m.Header } return nil } func init() { proto.RegisterType((*ResponseHeader)(nil), "etcdserverpb.ResponseHeader") proto.RegisterType((*RangeRequest)(nil), "etcdserverpb.RangeRequest") proto.RegisterType((*RangeResponse)(nil), "etcdserverpb.RangeResponse") proto.RegisterType((*PutRequest)(nil), "etcdserverpb.PutRequest") proto.RegisterType((*PutResponse)(nil), "etcdserverpb.PutResponse") proto.RegisterType((*DeleteRangeRequest)(nil), "etcdserverpb.DeleteRangeRequest") proto.RegisterType((*DeleteRangeResponse)(nil), "etcdserverpb.DeleteRangeResponse") proto.RegisterType((*RequestOp)(nil), "etcdserverpb.RequestOp") proto.RegisterType((*ResponseOp)(nil), "etcdserverpb.ResponseOp") proto.RegisterType((*Compare)(nil), "etcdserverpb.Compare") proto.RegisterType((*TxnRequest)(nil), "etcdserverpb.TxnRequest") proto.RegisterType((*TxnResponse)(nil), "etcdserverpb.TxnResponse") proto.RegisterType((*CompactionRequest)(nil), "etcdserverpb.CompactionRequest") proto.RegisterType((*CompactionResponse)(nil), "etcdserverpb.CompactionResponse") proto.RegisterType((*HashRequest)(nil), "etcdserverpb.HashRequest") proto.RegisterType((*HashKVRequest)(nil), "etcdserverpb.HashKVRequest") proto.RegisterType((*HashKVResponse)(nil), "etcdserverpb.HashKVResponse") proto.RegisterType((*HashResponse)(nil), "etcdserverpb.HashResponse") proto.RegisterType((*SnapshotRequest)(nil), "etcdserverpb.SnapshotRequest") proto.RegisterType((*SnapshotResponse)(nil), "etcdserverpb.SnapshotResponse") proto.RegisterType((*WatchRequest)(nil), "etcdserverpb.WatchRequest") proto.RegisterType((*WatchCreateRequest)(nil), "etcdserverpb.WatchCreateRequest") proto.RegisterType((*WatchCancelRequest)(nil), "etcdserverpb.WatchCancelRequest") proto.RegisterType((*WatchResponse)(nil), "etcdserverpb.WatchResponse") proto.RegisterType((*LeaseGrantRequest)(nil), "etcdserverpb.LeaseGrantRequest") proto.RegisterType((*LeaseGrantResponse)(nil), "etcdserverpb.LeaseGrantResponse") proto.RegisterType((*LeaseRevokeRequest)(nil), "etcdserverpb.LeaseRevokeRequest") proto.RegisterType((*LeaseRevokeResponse)(nil), "etcdserverpb.LeaseRevokeResponse") proto.RegisterType((*LeaseKeepAliveRequest)(nil), "etcdserverpb.LeaseKeepAliveRequest") proto.RegisterType((*LeaseKeepAliveResponse)(nil), "etcdserverpb.LeaseKeepAliveResponse") proto.RegisterType((*LeaseTimeToLiveRequest)(nil), "etcdserverpb.LeaseTimeToLiveRequest") proto.RegisterType((*LeaseTimeToLiveResponse)(nil), "etcdserverpb.LeaseTimeToLiveResponse") proto.RegisterType((*LeaseLeasesRequest)(nil), "etcdserverpb.LeaseLeasesRequest") proto.RegisterType((*LeaseStatus)(nil), "etcdserverpb.LeaseStatus") proto.RegisterType((*LeaseLeasesResponse)(nil), "etcdserverpb.LeaseLeasesResponse") proto.RegisterType((*Member)(nil), "etcdserverpb.Member") proto.RegisterType((*MemberAddRequest)(nil), "etcdserverpb.MemberAddRequest") proto.RegisterType((*MemberAddResponse)(nil), "etcdserverpb.MemberAddResponse") proto.RegisterType((*MemberRemoveRequest)(nil), "etcdserverpb.MemberRemoveRequest") proto.RegisterType((*MemberRemoveResponse)(nil), "etcdserverpb.MemberRemoveResponse") proto.RegisterType((*MemberUpdateRequest)(nil), "etcdserverpb.MemberUpdateRequest") proto.RegisterType((*MemberUpdateResponse)(nil), "etcdserverpb.MemberUpdateResponse") proto.RegisterType((*MemberListRequest)(nil), "etcdserverpb.MemberListRequest") proto.RegisterType((*MemberListResponse)(nil), "etcdserverpb.MemberListResponse") proto.RegisterType((*DefragmentRequest)(nil), "etcdserverpb.DefragmentRequest") proto.RegisterType((*DefragmentResponse)(nil), "etcdserverpb.DefragmentResponse") proto.RegisterType((*MoveLeaderRequest)(nil), "etcdserverpb.MoveLeaderRequest") proto.RegisterType((*MoveLeaderResponse)(nil), "etcdserverpb.MoveLeaderResponse") proto.RegisterType((*AlarmRequest)(nil), "etcdserverpb.AlarmRequest") proto.RegisterType((*AlarmMember)(nil), "etcdserverpb.AlarmMember") proto.RegisterType((*AlarmResponse)(nil), "etcdserverpb.AlarmResponse") proto.RegisterType((*StatusRequest)(nil), "etcdserverpb.StatusRequest") proto.RegisterType((*StatusResponse)(nil), "etcdserverpb.StatusResponse") proto.RegisterType((*AuthEnableRequest)(nil), "etcdserverpb.AuthEnableRequest") proto.RegisterType((*AuthDisableRequest)(nil), "etcdserverpb.AuthDisableRequest") proto.RegisterType((*AuthenticateRequest)(nil), "etcdserverpb.AuthenticateRequest") proto.RegisterType((*AuthUserAddRequest)(nil), "etcdserverpb.AuthUserAddRequest") proto.RegisterType((*AuthUserGetRequest)(nil), "etcdserverpb.AuthUserGetRequest") proto.RegisterType((*AuthUserDeleteRequest)(nil), "etcdserverpb.AuthUserDeleteRequest") proto.RegisterType((*AuthUserChangePasswordRequest)(nil), "etcdserverpb.AuthUserChangePasswordRequest") proto.RegisterType((*AuthUserGrantRoleRequest)(nil), "etcdserverpb.AuthUserGrantRoleRequest") proto.RegisterType((*AuthUserRevokeRoleRequest)(nil), "etcdserverpb.AuthUserRevokeRoleRequest") proto.RegisterType((*AuthRoleAddRequest)(nil), "etcdserverpb.AuthRoleAddRequest") proto.RegisterType((*AuthRoleGetRequest)(nil), "etcdserverpb.AuthRoleGetRequest") proto.RegisterType((*AuthUserListRequest)(nil), "etcdserverpb.AuthUserListRequest") proto.RegisterType((*AuthRoleListRequest)(nil), "etcdserverpb.AuthRoleListRequest") proto.RegisterType((*AuthRoleDeleteRequest)(nil), "etcdserverpb.AuthRoleDeleteRequest") proto.RegisterType((*AuthRoleGrantPermissionRequest)(nil), "etcdserverpb.AuthRoleGrantPermissionRequest") proto.RegisterType((*AuthRoleRevokePermissionRequest)(nil), "etcdserverpb.AuthRoleRevokePermissionRequest") proto.RegisterType((*AuthEnableResponse)(nil), "etcdserverpb.AuthEnableResponse") proto.RegisterType((*AuthDisableResponse)(nil), "etcdserverpb.AuthDisableResponse") proto.RegisterType((*AuthenticateResponse)(nil), "etcdserverpb.AuthenticateResponse") proto.RegisterType((*AuthUserAddResponse)(nil), "etcdserverpb.AuthUserAddResponse") proto.RegisterType((*AuthUserGetResponse)(nil), "etcdserverpb.AuthUserGetResponse") proto.RegisterType((*AuthUserDeleteResponse)(nil), "etcdserverpb.AuthUserDeleteResponse") proto.RegisterType((*AuthUserChangePasswordResponse)(nil), "etcdserverpb.AuthUserChangePasswordResponse") proto.RegisterType((*AuthUserGrantRoleResponse)(nil), "etcdserverpb.AuthUserGrantRoleResponse") proto.RegisterType((*AuthUserRevokeRoleResponse)(nil), "etcdserverpb.AuthUserRevokeRoleResponse") proto.RegisterType((*AuthRoleAddResponse)(nil), "etcdserverpb.AuthRoleAddResponse") proto.RegisterType((*AuthRoleGetResponse)(nil), "etcdserverpb.AuthRoleGetResponse") proto.RegisterType((*AuthRoleListResponse)(nil), "etcdserverpb.AuthRoleListResponse") proto.RegisterType((*AuthUserListResponse)(nil), "etcdserverpb.AuthUserListResponse") proto.RegisterType((*AuthRoleDeleteResponse)(nil), "etcdserverpb.AuthRoleDeleteResponse") proto.RegisterType((*AuthRoleGrantPermissionResponse)(nil), "etcdserverpb.AuthRoleGrantPermissionResponse") proto.RegisterType((*AuthRoleRevokePermissionResponse)(nil), "etcdserverpb.AuthRoleRevokePermissionResponse") proto.RegisterEnum("etcdserverpb.AlarmType", AlarmType_name, AlarmType_value) proto.RegisterEnum("etcdserverpb.RangeRequest_SortOrder", RangeRequest_SortOrder_name, RangeRequest_SortOrder_value) proto.RegisterEnum("etcdserverpb.RangeRequest_SortTarget", RangeRequest_SortTarget_name, RangeRequest_SortTarget_value) proto.RegisterEnum("etcdserverpb.Compare_CompareResult", Compare_CompareResult_name, Compare_CompareResult_value) proto.RegisterEnum("etcdserverpb.Compare_CompareTarget", Compare_CompareTarget_name, Compare_CompareTarget_value) proto.RegisterEnum("etcdserverpb.WatchCreateRequest_FilterType", WatchCreateRequest_FilterType_name, WatchCreateRequest_FilterType_value) proto.RegisterEnum("etcdserverpb.AlarmRequest_AlarmAction", AlarmRequest_AlarmAction_name, AlarmRequest_AlarmAction_value) } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // Client API for KV service type KVClient interface { // Range gets the keys in the range from the key-value store. Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) // Put puts the given key into the key-value store. // A put request increments the revision of the key-value store // and generates one event in the event history. Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) // DeleteRange deletes the given range from the key-value store. // A delete request increments the revision of the key-value store // and generates a delete event in the event history for every deleted key. DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) // Txn processes multiple requests in a single transaction. // A txn request increments the revision of the key-value store // and generates events with the same revision for every completed request. // It is not allowed to modify the same key several times within one txn. Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) // Compact compacts the event history in the etcd key-value store. The key-value // store should be periodically compacted or the event history will continue to grow // indefinitely. Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) } type kVClient struct { cc *grpc.ClientConn } func NewKVClient(cc *grpc.ClientConn) KVClient { return &kVClient{cc} } func (c *kVClient) Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error) { out := new(RangeResponse) err := grpc.Invoke(ctx, "/etcdserverpb.KV/Range", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *kVClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) { out := new(PutResponse) err := grpc.Invoke(ctx, "/etcdserverpb.KV/Put", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *kVClient) DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error) { out := new(DeleteRangeResponse) err := grpc.Invoke(ctx, "/etcdserverpb.KV/DeleteRange", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *kVClient) Txn(ctx context.Context, in *TxnRequest, opts ...grpc.CallOption) (*TxnResponse, error) { out := new(TxnResponse) err := grpc.Invoke(ctx, "/etcdserverpb.KV/Txn", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *kVClient) Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error) { out := new(CompactionResponse) err := grpc.Invoke(ctx, "/etcdserverpb.KV/Compact", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } // Server API for KV service type KVServer interface { // Range gets the keys in the range from the key-value store. Range(context.Context, *RangeRequest) (*RangeResponse, error) // Put puts the given key into the key-value store. // A put request increments the revision of the key-value store // and generates one event in the event history. Put(context.Context, *PutRequest) (*PutResponse, error) // DeleteRange deletes the given range from the key-value store. // A delete request increments the revision of the key-value store // and generates a delete event in the event history for every deleted key. DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error) // Txn processes multiple requests in a single transaction. // A txn request increments the revision of the key-value store // and generates events with the same revision for every completed request. // It is not allowed to modify the same key several times within one txn. Txn(context.Context, *TxnRequest) (*TxnResponse, error) // Compact compacts the event history in the etcd key-value store. The key-value // store should be periodically compacted or the event history will continue to grow // indefinitely. Compact(context.Context, *CompactionRequest) (*CompactionResponse, error) } func RegisterKVServer(s *grpc.Server, srv KVServer) { s.RegisterService(&_KV_serviceDesc, srv) } func _KV_Range_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RangeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(KVServer).Range(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.KV/Range", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KVServer).Range(ctx, req.(*RangeRequest)) } return interceptor(ctx, in, info, handler) } func _KV_Put_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PutRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(KVServer).Put(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.KV/Put", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KVServer).Put(ctx, req.(*PutRequest)) } return interceptor(ctx, in, info, handler) } func _KV_DeleteRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteRangeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(KVServer).DeleteRange(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.KV/DeleteRange", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KVServer).DeleteRange(ctx, req.(*DeleteRangeRequest)) } return interceptor(ctx, in, info, handler) } func _KV_Txn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(TxnRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(KVServer).Txn(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.KV/Txn", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KVServer).Txn(ctx, req.(*TxnRequest)) } return interceptor(ctx, in, info, handler) } func _KV_Compact_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CompactionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(KVServer).Compact(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.KV/Compact", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(KVServer).Compact(ctx, req.(*CompactionRequest)) } return interceptor(ctx, in, info, handler) } var _KV_serviceDesc = grpc.ServiceDesc{ ServiceName: "etcdserverpb.KV", HandlerType: (*KVServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Range", Handler: _KV_Range_Handler, }, { MethodName: "Put", Handler: _KV_Put_Handler, }, { MethodName: "DeleteRange", Handler: _KV_DeleteRange_Handler, }, { MethodName: "Txn", Handler: _KV_Txn_Handler, }, { MethodName: "Compact", Handler: _KV_Compact_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "rpc.proto", } // Client API for Watch service type WatchClient interface { // Watch watches for events happening or that have happened. Both input and output // are streams; the input stream is for creating and canceling watchers and the output // stream sends events. One watch RPC can watch on multiple key ranges, streaming events // for several watches at once. The entire event history can be watched starting from the // last compaction revision. Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) } type watchClient struct { cc *grpc.ClientConn } func NewWatchClient(cc *grpc.ClientConn) WatchClient { return &watchClient{cc} } func (c *watchClient) Watch(ctx context.Context, opts ...grpc.CallOption) (Watch_WatchClient, error) { stream, err := grpc.NewClientStream(ctx, &_Watch_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Watch/Watch", opts...) if err != nil { return nil, err } x := &watchWatchClient{stream} return x, nil } type Watch_WatchClient interface { Send(*WatchRequest) error Recv() (*WatchResponse, error) grpc.ClientStream } type watchWatchClient struct { grpc.ClientStream } func (x *watchWatchClient) Send(m *WatchRequest) error { return x.ClientStream.SendMsg(m) } func (x *watchWatchClient) Recv() (*WatchResponse, error) { m := new(WatchResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } // Server API for Watch service type WatchServer interface { // Watch watches for events happening or that have happened. Both input and output // are streams; the input stream is for creating and canceling watchers and the output // stream sends events. One watch RPC can watch on multiple key ranges, streaming events // for several watches at once. The entire event history can be watched starting from the // last compaction revision. Watch(Watch_WatchServer) error } func RegisterWatchServer(s *grpc.Server, srv WatchServer) { s.RegisterService(&_Watch_serviceDesc, srv) } func _Watch_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { return srv.(WatchServer).Watch(&watchWatchServer{stream}) } type Watch_WatchServer interface { Send(*WatchResponse) error Recv() (*WatchRequest, error) grpc.ServerStream } type watchWatchServer struct { grpc.ServerStream } func (x *watchWatchServer) Send(m *WatchResponse) error { return x.ServerStream.SendMsg(m) } func (x *watchWatchServer) Recv() (*WatchRequest, error) { m := new(WatchRequest) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } return m, nil } var _Watch_serviceDesc = grpc.ServiceDesc{ ServiceName: "etcdserverpb.Watch", HandlerType: (*WatchServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Watch", Handler: _Watch_Watch_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "rpc.proto", } // Client API for Lease service type LeaseClient interface { // LeaseGrant creates a lease which expires if the server does not receive a keepAlive // within a given time to live period. All keys attached to the lease will be expired and // deleted if the lease expires. Each expired key generates a delete event in the event history. LeaseGrant(ctx context.Context, in *LeaseGrantRequest, opts ...grpc.CallOption) (*LeaseGrantResponse, error) // LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) // LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client // to the server and streaming keep alive responses from the server to the client. LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) // LeaseTimeToLive retrieves lease information. LeaseTimeToLive(ctx context.Context, in *LeaseTimeToLiveRequest, opts ...grpc.CallOption) (*LeaseTimeToLiveResponse, error) // LeaseLeases lists all existing leases. LeaseLeases(ctx context.Context, in *LeaseLeasesRequest, opts ...grpc.CallOption) (*LeaseLeasesResponse, error) } type leaseClient struct { cc *grpc.ClientConn } func NewLeaseClient(cc *grpc.ClientConn) LeaseClient { return &leaseClient{cc} } func (c *leaseClient) LeaseGrant(ctx context.Context, in *LeaseGrantRequest, opts ...grpc.CallOption) (*LeaseGrantResponse, error) { out := new(LeaseGrantResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseGrant", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *leaseClient) LeaseRevoke(ctx context.Context, in *LeaseRevokeRequest, opts ...grpc.CallOption) (*LeaseRevokeResponse, error) { out := new(LeaseRevokeResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseRevoke", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *leaseClient) LeaseKeepAlive(ctx context.Context, opts ...grpc.CallOption) (Lease_LeaseKeepAliveClient, error) { stream, err := grpc.NewClientStream(ctx, &_Lease_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Lease/LeaseKeepAlive", opts...) if err != nil { return nil, err } x := &leaseLeaseKeepAliveClient{stream} return x, nil } type Lease_LeaseKeepAliveClient interface { Send(*LeaseKeepAliveRequest) error Recv() (*LeaseKeepAliveResponse, error) grpc.ClientStream } type leaseLeaseKeepAliveClient struct { grpc.ClientStream } func (x *leaseLeaseKeepAliveClient) Send(m *LeaseKeepAliveRequest) error { return x.ClientStream.SendMsg(m) } func (x *leaseLeaseKeepAliveClient) Recv() (*LeaseKeepAliveResponse, error) { m := new(LeaseKeepAliveResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *leaseClient) LeaseTimeToLive(ctx context.Context, in *LeaseTimeToLiveRequest, opts ...grpc.CallOption) (*LeaseTimeToLiveResponse, error) { out := new(LeaseTimeToLiveResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseTimeToLive", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *leaseClient) LeaseLeases(ctx context.Context, in *LeaseLeasesRequest, opts ...grpc.CallOption) (*LeaseLeasesResponse, error) { out := new(LeaseLeasesResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Lease/LeaseLeases", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } // Server API for Lease service type LeaseServer interface { // LeaseGrant creates a lease which expires if the server does not receive a keepAlive // within a given time to live period. All keys attached to the lease will be expired and // deleted if the lease expires. Each expired key generates a delete event in the event history. LeaseGrant(context.Context, *LeaseGrantRequest) (*LeaseGrantResponse, error) // LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. LeaseRevoke(context.Context, *LeaseRevokeRequest) (*LeaseRevokeResponse, error) // LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client // to the server and streaming keep alive responses from the server to the client. LeaseKeepAlive(Lease_LeaseKeepAliveServer) error // LeaseTimeToLive retrieves lease information. LeaseTimeToLive(context.Context, *LeaseTimeToLiveRequest) (*LeaseTimeToLiveResponse, error) // LeaseLeases lists all existing leases. LeaseLeases(context.Context, *LeaseLeasesRequest) (*LeaseLeasesResponse, error) } func RegisterLeaseServer(s *grpc.Server, srv LeaseServer) { s.RegisterService(&_Lease_serviceDesc, srv) } func _Lease_LeaseGrant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LeaseGrantRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(LeaseServer).LeaseGrant(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Lease/LeaseGrant", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(LeaseServer).LeaseGrant(ctx, req.(*LeaseGrantRequest)) } return interceptor(ctx, in, info, handler) } func _Lease_LeaseRevoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LeaseRevokeRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(LeaseServer).LeaseRevoke(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Lease/LeaseRevoke", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(LeaseServer).LeaseRevoke(ctx, req.(*LeaseRevokeRequest)) } return interceptor(ctx, in, info, handler) } func _Lease_LeaseKeepAlive_Handler(srv interface{}, stream grpc.ServerStream) error { return srv.(LeaseServer).LeaseKeepAlive(&leaseLeaseKeepAliveServer{stream}) } type Lease_LeaseKeepAliveServer interface { Send(*LeaseKeepAliveResponse) error Recv() (*LeaseKeepAliveRequest, error) grpc.ServerStream } type leaseLeaseKeepAliveServer struct { grpc.ServerStream } func (x *leaseLeaseKeepAliveServer) Send(m *LeaseKeepAliveResponse) error { return x.ServerStream.SendMsg(m) } func (x *leaseLeaseKeepAliveServer) Recv() (*LeaseKeepAliveRequest, error) { m := new(LeaseKeepAliveRequest) if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func _Lease_LeaseTimeToLive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LeaseTimeToLiveRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(LeaseServer).LeaseTimeToLive(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Lease/LeaseTimeToLive", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(LeaseServer).LeaseTimeToLive(ctx, req.(*LeaseTimeToLiveRequest)) } return interceptor(ctx, in, info, handler) } func _Lease_LeaseLeases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LeaseLeasesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(LeaseServer).LeaseLeases(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Lease/LeaseLeases", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(LeaseServer).LeaseLeases(ctx, req.(*LeaseLeasesRequest)) } return interceptor(ctx, in, info, handler) } var _Lease_serviceDesc = grpc.ServiceDesc{ ServiceName: "etcdserverpb.Lease", HandlerType: (*LeaseServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "LeaseGrant", Handler: _Lease_LeaseGrant_Handler, }, { MethodName: "LeaseRevoke", Handler: _Lease_LeaseRevoke_Handler, }, { MethodName: "LeaseTimeToLive", Handler: _Lease_LeaseTimeToLive_Handler, }, { MethodName: "LeaseLeases", Handler: _Lease_LeaseLeases_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "LeaseKeepAlive", Handler: _Lease_LeaseKeepAlive_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "rpc.proto", } // Client API for Cluster service type ClusterClient interface { // MemberAdd adds a member into the cluster. MemberAdd(ctx context.Context, in *MemberAddRequest, opts ...grpc.CallOption) (*MemberAddResponse, error) // MemberRemove removes an existing member from the cluster. MemberRemove(ctx context.Context, in *MemberRemoveRequest, opts ...grpc.CallOption) (*MemberRemoveResponse, error) // MemberUpdate updates the member configuration. MemberUpdate(ctx context.Context, in *MemberUpdateRequest, opts ...grpc.CallOption) (*MemberUpdateResponse, error) // MemberList lists all the members in the cluster. MemberList(ctx context.Context, in *MemberListRequest, opts ...grpc.CallOption) (*MemberListResponse, error) } type clusterClient struct { cc *grpc.ClientConn } func NewClusterClient(cc *grpc.ClientConn) ClusterClient { return &clusterClient{cc} } func (c *clusterClient) MemberAdd(ctx context.Context, in *MemberAddRequest, opts ...grpc.CallOption) (*MemberAddResponse, error) { out := new(MemberAddResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberAdd", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *clusterClient) MemberRemove(ctx context.Context, in *MemberRemoveRequest, opts ...grpc.CallOption) (*MemberRemoveResponse, error) { out := new(MemberRemoveResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberRemove", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *clusterClient) MemberUpdate(ctx context.Context, in *MemberUpdateRequest, opts ...grpc.CallOption) (*MemberUpdateResponse, error) { out := new(MemberUpdateResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberUpdate", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *clusterClient) MemberList(ctx context.Context, in *MemberListRequest, opts ...grpc.CallOption) (*MemberListResponse, error) { out := new(MemberListResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Cluster/MemberList", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } // Server API for Cluster service type ClusterServer interface { // MemberAdd adds a member into the cluster. MemberAdd(context.Context, *MemberAddRequest) (*MemberAddResponse, error) // MemberRemove removes an existing member from the cluster. MemberRemove(context.Context, *MemberRemoveRequest) (*MemberRemoveResponse, error) // MemberUpdate updates the member configuration. MemberUpdate(context.Context, *MemberUpdateRequest) (*MemberUpdateResponse, error) // MemberList lists all the members in the cluster. MemberList(context.Context, *MemberListRequest) (*MemberListResponse, error) } func RegisterClusterServer(s *grpc.Server, srv ClusterServer) { s.RegisterService(&_Cluster_serviceDesc, srv) } func _Cluster_MemberAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MemberAddRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ClusterServer).MemberAdd(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Cluster/MemberAdd", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ClusterServer).MemberAdd(ctx, req.(*MemberAddRequest)) } return interceptor(ctx, in, info, handler) } func _Cluster_MemberRemove_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MemberRemoveRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ClusterServer).MemberRemove(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Cluster/MemberRemove", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ClusterServer).MemberRemove(ctx, req.(*MemberRemoveRequest)) } return interceptor(ctx, in, info, handler) } func _Cluster_MemberUpdate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MemberUpdateRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ClusterServer).MemberUpdate(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Cluster/MemberUpdate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ClusterServer).MemberUpdate(ctx, req.(*MemberUpdateRequest)) } return interceptor(ctx, in, info, handler) } func _Cluster_MemberList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MemberListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ClusterServer).MemberList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Cluster/MemberList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ClusterServer).MemberList(ctx, req.(*MemberListRequest)) } return interceptor(ctx, in, info, handler) } var _Cluster_serviceDesc = grpc.ServiceDesc{ ServiceName: "etcdserverpb.Cluster", HandlerType: (*ClusterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "MemberAdd", Handler: _Cluster_MemberAdd_Handler, }, { MethodName: "MemberRemove", Handler: _Cluster_MemberRemove_Handler, }, { MethodName: "MemberUpdate", Handler: _Cluster_MemberUpdate_Handler, }, { MethodName: "MemberList", Handler: _Cluster_MemberList_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "rpc.proto", } // Client API for Maintenance service type MaintenanceClient interface { // Alarm activates, deactivates, and queries alarms regarding cluster health. Alarm(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*AlarmResponse, error) // Status gets the status of the member. Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) // Defragment defragments a member's backend database to recover storage space. Defragment(ctx context.Context, in *DefragmentRequest, opts ...grpc.CallOption) (*DefragmentResponse, error) // Hash computes the hash of the KV's backend. // This is designed for testing; do not use this in production when there // are ongoing transactions. Hash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*HashResponse, error) // HashKV computes the hash of all MVCC keys up to a given revision. HashKV(ctx context.Context, in *HashKVRequest, opts ...grpc.CallOption) (*HashKVResponse, error) // Snapshot sends a snapshot of the entire backend from a member over a stream to a client. Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (Maintenance_SnapshotClient, error) // MoveLeader requests current leader node to transfer its leadership to transferee. MoveLeader(ctx context.Context, in *MoveLeaderRequest, opts ...grpc.CallOption) (*MoveLeaderResponse, error) } type maintenanceClient struct { cc *grpc.ClientConn } func NewMaintenanceClient(cc *grpc.ClientConn) MaintenanceClient { return &maintenanceClient{cc} } func (c *maintenanceClient) Alarm(ctx context.Context, in *AlarmRequest, opts ...grpc.CallOption) (*AlarmResponse, error) { out := new(AlarmResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Alarm", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *maintenanceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { out := new(StatusResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Status", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *maintenanceClient) Defragment(ctx context.Context, in *DefragmentRequest, opts ...grpc.CallOption) (*DefragmentResponse, error) { out := new(DefragmentResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Defragment", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *maintenanceClient) Hash(ctx context.Context, in *HashRequest, opts ...grpc.CallOption) (*HashResponse, error) { out := new(HashResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/Hash", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *maintenanceClient) HashKV(ctx context.Context, in *HashKVRequest, opts ...grpc.CallOption) (*HashKVResponse, error) { out := new(HashKVResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/HashKV", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *maintenanceClient) Snapshot(ctx context.Context, in *SnapshotRequest, opts ...grpc.CallOption) (Maintenance_SnapshotClient, error) { stream, err := grpc.NewClientStream(ctx, &_Maintenance_serviceDesc.Streams[0], c.cc, "/etcdserverpb.Maintenance/Snapshot", opts...) if err != nil { return nil, err } x := &maintenanceSnapshotClient{stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } if err := x.ClientStream.CloseSend(); err != nil { return nil, err } return x, nil } type Maintenance_SnapshotClient interface { Recv() (*SnapshotResponse, error) grpc.ClientStream } type maintenanceSnapshotClient struct { grpc.ClientStream } func (x *maintenanceSnapshotClient) Recv() (*SnapshotResponse, error) { m := new(SnapshotResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *maintenanceClient) MoveLeader(ctx context.Context, in *MoveLeaderRequest, opts ...grpc.CallOption) (*MoveLeaderResponse, error) { out := new(MoveLeaderResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Maintenance/MoveLeader", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } // Server API for Maintenance service type MaintenanceServer interface { // Alarm activates, deactivates, and queries alarms regarding cluster health. Alarm(context.Context, *AlarmRequest) (*AlarmResponse, error) // Status gets the status of the member. Status(context.Context, *StatusRequest) (*StatusResponse, error) // Defragment defragments a member's backend database to recover storage space. Defragment(context.Context, *DefragmentRequest) (*DefragmentResponse, error) // Hash computes the hash of the KV's backend. // This is designed for testing; do not use this in production when there // are ongoing transactions. Hash(context.Context, *HashRequest) (*HashResponse, error) // HashKV computes the hash of all MVCC keys up to a given revision. HashKV(context.Context, *HashKVRequest) (*HashKVResponse, error) // Snapshot sends a snapshot of the entire backend from a member over a stream to a client. Snapshot(*SnapshotRequest, Maintenance_SnapshotServer) error // MoveLeader requests current leader node to transfer its leadership to transferee. MoveLeader(context.Context, *MoveLeaderRequest) (*MoveLeaderResponse, error) } func RegisterMaintenanceServer(s *grpc.Server, srv MaintenanceServer) { s.RegisterService(&_Maintenance_serviceDesc, srv) } func _Maintenance_Alarm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AlarmRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(MaintenanceServer).Alarm(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Maintenance/Alarm", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MaintenanceServer).Alarm(ctx, req.(*AlarmRequest)) } return interceptor(ctx, in, info, handler) } func _Maintenance_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StatusRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(MaintenanceServer).Status(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Maintenance/Status", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MaintenanceServer).Status(ctx, req.(*StatusRequest)) } return interceptor(ctx, in, info, handler) } func _Maintenance_Defragment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DefragmentRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(MaintenanceServer).Defragment(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Maintenance/Defragment", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MaintenanceServer).Defragment(ctx, req.(*DefragmentRequest)) } return interceptor(ctx, in, info, handler) } func _Maintenance_Hash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(HashRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(MaintenanceServer).Hash(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Maintenance/Hash", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MaintenanceServer).Hash(ctx, req.(*HashRequest)) } return interceptor(ctx, in, info, handler) } func _Maintenance_HashKV_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(HashKVRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(MaintenanceServer).HashKV(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Maintenance/HashKV", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MaintenanceServer).HashKV(ctx, req.(*HashKVRequest)) } return interceptor(ctx, in, info, handler) } func _Maintenance_Snapshot_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(SnapshotRequest) if err := stream.RecvMsg(m); err != nil { return err } return srv.(MaintenanceServer).Snapshot(m, &maintenanceSnapshotServer{stream}) } type Maintenance_SnapshotServer interface { Send(*SnapshotResponse) error grpc.ServerStream } type maintenanceSnapshotServer struct { grpc.ServerStream } func (x *maintenanceSnapshotServer) Send(m *SnapshotResponse) error { return x.ServerStream.SendMsg(m) } func _Maintenance_MoveLeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MoveLeaderRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(MaintenanceServer).MoveLeader(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Maintenance/MoveLeader", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MaintenanceServer).MoveLeader(ctx, req.(*MoveLeaderRequest)) } return interceptor(ctx, in, info, handler) } var _Maintenance_serviceDesc = grpc.ServiceDesc{ ServiceName: "etcdserverpb.Maintenance", HandlerType: (*MaintenanceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Alarm", Handler: _Maintenance_Alarm_Handler, }, { MethodName: "Status", Handler: _Maintenance_Status_Handler, }, { MethodName: "Defragment", Handler: _Maintenance_Defragment_Handler, }, { MethodName: "Hash", Handler: _Maintenance_Hash_Handler, }, { MethodName: "HashKV", Handler: _Maintenance_HashKV_Handler, }, { MethodName: "MoveLeader", Handler: _Maintenance_MoveLeader_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Snapshot", Handler: _Maintenance_Snapshot_Handler, ServerStreams: true, }, }, Metadata: "rpc.proto", } // Client API for Auth service type AuthClient interface { // AuthEnable enables authentication. AuthEnable(ctx context.Context, in *AuthEnableRequest, opts ...grpc.CallOption) (*AuthEnableResponse, error) // AuthDisable disables authentication. AuthDisable(ctx context.Context, in *AuthDisableRequest, opts ...grpc.CallOption) (*AuthDisableResponse, error) // Authenticate processes an authenticate request. Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error) // UserAdd adds a new user. UserAdd(ctx context.Context, in *AuthUserAddRequest, opts ...grpc.CallOption) (*AuthUserAddResponse, error) // UserGet gets detailed user information. UserGet(ctx context.Context, in *AuthUserGetRequest, opts ...grpc.CallOption) (*AuthUserGetResponse, error) // UserList gets a list of all users. UserList(ctx context.Context, in *AuthUserListRequest, opts ...grpc.CallOption) (*AuthUserListResponse, error) // UserDelete deletes a specified user. UserDelete(ctx context.Context, in *AuthUserDeleteRequest, opts ...grpc.CallOption) (*AuthUserDeleteResponse, error) // UserChangePassword changes the password of a specified user. UserChangePassword(ctx context.Context, in *AuthUserChangePasswordRequest, opts ...grpc.CallOption) (*AuthUserChangePasswordResponse, error) // UserGrant grants a role to a specified user. UserGrantRole(ctx context.Context, in *AuthUserGrantRoleRequest, opts ...grpc.CallOption) (*AuthUserGrantRoleResponse, error) // UserRevokeRole revokes a role of specified user. UserRevokeRole(ctx context.Context, in *AuthUserRevokeRoleRequest, opts ...grpc.CallOption) (*AuthUserRevokeRoleResponse, error) // RoleAdd adds a new role. RoleAdd(ctx context.Context, in *AuthRoleAddRequest, opts ...grpc.CallOption) (*AuthRoleAddResponse, error) // RoleGet gets detailed role information. RoleGet(ctx context.Context, in *AuthRoleGetRequest, opts ...grpc.CallOption) (*AuthRoleGetResponse, error) // RoleList gets lists of all roles. RoleList(ctx context.Context, in *AuthRoleListRequest, opts ...grpc.CallOption) (*AuthRoleListResponse, error) // RoleDelete deletes a specified role. RoleDelete(ctx context.Context, in *AuthRoleDeleteRequest, opts ...grpc.CallOption) (*AuthRoleDeleteResponse, error) // RoleGrantPermission grants a permission of a specified key or range to a specified role. RoleGrantPermission(ctx context.Context, in *AuthRoleGrantPermissionRequest, opts ...grpc.CallOption) (*AuthRoleGrantPermissionResponse, error) // RoleRevokePermission revokes a key or range permission of a specified role. RoleRevokePermission(ctx context.Context, in *AuthRoleRevokePermissionRequest, opts ...grpc.CallOption) (*AuthRoleRevokePermissionResponse, error) } type authClient struct { cc *grpc.ClientConn } func NewAuthClient(cc *grpc.ClientConn) AuthClient { return &authClient{cc} } func (c *authClient) AuthEnable(ctx context.Context, in *AuthEnableRequest, opts ...grpc.CallOption) (*AuthEnableResponse, error) { out := new(AuthEnableResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/AuthEnable", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) AuthDisable(ctx context.Context, in *AuthDisableRequest, opts ...grpc.CallOption) (*AuthDisableResponse, error) { out := new(AuthDisableResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/AuthDisable", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) Authenticate(ctx context.Context, in *AuthenticateRequest, opts ...grpc.CallOption) (*AuthenticateResponse, error) { out := new(AuthenticateResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/Authenticate", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) UserAdd(ctx context.Context, in *AuthUserAddRequest, opts ...grpc.CallOption) (*AuthUserAddResponse, error) { out := new(AuthUserAddResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserAdd", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) UserGet(ctx context.Context, in *AuthUserGetRequest, opts ...grpc.CallOption) (*AuthUserGetResponse, error) { out := new(AuthUserGetResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserGet", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) UserList(ctx context.Context, in *AuthUserListRequest, opts ...grpc.CallOption) (*AuthUserListResponse, error) { out := new(AuthUserListResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserList", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) UserDelete(ctx context.Context, in *AuthUserDeleteRequest, opts ...grpc.CallOption) (*AuthUserDeleteResponse, error) { out := new(AuthUserDeleteResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserDelete", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) UserChangePassword(ctx context.Context, in *AuthUserChangePasswordRequest, opts ...grpc.CallOption) (*AuthUserChangePasswordResponse, error) { out := new(AuthUserChangePasswordResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserChangePassword", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) UserGrantRole(ctx context.Context, in *AuthUserGrantRoleRequest, opts ...grpc.CallOption) (*AuthUserGrantRoleResponse, error) { out := new(AuthUserGrantRoleResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserGrantRole", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) UserRevokeRole(ctx context.Context, in *AuthUserRevokeRoleRequest, opts ...grpc.CallOption) (*AuthUserRevokeRoleResponse, error) { out := new(AuthUserRevokeRoleResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/UserRevokeRole", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) RoleAdd(ctx context.Context, in *AuthRoleAddRequest, opts ...grpc.CallOption) (*AuthRoleAddResponse, error) { out := new(AuthRoleAddResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleAdd", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) RoleGet(ctx context.Context, in *AuthRoleGetRequest, opts ...grpc.CallOption) (*AuthRoleGetResponse, error) { out := new(AuthRoleGetResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleGet", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) RoleList(ctx context.Context, in *AuthRoleListRequest, opts ...grpc.CallOption) (*AuthRoleListResponse, error) { out := new(AuthRoleListResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleList", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) RoleDelete(ctx context.Context, in *AuthRoleDeleteRequest, opts ...grpc.CallOption) (*AuthRoleDeleteResponse, error) { out := new(AuthRoleDeleteResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleDelete", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) RoleGrantPermission(ctx context.Context, in *AuthRoleGrantPermissionRequest, opts ...grpc.CallOption) (*AuthRoleGrantPermissionResponse, error) { out := new(AuthRoleGrantPermissionResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleGrantPermission", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } func (c *authClient) RoleRevokePermission(ctx context.Context, in *AuthRoleRevokePermissionRequest, opts ...grpc.CallOption) (*AuthRoleRevokePermissionResponse, error) { out := new(AuthRoleRevokePermissionResponse) err := grpc.Invoke(ctx, "/etcdserverpb.Auth/RoleRevokePermission", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } // Server API for Auth service type AuthServer interface { // AuthEnable enables authentication. AuthEnable(context.Context, *AuthEnableRequest) (*AuthEnableResponse, error) // AuthDisable disables authentication. AuthDisable(context.Context, *AuthDisableRequest) (*AuthDisableResponse, error) // Authenticate processes an authenticate request. Authenticate(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error) // UserAdd adds a new user. UserAdd(context.Context, *AuthUserAddRequest) (*AuthUserAddResponse, error) // UserGet gets detailed user information. UserGet(context.Context, *AuthUserGetRequest) (*AuthUserGetResponse, error) // UserList gets a list of all users. UserList(context.Context, *AuthUserListRequest) (*AuthUserListResponse, error) // UserDelete deletes a specified user. UserDelete(context.Context, *AuthUserDeleteRequest) (*AuthUserDeleteResponse, error) // UserChangePassword changes the password of a specified user. UserChangePassword(context.Context, *AuthUserChangePasswordRequest) (*AuthUserChangePasswordResponse, error) // UserGrant grants a role to a specified user. UserGrantRole(context.Context, *AuthUserGrantRoleRequest) (*AuthUserGrantRoleResponse, error) // UserRevokeRole revokes a role of specified user. UserRevokeRole(context.Context, *AuthUserRevokeRoleRequest) (*AuthUserRevokeRoleResponse, error) // RoleAdd adds a new role. RoleAdd(context.Context, *AuthRoleAddRequest) (*AuthRoleAddResponse, error) // RoleGet gets detailed role information. RoleGet(context.Context, *AuthRoleGetRequest) (*AuthRoleGetResponse, error) // RoleList gets lists of all roles. RoleList(context.Context, *AuthRoleListRequest) (*AuthRoleListResponse, error) // RoleDelete deletes a specified role. RoleDelete(context.Context, *AuthRoleDeleteRequest) (*AuthRoleDeleteResponse, error) // RoleGrantPermission grants a permission of a specified key or range to a specified role. RoleGrantPermission(context.Context, *AuthRoleGrantPermissionRequest) (*AuthRoleGrantPermissionResponse, error) // RoleRevokePermission revokes a key or range permission of a specified role. RoleRevokePermission(context.Context, *AuthRoleRevokePermissionRequest) (*AuthRoleRevokePermissionResponse, error) } func RegisterAuthServer(s *grpc.Server, srv AuthServer) { s.RegisterService(&_Auth_serviceDesc, srv) } func _Auth_AuthEnable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthEnableRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).AuthEnable(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/AuthEnable", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).AuthEnable(ctx, req.(*AuthEnableRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_AuthDisable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthDisableRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).AuthDisable(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/AuthDisable", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).AuthDisable(ctx, req.(*AuthDisableRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthenticateRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).Authenticate(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/Authenticate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).Authenticate(ctx, req.(*AuthenticateRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_UserAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthUserAddRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).UserAdd(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/UserAdd", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).UserAdd(ctx, req.(*AuthUserAddRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_UserGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthUserGetRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).UserGet(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/UserGet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).UserGet(ctx, req.(*AuthUserGetRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_UserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthUserListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).UserList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/UserList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).UserList(ctx, req.(*AuthUserListRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_UserDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthUserDeleteRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).UserDelete(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/UserDelete", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).UserDelete(ctx, req.(*AuthUserDeleteRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_UserChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthUserChangePasswordRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).UserChangePassword(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/UserChangePassword", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).UserChangePassword(ctx, req.(*AuthUserChangePasswordRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_UserGrantRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthUserGrantRoleRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).UserGrantRole(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/UserGrantRole", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).UserGrantRole(ctx, req.(*AuthUserGrantRoleRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_UserRevokeRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthUserRevokeRoleRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).UserRevokeRole(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/UserRevokeRole", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).UserRevokeRole(ctx, req.(*AuthUserRevokeRoleRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_RoleAdd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthRoleAddRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).RoleAdd(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/RoleAdd", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).RoleAdd(ctx, req.(*AuthRoleAddRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_RoleGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthRoleGetRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).RoleGet(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/RoleGet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).RoleGet(ctx, req.(*AuthRoleGetRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_RoleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthRoleListRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).RoleList(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/RoleList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).RoleList(ctx, req.(*AuthRoleListRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_RoleDelete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthRoleDeleteRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).RoleDelete(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/RoleDelete", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).RoleDelete(ctx, req.(*AuthRoleDeleteRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_RoleGrantPermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthRoleGrantPermissionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).RoleGrantPermission(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/RoleGrantPermission", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).RoleGrantPermission(ctx, req.(*AuthRoleGrantPermissionRequest)) } return interceptor(ctx, in, info, handler) } func _Auth_RoleRevokePermission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthRoleRevokePermissionRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(AuthServer).RoleRevokePermission(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/etcdserverpb.Auth/RoleRevokePermission", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthServer).RoleRevokePermission(ctx, req.(*AuthRoleRevokePermissionRequest)) } return interceptor(ctx, in, info, handler) } var _Auth_serviceDesc = grpc.ServiceDesc{ ServiceName: "etcdserverpb.Auth", HandlerType: (*AuthServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "AuthEnable", Handler: _Auth_AuthEnable_Handler, }, { MethodName: "AuthDisable", Handler: _Auth_AuthDisable_Handler, }, { MethodName: "Authenticate", Handler: _Auth_Authenticate_Handler, }, { MethodName: "UserAdd", Handler: _Auth_UserAdd_Handler, }, { MethodName: "UserGet", Handler: _Auth_UserGet_Handler, }, { MethodName: "UserList", Handler: _Auth_UserList_Handler, }, { MethodName: "UserDelete", Handler: _Auth_UserDelete_Handler, }, { MethodName: "UserChangePassword", Handler: _Auth_UserChangePassword_Handler, }, { MethodName: "UserGrantRole", Handler: _Auth_UserGrantRole_Handler, }, { MethodName: "UserRevokeRole", Handler: _Auth_UserRevokeRole_Handler, }, { MethodName: "RoleAdd", Handler: _Auth_RoleAdd_Handler, }, { MethodName: "RoleGet", Handler: _Auth_RoleGet_Handler, }, { MethodName: "RoleList", Handler: _Auth_RoleList_Handler, }, { MethodName: "RoleDelete", Handler: _Auth_RoleDelete_Handler, }, { MethodName: "RoleGrantPermission", Handler: _Auth_RoleGrantPermission_Handler, }, { MethodName: "RoleRevokePermission", Handler: _Auth_RoleRevokePermission_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "rpc.proto", } func (m *ResponseHeader) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ResponseHeader) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.ClusterId != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ClusterId)) } if m.MemberId != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.MemberId)) } if m.Revision != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) } if m.RaftTerm != 0 { dAtA[i] = 0x20 i++ i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) } return i, nil } func (m *RangeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RangeRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Key) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) i += copy(dAtA[i:], m.Key) } if len(m.RangeEnd) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) i += copy(dAtA[i:], m.RangeEnd) } if m.Limit != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Limit)) } if m.Revision != 0 { dAtA[i] = 0x20 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) } if m.SortOrder != 0 { dAtA[i] = 0x28 i++ i = encodeVarintRpc(dAtA, i, uint64(m.SortOrder)) } if m.SortTarget != 0 { dAtA[i] = 0x30 i++ i = encodeVarintRpc(dAtA, i, uint64(m.SortTarget)) } if m.Serializable { dAtA[i] = 0x38 i++ if m.Serializable { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.KeysOnly { dAtA[i] = 0x40 i++ if m.KeysOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.CountOnly { dAtA[i] = 0x48 i++ if m.CountOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.MinModRevision != 0 { dAtA[i] = 0x50 i++ i = encodeVarintRpc(dAtA, i, uint64(m.MinModRevision)) } if m.MaxModRevision != 0 { dAtA[i] = 0x58 i++ i = encodeVarintRpc(dAtA, i, uint64(m.MaxModRevision)) } if m.MinCreateRevision != 0 { dAtA[i] = 0x60 i++ i = encodeVarintRpc(dAtA, i, uint64(m.MinCreateRevision)) } if m.MaxCreateRevision != 0 { dAtA[i] = 0x68 i++ i = encodeVarintRpc(dAtA, i, uint64(m.MaxCreateRevision)) } return i, nil } func (m *RangeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RangeResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n1, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n1 } if len(m.Kvs) > 0 { for _, msg := range m.Kvs { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } if m.More { dAtA[i] = 0x18 i++ if m.More { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Count != 0 { dAtA[i] = 0x20 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Count)) } return i, nil } func (m *PutRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PutRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Key) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) i += copy(dAtA[i:], m.Key) } if len(m.Value) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) i += copy(dAtA[i:], m.Value) } if m.Lease != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Lease)) } if m.PrevKv { dAtA[i] = 0x20 i++ if m.PrevKv { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.IgnoreValue { dAtA[i] = 0x28 i++ if m.IgnoreValue { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.IgnoreLease { dAtA[i] = 0x30 i++ if m.IgnoreLease { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *PutResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PutResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n2, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n2 } if m.PrevKv != nil { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(m.PrevKv.Size())) n3, err := m.PrevKv.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n3 } return i, nil } func (m *DeleteRangeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DeleteRangeRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Key) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) i += copy(dAtA[i:], m.Key) } if len(m.RangeEnd) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) i += copy(dAtA[i:], m.RangeEnd) } if m.PrevKv { dAtA[i] = 0x18 i++ if m.PrevKv { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *DeleteRangeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DeleteRangeResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n4, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n4 } if m.Deleted != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Deleted)) } if len(m.PrevKvs) > 0 { for _, msg := range m.PrevKvs { dAtA[i] = 0x1a i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *RequestOp) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RequestOp) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Request != nil { nn5, err := m.Request.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += nn5 } return i, nil } func (m *RequestOp_RequestRange) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.RequestRange != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.RequestRange.Size())) n6, err := m.RequestRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n6 } return i, nil } func (m *RequestOp_RequestPut) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.RequestPut != nil { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(m.RequestPut.Size())) n7, err := m.RequestPut.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n7 } return i, nil } func (m *RequestOp_RequestDeleteRange) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.RequestDeleteRange != nil { dAtA[i] = 0x1a i++ i = encodeVarintRpc(dAtA, i, uint64(m.RequestDeleteRange.Size())) n8, err := m.RequestDeleteRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n8 } return i, nil } func (m *RequestOp_RequestTxn) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.RequestTxn != nil { dAtA[i] = 0x22 i++ i = encodeVarintRpc(dAtA, i, uint64(m.RequestTxn.Size())) n9, err := m.RequestTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n9 } return i, nil } func (m *ResponseOp) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ResponseOp) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Response != nil { nn10, err := m.Response.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += nn10 } return i, nil } func (m *ResponseOp_ResponseRange) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.ResponseRange != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.ResponseRange.Size())) n11, err := m.ResponseRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n11 } return i, nil } func (m *ResponseOp_ResponsePut) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.ResponsePut != nil { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ResponsePut.Size())) n12, err := m.ResponsePut.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n12 } return i, nil } func (m *ResponseOp_ResponseDeleteRange) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.ResponseDeleteRange != nil { dAtA[i] = 0x1a i++ i = encodeVarintRpc(dAtA, i, uint64(m.ResponseDeleteRange.Size())) n13, err := m.ResponseDeleteRange.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n13 } return i, nil } func (m *ResponseOp_ResponseTxn) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.ResponseTxn != nil { dAtA[i] = 0x22 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ResponseTxn.Size())) n14, err := m.ResponseTxn.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n14 } return i, nil } func (m *Compare) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Compare) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Result != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Result)) } if m.Target != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Target)) } if len(m.Key) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) i += copy(dAtA[i:], m.Key) } if m.TargetUnion != nil { nn15, err := m.TargetUnion.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += nn15 } if len(m.RangeEnd) > 0 { dAtA[i] = 0x82 i++ dAtA[i] = 0x4 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) i += copy(dAtA[i:], m.RangeEnd) } return i, nil } func (m *Compare_Version) MarshalTo(dAtA []byte) (int, error) { i := 0 dAtA[i] = 0x20 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Version)) return i, nil } func (m *Compare_CreateRevision) MarshalTo(dAtA []byte) (int, error) { i := 0 dAtA[i] = 0x28 i++ i = encodeVarintRpc(dAtA, i, uint64(m.CreateRevision)) return i, nil } func (m *Compare_ModRevision) MarshalTo(dAtA []byte) (int, error) { i := 0 dAtA[i] = 0x30 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ModRevision)) return i, nil } func (m *Compare_Value) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.Value != nil { dAtA[i] = 0x3a i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Value))) i += copy(dAtA[i:], m.Value) } return i, nil } func (m *Compare_Lease) MarshalTo(dAtA []byte) (int, error) { i := 0 dAtA[i] = 0x40 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Lease)) return i, nil } func (m *TxnRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *TxnRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Compare) > 0 { for _, msg := range m.Compare { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } if len(m.Success) > 0 { for _, msg := range m.Success { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } if len(m.Failure) > 0 { for _, msg := range m.Failure { dAtA[i] = 0x1a i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *TxnResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *TxnResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n16, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n16 } if m.Succeeded { dAtA[i] = 0x10 i++ if m.Succeeded { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if len(m.Responses) > 0 { for _, msg := range m.Responses { dAtA[i] = 0x1a i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *CompactionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CompactionRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Revision != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) } if m.Physical { dAtA[i] = 0x10 i++ if m.Physical { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *CompactionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CompactionResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n17, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n17 } return i, nil } func (m *HashRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *HashRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *HashKVRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *HashKVRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Revision != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Revision)) } return i, nil } func (m *HashKVResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *HashKVResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n18, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n18 } if m.Hash != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Hash)) } if m.CompactRevision != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRpc(dAtA, i, uint64(m.CompactRevision)) } return i, nil } func (m *HashResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *HashResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n19, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n19 } if m.Hash != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Hash)) } return i, nil } func (m *SnapshotRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *SnapshotRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *SnapshotResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *SnapshotResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n20, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n20 } if m.RemainingBytes != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.RemainingBytes)) } if len(m.Blob) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Blob))) i += copy(dAtA[i:], m.Blob) } return i, nil } func (m *WatchRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *WatchRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.RequestUnion != nil { nn21, err := m.RequestUnion.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += nn21 } return i, nil } func (m *WatchRequest_CreateRequest) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.CreateRequest != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.CreateRequest.Size())) n22, err := m.CreateRequest.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n22 } return i, nil } func (m *WatchRequest_CancelRequest) MarshalTo(dAtA []byte) (int, error) { i := 0 if m.CancelRequest != nil { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(m.CancelRequest.Size())) n23, err := m.CancelRequest.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n23 } return i, nil } func (m *WatchCreateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *WatchCreateRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Key) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) i += copy(dAtA[i:], m.Key) } if len(m.RangeEnd) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) i += copy(dAtA[i:], m.RangeEnd) } if m.StartRevision != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRpc(dAtA, i, uint64(m.StartRevision)) } if m.ProgressNotify { dAtA[i] = 0x20 i++ if m.ProgressNotify { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if len(m.Filters) > 0 { dAtA25 := make([]byte, len(m.Filters)*10) var j24 int for _, num := range m.Filters { for num >= 1<<7 { dAtA25[j24] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 j24++ } dAtA25[j24] = uint8(num) j24++ } dAtA[i] = 0x2a i++ i = encodeVarintRpc(dAtA, i, uint64(j24)) i += copy(dAtA[i:], dAtA25[:j24]) } if m.PrevKv { dAtA[i] = 0x30 i++ if m.PrevKv { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *WatchCancelRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *WatchCancelRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.WatchId != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) } return i, nil } func (m *WatchResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *WatchResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n26, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n26 } if m.WatchId != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.WatchId)) } if m.Created { dAtA[i] = 0x18 i++ if m.Created { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.Canceled { dAtA[i] = 0x20 i++ if m.Canceled { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } if m.CompactRevision != 0 { dAtA[i] = 0x28 i++ i = encodeVarintRpc(dAtA, i, uint64(m.CompactRevision)) } if len(m.CancelReason) > 0 { dAtA[i] = 0x32 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.CancelReason))) i += copy(dAtA[i:], m.CancelReason) } if len(m.Events) > 0 { for _, msg := range m.Events { dAtA[i] = 0x5a i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *LeaseGrantRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseGrantRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.TTL != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) } if m.ID != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } return i, nil } func (m *LeaseGrantResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseGrantResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n27, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n27 } if m.ID != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } if m.TTL != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) } if len(m.Error) > 0 { dAtA[i] = 0x22 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Error))) i += copy(dAtA[i:], m.Error) } return i, nil } func (m *LeaseRevokeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseRevokeRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.ID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } return i, nil } func (m *LeaseRevokeResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseRevokeResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n28, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n28 } return i, nil } func (m *LeaseKeepAliveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseKeepAliveRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.ID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } return i, nil } func (m *LeaseKeepAliveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseKeepAliveResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n29, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n29 } if m.ID != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } if m.TTL != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) } return i, nil } func (m *LeaseTimeToLiveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseTimeToLiveRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.ID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } if m.Keys { dAtA[i] = 0x10 i++ if m.Keys { dAtA[i] = 1 } else { dAtA[i] = 0 } i++ } return i, nil } func (m *LeaseTimeToLiveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseTimeToLiveResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n30, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n30 } if m.ID != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } if m.TTL != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRpc(dAtA, i, uint64(m.TTL)) } if m.GrantedTTL != 0 { dAtA[i] = 0x20 i++ i = encodeVarintRpc(dAtA, i, uint64(m.GrantedTTL)) } if len(m.Keys) > 0 { for _, b := range m.Keys { dAtA[i] = 0x2a i++ i = encodeVarintRpc(dAtA, i, uint64(len(b))) i += copy(dAtA[i:], b) } } return i, nil } func (m *LeaseLeasesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseLeasesRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *LeaseStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseStatus) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.ID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } return i, nil } func (m *LeaseLeasesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *LeaseLeasesResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n31, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n31 } if len(m.Leases) > 0 { for _, msg := range m.Leases { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *Member) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Member) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.ID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } if len(m.Name) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if len(m.PeerURLs) > 0 { for _, s := range m.PeerURLs { dAtA[i] = 0x1a i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if len(m.ClientURLs) > 0 { for _, s := range m.ClientURLs { dAtA[i] = 0x22 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } return i, nil } func (m *MemberAddRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MemberAddRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.PeerURLs) > 0 { for _, s := range m.PeerURLs { dAtA[i] = 0xa i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } return i, nil } func (m *MemberAddResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MemberAddResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n32, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n32 } if m.Member != nil { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Member.Size())) n33, err := m.Member.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n33 } if len(m.Members) > 0 { for _, msg := range m.Members { dAtA[i] = 0x1a i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *MemberRemoveRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MemberRemoveRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.ID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } return i, nil } func (m *MemberRemoveResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MemberRemoveResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n34, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n34 } if len(m.Members) > 0 { for _, msg := range m.Members { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *MemberUpdateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MemberUpdateRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.ID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.ID)) } if len(m.PeerURLs) > 0 { for _, s := range m.PeerURLs { dAtA[i] = 0x12 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } return i, nil } func (m *MemberUpdateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MemberUpdateResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n35, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n35 } if len(m.Members) > 0 { for _, msg := range m.Members { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *MemberListRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MemberListRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *MemberListResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MemberListResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n36, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n36 } if len(m.Members) > 0 { for _, msg := range m.Members { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *DefragmentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DefragmentRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *DefragmentResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DefragmentResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n37, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n37 } return i, nil } func (m *MoveLeaderRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MoveLeaderRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.TargetID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.TargetID)) } return i, nil } func (m *MoveLeaderResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MoveLeaderResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n38, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n38 } return i, nil } func (m *AlarmRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AlarmRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Action != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Action)) } if m.MemberID != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.MemberID)) } if m.Alarm != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Alarm)) } return i, nil } func (m *AlarmMember) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AlarmMember) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.MemberID != 0 { dAtA[i] = 0x8 i++ i = encodeVarintRpc(dAtA, i, uint64(m.MemberID)) } if m.Alarm != 0 { dAtA[i] = 0x10 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Alarm)) } return i, nil } func (m *AlarmResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AlarmResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n39, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n39 } if len(m.Alarms) > 0 { for _, msg := range m.Alarms { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *StatusRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *StatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n40, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n40 } if len(m.Version) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Version))) i += copy(dAtA[i:], m.Version) } if m.DbSize != 0 { dAtA[i] = 0x18 i++ i = encodeVarintRpc(dAtA, i, uint64(m.DbSize)) } if m.Leader != 0 { dAtA[i] = 0x20 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Leader)) } if m.RaftIndex != 0 { dAtA[i] = 0x28 i++ i = encodeVarintRpc(dAtA, i, uint64(m.RaftIndex)) } if m.RaftTerm != 0 { dAtA[i] = 0x30 i++ i = encodeVarintRpc(dAtA, i, uint64(m.RaftTerm)) } return i, nil } func (m *AuthEnableRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthEnableRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *AuthDisableRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthDisableRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *AuthenticateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthenticateRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if len(m.Password) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) i += copy(dAtA[i:], m.Password) } return i, nil } func (m *AuthUserAddRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserAddRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if len(m.Password) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) i += copy(dAtA[i:], m.Password) } return i, nil } func (m *AuthUserGetRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserGetRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } return i, nil } func (m *AuthUserDeleteRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserDeleteRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } return i, nil } func (m *AuthUserChangePasswordRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserChangePasswordRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if len(m.Password) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Password))) i += copy(dAtA[i:], m.Password) } return i, nil } func (m *AuthUserGrantRoleRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserGrantRoleRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.User) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.User))) i += copy(dAtA[i:], m.User) } if len(m.Role) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) i += copy(dAtA[i:], m.Role) } return i, nil } func (m *AuthUserRevokeRoleRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserRevokeRoleRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if len(m.Role) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) i += copy(dAtA[i:], m.Role) } return i, nil } func (m *AuthRoleAddRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleAddRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } return i, nil } func (m *AuthRoleGetRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleGetRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Role) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) i += copy(dAtA[i:], m.Role) } return i, nil } func (m *AuthUserListRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserListRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *AuthRoleListRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleListRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l return i, nil } func (m *AuthRoleDeleteRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleDeleteRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Role) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) i += copy(dAtA[i:], m.Role) } return i, nil } func (m *AuthRoleGrantPermissionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleGrantPermissionRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Name) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Name))) i += copy(dAtA[i:], m.Name) } if m.Perm != nil { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(m.Perm.Size())) n41, err := m.Perm.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n41 } return i, nil } func (m *AuthRoleRevokePermissionRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleRevokePermissionRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Role) > 0 { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Role))) i += copy(dAtA[i:], m.Role) } if len(m.Key) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Key))) i += copy(dAtA[i:], m.Key) } if len(m.RangeEnd) > 0 { dAtA[i] = 0x1a i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.RangeEnd))) i += copy(dAtA[i:], m.RangeEnd) } return i, nil } func (m *AuthEnableResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthEnableResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n42, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n42 } return i, nil } func (m *AuthDisableResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthDisableResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n43, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n43 } return i, nil } func (m *AuthenticateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthenticateResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n44, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n44 } if len(m.Token) > 0 { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(len(m.Token))) i += copy(dAtA[i:], m.Token) } return i, nil } func (m *AuthUserAddResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserAddResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n45, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n45 } return i, nil } func (m *AuthUserGetResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserGetResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n46, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n46 } if len(m.Roles) > 0 { for _, s := range m.Roles { dAtA[i] = 0x12 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } return i, nil } func (m *AuthUserDeleteResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserDeleteResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n47, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n47 } return i, nil } func (m *AuthUserChangePasswordResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserChangePasswordResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n48, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n48 } return i, nil } func (m *AuthUserGrantRoleResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserGrantRoleResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n49, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n49 } return i, nil } func (m *AuthUserRevokeRoleResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserRevokeRoleResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n50, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n50 } return i, nil } func (m *AuthRoleAddResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleAddResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n51, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n51 } return i, nil } func (m *AuthRoleGetResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleGetResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n52, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n52 } if len(m.Perm) > 0 { for _, msg := range m.Perm { dAtA[i] = 0x12 i++ i = encodeVarintRpc(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *AuthRoleListResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleListResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n53, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n53 } if len(m.Roles) > 0 { for _, s := range m.Roles { dAtA[i] = 0x12 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } return i, nil } func (m *AuthUserListResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthUserListResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n54, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n54 } if len(m.Users) > 0 { for _, s := range m.Users { dAtA[i] = 0x12 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } return i, nil } func (m *AuthRoleDeleteResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleDeleteResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n55, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n55 } return i, nil } func (m *AuthRoleGrantPermissionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleGrantPermissionResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n56, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n56 } return i, nil } func (m *AuthRoleRevokePermissionResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AuthRoleRevokePermissionResponse) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Header != nil { dAtA[i] = 0xa i++ i = encodeVarintRpc(dAtA, i, uint64(m.Header.Size())) n57, err := m.Header.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n57 } return i, nil } func encodeVarintRpc(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return offset + 1 } func (m *ResponseHeader) Size() (n int) { var l int _ = l if m.ClusterId != 0 { n += 1 + sovRpc(uint64(m.ClusterId)) } if m.MemberId != 0 { n += 1 + sovRpc(uint64(m.MemberId)) } if m.Revision != 0 { n += 1 + sovRpc(uint64(m.Revision)) } if m.RaftTerm != 0 { n += 1 + sovRpc(uint64(m.RaftTerm)) } return n } func (m *RangeRequest) Size() (n int) { var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.RangeEnd) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } if m.Limit != 0 { n += 1 + sovRpc(uint64(m.Limit)) } if m.Revision != 0 { n += 1 + sovRpc(uint64(m.Revision)) } if m.SortOrder != 0 { n += 1 + sovRpc(uint64(m.SortOrder)) } if m.SortTarget != 0 { n += 1 + sovRpc(uint64(m.SortTarget)) } if m.Serializable { n += 2 } if m.KeysOnly { n += 2 } if m.CountOnly { n += 2 } if m.MinModRevision != 0 { n += 1 + sovRpc(uint64(m.MinModRevision)) } if m.MaxModRevision != 0 { n += 1 + sovRpc(uint64(m.MaxModRevision)) } if m.MinCreateRevision != 0 { n += 1 + sovRpc(uint64(m.MinCreateRevision)) } if m.MaxCreateRevision != 0 { n += 1 + sovRpc(uint64(m.MaxCreateRevision)) } return n } func (m *RangeResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Kvs) > 0 { for _, e := range m.Kvs { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } if m.More { n += 2 } if m.Count != 0 { n += 1 + sovRpc(uint64(m.Count)) } return n } func (m *PutRequest) Size() (n int) { var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.Value) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } if m.Lease != 0 { n += 1 + sovRpc(uint64(m.Lease)) } if m.PrevKv { n += 2 } if m.IgnoreValue { n += 2 } if m.IgnoreLease { n += 2 } return n } func (m *PutResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.PrevKv != nil { l = m.PrevKv.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *DeleteRangeRequest) Size() (n int) { var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.RangeEnd) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } if m.PrevKv { n += 2 } return n } func (m *DeleteRangeResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.Deleted != 0 { n += 1 + sovRpc(uint64(m.Deleted)) } if len(m.PrevKvs) > 0 { for _, e := range m.PrevKvs { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *RequestOp) Size() (n int) { var l int _ = l if m.Request != nil { n += m.Request.Size() } return n } func (m *RequestOp_RequestRange) Size() (n int) { var l int _ = l if m.RequestRange != nil { l = m.RequestRange.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *RequestOp_RequestPut) Size() (n int) { var l int _ = l if m.RequestPut != nil { l = m.RequestPut.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *RequestOp_RequestDeleteRange) Size() (n int) { var l int _ = l if m.RequestDeleteRange != nil { l = m.RequestDeleteRange.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *RequestOp_RequestTxn) Size() (n int) { var l int _ = l if m.RequestTxn != nil { l = m.RequestTxn.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *ResponseOp) Size() (n int) { var l int _ = l if m.Response != nil { n += m.Response.Size() } return n } func (m *ResponseOp_ResponseRange) Size() (n int) { var l int _ = l if m.ResponseRange != nil { l = m.ResponseRange.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *ResponseOp_ResponsePut) Size() (n int) { var l int _ = l if m.ResponsePut != nil { l = m.ResponsePut.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *ResponseOp_ResponseDeleteRange) Size() (n int) { var l int _ = l if m.ResponseDeleteRange != nil { l = m.ResponseDeleteRange.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *ResponseOp_ResponseTxn) Size() (n int) { var l int _ = l if m.ResponseTxn != nil { l = m.ResponseTxn.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *Compare) Size() (n int) { var l int _ = l if m.Result != 0 { n += 1 + sovRpc(uint64(m.Result)) } if m.Target != 0 { n += 1 + sovRpc(uint64(m.Target)) } l = len(m.Key) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } if m.TargetUnion != nil { n += m.TargetUnion.Size() } l = len(m.RangeEnd) if l > 0 { n += 2 + l + sovRpc(uint64(l)) } return n } func (m *Compare_Version) Size() (n int) { var l int _ = l n += 1 + sovRpc(uint64(m.Version)) return n } func (m *Compare_CreateRevision) Size() (n int) { var l int _ = l n += 1 + sovRpc(uint64(m.CreateRevision)) return n } func (m *Compare_ModRevision) Size() (n int) { var l int _ = l n += 1 + sovRpc(uint64(m.ModRevision)) return n } func (m *Compare_Value) Size() (n int) { var l int _ = l if m.Value != nil { l = len(m.Value) n += 1 + l + sovRpc(uint64(l)) } return n } func (m *Compare_Lease) Size() (n int) { var l int _ = l n += 1 + sovRpc(uint64(m.Lease)) return n } func (m *TxnRequest) Size() (n int) { var l int _ = l if len(m.Compare) > 0 { for _, e := range m.Compare { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } if len(m.Success) > 0 { for _, e := range m.Success { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } if len(m.Failure) > 0 { for _, e := range m.Failure { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *TxnResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.Succeeded { n += 2 } if len(m.Responses) > 0 { for _, e := range m.Responses { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *CompactionRequest) Size() (n int) { var l int _ = l if m.Revision != 0 { n += 1 + sovRpc(uint64(m.Revision)) } if m.Physical { n += 2 } return n } func (m *CompactionResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *HashRequest) Size() (n int) { var l int _ = l return n } func (m *HashKVRequest) Size() (n int) { var l int _ = l if m.Revision != 0 { n += 1 + sovRpc(uint64(m.Revision)) } return n } func (m *HashKVResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.Hash != 0 { n += 1 + sovRpc(uint64(m.Hash)) } if m.CompactRevision != 0 { n += 1 + sovRpc(uint64(m.CompactRevision)) } return n } func (m *HashResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.Hash != 0 { n += 1 + sovRpc(uint64(m.Hash)) } return n } func (m *SnapshotRequest) Size() (n int) { var l int _ = l return n } func (m *SnapshotResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.RemainingBytes != 0 { n += 1 + sovRpc(uint64(m.RemainingBytes)) } l = len(m.Blob) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *WatchRequest) Size() (n int) { var l int _ = l if m.RequestUnion != nil { n += m.RequestUnion.Size() } return n } func (m *WatchRequest_CreateRequest) Size() (n int) { var l int _ = l if m.CreateRequest != nil { l = m.CreateRequest.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *WatchRequest_CancelRequest) Size() (n int) { var l int _ = l if m.CancelRequest != nil { l = m.CancelRequest.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *WatchCreateRequest) Size() (n int) { var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.RangeEnd) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } if m.StartRevision != 0 { n += 1 + sovRpc(uint64(m.StartRevision)) } if m.ProgressNotify { n += 2 } if len(m.Filters) > 0 { l = 0 for _, e := range m.Filters { l += sovRpc(uint64(e)) } n += 1 + sovRpc(uint64(l)) + l } if m.PrevKv { n += 2 } return n } func (m *WatchCancelRequest) Size() (n int) { var l int _ = l if m.WatchId != 0 { n += 1 + sovRpc(uint64(m.WatchId)) } return n } func (m *WatchResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.WatchId != 0 { n += 1 + sovRpc(uint64(m.WatchId)) } if m.Created { n += 2 } if m.Canceled { n += 2 } if m.CompactRevision != 0 { n += 1 + sovRpc(uint64(m.CompactRevision)) } l = len(m.CancelReason) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } if len(m.Events) > 0 { for _, e := range m.Events { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *LeaseGrantRequest) Size() (n int) { var l int _ = l if m.TTL != 0 { n += 1 + sovRpc(uint64(m.TTL)) } if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } return n } func (m *LeaseGrantResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } if m.TTL != 0 { n += 1 + sovRpc(uint64(m.TTL)) } l = len(m.Error) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *LeaseRevokeRequest) Size() (n int) { var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } return n } func (m *LeaseRevokeResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *LeaseKeepAliveRequest) Size() (n int) { var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } return n } func (m *LeaseKeepAliveResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } if m.TTL != 0 { n += 1 + sovRpc(uint64(m.TTL)) } return n } func (m *LeaseTimeToLiveRequest) Size() (n int) { var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } if m.Keys { n += 2 } return n } func (m *LeaseTimeToLiveResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } if m.TTL != 0 { n += 1 + sovRpc(uint64(m.TTL)) } if m.GrantedTTL != 0 { n += 1 + sovRpc(uint64(m.GrantedTTL)) } if len(m.Keys) > 0 { for _, b := range m.Keys { l = len(b) n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *LeaseLeasesRequest) Size() (n int) { var l int _ = l return n } func (m *LeaseStatus) Size() (n int) { var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } return n } func (m *LeaseLeasesResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Leases) > 0 { for _, e := range m.Leases { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *Member) Size() (n int) { var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } if len(m.PeerURLs) > 0 { for _, s := range m.PeerURLs { l = len(s) n += 1 + l + sovRpc(uint64(l)) } } if len(m.ClientURLs) > 0 { for _, s := range m.ClientURLs { l = len(s) n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *MemberAddRequest) Size() (n int) { var l int _ = l if len(m.PeerURLs) > 0 { for _, s := range m.PeerURLs { l = len(s) n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *MemberAddResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if m.Member != nil { l = m.Member.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Members) > 0 { for _, e := range m.Members { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *MemberRemoveRequest) Size() (n int) { var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } return n } func (m *MemberRemoveResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Members) > 0 { for _, e := range m.Members { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *MemberUpdateRequest) Size() (n int) { var l int _ = l if m.ID != 0 { n += 1 + sovRpc(uint64(m.ID)) } if len(m.PeerURLs) > 0 { for _, s := range m.PeerURLs { l = len(s) n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *MemberUpdateResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Members) > 0 { for _, e := range m.Members { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *MemberListRequest) Size() (n int) { var l int _ = l return n } func (m *MemberListResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Members) > 0 { for _, e := range m.Members { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *DefragmentRequest) Size() (n int) { var l int _ = l return n } func (m *DefragmentResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *MoveLeaderRequest) Size() (n int) { var l int _ = l if m.TargetID != 0 { n += 1 + sovRpc(uint64(m.TargetID)) } return n } func (m *MoveLeaderResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AlarmRequest) Size() (n int) { var l int _ = l if m.Action != 0 { n += 1 + sovRpc(uint64(m.Action)) } if m.MemberID != 0 { n += 1 + sovRpc(uint64(m.MemberID)) } if m.Alarm != 0 { n += 1 + sovRpc(uint64(m.Alarm)) } return n } func (m *AlarmMember) Size() (n int) { var l int _ = l if m.MemberID != 0 { n += 1 + sovRpc(uint64(m.MemberID)) } if m.Alarm != 0 { n += 1 + sovRpc(uint64(m.Alarm)) } return n } func (m *AlarmResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Alarms) > 0 { for _, e := range m.Alarms { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *StatusRequest) Size() (n int) { var l int _ = l return n } func (m *StatusResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } l = len(m.Version) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } if m.DbSize != 0 { n += 1 + sovRpc(uint64(m.DbSize)) } if m.Leader != 0 { n += 1 + sovRpc(uint64(m.Leader)) } if m.RaftIndex != 0 { n += 1 + sovRpc(uint64(m.RaftIndex)) } if m.RaftTerm != 0 { n += 1 + sovRpc(uint64(m.RaftTerm)) } return n } func (m *AuthEnableRequest) Size() (n int) { var l int _ = l return n } func (m *AuthDisableRequest) Size() (n int) { var l int _ = l return n } func (m *AuthenticateRequest) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.Password) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserAddRequest) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.Password) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserGetRequest) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserDeleteRequest) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserChangePasswordRequest) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.Password) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserGrantRoleRequest) Size() (n int) { var l int _ = l l = len(m.User) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.Role) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserRevokeRoleRequest) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.Role) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthRoleAddRequest) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthRoleGetRequest) Size() (n int) { var l int _ = l l = len(m.Role) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserListRequest) Size() (n int) { var l int _ = l return n } func (m *AuthRoleListRequest) Size() (n int) { var l int _ = l return n } func (m *AuthRoleDeleteRequest) Size() (n int) { var l int _ = l l = len(m.Role) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthRoleGrantPermissionRequest) Size() (n int) { var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } if m.Perm != nil { l = m.Perm.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthRoleRevokePermissionRequest) Size() (n int) { var l int _ = l l = len(m.Role) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.Key) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } l = len(m.RangeEnd) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthEnableResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthDisableResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthenticateResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } l = len(m.Token) if l > 0 { n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserAddResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserGetResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Roles) > 0 { for _, s := range m.Roles { l = len(s) n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *AuthUserDeleteResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserChangePasswordResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserGrantRoleResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthUserRevokeRoleResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthRoleAddResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthRoleGetResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Perm) > 0 { for _, e := range m.Perm { l = e.Size() n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *AuthRoleListResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Roles) > 0 { for _, s := range m.Roles { l = len(s) n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *AuthUserListResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } if len(m.Users) > 0 { for _, s := range m.Users { l = len(s) n += 1 + l + sovRpc(uint64(l)) } } return n } func (m *AuthRoleDeleteResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthRoleGrantPermissionResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func (m *AuthRoleRevokePermissionResponse) Size() (n int) { var l int _ = l if m.Header != nil { l = m.Header.Size() n += 1 + l + sovRpc(uint64(l)) } return n } func sovRpc(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozRpc(x uint64) (n int) { return sovRpc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *ResponseHeader) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ResponseHeader: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ResponseHeader: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ClusterId", wireType) } m.ClusterId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ClusterId |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MemberId", wireType) } m.MemberId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.MemberId |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) } m.Revision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Revision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType) } m.RaftTerm = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.RaftTerm |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RangeRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RangeRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) if m.RangeEnd == nil { m.RangeEnd = []byte{} } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType) } m.Limit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Limit |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) } m.Revision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Revision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SortOrder", wireType) } m.SortOrder = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.SortOrder |= (RangeRequest_SortOrder(b) & 0x7F) << shift if b < 0x80 { break } } case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SortTarget", wireType) } m.SortTarget = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.SortTarget |= (RangeRequest_SortTarget(b) & 0x7F) << shift if b < 0x80 { break } } case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Serializable", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Serializable = bool(v != 0) case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field KeysOnly", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.KeysOnly = bool(v != 0) case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CountOnly", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.CountOnly = bool(v != 0) case 10: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MinModRevision", wireType) } m.MinModRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.MinModRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MaxModRevision", wireType) } m.MaxModRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.MaxModRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 12: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MinCreateRevision", wireType) } m.MinCreateRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.MinCreateRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 13: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MaxCreateRevision", wireType) } m.MaxCreateRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.MaxCreateRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RangeResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RangeResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Kvs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Kvs = append(m.Kvs, &mvccpb.KeyValue{}) if err := m.Kvs[len(m.Kvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field More", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.More = bool(v != 0) case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) } m.Count = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Count |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PutRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PutRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PutRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) if m.Value == nil { m.Value = []byte{} } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) } m.Lease = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Lease |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.PrevKv = bool(v != 0) case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IgnoreValue", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.IgnoreValue = bool(v != 0) case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IgnoreLease", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.IgnoreLease = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PutResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PutResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PutResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.PrevKv == nil { m.PrevKv = &mvccpb.KeyValue{} } if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DeleteRangeRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DeleteRangeRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DeleteRangeRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) if m.RangeEnd == nil { m.RangeEnd = []byte{} } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.PrevKv = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DeleteRangeResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DeleteRangeResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DeleteRangeResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType) } m.Deleted = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Deleted |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PrevKvs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.PrevKvs = append(m.PrevKvs, &mvccpb.KeyValue{}) if err := m.PrevKvs[len(m.PrevKvs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RequestOp) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RequestOp: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RequestOp: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RequestRange", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } v := &RangeRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Request = &RequestOp_RequestRange{v} iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RequestPut", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } v := &PutRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Request = &RequestOp_RequestPut{v} iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RequestDeleteRange", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } v := &DeleteRangeRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Request = &RequestOp_RequestDeleteRange{v} iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RequestTxn", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } v := &TxnRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Request = &RequestOp_RequestTxn{v} iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ResponseOp) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ResponseOp: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ResponseOp: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResponseRange", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } v := &RangeResponse{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Response = &ResponseOp_ResponseRange{v} iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResponsePut", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } v := &PutResponse{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Response = &ResponseOp_ResponsePut{v} iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResponseDeleteRange", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } v := &DeleteRangeResponse{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Response = &ResponseOp_ResponseDeleteRange{v} iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResponseTxn", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } v := &TxnResponse{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Response = &ResponseOp_ResponseTxn{v} iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Compare) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Compare: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Compare: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) } m.Result = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Result |= (Compare_CompareResult(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Target", wireType) } m.Target = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Target |= (Compare_CompareTarget(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } m.TargetUnion = &Compare_Version{v} case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType) } var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } m.TargetUnion = &Compare_CreateRevision{v} case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType) } var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } m.TargetUnion = &Compare_ModRevision{v} case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } v := make([]byte, postIndex-iNdEx) copy(v, dAtA[iNdEx:postIndex]) m.TargetUnion = &Compare_Value{v} iNdEx = postIndex case 8: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) } var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } m.TargetUnion = &Compare_Lease{v} case 64: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) if m.RangeEnd == nil { m.RangeEnd = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *TxnRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: TxnRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: TxnRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Compare", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Compare = append(m.Compare, &Compare{}) if err := m.Compare[len(m.Compare)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Success", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Success = append(m.Success, &RequestOp{}) if err := m.Success[len(m.Success)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Failure", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Failure = append(m.Failure, &RequestOp{}) if err := m.Failure[len(m.Failure)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *TxnResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: TxnResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: TxnResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Succeeded", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Succeeded = bool(v != 0) case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Responses", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Responses = append(m.Responses, &ResponseOp{}) if err := m.Responses[len(m.Responses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CompactionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CompactionRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CompactionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) } m.Revision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Revision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Physical", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Physical = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CompactionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CompactionResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CompactionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *HashRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: HashRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: HashRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *HashKVRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: HashKVRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: HashKVRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) } m.Revision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Revision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *HashKVResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: HashKVResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: HashKVResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } m.Hash = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Hash |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CompactRevision", wireType) } m.CompactRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CompactRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *HashResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: HashResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: HashResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) } m.Hash = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Hash |= (uint32(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *SnapshotRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: SnapshotRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: SnapshotRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *SnapshotResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: SnapshotResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: SnapshotResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field RemainingBytes", wireType) } m.RemainingBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.RemainingBytes |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Blob", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Blob = append(m.Blob[:0], dAtA[iNdEx:postIndex]...) if m.Blob == nil { m.Blob = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *WatchRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: WatchRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: WatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CreateRequest", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } v := &WatchCreateRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.RequestUnion = &WatchRequest_CreateRequest{v} iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CancelRequest", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } v := &WatchCancelRequest{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.RequestUnion = &WatchRequest_CancelRequest{v} iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *WatchCreateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: WatchCreateRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: WatchCreateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.RangeEnd = append(m.RangeEnd[:0], dAtA[iNdEx:postIndex]...) if m.RangeEnd == nil { m.RangeEnd = []byte{} } iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field StartRevision", wireType) } m.StartRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.StartRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ProgressNotify", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.ProgressNotify = bool(v != 0) case 5: if wireType == 0 { var v WatchCreateRequest_FilterType for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift if b < 0x80 { break } } m.Filters = append(m.Filters, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + packedLen if postIndex > l { return io.ErrUnexpectedEOF } for iNdEx < postIndex { var v WatchCreateRequest_FilterType for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (WatchCreateRequest_FilterType(b) & 0x7F) << shift if b < 0x80 { break } } m.Filters = append(m.Filters, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field Filters", wireType) } case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.PrevKv = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *WatchCancelRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: WatchCancelRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: WatchCancelRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) } m.WatchId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.WatchId |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *WatchResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: WatchResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: WatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field WatchId", wireType) } m.WatchId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.WatchId |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Created", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Created = bool(v != 0) case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Canceled", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Canceled = bool(v != 0) case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CompactRevision", wireType) } m.CompactRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CompactRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CancelReason", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.CancelReason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Events = append(m.Events, &mvccpb.Event{}) if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseGrantRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseGrantRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseGrantRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) } m.TTL = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.TTL |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseGrantResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseGrantResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseGrantResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) } m.TTL = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.TTL |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseRevokeRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseRevokeRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseRevokeRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseRevokeResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseRevokeResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseRevokeResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseKeepAliveRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseKeepAliveRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseKeepAliveRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseKeepAliveResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseKeepAliveResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseKeepAliveResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) } m.TTL = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.TTL |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseTimeToLiveRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseTimeToLiveRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseTimeToLiveRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= (int(b) & 0x7F) << shift if b < 0x80 { break } } m.Keys = bool(v != 0) default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseTimeToLiveResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseTimeToLiveResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseTimeToLiveResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType) } m.TTL = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.TTL |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field GrantedTTL", wireType) } m.GrantedTTL = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.GrantedTTL |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseLeasesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseLeasesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseLeasesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *LeaseLeasesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: LeaseLeasesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: LeaseLeasesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Leases", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Leases = append(m.Leases, &LeaseStatus{}) if err := m.Leases[len(m.Leases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Member) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Member: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Member: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ClientURLs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.ClientURLs = append(m.ClientURLs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MemberAddRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MemberAddRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MemberAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MemberAddResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MemberAddResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MemberAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Member", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Member == nil { m.Member = &Member{} } if err := m.Member.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Members = append(m.Members, &Member{}) if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MemberRemoveRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MemberRemoveRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MemberRemoveRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MemberRemoveResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MemberRemoveResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MemberRemoveResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Members = append(m.Members, &Member{}) if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MemberUpdateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MemberUpdateRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MemberUpdateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PeerURLs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.PeerURLs = append(m.PeerURLs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MemberUpdateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MemberUpdateResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MemberUpdateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Members = append(m.Members, &Member{}) if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MemberListRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MemberListRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MemberListRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MemberListResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MemberListResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MemberListResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Members", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Members = append(m.Members, &Member{}) if err := m.Members[len(m.Members)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DefragmentRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DefragmentRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DefragmentRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DefragmentResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DefragmentResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DefragmentResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MoveLeaderRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MoveLeaderRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MoveLeaderRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TargetID", wireType) } m.TargetID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.TargetID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MoveLeaderResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MoveLeaderResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MoveLeaderResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AlarmRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AlarmRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AlarmRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) } m.Action = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Action |= (AlarmRequest_AlarmAction(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) } m.MemberID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.MemberID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) } m.Alarm = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Alarm |= (AlarmType(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AlarmMember) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AlarmMember: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AlarmMember: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field MemberID", wireType) } m.MemberID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.MemberID |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Alarm", wireType) } m.Alarm = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Alarm |= (AlarmType(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AlarmResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AlarmResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AlarmResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Alarms", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Alarms = append(m.Alarms, &AlarmMember{}) if err := m.Alarms[len(m.Alarms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StatusRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *StatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field DbSize", wireType) } m.DbSize = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.DbSize |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Leader", wireType) } m.Leader = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Leader |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field RaftIndex", wireType) } m.RaftIndex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.RaftIndex |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field RaftTerm", wireType) } m.RaftTerm = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.RaftTerm |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthEnableRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthEnableRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthEnableRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthDisableRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthDisableRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthDisableRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthenticateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthenticateRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthenticateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Password = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserAddRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserAddRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Password = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserGetRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserGetRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserDeleteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserDeleteRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserChangePasswordRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserChangePasswordRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserChangePasswordRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Password = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserGrantRoleRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserGrantRoleRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserGrantRoleRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.User = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserRevokeRoleRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserRevokeRoleRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserRevokeRoleRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleAddRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleAddRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleAddRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleGetRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleGetRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleGetRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserListRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserListRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserListRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleListRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleListRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleListRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleDeleteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleDeleteRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleGrantPermissionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleGrantPermissionRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleGrantPermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Perm == nil { m.Perm = &authpb.Permission{} } if err := m.Perm.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleRevokePermissionRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleRevokePermissionRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleRevokePermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Role", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Role = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RangeEnd", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.RangeEnd = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthEnableResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthEnableResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthEnableResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthDisableResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthDisableResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthDisableResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthenticateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthenticateResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthenticateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Token", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Token = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserAddResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserAddResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserGetResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserGetResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserDeleteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserDeleteResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserChangePasswordResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserChangePasswordResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserChangePasswordResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserGrantRoleResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserGrantRoleResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserGrantRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserRevokeRoleResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserRevokeRoleResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserRevokeRoleResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleAddResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleAddResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleAddResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleGetResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleGetResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleGetResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Perm", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Perm = append(m.Perm, &authpb.Permission{}) if err := m.Perm[len(m.Perm)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleListResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleListResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleListResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Roles", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Roles = append(m.Roles, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthUserListResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthUserListResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthUserListResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Users", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Users = append(m.Users, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleDeleteResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleDeleteResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleGrantPermissionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleGrantPermissionResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleGrantPermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AuthRoleRevokePermissionResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AuthRoleRevokePermissionResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AuthRoleRevokePermissionResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowRpc } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthRpc } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Header == nil { m.Header = &ResponseHeader{} } if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthRpc } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipRpc(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowRpc } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowRpc } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowRpc } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthRpc } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowRpc } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipRpc(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthRpc = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRpc = fmt.Errorf("proto: integer overflow") ) func init() { proto.RegisterFile("rpc.proto", fileDescriptorRpc) } var fileDescriptorRpc = []byte{ // 3669 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x5b, 0x5b, 0x6f, 0x23, 0xc7, 0x72, 0xd6, 0x90, 0x22, 0x29, 0x16, 0x2f, 0xe2, 0xb6, 0xb4, 0xbb, 0x14, 0x77, 0x57, 0xab, 0xed, 0xbd, 0x69, 0x2f, 0x16, 0x6d, 0xd9, 0xc9, 0xc3, 0x26, 0x30, 0xac, 0x95, 0xe8, 0x95, 0x2c, 0xad, 0x24, 0x8f, 0xa8, 0xb5, 0x03, 0x38, 0x11, 0x46, 0x64, 0x4b, 0x62, 0x44, 0xce, 0x30, 0x33, 0x43, 0xae, 0xb4, 0x31, 0x12, 0xc0, 0x71, 0x82, 0xbc, 0xe4, 0x25, 0x06, 0x82, 0xc4, 0xaf, 0x41, 0x60, 0xf8, 0x07, 0x04, 0xf9, 0x0b, 0x41, 0x5e, 0x12, 0x20, 0x7f, 0xe0, 0xc0, 0xe7, 0xbc, 0x9c, 0x5f, 0x70, 0x2e, 0x4f, 0x07, 0x7d, 0x9b, 0xe9, 0xb9, 0x51, 0xb2, 0x69, 0xfb, 0x45, 0x3b, 0x5d, 0x5d, 0x5d, 0x55, 0x5d, 0xdd, 0x55, 0xd5, 0xfd, 0x35, 0x17, 0xf2, 0x76, 0xbf, 0xb5, 0xd4, 0xb7, 0x2d, 0xd7, 0x42, 0x45, 0xe2, 0xb6, 0xda, 0x0e, 0xb1, 0x87, 0xc4, 0xee, 0x1f, 0xd6, 0x66, 0x8f, 0xad, 0x63, 0x8b, 0x75, 0xd4, 0xe9, 0x17, 0xe7, 0xa9, 0xcd, 0x51, 0x9e, 0x7a, 0x6f, 0xd8, 0x6a, 0xb1, 0x3f, 0xfd, 0xc3, 0xfa, 0xe9, 0x50, 0x74, 0xdd, 0x60, 0x5d, 0xc6, 0xc0, 0x3d, 0x61, 0x7f, 0xfa, 0x87, 0xec, 0x1f, 0xd1, 0x79, 0xf3, 0xd8, 0xb2, 0x8e, 0xbb, 0xa4, 0x6e, 0xf4, 0x3b, 0x75, 0xc3, 0x34, 0x2d, 0xd7, 0x70, 0x3b, 0x96, 0xe9, 0xf0, 0x5e, 0xfc, 0xf7, 0x1a, 0x94, 0x75, 0xe2, 0xf4, 0x2d, 0xd3, 0x21, 0xeb, 0xc4, 0x68, 0x13, 0x1b, 0xdd, 0x02, 0x68, 0x75, 0x07, 0x8e, 0x4b, 0xec, 0x83, 0x4e, 0xbb, 0xaa, 0x2d, 0x68, 0x8b, 0x93, 0x7a, 0x5e, 0x50, 0x36, 0xda, 0xe8, 0x06, 0xe4, 0x7b, 0xa4, 0x77, 0xc8, 0x7b, 0x53, 0xac, 0x77, 0x8a, 0x13, 0x36, 0xda, 0xa8, 0x06, 0x53, 0x36, 0x19, 0x76, 0x9c, 0x8e, 0x65, 0x56, 0xd3, 0x0b, 0xda, 0x62, 0x5a, 0xf7, 0xda, 0x74, 0xa0, 0x6d, 0x1c, 0xb9, 0x07, 0x2e, 0xb1, 0x7b, 0xd5, 0x49, 0x3e, 0x90, 0x12, 0x9a, 0xc4, 0xee, 0xe1, 0x2f, 0x33, 0x50, 0xd4, 0x0d, 0xf3, 0x98, 0xe8, 0xe4, 0xaf, 0x06, 0xc4, 0x71, 0x51, 0x05, 0xd2, 0xa7, 0xe4, 0x9c, 0xa9, 0x2f, 0xea, 0xf4, 0x93, 0x8f, 0x37, 0x8f, 0xc9, 0x01, 0x31, 0xb9, 0xe2, 0x22, 0x1d, 0x6f, 0x1e, 0x93, 0x86, 0xd9, 0x46, 0xb3, 0x90, 0xe9, 0x76, 0x7a, 0x1d, 0x57, 0x68, 0xe5, 0x8d, 0x80, 0x39, 0x93, 0x21, 0x73, 0x56, 0x01, 0x1c, 0xcb, 0x76, 0x0f, 0x2c, 0xbb, 0x4d, 0xec, 0x6a, 0x66, 0x41, 0x5b, 0x2c, 0x2f, 0xdf, 0x5b, 0x52, 0x17, 0x62, 0x49, 0x35, 0x68, 0x69, 0xcf, 0xb2, 0xdd, 0x1d, 0xca, 0xab, 0xe7, 0x1d, 0xf9, 0x89, 0x3e, 0x84, 0x02, 0x13, 0xe2, 0x1a, 0xf6, 0x31, 0x71, 0xab, 0x59, 0x26, 0xe5, 0xfe, 0x05, 0x52, 0x9a, 0x8c, 0x59, 0x67, 0xea, 0xf9, 0x37, 0xc2, 0x50, 0x74, 0x88, 0xdd, 0x31, 0xba, 0x9d, 0x37, 0xc6, 0x61, 0x97, 0x54, 0x73, 0x0b, 0xda, 0xe2, 0x94, 0x1e, 0xa0, 0xd1, 0xf9, 0x9f, 0x92, 0x73, 0xe7, 0xc0, 0x32, 0xbb, 0xe7, 0xd5, 0x29, 0xc6, 0x30, 0x45, 0x09, 0x3b, 0x66, 0xf7, 0x9c, 0x2d, 0x9a, 0x35, 0x30, 0x5d, 0xde, 0x9b, 0x67, 0xbd, 0x79, 0x46, 0x61, 0xdd, 0x8b, 0x50, 0xe9, 0x75, 0xcc, 0x83, 0x9e, 0xd5, 0x3e, 0xf0, 0x1c, 0x02, 0xcc, 0x21, 0xe5, 0x5e, 0xc7, 0x7c, 0x69, 0xb5, 0x75, 0xe9, 0x16, 0xca, 0x69, 0x9c, 0x05, 0x39, 0x0b, 0x82, 0xd3, 0x38, 0x53, 0x39, 0x97, 0x60, 0x86, 0xca, 0x6c, 0xd9, 0xc4, 0x70, 0x89, 0xcf, 0x5c, 0x64, 0xcc, 0x57, 0x7a, 0x1d, 0x73, 0x95, 0xf5, 0x04, 0xf8, 0x8d, 0xb3, 0x08, 0x7f, 0x49, 0xf0, 0x1b, 0x67, 0x41, 0x7e, 0xbc, 0x04, 0x79, 0xcf, 0xe7, 0x68, 0x0a, 0x26, 0xb7, 0x77, 0xb6, 0x1b, 0x95, 0x09, 0x04, 0x90, 0x5d, 0xd9, 0x5b, 0x6d, 0x6c, 0xaf, 0x55, 0x34, 0x54, 0x80, 0xdc, 0x5a, 0x83, 0x37, 0x52, 0xf8, 0x39, 0x80, 0xef, 0x5d, 0x94, 0x83, 0xf4, 0x66, 0xe3, 0xcf, 0x2a, 0x13, 0x94, 0xe7, 0x55, 0x43, 0xdf, 0xdb, 0xd8, 0xd9, 0xae, 0x68, 0x74, 0xf0, 0xaa, 0xde, 0x58, 0x69, 0x36, 0x2a, 0x29, 0xca, 0xf1, 0x72, 0x67, 0xad, 0x92, 0x46, 0x79, 0xc8, 0xbc, 0x5a, 0xd9, 0xda, 0x6f, 0x54, 0x26, 0xf1, 0x57, 0x1a, 0x94, 0xc4, 0x7a, 0xf1, 0x98, 0x40, 0xef, 0x41, 0xf6, 0x84, 0xc5, 0x05, 0xdb, 0x8a, 0x85, 0xe5, 0x9b, 0xa1, 0xc5, 0x0d, 0xc4, 0x8e, 0x2e, 0x78, 0x11, 0x86, 0xf4, 0xe9, 0xd0, 0xa9, 0xa6, 0x16, 0xd2, 0x8b, 0x85, 0xe5, 0xca, 0x12, 0x0f, 0xd8, 0xa5, 0x4d, 0x72, 0xfe, 0xca, 0xe8, 0x0e, 0x88, 0x4e, 0x3b, 0x11, 0x82, 0xc9, 0x9e, 0x65, 0x13, 0xb6, 0x63, 0xa7, 0x74, 0xf6, 0x4d, 0xb7, 0x31, 0x5b, 0x34, 0xb1, 0x5b, 0x79, 0x03, 0x7f, 0xab, 0x01, 0xec, 0x0e, 0xdc, 0xe4, 0xd0, 0x98, 0x85, 0xcc, 0x90, 0x0a, 0x16, 0x61, 0xc1, 0x1b, 0x2c, 0x26, 0x88, 0xe1, 0x10, 0x2f, 0x26, 0x68, 0x03, 0x5d, 0x87, 0x5c, 0xdf, 0x26, 0xc3, 0x83, 0xd3, 0x21, 0x53, 0x32, 0xa5, 0x67, 0x69, 0x73, 0x73, 0x88, 0xee, 0x40, 0xb1, 0x73, 0x6c, 0x5a, 0x36, 0x39, 0xe0, 0xb2, 0x32, 0xac, 0xb7, 0xc0, 0x69, 0xcc, 0x6e, 0x85, 0x85, 0x0b, 0xce, 0xaa, 0x2c, 0x5b, 0x94, 0x84, 0x4d, 0x28, 0x30, 0x53, 0xc7, 0x72, 0xdf, 0x23, 0xdf, 0xc6, 0x14, 0x1b, 0x16, 0x75, 0xa1, 0xb0, 0x1a, 0x7f, 0x06, 0x68, 0x8d, 0x74, 0x89, 0x4b, 0xc6, 0xc9, 0x1e, 0x8a, 0x4f, 0xd2, 0xaa, 0x4f, 0xf0, 0x3f, 0x6b, 0x30, 0x13, 0x10, 0x3f, 0xd6, 0xb4, 0xaa, 0x90, 0x6b, 0x33, 0x61, 0xdc, 0x82, 0xb4, 0x2e, 0x9b, 0xe8, 0x09, 0x4c, 0x09, 0x03, 0x9c, 0x6a, 0x3a, 0x61, 0xd3, 0xe4, 0xb8, 0x4d, 0x0e, 0xfe, 0x36, 0x05, 0x79, 0x31, 0xd1, 0x9d, 0x3e, 0x5a, 0x81, 0x92, 0xcd, 0x1b, 0x07, 0x6c, 0x3e, 0xc2, 0xa2, 0x5a, 0x72, 0x12, 0x5a, 0x9f, 0xd0, 0x8b, 0x62, 0x08, 0x23, 0xa3, 0x3f, 0x81, 0x82, 0x14, 0xd1, 0x1f, 0xb8, 0xc2, 0xe5, 0xd5, 0xa0, 0x00, 0x7f, 0xff, 0xad, 0x4f, 0xe8, 0x20, 0xd8, 0x77, 0x07, 0x2e, 0x6a, 0xc2, 0xac, 0x1c, 0xcc, 0x67, 0x23, 0xcc, 0x48, 0x33, 0x29, 0x0b, 0x41, 0x29, 0xd1, 0xa5, 0x5a, 0x9f, 0xd0, 0x91, 0x18, 0xaf, 0x74, 0xaa, 0x26, 0xb9, 0x67, 0x3c, 0x79, 0x47, 0x4c, 0x6a, 0x9e, 0x99, 0x51, 0x93, 0x9a, 0x67, 0xe6, 0xf3, 0x3c, 0xe4, 0x44, 0x0b, 0xff, 0x57, 0x0a, 0x40, 0xae, 0xc6, 0x4e, 0x1f, 0xad, 0x41, 0xd9, 0x16, 0xad, 0x80, 0xb7, 0x6e, 0xc4, 0x7a, 0x4b, 0x2c, 0xe2, 0x84, 0x5e, 0x92, 0x83, 0xb8, 0x71, 0xef, 0x43, 0xd1, 0x93, 0xe2, 0x3b, 0x6c, 0x2e, 0xc6, 0x61, 0x9e, 0x84, 0x82, 0x1c, 0x40, 0x5d, 0xf6, 0x09, 0x5c, 0xf5, 0xc6, 0xc7, 0xf8, 0xec, 0xce, 0x08, 0x9f, 0x79, 0x02, 0x67, 0xa4, 0x04, 0xd5, 0x6b, 0xaa, 0x61, 0xbe, 0xdb, 0xe6, 0x62, 0xdc, 0x16, 0x35, 0x8c, 0x3a, 0x0e, 0x68, 0xbd, 0xe4, 0x4d, 0xfc, 0xeb, 0x34, 0xe4, 0x56, 0xad, 0x5e, 0xdf, 0xb0, 0xe9, 0x6a, 0x64, 0x6d, 0xe2, 0x0c, 0xba, 0x2e, 0x73, 0x57, 0x79, 0xf9, 0x6e, 0x50, 0xa2, 0x60, 0x93, 0xff, 0xea, 0x8c, 0x55, 0x17, 0x43, 0xe8, 0x60, 0x51, 0x1e, 0x53, 0x97, 0x18, 0x2c, 0x8a, 0xa3, 0x18, 0x22, 0x03, 0x39, 0xed, 0x07, 0x72, 0x0d, 0x72, 0x43, 0x62, 0xfb, 0x25, 0x7d, 0x7d, 0x42, 0x97, 0x04, 0xf4, 0x08, 0xa6, 0xc3, 0xe5, 0x25, 0x23, 0x78, 0xca, 0xad, 0x60, 0x35, 0xba, 0x0b, 0xc5, 0x40, 0x8d, 0xcb, 0x0a, 0xbe, 0x42, 0x4f, 0x29, 0x71, 0xd7, 0x64, 0x5e, 0xa5, 0xf5, 0xb8, 0xb8, 0x3e, 0x21, 0x33, 0xeb, 0x35, 0x99, 0x59, 0xa7, 0xc4, 0x28, 0x91, 0x5b, 0x03, 0x49, 0xe6, 0x83, 0x60, 0x92, 0xc1, 0x1f, 0x40, 0x29, 0xe0, 0x20, 0x5a, 0x77, 0x1a, 0x1f, 0xef, 0xaf, 0x6c, 0xf1, 0x22, 0xf5, 0x82, 0xd5, 0x25, 0xbd, 0xa2, 0xd1, 0x5a, 0xb7, 0xd5, 0xd8, 0xdb, 0xab, 0xa4, 0x50, 0x09, 0xf2, 0xdb, 0x3b, 0xcd, 0x03, 0xce, 0x95, 0xc6, 0x2f, 0x3c, 0x09, 0xa2, 0xc8, 0x29, 0xb5, 0x6d, 0x42, 0xa9, 0x6d, 0x9a, 0xac, 0x6d, 0x29, 0xbf, 0xb6, 0xb1, 0x32, 0xb7, 0xd5, 0x58, 0xd9, 0x6b, 0x54, 0x26, 0x9f, 0x97, 0xa1, 0xc8, 0xfd, 0x7b, 0x30, 0x30, 0x69, 0xa9, 0xfd, 0x77, 0x0d, 0xc0, 0x8f, 0x26, 0x54, 0x87, 0x5c, 0x8b, 0xeb, 0xa9, 0x6a, 0x2c, 0x19, 0x5d, 0x8d, 0x5d, 0x32, 0x5d, 0x72, 0xa1, 0x77, 0x20, 0xe7, 0x0c, 0x5a, 0x2d, 0xe2, 0xc8, 0x92, 0x77, 0x3d, 0x9c, 0x0f, 0x45, 0xb6, 0xd2, 0x25, 0x1f, 0x1d, 0x72, 0x64, 0x74, 0xba, 0x03, 0x56, 0x00, 0x47, 0x0f, 0x11, 0x7c, 0xf8, 0xdf, 0x34, 0x28, 0x28, 0x9b, 0xf7, 0x07, 0x26, 0xe1, 0x9b, 0x90, 0x67, 0x36, 0x90, 0xb6, 0x48, 0xc3, 0x53, 0xba, 0x4f, 0x40, 0x7f, 0x0c, 0x79, 0x19, 0x01, 0x32, 0x13, 0x57, 0xe3, 0xc5, 0xee, 0xf4, 0x75, 0x9f, 0x15, 0x6f, 0xc2, 0x15, 0xe6, 0x95, 0x16, 0x3d, 0x5c, 0x4b, 0x3f, 0xaa, 0xc7, 0x4f, 0x2d, 0x74, 0xfc, 0xac, 0xc1, 0x54, 0xff, 0xe4, 0xdc, 0xe9, 0xb4, 0x8c, 0xae, 0xb0, 0xc2, 0x6b, 0xe3, 0x8f, 0x00, 0xa9, 0xc2, 0xc6, 0x99, 0x2e, 0x2e, 0x41, 0x61, 0xdd, 0x70, 0x4e, 0x84, 0x49, 0xf8, 0x09, 0x94, 0x68, 0x73, 0xf3, 0xd5, 0x25, 0x6c, 0x64, 0x97, 0x03, 0xc9, 0x3d, 0x96, 0xcf, 0x11, 0x4c, 0x9e, 0x18, 0xce, 0x09, 0x9b, 0x68, 0x49, 0x67, 0xdf, 0xe8, 0x11, 0x54, 0x5a, 0x7c, 0x92, 0x07, 0xa1, 0x2b, 0xc3, 0xb4, 0xa0, 0x7b, 0x27, 0xc1, 0x4f, 0xa1, 0xc8, 0xe7, 0xf0, 0x63, 0x1b, 0x81, 0xaf, 0xc0, 0xf4, 0x9e, 0x69, 0xf4, 0x9d, 0x13, 0x4b, 0x56, 0x37, 0x3a, 0xe9, 0x8a, 0x4f, 0x1b, 0x4b, 0xe3, 0x43, 0x98, 0xb6, 0x49, 0xcf, 0xe8, 0x98, 0x1d, 0xf3, 0xf8, 0xe0, 0xf0, 0xdc, 0x25, 0x8e, 0xb8, 0x30, 0x95, 0x3d, 0xf2, 0x73, 0x4a, 0xa5, 0xa6, 0x1d, 0x76, 0xad, 0x43, 0x91, 0xe6, 0xd8, 0x37, 0xfe, 0x4f, 0x0d, 0x8a, 0x9f, 0x18, 0x6e, 0x4b, 0x2e, 0x1d, 0xda, 0x80, 0xb2, 0x97, 0xdc, 0x18, 0x45, 0xd8, 0x12, 0x2a, 0xb1, 0x6c, 0x8c, 0x3c, 0x4a, 0xcb, 0xea, 0x58, 0x6a, 0xa9, 0x04, 0x26, 0xca, 0x30, 0x5b, 0xa4, 0xeb, 0x89, 0x4a, 0x25, 0x8b, 0x62, 0x8c, 0xaa, 0x28, 0x95, 0xf0, 0x7c, 0xda, 0x3f, 0x7e, 0xf0, 0x5c, 0xf2, 0x75, 0x0a, 0x50, 0xd4, 0x86, 0xef, 0x7b, 0x22, 0xbb, 0x0f, 0x65, 0xc7, 0x35, 0xec, 0xc8, 0xde, 0x28, 0x31, 0xaa, 0x97, 0xa0, 0x1f, 0xc2, 0x74, 0xdf, 0xb6, 0x8e, 0x6d, 0xe2, 0x38, 0x07, 0xa6, 0xe5, 0x76, 0x8e, 0xce, 0xc5, 0xa1, 0xb6, 0x2c, 0xc9, 0xdb, 0x8c, 0x8a, 0x1a, 0x90, 0x3b, 0xea, 0x74, 0x5d, 0x62, 0x3b, 0xd5, 0xcc, 0x42, 0x7a, 0xb1, 0xbc, 0xfc, 0xe4, 0x22, 0xaf, 0x2d, 0x7d, 0xc8, 0xf8, 0x9b, 0xe7, 0x7d, 0xa2, 0xcb, 0xb1, 0xea, 0x41, 0x31, 0x1b, 0x38, 0x28, 0xde, 0x07, 0xf0, 0xf9, 0x69, 0xaa, 0xdd, 0xde, 0xd9, 0xdd, 0x6f, 0x56, 0x26, 0x50, 0x11, 0xa6, 0xb6, 0x77, 0xd6, 0x1a, 0x5b, 0x0d, 0x9a, 0x97, 0x71, 0x5d, 0xfa, 0x46, 0xf5, 0x21, 0x9a, 0x83, 0xa9, 0xd7, 0x94, 0x2a, 0xef, 0xdb, 0x69, 0x3d, 0xc7, 0xda, 0x1b, 0x6d, 0xfc, 0x4f, 0x29, 0x28, 0x89, 0x5d, 0x30, 0xd6, 0x56, 0x54, 0x55, 0xa4, 0x02, 0x2a, 0xe8, 0xa9, 0x94, 0xef, 0x8e, 0xb6, 0x38, 0xfc, 0xca, 0x26, 0xcd, 0x0d, 0x7c, 0xb1, 0x49, 0x5b, 0xb8, 0xd5, 0x6b, 0xc7, 0x86, 0x6f, 0x26, 0x36, 0x7c, 0xd1, 0x5d, 0x28, 0x79, 0xbb, 0xcd, 0x70, 0x44, 0xad, 0xcd, 0xeb, 0x45, 0xb9, 0x91, 0x28, 0x0d, 0xdd, 0x87, 0x2c, 0x19, 0x12, 0xd3, 0x75, 0xaa, 0x05, 0x96, 0x75, 0x4b, 0xf2, 0xfc, 0xdb, 0xa0, 0x54, 0x5d, 0x74, 0xe2, 0x3f, 0x82, 0x2b, 0xec, 0x9e, 0xf1, 0xc2, 0x36, 0x4c, 0xf5, 0x42, 0xd4, 0x6c, 0x6e, 0x09, 0xd7, 0xd1, 0x4f, 0x54, 0x86, 0xd4, 0xc6, 0x9a, 0x98, 0x68, 0x6a, 0x63, 0x0d, 0x7f, 0xa1, 0x01, 0x52, 0xc7, 0x8d, 0xe5, 0xcb, 0x90, 0x70, 0xa9, 0x3e, 0xed, 0xab, 0x9f, 0x85, 0x0c, 0xb1, 0x6d, 0xcb, 0x66, 0x5e, 0xcb, 0xeb, 0xbc, 0x81, 0xef, 0x09, 0x1b, 0x74, 0x32, 0xb4, 0x4e, 0xbd, 0xc0, 0xe0, 0xd2, 0x34, 0xcf, 0xd4, 0x4d, 0x98, 0x09, 0x70, 0x8d, 0x95, 0xfd, 0x1f, 0xc2, 0x55, 0x26, 0x6c, 0x93, 0x90, 0xfe, 0x4a, 0xb7, 0x33, 0x4c, 0xd4, 0xda, 0x87, 0x6b, 0x61, 0xc6, 0x9f, 0xd6, 0x47, 0xf8, 0x4f, 0x85, 0xc6, 0x66, 0xa7, 0x47, 0x9a, 0xd6, 0x56, 0xb2, 0x6d, 0x34, 0x3b, 0x9e, 0x92, 0x73, 0x47, 0x94, 0x49, 0xf6, 0x8d, 0xff, 0x43, 0x83, 0xeb, 0x91, 0xe1, 0x3f, 0xf1, 0xaa, 0xce, 0x03, 0x1c, 0xd3, 0xed, 0x43, 0xda, 0xb4, 0x83, 0xdf, 0xd0, 0x15, 0x8a, 0x67, 0x27, 0x4d, 0x30, 0x45, 0x61, 0xe7, 0xac, 0x58, 0x73, 0xf6, 0xc7, 0x91, 0x35, 0xe6, 0x16, 0x14, 0x18, 0x61, 0xcf, 0x35, 0xdc, 0x81, 0x13, 0x59, 0x8c, 0xbf, 0x11, 0x5b, 0x40, 0x0e, 0x1a, 0x6b, 0x5e, 0xef, 0x40, 0x96, 0x1d, 0x4e, 0xe5, 0xd1, 0x2c, 0x74, 0x1b, 0x50, 0xec, 0xd0, 0x05, 0x23, 0x3e, 0x81, 0xec, 0x4b, 0x86, 0xe8, 0x29, 0x96, 0x4d, 0xca, 0xa5, 0x30, 0x8d, 0x1e, 0xc7, 0x19, 0xf2, 0x3a, 0xfb, 0x66, 0x27, 0x19, 0x42, 0xec, 0x7d, 0x7d, 0x8b, 0x9f, 0x98, 0xf2, 0xba, 0xd7, 0xa6, 0x2e, 0x6b, 0x75, 0x3b, 0xc4, 0x74, 0x59, 0xef, 0x24, 0xeb, 0x55, 0x28, 0x78, 0x09, 0x2a, 0x5c, 0xd3, 0x4a, 0xbb, 0xad, 0x9c, 0x48, 0x3c, 0x79, 0x5a, 0x50, 0x1e, 0xfe, 0x46, 0x83, 0x2b, 0xca, 0x80, 0xb1, 0x1c, 0xf3, 0x14, 0xb2, 0x1c, 0xb7, 0x14, 0xc5, 0x6f, 0x36, 0x38, 0x8a, 0xab, 0xd1, 0x05, 0x0f, 0x5a, 0x82, 0x1c, 0xff, 0x92, 0xc7, 0xc2, 0x78, 0x76, 0xc9, 0x84, 0xef, 0xc3, 0x8c, 0x20, 0x91, 0x9e, 0x15, 0xb7, 0xb7, 0x99, 0x43, 0xf1, 0xe7, 0x30, 0x1b, 0x64, 0x1b, 0x6b, 0x4a, 0x8a, 0x91, 0xa9, 0xcb, 0x18, 0xb9, 0x22, 0x8d, 0xdc, 0xef, 0xb7, 0x95, 0x5a, 0x1d, 0x5e, 0x75, 0x75, 0x45, 0x52, 0xa1, 0x15, 0xf1, 0x26, 0x20, 0x45, 0xfc, 0xac, 0x13, 0x98, 0x91, 0xdb, 0x61, 0xab, 0xe3, 0x78, 0x27, 0xb8, 0x37, 0x80, 0x54, 0xe2, 0xcf, 0x6d, 0xd0, 0x1a, 0x39, 0xb2, 0x8d, 0xe3, 0x1e, 0xf1, 0xea, 0x13, 0x3d, 0xcf, 0xab, 0xc4, 0xb1, 0x32, 0x7a, 0x1d, 0xae, 0xbc, 0xb4, 0x86, 0x34, 0x35, 0x50, 0xaa, 0x1f, 0x32, 0xfc, 0x3e, 0xe7, 0x2d, 0x9b, 0xd7, 0xa6, 0xca, 0xd5, 0x01, 0x63, 0x29, 0xff, 0x5f, 0x0d, 0x8a, 0x2b, 0x5d, 0xc3, 0xee, 0x49, 0xc5, 0xef, 0x43, 0x96, 0xdf, 0x52, 0x04, 0x30, 0xf0, 0x20, 0x28, 0x46, 0xe5, 0xe5, 0x8d, 0x15, 0x7e, 0xa7, 0x11, 0xa3, 0xa8, 0xe1, 0xe2, 0xed, 0x60, 0x2d, 0xf4, 0x96, 0xb0, 0x86, 0xde, 0x82, 0x8c, 0x41, 0x87, 0xb0, 0x14, 0x5c, 0x0e, 0xdf, 0x0f, 0x99, 0x34, 0x76, 0x38, 0xe3, 0x5c, 0xf8, 0x3d, 0x28, 0x28, 0x1a, 0xe8, 0x0d, 0xf8, 0x45, 0x43, 0x1c, 0xc0, 0x56, 0x56, 0x9b, 0x1b, 0xaf, 0xf8, 0xc5, 0xb8, 0x0c, 0xb0, 0xd6, 0xf0, 0xda, 0x29, 0xfc, 0xa9, 0x18, 0x25, 0xf2, 0x9d, 0x6a, 0x8f, 0x96, 0x64, 0x4f, 0xea, 0x52, 0xf6, 0x9c, 0x41, 0x49, 0x4c, 0x7f, 0xdc, 0xf4, 0xcd, 0xe4, 0x25, 0xa4, 0x6f, 0xc5, 0x78, 0x5d, 0x30, 0xe2, 0x69, 0x28, 0x89, 0x84, 0x2e, 0xf6, 0xdf, 0xff, 0x68, 0x50, 0x96, 0x94, 0x71, 0x01, 0x4c, 0x89, 0xbd, 0xf0, 0x0a, 0xe0, 0x21, 0x2f, 0xd7, 0x20, 0xdb, 0x3e, 0xdc, 0xeb, 0xbc, 0x91, 0x60, 0xb3, 0x68, 0x51, 0x7a, 0x97, 0xeb, 0xe1, 0x2f, 0x3e, 0xa2, 0x45, 0x6f, 0xe1, 0xb6, 0x71, 0xe4, 0x6e, 0x98, 0x6d, 0x72, 0xc6, 0xce, 0x8d, 0x93, 0xba, 0x4f, 0x60, 0x97, 0x52, 0xf1, 0x32, 0xc4, 0x0e, 0x8b, 0xea, 0x4b, 0xd1, 0x0c, 0x5c, 0x59, 0x19, 0xb8, 0x27, 0x0d, 0xd3, 0x38, 0xec, 0xca, 0x8c, 0x45, 0xcb, 0x2c, 0x25, 0xae, 0x75, 0x1c, 0x95, 0xda, 0x80, 0x19, 0x4a, 0x25, 0xa6, 0xdb, 0x69, 0x29, 0xe9, 0x4d, 0x16, 0x31, 0x2d, 0x54, 0xc4, 0x0c, 0xc7, 0x79, 0x6d, 0xd9, 0x6d, 0x31, 0x35, 0xaf, 0x8d, 0xd7, 0xb8, 0xf0, 0x7d, 0x27, 0x50, 0xa6, 0xbe, 0xaf, 0x94, 0x45, 0x5f, 0xca, 0x0b, 0xe2, 0x8e, 0x90, 0x82, 0x9f, 0xc0, 0x55, 0xc9, 0x29, 0xc0, 0xbd, 0x11, 0xcc, 0x3b, 0x70, 0x4b, 0x32, 0xaf, 0x9e, 0xd0, 0xdb, 0xd3, 0xae, 0x50, 0xf8, 0x43, 0xed, 0x7c, 0x0e, 0x55, 0xcf, 0x4e, 0x76, 0x58, 0xb6, 0xba, 0xaa, 0x01, 0x03, 0x47, 0xec, 0x99, 0xbc, 0xce, 0xbe, 0x29, 0xcd, 0xb6, 0xba, 0xde, 0x91, 0x80, 0x7e, 0xe3, 0x55, 0x98, 0x93, 0x32, 0xc4, 0x31, 0x36, 0x28, 0x24, 0x62, 0x50, 0x9c, 0x10, 0xe1, 0x30, 0x3a, 0x74, 0xb4, 0xdb, 0x55, 0xce, 0xa0, 0x6b, 0x99, 0x4c, 0x4d, 0x91, 0x79, 0x95, 0xef, 0x08, 0x6a, 0x98, 0x5a, 0x31, 0x04, 0x99, 0x0a, 0x50, 0xc9, 0x62, 0x21, 0x28, 0x39, 0xb2, 0x10, 0x11, 0xd1, 0x9f, 0xc1, 0xbc, 0x67, 0x04, 0xf5, 0xdb, 0x2e, 0xb1, 0x7b, 0x1d, 0xc7, 0x51, 0xe0, 0xa0, 0xb8, 0x89, 0x3f, 0x80, 0xc9, 0x3e, 0x11, 0x39, 0xa5, 0xb0, 0x8c, 0x96, 0xf8, 0xfb, 0xed, 0x92, 0x32, 0x98, 0xf5, 0xe3, 0x36, 0xdc, 0x96, 0xd2, 0xb9, 0x47, 0x63, 0xc5, 0x87, 0x8d, 0x92, 0xb7, 0x6e, 0xee, 0xd6, 0xe8, 0xad, 0x3b, 0xcd, 0xd7, 0xde, 0x83, 0x28, 0x3f, 0xe2, 0x8e, 0x94, 0xb1, 0x35, 0x56, 0xad, 0xd8, 0xe4, 0x3e, 0xf5, 0x42, 0x72, 0x2c, 0x61, 0x87, 0x30, 0x1b, 0x8c, 0xe4, 0xb1, 0xd2, 0xd8, 0x2c, 0x64, 0x5c, 0xeb, 0x94, 0xc8, 0x24, 0xc6, 0x1b, 0xd2, 0x60, 0x2f, 0xcc, 0xc7, 0x32, 0xd8, 0xf0, 0x85, 0xb1, 0x2d, 0x39, 0xae, 0xbd, 0x74, 0x35, 0xe5, 0xe1, 0x8b, 0x37, 0xf0, 0x36, 0x5c, 0x0b, 0xa7, 0x89, 0xb1, 0x4c, 0x7e, 0xc5, 0x37, 0x70, 0x5c, 0x26, 0x19, 0x4b, 0xee, 0xc7, 0x7e, 0x32, 0x50, 0x12, 0xca, 0x58, 0x22, 0x75, 0xa8, 0xc5, 0xe5, 0x97, 0x1f, 0x63, 0xbf, 0x7a, 0xe9, 0x66, 0x2c, 0x61, 0x8e, 0x2f, 0x6c, 0xfc, 0xe5, 0xf7, 0x73, 0x44, 0x7a, 0x64, 0x8e, 0x10, 0x41, 0xe2, 0x67, 0xb1, 0x9f, 0x60, 0xd3, 0x09, 0x1d, 0x7e, 0x02, 0x1d, 0x57, 0x07, 0xad, 0x21, 0x9e, 0x0e, 0xd6, 0x90, 0x1b, 0x5b, 0x4d, 0xbb, 0x63, 0x2d, 0xc6, 0x27, 0x7e, 0xee, 0x8c, 0x64, 0xe6, 0xb1, 0x04, 0x7f, 0x0a, 0x0b, 0xc9, 0x49, 0x79, 0x1c, 0xc9, 0x8f, 0xeb, 0x90, 0xf7, 0x0e, 0x94, 0xca, 0x6f, 0x1f, 0x0a, 0x90, 0xdb, 0xde, 0xd9, 0xdb, 0x5d, 0x59, 0x6d, 0xf0, 0x1f, 0x3f, 0xac, 0xee, 0xe8, 0xfa, 0xfe, 0x6e, 0xb3, 0x92, 0x5a, 0xfe, 0x6d, 0x1a, 0x52, 0x9b, 0xaf, 0xd0, 0x9f, 0x43, 0x86, 0xbf, 0x04, 0x8e, 0x78, 0xfe, 0xad, 0x8d, 0x7a, 0xec, 0xc4, 0x37, 0xbe, 0xf8, 0xff, 0x5f, 0x7d, 0x95, 0xba, 0x8a, 0x2b, 0xf5, 0xe1, 0xbb, 0x87, 0xc4, 0x35, 0xea, 0xa7, 0xc3, 0x3a, 0xab, 0x0f, 0xcf, 0xb4, 0xc7, 0x68, 0x1f, 0xd2, 0xbb, 0x03, 0x17, 0x25, 0x3e, 0x0d, 0xd7, 0x92, 0xdf, 0x40, 0xf1, 0x1c, 0x13, 0x3c, 0x83, 0xcb, 0x8a, 0xe0, 0xfe, 0xc0, 0xa5, 0x62, 0x07, 0x50, 0x50, 0x5f, 0x31, 0x2f, 0x7c, 0x33, 0xae, 0x5d, 0xfc, 0x42, 0x8a, 0xef, 0x30, 0x75, 0x37, 0xf0, 0x35, 0x45, 0x1d, 0x7f, 0x6b, 0x55, 0x67, 0xd3, 0x3c, 0x33, 0x51, 0xe2, 0xab, 0x72, 0x2d, 0xf9, 0xe1, 0x34, 0x76, 0x36, 0xee, 0x99, 0x49, 0xc5, 0x9a, 0xe2, 0xdd, 0xb4, 0xe5, 0xa2, 0xdb, 0x31, 0xef, 0x66, 0xea, 0x0b, 0x51, 0x6d, 0x21, 0x99, 0x41, 0x28, 0x5a, 0x60, 0x8a, 0x6a, 0xf8, 0xaa, 0xa2, 0xa8, 0xe5, 0xb1, 0x3d, 0xd3, 0x1e, 0x2f, 0x1f, 0x43, 0x86, 0x21, 0xc4, 0xe8, 0x2f, 0xe4, 0x47, 0x2d, 0x06, 0xdb, 0x4e, 0x58, 0xfc, 0x00, 0xb6, 0x8c, 0xab, 0x4c, 0x19, 0xc2, 0x25, 0xa9, 0x8c, 0x61, 0xc4, 0xcf, 0xb4, 0xc7, 0x8b, 0xda, 0xdb, 0xda, 0xf2, 0x6f, 0x26, 0x21, 0xc3, 0xe0, 0x22, 0x64, 0x01, 0xf8, 0x68, 0x6a, 0x78, 0x96, 0x11, 0x7c, 0x36, 0x3c, 0xcb, 0x28, 0x10, 0x8b, 0xe7, 0x99, 0xe2, 0x2a, 0x9e, 0x91, 0x8a, 0x19, 0x12, 0x55, 0x67, 0xe0, 0x1a, 0xf5, 0xe9, 0x50, 0x00, 0x66, 0x3c, 0xcc, 0x50, 0x9c, 0xc0, 0x00, 0xaa, 0x1a, 0xde, 0x21, 0x31, 0x88, 0x2a, 0xc6, 0x4c, 0xe7, 0x4d, 0x7c, 0x5d, 0xf1, 0x2c, 0x57, 0x6b, 0x33, 0x46, 0xaa, 0xf7, 0xef, 0x34, 0x28, 0x07, 0x71, 0x51, 0x74, 0x37, 0x46, 0x72, 0x18, 0x5e, 0xad, 0xdd, 0x1b, 0xcd, 0x94, 0x64, 0x01, 0x57, 0x7f, 0x4a, 0x48, 0xdf, 0xa0, 0x8c, 0xc2, 0xf1, 0xe8, 0x1f, 0x34, 0x98, 0x0e, 0x81, 0x9d, 0x28, 0x4e, 0x43, 0x04, 0x4a, 0xad, 0xdd, 0xbf, 0x80, 0x4b, 0x18, 0xf2, 0x80, 0x19, 0xb2, 0x80, 0x6f, 0x44, 0x5c, 0xe1, 0x76, 0x7a, 0xc4, 0xb5, 0x84, 0x31, 0xde, 0x32, 0x70, 0x60, 0x32, 0x76, 0x19, 0x02, 0x40, 0x67, 0xec, 0x32, 0x04, 0x51, 0xcd, 0x11, 0xcb, 0xc0, 0xd1, 0x48, 0xba, 0xc5, 0x7f, 0x97, 0x86, 0xdc, 0x2a, 0xff, 0x05, 0x22, 0x72, 0x20, 0xef, 0x21, 0x80, 0x68, 0x3e, 0x0e, 0x8d, 0xf1, 0x6f, 0x0b, 0xb5, 0xdb, 0x89, 0xfd, 0x42, 0xfb, 0x7d, 0xa6, 0xfd, 0x36, 0xae, 0x49, 0xed, 0xe2, 0x87, 0x8e, 0x75, 0x7e, 0xed, 0xaf, 0x1b, 0xed, 0x36, 0x9d, 0xf8, 0xdf, 0x42, 0x51, 0x85, 0xe9, 0xd0, 0x9d, 0x58, 0x14, 0x48, 0x45, 0xfa, 0x6a, 0x78, 0x14, 0x8b, 0xd0, 0xbe, 0xc8, 0xb4, 0x63, 0x7c, 0x2b, 0x41, 0xbb, 0xcd, 0xd8, 0x03, 0x06, 0x70, 0x98, 0x2d, 0xde, 0x80, 0x00, 0x8a, 0x17, 0x6f, 0x40, 0x10, 0xa5, 0xbb, 0xd0, 0x80, 0x01, 0x63, 0xa7, 0x06, 0xbc, 0x06, 0xf0, 0x41, 0x35, 0x14, 0xeb, 0x57, 0xe5, 0xea, 0x14, 0x0e, 0xf9, 0x28, 0x1e, 0x17, 0xdd, 0x73, 0x21, 0xd5, 0xdd, 0x8e, 0x43, 0x43, 0x7f, 0xf9, 0x9b, 0x2c, 0x14, 0x5e, 0x1a, 0x1d, 0xd3, 0x25, 0xa6, 0x61, 0xb6, 0x08, 0x3a, 0x82, 0x0c, 0x2b, 0x8d, 0xe1, 0x2c, 0xa7, 0x62, 0x4d, 0xe1, 0x2c, 0x17, 0x00, 0x62, 0xf0, 0x3d, 0xa6, 0x79, 0x1e, 0xcf, 0x49, 0xcd, 0x3d, 0x5f, 0x7c, 0x9d, 0x61, 0x28, 0x74, 0xc2, 0x7f, 0x09, 0x59, 0x01, 0xcf, 0x87, 0x84, 0x05, 0xb0, 0x95, 0xda, 0xcd, 0xf8, 0xce, 0xa4, 0xed, 0xa5, 0xaa, 0x72, 0x18, 0x2f, 0xd5, 0xf5, 0x06, 0xc0, 0x07, 0x08, 0xc3, 0xce, 0x8d, 0xe0, 0x89, 0xb5, 0x85, 0x64, 0x06, 0xa1, 0xf7, 0x11, 0xd3, 0x7b, 0x17, 0xcf, 0xc7, 0xe9, 0x6d, 0x7b, 0xfc, 0x54, 0xf7, 0x21, 0x4c, 0xae, 0x1b, 0xce, 0x09, 0x0a, 0x15, 0x3b, 0xe5, 0x47, 0x03, 0xb5, 0x5a, 0x5c, 0x97, 0xd0, 0x74, 0x97, 0x69, 0xba, 0x85, 0xab, 0x71, 0x9a, 0x4e, 0x0c, 0x87, 0x56, 0x0f, 0x74, 0x02, 0x59, 0xfe, 0x3b, 0x82, 0xb0, 0x2f, 0x03, 0xbf, 0x45, 0x08, 0xfb, 0x32, 0xf8, 0xd3, 0x83, 0xcb, 0x69, 0x72, 0x61, 0x4a, 0x3e, 0xde, 0xa3, 0x5b, 0xa1, 0xa5, 0x09, 0x3e, 0xf4, 0xd7, 0xe6, 0x93, 0xba, 0x85, 0xbe, 0x87, 0x4c, 0xdf, 0x1d, 0x7c, 0x33, 0x76, 0xed, 0x04, 0xf7, 0x33, 0xed, 0xf1, 0xdb, 0x1a, 0x2d, 0x13, 0xe0, 0x83, 0xac, 0x91, 0xe8, 0x08, 0xe3, 0xb5, 0x91, 0xe8, 0x88, 0xe0, 0xb3, 0x78, 0x99, 0x29, 0x7f, 0x8a, 0x1f, 0xc6, 0x29, 0x77, 0x6d, 0xc3, 0x74, 0x8e, 0x88, 0xfd, 0x16, 0x07, 0xd3, 0x9c, 0x93, 0x4e, 0x9f, 0x46, 0xca, 0xef, 0xa7, 0x61, 0x92, 0x9e, 0x47, 0x69, 0x79, 0xf6, 0xaf, 0xf1, 0x61, 0x6b, 0x22, 0xe0, 0x59, 0xd8, 0x9a, 0x28, 0x02, 0x10, 0x2d, 0xcf, 0xec, 0xb7, 0xe6, 0x84, 0x31, 0x51, 0xaf, 0x3b, 0x50, 0x50, 0xee, 0xfa, 0x28, 0x46, 0x60, 0x10, 0x99, 0x0b, 0xd7, 0x85, 0x18, 0xa0, 0x00, 0xdf, 0x66, 0x3a, 0xe7, 0xf0, 0x6c, 0x40, 0x67, 0x9b, 0x73, 0x51, 0xa5, 0x7f, 0x0d, 0x45, 0x15, 0x13, 0x40, 0x31, 0x32, 0x43, 0xc8, 0x5f, 0x38, 0x25, 0xc6, 0x41, 0x0a, 0xd1, 0xec, 0xe0, 0xfd, 0xae, 0x5e, 0xb2, 0x52, 0xe5, 0x7d, 0xc8, 0x09, 0xa0, 0x20, 0x6e, 0xb6, 0x41, 0xa8, 0x30, 0x6e, 0xb6, 0x21, 0x94, 0x21, 0x7a, 0xcc, 0x63, 0x5a, 0xe9, 0x7d, 0x48, 0x96, 0x20, 0xa1, 0xf1, 0x05, 0x71, 0x93, 0x34, 0xfa, 0xd8, 0x57, 0x92, 0x46, 0xe5, 0x2e, 0x3a, 0x4a, 0xe3, 0x31, 0x71, 0x45, 0x2c, 0xc9, 0x7b, 0x1e, 0x4a, 0x10, 0xa8, 0xa6, 0x7c, 0x3c, 0x8a, 0x25, 0xe9, 0x54, 0xee, 0x2b, 0x15, 0xf9, 0x1e, 0x7d, 0x0e, 0xe0, 0x43, 0x1a, 0xe1, 0xd3, 0x56, 0x2c, 0x2e, 0x1a, 0x3e, 0x6d, 0xc5, 0xa3, 0x22, 0xd1, 0xfc, 0xe1, 0xeb, 0xe6, 0x17, 0x03, 0xaa, 0xfd, 0x5f, 0x34, 0x40, 0x51, 0x04, 0x04, 0x3d, 0x89, 0xd7, 0x10, 0x8b, 0xb8, 0xd6, 0x9e, 0x5e, 0x8e, 0x39, 0xa9, 0x44, 0xf8, 0x66, 0xb5, 0xd8, 0x88, 0xfe, 0x6b, 0x6a, 0xd8, 0x97, 0x1a, 0x94, 0x02, 0x10, 0x0a, 0x7a, 0x90, 0xb0, 0xc6, 0x21, 0xd0, 0xb6, 0xf6, 0xf0, 0x42, 0xbe, 0xa4, 0x93, 0x98, 0xb2, 0x23, 0xe4, 0x41, 0xfc, 0x1f, 0x35, 0x28, 0x07, 0x61, 0x17, 0x94, 0x20, 0x3f, 0x02, 0xfc, 0xd6, 0x16, 0x2f, 0x66, 0xbc, 0x78, 0xa9, 0xfc, 0xb3, 0x79, 0x1f, 0x72, 0x02, 0xac, 0x89, 0x0b, 0x88, 0x20, 0x6c, 0x1c, 0x17, 0x10, 0x21, 0xa4, 0x27, 0x21, 0x20, 0x6c, 0xab, 0x4b, 0x94, 0x10, 0x14, 0x88, 0x4e, 0x92, 0xc6, 0xd1, 0x21, 0x18, 0x82, 0x83, 0x46, 0x69, 0xf4, 0x43, 0x50, 0xc2, 0x39, 0x28, 0x41, 0xe0, 0x05, 0x21, 0x18, 0x46, 0x83, 0x12, 0x42, 0x90, 0x29, 0x55, 0x42, 0xd0, 0x07, 0x5f, 0xe2, 0x42, 0x30, 0x82, 0x88, 0xc7, 0x85, 0x60, 0x14, 0xbf, 0x49, 0x58, 0x57, 0xa6, 0x3b, 0x10, 0x82, 0x33, 0x31, 0x58, 0x0d, 0x7a, 0x9a, 0xe0, 0xd0, 0x58, 0xb0, 0xbd, 0xf6, 0xd6, 0x25, 0xb9, 0x47, 0xee, 0x7d, 0xbe, 0x14, 0x72, 0xef, 0x7f, 0xad, 0xc1, 0x6c, 0x1c, 0xd6, 0x83, 0x12, 0x74, 0x25, 0x00, 0xf5, 0xb5, 0xa5, 0xcb, 0xb2, 0x5f, 0xec, 0x35, 0x2f, 0x1a, 0x9e, 0x57, 0xfe, 0xfb, 0xbb, 0x79, 0xed, 0xff, 0xbe, 0x9b, 0xd7, 0x7e, 0xf1, 0xdd, 0xbc, 0xf6, 0xaf, 0xbf, 0x9c, 0x9f, 0x38, 0xcc, 0xb2, 0xff, 0xe1, 0xf5, 0xee, 0x1f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x74, 0x55, 0x61, 0xe6, 0x68, 0x36, 0x00, 0x00, } ================================================ FILE: vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.proto ================================================ syntax = "proto3"; package etcdserverpb; import "gogoproto/gogo.proto"; import "etcd/mvcc/mvccpb/kv.proto"; import "etcd/auth/authpb/auth.proto"; // for grpc-gateway import "google/api/annotations.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.unmarshaler_all) = true; service KV { // Range gets the keys in the range from the key-value store. rpc Range(RangeRequest) returns (RangeResponse) { option (google.api.http) = { post: "/v3beta/kv/range" body: "*" }; } // Put puts the given key into the key-value store. // A put request increments the revision of the key-value store // and generates one event in the event history. rpc Put(PutRequest) returns (PutResponse) { option (google.api.http) = { post: "/v3beta/kv/put" body: "*" }; } // DeleteRange deletes the given range from the key-value store. // A delete request increments the revision of the key-value store // and generates a delete event in the event history for every deleted key. rpc DeleteRange(DeleteRangeRequest) returns (DeleteRangeResponse) { option (google.api.http) = { post: "/v3beta/kv/deleterange" body: "*" }; } // Txn processes multiple requests in a single transaction. // A txn request increments the revision of the key-value store // and generates events with the same revision for every completed request. // It is not allowed to modify the same key several times within one txn. rpc Txn(TxnRequest) returns (TxnResponse) { option (google.api.http) = { post: "/v3beta/kv/txn" body: "*" }; } // Compact compacts the event history in the etcd key-value store. The key-value // store should be periodically compacted or the event history will continue to grow // indefinitely. rpc Compact(CompactionRequest) returns (CompactionResponse) { option (google.api.http) = { post: "/v3beta/kv/compaction" body: "*" }; } } service Watch { // Watch watches for events happening or that have happened. Both input and output // are streams; the input stream is for creating and canceling watchers and the output // stream sends events. One watch RPC can watch on multiple key ranges, streaming events // for several watches at once. The entire event history can be watched starting from the // last compaction revision. rpc Watch(stream WatchRequest) returns (stream WatchResponse) { option (google.api.http) = { post: "/v3beta/watch" body: "*" }; } } service Lease { // LeaseGrant creates a lease which expires if the server does not receive a keepAlive // within a given time to live period. All keys attached to the lease will be expired and // deleted if the lease expires. Each expired key generates a delete event in the event history. rpc LeaseGrant(LeaseGrantRequest) returns (LeaseGrantResponse) { option (google.api.http) = { post: "/v3beta/lease/grant" body: "*" }; } // LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. rpc LeaseRevoke(LeaseRevokeRequest) returns (LeaseRevokeResponse) { option (google.api.http) = { post: "/v3beta/kv/lease/revoke" body: "*" }; } // LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client // to the server and streaming keep alive responses from the server to the client. rpc LeaseKeepAlive(stream LeaseKeepAliveRequest) returns (stream LeaseKeepAliveResponse) { option (google.api.http) = { post: "/v3beta/lease/keepalive" body: "*" }; } // LeaseTimeToLive retrieves lease information. rpc LeaseTimeToLive(LeaseTimeToLiveRequest) returns (LeaseTimeToLiveResponse) { option (google.api.http) = { post: "/v3beta/kv/lease/timetolive" body: "*" }; } // LeaseLeases lists all existing leases. rpc LeaseLeases(LeaseLeasesRequest) returns (LeaseLeasesResponse) { option (google.api.http) = { post: "/v3beta/kv/lease/leases" body: "*" }; } } service Cluster { // MemberAdd adds a member into the cluster. rpc MemberAdd(MemberAddRequest) returns (MemberAddResponse) { option (google.api.http) = { post: "/v3beta/cluster/member/add" body: "*" }; } // MemberRemove removes an existing member from the cluster. rpc MemberRemove(MemberRemoveRequest) returns (MemberRemoveResponse) { option (google.api.http) = { post: "/v3beta/cluster/member/remove" body: "*" }; } // MemberUpdate updates the member configuration. rpc MemberUpdate(MemberUpdateRequest) returns (MemberUpdateResponse) { option (google.api.http) = { post: "/v3beta/cluster/member/update" body: "*" }; } // MemberList lists all the members in the cluster. rpc MemberList(MemberListRequest) returns (MemberListResponse) { option (google.api.http) = { post: "/v3beta/cluster/member/list" body: "*" }; } } service Maintenance { // Alarm activates, deactivates, and queries alarms regarding cluster health. rpc Alarm(AlarmRequest) returns (AlarmResponse) { option (google.api.http) = { post: "/v3beta/maintenance/alarm" body: "*" }; } // Status gets the status of the member. rpc Status(StatusRequest) returns (StatusResponse) { option (google.api.http) = { post: "/v3beta/maintenance/status" body: "*" }; } // Defragment defragments a member's backend database to recover storage space. rpc Defragment(DefragmentRequest) returns (DefragmentResponse) { option (google.api.http) = { post: "/v3beta/maintenance/defragment" body: "*" }; } // Hash computes the hash of the KV's backend. // This is designed for testing; do not use this in production when there // are ongoing transactions. rpc Hash(HashRequest) returns (HashResponse) { option (google.api.http) = { post: "/v3beta/maintenance/hash" body: "*" }; } // HashKV computes the hash of all MVCC keys up to a given revision. rpc HashKV(HashKVRequest) returns (HashKVResponse) { option (google.api.http) = { post: "/v3beta/maintenance/hash" body: "*" }; } // Snapshot sends a snapshot of the entire backend from a member over a stream to a client. rpc Snapshot(SnapshotRequest) returns (stream SnapshotResponse) { option (google.api.http) = { post: "/v3beta/maintenance/snapshot" body: "*" }; } // MoveLeader requests current leader node to transfer its leadership to transferee. rpc MoveLeader(MoveLeaderRequest) returns (MoveLeaderResponse) { option (google.api.http) = { post: "/v3beta/maintenance/transfer-leadership" body: "*" }; } } service Auth { // AuthEnable enables authentication. rpc AuthEnable(AuthEnableRequest) returns (AuthEnableResponse) { option (google.api.http) = { post: "/v3beta/auth/enable" body: "*" }; } // AuthDisable disables authentication. rpc AuthDisable(AuthDisableRequest) returns (AuthDisableResponse) { option (google.api.http) = { post: "/v3beta/auth/disable" body: "*" }; } // Authenticate processes an authenticate request. rpc Authenticate(AuthenticateRequest) returns (AuthenticateResponse) { option (google.api.http) = { post: "/v3beta/auth/authenticate" body: "*" }; } // UserAdd adds a new user. rpc UserAdd(AuthUserAddRequest) returns (AuthUserAddResponse) { option (google.api.http) = { post: "/v3beta/auth/user/add" body: "*" }; } // UserGet gets detailed user information. rpc UserGet(AuthUserGetRequest) returns (AuthUserGetResponse) { option (google.api.http) = { post: "/v3beta/auth/user/get" body: "*" }; } // UserList gets a list of all users. rpc UserList(AuthUserListRequest) returns (AuthUserListResponse) { option (google.api.http) = { post: "/v3beta/auth/user/list" body: "*" }; } // UserDelete deletes a specified user. rpc UserDelete(AuthUserDeleteRequest) returns (AuthUserDeleteResponse) { option (google.api.http) = { post: "/v3beta/auth/user/delete" body: "*" }; } // UserChangePassword changes the password of a specified user. rpc UserChangePassword(AuthUserChangePasswordRequest) returns (AuthUserChangePasswordResponse) { option (google.api.http) = { post: "/v3beta/auth/user/changepw" body: "*" }; } // UserGrant grants a role to a specified user. rpc UserGrantRole(AuthUserGrantRoleRequest) returns (AuthUserGrantRoleResponse) { option (google.api.http) = { post: "/v3beta/auth/user/grant" body: "*" }; } // UserRevokeRole revokes a role of specified user. rpc UserRevokeRole(AuthUserRevokeRoleRequest) returns (AuthUserRevokeRoleResponse) { option (google.api.http) = { post: "/v3beta/auth/user/revoke" body: "*" }; } // RoleAdd adds a new role. rpc RoleAdd(AuthRoleAddRequest) returns (AuthRoleAddResponse) { option (google.api.http) = { post: "/v3beta/auth/role/add" body: "*" }; } // RoleGet gets detailed role information. rpc RoleGet(AuthRoleGetRequest) returns (AuthRoleGetResponse) { option (google.api.http) = { post: "/v3beta/auth/role/get" body: "*" }; } // RoleList gets lists of all roles. rpc RoleList(AuthRoleListRequest) returns (AuthRoleListResponse) { option (google.api.http) = { post: "/v3beta/auth/role/list" body: "*" }; } // RoleDelete deletes a specified role. rpc RoleDelete(AuthRoleDeleteRequest) returns (AuthRoleDeleteResponse) { option (google.api.http) = { post: "/v3beta/auth/role/delete" body: "*" }; } // RoleGrantPermission grants a permission of a specified key or range to a specified role. rpc RoleGrantPermission(AuthRoleGrantPermissionRequest) returns (AuthRoleGrantPermissionResponse) { option (google.api.http) = { post: "/v3beta/auth/role/grant" body: "*" }; } // RoleRevokePermission revokes a key or range permission of a specified role. rpc RoleRevokePermission(AuthRoleRevokePermissionRequest) returns (AuthRoleRevokePermissionResponse) { option (google.api.http) = { post: "/v3beta/auth/role/revoke" body: "*" }; } } message ResponseHeader { // cluster_id is the ID of the cluster which sent the response. uint64 cluster_id = 1; // member_id is the ID of the member which sent the response. uint64 member_id = 2; // revision is the key-value store revision when the request was applied. int64 revision = 3; // raft_term is the raft term when the request was applied. uint64 raft_term = 4; } message RangeRequest { enum SortOrder { NONE = 0; // default, no sorting ASCEND = 1; // lowest target value first DESCEND = 2; // highest target value first } enum SortTarget { KEY = 0; VERSION = 1; CREATE = 2; MOD = 3; VALUE = 4; } // key is the first key for the range. If range_end is not given, the request only looks up key. bytes key = 1; // range_end is the upper bound on the requested range [key, range_end). // If range_end is '\0', the range is all keys >= key. // If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"), // then the range request gets all keys prefixed with key. // If both key and range_end are '\0', then the range request returns all keys. bytes range_end = 2; // limit is a limit on the number of keys returned for the request. When limit is set to 0, // it is treated as no limit. int64 limit = 3; // revision is the point-in-time of the key-value store to use for the range. // If revision is less or equal to zero, the range is over the newest key-value store. // If the revision has been compacted, ErrCompacted is returned as a response. int64 revision = 4; // sort_order is the order for returned sorted results. SortOrder sort_order = 5; // sort_target is the key-value field to use for sorting. SortTarget sort_target = 6; // serializable sets the range request to use serializable member-local reads. // Range requests are linearizable by default; linearizable requests have higher // latency and lower throughput than serializable requests but reflect the current // consensus of the cluster. For better performance, in exchange for possible stale reads, // a serializable range request is served locally without needing to reach consensus // with other nodes in the cluster. bool serializable = 7; // keys_only when set returns only the keys and not the values. bool keys_only = 8; // count_only when set returns only the count of the keys in the range. bool count_only = 9; // min_mod_revision is the lower bound for returned key mod revisions; all keys with // lesser mod revisions will be filtered away. int64 min_mod_revision = 10; // max_mod_revision is the upper bound for returned key mod revisions; all keys with // greater mod revisions will be filtered away. int64 max_mod_revision = 11; // min_create_revision is the lower bound for returned key create revisions; all keys with // lesser create trevisions will be filtered away. int64 min_create_revision = 12; // max_create_revision is the upper bound for returned key create revisions; all keys with // greater create revisions will be filtered away. int64 max_create_revision = 13; } message RangeResponse { ResponseHeader header = 1; // kvs is the list of key-value pairs matched by the range request. // kvs is empty when count is requested. repeated mvccpb.KeyValue kvs = 2; // more indicates if there are more keys to return in the requested range. bool more = 3; // count is set to the number of keys within the range when requested. int64 count = 4; } message PutRequest { // key is the key, in bytes, to put into the key-value store. bytes key = 1; // value is the value, in bytes, to associate with the key in the key-value store. bytes value = 2; // lease is the lease ID to associate with the key in the key-value store. A lease // value of 0 indicates no lease. int64 lease = 3; // If prev_kv is set, etcd gets the previous key-value pair before changing it. // The previous key-value pair will be returned in the put response. bool prev_kv = 4; // If ignore_value is set, etcd updates the key using its current value. // Returns an error if the key does not exist. bool ignore_value = 5; // If ignore_lease is set, etcd updates the key using its current lease. // Returns an error if the key does not exist. bool ignore_lease = 6; } message PutResponse { ResponseHeader header = 1; // if prev_kv is set in the request, the previous key-value pair will be returned. mvccpb.KeyValue prev_kv = 2; } message DeleteRangeRequest { // key is the first key to delete in the range. bytes key = 1; // range_end is the key following the last key to delete for the range [key, range_end). // If range_end is not given, the range is defined to contain only the key argument. // If range_end is one bit larger than the given key, then the range is all the keys // with the prefix (the given key). // If range_end is '\0', the range is all keys greater than or equal to the key argument. bytes range_end = 2; // If prev_kv is set, etcd gets the previous key-value pairs before deleting it. // The previous key-value pairs will be returned in the delete response. bool prev_kv = 3; } message DeleteRangeResponse { ResponseHeader header = 1; // deleted is the number of keys deleted by the delete range request. int64 deleted = 2; // if prev_kv is set in the request, the previous key-value pairs will be returned. repeated mvccpb.KeyValue prev_kvs = 3; } message RequestOp { // request is a union of request types accepted by a transaction. oneof request { RangeRequest request_range = 1; PutRequest request_put = 2; DeleteRangeRequest request_delete_range = 3; TxnRequest request_txn = 4; } } message ResponseOp { // response is a union of response types returned by a transaction. oneof response { RangeResponse response_range = 1; PutResponse response_put = 2; DeleteRangeResponse response_delete_range = 3; TxnResponse response_txn = 4; } } message Compare { enum CompareResult { EQUAL = 0; GREATER = 1; LESS = 2; NOT_EQUAL = 3; } enum CompareTarget { VERSION = 0; CREATE = 1; MOD = 2; VALUE= 3; LEASE = 4; } // result is logical comparison operation for this comparison. CompareResult result = 1; // target is the key-value field to inspect for the comparison. CompareTarget target = 2; // key is the subject key for the comparison operation. bytes key = 3; oneof target_union { // version is the version of the given key int64 version = 4; // create_revision is the creation revision of the given key int64 create_revision = 5; // mod_revision is the last modified revision of the given key. int64 mod_revision = 6; // value is the value of the given key, in bytes. bytes value = 7; // lease is the lease id of the given key. int64 lease = 8; // leave room for more target_union field tags, jump to 64 } // range_end compares the given target to all keys in the range [key, range_end). // See RangeRequest for more details on key ranges. bytes range_end = 64; // TODO: fill out with most of the rest of RangeRequest fields when needed. } // From google paxosdb paper: // Our implementation hinges around a powerful primitive which we call MultiOp. All other database // operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically // and consists of three components: // 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check // for the absence or presence of a value, or compare with a given value. Two different tests in the guard // may apply to the same or different entries in the database. All tests in the guard are applied and // MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise // it executes f op (see item 3 below). // 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or // lookup operation, and applies to a single database entry. Two different operations in the list may apply // to the same or different entries in the database. These operations are executed // if guard evaluates to // true. // 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false. message TxnRequest { // compare is a list of predicates representing a conjunction of terms. // If the comparisons succeed, then the success requests will be processed in order, // and the response will contain their respective responses in order. // If the comparisons fail, then the failure requests will be processed in order, // and the response will contain their respective responses in order. repeated Compare compare = 1; // success is a list of requests which will be applied when compare evaluates to true. repeated RequestOp success = 2; // failure is a list of requests which will be applied when compare evaluates to false. repeated RequestOp failure = 3; } message TxnResponse { ResponseHeader header = 1; // succeeded is set to true if the compare evaluated to true or false otherwise. bool succeeded = 2; // responses is a list of responses corresponding to the results from applying // success if succeeded is true or failure if succeeded is false. repeated ResponseOp responses = 3; } // CompactionRequest compacts the key-value store up to a given revision. All superseded keys // with a revision less than the compaction revision will be removed. message CompactionRequest { // revision is the key-value store revision for the compaction operation. int64 revision = 1; // physical is set so the RPC will wait until the compaction is physically // applied to the local database such that compacted entries are totally // removed from the backend database. bool physical = 2; } message CompactionResponse { ResponseHeader header = 1; } message HashRequest { } message HashKVRequest { // revision is the key-value store revision for the hash operation. int64 revision = 1; } message HashKVResponse { ResponseHeader header = 1; // hash is the hash value computed from the responding member's MVCC keys up to a given revision. uint32 hash = 2; // compact_revision is the compacted revision of key-value store when hash begins. int64 compact_revision = 3; } message HashResponse { ResponseHeader header = 1; // hash is the hash value computed from the responding member's KV's backend. uint32 hash = 2; } message SnapshotRequest { } message SnapshotResponse { // header has the current key-value store information. The first header in the snapshot // stream indicates the point in time of the snapshot. ResponseHeader header = 1; // remaining_bytes is the number of blob bytes to be sent after this message uint64 remaining_bytes = 2; // blob contains the next chunk of the snapshot in the snapshot stream. bytes blob = 3; } message WatchRequest { // request_union is a request to either create a new watcher or cancel an existing watcher. oneof request_union { WatchCreateRequest create_request = 1; WatchCancelRequest cancel_request = 2; } } message WatchCreateRequest { // key is the key to register for watching. bytes key = 1; // range_end is the end of the range [key, range_end) to watch. If range_end is not given, // only the key argument is watched. If range_end is equal to '\0', all keys greater than // or equal to the key argument are watched. // If the range_end is one bit larger than the given key, // then all keys with the prefix (the given key) will be watched. bytes range_end = 2; // start_revision is an optional revision to watch from (inclusive). No start_revision is "now". int64 start_revision = 3; // progress_notify is set so that the etcd server will periodically send a WatchResponse with // no events to the new watcher if there are no recent events. It is useful when clients // wish to recover a disconnected watcher starting from a recent known revision. // The etcd server may decide how often it will send notifications based on current load. bool progress_notify = 4; enum FilterType { // filter out put event. NOPUT = 0; // filter out delete event. NODELETE = 1; } // filters filter the events at server side before it sends back to the watcher. repeated FilterType filters = 5; // If prev_kv is set, created watcher gets the previous KV before the event happens. // If the previous KV is already compacted, nothing will be returned. bool prev_kv = 6; } message WatchCancelRequest { // watch_id is the watcher id to cancel so that no more events are transmitted. int64 watch_id = 1; } message WatchResponse { ResponseHeader header = 1; // watch_id is the ID of the watcher that corresponds to the response. int64 watch_id = 2; // created is set to true if the response is for a create watch request. // The client should record the watch_id and expect to receive events for // the created watcher from the same stream. // All events sent to the created watcher will attach with the same watch_id. bool created = 3; // canceled is set to true if the response is for a cancel watch request. // No further events will be sent to the canceled watcher. bool canceled = 4; // compact_revision is set to the minimum index if a watcher tries to watch // at a compacted index. // // This happens when creating a watcher at a compacted revision or the watcher cannot // catch up with the progress of the key-value store. // // The client should treat the watcher as canceled and should not try to create any // watcher with the same start_revision again. int64 compact_revision = 5; // cancel_reason indicates the reason for canceling the watcher. string cancel_reason = 6; repeated mvccpb.Event events = 11; } message LeaseGrantRequest { // TTL is the advisory time-to-live in seconds. Expired lease will return -1. int64 TTL = 1; // ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. int64 ID = 2; } message LeaseGrantResponse { ResponseHeader header = 1; // ID is the lease ID for the granted lease. int64 ID = 2; // TTL is the server chosen lease time-to-live in seconds. int64 TTL = 3; string error = 4; } message LeaseRevokeRequest { // ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. int64 ID = 1; } message LeaseRevokeResponse { ResponseHeader header = 1; } message LeaseKeepAliveRequest { // ID is the lease ID for the lease to keep alive. int64 ID = 1; } message LeaseKeepAliveResponse { ResponseHeader header = 1; // ID is the lease ID from the keep alive request. int64 ID = 2; // TTL is the new time-to-live for the lease. int64 TTL = 3; } message LeaseTimeToLiveRequest { // ID is the lease ID for the lease. int64 ID = 1; // keys is true to query all the keys attached to this lease. bool keys = 2; } message LeaseTimeToLiveResponse { ResponseHeader header = 1; // ID is the lease ID from the keep alive request. int64 ID = 2; // TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds. int64 TTL = 3; // GrantedTTL is the initial granted time in seconds upon lease creation/renewal. int64 grantedTTL = 4; // Keys is the list of keys attached to this lease. repeated bytes keys = 5; } message LeaseLeasesRequest { } message LeaseStatus { int64 ID = 1; // TODO: int64 TTL = 2; } message LeaseLeasesResponse { ResponseHeader header = 1; repeated LeaseStatus leases = 2; } message Member { // ID is the member ID for this member. uint64 ID = 1; // name is the human-readable name of the member. If the member is not started, the name will be an empty string. string name = 2; // peerURLs is the list of URLs the member exposes to the cluster for communication. repeated string peerURLs = 3; // clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty. repeated string clientURLs = 4; } message MemberAddRequest { // peerURLs is the list of URLs the added member will use to communicate with the cluster. repeated string peerURLs = 1; } message MemberAddResponse { ResponseHeader header = 1; // member is the member information for the added member. Member member = 2; // members is a list of all members after adding the new member. repeated Member members = 3; } message MemberRemoveRequest { // ID is the member ID of the member to remove. uint64 ID = 1; } message MemberRemoveResponse { ResponseHeader header = 1; // members is a list of all members after removing the member. repeated Member members = 2; } message MemberUpdateRequest { // ID is the member ID of the member to update. uint64 ID = 1; // peerURLs is the new list of URLs the member will use to communicate with the cluster. repeated string peerURLs = 2; } message MemberUpdateResponse{ ResponseHeader header = 1; // members is a list of all members after updating the member. repeated Member members = 2; } message MemberListRequest { } message MemberListResponse { ResponseHeader header = 1; // members is a list of all members associated with the cluster. repeated Member members = 2; } message DefragmentRequest { } message DefragmentResponse { ResponseHeader header = 1; } message MoveLeaderRequest { // targetID is the node ID for the new leader. uint64 targetID = 1; } message MoveLeaderResponse { ResponseHeader header = 1; } enum AlarmType { NONE = 0; // default, used to query if any alarm is active NOSPACE = 1; // space quota is exhausted CORRUPT = 2; // kv store corruption detected } message AlarmRequest { enum AlarmAction { GET = 0; ACTIVATE = 1; DEACTIVATE = 2; } // action is the kind of alarm request to issue. The action // may GET alarm statuses, ACTIVATE an alarm, or DEACTIVATE a // raised alarm. AlarmAction action = 1; // memberID is the ID of the member associated with the alarm. If memberID is 0, the // alarm request covers all members. uint64 memberID = 2; // alarm is the type of alarm to consider for this request. AlarmType alarm = 3; } message AlarmMember { // memberID is the ID of the member associated with the raised alarm. uint64 memberID = 1; // alarm is the type of alarm which has been raised. AlarmType alarm = 2; } message AlarmResponse { ResponseHeader header = 1; // alarms is a list of alarms associated with the alarm request. repeated AlarmMember alarms = 2; } message StatusRequest { } message StatusResponse { ResponseHeader header = 1; // version is the cluster protocol version used by the responding member. string version = 2; // dbSize is the size of the backend database, in bytes, of the responding member. int64 dbSize = 3; // leader is the member ID which the responding member believes is the current leader. uint64 leader = 4; // raftIndex is the current raft index of the responding member. uint64 raftIndex = 5; // raftTerm is the current raft term of the responding member. uint64 raftTerm = 6; } message AuthEnableRequest { } message AuthDisableRequest { } message AuthenticateRequest { string name = 1; string password = 2; } message AuthUserAddRequest { string name = 1; string password = 2; } message AuthUserGetRequest { string name = 1; } message AuthUserDeleteRequest { // name is the name of the user to delete. string name = 1; } message AuthUserChangePasswordRequest { // name is the name of the user whose password is being changed. string name = 1; // password is the new password for the user. string password = 2; } message AuthUserGrantRoleRequest { // user is the name of the user which should be granted a given role. string user = 1; // role is the name of the role to grant to the user. string role = 2; } message AuthUserRevokeRoleRequest { string name = 1; string role = 2; } message AuthRoleAddRequest { // name is the name of the role to add to the authentication system. string name = 1; } message AuthRoleGetRequest { string role = 1; } message AuthUserListRequest { } message AuthRoleListRequest { } message AuthRoleDeleteRequest { string role = 1; } message AuthRoleGrantPermissionRequest { // name is the name of the role which will be granted the permission. string name = 1; // perm is the permission to grant to the role. authpb.Permission perm = 2; } message AuthRoleRevokePermissionRequest { string role = 1; string key = 2; string range_end = 3; } message AuthEnableResponse { ResponseHeader header = 1; } message AuthDisableResponse { ResponseHeader header = 1; } message AuthenticateResponse { ResponseHeader header = 1; // token is an authorized token that can be used in succeeding RPCs string token = 2; } message AuthUserAddResponse { ResponseHeader header = 1; } message AuthUserGetResponse { ResponseHeader header = 1; repeated string roles = 2; } message AuthUserDeleteResponse { ResponseHeader header = 1; } message AuthUserChangePasswordResponse { ResponseHeader header = 1; } message AuthUserGrantRoleResponse { ResponseHeader header = 1; } message AuthUserRevokeRoleResponse { ResponseHeader header = 1; } message AuthRoleAddResponse { ResponseHeader header = 1; } message AuthRoleGetResponse { ResponseHeader header = 1; repeated authpb.Permission perm = 2; } message AuthRoleListResponse { ResponseHeader header = 1; repeated string roles = 2; } message AuthUserListResponse { ResponseHeader header = 1; repeated string users = 2; } message AuthRoleDeleteResponse { ResponseHeader header = 1; } message AuthRoleGrantPermissionResponse { ResponseHeader header = 1; } message AuthRoleRevokePermissionResponse { ResponseHeader header = 1; } ================================================ FILE: vendor/github.com/coreos/etcd/mvcc/mvccpb/kv.pb.go ================================================ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: kv.proto /* Package mvccpb is a generated protocol buffer package. It is generated from these files: kv.proto It has these top-level messages: KeyValue Event */ package mvccpb import ( "fmt" proto "github.com/golang/protobuf/proto" math "math" _ "github.com/gogo/protobuf/gogoproto" io "io" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type Event_EventType int32 const ( PUT Event_EventType = 0 DELETE Event_EventType = 1 ) var Event_EventType_name = map[int32]string{ 0: "PUT", 1: "DELETE", } var Event_EventType_value = map[string]int32{ "PUT": 0, "DELETE": 1, } func (x Event_EventType) String() string { return proto.EnumName(Event_EventType_name, int32(x)) } func (Event_EventType) EnumDescriptor() ([]byte, []int) { return fileDescriptorKv, []int{1, 0} } type KeyValue struct { // key is the key in bytes. An empty key is not allowed. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // create_revision is the revision of last creation on this key. CreateRevision int64 `protobuf:"varint,2,opt,name=create_revision,json=createRevision,proto3" json:"create_revision,omitempty"` // mod_revision is the revision of last modification on this key. ModRevision int64 `protobuf:"varint,3,opt,name=mod_revision,json=modRevision,proto3" json:"mod_revision,omitempty"` // version is the version of the key. A deletion resets // the version to zero and any modification of the key // increases its version. Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` // value is the value held by the key, in bytes. Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"` // lease is the ID of the lease that attached to key. // When the attached lease expires, the key will be deleted. // If lease is 0, then no lease is attached to the key. Lease int64 `protobuf:"varint,6,opt,name=lease,proto3" json:"lease,omitempty"` } func (m *KeyValue) Reset() { *m = KeyValue{} } func (m *KeyValue) String() string { return proto.CompactTextString(m) } func (*KeyValue) ProtoMessage() {} func (*KeyValue) Descriptor() ([]byte, []int) { return fileDescriptorKv, []int{0} } type Event struct { // type is the kind of event. If type is a PUT, it indicates // new data has been stored to the key. If type is a DELETE, // it indicates the key was deleted. Type Event_EventType `protobuf:"varint,1,opt,name=type,proto3,enum=mvccpb.Event_EventType" json:"type,omitempty"` // kv holds the KeyValue for the event. // A PUT event contains current kv pair. // A PUT event with kv.Version=1 indicates the creation of a key. // A DELETE/EXPIRE event contains the deleted key with // its modification revision set to the revision of deletion. Kv *KeyValue `protobuf:"bytes,2,opt,name=kv" json:"kv,omitempty"` // prev_kv holds the key-value pair before the event happens. PrevKv *KeyValue `protobuf:"bytes,3,opt,name=prev_kv,json=prevKv" json:"prev_kv,omitempty"` } func (m *Event) Reset() { *m = Event{} } func (m *Event) String() string { return proto.CompactTextString(m) } func (*Event) ProtoMessage() {} func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorKv, []int{1} } func init() { proto.RegisterType((*KeyValue)(nil), "mvccpb.KeyValue") proto.RegisterType((*Event)(nil), "mvccpb.Event") proto.RegisterEnum("mvccpb.Event_EventType", Event_EventType_name, Event_EventType_value) } func (m *KeyValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Key) > 0 { dAtA[i] = 0xa i++ i = encodeVarintKv(dAtA, i, uint64(len(m.Key))) i += copy(dAtA[i:], m.Key) } if m.CreateRevision != 0 { dAtA[i] = 0x10 i++ i = encodeVarintKv(dAtA, i, uint64(m.CreateRevision)) } if m.ModRevision != 0 { dAtA[i] = 0x18 i++ i = encodeVarintKv(dAtA, i, uint64(m.ModRevision)) } if m.Version != 0 { dAtA[i] = 0x20 i++ i = encodeVarintKv(dAtA, i, uint64(m.Version)) } if len(m.Value) > 0 { dAtA[i] = 0x2a i++ i = encodeVarintKv(dAtA, i, uint64(len(m.Value))) i += copy(dAtA[i:], m.Value) } if m.Lease != 0 { dAtA[i] = 0x30 i++ i = encodeVarintKv(dAtA, i, uint64(m.Lease)) } return i, nil } func (m *Event) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Event) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Type != 0 { dAtA[i] = 0x8 i++ i = encodeVarintKv(dAtA, i, uint64(m.Type)) } if m.Kv != nil { dAtA[i] = 0x12 i++ i = encodeVarintKv(dAtA, i, uint64(m.Kv.Size())) n1, err := m.Kv.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n1 } if m.PrevKv != nil { dAtA[i] = 0x1a i++ i = encodeVarintKv(dAtA, i, uint64(m.PrevKv.Size())) n2, err := m.PrevKv.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n2 } return i, nil } func encodeVarintKv(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return offset + 1 } func (m *KeyValue) Size() (n int) { var l int _ = l l = len(m.Key) if l > 0 { n += 1 + l + sovKv(uint64(l)) } if m.CreateRevision != 0 { n += 1 + sovKv(uint64(m.CreateRevision)) } if m.ModRevision != 0 { n += 1 + sovKv(uint64(m.ModRevision)) } if m.Version != 0 { n += 1 + sovKv(uint64(m.Version)) } l = len(m.Value) if l > 0 { n += 1 + l + sovKv(uint64(l)) } if m.Lease != 0 { n += 1 + sovKv(uint64(m.Lease)) } return n } func (m *Event) Size() (n int) { var l int _ = l if m.Type != 0 { n += 1 + sovKv(uint64(m.Type)) } if m.Kv != nil { l = m.Kv.Size() n += 1 + l + sovKv(uint64(l)) } if m.PrevKv != nil { l = m.PrevKv.Size() n += 1 + l + sovKv(uint64(l)) } return n } func sovKv(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozKv(x uint64) (n int) { return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *KeyValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: KeyValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthKv } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) if m.Key == nil { m.Key = []byte{} } iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType) } m.CreateRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.CreateRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType) } m.ModRevision = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ModRevision |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 4: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } m.Version = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Version |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthKv } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) if m.Value == nil { m.Value = []byte{} } iNdEx = postIndex case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) } m.Lease = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Lease |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipKv(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthKv } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Event) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Event: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Type |= (Event_EventType(b) & 0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthKv } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.Kv == nil { m.Kv = &KeyValue{} } if err := m.Kv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowKv } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthKv } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if m.PrevKv == nil { m.PrevKv = &KeyValue{} } if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipKv(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthKv } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipKv(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowKv } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowKv } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowKv } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthKv } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowKv } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipKv(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowKv = fmt.Errorf("proto: integer overflow") ) func init() { proto.RegisterFile("kv.proto", fileDescriptorKv) } var fileDescriptorKv = []byte{ // 303 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x41, 0x4e, 0xc2, 0x40, 0x14, 0x86, 0x3b, 0x14, 0x0a, 0x3e, 0x08, 0x36, 0x13, 0x12, 0x27, 0x2e, 0x26, 0x95, 0x8d, 0x18, 0x13, 0x4c, 0xf0, 0x06, 0xc6, 0xae, 0x70, 0x61, 0x1a, 0x74, 0x4b, 0x4a, 0x79, 0x21, 0xa4, 0x94, 0x69, 0x4a, 0x9d, 0xa4, 0x37, 0x71, 0xef, 0xde, 0x73, 0xb0, 0xe4, 0x08, 0x52, 0x2f, 0x62, 0xfa, 0xc6, 0xe2, 0xc6, 0xcd, 0xe4, 0xfd, 0xff, 0xff, 0x65, 0xe6, 0x7f, 0x03, 0x9d, 0x58, 0x8f, 0xd3, 0x4c, 0xe5, 0x8a, 0x3b, 0x89, 0x8e, 0xa2, 0x74, 0x71, 0x39, 0x58, 0xa9, 0x95, 0x22, 0xeb, 0xae, 0x9a, 0x4c, 0x3a, 0xfc, 0x64, 0xd0, 0x99, 0x62, 0xf1, 0x1a, 0x6e, 0xde, 0x90, 0xbb, 0x60, 0xc7, 0x58, 0x08, 0xe6, 0xb1, 0x51, 0x2f, 0xa8, 0x46, 0x7e, 0x0d, 0xe7, 0x51, 0x86, 0x61, 0x8e, 0xf3, 0x0c, 0xf5, 0x7a, 0xb7, 0x56, 0x5b, 0xd1, 0xf0, 0xd8, 0xc8, 0x0e, 0xfa, 0xc6, 0x0e, 0x7e, 0x5d, 0x7e, 0x05, 0xbd, 0x44, 0x2d, 0xff, 0x28, 0x9b, 0xa8, 0x6e, 0xa2, 0x96, 0x27, 0x44, 0x40, 0x5b, 0x63, 0x46, 0x69, 0x93, 0xd2, 0x5a, 0xf2, 0x01, 0xb4, 0x74, 0x55, 0x40, 0xb4, 0xe8, 0x65, 0x23, 0x2a, 0x77, 0x83, 0xe1, 0x0e, 0x85, 0x43, 0xb4, 0x11, 0xc3, 0x0f, 0x06, 0x2d, 0x5f, 0xe3, 0x36, 0xe7, 0xb7, 0xd0, 0xcc, 0x8b, 0x14, 0xa9, 0x6e, 0x7f, 0x72, 0x31, 0x36, 0x7b, 0x8e, 0x29, 0x34, 0xe7, 0xac, 0x48, 0x31, 0x20, 0x88, 0x7b, 0xd0, 0x88, 0x35, 0x75, 0xef, 0x4e, 0xdc, 0x1a, 0xad, 0x17, 0x0f, 0x1a, 0xb1, 0xe6, 0x37, 0xd0, 0x4e, 0x33, 0xd4, 0xf3, 0x58, 0x53, 0xf9, 0xff, 0x30, 0xa7, 0x02, 0xa6, 0x7a, 0xe8, 0xc1, 0xd9, 0xe9, 0x7e, 0xde, 0x06, 0xfb, 0xf9, 0x65, 0xe6, 0x5a, 0x1c, 0xc0, 0x79, 0xf4, 0x9f, 0xfc, 0x99, 0xef, 0xb2, 0x07, 0xb1, 0x3f, 0x4a, 0xeb, 0x70, 0x94, 0xd6, 0xbe, 0x94, 0xec, 0x50, 0x4a, 0xf6, 0x55, 0x4a, 0xf6, 0xfe, 0x2d, 0xad, 0x85, 0x43, 0xff, 0x7e, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x45, 0x92, 0x5d, 0xa1, 0x01, 0x00, 0x00, } ================================================ FILE: vendor/github.com/coreos/etcd/mvcc/mvccpb/kv.proto ================================================ syntax = "proto3"; package mvccpb; import "gogoproto/gogo.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_getters_all) = false; option (gogoproto.goproto_enum_prefix_all) = false; message KeyValue { // key is the key in bytes. An empty key is not allowed. bytes key = 1; // create_revision is the revision of last creation on this key. int64 create_revision = 2; // mod_revision is the revision of last modification on this key. int64 mod_revision = 3; // version is the version of the key. A deletion resets // the version to zero and any modification of the key // increases its version. int64 version = 4; // value is the value held by the key, in bytes. bytes value = 5; // lease is the ID of the lease that attached to key. // When the attached lease expires, the key will be deleted. // If lease is 0, then no lease is attached to the key. int64 lease = 6; } message Event { enum EventType { PUT = 0; DELETE = 1; } // type is the kind of event. If type is a PUT, it indicates // new data has been stored to the key. If type is a DELETE, // it indicates the key was deleted. EventType type = 1; // kv holds the KeyValue for the event. // A PUT event contains current kv pair. // A PUT event with kv.Version=1 indicates the creation of a key. // A DELETE/EXPIRE event contains the deleted key with // its modification revision set to the revision of deletion. KeyValue kv = 2; // prev_kv holds the key-value pair before the event happens. KeyValue prev_kv = 3; } ================================================ FILE: vendor/github.com/coreos/etcd/pkg/types/doc.go ================================================ // Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package types declares various data types and implements type-checking // functions. package types ================================================ FILE: vendor/github.com/coreos/etcd/pkg/types/id.go ================================================ // Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package types import ( "strconv" ) // ID represents a generic identifier which is canonically // stored as a uint64 but is typically represented as a // base-16 string for input/output type ID uint64 func (i ID) String() string { return strconv.FormatUint(uint64(i), 16) } // IDFromString attempts to create an ID from a base-16 string. func IDFromString(s string) (ID, error) { i, err := strconv.ParseUint(s, 16, 64) return ID(i), err } // IDSlice implements the sort interface type IDSlice []ID func (p IDSlice) Len() int { return len(p) } func (p IDSlice) Less(i, j int) bool { return uint64(p[i]) < uint64(p[j]) } func (p IDSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } ================================================ FILE: vendor/github.com/coreos/etcd/pkg/types/set.go ================================================ // Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package types import ( "reflect" "sort" "sync" ) type Set interface { Add(string) Remove(string) Contains(string) bool Equals(Set) bool Length() int Values() []string Copy() Set Sub(Set) Set } func NewUnsafeSet(values ...string) *unsafeSet { set := &unsafeSet{make(map[string]struct{})} for _, v := range values { set.Add(v) } return set } func NewThreadsafeSet(values ...string) *tsafeSet { us := NewUnsafeSet(values...) return &tsafeSet{us, sync.RWMutex{}} } type unsafeSet struct { d map[string]struct{} } // Add adds a new value to the set (no-op if the value is already present) func (us *unsafeSet) Add(value string) { us.d[value] = struct{}{} } // Remove removes the given value from the set func (us *unsafeSet) Remove(value string) { delete(us.d, value) } // Contains returns whether the set contains the given value func (us *unsafeSet) Contains(value string) (exists bool) { _, exists = us.d[value] return exists } // ContainsAll returns whether the set contains all given values func (us *unsafeSet) ContainsAll(values []string) bool { for _, s := range values { if !us.Contains(s) { return false } } return true } // Equals returns whether the contents of two sets are identical func (us *unsafeSet) Equals(other Set) bool { v1 := sort.StringSlice(us.Values()) v2 := sort.StringSlice(other.Values()) v1.Sort() v2.Sort() return reflect.DeepEqual(v1, v2) } // Length returns the number of elements in the set func (us *unsafeSet) Length() int { return len(us.d) } // Values returns the values of the Set in an unspecified order. func (us *unsafeSet) Values() (values []string) { values = make([]string, 0) for val := range us.d { values = append(values, val) } return values } // Copy creates a new Set containing the values of the first func (us *unsafeSet) Copy() Set { cp := NewUnsafeSet() for val := range us.d { cp.Add(val) } return cp } // Sub removes all elements in other from the set func (us *unsafeSet) Sub(other Set) Set { oValues := other.Values() result := us.Copy().(*unsafeSet) for _, val := range oValues { if _, ok := result.d[val]; !ok { continue } delete(result.d, val) } return result } type tsafeSet struct { us *unsafeSet m sync.RWMutex } func (ts *tsafeSet) Add(value string) { ts.m.Lock() defer ts.m.Unlock() ts.us.Add(value) } func (ts *tsafeSet) Remove(value string) { ts.m.Lock() defer ts.m.Unlock() ts.us.Remove(value) } func (ts *tsafeSet) Contains(value string) (exists bool) { ts.m.RLock() defer ts.m.RUnlock() return ts.us.Contains(value) } func (ts *tsafeSet) Equals(other Set) bool { ts.m.RLock() defer ts.m.RUnlock() return ts.us.Equals(other) } func (ts *tsafeSet) Length() int { ts.m.RLock() defer ts.m.RUnlock() return ts.us.Length() } func (ts *tsafeSet) Values() (values []string) { ts.m.RLock() defer ts.m.RUnlock() return ts.us.Values() } func (ts *tsafeSet) Copy() Set { ts.m.RLock() defer ts.m.RUnlock() usResult := ts.us.Copy().(*unsafeSet) return &tsafeSet{usResult, sync.RWMutex{}} } func (ts *tsafeSet) Sub(other Set) Set { ts.m.RLock() defer ts.m.RUnlock() usResult := ts.us.Sub(other).(*unsafeSet) return &tsafeSet{usResult, sync.RWMutex{}} } ================================================ FILE: vendor/github.com/coreos/etcd/pkg/types/slice.go ================================================ // Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package types // Uint64Slice implements sort interface type Uint64Slice []uint64 func (p Uint64Slice) Len() int { return len(p) } func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } ================================================ FILE: vendor/github.com/coreos/etcd/pkg/types/urls.go ================================================ // Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package types import ( "errors" "fmt" "net" "net/url" "sort" "strings" ) type URLs []url.URL func NewURLs(strs []string) (URLs, error) { all := make([]url.URL, len(strs)) if len(all) == 0 { return nil, errors.New("no valid URLs given") } for i, in := range strs { in = strings.TrimSpace(in) u, err := url.Parse(in) if err != nil { return nil, err } if u.Scheme != "http" && u.Scheme != "https" && u.Scheme != "unix" && u.Scheme != "unixs" { return nil, fmt.Errorf("URL scheme must be http, https, unix, or unixs: %s", in) } if _, _, err := net.SplitHostPort(u.Host); err != nil { return nil, fmt.Errorf(`URL address does not have the form "host:port": %s`, in) } if u.Path != "" { return nil, fmt.Errorf("URL must not contain a path: %s", in) } all[i] = *u } us := URLs(all) us.Sort() return us, nil } func MustNewURLs(strs []string) URLs { urls, err := NewURLs(strs) if err != nil { panic(err) } return urls } func (us URLs) String() string { return strings.Join(us.StringSlice(), ",") } func (us *URLs) Sort() { sort.Sort(us) } func (us URLs) Len() int { return len(us) } func (us URLs) Less(i, j int) bool { return us[i].String() < us[j].String() } func (us URLs) Swap(i, j int) { us[i], us[j] = us[j], us[i] } func (us URLs) StringSlice() []string { out := make([]string, len(us)) for i := range us { out[i] = us[i].String() } return out } ================================================ FILE: vendor/github.com/coreos/etcd/pkg/types/urlsmap.go ================================================ // Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package types import ( "fmt" "sort" "strings" ) // URLsMap is a map from a name to its URLs. type URLsMap map[string]URLs // NewURLsMap returns a URLsMap instantiated from the given string, // which consists of discovery-formatted names-to-URLs, like: // mach0=http://1.1.1.1:2380,mach0=http://2.2.2.2::2380,mach1=http://3.3.3.3:2380,mach2=http://4.4.4.4:2380 func NewURLsMap(s string) (URLsMap, error) { m := parse(s) cl := URLsMap{} for name, urls := range m { us, err := NewURLs(urls) if err != nil { return nil, err } cl[name] = us } return cl, nil } // NewURLsMapFromStringMap takes a map of strings and returns a URLsMap. The // string values in the map can be multiple values separated by the sep string. func NewURLsMapFromStringMap(m map[string]string, sep string) (URLsMap, error) { var err error um := URLsMap{} for k, v := range m { um[k], err = NewURLs(strings.Split(v, sep)) if err != nil { return nil, err } } return um, nil } // String turns URLsMap into discovery-formatted name-to-URLs sorted by name. func (c URLsMap) String() string { var pairs []string for name, urls := range c { for _, url := range urls { pairs = append(pairs, fmt.Sprintf("%s=%s", name, url.String())) } } sort.Strings(pairs) return strings.Join(pairs, ",") } // URLs returns a list of all URLs. // The returned list is sorted in ascending lexicographical order. func (c URLsMap) URLs() []string { var urls []string for _, us := range c { for _, u := range us { urls = append(urls, u.String()) } } sort.Strings(urls) return urls } // Len returns the size of URLsMap. func (c URLsMap) Len() int { return len(c) } // parse parses the given string and returns a map listing the values specified for each key. func parse(s string) map[string][]string { m := make(map[string][]string) for s != "" { key := s if i := strings.IndexAny(key, ","); i >= 0 { key, s = key[:i], key[i+1:] } else { s = "" } if key == "" { continue } value := "" if i := strings.Index(key, "="); i >= 0 { key, value = key[:i], key[i+1:] } m[key] = append(m[key], value) } return m } ================================================ FILE: vendor/github.com/davecgh/go-spew/LICENSE ================================================ ISC License Copyright (c) 2012-2016 Dave Collins Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/bypass.go ================================================ // Copyright (c) 2015-2016 Dave Collins // // Permission to use, copy, modify, and distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice appear in all copies. // // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // NOTE: Due to the following build constraints, this file will only be compiled // when the code is not running on Google App Engine, compiled by GopherJS, and // "-tags safe" is not added to the go build command line. The "disableunsafe" // tag is deprecated and thus should not be used. // Go versions prior to 1.4 are disabled because they use a different layout // for interfaces which make the implementation of unsafeReflectValue more complex. // +build !js,!appengine,!safe,!disableunsafe,go1.4 package spew import ( "reflect" "unsafe" ) const ( // UnsafeDisabled is a build-time constant which specifies whether or // not access to the unsafe package is available. UnsafeDisabled = false // ptrSize is the size of a pointer on the current arch. ptrSize = unsafe.Sizeof((*byte)(nil)) ) type flag uintptr var ( // flagRO indicates whether the value field of a reflect.Value // is read-only. flagRO flag // flagAddr indicates whether the address of the reflect.Value's // value may be taken. flagAddr flag ) // flagKindMask holds the bits that make up the kind // part of the flags field. In all the supported versions, // it is in the lower 5 bits. const flagKindMask = flag(0x1f) // Different versions of Go have used different // bit layouts for the flags type. This table // records the known combinations. var okFlags = []struct { ro, addr flag }{{ // From Go 1.4 to 1.5 ro: 1 << 5, addr: 1 << 7, }, { // Up to Go tip. ro: 1<<5 | 1<<6, addr: 1 << 8, }} var flagValOffset = func() uintptr { field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag") if !ok { panic("reflect.Value has no flag field") } return field.Offset }() // flagField returns a pointer to the flag field of a reflect.Value. func flagField(v *reflect.Value) *flag { return (*flag)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + flagValOffset)) } // unsafeReflectValue converts the passed reflect.Value into a one that bypasses // the typical safety restrictions preventing access to unaddressable and // unexported data. It works by digging the raw pointer to the underlying // value out of the protected value and generating a new unprotected (unsafe) // reflect.Value to it. // // This allows us to check for implementations of the Stringer and error // interfaces to be used for pretty printing ordinarily unaddressable and // inaccessible values such as unexported struct fields. func unsafeReflectValue(v reflect.Value) reflect.Value { if !v.IsValid() || (v.CanInterface() && v.CanAddr()) { return v } flagFieldPtr := flagField(&v) *flagFieldPtr &^= flagRO *flagFieldPtr |= flagAddr return v } // Sanity checks against future reflect package changes // to the type or semantics of the Value.flag field. func init() { field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag") if !ok { panic("reflect.Value has no flag field") } if field.Type.Kind() != reflect.TypeOf(flag(0)).Kind() { panic("reflect.Value flag field has changed kind") } type t0 int var t struct { A t0 // t0 will have flagEmbedRO set. t0 // a will have flagStickyRO set a t0 } vA := reflect.ValueOf(t).FieldByName("A") va := reflect.ValueOf(t).FieldByName("a") vt0 := reflect.ValueOf(t).FieldByName("t0") // Infer flagRO from the difference between the flags // for the (otherwise identical) fields in t. flagPublic := *flagField(&vA) flagWithRO := *flagField(&va) | *flagField(&vt0) flagRO = flagPublic ^ flagWithRO // Infer flagAddr from the difference between a value // taken from a pointer and not. vPtrA := reflect.ValueOf(&t).Elem().FieldByName("A") flagNoPtr := *flagField(&vA) flagPtr := *flagField(&vPtrA) flagAddr = flagNoPtr ^ flagPtr // Check that the inferred flags tally with one of the known versions. for _, f := range okFlags { if flagRO == f.ro && flagAddr == f.addr { return } } panic("reflect.Value read-only flag has changed semantics") } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/bypasssafe.go ================================================ // Copyright (c) 2015-2016 Dave Collins // // Permission to use, copy, modify, and distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice appear in all copies. // // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // NOTE: Due to the following build constraints, this file will only be compiled // when the code is running on Google App Engine, compiled by GopherJS, or // "-tags safe" is added to the go build command line. The "disableunsafe" // tag is deprecated and thus should not be used. // +build js appengine safe disableunsafe !go1.4 package spew import "reflect" const ( // UnsafeDisabled is a build-time constant which specifies whether or // not access to the unsafe package is available. UnsafeDisabled = true ) // unsafeReflectValue typically converts the passed reflect.Value into a one // that bypasses the typical safety restrictions preventing access to // unaddressable and unexported data. However, doing this relies on access to // the unsafe package. This is a stub version which simply returns the passed // reflect.Value when the unsafe package is not available. func unsafeReflectValue(v reflect.Value) reflect.Value { return v } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/common.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package spew import ( "bytes" "fmt" "io" "reflect" "sort" "strconv" ) // Some constants in the form of bytes to avoid string overhead. This mirrors // the technique used in the fmt package. var ( panicBytes = []byte("(PANIC=") plusBytes = []byte("+") iBytes = []byte("i") trueBytes = []byte("true") falseBytes = []byte("false") interfaceBytes = []byte("(interface {})") commaNewlineBytes = []byte(",\n") newlineBytes = []byte("\n") openBraceBytes = []byte("{") openBraceNewlineBytes = []byte("{\n") closeBraceBytes = []byte("}") asteriskBytes = []byte("*") colonBytes = []byte(":") colonSpaceBytes = []byte(": ") openParenBytes = []byte("(") closeParenBytes = []byte(")") spaceBytes = []byte(" ") pointerChainBytes = []byte("->") nilAngleBytes = []byte("") maxNewlineBytes = []byte("\n") maxShortBytes = []byte("") circularBytes = []byte("") circularShortBytes = []byte("") invalidAngleBytes = []byte("") openBracketBytes = []byte("[") closeBracketBytes = []byte("]") percentBytes = []byte("%") precisionBytes = []byte(".") openAngleBytes = []byte("<") closeAngleBytes = []byte(">") openMapBytes = []byte("map[") closeMapBytes = []byte("]") lenEqualsBytes = []byte("len=") capEqualsBytes = []byte("cap=") ) // hexDigits is used to map a decimal value to a hex digit. var hexDigits = "0123456789abcdef" // catchPanic handles any panics that might occur during the handleMethods // calls. func catchPanic(w io.Writer, v reflect.Value) { if err := recover(); err != nil { w.Write(panicBytes) fmt.Fprintf(w, "%v", err) w.Write(closeParenBytes) } } // handleMethods attempts to call the Error and String methods on the underlying // type the passed reflect.Value represents and outputes the result to Writer w. // // It handles panics in any called methods by catching and displaying the error // as the formatted value. func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) { // We need an interface to check if the type implements the error or // Stringer interface. However, the reflect package won't give us an // interface on certain things like unexported struct fields in order // to enforce visibility rules. We use unsafe, when it's available, // to bypass these restrictions since this package does not mutate the // values. if !v.CanInterface() { if UnsafeDisabled { return false } v = unsafeReflectValue(v) } // Choose whether or not to do error and Stringer interface lookups against // the base type or a pointer to the base type depending on settings. // Technically calling one of these methods with a pointer receiver can // mutate the value, however, types which choose to satisify an error or // Stringer interface with a pointer receiver should not be mutating their // state inside these interface methods. if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() { v = unsafeReflectValue(v) } if v.CanAddr() { v = v.Addr() } // Is it an error or Stringer? switch iface := v.Interface().(type) { case error: defer catchPanic(w, v) if cs.ContinueOnMethod { w.Write(openParenBytes) w.Write([]byte(iface.Error())) w.Write(closeParenBytes) w.Write(spaceBytes) return false } w.Write([]byte(iface.Error())) return true case fmt.Stringer: defer catchPanic(w, v) if cs.ContinueOnMethod { w.Write(openParenBytes) w.Write([]byte(iface.String())) w.Write(closeParenBytes) w.Write(spaceBytes) return false } w.Write([]byte(iface.String())) return true } return false } // printBool outputs a boolean value as true or false to Writer w. func printBool(w io.Writer, val bool) { if val { w.Write(trueBytes) } else { w.Write(falseBytes) } } // printInt outputs a signed integer value to Writer w. func printInt(w io.Writer, val int64, base int) { w.Write([]byte(strconv.FormatInt(val, base))) } // printUint outputs an unsigned integer value to Writer w. func printUint(w io.Writer, val uint64, base int) { w.Write([]byte(strconv.FormatUint(val, base))) } // printFloat outputs a floating point value using the specified precision, // which is expected to be 32 or 64bit, to Writer w. func printFloat(w io.Writer, val float64, precision int) { w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision))) } // printComplex outputs a complex value using the specified float precision // for the real and imaginary parts to Writer w. func printComplex(w io.Writer, c complex128, floatPrecision int) { r := real(c) w.Write(openParenBytes) w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision))) i := imag(c) if i >= 0 { w.Write(plusBytes) } w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision))) w.Write(iBytes) w.Write(closeParenBytes) } // printHexPtr outputs a uintptr formatted as hexadecimal with a leading '0x' // prefix to Writer w. func printHexPtr(w io.Writer, p uintptr) { // Null pointer. num := uint64(p) if num == 0 { w.Write(nilAngleBytes) return } // Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix buf := make([]byte, 18) // It's simpler to construct the hex string right to left. base := uint64(16) i := len(buf) - 1 for num >= base { buf[i] = hexDigits[num%base] num /= base i-- } buf[i] = hexDigits[num] // Add '0x' prefix. i-- buf[i] = 'x' i-- buf[i] = '0' // Strip unused leading bytes. buf = buf[i:] w.Write(buf) } // valuesSorter implements sort.Interface to allow a slice of reflect.Value // elements to be sorted. type valuesSorter struct { values []reflect.Value strings []string // either nil or same len and values cs *ConfigState } // newValuesSorter initializes a valuesSorter instance, which holds a set of // surrogate keys on which the data should be sorted. It uses flags in // ConfigState to decide if and how to populate those surrogate keys. func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface { vs := &valuesSorter{values: values, cs: cs} if canSortSimply(vs.values[0].Kind()) { return vs } if !cs.DisableMethods { vs.strings = make([]string, len(values)) for i := range vs.values { b := bytes.Buffer{} if !handleMethods(cs, &b, vs.values[i]) { vs.strings = nil break } vs.strings[i] = b.String() } } if vs.strings == nil && cs.SpewKeys { vs.strings = make([]string, len(values)) for i := range vs.values { vs.strings[i] = Sprintf("%#v", vs.values[i].Interface()) } } return vs } // canSortSimply tests whether a reflect.Kind is a primitive that can be sorted // directly, or whether it should be considered for sorting by surrogate keys // (if the ConfigState allows it). func canSortSimply(kind reflect.Kind) bool { // This switch parallels valueSortLess, except for the default case. switch kind { case reflect.Bool: return true case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: return true case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: return true case reflect.Float32, reflect.Float64: return true case reflect.String: return true case reflect.Uintptr: return true case reflect.Array: return true } return false } // Len returns the number of values in the slice. It is part of the // sort.Interface implementation. func (s *valuesSorter) Len() int { return len(s.values) } // Swap swaps the values at the passed indices. It is part of the // sort.Interface implementation. func (s *valuesSorter) Swap(i, j int) { s.values[i], s.values[j] = s.values[j], s.values[i] if s.strings != nil { s.strings[i], s.strings[j] = s.strings[j], s.strings[i] } } // valueSortLess returns whether the first value should sort before the second // value. It is used by valueSorter.Less as part of the sort.Interface // implementation. func valueSortLess(a, b reflect.Value) bool { switch a.Kind() { case reflect.Bool: return !a.Bool() && b.Bool() case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: return a.Int() < b.Int() case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: return a.Uint() < b.Uint() case reflect.Float32, reflect.Float64: return a.Float() < b.Float() case reflect.String: return a.String() < b.String() case reflect.Uintptr: return a.Uint() < b.Uint() case reflect.Array: // Compare the contents of both arrays. l := a.Len() for i := 0; i < l; i++ { av := a.Index(i) bv := b.Index(i) if av.Interface() == bv.Interface() { continue } return valueSortLess(av, bv) } } return a.String() < b.String() } // Less returns whether the value at index i should sort before the // value at index j. It is part of the sort.Interface implementation. func (s *valuesSorter) Less(i, j int) bool { if s.strings == nil { return valueSortLess(s.values[i], s.values[j]) } return s.strings[i] < s.strings[j] } // sortValues is a sort function that handles both native types and any type that // can be converted to error or Stringer. Other inputs are sorted according to // their Value.String() value to ensure display stability. func sortValues(values []reflect.Value, cs *ConfigState) { if len(values) == 0 { return } sort.Sort(newValuesSorter(values, cs)) } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/config.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package spew import ( "bytes" "fmt" "io" "os" ) // ConfigState houses the configuration options used by spew to format and // display values. There is a global instance, Config, that is used to control // all top-level Formatter and Dump functionality. Each ConfigState instance // provides methods equivalent to the top-level functions. // // The zero value for ConfigState provides no indentation. You would typically // want to set it to a space or a tab. // // Alternatively, you can use NewDefaultConfig to get a ConfigState instance // with default settings. See the documentation of NewDefaultConfig for default // values. type ConfigState struct { // Indent specifies the string to use for each indentation level. The // global config instance that all top-level functions use set this to a // single space by default. If you would like more indentation, you might // set this to a tab with "\t" or perhaps two spaces with " ". Indent string // MaxDepth controls the maximum number of levels to descend into nested // data structures. The default, 0, means there is no limit. // // NOTE: Circular data structures are properly detected, so it is not // necessary to set this value unless you specifically want to limit deeply // nested data structures. MaxDepth int // DisableMethods specifies whether or not error and Stringer interfaces are // invoked for types that implement them. DisableMethods bool // DisablePointerMethods specifies whether or not to check for and invoke // error and Stringer interfaces on types which only accept a pointer // receiver when the current type is not a pointer. // // NOTE: This might be an unsafe action since calling one of these methods // with a pointer receiver could technically mutate the value, however, // in practice, types which choose to satisify an error or Stringer // interface with a pointer receiver should not be mutating their state // inside these interface methods. As a result, this option relies on // access to the unsafe package, so it will not have any effect when // running in environments without access to the unsafe package such as // Google App Engine or with the "safe" build tag specified. DisablePointerMethods bool // DisablePointerAddresses specifies whether to disable the printing of // pointer addresses. This is useful when diffing data structures in tests. DisablePointerAddresses bool // DisableCapacities specifies whether to disable the printing of capacities // for arrays, slices, maps and channels. This is useful when diffing // data structures in tests. DisableCapacities bool // ContinueOnMethod specifies whether or not recursion should continue once // a custom error or Stringer interface is invoked. The default, false, // means it will print the results of invoking the custom error or Stringer // interface and return immediately instead of continuing to recurse into // the internals of the data type. // // NOTE: This flag does not have any effect if method invocation is disabled // via the DisableMethods or DisablePointerMethods options. ContinueOnMethod bool // SortKeys specifies map keys should be sorted before being printed. Use // this to have a more deterministic, diffable output. Note that only // native types (bool, int, uint, floats, uintptr and string) and types // that support the error or Stringer interfaces (if methods are // enabled) are supported, with other types sorted according to the // reflect.Value.String() output which guarantees display stability. SortKeys bool // SpewKeys specifies that, as a last resort attempt, map keys should // be spewed to strings and sorted by those strings. This is only // considered if SortKeys is true. SpewKeys bool } // Config is the active configuration of the top-level functions. // The configuration can be changed by modifying the contents of spew.Config. var Config = ConfigState{Indent: " "} // Errorf is a wrapper for fmt.Errorf that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the formatted string as a value that satisfies error. See NewFormatter // for formatting details. // // This function is shorthand for the following syntax: // // fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) { return fmt.Errorf(format, c.convertArgs(a)...) } // Fprint is a wrapper for fmt.Fprint that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) { return fmt.Fprint(w, c.convertArgs(a)...) } // Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { return fmt.Fprintf(w, format, c.convertArgs(a)...) } // Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it // passed with a Formatter interface returned by c.NewFormatter. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { return fmt.Fprintln(w, c.convertArgs(a)...) } // Print is a wrapper for fmt.Print that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Print(c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Print(a ...interface{}) (n int, err error) { return fmt.Print(c.convertArgs(a)...) } // Printf is a wrapper for fmt.Printf that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) { return fmt.Printf(format, c.convertArgs(a)...) } // Println is a wrapper for fmt.Println that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Println(c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Println(a ...interface{}) (n int, err error) { return fmt.Println(c.convertArgs(a)...) } // Sprint is a wrapper for fmt.Sprint that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Sprint(a ...interface{}) string { return fmt.Sprint(c.convertArgs(a)...) } // Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were // passed with a Formatter interface returned by c.NewFormatter. It returns // the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Sprintf(format string, a ...interface{}) string { return fmt.Sprintf(format, c.convertArgs(a)...) } // Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it // were passed with a Formatter interface returned by c.NewFormatter. It // returns the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b)) func (c *ConfigState) Sprintln(a ...interface{}) string { return fmt.Sprintln(c.convertArgs(a)...) } /* NewFormatter returns a custom formatter that satisfies the fmt.Formatter interface. As a result, it integrates cleanly with standard fmt package printing functions. The formatter is useful for inline printing of smaller data types similar to the standard %v format specifier. The custom formatter only responds to the %v (most compact), %+v (adds pointer addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb combinations. Any other verbs such as %x and %q will be sent to the the standard fmt package for formatting. In addition, the custom formatter ignores the width and precision arguments (however they will still work on the format specifiers not handled by the custom formatter). Typically this function shouldn't be called directly. It is much easier to make use of the custom formatter by calling one of the convenience functions such as c.Printf, c.Println, or c.Printf. */ func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter { return newFormatter(c, v) } // Fdump formats and displays the passed arguments to io.Writer w. It formats // exactly the same as Dump. func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) { fdump(c, w, a...) } /* Dump displays the passed parameters to standard out with newlines, customizable indentation, and additional debug information such as complete types and all pointer addresses used to indirect to the final value. It provides the following features over the built-in printing facilities provided by the fmt package: * Pointers are dereferenced and followed * Circular data structures are detected and handled properly * Custom Stringer/error interfaces are optionally invoked, including on unexported types * Custom types which only implement the Stringer/error interfaces via a pointer receiver are optionally invoked when passing non-pointer variables * Byte arrays and slices are dumped like the hexdump -C command which includes offsets, byte values in hex, and ASCII output The configuration options are controlled by modifying the public members of c. See ConfigState for options documentation. See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to get the formatted result as a string. */ func (c *ConfigState) Dump(a ...interface{}) { fdump(c, os.Stdout, a...) } // Sdump returns a string with the passed arguments formatted exactly the same // as Dump. func (c *ConfigState) Sdump(a ...interface{}) string { var buf bytes.Buffer fdump(c, &buf, a...) return buf.String() } // convertArgs accepts a slice of arguments and returns a slice of the same // length with each argument converted to a spew Formatter interface using // the ConfigState associated with s. func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) { formatters = make([]interface{}, len(args)) for index, arg := range args { formatters[index] = newFormatter(c, arg) } return formatters } // NewDefaultConfig returns a ConfigState with the following default settings. // // Indent: " " // MaxDepth: 0 // DisableMethods: false // DisablePointerMethods: false // ContinueOnMethod: false // SortKeys: false func NewDefaultConfig() *ConfigState { return &ConfigState{Indent: " "} } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/doc.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Package spew implements a deep pretty printer for Go data structures to aid in debugging. A quick overview of the additional features spew provides over the built-in printing facilities for Go data types are as follows: * Pointers are dereferenced and followed * Circular data structures are detected and handled properly * Custom Stringer/error interfaces are optionally invoked, including on unexported types * Custom types which only implement the Stringer/error interfaces via a pointer receiver are optionally invoked when passing non-pointer variables * Byte arrays and slices are dumped like the hexdump -C command which includes offsets, byte values in hex, and ASCII output (only when using Dump style) There are two different approaches spew allows for dumping Go data structures: * Dump style which prints with newlines, customizable indentation, and additional debug information such as types and all pointer addresses used to indirect to the final value * A custom Formatter interface that integrates cleanly with the standard fmt package and replaces %v, %+v, %#v, and %#+v to provide inline printing similar to the default %v while providing the additional functionality outlined above and passing unsupported format verbs such as %x and %q along to fmt Quick Start This section demonstrates how to quickly get started with spew. See the sections below for further details on formatting and configuration options. To dump a variable with full newlines, indentation, type, and pointer information use Dump, Fdump, or Sdump: spew.Dump(myVar1, myVar2, ...) spew.Fdump(someWriter, myVar1, myVar2, ...) str := spew.Sdump(myVar1, myVar2, ...) Alternatively, if you would prefer to use format strings with a compacted inline printing style, use the convenience wrappers Printf, Fprintf, etc with %v (most compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types and pointer addresses): spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) Configuration Options Configuration of spew is handled by fields in the ConfigState type. For convenience, all of the top-level functions use a global state available via the spew.Config global. It is also possible to create a ConfigState instance that provides methods equivalent to the top-level functions. This allows concurrent configuration options. See the ConfigState documentation for more details. The following configuration options are available: * Indent String to use for each indentation level for Dump functions. It is a single space by default. A popular alternative is "\t". * MaxDepth Maximum number of levels to descend into nested data structures. There is no limit by default. * DisableMethods Disables invocation of error and Stringer interface methods. Method invocation is enabled by default. * DisablePointerMethods Disables invocation of error and Stringer interface methods on types which only accept pointer receivers from non-pointer variables. Pointer method invocation is enabled by default. * DisablePointerAddresses DisablePointerAddresses specifies whether to disable the printing of pointer addresses. This is useful when diffing data structures in tests. * DisableCapacities DisableCapacities specifies whether to disable the printing of capacities for arrays, slices, maps and channels. This is useful when diffing data structures in tests. * ContinueOnMethod Enables recursion into types after invoking error and Stringer interface methods. Recursion after method invocation is disabled by default. * SortKeys Specifies map keys should be sorted before being printed. Use this to have a more deterministic, diffable output. Note that only native types (bool, int, uint, floats, uintptr and string) and types which implement error or Stringer interfaces are supported with other types sorted according to the reflect.Value.String() output which guarantees display stability. Natural map order is used by default. * SpewKeys Specifies that, as a last resort attempt, map keys should be spewed to strings and sorted by those strings. This is only considered if SortKeys is true. Dump Usage Simply call spew.Dump with a list of variables you want to dump: spew.Dump(myVar1, myVar2, ...) You may also call spew.Fdump if you would prefer to output to an arbitrary io.Writer. For example, to dump to standard error: spew.Fdump(os.Stderr, myVar1, myVar2, ...) A third option is to call spew.Sdump to get the formatted output as a string: str := spew.Sdump(myVar1, myVar2, ...) Sample Dump Output See the Dump example for details on the setup of the types and variables being shown here. (main.Foo) { unexportedField: (*main.Bar)(0xf84002e210)({ flag: (main.Flag) flagTwo, data: (uintptr) }), ExportedField: (map[interface {}]interface {}) (len=1) { (string) (len=3) "one": (bool) true } } Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C command as shown. ([]uint8) (len=32 cap=32) { 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 |............... | 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 |!"#$%&'()*+,-./0| 00000020 31 32 |12| } Custom Formatter Spew provides a custom formatter that implements the fmt.Formatter interface so that it integrates cleanly with standard fmt package printing functions. The formatter is useful for inline printing of smaller data types similar to the standard %v format specifier. The custom formatter only responds to the %v (most compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb combinations. Any other verbs such as %x and %q will be sent to the the standard fmt package for formatting. In addition, the custom formatter ignores the width and precision arguments (however they will still work on the format specifiers not handled by the custom formatter). Custom Formatter Usage The simplest way to make use of the spew custom formatter is to call one of the convenience functions such as spew.Printf, spew.Println, or spew.Printf. The functions have syntax you are most likely already familiar with: spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2) spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) spew.Println(myVar, myVar2) spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2) spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4) See the Index for the full list convenience functions. Sample Formatter Output Double pointer to a uint8: %v: <**>5 %+v: <**>(0xf8400420d0->0xf8400420c8)5 %#v: (**uint8)5 %#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5 Pointer to circular struct with a uint8 field and a pointer to itself: %v: <*>{1 <*>} %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)} %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)} %#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)} See the Printf example for details on the setup of variables being shown here. Errors Since it is possible for custom Stringer/error interfaces to panic, spew detects them and handles them internally by printing the panic information inline with the output. Since spew is intended to provide deep pretty printing capabilities on structures, it intentionally does not return any errors. */ package spew ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/dump.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package spew import ( "bytes" "encoding/hex" "fmt" "io" "os" "reflect" "regexp" "strconv" "strings" ) var ( // uint8Type is a reflect.Type representing a uint8. It is used to // convert cgo types to uint8 slices for hexdumping. uint8Type = reflect.TypeOf(uint8(0)) // cCharRE is a regular expression that matches a cgo char. // It is used to detect character arrays to hexdump them. cCharRE = regexp.MustCompile(`^.*\._Ctype_char$`) // cUnsignedCharRE is a regular expression that matches a cgo unsigned // char. It is used to detect unsigned character arrays to hexdump // them. cUnsignedCharRE = regexp.MustCompile(`^.*\._Ctype_unsignedchar$`) // cUint8tCharRE is a regular expression that matches a cgo uint8_t. // It is used to detect uint8_t arrays to hexdump them. cUint8tCharRE = regexp.MustCompile(`^.*\._Ctype_uint8_t$`) ) // dumpState contains information about the state of a dump operation. type dumpState struct { w io.Writer depth int pointers map[uintptr]int ignoreNextType bool ignoreNextIndent bool cs *ConfigState } // indent performs indentation according to the depth level and cs.Indent // option. func (d *dumpState) indent() { if d.ignoreNextIndent { d.ignoreNextIndent = false return } d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth)) } // unpackValue returns values inside of non-nil interfaces when possible. // This is useful for data types like structs, arrays, slices, and maps which // can contain varying types packed inside an interface. func (d *dumpState) unpackValue(v reflect.Value) reflect.Value { if v.Kind() == reflect.Interface && !v.IsNil() { v = v.Elem() } return v } // dumpPtr handles formatting of pointers by indirecting them as necessary. func (d *dumpState) dumpPtr(v reflect.Value) { // Remove pointers at or below the current depth from map used to detect // circular refs. for k, depth := range d.pointers { if depth >= d.depth { delete(d.pointers, k) } } // Keep list of all dereferenced pointers to show later. pointerChain := make([]uintptr, 0) // Figure out how many levels of indirection there are by dereferencing // pointers and unpacking interfaces down the chain while detecting circular // references. nilFound := false cycleFound := false indirects := 0 ve := v for ve.Kind() == reflect.Ptr { if ve.IsNil() { nilFound = true break } indirects++ addr := ve.Pointer() pointerChain = append(pointerChain, addr) if pd, ok := d.pointers[addr]; ok && pd < d.depth { cycleFound = true indirects-- break } d.pointers[addr] = d.depth ve = ve.Elem() if ve.Kind() == reflect.Interface { if ve.IsNil() { nilFound = true break } ve = ve.Elem() } } // Display type information. d.w.Write(openParenBytes) d.w.Write(bytes.Repeat(asteriskBytes, indirects)) d.w.Write([]byte(ve.Type().String())) d.w.Write(closeParenBytes) // Display pointer information. if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 { d.w.Write(openParenBytes) for i, addr := range pointerChain { if i > 0 { d.w.Write(pointerChainBytes) } printHexPtr(d.w, addr) } d.w.Write(closeParenBytes) } // Display dereferenced value. d.w.Write(openParenBytes) switch { case nilFound: d.w.Write(nilAngleBytes) case cycleFound: d.w.Write(circularBytes) default: d.ignoreNextType = true d.dump(ve) } d.w.Write(closeParenBytes) } // dumpSlice handles formatting of arrays and slices. Byte (uint8 under // reflection) arrays and slices are dumped in hexdump -C fashion. func (d *dumpState) dumpSlice(v reflect.Value) { // Determine whether this type should be hex dumped or not. Also, // for types which should be hexdumped, try to use the underlying data // first, then fall back to trying to convert them to a uint8 slice. var buf []uint8 doConvert := false doHexDump := false numEntries := v.Len() if numEntries > 0 { vt := v.Index(0).Type() vts := vt.String() switch { // C types that need to be converted. case cCharRE.MatchString(vts): fallthrough case cUnsignedCharRE.MatchString(vts): fallthrough case cUint8tCharRE.MatchString(vts): doConvert = true // Try to use existing uint8 slices and fall back to converting // and copying if that fails. case vt.Kind() == reflect.Uint8: // We need an addressable interface to convert the type // to a byte slice. However, the reflect package won't // give us an interface on certain things like // unexported struct fields in order to enforce // visibility rules. We use unsafe, when available, to // bypass these restrictions since this package does not // mutate the values. vs := v if !vs.CanInterface() || !vs.CanAddr() { vs = unsafeReflectValue(vs) } if !UnsafeDisabled { vs = vs.Slice(0, numEntries) // Use the existing uint8 slice if it can be // type asserted. iface := vs.Interface() if slice, ok := iface.([]uint8); ok { buf = slice doHexDump = true break } } // The underlying data needs to be converted if it can't // be type asserted to a uint8 slice. doConvert = true } // Copy and convert the underlying type if needed. if doConvert && vt.ConvertibleTo(uint8Type) { // Convert and copy each element into a uint8 byte // slice. buf = make([]uint8, numEntries) for i := 0; i < numEntries; i++ { vv := v.Index(i) buf[i] = uint8(vv.Convert(uint8Type).Uint()) } doHexDump = true } } // Hexdump the entire slice as needed. if doHexDump { indent := strings.Repeat(d.cs.Indent, d.depth) str := indent + hex.Dump(buf) str = strings.Replace(str, "\n", "\n"+indent, -1) str = strings.TrimRight(str, d.cs.Indent) d.w.Write([]byte(str)) return } // Recursively call dump for each item. for i := 0; i < numEntries; i++ { d.dump(d.unpackValue(v.Index(i))) if i < (numEntries - 1) { d.w.Write(commaNewlineBytes) } else { d.w.Write(newlineBytes) } } } // dump is the main workhorse for dumping a value. It uses the passed reflect // value to figure out what kind of object we are dealing with and formats it // appropriately. It is a recursive function, however circular data structures // are detected and handled properly. func (d *dumpState) dump(v reflect.Value) { // Handle invalid reflect values immediately. kind := v.Kind() if kind == reflect.Invalid { d.w.Write(invalidAngleBytes) return } // Handle pointers specially. if kind == reflect.Ptr { d.indent() d.dumpPtr(v) return } // Print type information unless already handled elsewhere. if !d.ignoreNextType { d.indent() d.w.Write(openParenBytes) d.w.Write([]byte(v.Type().String())) d.w.Write(closeParenBytes) d.w.Write(spaceBytes) } d.ignoreNextType = false // Display length and capacity if the built-in len and cap functions // work with the value's kind and the len/cap itself is non-zero. valueLen, valueCap := 0, 0 switch v.Kind() { case reflect.Array, reflect.Slice, reflect.Chan: valueLen, valueCap = v.Len(), v.Cap() case reflect.Map, reflect.String: valueLen = v.Len() } if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 { d.w.Write(openParenBytes) if valueLen != 0 { d.w.Write(lenEqualsBytes) printInt(d.w, int64(valueLen), 10) } if !d.cs.DisableCapacities && valueCap != 0 { if valueLen != 0 { d.w.Write(spaceBytes) } d.w.Write(capEqualsBytes) printInt(d.w, int64(valueCap), 10) } d.w.Write(closeParenBytes) d.w.Write(spaceBytes) } // Call Stringer/error interfaces if they exist and the handle methods flag // is enabled if !d.cs.DisableMethods { if (kind != reflect.Invalid) && (kind != reflect.Interface) { if handled := handleMethods(d.cs, d.w, v); handled { return } } } switch kind { case reflect.Invalid: // Do nothing. We should never get here since invalid has already // been handled above. case reflect.Bool: printBool(d.w, v.Bool()) case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: printInt(d.w, v.Int(), 10) case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: printUint(d.w, v.Uint(), 10) case reflect.Float32: printFloat(d.w, v.Float(), 32) case reflect.Float64: printFloat(d.w, v.Float(), 64) case reflect.Complex64: printComplex(d.w, v.Complex(), 32) case reflect.Complex128: printComplex(d.w, v.Complex(), 64) case reflect.Slice: if v.IsNil() { d.w.Write(nilAngleBytes) break } fallthrough case reflect.Array: d.w.Write(openBraceNewlineBytes) d.depth++ if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { d.indent() d.w.Write(maxNewlineBytes) } else { d.dumpSlice(v) } d.depth-- d.indent() d.w.Write(closeBraceBytes) case reflect.String: d.w.Write([]byte(strconv.Quote(v.String()))) case reflect.Interface: // The only time we should get here is for nil interfaces due to // unpackValue calls. if v.IsNil() { d.w.Write(nilAngleBytes) } case reflect.Ptr: // Do nothing. We should never get here since pointers have already // been handled above. case reflect.Map: // nil maps should be indicated as different than empty maps if v.IsNil() { d.w.Write(nilAngleBytes) break } d.w.Write(openBraceNewlineBytes) d.depth++ if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { d.indent() d.w.Write(maxNewlineBytes) } else { numEntries := v.Len() keys := v.MapKeys() if d.cs.SortKeys { sortValues(keys, d.cs) } for i, key := range keys { d.dump(d.unpackValue(key)) d.w.Write(colonSpaceBytes) d.ignoreNextIndent = true d.dump(d.unpackValue(v.MapIndex(key))) if i < (numEntries - 1) { d.w.Write(commaNewlineBytes) } else { d.w.Write(newlineBytes) } } } d.depth-- d.indent() d.w.Write(closeBraceBytes) case reflect.Struct: d.w.Write(openBraceNewlineBytes) d.depth++ if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) { d.indent() d.w.Write(maxNewlineBytes) } else { vt := v.Type() numFields := v.NumField() for i := 0; i < numFields; i++ { d.indent() vtf := vt.Field(i) d.w.Write([]byte(vtf.Name)) d.w.Write(colonSpaceBytes) d.ignoreNextIndent = true d.dump(d.unpackValue(v.Field(i))) if i < (numFields - 1) { d.w.Write(commaNewlineBytes) } else { d.w.Write(newlineBytes) } } } d.depth-- d.indent() d.w.Write(closeBraceBytes) case reflect.Uintptr: printHexPtr(d.w, uintptr(v.Uint())) case reflect.UnsafePointer, reflect.Chan, reflect.Func: printHexPtr(d.w, v.Pointer()) // There were not any other types at the time this code was written, but // fall back to letting the default fmt package handle it in case any new // types are added. default: if v.CanInterface() { fmt.Fprintf(d.w, "%v", v.Interface()) } else { fmt.Fprintf(d.w, "%v", v.String()) } } } // fdump is a helper function to consolidate the logic from the various public // methods which take varying writers and config states. func fdump(cs *ConfigState, w io.Writer, a ...interface{}) { for _, arg := range a { if arg == nil { w.Write(interfaceBytes) w.Write(spaceBytes) w.Write(nilAngleBytes) w.Write(newlineBytes) continue } d := dumpState{w: w, cs: cs} d.pointers = make(map[uintptr]int) d.dump(reflect.ValueOf(arg)) d.w.Write(newlineBytes) } } // Fdump formats and displays the passed arguments to io.Writer w. It formats // exactly the same as Dump. func Fdump(w io.Writer, a ...interface{}) { fdump(&Config, w, a...) } // Sdump returns a string with the passed arguments formatted exactly the same // as Dump. func Sdump(a ...interface{}) string { var buf bytes.Buffer fdump(&Config, &buf, a...) return buf.String() } /* Dump displays the passed parameters to standard out with newlines, customizable indentation, and additional debug information such as complete types and all pointer addresses used to indirect to the final value. It provides the following features over the built-in printing facilities provided by the fmt package: * Pointers are dereferenced and followed * Circular data structures are detected and handled properly * Custom Stringer/error interfaces are optionally invoked, including on unexported types * Custom types which only implement the Stringer/error interfaces via a pointer receiver are optionally invoked when passing non-pointer variables * Byte arrays and slices are dumped like the hexdump -C command which includes offsets, byte values in hex, and ASCII output The configuration options are controlled by an exported package global, spew.Config. See ConfigState for options documentation. See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to get the formatted result as a string. */ func Dump(a ...interface{}) { fdump(&Config, os.Stdout, a...) } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/format.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package spew import ( "bytes" "fmt" "reflect" "strconv" "strings" ) // supportedFlags is a list of all the character flags supported by fmt package. const supportedFlags = "0-+# " // formatState implements the fmt.Formatter interface and contains information // about the state of a formatting operation. The NewFormatter function can // be used to get a new Formatter which can be used directly as arguments // in standard fmt package printing calls. type formatState struct { value interface{} fs fmt.State depth int pointers map[uintptr]int ignoreNextType bool cs *ConfigState } // buildDefaultFormat recreates the original format string without precision // and width information to pass in to fmt.Sprintf in the case of an // unrecognized type. Unless new types are added to the language, this // function won't ever be called. func (f *formatState) buildDefaultFormat() (format string) { buf := bytes.NewBuffer(percentBytes) for _, flag := range supportedFlags { if f.fs.Flag(int(flag)) { buf.WriteRune(flag) } } buf.WriteRune('v') format = buf.String() return format } // constructOrigFormat recreates the original format string including precision // and width information to pass along to the standard fmt package. This allows // automatic deferral of all format strings this package doesn't support. func (f *formatState) constructOrigFormat(verb rune) (format string) { buf := bytes.NewBuffer(percentBytes) for _, flag := range supportedFlags { if f.fs.Flag(int(flag)) { buf.WriteRune(flag) } } if width, ok := f.fs.Width(); ok { buf.WriteString(strconv.Itoa(width)) } if precision, ok := f.fs.Precision(); ok { buf.Write(precisionBytes) buf.WriteString(strconv.Itoa(precision)) } buf.WriteRune(verb) format = buf.String() return format } // unpackValue returns values inside of non-nil interfaces when possible and // ensures that types for values which have been unpacked from an interface // are displayed when the show types flag is also set. // This is useful for data types like structs, arrays, slices, and maps which // can contain varying types packed inside an interface. func (f *formatState) unpackValue(v reflect.Value) reflect.Value { if v.Kind() == reflect.Interface { f.ignoreNextType = false if !v.IsNil() { v = v.Elem() } } return v } // formatPtr handles formatting of pointers by indirecting them as necessary. func (f *formatState) formatPtr(v reflect.Value) { // Display nil if top level pointer is nil. showTypes := f.fs.Flag('#') if v.IsNil() && (!showTypes || f.ignoreNextType) { f.fs.Write(nilAngleBytes) return } // Remove pointers at or below the current depth from map used to detect // circular refs. for k, depth := range f.pointers { if depth >= f.depth { delete(f.pointers, k) } } // Keep list of all dereferenced pointers to possibly show later. pointerChain := make([]uintptr, 0) // Figure out how many levels of indirection there are by derferencing // pointers and unpacking interfaces down the chain while detecting circular // references. nilFound := false cycleFound := false indirects := 0 ve := v for ve.Kind() == reflect.Ptr { if ve.IsNil() { nilFound = true break } indirects++ addr := ve.Pointer() pointerChain = append(pointerChain, addr) if pd, ok := f.pointers[addr]; ok && pd < f.depth { cycleFound = true indirects-- break } f.pointers[addr] = f.depth ve = ve.Elem() if ve.Kind() == reflect.Interface { if ve.IsNil() { nilFound = true break } ve = ve.Elem() } } // Display type or indirection level depending on flags. if showTypes && !f.ignoreNextType { f.fs.Write(openParenBytes) f.fs.Write(bytes.Repeat(asteriskBytes, indirects)) f.fs.Write([]byte(ve.Type().String())) f.fs.Write(closeParenBytes) } else { if nilFound || cycleFound { indirects += strings.Count(ve.Type().String(), "*") } f.fs.Write(openAngleBytes) f.fs.Write([]byte(strings.Repeat("*", indirects))) f.fs.Write(closeAngleBytes) } // Display pointer information depending on flags. if f.fs.Flag('+') && (len(pointerChain) > 0) { f.fs.Write(openParenBytes) for i, addr := range pointerChain { if i > 0 { f.fs.Write(pointerChainBytes) } printHexPtr(f.fs, addr) } f.fs.Write(closeParenBytes) } // Display dereferenced value. switch { case nilFound: f.fs.Write(nilAngleBytes) case cycleFound: f.fs.Write(circularShortBytes) default: f.ignoreNextType = true f.format(ve) } } // format is the main workhorse for providing the Formatter interface. It // uses the passed reflect value to figure out what kind of object we are // dealing with and formats it appropriately. It is a recursive function, // however circular data structures are detected and handled properly. func (f *formatState) format(v reflect.Value) { // Handle invalid reflect values immediately. kind := v.Kind() if kind == reflect.Invalid { f.fs.Write(invalidAngleBytes) return } // Handle pointers specially. if kind == reflect.Ptr { f.formatPtr(v) return } // Print type information unless already handled elsewhere. if !f.ignoreNextType && f.fs.Flag('#') { f.fs.Write(openParenBytes) f.fs.Write([]byte(v.Type().String())) f.fs.Write(closeParenBytes) } f.ignoreNextType = false // Call Stringer/error interfaces if they exist and the handle methods // flag is enabled. if !f.cs.DisableMethods { if (kind != reflect.Invalid) && (kind != reflect.Interface) { if handled := handleMethods(f.cs, f.fs, v); handled { return } } } switch kind { case reflect.Invalid: // Do nothing. We should never get here since invalid has already // been handled above. case reflect.Bool: printBool(f.fs, v.Bool()) case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: printInt(f.fs, v.Int(), 10) case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: printUint(f.fs, v.Uint(), 10) case reflect.Float32: printFloat(f.fs, v.Float(), 32) case reflect.Float64: printFloat(f.fs, v.Float(), 64) case reflect.Complex64: printComplex(f.fs, v.Complex(), 32) case reflect.Complex128: printComplex(f.fs, v.Complex(), 64) case reflect.Slice: if v.IsNil() { f.fs.Write(nilAngleBytes) break } fallthrough case reflect.Array: f.fs.Write(openBracketBytes) f.depth++ if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { f.fs.Write(maxShortBytes) } else { numEntries := v.Len() for i := 0; i < numEntries; i++ { if i > 0 { f.fs.Write(spaceBytes) } f.ignoreNextType = true f.format(f.unpackValue(v.Index(i))) } } f.depth-- f.fs.Write(closeBracketBytes) case reflect.String: f.fs.Write([]byte(v.String())) case reflect.Interface: // The only time we should get here is for nil interfaces due to // unpackValue calls. if v.IsNil() { f.fs.Write(nilAngleBytes) } case reflect.Ptr: // Do nothing. We should never get here since pointers have already // been handled above. case reflect.Map: // nil maps should be indicated as different than empty maps if v.IsNil() { f.fs.Write(nilAngleBytes) break } f.fs.Write(openMapBytes) f.depth++ if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { f.fs.Write(maxShortBytes) } else { keys := v.MapKeys() if f.cs.SortKeys { sortValues(keys, f.cs) } for i, key := range keys { if i > 0 { f.fs.Write(spaceBytes) } f.ignoreNextType = true f.format(f.unpackValue(key)) f.fs.Write(colonBytes) f.ignoreNextType = true f.format(f.unpackValue(v.MapIndex(key))) } } f.depth-- f.fs.Write(closeMapBytes) case reflect.Struct: numFields := v.NumField() f.fs.Write(openBraceBytes) f.depth++ if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) { f.fs.Write(maxShortBytes) } else { vt := v.Type() for i := 0; i < numFields; i++ { if i > 0 { f.fs.Write(spaceBytes) } vtf := vt.Field(i) if f.fs.Flag('+') || f.fs.Flag('#') { f.fs.Write([]byte(vtf.Name)) f.fs.Write(colonBytes) } f.format(f.unpackValue(v.Field(i))) } } f.depth-- f.fs.Write(closeBraceBytes) case reflect.Uintptr: printHexPtr(f.fs, uintptr(v.Uint())) case reflect.UnsafePointer, reflect.Chan, reflect.Func: printHexPtr(f.fs, v.Pointer()) // There were not any other types at the time this code was written, but // fall back to letting the default fmt package handle it if any get added. default: format := f.buildDefaultFormat() if v.CanInterface() { fmt.Fprintf(f.fs, format, v.Interface()) } else { fmt.Fprintf(f.fs, format, v.String()) } } } // Format satisfies the fmt.Formatter interface. See NewFormatter for usage // details. func (f *formatState) Format(fs fmt.State, verb rune) { f.fs = fs // Use standard formatting for verbs that are not v. if verb != 'v' { format := f.constructOrigFormat(verb) fmt.Fprintf(fs, format, f.value) return } if f.value == nil { if fs.Flag('#') { fs.Write(interfaceBytes) } fs.Write(nilAngleBytes) return } f.format(reflect.ValueOf(f.value)) } // newFormatter is a helper function to consolidate the logic from the various // public methods which take varying config states. func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter { fs := &formatState{value: v, cs: cs} fs.pointers = make(map[uintptr]int) return fs } /* NewFormatter returns a custom formatter that satisfies the fmt.Formatter interface. As a result, it integrates cleanly with standard fmt package printing functions. The formatter is useful for inline printing of smaller data types similar to the standard %v format specifier. The custom formatter only responds to the %v (most compact), %+v (adds pointer addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb combinations. Any other verbs such as %x and %q will be sent to the the standard fmt package for formatting. In addition, the custom formatter ignores the width and precision arguments (however they will still work on the format specifiers not handled by the custom formatter). Typically this function shouldn't be called directly. It is much easier to make use of the custom formatter by calling one of the convenience functions such as Printf, Println, or Fprintf. */ func NewFormatter(v interface{}) fmt.Formatter { return newFormatter(&Config, v) } ================================================ FILE: vendor/github.com/davecgh/go-spew/spew/spew.go ================================================ /* * Copyright (c) 2013-2016 Dave Collins * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package spew import ( "fmt" "io" ) // Errorf is a wrapper for fmt.Errorf that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the formatted string as a value that satisfies error. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b)) func Errorf(format string, a ...interface{}) (err error) { return fmt.Errorf(format, convertArgs(a)...) } // Fprint is a wrapper for fmt.Fprint that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b)) func Fprint(w io.Writer, a ...interface{}) (n int, err error) { return fmt.Fprint(w, convertArgs(a)...) } // Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b)) func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { return fmt.Fprintf(w, format, convertArgs(a)...) } // Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it // passed with a default Formatter interface returned by NewFormatter. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b)) func Fprintln(w io.Writer, a ...interface{}) (n int, err error) { return fmt.Fprintln(w, convertArgs(a)...) } // Print is a wrapper for fmt.Print that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b)) func Print(a ...interface{}) (n int, err error) { return fmt.Print(convertArgs(a)...) } // Printf is a wrapper for fmt.Printf that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b)) func Printf(format string, a ...interface{}) (n int, err error) { return fmt.Printf(format, convertArgs(a)...) } // Println is a wrapper for fmt.Println that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the number of bytes written and any write error encountered. See // NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b)) func Println(a ...interface{}) (n int, err error) { return fmt.Println(convertArgs(a)...) } // Sprint is a wrapper for fmt.Sprint that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b)) func Sprint(a ...interface{}) string { return fmt.Sprint(convertArgs(a)...) } // Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were // passed with a default Formatter interface returned by NewFormatter. It // returns the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b)) func Sprintf(format string, a ...interface{}) string { return fmt.Sprintf(format, convertArgs(a)...) } // Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it // were passed with a default Formatter interface returned by NewFormatter. It // returns the resulting string. See NewFormatter for formatting details. // // This function is shorthand for the following syntax: // // fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b)) func Sprintln(a ...interface{}) string { return fmt.Sprintln(convertArgs(a)...) } // convertArgs accepts a slice of arguments and returns a slice of the same // length with each argument converted to a default spew Formatter interface. func convertArgs(args []interface{}) (formatters []interface{}) { formatters = make([]interface{}, len(args)) for index, arg := range args { formatters[index] = NewFormatter(arg) } return formatters } ================================================ FILE: vendor/github.com/ghodss/yaml/.gitignore ================================================ # OSX leaves these everywhere on SMB shares ._* # Eclipse files .classpath .project .settings/** # Emacs save files *~ # Vim-related files [._]*.s[a-w][a-z] [._]s[a-w][a-z] *.un~ Session.vim .netrwhist # Go test binaries *.test ================================================ FILE: vendor/github.com/ghodss/yaml/.travis.yml ================================================ language: go go: - 1.3 - 1.4 script: - go test - go build ================================================ FILE: vendor/github.com/ghodss/yaml/LICENSE ================================================ The MIT License (MIT) Copyright (c) 2014 Sam Ghods Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copyright (c) 2012 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/ghodss/yaml/README.md ================================================ # YAML marshaling and unmarshaling support for Go [![Build Status](https://travis-ci.org/ghodss/yaml.svg)](https://travis-ci.org/ghodss/yaml) ## Introduction A wrapper around [go-yaml](https://github.com/go-yaml/yaml) designed to enable a better way of handling YAML when marshaling to and from structs. In short, this library first converts YAML to JSON using go-yaml and then uses `json.Marshal` and `json.Unmarshal` to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods `MarshalJSON` and `UnmarshalJSON` unlike go-yaml. For a detailed overview of the rationale behind this method, [see this blog post](http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/). ## Compatibility This package uses [go-yaml](https://github.com/go-yaml/yaml) and therefore supports [everything go-yaml supports](https://github.com/go-yaml/yaml#compatibility). ## Caveats **Caveat #1:** When using `yaml.Marshal` and `yaml.Unmarshal`, binary data should NOT be preceded with the `!!binary` YAML tag. If you do, go-yaml will convert the binary data from base64 to native binary data, which is not compatible with JSON. You can still use binary in your YAML files though - just store them without the `!!binary` tag and decode the base64 in your code (e.g. in the custom JSON methods `MarshalJSON` and `UnmarshalJSON`). This also has the benefit that your YAML and your JSON binary data will be decoded exactly the same way. As an example: ``` BAD: exampleKey: !!binary gIGC GOOD: exampleKey: gIGC ... and decode the base64 data in your code. ``` **Caveat #2:** When using `YAMLToJSON` directly, maps with keys that are maps will result in an error since this is not supported by JSON. This error will occur in `Unmarshal` as well since you can't unmarshal map keys anyways since struct fields can't be keys. ## Installation and usage To install, run: ``` $ go get github.com/ghodss/yaml ``` And import using: ``` import "github.com/ghodss/yaml" ``` Usage is very similar to the JSON library: ```go package main import ( "fmt" "github.com/ghodss/yaml" ) type Person struct { Name string `json:"name"` // Affects YAML field names too. Age int `json:"age"` } func main() { // Marshal a Person struct to YAML. p := Person{"John", 30} y, err := yaml.Marshal(p) if err != nil { fmt.Printf("err: %v\n", err) return } fmt.Println(string(y)) /* Output: age: 30 name: John */ // Unmarshal the YAML back into a Person struct. var p2 Person err = yaml.Unmarshal(y, &p2) if err != nil { fmt.Printf("err: %v\n", err) return } fmt.Println(p2) /* Output: {John 30} */ } ``` `yaml.YAMLToJSON` and `yaml.JSONToYAML` methods are also available: ```go package main import ( "fmt" "github.com/ghodss/yaml" ) func main() { j := []byte(`{"name": "John", "age": 30}`) y, err := yaml.JSONToYAML(j) if err != nil { fmt.Printf("err: %v\n", err) return } fmt.Println(string(y)) /* Output: name: John age: 30 */ j2, err := yaml.YAMLToJSON(y) if err != nil { fmt.Printf("err: %v\n", err) return } fmt.Println(string(j2)) /* Output: {"age":30,"name":"John"} */ } ``` ================================================ FILE: vendor/github.com/ghodss/yaml/fields.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package yaml import ( "bytes" "encoding" "encoding/json" "reflect" "sort" "strings" "sync" "unicode" "unicode/utf8" ) // indirect walks down v allocating pointers as needed, // until it gets to a non-pointer. // if it encounters an Unmarshaler, indirect stops and returns that. // if decodingNull is true, indirect stops at the last pointer so it can be set to nil. func indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, encoding.TextUnmarshaler, reflect.Value) { // If v is a named type and is addressable, // start with its address, so that if the type has pointer methods, // we find them. if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() { v = v.Addr() } for { // Load value from interface, but only if the result will be // usefully addressable. if v.Kind() == reflect.Interface && !v.IsNil() { e := v.Elem() if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) { v = e continue } } if v.Kind() != reflect.Ptr { break } if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() { break } if v.IsNil() { if v.CanSet() { v.Set(reflect.New(v.Type().Elem())) } else { v = reflect.New(v.Type().Elem()) } } if v.Type().NumMethod() > 0 { if u, ok := v.Interface().(json.Unmarshaler); ok { return u, nil, reflect.Value{} } if u, ok := v.Interface().(encoding.TextUnmarshaler); ok { return nil, u, reflect.Value{} } } v = v.Elem() } return nil, nil, v } // A field represents a single field found in a struct. type field struct { name string nameBytes []byte // []byte(name) equalFold func(s, t []byte) bool // bytes.EqualFold or equivalent tag bool index []int typ reflect.Type omitEmpty bool quoted bool } func fillField(f field) field { f.nameBytes = []byte(f.name) f.equalFold = foldFunc(f.nameBytes) return f } // byName sorts field by name, breaking ties with depth, // then breaking ties with "name came from json tag", then // breaking ties with index sequence. type byName []field func (x byName) Len() int { return len(x) } func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } func (x byName) Less(i, j int) bool { if x[i].name != x[j].name { return x[i].name < x[j].name } if len(x[i].index) != len(x[j].index) { return len(x[i].index) < len(x[j].index) } if x[i].tag != x[j].tag { return x[i].tag } return byIndex(x).Less(i, j) } // byIndex sorts field by index sequence. type byIndex []field func (x byIndex) Len() int { return len(x) } func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] } func (x byIndex) Less(i, j int) bool { for k, xik := range x[i].index { if k >= len(x[j].index) { return false } if xik != x[j].index[k] { return xik < x[j].index[k] } } return len(x[i].index) < len(x[j].index) } // typeFields returns a list of fields that JSON should recognize for the given type. // The algorithm is breadth-first search over the set of structs to include - the top struct // and then any reachable anonymous structs. func typeFields(t reflect.Type) []field { // Anonymous fields to explore at the current level and the next. current := []field{} next := []field{{typ: t}} // Count of queued names for current level and the next. count := map[reflect.Type]int{} nextCount := map[reflect.Type]int{} // Types already visited at an earlier level. visited := map[reflect.Type]bool{} // Fields found. var fields []field for len(next) > 0 { current, next = next, current[:0] count, nextCount = nextCount, map[reflect.Type]int{} for _, f := range current { if visited[f.typ] { continue } visited[f.typ] = true // Scan f.typ for fields to include. for i := 0; i < f.typ.NumField(); i++ { sf := f.typ.Field(i) if sf.PkgPath != "" { // unexported continue } tag := sf.Tag.Get("json") if tag == "-" { continue } name, opts := parseTag(tag) if !isValidTag(name) { name = "" } index := make([]int, len(f.index)+1) copy(index, f.index) index[len(f.index)] = i ft := sf.Type if ft.Name() == "" && ft.Kind() == reflect.Ptr { // Follow pointer. ft = ft.Elem() } // Record found field and index sequence. if name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct { tagged := name != "" if name == "" { name = sf.Name } fields = append(fields, fillField(field{ name: name, tag: tagged, index: index, typ: ft, omitEmpty: opts.Contains("omitempty"), quoted: opts.Contains("string"), })) if count[f.typ] > 1 { // If there were multiple instances, add a second, // so that the annihilation code will see a duplicate. // It only cares about the distinction between 1 or 2, // so don't bother generating any more copies. fields = append(fields, fields[len(fields)-1]) } continue } // Record new anonymous struct to explore in next round. nextCount[ft]++ if nextCount[ft] == 1 { next = append(next, fillField(field{name: ft.Name(), index: index, typ: ft})) } } } } sort.Sort(byName(fields)) // Delete all fields that are hidden by the Go rules for embedded fields, // except that fields with JSON tags are promoted. // The fields are sorted in primary order of name, secondary order // of field index length. Loop over names; for each name, delete // hidden fields by choosing the one dominant field that survives. out := fields[:0] for advance, i := 0, 0; i < len(fields); i += advance { // One iteration per name. // Find the sequence of fields with the name of this first field. fi := fields[i] name := fi.name for advance = 1; i+advance < len(fields); advance++ { fj := fields[i+advance] if fj.name != name { break } } if advance == 1 { // Only one field with this name out = append(out, fi) continue } dominant, ok := dominantField(fields[i : i+advance]) if ok { out = append(out, dominant) } } fields = out sort.Sort(byIndex(fields)) return fields } // dominantField looks through the fields, all of which are known to // have the same name, to find the single field that dominates the // others using Go's embedding rules, modified by the presence of // JSON tags. If there are multiple top-level fields, the boolean // will be false: This condition is an error in Go and we skip all // the fields. func dominantField(fields []field) (field, bool) { // The fields are sorted in increasing index-length order. The winner // must therefore be one with the shortest index length. Drop all // longer entries, which is easy: just truncate the slice. length := len(fields[0].index) tagged := -1 // Index of first tagged field. for i, f := range fields { if len(f.index) > length { fields = fields[:i] break } if f.tag { if tagged >= 0 { // Multiple tagged fields at the same level: conflict. // Return no field. return field{}, false } tagged = i } } if tagged >= 0 { return fields[tagged], true } // All remaining fields have the same length. If there's more than one, // we have a conflict (two fields named "X" at the same level) and we // return no field. if len(fields) > 1 { return field{}, false } return fields[0], true } var fieldCache struct { sync.RWMutex m map[reflect.Type][]field } // cachedTypeFields is like typeFields but uses a cache to avoid repeated work. func cachedTypeFields(t reflect.Type) []field { fieldCache.RLock() f := fieldCache.m[t] fieldCache.RUnlock() if f != nil { return f } // Compute fields without lock. // Might duplicate effort but won't hold other computations back. f = typeFields(t) if f == nil { f = []field{} } fieldCache.Lock() if fieldCache.m == nil { fieldCache.m = map[reflect.Type][]field{} } fieldCache.m[t] = f fieldCache.Unlock() return f } func isValidTag(s string) bool { if s == "" { return false } for _, c := range s { switch { case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c): // Backslash and quote chars are reserved, but // otherwise any punctuation chars are allowed // in a tag name. default: if !unicode.IsLetter(c) && !unicode.IsDigit(c) { return false } } } return true } const ( caseMask = ^byte(0x20) // Mask to ignore case in ASCII. kelvin = '\u212a' smallLongEss = '\u017f' ) // foldFunc returns one of four different case folding equivalence // functions, from most general (and slow) to fastest: // // 1) bytes.EqualFold, if the key s contains any non-ASCII UTF-8 // 2) equalFoldRight, if s contains special folding ASCII ('k', 'K', 's', 'S') // 3) asciiEqualFold, no special, but includes non-letters (including _) // 4) simpleLetterEqualFold, no specials, no non-letters. // // The letters S and K are special because they map to 3 runes, not just 2: // * S maps to s and to U+017F 'ſ' Latin small letter long s // * k maps to K and to U+212A 'K' Kelvin sign // See http://play.golang.org/p/tTxjOc0OGo // // The returned function is specialized for matching against s and // should only be given s. It's not curried for performance reasons. func foldFunc(s []byte) func(s, t []byte) bool { nonLetter := false special := false // special letter for _, b := range s { if b >= utf8.RuneSelf { return bytes.EqualFold } upper := b & caseMask if upper < 'A' || upper > 'Z' { nonLetter = true } else if upper == 'K' || upper == 'S' { // See above for why these letters are special. special = true } } if special { return equalFoldRight } if nonLetter { return asciiEqualFold } return simpleLetterEqualFold } // equalFoldRight is a specialization of bytes.EqualFold when s is // known to be all ASCII (including punctuation), but contains an 's', // 'S', 'k', or 'K', requiring a Unicode fold on the bytes in t. // See comments on foldFunc. func equalFoldRight(s, t []byte) bool { for _, sb := range s { if len(t) == 0 { return false } tb := t[0] if tb < utf8.RuneSelf { if sb != tb { sbUpper := sb & caseMask if 'A' <= sbUpper && sbUpper <= 'Z' { if sbUpper != tb&caseMask { return false } } else { return false } } t = t[1:] continue } // sb is ASCII and t is not. t must be either kelvin // sign or long s; sb must be s, S, k, or K. tr, size := utf8.DecodeRune(t) switch sb { case 's', 'S': if tr != smallLongEss { return false } case 'k', 'K': if tr != kelvin { return false } default: return false } t = t[size:] } if len(t) > 0 { return false } return true } // asciiEqualFold is a specialization of bytes.EqualFold for use when // s is all ASCII (but may contain non-letters) and contains no // special-folding letters. // See comments on foldFunc. func asciiEqualFold(s, t []byte) bool { if len(s) != len(t) { return false } for i, sb := range s { tb := t[i] if sb == tb { continue } if ('a' <= sb && sb <= 'z') || ('A' <= sb && sb <= 'Z') { if sb&caseMask != tb&caseMask { return false } } else { return false } } return true } // simpleLetterEqualFold is a specialization of bytes.EqualFold for // use when s is all ASCII letters (no underscores, etc) and also // doesn't contain 'k', 'K', 's', or 'S'. // See comments on foldFunc. func simpleLetterEqualFold(s, t []byte) bool { if len(s) != len(t) { return false } for i, b := range s { if b&caseMask != t[i]&caseMask { return false } } return true } // tagOptions is the string following a comma in a struct field's "json" // tag, or the empty string. It does not include the leading comma. type tagOptions string // parseTag splits a struct field's json tag into its name and // comma-separated options. func parseTag(tag string) (string, tagOptions) { if idx := strings.Index(tag, ","); idx != -1 { return tag[:idx], tagOptions(tag[idx+1:]) } return tag, tagOptions("") } // Contains reports whether a comma-separated list of options // contains a particular substr flag. substr must be surrounded by a // string boundary or commas. func (o tagOptions) Contains(optionName string) bool { if len(o) == 0 { return false } s := string(o) for s != "" { var next string i := strings.Index(s, ",") if i >= 0 { s, next = s[:i], s[i+1:] } if s == optionName { return true } s = next } return false } ================================================ FILE: vendor/github.com/ghodss/yaml/yaml.go ================================================ package yaml import ( "bytes" "encoding/json" "fmt" "reflect" "strconv" "gopkg.in/yaml.v2" ) // Marshals the object into JSON then converts JSON to YAML and returns the // YAML. func Marshal(o interface{}) ([]byte, error) { j, err := json.Marshal(o) if err != nil { return nil, fmt.Errorf("error marshaling into JSON: %v", err) } y, err := JSONToYAML(j) if err != nil { return nil, fmt.Errorf("error converting JSON to YAML: %v", err) } return y, nil } // Converts YAML to JSON then uses JSON to unmarshal into an object. func Unmarshal(y []byte, o interface{}) error { vo := reflect.ValueOf(o) j, err := yamlToJSON(y, &vo) if err != nil { return fmt.Errorf("error converting YAML to JSON: %v", err) } err = json.Unmarshal(j, o) if err != nil { return fmt.Errorf("error unmarshaling JSON: %v", err) } return nil } // Convert JSON to YAML. func JSONToYAML(j []byte) ([]byte, error) { // Convert the JSON to an object. var jsonObj interface{} // We are using yaml.Unmarshal here (instead of json.Unmarshal) because the // Go JSON library doesn't try to pick the right number type (int, float, // etc.) when unmarshalling to interface{}, it just picks float64 // universally. go-yaml does go through the effort of picking the right // number type, so we can preserve number type throughout this process. err := yaml.Unmarshal(j, &jsonObj) if err != nil { return nil, err } // Marshal this object into YAML. return yaml.Marshal(jsonObj) } // Convert YAML to JSON. Since JSON is a subset of YAML, passing JSON through // this method should be a no-op. // // Things YAML can do that are not supported by JSON: // * In YAML you can have binary and null keys in your maps. These are invalid // in JSON. (int and float keys are converted to strings.) // * Binary data in YAML with the !!binary tag is not supported. If you want to // use binary data with this library, encode the data as base64 as usual but do // not use the !!binary tag in your YAML. This will ensure the original base64 // encoded data makes it all the way through to the JSON. func YAMLToJSON(y []byte) ([]byte, error) { return yamlToJSON(y, nil) } func yamlToJSON(y []byte, jsonTarget *reflect.Value) ([]byte, error) { // Convert the YAML to an object. var yamlObj interface{} err := yaml.Unmarshal(y, &yamlObj) if err != nil { return nil, err } // YAML objects are not completely compatible with JSON objects (e.g. you // can have non-string keys in YAML). So, convert the YAML-compatible object // to a JSON-compatible object, failing with an error if irrecoverable // incompatibilties happen along the way. jsonObj, err := convertToJSONableObject(yamlObj, jsonTarget) if err != nil { return nil, err } // Convert this object to JSON and return the data. return json.Marshal(jsonObj) } func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (interface{}, error) { var err error // Resolve jsonTarget to a concrete value (i.e. not a pointer or an // interface). We pass decodingNull as false because we're not actually // decoding into the value, we're just checking if the ultimate target is a // string. if jsonTarget != nil { ju, tu, pv := indirect(*jsonTarget, false) // We have a JSON or Text Umarshaler at this level, so we can't be trying // to decode into a string. if ju != nil || tu != nil { jsonTarget = nil } else { jsonTarget = &pv } } // If yamlObj is a number or a boolean, check if jsonTarget is a string - // if so, coerce. Else return normal. // If yamlObj is a map or array, find the field that each key is // unmarshaling to, and when you recurse pass the reflect.Value for that // field back into this function. switch typedYAMLObj := yamlObj.(type) { case map[interface{}]interface{}: // JSON does not support arbitrary keys in a map, so we must convert // these keys to strings. // // From my reading of go-yaml v2 (specifically the resolve function), // keys can only have the types string, int, int64, float64, binary // (unsupported), or null (unsupported). strMap := make(map[string]interface{}) for k, v := range typedYAMLObj { // Resolve the key to a string first. var keyString string switch typedKey := k.(type) { case string: keyString = typedKey case int: keyString = strconv.Itoa(typedKey) case int64: // go-yaml will only return an int64 as a key if the system // architecture is 32-bit and the key's value is between 32-bit // and 64-bit. Otherwise the key type will simply be int. keyString = strconv.FormatInt(typedKey, 10) case float64: // Stolen from go-yaml to use the same conversion to string as // the go-yaml library uses to convert float to string when // Marshaling. s := strconv.FormatFloat(typedKey, 'g', -1, 32) switch s { case "+Inf": s = ".inf" case "-Inf": s = "-.inf" case "NaN": s = ".nan" } keyString = s case bool: if typedKey { keyString = "true" } else { keyString = "false" } default: return nil, fmt.Errorf("Unsupported map key of type: %s, key: %+#v, value: %+#v", reflect.TypeOf(k), k, v) } // jsonTarget should be a struct or a map. If it's a struct, find // the field it's going to map to and pass its reflect.Value. If // it's a map, find the element type of the map and pass the // reflect.Value created from that type. If it's neither, just pass // nil - JSON conversion will error for us if it's a real issue. if jsonTarget != nil { t := *jsonTarget if t.Kind() == reflect.Struct { keyBytes := []byte(keyString) // Find the field that the JSON library would use. var f *field fields := cachedTypeFields(t.Type()) for i := range fields { ff := &fields[i] if bytes.Equal(ff.nameBytes, keyBytes) { f = ff break } // Do case-insensitive comparison. if f == nil && ff.equalFold(ff.nameBytes, keyBytes) { f = ff } } if f != nil { // Find the reflect.Value of the most preferential // struct field. jtf := t.Field(f.index[0]) strMap[keyString], err = convertToJSONableObject(v, &jtf) if err != nil { return nil, err } continue } } else if t.Kind() == reflect.Map { // Create a zero value of the map's element type to use as // the JSON target. jtv := reflect.Zero(t.Type().Elem()) strMap[keyString], err = convertToJSONableObject(v, &jtv) if err != nil { return nil, err } continue } } strMap[keyString], err = convertToJSONableObject(v, nil) if err != nil { return nil, err } } return strMap, nil case []interface{}: // We need to recurse into arrays in case there are any // map[interface{}]interface{}'s inside and to convert any // numbers to strings. // If jsonTarget is a slice (which it really should be), find the // thing it's going to map to. If it's not a slice, just pass nil // - JSON conversion will error for us if it's a real issue. var jsonSliceElemValue *reflect.Value if jsonTarget != nil { t := *jsonTarget if t.Kind() == reflect.Slice { // By default slices point to nil, but we need a reflect.Value // pointing to a value of the slice type, so we create one here. ev := reflect.Indirect(reflect.New(t.Type().Elem())) jsonSliceElemValue = &ev } } // Make and use a new array. arr := make([]interface{}, len(typedYAMLObj)) for i, v := range typedYAMLObj { arr[i], err = convertToJSONableObject(v, jsonSliceElemValue) if err != nil { return nil, err } } return arr, nil default: // If the target type is a string and the YAML type is a number, // convert the YAML type to a string. if jsonTarget != nil && (*jsonTarget).Kind() == reflect.String { // Based on my reading of go-yaml, it may return int, int64, // float64, or uint64. var s string switch typedVal := typedYAMLObj.(type) { case int: s = strconv.FormatInt(int64(typedVal), 10) case int64: s = strconv.FormatInt(typedVal, 10) case float64: s = strconv.FormatFloat(typedVal, 'g', -1, 32) case uint64: s = strconv.FormatUint(typedVal, 10) case bool: if typedVal { s = "true" } else { s = "false" } } if len(s) > 0 { yamlObj = interface{}(s) } } return yamlObj, nil } return nil, nil } ================================================ FILE: vendor/github.com/gogo/protobuf/AUTHORS ================================================ # This is the official list of GoGo authors for copyright purposes. # This file is distinct from the CONTRIBUTORS file, which # lists people. For example, employees are listed in CONTRIBUTORS, # but not in AUTHORS, because the employer holds the copyright. # Names should be added to this file as one of # Organization's name # Individual's name # Individual's name # Please keep the list sorted. Sendgrid, Inc Vastech SA (PTY) LTD Walter Schulze ================================================ FILE: vendor/github.com/gogo/protobuf/CONTRIBUTORS ================================================ Anton Povarov Brian Goff Clayton Coleman Denis Smirnov DongYun Kang Dwayne Schultz Georg Apitz Gustav Paul Johan Brandhorst John Shahid John Tuley Laurent Patrick Lee Peter Edge Roger Johansson Sam Nguyen Sergio Arbeo Stephen J Day Tamir Duberstein Todd Eisenberger Tormod Erevik Lea Vyacheslav Kim Walter Schulze ================================================ FILE: vendor/github.com/gogo/protobuf/LICENSE ================================================ Copyright (c) 2013, The GoGo Authors. All rights reserved. Protocol Buffers for Go with Gadgets Go support for Protocol Buffers - Google's data interchange format Copyright 2010 The Go Authors. All rights reserved. https://github.com/golang/protobuf Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/gogo/protobuf/gogoproto/Makefile ================================================ # Protocol Buffers for Go with Gadgets # # Copyright (c) 2013, The GoGo Authors. All rights reserved. # http://github.com/gogo/protobuf # # 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. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. regenerate: go install github.com/gogo/protobuf/protoc-gen-gogo protoc --gogo_out=Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:../../../../ --proto_path=../../../../:../protobuf/:. *.proto restore: cp gogo.pb.golden gogo.pb.go preserve: cp gogo.pb.go gogo.pb.golden ================================================ FILE: vendor/github.com/gogo/protobuf/gogoproto/doc.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Package gogoproto provides extensions for protocol buffers to achieve: - fast marshalling and unmarshalling. - peace of mind by optionally generating test and benchmark code. - more canonical Go structures. - less typing by optionally generating extra helper code. - goprotobuf compatibility More Canonical Go Structures A lot of time working with a goprotobuf struct will lead you to a place where you create another struct that is easier to work with and then have a function to copy the values between the two structs. You might also find that basic structs that started their life as part of an API need to be sent over the wire. With gob, you could just send it. With goprotobuf, you need to make a parallel struct. Gogoprotobuf tries to fix these problems with the nullable, embed, customtype and customname field extensions. - nullable, if false, a field is generated without a pointer (see warning below). - embed, if true, the field is generated as an embedded field. - customtype, It works with the Marshal and Unmarshal methods, to allow you to have your own types in your struct, but marshal to bytes. For example, custom.Uuid or custom.Fixed128 - customname (beta), Changes the generated fieldname. This is especially useful when generated methods conflict with fieldnames. - casttype (beta), Changes the generated fieldtype. All generated code assumes that this type is castable to the protocol buffer field type. It does not work for structs or enums. - castkey (beta), Changes the generated fieldtype for a map key. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps. - castvalue (beta), Changes the generated fieldtype for a map value. All generated code assumes that this type is castable to the protocol buffer field type. Only supported on maps. Warning about nullable: According to the Protocol Buffer specification, you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set. It can be seen as a layer on top of Protocol Buffers, where before and after marshalling all non-nullable fields are set and they cannot be unset. Let us look at: github.com/gogo/protobuf/test/example/example.proto for a quicker overview. The following message: package test; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; message A { optional string Description = 1 [(gogoproto.nullable) = false]; optional int64 Number = 2 [(gogoproto.nullable) = false]; optional bytes Id = 3 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uuid", (gogoproto.nullable) = false]; } Will generate a go struct which looks a lot like this: type A struct { Description string Number int64 Id github_com_gogo_protobuf_test_custom.Uuid } You will see there are no pointers, since all fields are non-nullable. You will also see a custom type which marshals to a string. Be warned it is your responsibility to test your custom types thoroughly. You should think of every possible empty and nil case for your marshaling, unmarshaling and size methods. Next we will embed the message A in message B. message B { optional A A = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; repeated bytes G = 2 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uint128", (gogoproto.nullable) = false]; } See below that A is embedded in B. type B struct { A G []github_com_gogo_protobuf_test_custom.Uint128 } Also see the repeated custom type. type Uint128 [2]uint64 Next we will create a custom name for one of our fields. message C { optional int64 size = 1 [(gogoproto.customname) = "MySize"]; } See below that the field's name is MySize and not Size. type C struct { MySize *int64 } The is useful when having a protocol buffer message with a field name which conflicts with a generated method. As an example, having a field name size and using the sizer plugin to generate a Size method will cause a go compiler error. Using customname you can fix this error without changing the field name. This is typically useful when working with a protocol buffer that was designed before these methods and/or the go language were avialable. Gogoprotobuf also has some more subtle changes, these could be changed back: - the generated package name for imports do not have the extra /filename.pb, but are actually the imports specified in the .proto file. Gogoprotobuf also has lost some features which should be brought back with time: - Marshalling and unmarshalling with reflect and without the unsafe package, this requires work in pointer_reflect.go Why does nullable break protocol buffer specifications: The protocol buffer specification states, somewhere, that you should be able to tell whether a field is set or unset. With the option nullable=false this feature is lost, since your non-nullable fields will always be set. It can be seen as a layer on top of protocol buffers, where before and after marshalling all non-nullable fields are set and they cannot be unset. Goprotobuf Compatibility: Gogoprotobuf is compatible with Goprotobuf, because it is compatible with protocol buffers. Gogoprotobuf generates the same code as goprotobuf if no extensions are used. The enumprefix, getters and stringer extensions can be used to remove some of the unnecessary code generated by goprotobuf: - gogoproto_import, if false, the generated code imports github.com/golang/protobuf/proto instead of github.com/gogo/protobuf/proto. - goproto_enum_prefix, if false, generates the enum constant names without the messagetype prefix - goproto_enum_stringer (experimental), if false, the enum is generated without the default string method, this is useful for rather using enum_stringer, or allowing you to write your own string method. - goproto_getters, if false, the message is generated without get methods, this is useful when you would rather want to use face - goproto_stringer, if false, the message is generated without the default string method, this is useful for rather using stringer, or allowing you to write your own string method. - goproto_extensions_map (beta), if false, the extensions field is generated as type []byte instead of type map[int32]proto.Extension - goproto_unrecognized (beta), if false, XXX_unrecognized field is not generated. This is useful in conjunction with gogoproto.nullable=false, to generate structures completely devoid of pointers and reduce GC pressure at the cost of losing information about unrecognized fields. - goproto_registration (beta), if true, the generated files will register all messages and types against both gogo/protobuf and golang/protobuf. This is necessary when using third-party packages which read registrations from golang/protobuf (such as the grpc-gateway). Less Typing and Peace of Mind is explained in their specific plugin folders godoc: - github.com/gogo/protobuf/plugin/ If you do not use any of these extension the code that is generated will be the same as if goprotobuf has generated it. The most complete way to see examples is to look at github.com/gogo/protobuf/test/thetest.proto Gogoprototest is a seperate project, because we want to keep gogoprotobuf independent of goprotobuf, but we still want to test it thoroughly. */ package gogoproto ================================================ FILE: vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.go ================================================ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: gogo.proto package gogoproto import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package var E_GoprotoEnumPrefix = &proto.ExtensionDesc{ ExtendedType: (*descriptor.EnumOptions)(nil), ExtensionType: (*bool)(nil), Field: 62001, Name: "gogoproto.goproto_enum_prefix", Tag: "varint,62001,opt,name=goproto_enum_prefix", Filename: "gogo.proto", } var E_GoprotoEnumStringer = &proto.ExtensionDesc{ ExtendedType: (*descriptor.EnumOptions)(nil), ExtensionType: (*bool)(nil), Field: 62021, Name: "gogoproto.goproto_enum_stringer", Tag: "varint,62021,opt,name=goproto_enum_stringer", Filename: "gogo.proto", } var E_EnumStringer = &proto.ExtensionDesc{ ExtendedType: (*descriptor.EnumOptions)(nil), ExtensionType: (*bool)(nil), Field: 62022, Name: "gogoproto.enum_stringer", Tag: "varint,62022,opt,name=enum_stringer", Filename: "gogo.proto", } var E_EnumCustomname = &proto.ExtensionDesc{ ExtendedType: (*descriptor.EnumOptions)(nil), ExtensionType: (*string)(nil), Field: 62023, Name: "gogoproto.enum_customname", Tag: "bytes,62023,opt,name=enum_customname", Filename: "gogo.proto", } var E_Enumdecl = &proto.ExtensionDesc{ ExtendedType: (*descriptor.EnumOptions)(nil), ExtensionType: (*bool)(nil), Field: 62024, Name: "gogoproto.enumdecl", Tag: "varint,62024,opt,name=enumdecl", Filename: "gogo.proto", } var E_EnumvalueCustomname = &proto.ExtensionDesc{ ExtendedType: (*descriptor.EnumValueOptions)(nil), ExtensionType: (*string)(nil), Field: 66001, Name: "gogoproto.enumvalue_customname", Tag: "bytes,66001,opt,name=enumvalue_customname", Filename: "gogo.proto", } var E_GoprotoGettersAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63001, Name: "gogoproto.goproto_getters_all", Tag: "varint,63001,opt,name=goproto_getters_all", Filename: "gogo.proto", } var E_GoprotoEnumPrefixAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63002, Name: "gogoproto.goproto_enum_prefix_all", Tag: "varint,63002,opt,name=goproto_enum_prefix_all", Filename: "gogo.proto", } var E_GoprotoStringerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63003, Name: "gogoproto.goproto_stringer_all", Tag: "varint,63003,opt,name=goproto_stringer_all", Filename: "gogo.proto", } var E_VerboseEqualAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63004, Name: "gogoproto.verbose_equal_all", Tag: "varint,63004,opt,name=verbose_equal_all", Filename: "gogo.proto", } var E_FaceAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63005, Name: "gogoproto.face_all", Tag: "varint,63005,opt,name=face_all", Filename: "gogo.proto", } var E_GostringAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63006, Name: "gogoproto.gostring_all", Tag: "varint,63006,opt,name=gostring_all", Filename: "gogo.proto", } var E_PopulateAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63007, Name: "gogoproto.populate_all", Tag: "varint,63007,opt,name=populate_all", Filename: "gogo.proto", } var E_StringerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63008, Name: "gogoproto.stringer_all", Tag: "varint,63008,opt,name=stringer_all", Filename: "gogo.proto", } var E_OnlyoneAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63009, Name: "gogoproto.onlyone_all", Tag: "varint,63009,opt,name=onlyone_all", Filename: "gogo.proto", } var E_EqualAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63013, Name: "gogoproto.equal_all", Tag: "varint,63013,opt,name=equal_all", Filename: "gogo.proto", } var E_DescriptionAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63014, Name: "gogoproto.description_all", Tag: "varint,63014,opt,name=description_all", Filename: "gogo.proto", } var E_TestgenAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63015, Name: "gogoproto.testgen_all", Tag: "varint,63015,opt,name=testgen_all", Filename: "gogo.proto", } var E_BenchgenAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63016, Name: "gogoproto.benchgen_all", Tag: "varint,63016,opt,name=benchgen_all", Filename: "gogo.proto", } var E_MarshalerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63017, Name: "gogoproto.marshaler_all", Tag: "varint,63017,opt,name=marshaler_all", Filename: "gogo.proto", } var E_UnmarshalerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63018, Name: "gogoproto.unmarshaler_all", Tag: "varint,63018,opt,name=unmarshaler_all", Filename: "gogo.proto", } var E_StableMarshalerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63019, Name: "gogoproto.stable_marshaler_all", Tag: "varint,63019,opt,name=stable_marshaler_all", Filename: "gogo.proto", } var E_SizerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63020, Name: "gogoproto.sizer_all", Tag: "varint,63020,opt,name=sizer_all", Filename: "gogo.proto", } var E_GoprotoEnumStringerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63021, Name: "gogoproto.goproto_enum_stringer_all", Tag: "varint,63021,opt,name=goproto_enum_stringer_all", Filename: "gogo.proto", } var E_EnumStringerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63022, Name: "gogoproto.enum_stringer_all", Tag: "varint,63022,opt,name=enum_stringer_all", Filename: "gogo.proto", } var E_UnsafeMarshalerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63023, Name: "gogoproto.unsafe_marshaler_all", Tag: "varint,63023,opt,name=unsafe_marshaler_all", Filename: "gogo.proto", } var E_UnsafeUnmarshalerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63024, Name: "gogoproto.unsafe_unmarshaler_all", Tag: "varint,63024,opt,name=unsafe_unmarshaler_all", Filename: "gogo.proto", } var E_GoprotoExtensionsMapAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63025, Name: "gogoproto.goproto_extensions_map_all", Tag: "varint,63025,opt,name=goproto_extensions_map_all", Filename: "gogo.proto", } var E_GoprotoUnrecognizedAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63026, Name: "gogoproto.goproto_unrecognized_all", Tag: "varint,63026,opt,name=goproto_unrecognized_all", Filename: "gogo.proto", } var E_GogoprotoImport = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63027, Name: "gogoproto.gogoproto_import", Tag: "varint,63027,opt,name=gogoproto_import", Filename: "gogo.proto", } var E_ProtosizerAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63028, Name: "gogoproto.protosizer_all", Tag: "varint,63028,opt,name=protosizer_all", Filename: "gogo.proto", } var E_CompareAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63029, Name: "gogoproto.compare_all", Tag: "varint,63029,opt,name=compare_all", Filename: "gogo.proto", } var E_TypedeclAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63030, Name: "gogoproto.typedecl_all", Tag: "varint,63030,opt,name=typedecl_all", Filename: "gogo.proto", } var E_EnumdeclAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63031, Name: "gogoproto.enumdecl_all", Tag: "varint,63031,opt,name=enumdecl_all", Filename: "gogo.proto", } var E_GoprotoRegistration = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63032, Name: "gogoproto.goproto_registration", Tag: "varint,63032,opt,name=goproto_registration", Filename: "gogo.proto", } var E_MessagenameAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63033, Name: "gogoproto.messagename_all", Tag: "varint,63033,opt,name=messagename_all", Filename: "gogo.proto", } var E_GoprotoSizecacheAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63034, Name: "gogoproto.goproto_sizecache_all", Tag: "varint,63034,opt,name=goproto_sizecache_all", Filename: "gogo.proto", } var E_GoprotoUnkeyedAll = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FileOptions)(nil), ExtensionType: (*bool)(nil), Field: 63035, Name: "gogoproto.goproto_unkeyed_all", Tag: "varint,63035,opt,name=goproto_unkeyed_all", Filename: "gogo.proto", } var E_GoprotoGetters = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64001, Name: "gogoproto.goproto_getters", Tag: "varint,64001,opt,name=goproto_getters", Filename: "gogo.proto", } var E_GoprotoStringer = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64003, Name: "gogoproto.goproto_stringer", Tag: "varint,64003,opt,name=goproto_stringer", Filename: "gogo.proto", } var E_VerboseEqual = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64004, Name: "gogoproto.verbose_equal", Tag: "varint,64004,opt,name=verbose_equal", Filename: "gogo.proto", } var E_Face = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64005, Name: "gogoproto.face", Tag: "varint,64005,opt,name=face", Filename: "gogo.proto", } var E_Gostring = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64006, Name: "gogoproto.gostring", Tag: "varint,64006,opt,name=gostring", Filename: "gogo.proto", } var E_Populate = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64007, Name: "gogoproto.populate", Tag: "varint,64007,opt,name=populate", Filename: "gogo.proto", } var E_Stringer = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 67008, Name: "gogoproto.stringer", Tag: "varint,67008,opt,name=stringer", Filename: "gogo.proto", } var E_Onlyone = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64009, Name: "gogoproto.onlyone", Tag: "varint,64009,opt,name=onlyone", Filename: "gogo.proto", } var E_Equal = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64013, Name: "gogoproto.equal", Tag: "varint,64013,opt,name=equal", Filename: "gogo.proto", } var E_Description = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64014, Name: "gogoproto.description", Tag: "varint,64014,opt,name=description", Filename: "gogo.proto", } var E_Testgen = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64015, Name: "gogoproto.testgen", Tag: "varint,64015,opt,name=testgen", Filename: "gogo.proto", } var E_Benchgen = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64016, Name: "gogoproto.benchgen", Tag: "varint,64016,opt,name=benchgen", Filename: "gogo.proto", } var E_Marshaler = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64017, Name: "gogoproto.marshaler", Tag: "varint,64017,opt,name=marshaler", Filename: "gogo.proto", } var E_Unmarshaler = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64018, Name: "gogoproto.unmarshaler", Tag: "varint,64018,opt,name=unmarshaler", Filename: "gogo.proto", } var E_StableMarshaler = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64019, Name: "gogoproto.stable_marshaler", Tag: "varint,64019,opt,name=stable_marshaler", Filename: "gogo.proto", } var E_Sizer = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64020, Name: "gogoproto.sizer", Tag: "varint,64020,opt,name=sizer", Filename: "gogo.proto", } var E_UnsafeMarshaler = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64023, Name: "gogoproto.unsafe_marshaler", Tag: "varint,64023,opt,name=unsafe_marshaler", Filename: "gogo.proto", } var E_UnsafeUnmarshaler = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64024, Name: "gogoproto.unsafe_unmarshaler", Tag: "varint,64024,opt,name=unsafe_unmarshaler", Filename: "gogo.proto", } var E_GoprotoExtensionsMap = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64025, Name: "gogoproto.goproto_extensions_map", Tag: "varint,64025,opt,name=goproto_extensions_map", Filename: "gogo.proto", } var E_GoprotoUnrecognized = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64026, Name: "gogoproto.goproto_unrecognized", Tag: "varint,64026,opt,name=goproto_unrecognized", Filename: "gogo.proto", } var E_Protosizer = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64028, Name: "gogoproto.protosizer", Tag: "varint,64028,opt,name=protosizer", Filename: "gogo.proto", } var E_Compare = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64029, Name: "gogoproto.compare", Tag: "varint,64029,opt,name=compare", Filename: "gogo.proto", } var E_Typedecl = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64030, Name: "gogoproto.typedecl", Tag: "varint,64030,opt,name=typedecl", Filename: "gogo.proto", } var E_Messagename = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64033, Name: "gogoproto.messagename", Tag: "varint,64033,opt,name=messagename", Filename: "gogo.proto", } var E_GoprotoSizecache = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64034, Name: "gogoproto.goproto_sizecache", Tag: "varint,64034,opt,name=goproto_sizecache", Filename: "gogo.proto", } var E_GoprotoUnkeyed = &proto.ExtensionDesc{ ExtendedType: (*descriptor.MessageOptions)(nil), ExtensionType: (*bool)(nil), Field: 64035, Name: "gogoproto.goproto_unkeyed", Tag: "varint,64035,opt,name=goproto_unkeyed", Filename: "gogo.proto", } var E_Nullable = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 65001, Name: "gogoproto.nullable", Tag: "varint,65001,opt,name=nullable", Filename: "gogo.proto", } var E_Embed = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 65002, Name: "gogoproto.embed", Tag: "varint,65002,opt,name=embed", Filename: "gogo.proto", } var E_Customtype = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65003, Name: "gogoproto.customtype", Tag: "bytes,65003,opt,name=customtype", Filename: "gogo.proto", } var E_Customname = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65004, Name: "gogoproto.customname", Tag: "bytes,65004,opt,name=customname", Filename: "gogo.proto", } var E_Jsontag = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65005, Name: "gogoproto.jsontag", Tag: "bytes,65005,opt,name=jsontag", Filename: "gogo.proto", } var E_Moretags = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65006, Name: "gogoproto.moretags", Tag: "bytes,65006,opt,name=moretags", Filename: "gogo.proto", } var E_Casttype = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65007, Name: "gogoproto.casttype", Tag: "bytes,65007,opt,name=casttype", Filename: "gogo.proto", } var E_Castkey = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65008, Name: "gogoproto.castkey", Tag: "bytes,65008,opt,name=castkey", Filename: "gogo.proto", } var E_Castvalue = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 65009, Name: "gogoproto.castvalue", Tag: "bytes,65009,opt,name=castvalue", Filename: "gogo.proto", } var E_Stdtime = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 65010, Name: "gogoproto.stdtime", Tag: "varint,65010,opt,name=stdtime", Filename: "gogo.proto", } var E_Stdduration = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 65011, Name: "gogoproto.stdduration", Tag: "varint,65011,opt,name=stdduration", Filename: "gogo.proto", } var E_Wktpointer = &proto.ExtensionDesc{ ExtendedType: (*descriptor.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 65012, Name: "gogoproto.wktpointer", Tag: "varint,65012,opt,name=wktpointer", Filename: "gogo.proto", } func init() { proto.RegisterExtension(E_GoprotoEnumPrefix) proto.RegisterExtension(E_GoprotoEnumStringer) proto.RegisterExtension(E_EnumStringer) proto.RegisterExtension(E_EnumCustomname) proto.RegisterExtension(E_Enumdecl) proto.RegisterExtension(E_EnumvalueCustomname) proto.RegisterExtension(E_GoprotoGettersAll) proto.RegisterExtension(E_GoprotoEnumPrefixAll) proto.RegisterExtension(E_GoprotoStringerAll) proto.RegisterExtension(E_VerboseEqualAll) proto.RegisterExtension(E_FaceAll) proto.RegisterExtension(E_GostringAll) proto.RegisterExtension(E_PopulateAll) proto.RegisterExtension(E_StringerAll) proto.RegisterExtension(E_OnlyoneAll) proto.RegisterExtension(E_EqualAll) proto.RegisterExtension(E_DescriptionAll) proto.RegisterExtension(E_TestgenAll) proto.RegisterExtension(E_BenchgenAll) proto.RegisterExtension(E_MarshalerAll) proto.RegisterExtension(E_UnmarshalerAll) proto.RegisterExtension(E_StableMarshalerAll) proto.RegisterExtension(E_SizerAll) proto.RegisterExtension(E_GoprotoEnumStringerAll) proto.RegisterExtension(E_EnumStringerAll) proto.RegisterExtension(E_UnsafeMarshalerAll) proto.RegisterExtension(E_UnsafeUnmarshalerAll) proto.RegisterExtension(E_GoprotoExtensionsMapAll) proto.RegisterExtension(E_GoprotoUnrecognizedAll) proto.RegisterExtension(E_GogoprotoImport) proto.RegisterExtension(E_ProtosizerAll) proto.RegisterExtension(E_CompareAll) proto.RegisterExtension(E_TypedeclAll) proto.RegisterExtension(E_EnumdeclAll) proto.RegisterExtension(E_GoprotoRegistration) proto.RegisterExtension(E_MessagenameAll) proto.RegisterExtension(E_GoprotoSizecacheAll) proto.RegisterExtension(E_GoprotoUnkeyedAll) proto.RegisterExtension(E_GoprotoGetters) proto.RegisterExtension(E_GoprotoStringer) proto.RegisterExtension(E_VerboseEqual) proto.RegisterExtension(E_Face) proto.RegisterExtension(E_Gostring) proto.RegisterExtension(E_Populate) proto.RegisterExtension(E_Stringer) proto.RegisterExtension(E_Onlyone) proto.RegisterExtension(E_Equal) proto.RegisterExtension(E_Description) proto.RegisterExtension(E_Testgen) proto.RegisterExtension(E_Benchgen) proto.RegisterExtension(E_Marshaler) proto.RegisterExtension(E_Unmarshaler) proto.RegisterExtension(E_StableMarshaler) proto.RegisterExtension(E_Sizer) proto.RegisterExtension(E_UnsafeMarshaler) proto.RegisterExtension(E_UnsafeUnmarshaler) proto.RegisterExtension(E_GoprotoExtensionsMap) proto.RegisterExtension(E_GoprotoUnrecognized) proto.RegisterExtension(E_Protosizer) proto.RegisterExtension(E_Compare) proto.RegisterExtension(E_Typedecl) proto.RegisterExtension(E_Messagename) proto.RegisterExtension(E_GoprotoSizecache) proto.RegisterExtension(E_GoprotoUnkeyed) proto.RegisterExtension(E_Nullable) proto.RegisterExtension(E_Embed) proto.RegisterExtension(E_Customtype) proto.RegisterExtension(E_Customname) proto.RegisterExtension(E_Jsontag) proto.RegisterExtension(E_Moretags) proto.RegisterExtension(E_Casttype) proto.RegisterExtension(E_Castkey) proto.RegisterExtension(E_Castvalue) proto.RegisterExtension(E_Stdtime) proto.RegisterExtension(E_Stdduration) proto.RegisterExtension(E_Wktpointer) } func init() { proto.RegisterFile("gogo.proto", fileDescriptor_592445b5231bc2b9) } var fileDescriptor_592445b5231bc2b9 = []byte{ // 1328 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x49, 0x6f, 0x1c, 0x45, 0x14, 0x80, 0x85, 0x48, 0x64, 0x4f, 0x79, 0x8b, 0xc7, 0xc6, 0x84, 0x08, 0x44, 0xe0, 0xc4, 0xc9, 0x3e, 0x45, 0x28, 0x65, 0x45, 0x96, 0x63, 0x39, 0x56, 0x10, 0x0e, 0xc6, 0x89, 0xc3, 0x76, 0x18, 0xf5, 0xf4, 0x94, 0xdb, 0x8d, 0xbb, 0xbb, 0x9a, 0xee, 0xea, 0x10, 0xe7, 0x86, 0xc2, 0x22, 0x84, 0xd8, 0x91, 0x20, 0x21, 0x09, 0x04, 0xc4, 0xbe, 0x86, 0x7d, 0xb9, 0x70, 0x61, 0xb9, 0xf2, 0x1f, 0xb8, 0x00, 0x66, 0xf7, 0xcd, 0x17, 0xf4, 0xba, 0xdf, 0xeb, 0xa9, 0x69, 0x8f, 0x54, 0x35, 0xb7, 0xf6, 0xb8, 0xbe, 0x6f, 0xaa, 0xdf, 0xeb, 0x7a, 0xef, 0x4d, 0x33, 0xe6, 0x49, 0x4f, 0x4e, 0xc6, 0x89, 0x54, 0xb2, 0x5e, 0x83, 0xeb, 0xfc, 0x72, 0xdf, 0x7e, 0x4f, 0x4a, 0x2f, 0x10, 0x53, 0xf9, 0x5f, 0xcd, 0x6c, 0x75, 0xaa, 0x25, 0x52, 0x37, 0xf1, 0x63, 0x25, 0x93, 0x62, 0x31, 0x3f, 0xc6, 0xc6, 0x70, 0x71, 0x43, 0x44, 0x59, 0xd8, 0x88, 0x13, 0xb1, 0xea, 0x9f, 0xae, 0x5f, 0x3f, 0x59, 0x90, 0x93, 0x44, 0x4e, 0xce, 0x47, 0x59, 0x78, 0x47, 0xac, 0x7c, 0x19, 0xa5, 0x7b, 0xaf, 0xfc, 0x72, 0xf5, 0xfe, 0xab, 0x6e, 0xe9, 0x5f, 0x1e, 0x45, 0x14, 0xfe, 0xb7, 0x94, 0x83, 0x7c, 0x99, 0x5d, 0xd3, 0xe1, 0x4b, 0x55, 0xe2, 0x47, 0x9e, 0x48, 0x0c, 0xc6, 0xef, 0xd1, 0x38, 0xa6, 0x19, 0x8f, 0x23, 0xca, 0xe7, 0xd8, 0x50, 0x2f, 0xae, 0x1f, 0xd0, 0x35, 0x28, 0x74, 0xc9, 0x02, 0x1b, 0xc9, 0x25, 0x6e, 0x96, 0x2a, 0x19, 0x46, 0x4e, 0x28, 0x0c, 0x9a, 0x1f, 0x73, 0x4d, 0x6d, 0x79, 0x18, 0xb0, 0xb9, 0x92, 0xe2, 0x9c, 0xf5, 0xc3, 0x27, 0x2d, 0xe1, 0x06, 0x06, 0xc3, 0x4f, 0xb8, 0x91, 0x72, 0x3d, 0x3f, 0xc9, 0xc6, 0xe1, 0xfa, 0x94, 0x13, 0x64, 0x42, 0xdf, 0xc9, 0x4d, 0x5d, 0x3d, 0x27, 0x61, 0x19, 0xc9, 0x7e, 0x3e, 0xbb, 0x2b, 0xdf, 0xce, 0x58, 0x29, 0xd0, 0xf6, 0xa4, 0x65, 0xd1, 0x13, 0x4a, 0x89, 0x24, 0x6d, 0x38, 0x41, 0xb7, 0xed, 0x1d, 0xf1, 0x83, 0xd2, 0x78, 0x6e, 0xb3, 0x33, 0x8b, 0x0b, 0x05, 0x39, 0x1b, 0x04, 0x7c, 0x85, 0x5d, 0xdb, 0xe5, 0xa9, 0xb0, 0x70, 0x9e, 0x47, 0xe7, 0xf8, 0x8e, 0x27, 0x03, 0xb4, 0x4b, 0x8c, 0x3e, 0x2f, 0x73, 0x69, 0xe1, 0x7c, 0x19, 0x9d, 0x75, 0x64, 0x29, 0xa5, 0x60, 0xbc, 0x8d, 0x8d, 0x9e, 0x12, 0x49, 0x53, 0xa6, 0xa2, 0x21, 0x1e, 0xc8, 0x9c, 0xc0, 0x42, 0x77, 0x01, 0x75, 0x23, 0x08, 0xce, 0x03, 0x07, 0xae, 0x83, 0xac, 0x7f, 0xd5, 0x71, 0x85, 0x85, 0xe2, 0x22, 0x2a, 0xfa, 0x60, 0x3d, 0xa0, 0xb3, 0x6c, 0xd0, 0x93, 0xc5, 0x2d, 0x59, 0xe0, 0x97, 0x10, 0x1f, 0x20, 0x06, 0x15, 0xb1, 0x8c, 0xb3, 0xc0, 0x51, 0x36, 0x3b, 0x78, 0x85, 0x14, 0xc4, 0xa0, 0xa2, 0x87, 0xb0, 0xbe, 0x4a, 0x8a, 0x54, 0x8b, 0xe7, 0x0c, 0x1b, 0x90, 0x51, 0xb0, 0x21, 0x23, 0x9b, 0x4d, 0x5c, 0x46, 0x03, 0x43, 0x04, 0x04, 0xd3, 0xac, 0x66, 0x9b, 0x88, 0x37, 0x36, 0xe9, 0x78, 0x50, 0x06, 0x16, 0xd8, 0x08, 0x15, 0x28, 0x5f, 0x46, 0x16, 0x8a, 0x37, 0x51, 0x31, 0xac, 0x61, 0x78, 0x1b, 0x4a, 0xa4, 0xca, 0x13, 0x36, 0x92, 0xb7, 0xe8, 0x36, 0x10, 0xc1, 0x50, 0x36, 0x45, 0xe4, 0xae, 0xd9, 0x19, 0xde, 0xa6, 0x50, 0x12, 0x03, 0x8a, 0x39, 0x36, 0x14, 0x3a, 0x49, 0xba, 0xe6, 0x04, 0x56, 0xe9, 0x78, 0x07, 0x1d, 0x83, 0x25, 0x84, 0x11, 0xc9, 0xa2, 0x5e, 0x34, 0xef, 0x52, 0x44, 0x34, 0x0c, 0x8f, 0x5e, 0xaa, 0x9c, 0x66, 0x20, 0x1a, 0xbd, 0xd8, 0xde, 0xa3, 0xa3, 0x57, 0xb0, 0x8b, 0xba, 0x71, 0x9a, 0xd5, 0x52, 0xff, 0x8c, 0x95, 0xe6, 0x7d, 0xca, 0x74, 0x0e, 0x00, 0x7c, 0x0f, 0xbb, 0xae, 0x6b, 0x9b, 0xb0, 0x90, 0x7d, 0x80, 0xb2, 0x89, 0x2e, 0xad, 0x02, 0x4b, 0x42, 0xaf, 0xca, 0x0f, 0xa9, 0x24, 0x88, 0x8a, 0x6b, 0x89, 0x8d, 0x67, 0x51, 0xea, 0xac, 0xf6, 0x16, 0xb5, 0x8f, 0x28, 0x6a, 0x05, 0xdb, 0x11, 0xb5, 0x13, 0x6c, 0x02, 0x8d, 0xbd, 0xe5, 0xf5, 0x63, 0x2a, 0xac, 0x05, 0xbd, 0xd2, 0x99, 0xdd, 0xfb, 0xd8, 0xbe, 0x32, 0x9c, 0xa7, 0x95, 0x88, 0x52, 0x60, 0x1a, 0xa1, 0x13, 0x5b, 0x98, 0xaf, 0xa0, 0x99, 0x2a, 0xfe, 0x7c, 0x29, 0x58, 0x74, 0x62, 0x90, 0xdf, 0xcd, 0xf6, 0x92, 0x3c, 0x8b, 0x12, 0xe1, 0x4a, 0x2f, 0xf2, 0xcf, 0x88, 0x96, 0x85, 0xfa, 0x93, 0x4a, 0xaa, 0x56, 0x34, 0x1c, 0xcc, 0x47, 0xd9, 0x9e, 0x72, 0x56, 0x69, 0xf8, 0x61, 0x2c, 0x13, 0x65, 0x30, 0x7e, 0x4a, 0x99, 0x2a, 0xb9, 0xa3, 0x39, 0xc6, 0xe7, 0xd9, 0x70, 0xfe, 0xa7, 0xed, 0x23, 0xf9, 0x19, 0x8a, 0x86, 0xda, 0x14, 0x16, 0x0e, 0x57, 0x86, 0xb1, 0x93, 0xd8, 0xd4, 0xbf, 0xcf, 0xa9, 0x70, 0x20, 0x82, 0x85, 0x43, 0x6d, 0xc4, 0x02, 0xba, 0xbd, 0x85, 0xe1, 0x0b, 0x2a, 0x1c, 0xc4, 0xa0, 0x82, 0x06, 0x06, 0x0b, 0xc5, 0x97, 0xa4, 0x20, 0x06, 0x14, 0x77, 0xb6, 0x1b, 0x6d, 0x22, 0x3c, 0x3f, 0x55, 0x89, 0x03, 0xab, 0x0d, 0xaa, 0xaf, 0x36, 0x3b, 0x87, 0xb0, 0x65, 0x0d, 0x85, 0x4a, 0x14, 0x8a, 0x34, 0x75, 0x3c, 0x01, 0x13, 0x87, 0xc5, 0xc6, 0xbe, 0xa6, 0x4a, 0xa4, 0x61, 0xb0, 0x37, 0x6d, 0x42, 0x84, 0xb0, 0xbb, 0x8e, 0xbb, 0x66, 0xa3, 0xfb, 0xa6, 0xb2, 0xb9, 0xe3, 0xc4, 0x82, 0x53, 0x9b, 0x7f, 0xb2, 0x68, 0x5d, 0x6c, 0x58, 0x3d, 0x9d, 0xdf, 0x56, 0xe6, 0x9f, 0x95, 0x82, 0x2c, 0x6a, 0xc8, 0x48, 0x65, 0x9e, 0xaa, 0xdf, 0xb8, 0xc3, 0xb5, 0x58, 0xdc, 0x17, 0xe9, 0x1e, 0xda, 0xc2, 0xfb, 0xed, 0x1c, 0xa7, 0xf8, 0xed, 0xf0, 0x90, 0x77, 0x0e, 0x3d, 0x66, 0xd9, 0xd9, 0xad, 0xf2, 0x39, 0xef, 0x98, 0x79, 0xf8, 0x11, 0x36, 0xd4, 0x31, 0xf0, 0x98, 0x55, 0x0f, 0xa3, 0x6a, 0x50, 0x9f, 0x77, 0xf8, 0x01, 0xb6, 0x0b, 0x86, 0x17, 0x33, 0xfe, 0x08, 0xe2, 0xf9, 0x72, 0x7e, 0x88, 0xf5, 0xd3, 0xd0, 0x62, 0x46, 0x1f, 0x45, 0xb4, 0x44, 0x00, 0xa7, 0x81, 0xc5, 0x8c, 0x3f, 0x46, 0x38, 0x21, 0x80, 0xdb, 0x87, 0xf0, 0xbb, 0x27, 0x76, 0x61, 0xd3, 0xa1, 0xd8, 0x4d, 0xb3, 0x3e, 0x9c, 0x54, 0xcc, 0xf4, 0xe3, 0xf8, 0xe5, 0x44, 0xf0, 0x5b, 0xd9, 0x6e, 0xcb, 0x80, 0x3f, 0x89, 0x68, 0xb1, 0x9e, 0xcf, 0xb1, 0x01, 0x6d, 0x3a, 0x31, 0xe3, 0x4f, 0x21, 0xae, 0x53, 0xb0, 0x75, 0x9c, 0x4e, 0xcc, 0x82, 0xa7, 0x69, 0xeb, 0x48, 0x40, 0xd8, 0x68, 0x30, 0x31, 0xd3, 0xcf, 0x50, 0xd4, 0x09, 0xe1, 0x33, 0xac, 0x56, 0x36, 0x1b, 0x33, 0xff, 0x2c, 0xf2, 0x6d, 0x06, 0x22, 0xa0, 0x35, 0x3b, 0xb3, 0xe2, 0x39, 0x8a, 0x80, 0x46, 0xc1, 0x31, 0xaa, 0x0e, 0x30, 0x66, 0xd3, 0xf3, 0x74, 0x8c, 0x2a, 0xf3, 0x0b, 0x64, 0x33, 0xaf, 0xf9, 0x66, 0xc5, 0x0b, 0x94, 0xcd, 0x7c, 0x3d, 0x6c, 0xa3, 0x3a, 0x11, 0x98, 0x1d, 0x2f, 0xd2, 0x36, 0x2a, 0x03, 0x01, 0x5f, 0x62, 0xf5, 0x9d, 0xd3, 0x80, 0xd9, 0xf7, 0x12, 0xfa, 0x46, 0x77, 0x0c, 0x03, 0xfc, 0x2e, 0x36, 0xd1, 0x7d, 0x12, 0x30, 0x5b, 0xcf, 0x6d, 0x55, 0x7e, 0xbb, 0xe9, 0x83, 0x00, 0x3f, 0xd1, 0x6e, 0x29, 0xfa, 0x14, 0x60, 0xd6, 0x9e, 0xdf, 0xea, 0x2c, 0xdc, 0xfa, 0x10, 0xc0, 0x67, 0x19, 0x6b, 0x37, 0x60, 0xb3, 0xeb, 0x02, 0xba, 0x34, 0x08, 0x8e, 0x06, 0xf6, 0x5f, 0x33, 0x7f, 0x91, 0x8e, 0x06, 0x12, 0x70, 0x34, 0xa8, 0xf5, 0x9a, 0xe9, 0x4b, 0x74, 0x34, 0x08, 0x81, 0x27, 0x5b, 0xeb, 0x6e, 0x66, 0xc3, 0x65, 0x7a, 0xb2, 0x35, 0x8a, 0x1f, 0x63, 0xa3, 0x3b, 0x1a, 0xa2, 0x59, 0xf5, 0x1a, 0xaa, 0xf6, 0x54, 0xfb, 0xa1, 0xde, 0xbc, 0xb0, 0x19, 0x9a, 0x6d, 0xaf, 0x57, 0x9a, 0x17, 0xf6, 0x42, 0x3e, 0xcd, 0xfa, 0xa3, 0x2c, 0x08, 0xe0, 0xf0, 0xd4, 0x6f, 0xe8, 0xd2, 0x4d, 0x45, 0xd0, 0x22, 0xc5, 0xaf, 0xdb, 0x18, 0x1d, 0x02, 0xf8, 0x01, 0xb6, 0x5b, 0x84, 0x4d, 0xd1, 0x32, 0x91, 0xbf, 0x6d, 0x53, 0xc1, 0x84, 0xd5, 0x7c, 0x86, 0xb1, 0xe2, 0xd5, 0x08, 0x84, 0xd9, 0xc4, 0xfe, 0xbe, 0x5d, 0xbc, 0xa5, 0xd1, 0x90, 0xb6, 0x20, 0x4f, 0x8a, 0x41, 0xb0, 0xd9, 0x29, 0xc8, 0x33, 0x72, 0x90, 0xf5, 0xdd, 0x9f, 0xca, 0x48, 0x39, 0x9e, 0x89, 0xfe, 0x03, 0x69, 0x5a, 0x0f, 0x01, 0x0b, 0x65, 0x22, 0x94, 0xe3, 0xa5, 0x26, 0xf6, 0x4f, 0x64, 0x4b, 0x00, 0x60, 0xd7, 0x49, 0x95, 0xcd, 0x7d, 0xff, 0x45, 0x30, 0x01, 0xb0, 0x69, 0xb8, 0x5e, 0x17, 0x1b, 0x26, 0xf6, 0x6f, 0xda, 0x34, 0xae, 0xe7, 0x87, 0x58, 0x0d, 0x2e, 0xf3, 0xb7, 0x4a, 0x26, 0xf8, 0x1f, 0x84, 0xdb, 0x04, 0x7c, 0x73, 0xaa, 0x5a, 0xca, 0x37, 0x07, 0xfb, 0x5f, 0xcc, 0x34, 0xad, 0xe7, 0xb3, 0x6c, 0x20, 0x55, 0xad, 0x56, 0x86, 0xf3, 0xa9, 0x01, 0xff, 0x6f, 0xbb, 0x7c, 0x65, 0x51, 0x32, 0x90, 0xed, 0x07, 0xd7, 0x55, 0x2c, 0xfd, 0x48, 0x89, 0xc4, 0x64, 0xd8, 0x42, 0x83, 0x86, 0x1c, 0x9e, 0x67, 0x63, 0xae, 0x0c, 0xab, 0xdc, 0x61, 0xb6, 0x20, 0x17, 0xe4, 0x52, 0x5e, 0x67, 0xee, 0xbd, 0xd9, 0xf3, 0xd5, 0x5a, 0xd6, 0x9c, 0x74, 0x65, 0x38, 0x05, 0xbf, 0x3c, 0xda, 0x2f, 0x54, 0xcb, 0xdf, 0x21, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xaf, 0x70, 0x4e, 0x83, 0x15, 0x00, 0x00, } ================================================ FILE: vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.golden ================================================ // Code generated by protoc-gen-go. // source: gogo.proto // DO NOT EDIT! package gogoproto import proto "github.com/gogo/protobuf/proto" import json "encoding/json" import math "math" import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" // Reference proto, json, and math imports to suppress error if they are not otherwise used. var _ = proto.Marshal var _ = &json.SyntaxError{} var _ = math.Inf var E_Nullable = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 51235, Name: "gogoproto.nullable", Tag: "varint,51235,opt,name=nullable", } var E_Embed = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*bool)(nil), Field: 51236, Name: "gogoproto.embed", Tag: "varint,51236,opt,name=embed", } var E_Customtype = &proto.ExtensionDesc{ ExtendedType: (*google_protobuf.FieldOptions)(nil), ExtensionType: (*string)(nil), Field: 51237, Name: "gogoproto.customtype", Tag: "bytes,51237,opt,name=customtype", } func init() { proto.RegisterExtension(E_Nullable) proto.RegisterExtension(E_Embed) proto.RegisterExtension(E_Customtype) } ================================================ FILE: vendor/github.com/gogo/protobuf/gogoproto/gogo.proto ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto2"; package gogoproto; import "google/protobuf/descriptor.proto"; option java_package = "com.google.protobuf"; option java_outer_classname = "GoGoProtos"; option go_package = "github.com/gogo/protobuf/gogoproto"; extend google.protobuf.EnumOptions { optional bool goproto_enum_prefix = 62001; optional bool goproto_enum_stringer = 62021; optional bool enum_stringer = 62022; optional string enum_customname = 62023; optional bool enumdecl = 62024; } extend google.protobuf.EnumValueOptions { optional string enumvalue_customname = 66001; } extend google.protobuf.FileOptions { optional bool goproto_getters_all = 63001; optional bool goproto_enum_prefix_all = 63002; optional bool goproto_stringer_all = 63003; optional bool verbose_equal_all = 63004; optional bool face_all = 63005; optional bool gostring_all = 63006; optional bool populate_all = 63007; optional bool stringer_all = 63008; optional bool onlyone_all = 63009; optional bool equal_all = 63013; optional bool description_all = 63014; optional bool testgen_all = 63015; optional bool benchgen_all = 63016; optional bool marshaler_all = 63017; optional bool unmarshaler_all = 63018; optional bool stable_marshaler_all = 63019; optional bool sizer_all = 63020; optional bool goproto_enum_stringer_all = 63021; optional bool enum_stringer_all = 63022; optional bool unsafe_marshaler_all = 63023; optional bool unsafe_unmarshaler_all = 63024; optional bool goproto_extensions_map_all = 63025; optional bool goproto_unrecognized_all = 63026; optional bool gogoproto_import = 63027; optional bool protosizer_all = 63028; optional bool compare_all = 63029; optional bool typedecl_all = 63030; optional bool enumdecl_all = 63031; optional bool goproto_registration = 63032; optional bool messagename_all = 63033; optional bool goproto_sizecache_all = 63034; optional bool goproto_unkeyed_all = 63035; } extend google.protobuf.MessageOptions { optional bool goproto_getters = 64001; optional bool goproto_stringer = 64003; optional bool verbose_equal = 64004; optional bool face = 64005; optional bool gostring = 64006; optional bool populate = 64007; optional bool stringer = 67008; optional bool onlyone = 64009; optional bool equal = 64013; optional bool description = 64014; optional bool testgen = 64015; optional bool benchgen = 64016; optional bool marshaler = 64017; optional bool unmarshaler = 64018; optional bool stable_marshaler = 64019; optional bool sizer = 64020; optional bool unsafe_marshaler = 64023; optional bool unsafe_unmarshaler = 64024; optional bool goproto_extensions_map = 64025; optional bool goproto_unrecognized = 64026; optional bool protosizer = 64028; optional bool compare = 64029; optional bool typedecl = 64030; optional bool messagename = 64033; optional bool goproto_sizecache = 64034; optional bool goproto_unkeyed = 64035; } extend google.protobuf.FieldOptions { optional bool nullable = 65001; optional bool embed = 65002; optional string customtype = 65003; optional string customname = 65004; optional string jsontag = 65005; optional string moretags = 65006; optional string casttype = 65007; optional string castkey = 65008; optional string castvalue = 65009; optional bool stdtime = 65010; optional bool stdduration = 65011; optional bool wktpointer = 65012; } ================================================ FILE: vendor/github.com/gogo/protobuf/gogoproto/helper.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package gogoproto import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" import proto "github.com/gogo/protobuf/proto" func IsEmbed(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Embed, false) } func IsNullable(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Nullable, true) } func IsStdTime(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Stdtime, false) } func IsStdDuration(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Stdduration, false) } func IsStdDouble(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.DoubleValue" } func IsStdFloat(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.FloatValue" } func IsStdInt64(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.Int64Value" } func IsStdUInt64(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.UInt64Value" } func IsStdInt32(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.Int32Value" } func IsStdUInt32(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.UInt32Value" } func IsStdBool(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.BoolValue" } func IsStdString(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.StringValue" } func IsStdBytes(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Wktpointer, false) && *field.TypeName == ".google.protobuf.BytesValue" } func IsStdType(field *google_protobuf.FieldDescriptorProto) bool { return (IsStdTime(field) || IsStdDuration(field) || IsStdDouble(field) || IsStdFloat(field) || IsStdInt64(field) || IsStdUInt64(field) || IsStdInt32(field) || IsStdUInt32(field) || IsStdBool(field) || IsStdString(field) || IsStdBytes(field)) } func IsWktPtr(field *google_protobuf.FieldDescriptorProto) bool { return proto.GetBoolExtension(field.Options, E_Wktpointer, false) } func NeedsNilCheck(proto3 bool, field *google_protobuf.FieldDescriptorProto) bool { nullable := IsNullable(field) if field.IsMessage() || IsCustomType(field) { return nullable } if proto3 { return false } return nullable || *field.Type == google_protobuf.FieldDescriptorProto_TYPE_BYTES } func IsCustomType(field *google_protobuf.FieldDescriptorProto) bool { typ := GetCustomType(field) if len(typ) > 0 { return true } return false } func IsCastType(field *google_protobuf.FieldDescriptorProto) bool { typ := GetCastType(field) if len(typ) > 0 { return true } return false } func IsCastKey(field *google_protobuf.FieldDescriptorProto) bool { typ := GetCastKey(field) if len(typ) > 0 { return true } return false } func IsCastValue(field *google_protobuf.FieldDescriptorProto) bool { typ := GetCastValue(field) if len(typ) > 0 { return true } return false } func HasEnumDecl(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { return proto.GetBoolExtension(enum.Options, E_Enumdecl, proto.GetBoolExtension(file.Options, E_EnumdeclAll, true)) } func HasTypeDecl(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Typedecl, proto.GetBoolExtension(file.Options, E_TypedeclAll, true)) } func GetCustomType(field *google_protobuf.FieldDescriptorProto) string { if field == nil { return "" } if field.Options != nil { v, err := proto.GetExtension(field.Options, E_Customtype) if err == nil && v.(*string) != nil { return *(v.(*string)) } } return "" } func GetCastType(field *google_protobuf.FieldDescriptorProto) string { if field == nil { return "" } if field.Options != nil { v, err := proto.GetExtension(field.Options, E_Casttype) if err == nil && v.(*string) != nil { return *(v.(*string)) } } return "" } func GetCastKey(field *google_protobuf.FieldDescriptorProto) string { if field == nil { return "" } if field.Options != nil { v, err := proto.GetExtension(field.Options, E_Castkey) if err == nil && v.(*string) != nil { return *(v.(*string)) } } return "" } func GetCastValue(field *google_protobuf.FieldDescriptorProto) string { if field == nil { return "" } if field.Options != nil { v, err := proto.GetExtension(field.Options, E_Castvalue) if err == nil && v.(*string) != nil { return *(v.(*string)) } } return "" } func IsCustomName(field *google_protobuf.FieldDescriptorProto) bool { name := GetCustomName(field) if len(name) > 0 { return true } return false } func IsEnumCustomName(field *google_protobuf.EnumDescriptorProto) bool { name := GetEnumCustomName(field) if len(name) > 0 { return true } return false } func IsEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) bool { name := GetEnumValueCustomName(field) if len(name) > 0 { return true } return false } func GetCustomName(field *google_protobuf.FieldDescriptorProto) string { if field == nil { return "" } if field.Options != nil { v, err := proto.GetExtension(field.Options, E_Customname) if err == nil && v.(*string) != nil { return *(v.(*string)) } } return "" } func GetEnumCustomName(field *google_protobuf.EnumDescriptorProto) string { if field == nil { return "" } if field.Options != nil { v, err := proto.GetExtension(field.Options, E_EnumCustomname) if err == nil && v.(*string) != nil { return *(v.(*string)) } } return "" } func GetEnumValueCustomName(field *google_protobuf.EnumValueDescriptorProto) string { if field == nil { return "" } if field.Options != nil { v, err := proto.GetExtension(field.Options, E_EnumvalueCustomname) if err == nil && v.(*string) != nil { return *(v.(*string)) } } return "" } func GetJsonTag(field *google_protobuf.FieldDescriptorProto) *string { if field == nil { return nil } if field.Options != nil { v, err := proto.GetExtension(field.Options, E_Jsontag) if err == nil && v.(*string) != nil { return (v.(*string)) } } return nil } func GetMoreTags(field *google_protobuf.FieldDescriptorProto) *string { if field == nil { return nil } if field.Options != nil { v, err := proto.GetExtension(field.Options, E_Moretags) if err == nil && v.(*string) != nil { return (v.(*string)) } } return nil } type EnableFunc func(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool func EnabledGoEnumPrefix(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { return proto.GetBoolExtension(enum.Options, E_GoprotoEnumPrefix, proto.GetBoolExtension(file.Options, E_GoprotoEnumPrefixAll, true)) } func EnabledGoStringer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_GoprotoStringer, proto.GetBoolExtension(file.Options, E_GoprotoStringerAll, true)) } func HasGoGetters(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_GoprotoGetters, proto.GetBoolExtension(file.Options, E_GoprotoGettersAll, true)) } func IsUnion(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Onlyone, proto.GetBoolExtension(file.Options, E_OnlyoneAll, false)) } func HasGoString(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Gostring, proto.GetBoolExtension(file.Options, E_GostringAll, false)) } func HasEqual(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Equal, proto.GetBoolExtension(file.Options, E_EqualAll, false)) } func HasVerboseEqual(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_VerboseEqual, proto.GetBoolExtension(file.Options, E_VerboseEqualAll, false)) } func IsStringer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Stringer, proto.GetBoolExtension(file.Options, E_StringerAll, false)) } func IsFace(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Face, proto.GetBoolExtension(file.Options, E_FaceAll, false)) } func HasDescription(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Description, proto.GetBoolExtension(file.Options, E_DescriptionAll, false)) } func HasPopulate(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Populate, proto.GetBoolExtension(file.Options, E_PopulateAll, false)) } func HasTestGen(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Testgen, proto.GetBoolExtension(file.Options, E_TestgenAll, false)) } func HasBenchGen(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Benchgen, proto.GetBoolExtension(file.Options, E_BenchgenAll, false)) } func IsMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Marshaler, proto.GetBoolExtension(file.Options, E_MarshalerAll, false)) } func IsUnmarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Unmarshaler, proto.GetBoolExtension(file.Options, E_UnmarshalerAll, false)) } func IsStableMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_StableMarshaler, proto.GetBoolExtension(file.Options, E_StableMarshalerAll, false)) } func IsSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Sizer, proto.GetBoolExtension(file.Options, E_SizerAll, false)) } func IsProtoSizer(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Protosizer, proto.GetBoolExtension(file.Options, E_ProtosizerAll, false)) } func IsGoEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { return proto.GetBoolExtension(enum.Options, E_GoprotoEnumStringer, proto.GetBoolExtension(file.Options, E_GoprotoEnumStringerAll, true)) } func IsEnumStringer(file *google_protobuf.FileDescriptorProto, enum *google_protobuf.EnumDescriptorProto) bool { return proto.GetBoolExtension(enum.Options, E_EnumStringer, proto.GetBoolExtension(file.Options, E_EnumStringerAll, false)) } func IsUnsafeMarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_UnsafeMarshaler, proto.GetBoolExtension(file.Options, E_UnsafeMarshalerAll, false)) } func IsUnsafeUnmarshaler(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_UnsafeUnmarshaler, proto.GetBoolExtension(file.Options, E_UnsafeUnmarshalerAll, false)) } func HasExtensionsMap(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_GoprotoExtensionsMap, proto.GetBoolExtension(file.Options, E_GoprotoExtensionsMapAll, true)) } func HasUnrecognized(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_GoprotoUnrecognized, proto.GetBoolExtension(file.Options, E_GoprotoUnrecognizedAll, true)) } func IsProto3(file *google_protobuf.FileDescriptorProto) bool { return file.GetSyntax() == "proto3" } func ImportsGoGoProto(file *google_protobuf.FileDescriptorProto) bool { return proto.GetBoolExtension(file.Options, E_GogoprotoImport, true) } func HasCompare(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Compare, proto.GetBoolExtension(file.Options, E_CompareAll, false)) } func RegistersGolangProto(file *google_protobuf.FileDescriptorProto) bool { return proto.GetBoolExtension(file.Options, E_GoprotoRegistration, false) } func HasMessageName(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_Messagename, proto.GetBoolExtension(file.Options, E_MessagenameAll, false)) } func HasSizecache(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_GoprotoSizecache, proto.GetBoolExtension(file.Options, E_GoprotoSizecacheAll, true)) } func HasUnkeyed(file *google_protobuf.FileDescriptorProto, message *google_protobuf.DescriptorProto) bool { return proto.GetBoolExtension(message.Options, E_GoprotoUnkeyed, proto.GetBoolExtension(file.Options, E_GoprotoUnkeyedAll, true)) } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/Makefile ================================================ # Go support for Protocol Buffers - Google's data interchange format # # Copyright 2010 The Go Authors. All rights reserved. # https://github.com/golang/protobuf # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. install: go install test: install generate-test-pbs go test generate-test-pbs: make install make -C test_proto make -C proto3_proto make ================================================ FILE: vendor/github.com/gogo/protobuf/proto/clone.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2011 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Protocol buffer deep copy and merge. // TODO: RawMessage. package proto import ( "fmt" "log" "reflect" "strings" ) // Clone returns a deep copy of a protocol buffer. func Clone(src Message) Message { in := reflect.ValueOf(src) if in.IsNil() { return src } out := reflect.New(in.Type().Elem()) dst := out.Interface().(Message) Merge(dst, src) return dst } // Merger is the interface representing objects that can merge messages of the same type. type Merger interface { // Merge merges src into this message. // Required and optional fields that are set in src will be set to that value in dst. // Elements of repeated fields will be appended. // // Merge may panic if called with a different argument type than the receiver. Merge(src Message) } // generatedMerger is the custom merge method that generated protos will have. // We must add this method since a generate Merge method will conflict with // many existing protos that have a Merge data field already defined. type generatedMerger interface { XXX_Merge(src Message) } // Merge merges src into dst. // Required and optional fields that are set in src will be set to that value in dst. // Elements of repeated fields will be appended. // Merge panics if src and dst are not the same type, or if dst is nil. func Merge(dst, src Message) { if m, ok := dst.(Merger); ok { m.Merge(src) return } in := reflect.ValueOf(src) out := reflect.ValueOf(dst) if out.IsNil() { panic("proto: nil destination") } if in.Type() != out.Type() { panic(fmt.Sprintf("proto.Merge(%T, %T) type mismatch", dst, src)) } if in.IsNil() { return // Merge from nil src is a noop } if m, ok := dst.(generatedMerger); ok { m.XXX_Merge(src) return } mergeStruct(out.Elem(), in.Elem()) } func mergeStruct(out, in reflect.Value) { sprop := GetProperties(in.Type()) for i := 0; i < in.NumField(); i++ { f := in.Type().Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } mergeAny(out.Field(i), in.Field(i), false, sprop.Prop[i]) } if emIn, ok := in.Addr().Interface().(extensionsBytes); ok { emOut := out.Addr().Interface().(extensionsBytes) bIn := emIn.GetExtensions() bOut := emOut.GetExtensions() *bOut = append(*bOut, *bIn...) } else if emIn, err := extendable(in.Addr().Interface()); err == nil { emOut, _ := extendable(out.Addr().Interface()) mIn, muIn := emIn.extensionsRead() if mIn != nil { mOut := emOut.extensionsWrite() muIn.Lock() mergeExtension(mOut, mIn) muIn.Unlock() } } uf := in.FieldByName("XXX_unrecognized") if !uf.IsValid() { return } uin := uf.Bytes() if len(uin) > 0 { out.FieldByName("XXX_unrecognized").SetBytes(append([]byte(nil), uin...)) } } // mergeAny performs a merge between two values of the same type. // viaPtr indicates whether the values were indirected through a pointer (implying proto2). // prop is set if this is a struct field (it may be nil). func mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) { if in.Type() == protoMessageType { if !in.IsNil() { if out.IsNil() { out.Set(reflect.ValueOf(Clone(in.Interface().(Message)))) } else { Merge(out.Interface().(Message), in.Interface().(Message)) } } return } switch in.Kind() { case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, reflect.String, reflect.Uint32, reflect.Uint64: if !viaPtr && isProto3Zero(in) { return } out.Set(in) case reflect.Interface: // Probably a oneof field; copy non-nil values. if in.IsNil() { return } // Allocate destination if it is not set, or set to a different type. // Otherwise we will merge as normal. if out.IsNil() || out.Elem().Type() != in.Elem().Type() { out.Set(reflect.New(in.Elem().Elem().Type())) // interface -> *T -> T -> new(T) } mergeAny(out.Elem(), in.Elem(), false, nil) case reflect.Map: if in.Len() == 0 { return } if out.IsNil() { out.Set(reflect.MakeMap(in.Type())) } // For maps with value types of *T or []byte we need to deep copy each value. elemKind := in.Type().Elem().Kind() for _, key := range in.MapKeys() { var val reflect.Value switch elemKind { case reflect.Ptr: val = reflect.New(in.Type().Elem().Elem()) mergeAny(val, in.MapIndex(key), false, nil) case reflect.Slice: val = in.MapIndex(key) val = reflect.ValueOf(append([]byte{}, val.Bytes()...)) default: val = in.MapIndex(key) } out.SetMapIndex(key, val) } case reflect.Ptr: if in.IsNil() { return } if out.IsNil() { out.Set(reflect.New(in.Elem().Type())) } mergeAny(out.Elem(), in.Elem(), true, nil) case reflect.Slice: if in.IsNil() { return } if in.Type().Elem().Kind() == reflect.Uint8 { // []byte is a scalar bytes field, not a repeated field. // Edge case: if this is in a proto3 message, a zero length // bytes field is considered the zero value, and should not // be merged. if prop != nil && prop.proto3 && in.Len() == 0 { return } // Make a deep copy. // Append to []byte{} instead of []byte(nil) so that we never end up // with a nil result. out.SetBytes(append([]byte{}, in.Bytes()...)) return } n := in.Len() if out.IsNil() { out.Set(reflect.MakeSlice(in.Type(), 0, n)) } switch in.Type().Elem().Kind() { case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, reflect.String, reflect.Uint32, reflect.Uint64: out.Set(reflect.AppendSlice(out, in)) default: for i := 0; i < n; i++ { x := reflect.Indirect(reflect.New(in.Type().Elem())) mergeAny(x, in.Index(i), false, nil) out.Set(reflect.Append(out, x)) } } case reflect.Struct: mergeStruct(out, in) default: // unknown type, so not a protocol buffer log.Printf("proto: don't know how to copy %v", in) } } func mergeExtension(out, in map[int32]Extension) { for extNum, eIn := range in { eOut := Extension{desc: eIn.desc} if eIn.value != nil { v := reflect.New(reflect.TypeOf(eIn.value)).Elem() mergeAny(v, reflect.ValueOf(eIn.value), false, nil) eOut.value = v.Interface() } if eIn.enc != nil { eOut.enc = make([]byte, len(eIn.enc)) copy(eOut.enc, eIn.enc) } out[extNum] = eOut } } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/custom_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2018, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import "reflect" type custom interface { Marshal() ([]byte, error) Unmarshal(data []byte) error Size() int } var customType = reflect.TypeOf((*custom)(nil)).Elem() ================================================ FILE: vendor/github.com/gogo/protobuf/proto/decode.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto /* * Routines for decoding protocol buffer data to construct in-memory representations. */ import ( "errors" "fmt" "io" ) // errOverflow is returned when an integer is too large to be represented. var errOverflow = errors.New("proto: integer overflow") // ErrInternalBadWireType is returned by generated code when an incorrect // wire type is encountered. It does not get returned to user code. var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof") // DecodeVarint reads a varint-encoded integer from the slice. // It returns the integer and the number of bytes consumed, or // zero if there is not enough. // This is the format for the // int32, int64, uint32, uint64, bool, and enum // protocol buffer types. func DecodeVarint(buf []byte) (x uint64, n int) { for shift := uint(0); shift < 64; shift += 7 { if n >= len(buf) { return 0, 0 } b := uint64(buf[n]) n++ x |= (b & 0x7F) << shift if (b & 0x80) == 0 { return x, n } } // The number is too large to represent in a 64-bit value. return 0, 0 } func (p *Buffer) decodeVarintSlow() (x uint64, err error) { i := p.index l := len(p.buf) for shift := uint(0); shift < 64; shift += 7 { if i >= l { err = io.ErrUnexpectedEOF return } b := p.buf[i] i++ x |= (uint64(b) & 0x7F) << shift if b < 0x80 { p.index = i return } } // The number is too large to represent in a 64-bit value. err = errOverflow return } // DecodeVarint reads a varint-encoded integer from the Buffer. // This is the format for the // int32, int64, uint32, uint64, bool, and enum // protocol buffer types. func (p *Buffer) DecodeVarint() (x uint64, err error) { i := p.index buf := p.buf if i >= len(buf) { return 0, io.ErrUnexpectedEOF } else if buf[i] < 0x80 { p.index++ return uint64(buf[i]), nil } else if len(buf)-i < 10 { return p.decodeVarintSlow() } var b uint64 // we already checked the first byte x = uint64(buf[i]) - 0x80 i++ b = uint64(buf[i]) i++ x += b << 7 if b&0x80 == 0 { goto done } x -= 0x80 << 7 b = uint64(buf[i]) i++ x += b << 14 if b&0x80 == 0 { goto done } x -= 0x80 << 14 b = uint64(buf[i]) i++ x += b << 21 if b&0x80 == 0 { goto done } x -= 0x80 << 21 b = uint64(buf[i]) i++ x += b << 28 if b&0x80 == 0 { goto done } x -= 0x80 << 28 b = uint64(buf[i]) i++ x += b << 35 if b&0x80 == 0 { goto done } x -= 0x80 << 35 b = uint64(buf[i]) i++ x += b << 42 if b&0x80 == 0 { goto done } x -= 0x80 << 42 b = uint64(buf[i]) i++ x += b << 49 if b&0x80 == 0 { goto done } x -= 0x80 << 49 b = uint64(buf[i]) i++ x += b << 56 if b&0x80 == 0 { goto done } x -= 0x80 << 56 b = uint64(buf[i]) i++ x += b << 63 if b&0x80 == 0 { goto done } return 0, errOverflow done: p.index = i return x, nil } // DecodeFixed64 reads a 64-bit integer from the Buffer. // This is the format for the // fixed64, sfixed64, and double protocol buffer types. func (p *Buffer) DecodeFixed64() (x uint64, err error) { // x, err already 0 i := p.index + 8 if i < 0 || i > len(p.buf) { err = io.ErrUnexpectedEOF return } p.index = i x = uint64(p.buf[i-8]) x |= uint64(p.buf[i-7]) << 8 x |= uint64(p.buf[i-6]) << 16 x |= uint64(p.buf[i-5]) << 24 x |= uint64(p.buf[i-4]) << 32 x |= uint64(p.buf[i-3]) << 40 x |= uint64(p.buf[i-2]) << 48 x |= uint64(p.buf[i-1]) << 56 return } // DecodeFixed32 reads a 32-bit integer from the Buffer. // This is the format for the // fixed32, sfixed32, and float protocol buffer types. func (p *Buffer) DecodeFixed32() (x uint64, err error) { // x, err already 0 i := p.index + 4 if i < 0 || i > len(p.buf) { err = io.ErrUnexpectedEOF return } p.index = i x = uint64(p.buf[i-4]) x |= uint64(p.buf[i-3]) << 8 x |= uint64(p.buf[i-2]) << 16 x |= uint64(p.buf[i-1]) << 24 return } // DecodeZigzag64 reads a zigzag-encoded 64-bit integer // from the Buffer. // This is the format used for the sint64 protocol buffer type. func (p *Buffer) DecodeZigzag64() (x uint64, err error) { x, err = p.DecodeVarint() if err != nil { return } x = (x >> 1) ^ uint64((int64(x&1)<<63)>>63) return } // DecodeZigzag32 reads a zigzag-encoded 32-bit integer // from the Buffer. // This is the format used for the sint32 protocol buffer type. func (p *Buffer) DecodeZigzag32() (x uint64, err error) { x, err = p.DecodeVarint() if err != nil { return } x = uint64((uint32(x) >> 1) ^ uint32((int32(x&1)<<31)>>31)) return } // DecodeRawBytes reads a count-delimited byte buffer from the Buffer. // This is the format used for the bytes protocol buffer // type and for embedded messages. func (p *Buffer) DecodeRawBytes(alloc bool) (buf []byte, err error) { n, err := p.DecodeVarint() if err != nil { return nil, err } nb := int(n) if nb < 0 { return nil, fmt.Errorf("proto: bad byte length %d", nb) } end := p.index + nb if end < p.index || end > len(p.buf) { return nil, io.ErrUnexpectedEOF } if !alloc { // todo: check if can get more uses of alloc=false buf = p.buf[p.index:end] p.index += nb return } buf = make([]byte, nb) copy(buf, p.buf[p.index:]) p.index += nb return } // DecodeStringBytes reads an encoded string from the Buffer. // This is the format used for the proto2 string type. func (p *Buffer) DecodeStringBytes() (s string, err error) { buf, err := p.DecodeRawBytes(false) if err != nil { return } return string(buf), nil } // Unmarshaler is the interface representing objects that can // unmarshal themselves. The argument points to data that may be // overwritten, so implementations should not keep references to the // buffer. // Unmarshal implementations should not clear the receiver. // Any unmarshaled data should be merged into the receiver. // Callers of Unmarshal that do not want to retain existing data // should Reset the receiver before calling Unmarshal. type Unmarshaler interface { Unmarshal([]byte) error } // newUnmarshaler is the interface representing objects that can // unmarshal themselves. The semantics are identical to Unmarshaler. // // This exists to support protoc-gen-go generated messages. // The proto package will stop type-asserting to this interface in the future. // // DO NOT DEPEND ON THIS. type newUnmarshaler interface { XXX_Unmarshal([]byte) error } // Unmarshal parses the protocol buffer representation in buf and places the // decoded result in pb. If the struct underlying pb does not match // the data in buf, the results can be unpredictable. // // Unmarshal resets pb before starting to unmarshal, so any // existing data in pb is always removed. Use UnmarshalMerge // to preserve and append to existing data. func Unmarshal(buf []byte, pb Message) error { pb.Reset() if u, ok := pb.(newUnmarshaler); ok { return u.XXX_Unmarshal(buf) } if u, ok := pb.(Unmarshaler); ok { return u.Unmarshal(buf) } return NewBuffer(buf).Unmarshal(pb) } // UnmarshalMerge parses the protocol buffer representation in buf and // writes the decoded result to pb. If the struct underlying pb does not match // the data in buf, the results can be unpredictable. // // UnmarshalMerge merges into existing data in pb. // Most code should use Unmarshal instead. func UnmarshalMerge(buf []byte, pb Message) error { if u, ok := pb.(newUnmarshaler); ok { return u.XXX_Unmarshal(buf) } if u, ok := pb.(Unmarshaler); ok { // NOTE: The history of proto have unfortunately been inconsistent // whether Unmarshaler should or should not implicitly clear itself. // Some implementations do, most do not. // Thus, calling this here may or may not do what people want. // // See https://github.com/golang/protobuf/issues/424 return u.Unmarshal(buf) } return NewBuffer(buf).Unmarshal(pb) } // DecodeMessage reads a count-delimited message from the Buffer. func (p *Buffer) DecodeMessage(pb Message) error { enc, err := p.DecodeRawBytes(false) if err != nil { return err } return NewBuffer(enc).Unmarshal(pb) } // DecodeGroup reads a tag-delimited group from the Buffer. // StartGroup tag is already consumed. This function consumes // EndGroup tag. func (p *Buffer) DecodeGroup(pb Message) error { b := p.buf[p.index:] x, y := findEndGroup(b) if x < 0 { return io.ErrUnexpectedEOF } err := Unmarshal(b[:x], pb) p.index += y return err } // Unmarshal parses the protocol buffer representation in the // Buffer and places the decoded result in pb. If the struct // underlying pb does not match the data in the buffer, the results can be // unpredictable. // // Unlike proto.Unmarshal, this does not reset pb before starting to unmarshal. func (p *Buffer) Unmarshal(pb Message) error { // If the object can unmarshal itself, let it. if u, ok := pb.(newUnmarshaler); ok { err := u.XXX_Unmarshal(p.buf[p.index:]) p.index = len(p.buf) return err } if u, ok := pb.(Unmarshaler); ok { // NOTE: The history of proto have unfortunately been inconsistent // whether Unmarshaler should or should not implicitly clear itself. // Some implementations do, most do not. // Thus, calling this here may or may not do what people want. // // See https://github.com/golang/protobuf/issues/424 err := u.Unmarshal(p.buf[p.index:]) p.index = len(p.buf) return err } // Slow workaround for messages that aren't Unmarshalers. // This includes some hand-coded .pb.go files and // bootstrap protos. // TODO: fix all of those and then add Unmarshal to // the Message interface. Then: // The cast above and code below can be deleted. // The old unmarshaler can be deleted. // Clients can call Unmarshal directly (can already do that, actually). var info InternalMessageInfo err := info.Unmarshal(pb, p.buf[p.index:]) p.index = len(p.buf) return err } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/deprecated.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2018 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import "errors" // Deprecated: do not use. type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 } // Deprecated: do not use. func GetStats() Stats { return Stats{} } // Deprecated: do not use. func MarshalMessageSet(interface{}) ([]byte, error) { return nil, errors.New("proto: not implemented") } // Deprecated: do not use. func UnmarshalMessageSet([]byte, interface{}) error { return errors.New("proto: not implemented") } // Deprecated: do not use. func MarshalMessageSetJSON(interface{}) ([]byte, error) { return nil, errors.New("proto: not implemented") } // Deprecated: do not use. func UnmarshalMessageSetJSON([]byte, interface{}) error { return errors.New("proto: not implemented") } // Deprecated: do not use. func RegisterMessageSetType(Message, int32, string) {} ================================================ FILE: vendor/github.com/gogo/protobuf/proto/discard.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2017 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "fmt" "reflect" "strings" "sync" "sync/atomic" ) type generatedDiscarder interface { XXX_DiscardUnknown() } // DiscardUnknown recursively discards all unknown fields from this message // and all embedded messages. // // When unmarshaling a message with unrecognized fields, the tags and values // of such fields are preserved in the Message. This allows a later call to // marshal to be able to produce a message that continues to have those // unrecognized fields. To avoid this, DiscardUnknown is used to // explicitly clear the unknown fields after unmarshaling. // // For proto2 messages, the unknown fields of message extensions are only // discarded from messages that have been accessed via GetExtension. func DiscardUnknown(m Message) { if m, ok := m.(generatedDiscarder); ok { m.XXX_DiscardUnknown() return } // TODO: Dynamically populate a InternalMessageInfo for legacy messages, // but the master branch has no implementation for InternalMessageInfo, // so it would be more work to replicate that approach. discardLegacy(m) } // DiscardUnknown recursively discards all unknown fields. func (a *InternalMessageInfo) DiscardUnknown(m Message) { di := atomicLoadDiscardInfo(&a.discard) if di == nil { di = getDiscardInfo(reflect.TypeOf(m).Elem()) atomicStoreDiscardInfo(&a.discard, di) } di.discard(toPointer(&m)) } type discardInfo struct { typ reflect.Type initialized int32 // 0: only typ is valid, 1: everything is valid lock sync.Mutex fields []discardFieldInfo unrecognized field } type discardFieldInfo struct { field field // Offset of field, guaranteed to be valid discard func(src pointer) } var ( discardInfoMap = map[reflect.Type]*discardInfo{} discardInfoLock sync.Mutex ) func getDiscardInfo(t reflect.Type) *discardInfo { discardInfoLock.Lock() defer discardInfoLock.Unlock() di := discardInfoMap[t] if di == nil { di = &discardInfo{typ: t} discardInfoMap[t] = di } return di } func (di *discardInfo) discard(src pointer) { if src.isNil() { return // Nothing to do. } if atomic.LoadInt32(&di.initialized) == 0 { di.computeDiscardInfo() } for _, fi := range di.fields { sfp := src.offset(fi.field) fi.discard(sfp) } // For proto2 messages, only discard unknown fields in message extensions // that have been accessed via GetExtension. if em, err := extendable(src.asPointerTo(di.typ).Interface()); err == nil { // Ignore lock since DiscardUnknown is not concurrency safe. emm, _ := em.extensionsRead() for _, mx := range emm { if m, ok := mx.value.(Message); ok { DiscardUnknown(m) } } } if di.unrecognized.IsValid() { *src.offset(di.unrecognized).toBytes() = nil } } func (di *discardInfo) computeDiscardInfo() { di.lock.Lock() defer di.lock.Unlock() if di.initialized != 0 { return } t := di.typ n := t.NumField() for i := 0; i < n; i++ { f := t.Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } dfi := discardFieldInfo{field: toField(&f)} tf := f.Type // Unwrap tf to get its most basic type. var isPointer, isSlice bool if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 { isSlice = true tf = tf.Elem() } if tf.Kind() == reflect.Ptr { isPointer = true tf = tf.Elem() } if isPointer && isSlice && tf.Kind() != reflect.Struct { panic(fmt.Sprintf("%v.%s cannot be a slice of pointers to primitive types", t, f.Name)) } switch tf.Kind() { case reflect.Struct: switch { case !isPointer: panic(fmt.Sprintf("%v.%s cannot be a direct struct value", t, f.Name)) case isSlice: // E.g., []*pb.T discardInfo := getDiscardInfo(tf) dfi.discard = func(src pointer) { sps := src.getPointerSlice() for _, sp := range sps { if !sp.isNil() { discardInfo.discard(sp) } } } default: // E.g., *pb.T discardInfo := getDiscardInfo(tf) dfi.discard = func(src pointer) { sp := src.getPointer() if !sp.isNil() { discardInfo.discard(sp) } } } case reflect.Map: switch { case isPointer || isSlice: panic(fmt.Sprintf("%v.%s cannot be a pointer to a map or a slice of map values", t, f.Name)) default: // E.g., map[K]V if tf.Elem().Kind() == reflect.Ptr { // Proto struct (e.g., *T) dfi.discard = func(src pointer) { sm := src.asPointerTo(tf).Elem() if sm.Len() == 0 { return } for _, key := range sm.MapKeys() { val := sm.MapIndex(key) DiscardUnknown(val.Interface().(Message)) } } } else { dfi.discard = func(pointer) {} // Noop } } case reflect.Interface: // Must be oneof field. switch { case isPointer || isSlice: panic(fmt.Sprintf("%v.%s cannot be a pointer to a interface or a slice of interface values", t, f.Name)) default: // E.g., interface{} // TODO: Make this faster? dfi.discard = func(src pointer) { su := src.asPointerTo(tf).Elem() if !su.IsNil() { sv := su.Elem().Elem().Field(0) if sv.Kind() == reflect.Ptr && sv.IsNil() { return } switch sv.Type().Kind() { case reflect.Ptr: // Proto struct (e.g., *T) DiscardUnknown(sv.Interface().(Message)) } } } } default: continue } di.fields = append(di.fields, dfi) } di.unrecognized = invalidField if f, ok := t.FieldByName("XXX_unrecognized"); ok { if f.Type != reflect.TypeOf([]byte{}) { panic("expected XXX_unrecognized to be of type []byte") } di.unrecognized = toField(&f) } atomic.StoreInt32(&di.initialized, 1) } func discardLegacy(m Message) { v := reflect.ValueOf(m) if v.Kind() != reflect.Ptr || v.IsNil() { return } v = v.Elem() if v.Kind() != reflect.Struct { return } t := v.Type() for i := 0; i < v.NumField(); i++ { f := t.Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } vf := v.Field(i) tf := f.Type // Unwrap tf to get its most basic type. var isPointer, isSlice bool if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 { isSlice = true tf = tf.Elem() } if tf.Kind() == reflect.Ptr { isPointer = true tf = tf.Elem() } if isPointer && isSlice && tf.Kind() != reflect.Struct { panic(fmt.Sprintf("%T.%s cannot be a slice of pointers to primitive types", m, f.Name)) } switch tf.Kind() { case reflect.Struct: switch { case !isPointer: panic(fmt.Sprintf("%T.%s cannot be a direct struct value", m, f.Name)) case isSlice: // E.g., []*pb.T for j := 0; j < vf.Len(); j++ { discardLegacy(vf.Index(j).Interface().(Message)) } default: // E.g., *pb.T discardLegacy(vf.Interface().(Message)) } case reflect.Map: switch { case isPointer || isSlice: panic(fmt.Sprintf("%T.%s cannot be a pointer to a map or a slice of map values", m, f.Name)) default: // E.g., map[K]V tv := vf.Type().Elem() if tv.Kind() == reflect.Ptr && tv.Implements(protoMessageType) { // Proto struct (e.g., *T) for _, key := range vf.MapKeys() { val := vf.MapIndex(key) discardLegacy(val.Interface().(Message)) } } } case reflect.Interface: // Must be oneof field. switch { case isPointer || isSlice: panic(fmt.Sprintf("%T.%s cannot be a pointer to a interface or a slice of interface values", m, f.Name)) default: // E.g., test_proto.isCommunique_Union interface if !vf.IsNil() && f.Tag.Get("protobuf_oneof") != "" { vf = vf.Elem() // E.g., *test_proto.Communique_Msg if !vf.IsNil() { vf = vf.Elem() // E.g., test_proto.Communique_Msg vf = vf.Field(0) // E.g., Proto struct (e.g., *T) or primitive value if vf.Kind() == reflect.Ptr { discardLegacy(vf.Interface().(Message)) } } } } } } if vf := v.FieldByName("XXX_unrecognized"); vf.IsValid() { if vf.Type() != reflect.TypeOf([]byte{}) { panic("expected XXX_unrecognized to be of type []byte") } vf.Set(reflect.ValueOf([]byte(nil))) } // For proto2 messages, only discard unknown fields in message extensions // that have been accessed via GetExtension. if em, err := extendable(m); err == nil { // Ignore lock since discardLegacy is not concurrency safe. emm, _ := em.extensionsRead() for _, mx := range emm { if m, ok := mx.value.(Message); ok { discardLegacy(m) } } } } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/duration.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto // This file implements conversions between google.protobuf.Duration // and time.Duration. import ( "errors" "fmt" "time" ) const ( // Range of a Duration in seconds, as specified in // google/protobuf/duration.proto. This is about 10,000 years in seconds. maxSeconds = int64(10000 * 365.25 * 24 * 60 * 60) minSeconds = -maxSeconds ) // validateDuration determines whether the Duration is valid according to the // definition in google/protobuf/duration.proto. A valid Duration // may still be too large to fit into a time.Duration (the range of Duration // is about 10,000 years, and the range of time.Duration is about 290). func validateDuration(d *duration) error { if d == nil { return errors.New("duration: nil Duration") } if d.Seconds < minSeconds || d.Seconds > maxSeconds { return fmt.Errorf("duration: %#v: seconds out of range", d) } if d.Nanos <= -1e9 || d.Nanos >= 1e9 { return fmt.Errorf("duration: %#v: nanos out of range", d) } // Seconds and Nanos must have the same sign, unless d.Nanos is zero. if (d.Seconds < 0 && d.Nanos > 0) || (d.Seconds > 0 && d.Nanos < 0) { return fmt.Errorf("duration: %#v: seconds and nanos have different signs", d) } return nil } // DurationFromProto converts a Duration to a time.Duration. DurationFromProto // returns an error if the Duration is invalid or is too large to be // represented in a time.Duration. func durationFromProto(p *duration) (time.Duration, error) { if err := validateDuration(p); err != nil { return 0, err } d := time.Duration(p.Seconds) * time.Second if int64(d/time.Second) != p.Seconds { return 0, fmt.Errorf("duration: %#v is out of range for time.Duration", p) } if p.Nanos != 0 { d += time.Duration(p.Nanos) if (d < 0) != (p.Nanos < 0) { return 0, fmt.Errorf("duration: %#v is out of range for time.Duration", p) } } return d, nil } // DurationProto converts a time.Duration to a Duration. func durationProto(d time.Duration) *duration { nanos := d.Nanoseconds() secs := nanos / 1e9 nanos -= secs * 1e9 return &duration{ Seconds: secs, Nanos: int32(nanos), } } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/duration_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2016, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "reflect" "time" ) var durationType = reflect.TypeOf((*time.Duration)(nil)).Elem() type duration struct { Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` } func (m *duration) Reset() { *m = duration{} } func (*duration) ProtoMessage() {} func (*duration) String() string { return "duration" } func init() { RegisterType((*duration)(nil), "gogo.protobuf.proto.duration") } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/encode.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto /* * Routines for encoding data into the wire format for protocol buffers. */ import ( "errors" "reflect" ) var ( // errRepeatedHasNil is the error returned if Marshal is called with // a struct with a repeated field containing a nil element. errRepeatedHasNil = errors.New("proto: repeated field has nil element") // errOneofHasNil is the error returned if Marshal is called with // a struct with a oneof field containing a nil element. errOneofHasNil = errors.New("proto: oneof field has nil value") // ErrNil is the error returned if Marshal is called with nil. ErrNil = errors.New("proto: Marshal called with nil") // ErrTooLarge is the error returned if Marshal is called with a // message that encodes to >2GB. ErrTooLarge = errors.New("proto: message encodes to over 2 GB") ) // The fundamental encoders that put bytes on the wire. // Those that take integer types all accept uint64 and are // therefore of type valueEncoder. const maxVarintBytes = 10 // maximum length of a varint // EncodeVarint returns the varint encoding of x. // This is the format for the // int32, int64, uint32, uint64, bool, and enum // protocol buffer types. // Not used by the package itself, but helpful to clients // wishing to use the same encoding. func EncodeVarint(x uint64) []byte { var buf [maxVarintBytes]byte var n int for n = 0; x > 127; n++ { buf[n] = 0x80 | uint8(x&0x7F) x >>= 7 } buf[n] = uint8(x) n++ return buf[0:n] } // EncodeVarint writes a varint-encoded integer to the Buffer. // This is the format for the // int32, int64, uint32, uint64, bool, and enum // protocol buffer types. func (p *Buffer) EncodeVarint(x uint64) error { for x >= 1<<7 { p.buf = append(p.buf, uint8(x&0x7f|0x80)) x >>= 7 } p.buf = append(p.buf, uint8(x)) return nil } // SizeVarint returns the varint encoding size of an integer. func SizeVarint(x uint64) int { switch { case x < 1<<7: return 1 case x < 1<<14: return 2 case x < 1<<21: return 3 case x < 1<<28: return 4 case x < 1<<35: return 5 case x < 1<<42: return 6 case x < 1<<49: return 7 case x < 1<<56: return 8 case x < 1<<63: return 9 } return 10 } // EncodeFixed64 writes a 64-bit integer to the Buffer. // This is the format for the // fixed64, sfixed64, and double protocol buffer types. func (p *Buffer) EncodeFixed64(x uint64) error { p.buf = append(p.buf, uint8(x), uint8(x>>8), uint8(x>>16), uint8(x>>24), uint8(x>>32), uint8(x>>40), uint8(x>>48), uint8(x>>56)) return nil } // EncodeFixed32 writes a 32-bit integer to the Buffer. // This is the format for the // fixed32, sfixed32, and float protocol buffer types. func (p *Buffer) EncodeFixed32(x uint64) error { p.buf = append(p.buf, uint8(x), uint8(x>>8), uint8(x>>16), uint8(x>>24)) return nil } // EncodeZigzag64 writes a zigzag-encoded 64-bit integer // to the Buffer. // This is the format used for the sint64 protocol buffer type. func (p *Buffer) EncodeZigzag64(x uint64) error { // use signed number to get arithmetic right shift. return p.EncodeVarint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } // EncodeZigzag32 writes a zigzag-encoded 32-bit integer // to the Buffer. // This is the format used for the sint32 protocol buffer type. func (p *Buffer) EncodeZigzag32(x uint64) error { // use signed number to get arithmetic right shift. return p.EncodeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31)))) } // EncodeRawBytes writes a count-delimited byte buffer to the Buffer. // This is the format used for the bytes protocol buffer // type and for embedded messages. func (p *Buffer) EncodeRawBytes(b []byte) error { p.EncodeVarint(uint64(len(b))) p.buf = append(p.buf, b...) return nil } // EncodeStringBytes writes an encoded string to the Buffer. // This is the format used for the proto2 string type. func (p *Buffer) EncodeStringBytes(s string) error { p.EncodeVarint(uint64(len(s))) p.buf = append(p.buf, s...) return nil } // Marshaler is the interface representing objects that can marshal themselves. type Marshaler interface { Marshal() ([]byte, error) } // EncodeMessage writes the protocol buffer to the Buffer, // prefixed by a varint-encoded length. func (p *Buffer) EncodeMessage(pb Message) error { siz := Size(pb) p.EncodeVarint(uint64(siz)) return p.Marshal(pb) } // All protocol buffer fields are nillable, but be careful. func isNil(v reflect.Value) bool { switch v.Kind() { case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: return v.IsNil() } return false } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/encode_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto func NewRequiredNotSetError(field string) *RequiredNotSetError { return &RequiredNotSetError{field} } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/equal.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2011 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Protocol buffer comparison. package proto import ( "bytes" "log" "reflect" "strings" ) /* Equal returns true iff protocol buffers a and b are equal. The arguments must both be pointers to protocol buffer structs. Equality is defined in this way: - Two messages are equal iff they are the same type, corresponding fields are equal, unknown field sets are equal, and extensions sets are equal. - Two set scalar fields are equal iff their values are equal. If the fields are of a floating-point type, remember that NaN != x for all x, including NaN. If the message is defined in a proto3 .proto file, fields are not "set"; specifically, zero length proto3 "bytes" fields are equal (nil == {}). - Two repeated fields are equal iff their lengths are the same, and their corresponding elements are equal. Note a "bytes" field, although represented by []byte, is not a repeated field and the rule for the scalar fields described above applies. - Two unset fields are equal. - Two unknown field sets are equal if their current encoded state is equal. - Two extension sets are equal iff they have corresponding elements that are pairwise equal. - Two map fields are equal iff their lengths are the same, and they contain the same set of elements. Zero-length map fields are equal. - Every other combination of things are not equal. The return value is undefined if a and b are not protocol buffers. */ func Equal(a, b Message) bool { if a == nil || b == nil { return a == b } v1, v2 := reflect.ValueOf(a), reflect.ValueOf(b) if v1.Type() != v2.Type() { return false } if v1.Kind() == reflect.Ptr { if v1.IsNil() { return v2.IsNil() } if v2.IsNil() { return false } v1, v2 = v1.Elem(), v2.Elem() } if v1.Kind() != reflect.Struct { return false } return equalStruct(v1, v2) } // v1 and v2 are known to have the same type. func equalStruct(v1, v2 reflect.Value) bool { sprop := GetProperties(v1.Type()) for i := 0; i < v1.NumField(); i++ { f := v1.Type().Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } f1, f2 := v1.Field(i), v2.Field(i) if f.Type.Kind() == reflect.Ptr { if n1, n2 := f1.IsNil(), f2.IsNil(); n1 && n2 { // both unset continue } else if n1 != n2 { // set/unset mismatch return false } f1, f2 = f1.Elem(), f2.Elem() } if !equalAny(f1, f2, sprop.Prop[i]) { return false } } if em1 := v1.FieldByName("XXX_InternalExtensions"); em1.IsValid() { em2 := v2.FieldByName("XXX_InternalExtensions") if !equalExtensions(v1.Type(), em1.Interface().(XXX_InternalExtensions), em2.Interface().(XXX_InternalExtensions)) { return false } } if em1 := v1.FieldByName("XXX_extensions"); em1.IsValid() { em2 := v2.FieldByName("XXX_extensions") if !equalExtMap(v1.Type(), em1.Interface().(map[int32]Extension), em2.Interface().(map[int32]Extension)) { return false } } uf := v1.FieldByName("XXX_unrecognized") if !uf.IsValid() { return true } u1 := uf.Bytes() u2 := v2.FieldByName("XXX_unrecognized").Bytes() return bytes.Equal(u1, u2) } // v1 and v2 are known to have the same type. // prop may be nil. func equalAny(v1, v2 reflect.Value, prop *Properties) bool { if v1.Type() == protoMessageType { m1, _ := v1.Interface().(Message) m2, _ := v2.Interface().(Message) return Equal(m1, m2) } switch v1.Kind() { case reflect.Bool: return v1.Bool() == v2.Bool() case reflect.Float32, reflect.Float64: return v1.Float() == v2.Float() case reflect.Int32, reflect.Int64: return v1.Int() == v2.Int() case reflect.Interface: // Probably a oneof field; compare the inner values. n1, n2 := v1.IsNil(), v2.IsNil() if n1 || n2 { return n1 == n2 } e1, e2 := v1.Elem(), v2.Elem() if e1.Type() != e2.Type() { return false } return equalAny(e1, e2, nil) case reflect.Map: if v1.Len() != v2.Len() { return false } for _, key := range v1.MapKeys() { val2 := v2.MapIndex(key) if !val2.IsValid() { // This key was not found in the second map. return false } if !equalAny(v1.MapIndex(key), val2, nil) { return false } } return true case reflect.Ptr: // Maps may have nil values in them, so check for nil. if v1.IsNil() && v2.IsNil() { return true } if v1.IsNil() != v2.IsNil() { return false } return equalAny(v1.Elem(), v2.Elem(), prop) case reflect.Slice: if v1.Type().Elem().Kind() == reflect.Uint8 { // short circuit: []byte // Edge case: if this is in a proto3 message, a zero length // bytes field is considered the zero value. if prop != nil && prop.proto3 && v1.Len() == 0 && v2.Len() == 0 { return true } if v1.IsNil() != v2.IsNil() { return false } return bytes.Equal(v1.Interface().([]byte), v2.Interface().([]byte)) } if v1.Len() != v2.Len() { return false } for i := 0; i < v1.Len(); i++ { if !equalAny(v1.Index(i), v2.Index(i), prop) { return false } } return true case reflect.String: return v1.Interface().(string) == v2.Interface().(string) case reflect.Struct: return equalStruct(v1, v2) case reflect.Uint32, reflect.Uint64: return v1.Uint() == v2.Uint() } // unknown type, so not a protocol buffer log.Printf("proto: don't know how to compare %v", v1) return false } // base is the struct type that the extensions are based on. // x1 and x2 are InternalExtensions. func equalExtensions(base reflect.Type, x1, x2 XXX_InternalExtensions) bool { em1, _ := x1.extensionsRead() em2, _ := x2.extensionsRead() return equalExtMap(base, em1, em2) } func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool { if len(em1) != len(em2) { return false } for extNum, e1 := range em1 { e2, ok := em2[extNum] if !ok { return false } m1, m2 := e1.value, e2.value if m1 == nil && m2 == nil { // Both have only encoded form. if bytes.Equal(e1.enc, e2.enc) { continue } // The bytes are different, but the extensions might still be // equal. We need to decode them to compare. } if m1 != nil && m2 != nil { // Both are unencoded. if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) { return false } continue } // At least one is encoded. To do a semantically correct comparison // we need to unmarshal them first. var desc *ExtensionDesc if m := extensionMaps[base]; m != nil { desc = m[extNum] } if desc == nil { // If both have only encoded form and the bytes are the same, // it is handled above. We get here when the bytes are different. // We don't know how to decode it, so just compare them as byte // slices. log.Printf("proto: don't know how to compare extension %d of %v", extNum, base) return false } var err error if m1 == nil { m1, err = decodeExtension(e1.enc, desc) } if m2 == nil && err == nil { m2, err = decodeExtension(e2.enc, desc) } if err != nil { // The encoded form is invalid. log.Printf("proto: badly encoded extension %d of %v: %v", extNum, base, err) return false } if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) { return false } } return true } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/extensions.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto /* * Types and routines for supporting protocol buffer extensions. */ import ( "errors" "fmt" "io" "reflect" "strconv" "sync" ) // ErrMissingExtension is the error returned by GetExtension if the named extension is not in the message. var ErrMissingExtension = errors.New("proto: missing extension") // ExtensionRange represents a range of message extensions for a protocol buffer. // Used in code generated by the protocol compiler. type ExtensionRange struct { Start, End int32 // both inclusive } // extendableProto is an interface implemented by any protocol buffer generated by the current // proto compiler that may be extended. type extendableProto interface { Message ExtensionRangeArray() []ExtensionRange extensionsWrite() map[int32]Extension extensionsRead() (map[int32]Extension, sync.Locker) } // extendableProtoV1 is an interface implemented by a protocol buffer generated by the previous // version of the proto compiler that may be extended. type extendableProtoV1 interface { Message ExtensionRangeArray() []ExtensionRange ExtensionMap() map[int32]Extension } // extensionAdapter is a wrapper around extendableProtoV1 that implements extendableProto. type extensionAdapter struct { extendableProtoV1 } func (e extensionAdapter) extensionsWrite() map[int32]Extension { return e.ExtensionMap() } func (e extensionAdapter) extensionsRead() (map[int32]Extension, sync.Locker) { return e.ExtensionMap(), notLocker{} } // notLocker is a sync.Locker whose Lock and Unlock methods are nops. type notLocker struct{} func (n notLocker) Lock() {} func (n notLocker) Unlock() {} // extendable returns the extendableProto interface for the given generated proto message. // If the proto message has the old extension format, it returns a wrapper that implements // the extendableProto interface. func extendable(p interface{}) (extendableProto, error) { switch p := p.(type) { case extendableProto: if isNilPtr(p) { return nil, fmt.Errorf("proto: nil %T is not extendable", p) } return p, nil case extendableProtoV1: if isNilPtr(p) { return nil, fmt.Errorf("proto: nil %T is not extendable", p) } return extensionAdapter{p}, nil case extensionsBytes: return slowExtensionAdapter{p}, nil } // Don't allocate a specific error containing %T: // this is the hot path for Clone and MarshalText. return nil, errNotExtendable } var errNotExtendable = errors.New("proto: not an extendable proto.Message") func isNilPtr(x interface{}) bool { v := reflect.ValueOf(x) return v.Kind() == reflect.Ptr && v.IsNil() } // XXX_InternalExtensions is an internal representation of proto extensions. // // Each generated message struct type embeds an anonymous XXX_InternalExtensions field, // thus gaining the unexported 'extensions' method, which can be called only from the proto package. // // The methods of XXX_InternalExtensions are not concurrency safe in general, // but calls to logically read-only methods such as has and get may be executed concurrently. type XXX_InternalExtensions struct { // The struct must be indirect so that if a user inadvertently copies a // generated message and its embedded XXX_InternalExtensions, they // avoid the mayhem of a copied mutex. // // The mutex serializes all logically read-only operations to p.extensionMap. // It is up to the client to ensure that write operations to p.extensionMap are // mutually exclusive with other accesses. p *struct { mu sync.Mutex extensionMap map[int32]Extension } } // extensionsWrite returns the extension map, creating it on first use. func (e *XXX_InternalExtensions) extensionsWrite() map[int32]Extension { if e.p == nil { e.p = new(struct { mu sync.Mutex extensionMap map[int32]Extension }) e.p.extensionMap = make(map[int32]Extension) } return e.p.extensionMap } // extensionsRead returns the extensions map for read-only use. It may be nil. // The caller must hold the returned mutex's lock when accessing Elements within the map. func (e *XXX_InternalExtensions) extensionsRead() (map[int32]Extension, sync.Locker) { if e.p == nil { return nil, nil } return e.p.extensionMap, &e.p.mu } // ExtensionDesc represents an extension specification. // Used in generated code from the protocol compiler. type ExtensionDesc struct { ExtendedType Message // nil pointer to the type that is being extended ExtensionType interface{} // nil pointer to the extension type Field int32 // field number Name string // fully-qualified name of extension, for text formatting Tag string // protobuf tag style Filename string // name of the file in which the extension is defined } func (ed *ExtensionDesc) repeated() bool { t := reflect.TypeOf(ed.ExtensionType) return t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 } // Extension represents an extension in a message. type Extension struct { // When an extension is stored in a message using SetExtension // only desc and value are set. When the message is marshaled // enc will be set to the encoded form of the message. // // When a message is unmarshaled and contains extensions, each // extension will have only enc set. When such an extension is // accessed using GetExtension (or GetExtensions) desc and value // will be set. desc *ExtensionDesc value interface{} enc []byte } // SetRawExtension is for testing only. func SetRawExtension(base Message, id int32, b []byte) { if ebase, ok := base.(extensionsBytes); ok { clearExtension(base, id) ext := ebase.GetExtensions() *ext = append(*ext, b...) return } epb, err := extendable(base) if err != nil { return } extmap := epb.extensionsWrite() extmap[id] = Extension{enc: b} } // isExtensionField returns true iff the given field number is in an extension range. func isExtensionField(pb extendableProto, field int32) bool { for _, er := range pb.ExtensionRangeArray() { if er.Start <= field && field <= er.End { return true } } return false } // checkExtensionTypes checks that the given extension is valid for pb. func checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) error { var pbi interface{} = pb // Check the extended type. if ea, ok := pbi.(extensionAdapter); ok { pbi = ea.extendableProtoV1 } if ea, ok := pbi.(slowExtensionAdapter); ok { pbi = ea.extensionsBytes } if a, b := reflect.TypeOf(pbi), reflect.TypeOf(extension.ExtendedType); a != b { return fmt.Errorf("proto: bad extended type; %v does not extend %v", b, a) } // Check the range. if !isExtensionField(pb, extension.Field) { return errors.New("proto: bad extension number; not in declared ranges") } return nil } // extPropKey is sufficient to uniquely identify an extension. type extPropKey struct { base reflect.Type field int32 } var extProp = struct { sync.RWMutex m map[extPropKey]*Properties }{ m: make(map[extPropKey]*Properties), } func extensionProperties(ed *ExtensionDesc) *Properties { key := extPropKey{base: reflect.TypeOf(ed.ExtendedType), field: ed.Field} extProp.RLock() if prop, ok := extProp.m[key]; ok { extProp.RUnlock() return prop } extProp.RUnlock() extProp.Lock() defer extProp.Unlock() // Check again. if prop, ok := extProp.m[key]; ok { return prop } prop := new(Properties) prop.Init(reflect.TypeOf(ed.ExtensionType), "unknown_name", ed.Tag, nil) extProp.m[key] = prop return prop } // HasExtension returns whether the given extension is present in pb. func HasExtension(pb Message, extension *ExtensionDesc) bool { if epb, doki := pb.(extensionsBytes); doki { ext := epb.GetExtensions() buf := *ext o := 0 for o < len(buf) { tag, n := DecodeVarint(buf[o:]) fieldNum := int32(tag >> 3) if int32(fieldNum) == extension.Field { return true } wireType := int(tag & 0x7) o += n l, err := size(buf[o:], wireType) if err != nil { return false } o += l } return false } // TODO: Check types, field numbers, etc.? epb, err := extendable(pb) if err != nil { return false } extmap, mu := epb.extensionsRead() if extmap == nil { return false } mu.Lock() _, ok := extmap[extension.Field] mu.Unlock() return ok } // ClearExtension removes the given extension from pb. func ClearExtension(pb Message, extension *ExtensionDesc) { clearExtension(pb, extension.Field) } func clearExtension(pb Message, fieldNum int32) { if epb, ok := pb.(extensionsBytes); ok { offset := 0 for offset != -1 { offset = deleteExtension(epb, fieldNum, offset) } return } epb, err := extendable(pb) if err != nil { return } // TODO: Check types, field numbers, etc.? extmap := epb.extensionsWrite() delete(extmap, fieldNum) } // GetExtension retrieves a proto2 extended field from pb. // // If the descriptor is type complete (i.e., ExtensionDesc.ExtensionType is non-nil), // then GetExtension parses the encoded field and returns a Go value of the specified type. // If the field is not present, then the default value is returned (if one is specified), // otherwise ErrMissingExtension is reported. // // If the descriptor is not type complete (i.e., ExtensionDesc.ExtensionType is nil), // then GetExtension returns the raw encoded bytes of the field extension. func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) { if epb, doki := pb.(extensionsBytes); doki { ext := epb.GetExtensions() return decodeExtensionFromBytes(extension, *ext) } epb, err := extendable(pb) if err != nil { return nil, err } if extension.ExtendedType != nil { // can only check type if this is a complete descriptor if cerr := checkExtensionTypes(epb, extension); cerr != nil { return nil, cerr } } emap, mu := epb.extensionsRead() if emap == nil { return defaultExtensionValue(extension) } mu.Lock() defer mu.Unlock() e, ok := emap[extension.Field] if !ok { // defaultExtensionValue returns the default value or // ErrMissingExtension if there is no default. return defaultExtensionValue(extension) } if e.value != nil { // Already decoded. Check the descriptor, though. if e.desc != extension { // This shouldn't happen. If it does, it means that // GetExtension was called twice with two different // descriptors with the same field number. return nil, errors.New("proto: descriptor conflict") } return e.value, nil } if extension.ExtensionType == nil { // incomplete descriptor return e.enc, nil } v, err := decodeExtension(e.enc, extension) if err != nil { return nil, err } // Remember the decoded version and drop the encoded version. // That way it is safe to mutate what we return. e.value = v e.desc = extension e.enc = nil emap[extension.Field] = e return e.value, nil } // defaultExtensionValue returns the default value for extension. // If no default for an extension is defined ErrMissingExtension is returned. func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) { if extension.ExtensionType == nil { // incomplete descriptor, so no default return nil, ErrMissingExtension } t := reflect.TypeOf(extension.ExtensionType) props := extensionProperties(extension) sf, _, err := fieldDefault(t, props) if err != nil { return nil, err } if sf == nil || sf.value == nil { // There is no default value. return nil, ErrMissingExtension } if t.Kind() != reflect.Ptr { // We do not need to return a Ptr, we can directly return sf.value. return sf.value, nil } // We need to return an interface{} that is a pointer to sf.value. value := reflect.New(t).Elem() value.Set(reflect.New(value.Type().Elem())) if sf.kind == reflect.Int32 { // We may have an int32 or an enum, but the underlying data is int32. // Since we can't set an int32 into a non int32 reflect.value directly // set it as a int32. value.Elem().SetInt(int64(sf.value.(int32))) } else { value.Elem().Set(reflect.ValueOf(sf.value)) } return value.Interface(), nil } // decodeExtension decodes an extension encoded in b. func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) { t := reflect.TypeOf(extension.ExtensionType) unmarshal := typeUnmarshaler(t, extension.Tag) // t is a pointer to a struct, pointer to basic type or a slice. // Allocate space to store the pointer/slice. value := reflect.New(t).Elem() var err error for { x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] wire := int(x) & 7 b, err = unmarshal(b, valToPointer(value.Addr()), wire) if err != nil { return nil, err } if len(b) == 0 { break } } return value.Interface(), nil } // GetExtensions returns a slice of the extensions present in pb that are also listed in es. // The returned slice has the same length as es; missing extensions will appear as nil elements. func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, err error) { epb, err := extendable(pb) if err != nil { return nil, err } extensions = make([]interface{}, len(es)) for i, e := range es { extensions[i], err = GetExtension(epb, e) if err == ErrMissingExtension { err = nil } if err != nil { return } } return } // ExtensionDescs returns a new slice containing pb's extension descriptors, in undefined order. // For non-registered extensions, ExtensionDescs returns an incomplete descriptor containing // just the Field field, which defines the extension's field number. func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) { epb, err := extendable(pb) if err != nil { return nil, err } registeredExtensions := RegisteredExtensions(pb) emap, mu := epb.extensionsRead() if emap == nil { return nil, nil } mu.Lock() defer mu.Unlock() extensions := make([]*ExtensionDesc, 0, len(emap)) for extid, e := range emap { desc := e.desc if desc == nil { desc = registeredExtensions[extid] if desc == nil { desc = &ExtensionDesc{Field: extid} } } extensions = append(extensions, desc) } return extensions, nil } // SetExtension sets the specified extension of pb to the specified value. func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error { if epb, ok := pb.(extensionsBytes); ok { newb, err := encodeExtension(extension, value) if err != nil { return err } bb := epb.GetExtensions() *bb = append(*bb, newb...) return nil } epb, err := extendable(pb) if err != nil { return err } if err := checkExtensionTypes(epb, extension); err != nil { return err } typ := reflect.TypeOf(extension.ExtensionType) if typ != reflect.TypeOf(value) { return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", value, extension.ExtensionType) } // nil extension values need to be caught early, because the // encoder can't distinguish an ErrNil due to a nil extension // from an ErrNil due to a missing field. Extensions are // always optional, so the encoder would just swallow the error // and drop all the extensions from the encoded message. if reflect.ValueOf(value).IsNil() { return fmt.Errorf("proto: SetExtension called with nil value of type %T", value) } extmap := epb.extensionsWrite() extmap[extension.Field] = Extension{desc: extension, value: value} return nil } // ClearAllExtensions clears all extensions from pb. func ClearAllExtensions(pb Message) { if epb, doki := pb.(extensionsBytes); doki { ext := epb.GetExtensions() *ext = []byte{} return } epb, err := extendable(pb) if err != nil { return } m := epb.extensionsWrite() for k := range m { delete(m, k) } } // A global registry of extensions. // The generated code will register the generated descriptors by calling RegisterExtension. var extensionMaps = make(map[reflect.Type]map[int32]*ExtensionDesc) // RegisterExtension is called from the generated code. func RegisterExtension(desc *ExtensionDesc) { st := reflect.TypeOf(desc.ExtendedType).Elem() m := extensionMaps[st] if m == nil { m = make(map[int32]*ExtensionDesc) extensionMaps[st] = m } if _, ok := m[desc.Field]; ok { panic("proto: duplicate extension registered: " + st.String() + " " + strconv.Itoa(int(desc.Field))) } m[desc.Field] = desc } // RegisteredExtensions returns a map of the registered extensions of a // protocol buffer struct, indexed by the extension number. // The argument pb should be a nil pointer to the struct type. func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc { return extensionMaps[reflect.TypeOf(pb).Elem()] } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/extensions_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "bytes" "errors" "fmt" "io" "reflect" "sort" "strings" "sync" ) type extensionsBytes interface { Message ExtensionRangeArray() []ExtensionRange GetExtensions() *[]byte } type slowExtensionAdapter struct { extensionsBytes } func (s slowExtensionAdapter) extensionsWrite() map[int32]Extension { panic("Please report a bug to github.com/gogo/protobuf if you see this message: Writing extensions is not supported for extensions stored in a byte slice field.") } func (s slowExtensionAdapter) extensionsRead() (map[int32]Extension, sync.Locker) { b := s.GetExtensions() m, err := BytesToExtensionsMap(*b) if err != nil { panic(err) } return m, notLocker{} } func GetBoolExtension(pb Message, extension *ExtensionDesc, ifnotset bool) bool { if reflect.ValueOf(pb).IsNil() { return ifnotset } value, err := GetExtension(pb, extension) if err != nil { return ifnotset } if value == nil { return ifnotset } if value.(*bool) == nil { return ifnotset } return *(value.(*bool)) } func (this *Extension) Equal(that *Extension) bool { if err := this.Encode(); err != nil { return false } if err := that.Encode(); err != nil { return false } return bytes.Equal(this.enc, that.enc) } func (this *Extension) Compare(that *Extension) int { if err := this.Encode(); err != nil { return 1 } if err := that.Encode(); err != nil { return -1 } return bytes.Compare(this.enc, that.enc) } func SizeOfInternalExtension(m extendableProto) (n int) { info := getMarshalInfo(reflect.TypeOf(m)) return info.sizeV1Extensions(m.extensionsWrite()) } type sortableMapElem struct { field int32 ext Extension } func newSortableExtensionsFromMap(m map[int32]Extension) sortableExtensions { s := make(sortableExtensions, 0, len(m)) for k, v := range m { s = append(s, &sortableMapElem{field: k, ext: v}) } return s } type sortableExtensions []*sortableMapElem func (this sortableExtensions) Len() int { return len(this) } func (this sortableExtensions) Swap(i, j int) { this[i], this[j] = this[j], this[i] } func (this sortableExtensions) Less(i, j int) bool { return this[i].field < this[j].field } func (this sortableExtensions) String() string { sort.Sort(this) ss := make([]string, len(this)) for i := range this { ss[i] = fmt.Sprintf("%d: %v", this[i].field, this[i].ext) } return "map[" + strings.Join(ss, ",") + "]" } func StringFromInternalExtension(m extendableProto) string { return StringFromExtensionsMap(m.extensionsWrite()) } func StringFromExtensionsMap(m map[int32]Extension) string { return newSortableExtensionsFromMap(m).String() } func StringFromExtensionsBytes(ext []byte) string { m, err := BytesToExtensionsMap(ext) if err != nil { panic(err) } return StringFromExtensionsMap(m) } func EncodeInternalExtension(m extendableProto, data []byte) (n int, err error) { return EncodeExtensionMap(m.extensionsWrite(), data) } func EncodeExtensionMap(m map[int32]Extension, data []byte) (n int, err error) { o := 0 for _, e := range m { if err := e.Encode(); err != nil { return 0, err } n := copy(data[o:], e.enc) if n != len(e.enc) { return 0, io.ErrShortBuffer } o += n } return o, nil } func GetRawExtension(m map[int32]Extension, id int32) ([]byte, error) { e := m[id] if err := e.Encode(); err != nil { return nil, err } return e.enc, nil } func size(buf []byte, wire int) (int, error) { switch wire { case WireVarint: _, n := DecodeVarint(buf) return n, nil case WireFixed64: return 8, nil case WireBytes: v, n := DecodeVarint(buf) return int(v) + n, nil case WireFixed32: return 4, nil case WireStartGroup: offset := 0 for { u, n := DecodeVarint(buf[offset:]) fwire := int(u & 0x7) offset += n if fwire == WireEndGroup { return offset, nil } s, err := size(buf[offset:], wire) if err != nil { return 0, err } offset += s } } return 0, fmt.Errorf("proto: can't get size for unknown wire type %d", wire) } func BytesToExtensionsMap(buf []byte) (map[int32]Extension, error) { m := make(map[int32]Extension) i := 0 for i < len(buf) { tag, n := DecodeVarint(buf[i:]) if n <= 0 { return nil, fmt.Errorf("unable to decode varint") } fieldNum := int32(tag >> 3) wireType := int(tag & 0x7) l, err := size(buf[i+n:], wireType) if err != nil { return nil, err } end := i + int(l) + n m[int32(fieldNum)] = Extension{enc: buf[i:end]} i = end } return m, nil } func NewExtension(e []byte) Extension { ee := Extension{enc: make([]byte, len(e))} copy(ee.enc, e) return ee } func AppendExtension(e Message, tag int32, buf []byte) { if ee, eok := e.(extensionsBytes); eok { ext := ee.GetExtensions() *ext = append(*ext, buf...) return } if ee, eok := e.(extendableProto); eok { m := ee.extensionsWrite() ext := m[int32(tag)] // may be missing ext.enc = append(ext.enc, buf...) m[int32(tag)] = ext } } func encodeExtension(extension *ExtensionDesc, value interface{}) ([]byte, error) { u := getMarshalInfo(reflect.TypeOf(extension.ExtendedType)) ei := u.getExtElemInfo(extension) v := value p := toAddrPointer(&v, ei.isptr) siz := ei.sizer(p, SizeVarint(ei.wiretag)) buf := make([]byte, 0, siz) return ei.marshaler(buf, p, ei.wiretag, false) } func decodeExtensionFromBytes(extension *ExtensionDesc, buf []byte) (interface{}, error) { o := 0 for o < len(buf) { tag, n := DecodeVarint((buf)[o:]) fieldNum := int32(tag >> 3) wireType := int(tag & 0x7) if o+n > len(buf) { return nil, fmt.Errorf("unable to decode extension") } l, err := size((buf)[o+n:], wireType) if err != nil { return nil, err } if int32(fieldNum) == extension.Field { if o+n+l > len(buf) { return nil, fmt.Errorf("unable to decode extension") } v, err := decodeExtension((buf)[o:o+n+l], extension) if err != nil { return nil, err } return v, nil } o += n + l } return defaultExtensionValue(extension) } func (this *Extension) Encode() error { if this.enc == nil { var err error this.enc, err = encodeExtension(this.desc, this.value) if err != nil { return err } } return nil } func (this Extension) GoString() string { if err := this.Encode(); err != nil { return fmt.Sprintf("error encoding extension: %v", err) } return fmt.Sprintf("proto.NewExtension(%#v)", this.enc) } func SetUnsafeExtension(pb Message, fieldNum int32, value interface{}) error { typ := reflect.TypeOf(pb).Elem() ext, ok := extensionMaps[typ] if !ok { return fmt.Errorf("proto: bad extended type; %s is not extendable", typ.String()) } desc, ok := ext[fieldNum] if !ok { return errors.New("proto: bad extension number; not in declared ranges") } return SetExtension(pb, desc, value) } func GetUnsafeExtension(pb Message, fieldNum int32) (interface{}, error) { typ := reflect.TypeOf(pb).Elem() ext, ok := extensionMaps[typ] if !ok { return nil, fmt.Errorf("proto: bad extended type; %s is not extendable", typ.String()) } desc, ok := ext[fieldNum] if !ok { return nil, fmt.Errorf("unregistered field number %d", fieldNum) } return GetExtension(pb, desc) } func NewUnsafeXXX_InternalExtensions(m map[int32]Extension) XXX_InternalExtensions { x := &XXX_InternalExtensions{ p: new(struct { mu sync.Mutex extensionMap map[int32]Extension }), } x.p.extensionMap = m return *x } func GetUnsafeExtensionsMap(extendable Message) map[int32]Extension { pb := extendable.(extendableProto) return pb.extensionsWrite() } func deleteExtension(pb extensionsBytes, theFieldNum int32, offset int) int { ext := pb.GetExtensions() for offset < len(*ext) { tag, n1 := DecodeVarint((*ext)[offset:]) fieldNum := int32(tag >> 3) wireType := int(tag & 0x7) n2, err := size((*ext)[offset+n1:], wireType) if err != nil { panic(err) } newOffset := offset + n1 + n2 if fieldNum == theFieldNum { *ext = append((*ext)[:offset], (*ext)[newOffset:]...) return offset } offset = newOffset } return -1 } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/lib.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Package proto converts data structures to and from the wire format of protocol buffers. It works in concert with the Go source code generated for .proto files by the protocol compiler. A summary of the properties of the protocol buffer interface for a protocol buffer variable v: - Names are turned from camel_case to CamelCase for export. - There are no methods on v to set fields; just treat them as structure fields. - There are getters that return a field's value if set, and return the field's default value if unset. The getters work even if the receiver is a nil message. - The zero value for a struct is its correct initialization state. All desired fields must be set before marshaling. - A Reset() method will restore a protobuf struct to its zero state. - Non-repeated fields are pointers to the values; nil means unset. That is, optional or required field int32 f becomes F *int32. - Repeated fields are slices. - Helper functions are available to aid the setting of fields. msg.Foo = proto.String("hello") // set field - Constants are defined to hold the default values of all fields that have them. They have the form Default_StructName_FieldName. Because the getter methods handle defaulted values, direct use of these constants should be rare. - Enums are given type names and maps from names to values. Enum values are prefixed by the enclosing message's name, or by the enum's type name if it is a top-level enum. Enum types have a String method, and a Enum method to assist in message construction. - Nested messages, groups and enums have type names prefixed with the name of the surrounding message type. - Extensions are given descriptor names that start with E_, followed by an underscore-delimited list of the nested messages that contain it (if any) followed by the CamelCased name of the extension field itself. HasExtension, ClearExtension, GetExtension and SetExtension are functions for manipulating extensions. - Oneof field sets are given a single field in their message, with distinguished wrapper types for each possible field value. - Marshal and Unmarshal are functions to encode and decode the wire format. When the .proto file specifies `syntax="proto3"`, there are some differences: - Non-repeated fields of non-message type are values instead of pointers. - Enum types do not get an Enum method. The simplest way to describe this is to see an example. Given file test.proto, containing package example; enum FOO { X = 17; } message Test { required string label = 1; optional int32 type = 2 [default=77]; repeated int64 reps = 3; optional group OptionalGroup = 4 { required string RequiredField = 5; } oneof union { int32 number = 6; string name = 7; } } The resulting file, test.pb.go, is: package example import proto "github.com/gogo/protobuf/proto" import math "math" type FOO int32 const ( FOO_X FOO = 17 ) var FOO_name = map[int32]string{ 17: "X", } var FOO_value = map[string]int32{ "X": 17, } func (x FOO) Enum() *FOO { p := new(FOO) *p = x return p } func (x FOO) String() string { return proto.EnumName(FOO_name, int32(x)) } func (x *FOO) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FOO_value, data) if err != nil { return err } *x = FOO(value) return nil } type Test struct { Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` // Types that are valid to be assigned to Union: // *Test_Number // *Test_Name Union isTest_Union `protobuf_oneof:"union"` XXX_unrecognized []byte `json:"-"` } func (m *Test) Reset() { *m = Test{} } func (m *Test) String() string { return proto.CompactTextString(m) } func (*Test) ProtoMessage() {} type isTest_Union interface { isTest_Union() } type Test_Number struct { Number int32 `protobuf:"varint,6,opt,name=number"` } type Test_Name struct { Name string `protobuf:"bytes,7,opt,name=name"` } func (*Test_Number) isTest_Union() {} func (*Test_Name) isTest_Union() {} func (m *Test) GetUnion() isTest_Union { if m != nil { return m.Union } return nil } const Default_Test_Type int32 = 77 func (m *Test) GetLabel() string { if m != nil && m.Label != nil { return *m.Label } return "" } func (m *Test) GetType() int32 { if m != nil && m.Type != nil { return *m.Type } return Default_Test_Type } func (m *Test) GetOptionalgroup() *Test_OptionalGroup { if m != nil { return m.Optionalgroup } return nil } type Test_OptionalGroup struct { RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"` } func (m *Test_OptionalGroup) Reset() { *m = Test_OptionalGroup{} } func (m *Test_OptionalGroup) String() string { return proto.CompactTextString(m) } func (m *Test_OptionalGroup) GetRequiredField() string { if m != nil && m.RequiredField != nil { return *m.RequiredField } return "" } func (m *Test) GetNumber() int32 { if x, ok := m.GetUnion().(*Test_Number); ok { return x.Number } return 0 } func (m *Test) GetName() string { if x, ok := m.GetUnion().(*Test_Name); ok { return x.Name } return "" } func init() { proto.RegisterEnum("example.FOO", FOO_name, FOO_value) } To create and play with a Test object: package main import ( "log" "github.com/gogo/protobuf/proto" pb "./example.pb" ) func main() { test := &pb.Test{ Label: proto.String("hello"), Type: proto.Int32(17), Reps: []int64{1, 2, 3}, Optionalgroup: &pb.Test_OptionalGroup{ RequiredField: proto.String("good bye"), }, Union: &pb.Test_Name{"fred"}, } data, err := proto.Marshal(test) if err != nil { log.Fatal("marshaling error: ", err) } newTest := &pb.Test{} err = proto.Unmarshal(data, newTest) if err != nil { log.Fatal("unmarshaling error: ", err) } // Now test and newTest contain the same data. if test.GetLabel() != newTest.GetLabel() { log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel()) } // Use a type switch to determine which oneof was set. switch u := test.Union.(type) { case *pb.Test_Number: // u.Number contains the number. case *pb.Test_Name: // u.Name contains the string. } // etc. } */ package proto import ( "encoding/json" "fmt" "log" "reflect" "sort" "strconv" "sync" ) // RequiredNotSetError is an error type returned by either Marshal or Unmarshal. // Marshal reports this when a required field is not initialized. // Unmarshal reports this when a required field is missing from the wire data. type RequiredNotSetError struct{ field string } func (e *RequiredNotSetError) Error() string { if e.field == "" { return fmt.Sprintf("proto: required field not set") } return fmt.Sprintf("proto: required field %q not set", e.field) } func (e *RequiredNotSetError) RequiredNotSet() bool { return true } type invalidUTF8Error struct{ field string } func (e *invalidUTF8Error) Error() string { if e.field == "" { return "proto: invalid UTF-8 detected" } return fmt.Sprintf("proto: field %q contains invalid UTF-8", e.field) } func (e *invalidUTF8Error) InvalidUTF8() bool { return true } // errInvalidUTF8 is a sentinel error to identify fields with invalid UTF-8. // This error should not be exposed to the external API as such errors should // be recreated with the field information. var errInvalidUTF8 = &invalidUTF8Error{} // isNonFatal reports whether the error is either a RequiredNotSet error // or a InvalidUTF8 error. func isNonFatal(err error) bool { if re, ok := err.(interface{ RequiredNotSet() bool }); ok && re.RequiredNotSet() { return true } if re, ok := err.(interface{ InvalidUTF8() bool }); ok && re.InvalidUTF8() { return true } return false } type nonFatal struct{ E error } // Merge merges err into nf and reports whether it was successful. // Otherwise it returns false for any fatal non-nil errors. func (nf *nonFatal) Merge(err error) (ok bool) { if err == nil { return true // not an error } if !isNonFatal(err) { return false // fatal error } if nf.E == nil { nf.E = err // store first instance of non-fatal error } return true } // Message is implemented by generated protocol buffer messages. type Message interface { Reset() String() string ProtoMessage() } // A Buffer is a buffer manager for marshaling and unmarshaling // protocol buffers. It may be reused between invocations to // reduce memory usage. It is not necessary to use a Buffer; // the global functions Marshal and Unmarshal create a // temporary Buffer and are fine for most applications. type Buffer struct { buf []byte // encode/decode byte stream index int // read point deterministic bool } // NewBuffer allocates a new Buffer and initializes its internal data to // the contents of the argument slice. func NewBuffer(e []byte) *Buffer { return &Buffer{buf: e} } // Reset resets the Buffer, ready for marshaling a new protocol buffer. func (p *Buffer) Reset() { p.buf = p.buf[0:0] // for reading/writing p.index = 0 // for reading } // SetBuf replaces the internal buffer with the slice, // ready for unmarshaling the contents of the slice. func (p *Buffer) SetBuf(s []byte) { p.buf = s p.index = 0 } // Bytes returns the contents of the Buffer. func (p *Buffer) Bytes() []byte { return p.buf } // SetDeterministic sets whether to use deterministic serialization. // // Deterministic serialization guarantees that for a given binary, equal // messages will always be serialized to the same bytes. This implies: // // - Repeated serialization of a message will return the same bytes. // - Different processes of the same binary (which may be executing on // different machines) will serialize equal messages to the same bytes. // // Note that the deterministic serialization is NOT canonical across // languages. It is not guaranteed to remain stable over time. It is unstable // across different builds with schema changes due to unknown fields. // Users who need canonical serialization (e.g., persistent storage in a // canonical form, fingerprinting, etc.) should define their own // canonicalization specification and implement their own serializer rather // than relying on this API. // // If deterministic serialization is requested, map entries will be sorted // by keys in lexographical order. This is an implementation detail and // subject to change. func (p *Buffer) SetDeterministic(deterministic bool) { p.deterministic = deterministic } /* * Helper routines for simplifying the creation of optional fields of basic type. */ // Bool is a helper routine that allocates a new bool value // to store v and returns a pointer to it. func Bool(v bool) *bool { return &v } // Int32 is a helper routine that allocates a new int32 value // to store v and returns a pointer to it. func Int32(v int32) *int32 { return &v } // Int is a helper routine that allocates a new int32 value // to store v and returns a pointer to it, but unlike Int32 // its argument value is an int. func Int(v int) *int32 { p := new(int32) *p = int32(v) return p } // Int64 is a helper routine that allocates a new int64 value // to store v and returns a pointer to it. func Int64(v int64) *int64 { return &v } // Float32 is a helper routine that allocates a new float32 value // to store v and returns a pointer to it. func Float32(v float32) *float32 { return &v } // Float64 is a helper routine that allocates a new float64 value // to store v and returns a pointer to it. func Float64(v float64) *float64 { return &v } // Uint32 is a helper routine that allocates a new uint32 value // to store v and returns a pointer to it. func Uint32(v uint32) *uint32 { return &v } // Uint64 is a helper routine that allocates a new uint64 value // to store v and returns a pointer to it. func Uint64(v uint64) *uint64 { return &v } // String is a helper routine that allocates a new string value // to store v and returns a pointer to it. func String(v string) *string { return &v } // EnumName is a helper function to simplify printing protocol buffer enums // by name. Given an enum map and a value, it returns a useful string. func EnumName(m map[int32]string, v int32) string { s, ok := m[v] if ok { return s } return strconv.Itoa(int(v)) } // UnmarshalJSONEnum is a helper function to simplify recovering enum int values // from their JSON-encoded representation. Given a map from the enum's symbolic // names to its int values, and a byte buffer containing the JSON-encoded // value, it returns an int32 that can be cast to the enum type by the caller. // // The function can deal with both JSON representations, numeric and symbolic. func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error) { if data[0] == '"' { // New style: enums are strings. var repr string if err := json.Unmarshal(data, &repr); err != nil { return -1, err } val, ok := m[repr] if !ok { return 0, fmt.Errorf("unrecognized enum %s value %q", enumName, repr) } return val, nil } // Old style: enums are ints. var val int32 if err := json.Unmarshal(data, &val); err != nil { return 0, fmt.Errorf("cannot unmarshal %#q into enum %s", data, enumName) } return val, nil } // DebugPrint dumps the encoded data in b in a debugging format with a header // including the string s. Used in testing but made available for general debugging. func (p *Buffer) DebugPrint(s string, b []byte) { var u uint64 obuf := p.buf sindex := p.index p.buf = b p.index = 0 depth := 0 fmt.Printf("\n--- %s ---\n", s) out: for { for i := 0; i < depth; i++ { fmt.Print(" ") } index := p.index if index == len(p.buf) { break } op, err := p.DecodeVarint() if err != nil { fmt.Printf("%3d: fetching op err %v\n", index, err) break out } tag := op >> 3 wire := op & 7 switch wire { default: fmt.Printf("%3d: t=%3d unknown wire=%d\n", index, tag, wire) break out case WireBytes: var r []byte r, err = p.DecodeRawBytes(false) if err != nil { break out } fmt.Printf("%3d: t=%3d bytes [%d]", index, tag, len(r)) if len(r) <= 6 { for i := 0; i < len(r); i++ { fmt.Printf(" %.2x", r[i]) } } else { for i := 0; i < 3; i++ { fmt.Printf(" %.2x", r[i]) } fmt.Printf(" ..") for i := len(r) - 3; i < len(r); i++ { fmt.Printf(" %.2x", r[i]) } } fmt.Printf("\n") case WireFixed32: u, err = p.DecodeFixed32() if err != nil { fmt.Printf("%3d: t=%3d fix32 err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d fix32 %d\n", index, tag, u) case WireFixed64: u, err = p.DecodeFixed64() if err != nil { fmt.Printf("%3d: t=%3d fix64 err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d fix64 %d\n", index, tag, u) case WireVarint: u, err = p.DecodeVarint() if err != nil { fmt.Printf("%3d: t=%3d varint err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d varint %d\n", index, tag, u) case WireStartGroup: fmt.Printf("%3d: t=%3d start\n", index, tag) depth++ case WireEndGroup: depth-- fmt.Printf("%3d: t=%3d end\n", index, tag) } } if depth != 0 { fmt.Printf("%3d: start-end not balanced %d\n", p.index, depth) } fmt.Printf("\n") p.buf = obuf p.index = sindex } // SetDefaults sets unset protocol buffer fields to their default values. // It only modifies fields that are both unset and have defined defaults. // It recursively sets default values in any non-nil sub-messages. func SetDefaults(pb Message) { setDefaults(reflect.ValueOf(pb), true, false) } // v is a struct. func setDefaults(v reflect.Value, recur, zeros bool) { if v.Kind() == reflect.Ptr { v = v.Elem() } defaultMu.RLock() dm, ok := defaults[v.Type()] defaultMu.RUnlock() if !ok { dm = buildDefaultMessage(v.Type()) defaultMu.Lock() defaults[v.Type()] = dm defaultMu.Unlock() } for _, sf := range dm.scalars { f := v.Field(sf.index) if !f.IsNil() { // field already set continue } dv := sf.value if dv == nil && !zeros { // no explicit default, and don't want to set zeros continue } fptr := f.Addr().Interface() // **T // TODO: Consider batching the allocations we do here. switch sf.kind { case reflect.Bool: b := new(bool) if dv != nil { *b = dv.(bool) } *(fptr.(**bool)) = b case reflect.Float32: f := new(float32) if dv != nil { *f = dv.(float32) } *(fptr.(**float32)) = f case reflect.Float64: f := new(float64) if dv != nil { *f = dv.(float64) } *(fptr.(**float64)) = f case reflect.Int32: // might be an enum if ft := f.Type(); ft != int32PtrType { // enum f.Set(reflect.New(ft.Elem())) if dv != nil { f.Elem().SetInt(int64(dv.(int32))) } } else { // int32 field i := new(int32) if dv != nil { *i = dv.(int32) } *(fptr.(**int32)) = i } case reflect.Int64: i := new(int64) if dv != nil { *i = dv.(int64) } *(fptr.(**int64)) = i case reflect.String: s := new(string) if dv != nil { *s = dv.(string) } *(fptr.(**string)) = s case reflect.Uint8: // exceptional case: []byte var b []byte if dv != nil { db := dv.([]byte) b = make([]byte, len(db)) copy(b, db) } else { b = []byte{} } *(fptr.(*[]byte)) = b case reflect.Uint32: u := new(uint32) if dv != nil { *u = dv.(uint32) } *(fptr.(**uint32)) = u case reflect.Uint64: u := new(uint64) if dv != nil { *u = dv.(uint64) } *(fptr.(**uint64)) = u default: log.Printf("proto: can't set default for field %v (sf.kind=%v)", f, sf.kind) } } for _, ni := range dm.nested { f := v.Field(ni) // f is *T or T or []*T or []T switch f.Kind() { case reflect.Struct: setDefaults(f, recur, zeros) case reflect.Ptr: if f.IsNil() { continue } setDefaults(f, recur, zeros) case reflect.Slice: for i := 0; i < f.Len(); i++ { e := f.Index(i) if e.Kind() == reflect.Ptr && e.IsNil() { continue } setDefaults(e, recur, zeros) } case reflect.Map: for _, k := range f.MapKeys() { e := f.MapIndex(k) if e.IsNil() { continue } setDefaults(e, recur, zeros) } } } } var ( // defaults maps a protocol buffer struct type to a slice of the fields, // with its scalar fields set to their proto-declared non-zero default values. defaultMu sync.RWMutex defaults = make(map[reflect.Type]defaultMessage) int32PtrType = reflect.TypeOf((*int32)(nil)) ) // defaultMessage represents information about the default values of a message. type defaultMessage struct { scalars []scalarField nested []int // struct field index of nested messages } type scalarField struct { index int // struct field index kind reflect.Kind // element type (the T in *T or []T) value interface{} // the proto-declared default value, or nil } // t is a struct type. func buildDefaultMessage(t reflect.Type) (dm defaultMessage) { sprop := GetProperties(t) for _, prop := range sprop.Prop { fi, ok := sprop.decoderTags.get(prop.Tag) if !ok { // XXX_unrecognized continue } ft := t.Field(fi).Type sf, nested, err := fieldDefault(ft, prop) switch { case err != nil: log.Print(err) case nested: dm.nested = append(dm.nested, fi) case sf != nil: sf.index = fi dm.scalars = append(dm.scalars, *sf) } } return dm } // fieldDefault returns the scalarField for field type ft. // sf will be nil if the field can not have a default. // nestedMessage will be true if this is a nested message. // Note that sf.index is not set on return. func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMessage bool, err error) { var canHaveDefault bool switch ft.Kind() { case reflect.Struct: nestedMessage = true // non-nullable case reflect.Ptr: if ft.Elem().Kind() == reflect.Struct { nestedMessage = true } else { canHaveDefault = true // proto2 scalar field } case reflect.Slice: switch ft.Elem().Kind() { case reflect.Ptr, reflect.Struct: nestedMessage = true // repeated message case reflect.Uint8: canHaveDefault = true // bytes field } case reflect.Map: if ft.Elem().Kind() == reflect.Ptr { nestedMessage = true // map with message values } } if !canHaveDefault { if nestedMessage { return nil, true, nil } return nil, false, nil } // We now know that ft is a pointer or slice. sf = &scalarField{kind: ft.Elem().Kind()} // scalar fields without defaults if !prop.HasDefault { return sf, false, nil } // a scalar field: either *T or []byte switch ft.Elem().Kind() { case reflect.Bool: x, err := strconv.ParseBool(prop.Default) if err != nil { return nil, false, fmt.Errorf("proto: bad default bool %q: %v", prop.Default, err) } sf.value = x case reflect.Float32: x, err := strconv.ParseFloat(prop.Default, 32) if err != nil { return nil, false, fmt.Errorf("proto: bad default float32 %q: %v", prop.Default, err) } sf.value = float32(x) case reflect.Float64: x, err := strconv.ParseFloat(prop.Default, 64) if err != nil { return nil, false, fmt.Errorf("proto: bad default float64 %q: %v", prop.Default, err) } sf.value = x case reflect.Int32: x, err := strconv.ParseInt(prop.Default, 10, 32) if err != nil { return nil, false, fmt.Errorf("proto: bad default int32 %q: %v", prop.Default, err) } sf.value = int32(x) case reflect.Int64: x, err := strconv.ParseInt(prop.Default, 10, 64) if err != nil { return nil, false, fmt.Errorf("proto: bad default int64 %q: %v", prop.Default, err) } sf.value = x case reflect.String: sf.value = prop.Default case reflect.Uint8: // []byte (not *uint8) sf.value = []byte(prop.Default) case reflect.Uint32: x, err := strconv.ParseUint(prop.Default, 10, 32) if err != nil { return nil, false, fmt.Errorf("proto: bad default uint32 %q: %v", prop.Default, err) } sf.value = uint32(x) case reflect.Uint64: x, err := strconv.ParseUint(prop.Default, 10, 64) if err != nil { return nil, false, fmt.Errorf("proto: bad default uint64 %q: %v", prop.Default, err) } sf.value = x default: return nil, false, fmt.Errorf("proto: unhandled def kind %v", ft.Elem().Kind()) } return sf, false, nil } // mapKeys returns a sort.Interface to be used for sorting the map keys. // Map fields may have key types of non-float scalars, strings and enums. func mapKeys(vs []reflect.Value) sort.Interface { s := mapKeySorter{vs: vs} // Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps. if len(vs) == 0 { return s } switch vs[0].Kind() { case reflect.Int32, reflect.Int64: s.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() } case reflect.Uint32, reflect.Uint64: s.less = func(a, b reflect.Value) bool { return a.Uint() < b.Uint() } case reflect.Bool: s.less = func(a, b reflect.Value) bool { return !a.Bool() && b.Bool() } // false < true case reflect.String: s.less = func(a, b reflect.Value) bool { return a.String() < b.String() } default: panic(fmt.Sprintf("unsupported map key type: %v", vs[0].Kind())) } return s } type mapKeySorter struct { vs []reflect.Value less func(a, b reflect.Value) bool } func (s mapKeySorter) Len() int { return len(s.vs) } func (s mapKeySorter) Swap(i, j int) { s.vs[i], s.vs[j] = s.vs[j], s.vs[i] } func (s mapKeySorter) Less(i, j int) bool { return s.less(s.vs[i], s.vs[j]) } // isProto3Zero reports whether v is a zero proto3 value. func isProto3Zero(v reflect.Value) bool { switch v.Kind() { case reflect.Bool: return !v.Bool() case reflect.Int32, reflect.Int64: return v.Int() == 0 case reflect.Uint32, reflect.Uint64: return v.Uint() == 0 case reflect.Float32, reflect.Float64: return v.Float() == 0 case reflect.String: return v.String() == "" } return false } // ProtoPackageIsVersion2 is referenced from generated protocol buffer files // to assert that that code is compatible with this version of the proto package. const GoGoProtoPackageIsVersion2 = true // ProtoPackageIsVersion1 is referenced from generated protocol buffer files // to assert that that code is compatible with this version of the proto package. const GoGoProtoPackageIsVersion1 = true // InternalMessageInfo is a type used internally by generated .pb.go files. // This type is not intended to be used by non-generated code. // This type is not subject to any compatibility guarantee. type InternalMessageInfo struct { marshal *marshalInfo unmarshal *unmarshalInfo merge *mergeInfo discard *discardInfo } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/lib_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "encoding/json" "strconv" ) type Sizer interface { Size() int } type ProtoSizer interface { ProtoSize() int } func MarshalJSONEnum(m map[int32]string, value int32) ([]byte, error) { s, ok := m[value] if !ok { s = strconv.Itoa(int(value)) } return json.Marshal(s) } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/message_set.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto /* * Support for message sets. */ import ( "errors" ) // errNoMessageTypeID occurs when a protocol buffer does not have a message type ID. // A message type ID is required for storing a protocol buffer in a message set. var errNoMessageTypeID = errors.New("proto does not have a message type ID") // The first two types (_MessageSet_Item and messageSet) // model what the protocol compiler produces for the following protocol message: // message MessageSet { // repeated group Item = 1 { // required int32 type_id = 2; // required string message = 3; // }; // } // That is the MessageSet wire format. We can't use a proto to generate these // because that would introduce a circular dependency between it and this package. type _MessageSet_Item struct { TypeId *int32 `protobuf:"varint,2,req,name=type_id"` Message []byte `protobuf:"bytes,3,req,name=message"` } type messageSet struct { Item []*_MessageSet_Item `protobuf:"group,1,rep"` XXX_unrecognized []byte // TODO: caching? } // Make sure messageSet is a Message. var _ Message = (*messageSet)(nil) // messageTypeIder is an interface satisfied by a protocol buffer type // that may be stored in a MessageSet. type messageTypeIder interface { MessageTypeId() int32 } func (ms *messageSet) find(pb Message) *_MessageSet_Item { mti, ok := pb.(messageTypeIder) if !ok { return nil } id := mti.MessageTypeId() for _, item := range ms.Item { if *item.TypeId == id { return item } } return nil } func (ms *messageSet) Has(pb Message) bool { return ms.find(pb) != nil } func (ms *messageSet) Unmarshal(pb Message) error { if item := ms.find(pb); item != nil { return Unmarshal(item.Message, pb) } if _, ok := pb.(messageTypeIder); !ok { return errNoMessageTypeID } return nil // TODO: return error instead? } func (ms *messageSet) Marshal(pb Message) error { msg, err := Marshal(pb) if err != nil { return err } if item := ms.find(pb); item != nil { // reuse existing item item.Message = msg return nil } mti, ok := pb.(messageTypeIder) if !ok { return errNoMessageTypeID } mtid := mti.MessageTypeId() ms.Item = append(ms.Item, &_MessageSet_Item{ TypeId: &mtid, Message: msg, }) return nil } func (ms *messageSet) Reset() { *ms = messageSet{} } func (ms *messageSet) String() string { return CompactTextString(ms) } func (*messageSet) ProtoMessage() {} // Support for the message_set_wire_format message option. func skipVarint(buf []byte) []byte { i := 0 for ; buf[i]&0x80 != 0; i++ { } return buf[i+1:] } // unmarshalMessageSet decodes the extension map encoded in buf in the message set wire format. // It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option. func unmarshalMessageSet(buf []byte, exts interface{}) error { var m map[int32]Extension switch exts := exts.(type) { case *XXX_InternalExtensions: m = exts.extensionsWrite() case map[int32]Extension: m = exts default: return errors.New("proto: not an extension map") } ms := new(messageSet) if err := Unmarshal(buf, ms); err != nil { return err } for _, item := range ms.Item { id := *item.TypeId msg := item.Message // Restore wire type and field number varint, plus length varint. // Be careful to preserve duplicate items. b := EncodeVarint(uint64(id)<<3 | WireBytes) if ext, ok := m[id]; ok { // Existing data; rip off the tag and length varint // so we join the new data correctly. // We can assume that ext.enc is set because we are unmarshaling. o := ext.enc[len(b):] // skip wire type and field number _, n := DecodeVarint(o) // calculate length of length varint o = o[n:] // skip length varint msg = append(o, msg...) // join old data and new data } b = append(b, EncodeVarint(uint64(len(msg)))...) b = append(b, msg...) m[id] = Extension{enc: b} } return nil } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/pointer_reflect.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2012 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // +build purego appengine js // This file contains an implementation of proto field accesses using package reflect. // It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can // be used on App Engine. package proto import ( "reflect" "sync" ) const unsafeAllowed = false // A field identifies a field in a struct, accessible from a pointer. // In this implementation, a field is identified by the sequence of field indices // passed to reflect's FieldByIndex. type field []int // toField returns a field equivalent to the given reflect field. func toField(f *reflect.StructField) field { return f.Index } // invalidField is an invalid field identifier. var invalidField = field(nil) // zeroField is a noop when calling pointer.offset. var zeroField = field([]int{}) // IsValid reports whether the field identifier is valid. func (f field) IsValid() bool { return f != nil } // The pointer type is for the table-driven decoder. // The implementation here uses a reflect.Value of pointer type to // create a generic pointer. In pointer_unsafe.go we use unsafe // instead of reflect to implement the same (but faster) interface. type pointer struct { v reflect.Value } // toPointer converts an interface of pointer type to a pointer // that points to the same target. func toPointer(i *Message) pointer { return pointer{v: reflect.ValueOf(*i)} } // toAddrPointer converts an interface to a pointer that points to // the interface data. func toAddrPointer(i *interface{}, isptr bool) pointer { v := reflect.ValueOf(*i) u := reflect.New(v.Type()) u.Elem().Set(v) return pointer{v: u} } // valToPointer converts v to a pointer. v must be of pointer type. func valToPointer(v reflect.Value) pointer { return pointer{v: v} } // offset converts from a pointer to a structure to a pointer to // one of its fields. func (p pointer) offset(f field) pointer { return pointer{v: p.v.Elem().FieldByIndex(f).Addr()} } func (p pointer) isNil() bool { return p.v.IsNil() } // grow updates the slice s in place to make it one element longer. // s must be addressable. // Returns the (addressable) new element. func grow(s reflect.Value) reflect.Value { n, m := s.Len(), s.Cap() if n < m { s.SetLen(n + 1) } else { s.Set(reflect.Append(s, reflect.Zero(s.Type().Elem()))) } return s.Index(n) } func (p pointer) toInt64() *int64 { return p.v.Interface().(*int64) } func (p pointer) toInt64Ptr() **int64 { return p.v.Interface().(**int64) } func (p pointer) toInt64Slice() *[]int64 { return p.v.Interface().(*[]int64) } var int32ptr = reflect.TypeOf((*int32)(nil)) func (p pointer) toInt32() *int32 { return p.v.Convert(int32ptr).Interface().(*int32) } // The toInt32Ptr/Slice methods don't work because of enums. // Instead, we must use set/get methods for the int32ptr/slice case. /* func (p pointer) toInt32Ptr() **int32 { return p.v.Interface().(**int32) } func (p pointer) toInt32Slice() *[]int32 { return p.v.Interface().(*[]int32) } */ func (p pointer) getInt32Ptr() *int32 { if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) { // raw int32 type return p.v.Elem().Interface().(*int32) } // an enum return p.v.Elem().Convert(int32PtrType).Interface().(*int32) } func (p pointer) setInt32Ptr(v int32) { // Allocate value in a *int32. Possibly convert that to a *enum. // Then assign it to a **int32 or **enum. // Note: we can convert *int32 to *enum, but we can't convert // **int32 to **enum! p.v.Elem().Set(reflect.ValueOf(&v).Convert(p.v.Type().Elem())) } // getInt32Slice copies []int32 from p as a new slice. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) getInt32Slice() []int32 { if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) { // raw int32 type return p.v.Elem().Interface().([]int32) } // an enum // Allocate a []int32, then assign []enum's values into it. // Note: we can't convert []enum to []int32. slice := p.v.Elem() s := make([]int32, slice.Len()) for i := 0; i < slice.Len(); i++ { s[i] = int32(slice.Index(i).Int()) } return s } // setInt32Slice copies []int32 into p as a new slice. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) setInt32Slice(v []int32) { if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) { // raw int32 type p.v.Elem().Set(reflect.ValueOf(v)) return } // an enum // Allocate a []enum, then assign []int32's values into it. // Note: we can't convert []enum to []int32. slice := reflect.MakeSlice(p.v.Type().Elem(), len(v), cap(v)) for i, x := range v { slice.Index(i).SetInt(int64(x)) } p.v.Elem().Set(slice) } func (p pointer) appendInt32Slice(v int32) { grow(p.v.Elem()).SetInt(int64(v)) } func (p pointer) toUint64() *uint64 { return p.v.Interface().(*uint64) } func (p pointer) toUint64Ptr() **uint64 { return p.v.Interface().(**uint64) } func (p pointer) toUint64Slice() *[]uint64 { return p.v.Interface().(*[]uint64) } func (p pointer) toUint32() *uint32 { return p.v.Interface().(*uint32) } func (p pointer) toUint32Ptr() **uint32 { return p.v.Interface().(**uint32) } func (p pointer) toUint32Slice() *[]uint32 { return p.v.Interface().(*[]uint32) } func (p pointer) toBool() *bool { return p.v.Interface().(*bool) } func (p pointer) toBoolPtr() **bool { return p.v.Interface().(**bool) } func (p pointer) toBoolSlice() *[]bool { return p.v.Interface().(*[]bool) } func (p pointer) toFloat64() *float64 { return p.v.Interface().(*float64) } func (p pointer) toFloat64Ptr() **float64 { return p.v.Interface().(**float64) } func (p pointer) toFloat64Slice() *[]float64 { return p.v.Interface().(*[]float64) } func (p pointer) toFloat32() *float32 { return p.v.Interface().(*float32) } func (p pointer) toFloat32Ptr() **float32 { return p.v.Interface().(**float32) } func (p pointer) toFloat32Slice() *[]float32 { return p.v.Interface().(*[]float32) } func (p pointer) toString() *string { return p.v.Interface().(*string) } func (p pointer) toStringPtr() **string { return p.v.Interface().(**string) } func (p pointer) toStringSlice() *[]string { return p.v.Interface().(*[]string) } func (p pointer) toBytes() *[]byte { return p.v.Interface().(*[]byte) } func (p pointer) toBytesSlice() *[][]byte { return p.v.Interface().(*[][]byte) } func (p pointer) toExtensions() *XXX_InternalExtensions { return p.v.Interface().(*XXX_InternalExtensions) } func (p pointer) toOldExtensions() *map[int32]Extension { return p.v.Interface().(*map[int32]Extension) } func (p pointer) getPointer() pointer { return pointer{v: p.v.Elem()} } func (p pointer) setPointer(q pointer) { p.v.Elem().Set(q.v) } func (p pointer) appendPointer(q pointer) { grow(p.v.Elem()).Set(q.v) } // getPointerSlice copies []*T from p as a new []pointer. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) getPointerSlice() []pointer { if p.v.IsNil() { return nil } n := p.v.Elem().Len() s := make([]pointer, n) for i := 0; i < n; i++ { s[i] = pointer{v: p.v.Elem().Index(i)} } return s } // setPointerSlice copies []pointer into p as a new []*T. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) setPointerSlice(v []pointer) { if v == nil { p.v.Elem().Set(reflect.New(p.v.Elem().Type()).Elem()) return } s := reflect.MakeSlice(p.v.Elem().Type(), 0, len(v)) for _, p := range v { s = reflect.Append(s, p.v) } p.v.Elem().Set(s) } // getInterfacePointer returns a pointer that points to the // interface data of the interface pointed by p. func (p pointer) getInterfacePointer() pointer { if p.v.Elem().IsNil() { return pointer{v: p.v.Elem()} } return pointer{v: p.v.Elem().Elem().Elem().Field(0).Addr()} // *interface -> interface -> *struct -> struct } func (p pointer) asPointerTo(t reflect.Type) reflect.Value { // TODO: check that p.v.Type().Elem() == t? return p.v } func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } func atomicLoadDiscardInfo(p **discardInfo) *discardInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } var atomicLock sync.Mutex ================================================ FILE: vendor/github.com/gogo/protobuf/proto/pointer_reflect_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2018, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // +build purego appengine js // This file contains an implementation of proto field accesses using package reflect. // It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can // be used on App Engine. package proto import ( "reflect" ) // TODO: untested, so probably incorrect. func (p pointer) getRef() pointer { return pointer{v: p.v.Addr()} } func (p pointer) appendRef(v pointer, typ reflect.Type) { slice := p.getSlice(typ) elem := v.asPointerTo(typ).Elem() newSlice := reflect.Append(slice, elem) slice.Set(newSlice) } func (p pointer) getSlice(typ reflect.Type) reflect.Value { sliceTyp := reflect.SliceOf(typ) slice := p.asPointerTo(sliceTyp) slice = slice.Elem() return slice } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/pointer_unsafe.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2012 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // +build !purego,!appengine,!js // This file contains the implementation of the proto field accesses using package unsafe. package proto import ( "reflect" "sync/atomic" "unsafe" ) const unsafeAllowed = true // A field identifies a field in a struct, accessible from a pointer. // In this implementation, a field is identified by its byte offset from the start of the struct. type field uintptr // toField returns a field equivalent to the given reflect field. func toField(f *reflect.StructField) field { return field(f.Offset) } // invalidField is an invalid field identifier. const invalidField = ^field(0) // zeroField is a noop when calling pointer.offset. const zeroField = field(0) // IsValid reports whether the field identifier is valid. func (f field) IsValid() bool { return f != invalidField } // The pointer type below is for the new table-driven encoder/decoder. // The implementation here uses unsafe.Pointer to create a generic pointer. // In pointer_reflect.go we use reflect instead of unsafe to implement // the same (but slower) interface. type pointer struct { p unsafe.Pointer } // size of pointer var ptrSize = unsafe.Sizeof(uintptr(0)) // toPointer converts an interface of pointer type to a pointer // that points to the same target. func toPointer(i *Message) pointer { // Super-tricky - read pointer out of data word of interface value. // Saves ~25ns over the equivalent: // return valToPointer(reflect.ValueOf(*i)) return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]} } // toAddrPointer converts an interface to a pointer that points to // the interface data. func toAddrPointer(i *interface{}, isptr bool) pointer { // Super-tricky - read or get the address of data word of interface value. if isptr { // The interface is of pointer type, thus it is a direct interface. // The data word is the pointer data itself. We take its address. return pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)} } // The interface is not of pointer type. The data word is the pointer // to the data. return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]} } // valToPointer converts v to a pointer. v must be of pointer type. func valToPointer(v reflect.Value) pointer { return pointer{p: unsafe.Pointer(v.Pointer())} } // offset converts from a pointer to a structure to a pointer to // one of its fields. func (p pointer) offset(f field) pointer { // For safety, we should panic if !f.IsValid, however calling panic causes // this to no longer be inlineable, which is a serious performance cost. /* if !f.IsValid() { panic("invalid field") } */ return pointer{p: unsafe.Pointer(uintptr(p.p) + uintptr(f))} } func (p pointer) isNil() bool { return p.p == nil } func (p pointer) toInt64() *int64 { return (*int64)(p.p) } func (p pointer) toInt64Ptr() **int64 { return (**int64)(p.p) } func (p pointer) toInt64Slice() *[]int64 { return (*[]int64)(p.p) } func (p pointer) toInt32() *int32 { return (*int32)(p.p) } // See pointer_reflect.go for why toInt32Ptr/Slice doesn't exist. /* func (p pointer) toInt32Ptr() **int32 { return (**int32)(p.p) } func (p pointer) toInt32Slice() *[]int32 { return (*[]int32)(p.p) } */ func (p pointer) getInt32Ptr() *int32 { return *(**int32)(p.p) } func (p pointer) setInt32Ptr(v int32) { *(**int32)(p.p) = &v } // getInt32Slice loads a []int32 from p. // The value returned is aliased with the original slice. // This behavior differs from the implementation in pointer_reflect.go. func (p pointer) getInt32Slice() []int32 { return *(*[]int32)(p.p) } // setInt32Slice stores a []int32 to p. // The value set is aliased with the input slice. // This behavior differs from the implementation in pointer_reflect.go. func (p pointer) setInt32Slice(v []int32) { *(*[]int32)(p.p) = v } // TODO: Can we get rid of appendInt32Slice and use setInt32Slice instead? func (p pointer) appendInt32Slice(v int32) { s := (*[]int32)(p.p) *s = append(*s, v) } func (p pointer) toUint64() *uint64 { return (*uint64)(p.p) } func (p pointer) toUint64Ptr() **uint64 { return (**uint64)(p.p) } func (p pointer) toUint64Slice() *[]uint64 { return (*[]uint64)(p.p) } func (p pointer) toUint32() *uint32 { return (*uint32)(p.p) } func (p pointer) toUint32Ptr() **uint32 { return (**uint32)(p.p) } func (p pointer) toUint32Slice() *[]uint32 { return (*[]uint32)(p.p) } func (p pointer) toBool() *bool { return (*bool)(p.p) } func (p pointer) toBoolPtr() **bool { return (**bool)(p.p) } func (p pointer) toBoolSlice() *[]bool { return (*[]bool)(p.p) } func (p pointer) toFloat64() *float64 { return (*float64)(p.p) } func (p pointer) toFloat64Ptr() **float64 { return (**float64)(p.p) } func (p pointer) toFloat64Slice() *[]float64 { return (*[]float64)(p.p) } func (p pointer) toFloat32() *float32 { return (*float32)(p.p) } func (p pointer) toFloat32Ptr() **float32 { return (**float32)(p.p) } func (p pointer) toFloat32Slice() *[]float32 { return (*[]float32)(p.p) } func (p pointer) toString() *string { return (*string)(p.p) } func (p pointer) toStringPtr() **string { return (**string)(p.p) } func (p pointer) toStringSlice() *[]string { return (*[]string)(p.p) } func (p pointer) toBytes() *[]byte { return (*[]byte)(p.p) } func (p pointer) toBytesSlice() *[][]byte { return (*[][]byte)(p.p) } func (p pointer) toExtensions() *XXX_InternalExtensions { return (*XXX_InternalExtensions)(p.p) } func (p pointer) toOldExtensions() *map[int32]Extension { return (*map[int32]Extension)(p.p) } // getPointerSlice loads []*T from p as a []pointer. // The value returned is aliased with the original slice. // This behavior differs from the implementation in pointer_reflect.go. func (p pointer) getPointerSlice() []pointer { // Super-tricky - p should point to a []*T where T is a // message type. We load it as []pointer. return *(*[]pointer)(p.p) } // setPointerSlice stores []pointer into p as a []*T. // The value set is aliased with the input slice. // This behavior differs from the implementation in pointer_reflect.go. func (p pointer) setPointerSlice(v []pointer) { // Super-tricky - p should point to a []*T where T is a // message type. We store it as []pointer. *(*[]pointer)(p.p) = v } // getPointer loads the pointer at p and returns it. func (p pointer) getPointer() pointer { return pointer{p: *(*unsafe.Pointer)(p.p)} } // setPointer stores the pointer q at p. func (p pointer) setPointer(q pointer) { *(*unsafe.Pointer)(p.p) = q.p } // append q to the slice pointed to by p. func (p pointer) appendPointer(q pointer) { s := (*[]unsafe.Pointer)(p.p) *s = append(*s, q.p) } // getInterfacePointer returns a pointer that points to the // interface data of the interface pointed by p. func (p pointer) getInterfacePointer() pointer { // Super-tricky - read pointer out of data word of interface value. return pointer{p: (*(*[2]unsafe.Pointer)(p.p))[1]} } // asPointerTo returns a reflect.Value that is a pointer to an // object of type t stored at p. func (p pointer) asPointerTo(t reflect.Type) reflect.Value { return reflect.NewAt(t, p.p) } func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo { return (*unmarshalInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) } func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v)) } func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo { return (*marshalInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) } func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v)) } func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo { return (*mergeInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) } func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v)) } func atomicLoadDiscardInfo(p **discardInfo) *discardInfo { return (*discardInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) } func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v)) } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/pointer_unsafe_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2018, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // +build !purego,!appengine,!js // This file contains the implementation of the proto field accesses using package unsafe. package proto import ( "reflect" "unsafe" ) func (p pointer) getRef() pointer { return pointer{p: (unsafe.Pointer)(&p.p)} } func (p pointer) appendRef(v pointer, typ reflect.Type) { slice := p.getSlice(typ) elem := v.asPointerTo(typ).Elem() newSlice := reflect.Append(slice, elem) slice.Set(newSlice) } func (p pointer) getSlice(typ reflect.Type) reflect.Value { sliceTyp := reflect.SliceOf(typ) slice := p.asPointerTo(sliceTyp) slice = slice.Elem() return slice } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/properties.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto /* * Routines for encoding data into the wire format for protocol buffers. */ import ( "fmt" "log" "os" "reflect" "sort" "strconv" "strings" "sync" ) const debug bool = false // Constants that identify the encoding of a value on the wire. const ( WireVarint = 0 WireFixed64 = 1 WireBytes = 2 WireStartGroup = 3 WireEndGroup = 4 WireFixed32 = 5 ) // tagMap is an optimization over map[int]int for typical protocol buffer // use-cases. Encoded protocol buffers are often in tag order with small tag // numbers. type tagMap struct { fastTags []int slowTags map[int]int } // tagMapFastLimit is the upper bound on the tag number that will be stored in // the tagMap slice rather than its map. const tagMapFastLimit = 1024 func (p *tagMap) get(t int) (int, bool) { if t > 0 && t < tagMapFastLimit { if t >= len(p.fastTags) { return 0, false } fi := p.fastTags[t] return fi, fi >= 0 } fi, ok := p.slowTags[t] return fi, ok } func (p *tagMap) put(t int, fi int) { if t > 0 && t < tagMapFastLimit { for len(p.fastTags) < t+1 { p.fastTags = append(p.fastTags, -1) } p.fastTags[t] = fi return } if p.slowTags == nil { p.slowTags = make(map[int]int) } p.slowTags[t] = fi } // StructProperties represents properties for all the fields of a struct. // decoderTags and decoderOrigNames should only be used by the decoder. type StructProperties struct { Prop []*Properties // properties for each field reqCount int // required count decoderTags tagMap // map from proto tag to struct field number decoderOrigNames map[string]int // map from original name to struct field number order []int // list of struct field numbers in tag order // OneofTypes contains information about the oneof fields in this message. // It is keyed by the original name of a field. OneofTypes map[string]*OneofProperties } // OneofProperties represents information about a specific field in a oneof. type OneofProperties struct { Type reflect.Type // pointer to generated struct type for this oneof field Field int // struct field number of the containing oneof in the message Prop *Properties } // Implement the sorting interface so we can sort the fields in tag order, as recommended by the spec. // See encode.go, (*Buffer).enc_struct. func (sp *StructProperties) Len() int { return len(sp.order) } func (sp *StructProperties) Less(i, j int) bool { return sp.Prop[sp.order[i]].Tag < sp.Prop[sp.order[j]].Tag } func (sp *StructProperties) Swap(i, j int) { sp.order[i], sp.order[j] = sp.order[j], sp.order[i] } // Properties represents the protocol-specific behavior of a single struct field. type Properties struct { Name string // name of the field, for error messages OrigName string // original name before protocol compiler (always set) JSONName string // name to use for JSON; determined by protoc Wire string WireType int Tag int Required bool Optional bool Repeated bool Packed bool // relevant for repeated primitives only Enum string // set for enum types only proto3 bool // whether this is known to be a proto3 field oneof bool // whether this is a oneof field Default string // default value HasDefault bool // whether an explicit default was provided CustomType string CastType string StdTime bool StdDuration bool WktPointer bool stype reflect.Type // set for struct types only ctype reflect.Type // set for custom types only sprop *StructProperties // set for struct types only mtype reflect.Type // set for map types only MapKeyProp *Properties // set for map types only MapValProp *Properties // set for map types only } // String formats the properties in the protobuf struct field tag style. func (p *Properties) String() string { s := p.Wire s += "," s += strconv.Itoa(p.Tag) if p.Required { s += ",req" } if p.Optional { s += ",opt" } if p.Repeated { s += ",rep" } if p.Packed { s += ",packed" } s += ",name=" + p.OrigName if p.JSONName != p.OrigName { s += ",json=" + p.JSONName } if p.proto3 { s += ",proto3" } if p.oneof { s += ",oneof" } if len(p.Enum) > 0 { s += ",enum=" + p.Enum } if p.HasDefault { s += ",def=" + p.Default } return s } // Parse populates p by parsing a string in the protobuf struct field tag style. func (p *Properties) Parse(s string) { // "bytes,49,opt,name=foo,def=hello!" fields := strings.Split(s, ",") // breaks def=, but handled below. if len(fields) < 2 { fmt.Fprintf(os.Stderr, "proto: tag has too few fields: %q\n", s) return } p.Wire = fields[0] switch p.Wire { case "varint": p.WireType = WireVarint case "fixed32": p.WireType = WireFixed32 case "fixed64": p.WireType = WireFixed64 case "zigzag32": p.WireType = WireVarint case "zigzag64": p.WireType = WireVarint case "bytes", "group": p.WireType = WireBytes // no numeric converter for non-numeric types default: fmt.Fprintf(os.Stderr, "proto: tag has unknown wire type: %q\n", s) return } var err error p.Tag, err = strconv.Atoi(fields[1]) if err != nil { return } outer: for i := 2; i < len(fields); i++ { f := fields[i] switch { case f == "req": p.Required = true case f == "opt": p.Optional = true case f == "rep": p.Repeated = true case f == "packed": p.Packed = true case strings.HasPrefix(f, "name="): p.OrigName = f[5:] case strings.HasPrefix(f, "json="): p.JSONName = f[5:] case strings.HasPrefix(f, "enum="): p.Enum = f[5:] case f == "proto3": p.proto3 = true case f == "oneof": p.oneof = true case strings.HasPrefix(f, "def="): p.HasDefault = true p.Default = f[4:] // rest of string if i+1 < len(fields) { // Commas aren't escaped, and def is always last. p.Default += "," + strings.Join(fields[i+1:], ",") break outer } case strings.HasPrefix(f, "embedded="): p.OrigName = strings.Split(f, "=")[1] case strings.HasPrefix(f, "customtype="): p.CustomType = strings.Split(f, "=")[1] case strings.HasPrefix(f, "casttype="): p.CastType = strings.Split(f, "=")[1] case f == "stdtime": p.StdTime = true case f == "stdduration": p.StdDuration = true case f == "wktptr": p.WktPointer = true } } } var protoMessageType = reflect.TypeOf((*Message)(nil)).Elem() // setFieldProps initializes the field properties for submessages and maps. func (p *Properties) setFieldProps(typ reflect.Type, f *reflect.StructField, lockGetProp bool) { isMap := typ.Kind() == reflect.Map if len(p.CustomType) > 0 && !isMap { p.ctype = typ p.setTag(lockGetProp) return } if p.StdTime && !isMap { p.setTag(lockGetProp) return } if p.StdDuration && !isMap { p.setTag(lockGetProp) return } if p.WktPointer && !isMap { p.setTag(lockGetProp) return } switch t1 := typ; t1.Kind() { case reflect.Struct: p.stype = typ case reflect.Ptr: if t1.Elem().Kind() == reflect.Struct { p.stype = t1.Elem() } case reflect.Slice: switch t2 := t1.Elem(); t2.Kind() { case reflect.Ptr: switch t3 := t2.Elem(); t3.Kind() { case reflect.Struct: p.stype = t3 } case reflect.Struct: p.stype = t2 } case reflect.Map: p.mtype = t1 p.MapKeyProp = &Properties{} p.MapKeyProp.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp) p.MapValProp = &Properties{} vtype := p.mtype.Elem() if vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice { // The value type is not a message (*T) or bytes ([]byte), // so we need encoders for the pointer to this type. vtype = reflect.PtrTo(vtype) } p.MapValProp.CustomType = p.CustomType p.MapValProp.StdDuration = p.StdDuration p.MapValProp.StdTime = p.StdTime p.MapValProp.WktPointer = p.WktPointer p.MapValProp.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp) } p.setTag(lockGetProp) } func (p *Properties) setTag(lockGetProp bool) { if p.stype != nil { if lockGetProp { p.sprop = GetProperties(p.stype) } else { p.sprop = getPropertiesLocked(p.stype) } } } var ( marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem() ) // Init populates the properties from a protocol buffer struct tag. func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) { p.init(typ, name, tag, f, true) } func (p *Properties) init(typ reflect.Type, name, tag string, f *reflect.StructField, lockGetProp bool) { // "bytes,49,opt,def=hello!" p.Name = name p.OrigName = name if tag == "" { return } p.Parse(tag) p.setFieldProps(typ, f, lockGetProp) } var ( propertiesMu sync.RWMutex propertiesMap = make(map[reflect.Type]*StructProperties) ) // GetProperties returns the list of properties for the type represented by t. // t must represent a generated struct type of a protocol message. func GetProperties(t reflect.Type) *StructProperties { if t.Kind() != reflect.Struct { panic("proto: type must have kind struct") } // Most calls to GetProperties in a long-running program will be // retrieving details for types we have seen before. propertiesMu.RLock() sprop, ok := propertiesMap[t] propertiesMu.RUnlock() if ok { return sprop } propertiesMu.Lock() sprop = getPropertiesLocked(t) propertiesMu.Unlock() return sprop } // getPropertiesLocked requires that propertiesMu is held. func getPropertiesLocked(t reflect.Type) *StructProperties { if prop, ok := propertiesMap[t]; ok { return prop } prop := new(StructProperties) // in case of recursive protos, fill this in now. propertiesMap[t] = prop // build properties prop.Prop = make([]*Properties, t.NumField()) prop.order = make([]int, t.NumField()) isOneofMessage := false for i := 0; i < t.NumField(); i++ { f := t.Field(i) p := new(Properties) name := f.Name p.init(f.Type, name, f.Tag.Get("protobuf"), &f, false) oneof := f.Tag.Get("protobuf_oneof") // special case if oneof != "" { isOneofMessage = true // Oneof fields don't use the traditional protobuf tag. p.OrigName = oneof } prop.Prop[i] = p prop.order[i] = i if debug { print(i, " ", f.Name, " ", t.String(), " ") if p.Tag > 0 { print(p.String()) } print("\n") } } // Re-order prop.order. sort.Sort(prop) type oneofMessage interface { XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) } if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); isOneofMessage && ok { var oots []interface{} _, _, _, oots = om.XXX_OneofFuncs() // Interpret oneof metadata. prop.OneofTypes = make(map[string]*OneofProperties) for _, oot := range oots { oop := &OneofProperties{ Type: reflect.ValueOf(oot).Type(), // *T Prop: new(Properties), } sft := oop.Type.Elem().Field(0) oop.Prop.Name = sft.Name oop.Prop.Parse(sft.Tag.Get("protobuf")) // There will be exactly one interface field that // this new value is assignable to. for i := 0; i < t.NumField(); i++ { f := t.Field(i) if f.Type.Kind() != reflect.Interface { continue } if !oop.Type.AssignableTo(f.Type) { continue } oop.Field = i break } prop.OneofTypes[oop.Prop.OrigName] = oop } } // build required counts // build tags reqCount := 0 prop.decoderOrigNames = make(map[string]int) for i, p := range prop.Prop { if strings.HasPrefix(p.Name, "XXX_") { // Internal fields should not appear in tags/origNames maps. // They are handled specially when encoding and decoding. continue } if p.Required { reqCount++ } prop.decoderTags.put(p.Tag, i) prop.decoderOrigNames[p.OrigName] = i } prop.reqCount = reqCount return prop } // A global registry of enum types. // The generated code will register the generated maps by calling RegisterEnum. var enumValueMaps = make(map[string]map[string]int32) var enumStringMaps = make(map[string]map[int32]string) // RegisterEnum is called from the generated code to install the enum descriptor // maps into the global table to aid parsing text format protocol buffers. func RegisterEnum(typeName string, unusedNameMap map[int32]string, valueMap map[string]int32) { if _, ok := enumValueMaps[typeName]; ok { panic("proto: duplicate enum registered: " + typeName) } enumValueMaps[typeName] = valueMap if _, ok := enumStringMaps[typeName]; ok { panic("proto: duplicate enum registered: " + typeName) } enumStringMaps[typeName] = unusedNameMap } // EnumValueMap returns the mapping from names to integers of the // enum type enumType, or a nil if not found. func EnumValueMap(enumType string) map[string]int32 { return enumValueMaps[enumType] } // A registry of all linked message types. // The string is a fully-qualified proto name ("pkg.Message"). var ( protoTypedNils = make(map[string]Message) // a map from proto names to typed nil pointers protoMapTypes = make(map[string]reflect.Type) // a map from proto names to map types revProtoTypes = make(map[reflect.Type]string) ) // RegisterType is called from generated code and maps from the fully qualified // proto name to the type (pointer to struct) of the protocol buffer. func RegisterType(x Message, name string) { if _, ok := protoTypedNils[name]; ok { // TODO: Some day, make this a panic. log.Printf("proto: duplicate proto type registered: %s", name) return } t := reflect.TypeOf(x) if v := reflect.ValueOf(x); v.Kind() == reflect.Ptr && v.Pointer() == 0 { // Generated code always calls RegisterType with nil x. // This check is just for extra safety. protoTypedNils[name] = x } else { protoTypedNils[name] = reflect.Zero(t).Interface().(Message) } revProtoTypes[t] = name } // RegisterMapType is called from generated code and maps from the fully qualified // proto name to the native map type of the proto map definition. func RegisterMapType(x interface{}, name string) { if reflect.TypeOf(x).Kind() != reflect.Map { panic(fmt.Sprintf("RegisterMapType(%T, %q); want map", x, name)) } if _, ok := protoMapTypes[name]; ok { log.Printf("proto: duplicate proto type registered: %s", name) return } t := reflect.TypeOf(x) protoMapTypes[name] = t revProtoTypes[t] = name } // MessageName returns the fully-qualified proto name for the given message type. func MessageName(x Message) string { type xname interface { XXX_MessageName() string } if m, ok := x.(xname); ok { return m.XXX_MessageName() } return revProtoTypes[reflect.TypeOf(x)] } // MessageType returns the message type (pointer to struct) for a named message. // The type is not guaranteed to implement proto.Message if the name refers to a // map entry. func MessageType(name string) reflect.Type { if t, ok := protoTypedNils[name]; ok { return reflect.TypeOf(t) } return protoMapTypes[name] } // A registry of all linked proto files. var ( protoFiles = make(map[string][]byte) // file name => fileDescriptor ) // RegisterFile is called from generated code and maps from the // full file name of a .proto file to its compressed FileDescriptorProto. func RegisterFile(filename string, fileDescriptor []byte) { protoFiles[filename] = fileDescriptor } // FileDescriptor returns the compressed FileDescriptorProto for a .proto file. func FileDescriptor(filename string) []byte { return protoFiles[filename] } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/properties_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2018, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "reflect" ) var sizerType = reflect.TypeOf((*Sizer)(nil)).Elem() var protosizerType = reflect.TypeOf((*ProtoSizer)(nil)).Elem() ================================================ FILE: vendor/github.com/gogo/protobuf/proto/skip_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "fmt" "io" ) func Skip(data []byte) (n int, err error) { l := len(data) index := 0 for index < l { var wire uint64 for shift := uint(0); ; shift += 7 { if index >= l { return 0, io.ErrUnexpectedEOF } b := data[index] index++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for { if index >= l { return 0, io.ErrUnexpectedEOF } index++ if data[index-1] < 0x80 { break } } return index, nil case 1: index += 8 return index, nil case 2: var length int for shift := uint(0); ; shift += 7 { if index >= l { return 0, io.ErrUnexpectedEOF } b := data[index] index++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } index += length return index, nil case 3: for { var innerWire uint64 var start int = index for shift := uint(0); ; shift += 7 { if index >= l { return 0, io.ErrUnexpectedEOF } b := data[index] index++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := Skip(data[start:]) if err != nil { return 0, err } index = start + next } return index, nil case 4: return index, nil case 5: index += 4 return index, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/table_marshal.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "errors" "fmt" "math" "reflect" "sort" "strconv" "strings" "sync" "sync/atomic" "unicode/utf8" ) // a sizer takes a pointer to a field and the size of its tag, computes the size of // the encoded data. type sizer func(pointer, int) int // a marshaler takes a byte slice, a pointer to a field, and its tag (in wire format), // marshals the field to the end of the slice, returns the slice and error (if any). type marshaler func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) // marshalInfo is the information used for marshaling a message. type marshalInfo struct { typ reflect.Type fields []*marshalFieldInfo unrecognized field // offset of XXX_unrecognized extensions field // offset of XXX_InternalExtensions v1extensions field // offset of XXX_extensions sizecache field // offset of XXX_sizecache initialized int32 // 0 -- only typ is set, 1 -- fully initialized messageset bool // uses message set wire format hasmarshaler bool // has custom marshaler sync.RWMutex // protect extElems map, also for initialization extElems map[int32]*marshalElemInfo // info of extension elements hassizer bool // has custom sizer hasprotosizer bool // has custom protosizer bytesExtensions field // offset of XXX_extensions where the field type is []byte } // marshalFieldInfo is the information used for marshaling a field of a message. type marshalFieldInfo struct { field field wiretag uint64 // tag in wire format tagsize int // size of tag in wire format sizer sizer marshaler marshaler isPointer bool required bool // field is required name string // name of the field, for error reporting oneofElems map[reflect.Type]*marshalElemInfo // info of oneof elements } // marshalElemInfo is the information used for marshaling an extension or oneof element. type marshalElemInfo struct { wiretag uint64 // tag in wire format tagsize int // size of tag in wire format sizer sizer marshaler marshaler isptr bool // elem is pointer typed, thus interface of this type is a direct interface (extension only) } var ( marshalInfoMap = map[reflect.Type]*marshalInfo{} marshalInfoLock sync.Mutex uint8SliceType = reflect.TypeOf(([]uint8)(nil)).Kind() ) // getMarshalInfo returns the information to marshal a given type of message. // The info it returns may not necessarily initialized. // t is the type of the message (NOT the pointer to it). func getMarshalInfo(t reflect.Type) *marshalInfo { marshalInfoLock.Lock() u, ok := marshalInfoMap[t] if !ok { u = &marshalInfo{typ: t} marshalInfoMap[t] = u } marshalInfoLock.Unlock() return u } // Size is the entry point from generated code, // and should be ONLY called by generated code. // It computes the size of encoded data of msg. // a is a pointer to a place to store cached marshal info. func (a *InternalMessageInfo) Size(msg Message) int { u := getMessageMarshalInfo(msg, a) ptr := toPointer(&msg) if ptr.isNil() { // We get here if msg is a typed nil ((*SomeMessage)(nil)), // so it satisfies the interface, and msg == nil wouldn't // catch it. We don't want crash in this case. return 0 } return u.size(ptr) } // Marshal is the entry point from generated code, // and should be ONLY called by generated code. // It marshals msg to the end of b. // a is a pointer to a place to store cached marshal info. func (a *InternalMessageInfo) Marshal(b []byte, msg Message, deterministic bool) ([]byte, error) { u := getMessageMarshalInfo(msg, a) ptr := toPointer(&msg) if ptr.isNil() { // We get here if msg is a typed nil ((*SomeMessage)(nil)), // so it satisfies the interface, and msg == nil wouldn't // catch it. We don't want crash in this case. return b, ErrNil } return u.marshal(b, ptr, deterministic) } func getMessageMarshalInfo(msg interface{}, a *InternalMessageInfo) *marshalInfo { // u := a.marshal, but atomically. // We use an atomic here to ensure memory consistency. u := atomicLoadMarshalInfo(&a.marshal) if u == nil { // Get marshal information from type of message. t := reflect.ValueOf(msg).Type() if t.Kind() != reflect.Ptr { panic(fmt.Sprintf("cannot handle non-pointer message type %v", t)) } u = getMarshalInfo(t.Elem()) // Store it in the cache for later users. // a.marshal = u, but atomically. atomicStoreMarshalInfo(&a.marshal, u) } return u } // size is the main function to compute the size of the encoded data of a message. // ptr is the pointer to the message. func (u *marshalInfo) size(ptr pointer) int { if atomic.LoadInt32(&u.initialized) == 0 { u.computeMarshalInfo() } // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. if u.hasmarshaler { // Uses the message's Size method if available if u.hassizer { s := ptr.asPointerTo(u.typ).Interface().(Sizer) return s.Size() } // Uses the message's ProtoSize method if available if u.hasprotosizer { s := ptr.asPointerTo(u.typ).Interface().(ProtoSizer) return s.ProtoSize() } m := ptr.asPointerTo(u.typ).Interface().(Marshaler) b, _ := m.Marshal() return len(b) } n := 0 for _, f := range u.fields { if f.isPointer && ptr.offset(f.field).getPointer().isNil() { // nil pointer always marshals to nothing continue } n += f.sizer(ptr.offset(f.field), f.tagsize) } if u.extensions.IsValid() { e := ptr.offset(u.extensions).toExtensions() if u.messageset { n += u.sizeMessageSet(e) } else { n += u.sizeExtensions(e) } } if u.v1extensions.IsValid() { m := *ptr.offset(u.v1extensions).toOldExtensions() n += u.sizeV1Extensions(m) } if u.bytesExtensions.IsValid() { s := *ptr.offset(u.bytesExtensions).toBytes() n += len(s) } if u.unrecognized.IsValid() { s := *ptr.offset(u.unrecognized).toBytes() n += len(s) } // cache the result for use in marshal if u.sizecache.IsValid() { atomic.StoreInt32(ptr.offset(u.sizecache).toInt32(), int32(n)) } return n } // cachedsize gets the size from cache. If there is no cache (i.e. message is not generated), // fall back to compute the size. func (u *marshalInfo) cachedsize(ptr pointer) int { if u.sizecache.IsValid() { return int(atomic.LoadInt32(ptr.offset(u.sizecache).toInt32())) } return u.size(ptr) } // marshal is the main function to marshal a message. It takes a byte slice and appends // the encoded data to the end of the slice, returns the slice and error (if any). // ptr is the pointer to the message. // If deterministic is true, map is marshaled in deterministic order. func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte, error) { if atomic.LoadInt32(&u.initialized) == 0 { u.computeMarshalInfo() } // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. if u.hasmarshaler { m := ptr.asPointerTo(u.typ).Interface().(Marshaler) b1, err := m.Marshal() b = append(b, b1...) return b, err } var err, errLater error // The old marshaler encodes extensions at beginning. if u.extensions.IsValid() { e := ptr.offset(u.extensions).toExtensions() if u.messageset { b, err = u.appendMessageSet(b, e, deterministic) } else { b, err = u.appendExtensions(b, e, deterministic) } if err != nil { return b, err } } if u.v1extensions.IsValid() { m := *ptr.offset(u.v1extensions).toOldExtensions() b, err = u.appendV1Extensions(b, m, deterministic) if err != nil { return b, err } } if u.bytesExtensions.IsValid() { s := *ptr.offset(u.bytesExtensions).toBytes() b = append(b, s...) } for _, f := range u.fields { if f.required { if f.isPointer && ptr.offset(f.field).getPointer().isNil() { // Required field is not set. // We record the error but keep going, to give a complete marshaling. if errLater == nil { errLater = &RequiredNotSetError{f.name} } continue } } if f.isPointer && ptr.offset(f.field).getPointer().isNil() { // nil pointer always marshals to nothing continue } b, err = f.marshaler(b, ptr.offset(f.field), f.wiretag, deterministic) if err != nil { if err1, ok := err.(*RequiredNotSetError); ok { // Required field in submessage is not set. // We record the error but keep going, to give a complete marshaling. if errLater == nil { errLater = &RequiredNotSetError{f.name + "." + err1.field} } continue } if err == errRepeatedHasNil { err = errors.New("proto: repeated field " + f.name + " has nil element") } if err == errInvalidUTF8 { if errLater == nil { fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name errLater = &invalidUTF8Error{fullName} } continue } return b, err } } if u.unrecognized.IsValid() { s := *ptr.offset(u.unrecognized).toBytes() b = append(b, s...) } return b, errLater } // computeMarshalInfo initializes the marshal info. func (u *marshalInfo) computeMarshalInfo() { u.Lock() defer u.Unlock() if u.initialized != 0 { // non-atomic read is ok as it is protected by the lock return } t := u.typ u.unrecognized = invalidField u.extensions = invalidField u.v1extensions = invalidField u.bytesExtensions = invalidField u.sizecache = invalidField isOneofMessage := false if reflect.PtrTo(t).Implements(sizerType) { u.hassizer = true } if reflect.PtrTo(t).Implements(protosizerType) { u.hasprotosizer = true } // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. if reflect.PtrTo(t).Implements(marshalerType) { u.hasmarshaler = true atomic.StoreInt32(&u.initialized, 1) return } n := t.NumField() // deal with XXX fields first for i := 0; i < t.NumField(); i++ { f := t.Field(i) if f.Tag.Get("protobuf_oneof") != "" { isOneofMessage = true } if !strings.HasPrefix(f.Name, "XXX_") { continue } switch f.Name { case "XXX_sizecache": u.sizecache = toField(&f) case "XXX_unrecognized": u.unrecognized = toField(&f) case "XXX_InternalExtensions": u.extensions = toField(&f) u.messageset = f.Tag.Get("protobuf_messageset") == "1" case "XXX_extensions": if f.Type.Kind() == reflect.Map { u.v1extensions = toField(&f) } else { u.bytesExtensions = toField(&f) } case "XXX_NoUnkeyedLiteral": // nothing to do default: panic("unknown XXX field: " + f.Name) } n-- } // get oneof implementers var oneofImplementers []interface{} // gogo: isOneofMessage is needed for embedded oneof messages, without a marshaler and unmarshaler if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok && isOneofMessage { _, _, _, oneofImplementers = m.XXX_OneofFuncs() } // normal fields fields := make([]marshalFieldInfo, n) // batch allocation u.fields = make([]*marshalFieldInfo, 0, n) for i, j := 0, 0; i < t.NumField(); i++ { f := t.Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } field := &fields[j] j++ field.name = f.Name u.fields = append(u.fields, field) if f.Tag.Get("protobuf_oneof") != "" { field.computeOneofFieldInfo(&f, oneofImplementers) continue } if f.Tag.Get("protobuf") == "" { // field has no tag (not in generated message), ignore it u.fields = u.fields[:len(u.fields)-1] j-- continue } field.computeMarshalFieldInfo(&f) } // fields are marshaled in tag order on the wire. sort.Sort(byTag(u.fields)) atomic.StoreInt32(&u.initialized, 1) } // helper for sorting fields by tag type byTag []*marshalFieldInfo func (a byTag) Len() int { return len(a) } func (a byTag) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a byTag) Less(i, j int) bool { return a[i].wiretag < a[j].wiretag } // getExtElemInfo returns the information to marshal an extension element. // The info it returns is initialized. func (u *marshalInfo) getExtElemInfo(desc *ExtensionDesc) *marshalElemInfo { // get from cache first u.RLock() e, ok := u.extElems[desc.Field] u.RUnlock() if ok { return e } t := reflect.TypeOf(desc.ExtensionType) // pointer or slice to basic type or struct tags := strings.Split(desc.Tag, ",") tag, err := strconv.Atoi(tags[1]) if err != nil { panic("tag is not an integer") } wt := wiretype(tags[0]) sizr, marshalr := typeMarshaler(t, tags, false, false) e = &marshalElemInfo{ wiretag: uint64(tag)<<3 | wt, tagsize: SizeVarint(uint64(tag) << 3), sizer: sizr, marshaler: marshalr, isptr: t.Kind() == reflect.Ptr, } // update cache u.Lock() if u.extElems == nil { u.extElems = make(map[int32]*marshalElemInfo) } u.extElems[desc.Field] = e u.Unlock() return e } // computeMarshalFieldInfo fills up the information to marshal a field. func (fi *marshalFieldInfo) computeMarshalFieldInfo(f *reflect.StructField) { // parse protobuf tag of the field. // tag has format of "bytes,49,opt,name=foo,def=hello!" tags := strings.Split(f.Tag.Get("protobuf"), ",") if tags[0] == "" { return } tag, err := strconv.Atoi(tags[1]) if err != nil { panic("tag is not an integer") } wt := wiretype(tags[0]) if tags[2] == "req" { fi.required = true } fi.setTag(f, tag, wt) fi.setMarshaler(f, tags) } func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) { fi.field = toField(f) fi.wiretag = math.MaxInt32 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire. fi.isPointer = true fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f) fi.oneofElems = make(map[reflect.Type]*marshalElemInfo) ityp := f.Type // interface type for _, o := range oneofImplementers { t := reflect.TypeOf(o) if !t.Implements(ityp) { continue } sf := t.Elem().Field(0) // oneof implementer is a struct with a single field tags := strings.Split(sf.Tag.Get("protobuf"), ",") tag, err := strconv.Atoi(tags[1]) if err != nil { panic("tag is not an integer") } wt := wiretype(tags[0]) sizr, marshalr := typeMarshaler(sf.Type, tags, false, true) // oneof should not omit any zero value fi.oneofElems[t.Elem()] = &marshalElemInfo{ wiretag: uint64(tag)<<3 | wt, tagsize: SizeVarint(uint64(tag) << 3), sizer: sizr, marshaler: marshalr, } } } type oneofMessage interface { XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) } // wiretype returns the wire encoding of the type. func wiretype(encoding string) uint64 { switch encoding { case "fixed32": return WireFixed32 case "fixed64": return WireFixed64 case "varint", "zigzag32", "zigzag64": return WireVarint case "bytes": return WireBytes case "group": return WireStartGroup } panic("unknown wire type " + encoding) } // setTag fills up the tag (in wire format) and its size in the info of a field. func (fi *marshalFieldInfo) setTag(f *reflect.StructField, tag int, wt uint64) { fi.field = toField(f) fi.wiretag = uint64(tag)<<3 | wt fi.tagsize = SizeVarint(uint64(tag) << 3) } // setMarshaler fills up the sizer and marshaler in the info of a field. func (fi *marshalFieldInfo) setMarshaler(f *reflect.StructField, tags []string) { switch f.Type.Kind() { case reflect.Map: // map field fi.isPointer = true fi.sizer, fi.marshaler = makeMapMarshaler(f) return case reflect.Ptr, reflect.Slice: fi.isPointer = true } fi.sizer, fi.marshaler = typeMarshaler(f.Type, tags, true, false) } // typeMarshaler returns the sizer and marshaler of a given field. // t is the type of the field. // tags is the generated "protobuf" tag of the field. // If nozero is true, zero value is not marshaled to the wire. // If oneof is true, it is a oneof field. func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (sizer, marshaler) { encoding := tags[0] pointer := false slice := false if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 { slice = true t = t.Elem() } if t.Kind() == reflect.Ptr { pointer = true t = t.Elem() } packed := false proto3 := false ctype := false isTime := false isDuration := false isWktPointer := false validateUTF8 := true for i := 2; i < len(tags); i++ { if tags[i] == "packed" { packed = true } if tags[i] == "proto3" { proto3 = true } if strings.HasPrefix(tags[i], "customtype=") { ctype = true } if tags[i] == "stdtime" { isTime = true } if tags[i] == "stdduration" { isDuration = true } if tags[i] == "wktptr" { isWktPointer = true } } validateUTF8 = validateUTF8 && proto3 if !proto3 && !pointer && !slice { nozero = false } if ctype { if reflect.PtrTo(t).Implements(customType) { if slice { return makeMessageRefSliceMarshaler(getMarshalInfo(t)) } if pointer { return makeCustomPtrMarshaler(getMarshalInfo(t)) } return makeCustomMarshaler(getMarshalInfo(t)) } else { panic(fmt.Sprintf("custom type: type: %v, does not implement the proto.custom interface", t)) } } if isTime { if pointer { if slice { return makeTimePtrSliceMarshaler(getMarshalInfo(t)) } return makeTimePtrMarshaler(getMarshalInfo(t)) } if slice { return makeTimeSliceMarshaler(getMarshalInfo(t)) } return makeTimeMarshaler(getMarshalInfo(t)) } if isDuration { if pointer { if slice { return makeDurationPtrSliceMarshaler(getMarshalInfo(t)) } return makeDurationPtrMarshaler(getMarshalInfo(t)) } if slice { return makeDurationSliceMarshaler(getMarshalInfo(t)) } return makeDurationMarshaler(getMarshalInfo(t)) } if isWktPointer { switch t.Kind() { case reflect.Float64: if pointer { if slice { return makeStdDoubleValuePtrSliceMarshaler(getMarshalInfo(t)) } return makeStdDoubleValuePtrMarshaler(getMarshalInfo(t)) } if slice { return makeStdDoubleValueSliceMarshaler(getMarshalInfo(t)) } return makeStdDoubleValueMarshaler(getMarshalInfo(t)) case reflect.Float32: if pointer { if slice { return makeStdFloatValuePtrSliceMarshaler(getMarshalInfo(t)) } return makeStdFloatValuePtrMarshaler(getMarshalInfo(t)) } if slice { return makeStdFloatValueSliceMarshaler(getMarshalInfo(t)) } return makeStdFloatValueMarshaler(getMarshalInfo(t)) case reflect.Int64: if pointer { if slice { return makeStdInt64ValuePtrSliceMarshaler(getMarshalInfo(t)) } return makeStdInt64ValuePtrMarshaler(getMarshalInfo(t)) } if slice { return makeStdInt64ValueSliceMarshaler(getMarshalInfo(t)) } return makeStdInt64ValueMarshaler(getMarshalInfo(t)) case reflect.Uint64: if pointer { if slice { return makeStdUInt64ValuePtrSliceMarshaler(getMarshalInfo(t)) } return makeStdUInt64ValuePtrMarshaler(getMarshalInfo(t)) } if slice { return makeStdUInt64ValueSliceMarshaler(getMarshalInfo(t)) } return makeStdUInt64ValueMarshaler(getMarshalInfo(t)) case reflect.Int32: if pointer { if slice { return makeStdInt32ValuePtrSliceMarshaler(getMarshalInfo(t)) } return makeStdInt32ValuePtrMarshaler(getMarshalInfo(t)) } if slice { return makeStdInt32ValueSliceMarshaler(getMarshalInfo(t)) } return makeStdInt32ValueMarshaler(getMarshalInfo(t)) case reflect.Uint32: if pointer { if slice { return makeStdUInt32ValuePtrSliceMarshaler(getMarshalInfo(t)) } return makeStdUInt32ValuePtrMarshaler(getMarshalInfo(t)) } if slice { return makeStdUInt32ValueSliceMarshaler(getMarshalInfo(t)) } return makeStdUInt32ValueMarshaler(getMarshalInfo(t)) case reflect.Bool: if pointer { if slice { return makeStdBoolValuePtrSliceMarshaler(getMarshalInfo(t)) } return makeStdBoolValuePtrMarshaler(getMarshalInfo(t)) } if slice { return makeStdBoolValueSliceMarshaler(getMarshalInfo(t)) } return makeStdBoolValueMarshaler(getMarshalInfo(t)) case reflect.String: if pointer { if slice { return makeStdStringValuePtrSliceMarshaler(getMarshalInfo(t)) } return makeStdStringValuePtrMarshaler(getMarshalInfo(t)) } if slice { return makeStdStringValueSliceMarshaler(getMarshalInfo(t)) } return makeStdStringValueMarshaler(getMarshalInfo(t)) case uint8SliceType: if pointer { if slice { return makeStdBytesValuePtrSliceMarshaler(getMarshalInfo(t)) } return makeStdBytesValuePtrMarshaler(getMarshalInfo(t)) } if slice { return makeStdBytesValueSliceMarshaler(getMarshalInfo(t)) } return makeStdBytesValueMarshaler(getMarshalInfo(t)) default: panic(fmt.Sprintf("unknown wktpointer type %#v", t)) } } switch t.Kind() { case reflect.Bool: if pointer { return sizeBoolPtr, appendBoolPtr } if slice { if packed { return sizeBoolPackedSlice, appendBoolPackedSlice } return sizeBoolSlice, appendBoolSlice } if nozero { return sizeBoolValueNoZero, appendBoolValueNoZero } return sizeBoolValue, appendBoolValue case reflect.Uint32: switch encoding { case "fixed32": if pointer { return sizeFixed32Ptr, appendFixed32Ptr } if slice { if packed { return sizeFixed32PackedSlice, appendFixed32PackedSlice } return sizeFixed32Slice, appendFixed32Slice } if nozero { return sizeFixed32ValueNoZero, appendFixed32ValueNoZero } return sizeFixed32Value, appendFixed32Value case "varint": if pointer { return sizeVarint32Ptr, appendVarint32Ptr } if slice { if packed { return sizeVarint32PackedSlice, appendVarint32PackedSlice } return sizeVarint32Slice, appendVarint32Slice } if nozero { return sizeVarint32ValueNoZero, appendVarint32ValueNoZero } return sizeVarint32Value, appendVarint32Value } case reflect.Int32: switch encoding { case "fixed32": if pointer { return sizeFixedS32Ptr, appendFixedS32Ptr } if slice { if packed { return sizeFixedS32PackedSlice, appendFixedS32PackedSlice } return sizeFixedS32Slice, appendFixedS32Slice } if nozero { return sizeFixedS32ValueNoZero, appendFixedS32ValueNoZero } return sizeFixedS32Value, appendFixedS32Value case "varint": if pointer { return sizeVarintS32Ptr, appendVarintS32Ptr } if slice { if packed { return sizeVarintS32PackedSlice, appendVarintS32PackedSlice } return sizeVarintS32Slice, appendVarintS32Slice } if nozero { return sizeVarintS32ValueNoZero, appendVarintS32ValueNoZero } return sizeVarintS32Value, appendVarintS32Value case "zigzag32": if pointer { return sizeZigzag32Ptr, appendZigzag32Ptr } if slice { if packed { return sizeZigzag32PackedSlice, appendZigzag32PackedSlice } return sizeZigzag32Slice, appendZigzag32Slice } if nozero { return sizeZigzag32ValueNoZero, appendZigzag32ValueNoZero } return sizeZigzag32Value, appendZigzag32Value } case reflect.Uint64: switch encoding { case "fixed64": if pointer { return sizeFixed64Ptr, appendFixed64Ptr } if slice { if packed { return sizeFixed64PackedSlice, appendFixed64PackedSlice } return sizeFixed64Slice, appendFixed64Slice } if nozero { return sizeFixed64ValueNoZero, appendFixed64ValueNoZero } return sizeFixed64Value, appendFixed64Value case "varint": if pointer { return sizeVarint64Ptr, appendVarint64Ptr } if slice { if packed { return sizeVarint64PackedSlice, appendVarint64PackedSlice } return sizeVarint64Slice, appendVarint64Slice } if nozero { return sizeVarint64ValueNoZero, appendVarint64ValueNoZero } return sizeVarint64Value, appendVarint64Value } case reflect.Int64: switch encoding { case "fixed64": if pointer { return sizeFixedS64Ptr, appendFixedS64Ptr } if slice { if packed { return sizeFixedS64PackedSlice, appendFixedS64PackedSlice } return sizeFixedS64Slice, appendFixedS64Slice } if nozero { return sizeFixedS64ValueNoZero, appendFixedS64ValueNoZero } return sizeFixedS64Value, appendFixedS64Value case "varint": if pointer { return sizeVarintS64Ptr, appendVarintS64Ptr } if slice { if packed { return sizeVarintS64PackedSlice, appendVarintS64PackedSlice } return sizeVarintS64Slice, appendVarintS64Slice } if nozero { return sizeVarintS64ValueNoZero, appendVarintS64ValueNoZero } return sizeVarintS64Value, appendVarintS64Value case "zigzag64": if pointer { return sizeZigzag64Ptr, appendZigzag64Ptr } if slice { if packed { return sizeZigzag64PackedSlice, appendZigzag64PackedSlice } return sizeZigzag64Slice, appendZigzag64Slice } if nozero { return sizeZigzag64ValueNoZero, appendZigzag64ValueNoZero } return sizeZigzag64Value, appendZigzag64Value } case reflect.Float32: if pointer { return sizeFloat32Ptr, appendFloat32Ptr } if slice { if packed { return sizeFloat32PackedSlice, appendFloat32PackedSlice } return sizeFloat32Slice, appendFloat32Slice } if nozero { return sizeFloat32ValueNoZero, appendFloat32ValueNoZero } return sizeFloat32Value, appendFloat32Value case reflect.Float64: if pointer { return sizeFloat64Ptr, appendFloat64Ptr } if slice { if packed { return sizeFloat64PackedSlice, appendFloat64PackedSlice } return sizeFloat64Slice, appendFloat64Slice } if nozero { return sizeFloat64ValueNoZero, appendFloat64ValueNoZero } return sizeFloat64Value, appendFloat64Value case reflect.String: if validateUTF8 { if pointer { return sizeStringPtr, appendUTF8StringPtr } if slice { return sizeStringSlice, appendUTF8StringSlice } if nozero { return sizeStringValueNoZero, appendUTF8StringValueNoZero } return sizeStringValue, appendUTF8StringValue } if pointer { return sizeStringPtr, appendStringPtr } if slice { return sizeStringSlice, appendStringSlice } if nozero { return sizeStringValueNoZero, appendStringValueNoZero } return sizeStringValue, appendStringValue case reflect.Slice: if slice { return sizeBytesSlice, appendBytesSlice } if oneof { // Oneof bytes field may also have "proto3" tag. // We want to marshal it as a oneof field. Do this // check before the proto3 check. return sizeBytesOneof, appendBytesOneof } if proto3 { return sizeBytes3, appendBytes3 } return sizeBytes, appendBytes case reflect.Struct: switch encoding { case "group": if slice { return makeGroupSliceMarshaler(getMarshalInfo(t)) } return makeGroupMarshaler(getMarshalInfo(t)) case "bytes": if pointer { if slice { return makeMessageSliceMarshaler(getMarshalInfo(t)) } return makeMessageMarshaler(getMarshalInfo(t)) } else { if slice { return makeMessageRefSliceMarshaler(getMarshalInfo(t)) } return makeMessageRefMarshaler(getMarshalInfo(t)) } } } panic(fmt.Sprintf("unknown or mismatched type: type: %v, wire type: %v", t, encoding)) } // Below are functions to size/marshal a specific type of a field. // They are stored in the field's info, and called by function pointers. // They have type sizer or marshaler. func sizeFixed32Value(_ pointer, tagsize int) int { return 4 + tagsize } func sizeFixed32ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toUint32() if v == 0 { return 0 } return 4 + tagsize } func sizeFixed32Ptr(ptr pointer, tagsize int) int { p := *ptr.toUint32Ptr() if p == nil { return 0 } return 4 + tagsize } func sizeFixed32Slice(ptr pointer, tagsize int) int { s := *ptr.toUint32Slice() return (4 + tagsize) * len(s) } func sizeFixed32PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toUint32Slice() if len(s) == 0 { return 0 } return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize } func sizeFixedS32Value(_ pointer, tagsize int) int { return 4 + tagsize } func sizeFixedS32ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt32() if v == 0 { return 0 } return 4 + tagsize } func sizeFixedS32Ptr(ptr pointer, tagsize int) int { p := ptr.getInt32Ptr() if p == nil { return 0 } return 4 + tagsize } func sizeFixedS32Slice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() return (4 + tagsize) * len(s) } func sizeFixedS32PackedSlice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() if len(s) == 0 { return 0 } return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize } func sizeFloat32Value(_ pointer, tagsize int) int { return 4 + tagsize } func sizeFloat32ValueNoZero(ptr pointer, tagsize int) int { v := math.Float32bits(*ptr.toFloat32()) if v == 0 { return 0 } return 4 + tagsize } func sizeFloat32Ptr(ptr pointer, tagsize int) int { p := *ptr.toFloat32Ptr() if p == nil { return 0 } return 4 + tagsize } func sizeFloat32Slice(ptr pointer, tagsize int) int { s := *ptr.toFloat32Slice() return (4 + tagsize) * len(s) } func sizeFloat32PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toFloat32Slice() if len(s) == 0 { return 0 } return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize } func sizeFixed64Value(_ pointer, tagsize int) int { return 8 + tagsize } func sizeFixed64ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toUint64() if v == 0 { return 0 } return 8 + tagsize } func sizeFixed64Ptr(ptr pointer, tagsize int) int { p := *ptr.toUint64Ptr() if p == nil { return 0 } return 8 + tagsize } func sizeFixed64Slice(ptr pointer, tagsize int) int { s := *ptr.toUint64Slice() return (8 + tagsize) * len(s) } func sizeFixed64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toUint64Slice() if len(s) == 0 { return 0 } return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize } func sizeFixedS64Value(_ pointer, tagsize int) int { return 8 + tagsize } func sizeFixedS64ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt64() if v == 0 { return 0 } return 8 + tagsize } func sizeFixedS64Ptr(ptr pointer, tagsize int) int { p := *ptr.toInt64Ptr() if p == nil { return 0 } return 8 + tagsize } func sizeFixedS64Slice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() return (8 + tagsize) * len(s) } func sizeFixedS64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() if len(s) == 0 { return 0 } return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize } func sizeFloat64Value(_ pointer, tagsize int) int { return 8 + tagsize } func sizeFloat64ValueNoZero(ptr pointer, tagsize int) int { v := math.Float64bits(*ptr.toFloat64()) if v == 0 { return 0 } return 8 + tagsize } func sizeFloat64Ptr(ptr pointer, tagsize int) int { p := *ptr.toFloat64Ptr() if p == nil { return 0 } return 8 + tagsize } func sizeFloat64Slice(ptr pointer, tagsize int) int { s := *ptr.toFloat64Slice() return (8 + tagsize) * len(s) } func sizeFloat64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toFloat64Slice() if len(s) == 0 { return 0 } return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize } func sizeVarint32Value(ptr pointer, tagsize int) int { v := *ptr.toUint32() return SizeVarint(uint64(v)) + tagsize } func sizeVarint32ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toUint32() if v == 0 { return 0 } return SizeVarint(uint64(v)) + tagsize } func sizeVarint32Ptr(ptr pointer, tagsize int) int { p := *ptr.toUint32Ptr() if p == nil { return 0 } return SizeVarint(uint64(*p)) + tagsize } func sizeVarint32Slice(ptr pointer, tagsize int) int { s := *ptr.toUint32Slice() n := 0 for _, v := range s { n += SizeVarint(uint64(v)) + tagsize } return n } func sizeVarint32PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toUint32Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } return n + SizeVarint(uint64(n)) + tagsize } func sizeVarintS32Value(ptr pointer, tagsize int) int { v := *ptr.toInt32() return SizeVarint(uint64(v)) + tagsize } func sizeVarintS32ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt32() if v == 0 { return 0 } return SizeVarint(uint64(v)) + tagsize } func sizeVarintS32Ptr(ptr pointer, tagsize int) int { p := ptr.getInt32Ptr() if p == nil { return 0 } return SizeVarint(uint64(*p)) + tagsize } func sizeVarintS32Slice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() n := 0 for _, v := range s { n += SizeVarint(uint64(v)) + tagsize } return n } func sizeVarintS32PackedSlice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } return n + SizeVarint(uint64(n)) + tagsize } func sizeVarint64Value(ptr pointer, tagsize int) int { v := *ptr.toUint64() return SizeVarint(v) + tagsize } func sizeVarint64ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toUint64() if v == 0 { return 0 } return SizeVarint(v) + tagsize } func sizeVarint64Ptr(ptr pointer, tagsize int) int { p := *ptr.toUint64Ptr() if p == nil { return 0 } return SizeVarint(*p) + tagsize } func sizeVarint64Slice(ptr pointer, tagsize int) int { s := *ptr.toUint64Slice() n := 0 for _, v := range s { n += SizeVarint(v) + tagsize } return n } func sizeVarint64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toUint64Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(v) } return n + SizeVarint(uint64(n)) + tagsize } func sizeVarintS64Value(ptr pointer, tagsize int) int { v := *ptr.toInt64() return SizeVarint(uint64(v)) + tagsize } func sizeVarintS64ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt64() if v == 0 { return 0 } return SizeVarint(uint64(v)) + tagsize } func sizeVarintS64Ptr(ptr pointer, tagsize int) int { p := *ptr.toInt64Ptr() if p == nil { return 0 } return SizeVarint(uint64(*p)) + tagsize } func sizeVarintS64Slice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() n := 0 for _, v := range s { n += SizeVarint(uint64(v)) + tagsize } return n } func sizeVarintS64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } return n + SizeVarint(uint64(n)) + tagsize } func sizeZigzag32Value(ptr pointer, tagsize int) int { v := *ptr.toInt32() return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize } func sizeZigzag32ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt32() if v == 0 { return 0 } return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize } func sizeZigzag32Ptr(ptr pointer, tagsize int) int { p := ptr.getInt32Ptr() if p == nil { return 0 } v := *p return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize } func sizeZigzag32Slice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() n := 0 for _, v := range s { n += SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize } return n } func sizeZigzag32PackedSlice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31)))) } return n + SizeVarint(uint64(n)) + tagsize } func sizeZigzag64Value(ptr pointer, tagsize int) int { v := *ptr.toInt64() return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize } func sizeZigzag64ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt64() if v == 0 { return 0 } return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize } func sizeZigzag64Ptr(ptr pointer, tagsize int) int { p := *ptr.toInt64Ptr() if p == nil { return 0 } v := *p return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize } func sizeZigzag64Slice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() n := 0 for _, v := range s { n += SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize } return n } func sizeZigzag64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(uint64(v<<1) ^ uint64((int64(v) >> 63))) } return n + SizeVarint(uint64(n)) + tagsize } func sizeBoolValue(_ pointer, tagsize int) int { return 1 + tagsize } func sizeBoolValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toBool() if !v { return 0 } return 1 + tagsize } func sizeBoolPtr(ptr pointer, tagsize int) int { p := *ptr.toBoolPtr() if p == nil { return 0 } return 1 + tagsize } func sizeBoolSlice(ptr pointer, tagsize int) int { s := *ptr.toBoolSlice() return (1 + tagsize) * len(s) } func sizeBoolPackedSlice(ptr pointer, tagsize int) int { s := *ptr.toBoolSlice() if len(s) == 0 { return 0 } return len(s) + SizeVarint(uint64(len(s))) + tagsize } func sizeStringValue(ptr pointer, tagsize int) int { v := *ptr.toString() return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeStringValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toString() if v == "" { return 0 } return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeStringPtr(ptr pointer, tagsize int) int { p := *ptr.toStringPtr() if p == nil { return 0 } v := *p return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeStringSlice(ptr pointer, tagsize int) int { s := *ptr.toStringSlice() n := 0 for _, v := range s { n += len(v) + SizeVarint(uint64(len(v))) + tagsize } return n } func sizeBytes(ptr pointer, tagsize int) int { v := *ptr.toBytes() if v == nil { return 0 } return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeBytes3(ptr pointer, tagsize int) int { v := *ptr.toBytes() if len(v) == 0 { return 0 } return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeBytesOneof(ptr pointer, tagsize int) int { v := *ptr.toBytes() return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeBytesSlice(ptr pointer, tagsize int) int { s := *ptr.toBytesSlice() n := 0 for _, v := range s { n += len(v) + SizeVarint(uint64(len(v))) + tagsize } return n } // appendFixed32 appends an encoded fixed32 to b. func appendFixed32(b []byte, v uint32) []byte { b = append(b, byte(v), byte(v>>8), byte(v>>16), byte(v>>24)) return b } // appendFixed64 appends an encoded fixed64 to b. func appendFixed64(b []byte, v uint64) []byte { b = append(b, byte(v), byte(v>>8), byte(v>>16), byte(v>>24), byte(v>>32), byte(v>>40), byte(v>>48), byte(v>>56)) return b } // appendVarint appends an encoded varint to b. func appendVarint(b []byte, v uint64) []byte { // TODO: make 1-byte (maybe 2-byte) case inline-able, once we // have non-leaf inliner. switch { case v < 1<<7: b = append(b, byte(v)) case v < 1<<14: b = append(b, byte(v&0x7f|0x80), byte(v>>7)) case v < 1<<21: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte(v>>14)) case v < 1<<28: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte(v>>21)) case v < 1<<35: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte(v>>28)) case v < 1<<42: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte(v>>35)) case v < 1<<49: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte(v>>42)) case v < 1<<56: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte((v>>42)&0x7f|0x80), byte(v>>49)) case v < 1<<63: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte((v>>42)&0x7f|0x80), byte((v>>49)&0x7f|0x80), byte(v>>56)) default: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte((v>>42)&0x7f|0x80), byte((v>>49)&0x7f|0x80), byte((v>>56)&0x7f|0x80), 1) } return b } func appendFixed32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint32() b = appendVarint(b, wiretag) b = appendFixed32(b, v) return b, nil } func appendFixed32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint32() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, v) return b, nil } func appendFixed32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toUint32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, *p) return b, nil } func appendFixed32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed32(b, v) } return b, nil } func appendFixed32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(4*len(s))) for _, v := range s { b = appendFixed32(b, v) } return b, nil } func appendFixedS32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() b = appendVarint(b, wiretag) b = appendFixed32(b, uint32(v)) return b, nil } func appendFixedS32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, uint32(v)) return b, nil } func appendFixedS32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := ptr.getInt32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, uint32(*p)) return b, nil } func appendFixedS32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed32(b, uint32(v)) } return b, nil } func appendFixedS32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(4*len(s))) for _, v := range s { b = appendFixed32(b, uint32(v)) } return b, nil } func appendFloat32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := math.Float32bits(*ptr.toFloat32()) b = appendVarint(b, wiretag) b = appendFixed32(b, v) return b, nil } func appendFloat32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := math.Float32bits(*ptr.toFloat32()) if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, v) return b, nil } func appendFloat32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toFloat32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, math.Float32bits(*p)) return b, nil } func appendFloat32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toFloat32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed32(b, math.Float32bits(v)) } return b, nil } func appendFloat32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toFloat32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(4*len(s))) for _, v := range s { b = appendFixed32(b, math.Float32bits(v)) } return b, nil } func appendFixed64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint64() b = appendVarint(b, wiretag) b = appendFixed64(b, v) return b, nil } func appendFixed64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint64() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, v) return b, nil } func appendFixed64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toUint64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, *p) return b, nil } func appendFixed64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed64(b, v) } return b, nil } func appendFixed64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(8*len(s))) for _, v := range s { b = appendFixed64(b, v) } return b, nil } func appendFixedS64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() b = appendVarint(b, wiretag) b = appendFixed64(b, uint64(v)) return b, nil } func appendFixedS64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, uint64(v)) return b, nil } func appendFixedS64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toInt64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, uint64(*p)) return b, nil } func appendFixedS64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed64(b, uint64(v)) } return b, nil } func appendFixedS64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(8*len(s))) for _, v := range s { b = appendFixed64(b, uint64(v)) } return b, nil } func appendFloat64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := math.Float64bits(*ptr.toFloat64()) b = appendVarint(b, wiretag) b = appendFixed64(b, v) return b, nil } func appendFloat64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := math.Float64bits(*ptr.toFloat64()) if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, v) return b, nil } func appendFloat64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toFloat64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, math.Float64bits(*p)) return b, nil } func appendFloat64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toFloat64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed64(b, math.Float64bits(v)) } return b, nil } func appendFloat64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toFloat64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(8*len(s))) for _, v := range s { b = appendFixed64(b, math.Float64bits(v)) } return b, nil } func appendVarint32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint32() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarint32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint32() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarint32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toUint32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(*p)) return b, nil } func appendVarint32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) } return b, nil } func appendVarint32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, uint64(v)) } return b, nil } func appendVarintS32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarintS32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarintS32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := ptr.getInt32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(*p)) return b, nil } func appendVarintS32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) } return b, nil } func appendVarintS32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, uint64(v)) } return b, nil } func appendVarint64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint64() b = appendVarint(b, wiretag) b = appendVarint(b, v) return b, nil } func appendVarint64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint64() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, v) return b, nil } func appendVarint64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toUint64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, *p) return b, nil } func appendVarint64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, v) } return b, nil } func appendVarint64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(v) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, v) } return b, nil } func appendVarintS64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarintS64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarintS64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toInt64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(*p)) return b, nil } func appendVarintS64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) } return b, nil } func appendVarintS64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, uint64(v)) } return b, nil } func appendZigzag32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() b = appendVarint(b, wiretag) b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) return b, nil } func appendZigzag32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) return b, nil } func appendZigzag32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := ptr.getInt32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) v := *p b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) return b, nil } func appendZigzag32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) } return b, nil } func appendZigzag32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31)))) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) } return b, nil } func appendZigzag64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63))) return b, nil } func appendZigzag64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63))) return b, nil } func appendZigzag64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toInt64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) v := *p b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63))) return b, nil } func appendZigzag64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63))) } return b, nil } func appendZigzag64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(uint64(v<<1) ^ uint64((int64(v) >> 63))) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63))) } return b, nil } func appendBoolValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toBool() b = appendVarint(b, wiretag) if v { b = append(b, 1) } else { b = append(b, 0) } return b, nil } func appendBoolValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toBool() if !v { return b, nil } b = appendVarint(b, wiretag) b = append(b, 1) return b, nil } func appendBoolPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toBoolPtr() if p == nil { return b, nil } b = appendVarint(b, wiretag) if *p { b = append(b, 1) } else { b = append(b, 0) } return b, nil } func appendBoolSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toBoolSlice() for _, v := range s { b = appendVarint(b, wiretag) if v { b = append(b, 1) } else { b = append(b, 0) } } return b, nil } func appendBoolPackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toBoolSlice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(len(s))) for _, v := range s { if v { b = append(b, 1) } else { b = append(b, 0) } } return b, nil } func appendStringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toString() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendStringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toString() if v == "" { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendStringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toStringPtr() if p == nil { return b, nil } v := *p b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendStringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toStringSlice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) } return b, nil } func appendUTF8StringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { var invalidUTF8 bool v := *ptr.toString() if !utf8.ValidString(v) { invalidUTF8 = true } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) if invalidUTF8 { return b, errInvalidUTF8 } return b, nil } func appendUTF8StringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { var invalidUTF8 bool v := *ptr.toString() if v == "" { return b, nil } if !utf8.ValidString(v) { invalidUTF8 = true } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) if invalidUTF8 { return b, errInvalidUTF8 } return b, nil } func appendUTF8StringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { var invalidUTF8 bool p := *ptr.toStringPtr() if p == nil { return b, nil } v := *p if !utf8.ValidString(v) { invalidUTF8 = true } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) if invalidUTF8 { return b, errInvalidUTF8 } return b, nil } func appendUTF8StringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { var invalidUTF8 bool s := *ptr.toStringSlice() for _, v := range s { if !utf8.ValidString(v) { invalidUTF8 = true } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) } if invalidUTF8 { return b, errInvalidUTF8 } return b, nil } func appendBytes(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toBytes() if v == nil { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendBytes3(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toBytes() if len(v) == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendBytesOneof(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toBytes() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendBytesSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toBytesSlice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) } return b, nil } // makeGroupMarshaler returns the sizer and marshaler for a group. // u is the marshal info of the underlying message. func makeGroupMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { p := ptr.getPointer() if p.isNil() { return 0 } return u.size(p) + 2*tagsize }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { p := ptr.getPointer() if p.isNil() { return b, nil } var err error b = appendVarint(b, wiretag) // start group b, err = u.marshal(b, p, deterministic) b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group return b, err } } // makeGroupSliceMarshaler returns the sizer and marshaler for a group slice. // u is the marshal info of the underlying message. func makeGroupSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getPointerSlice() n := 0 for _, v := range s { if v.isNil() { continue } n += u.size(v) + 2*tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getPointerSlice() var err error var nerr nonFatal for _, v := range s { if v.isNil() { return b, errRepeatedHasNil } b = appendVarint(b, wiretag) // start group b, err = u.marshal(b, v, deterministic) b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group if !nerr.Merge(err) { if err == ErrNil { err = errRepeatedHasNil } return b, err } } return b, nerr.E } } // makeMessageMarshaler returns the sizer and marshaler for a message field. // u is the marshal info of the message. func makeMessageMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { p := ptr.getPointer() if p.isNil() { return 0 } siz := u.size(p) return siz + SizeVarint(uint64(siz)) + tagsize }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { p := ptr.getPointer() if p.isNil() { return b, nil } b = appendVarint(b, wiretag) siz := u.cachedsize(p) b = appendVarint(b, uint64(siz)) return u.marshal(b, p, deterministic) } } // makeMessageSliceMarshaler returns the sizer and marshaler for a message slice. // u is the marshal info of the message. func makeMessageSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getPointerSlice() n := 0 for _, v := range s { if v.isNil() { continue } siz := u.size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getPointerSlice() var err error var nerr nonFatal for _, v := range s { if v.isNil() { return b, errRepeatedHasNil } b = appendVarint(b, wiretag) siz := u.cachedsize(v) b = appendVarint(b, uint64(siz)) b, err = u.marshal(b, v, deterministic) if !nerr.Merge(err) { if err == ErrNil { err = errRepeatedHasNil } return b, err } } return b, nerr.E } } // makeMapMarshaler returns the sizer and marshaler for a map field. // f is the pointer to the reflect data structure of the field. func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) { // figure out key and value type t := f.Type keyType := t.Key() valType := t.Elem() tags := strings.Split(f.Tag.Get("protobuf"), ",") keyTags := strings.Split(f.Tag.Get("protobuf_key"), ",") valTags := strings.Split(f.Tag.Get("protobuf_val"), ",") stdOptions := false for _, t := range tags { if strings.HasPrefix(t, "customtype=") { valTags = append(valTags, t) } if t == "stdtime" { valTags = append(valTags, t) stdOptions = true } if t == "stdduration" { valTags = append(valTags, t) stdOptions = true } if t == "wktptr" { valTags = append(valTags, t) } } keySizer, keyMarshaler := typeMarshaler(keyType, keyTags, false, false) // don't omit zero value in map valSizer, valMarshaler := typeMarshaler(valType, valTags, false, false) // don't omit zero value in map keyWireTag := 1<<3 | wiretype(keyTags[0]) valWireTag := 2<<3 | wiretype(valTags[0]) // We create an interface to get the addresses of the map key and value. // If value is pointer-typed, the interface is a direct interface, the // idata itself is the value. Otherwise, the idata is the pointer to the // value. // Key cannot be pointer-typed. valIsPtr := valType.Kind() == reflect.Ptr // If value is a message with nested maps, calling // valSizer in marshal may be quadratic. We should use // cached version in marshal (but not in size). // If value is not message type, we don't have size cache, // but it cannot be nested either. Just use valSizer. valCachedSizer := valSizer if valIsPtr && !stdOptions && valType.Elem().Kind() == reflect.Struct { u := getMarshalInfo(valType.Elem()) valCachedSizer = func(ptr pointer, tagsize int) int { // Same as message sizer, but use cache. p := ptr.getPointer() if p.isNil() { return 0 } siz := u.cachedsize(p) return siz + SizeVarint(uint64(siz)) + tagsize } } return func(ptr pointer, tagsize int) int { m := ptr.asPointerTo(t).Elem() // the map n := 0 for _, k := range m.MapKeys() { ki := k.Interface() vi := m.MapIndex(k).Interface() kaddr := toAddrPointer(&ki, false) // pointer to key vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, tag uint64, deterministic bool) ([]byte, error) { m := ptr.asPointerTo(t).Elem() // the map var err error keys := m.MapKeys() if len(keys) > 1 && deterministic { sort.Sort(mapKeys(keys)) } var nerr nonFatal for _, k := range keys { ki := k.Interface() vi := m.MapIndex(k).Interface() kaddr := toAddrPointer(&ki, false) // pointer to key vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value b = appendVarint(b, tag) siz := keySizer(kaddr, 1) + valCachedSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1) b = appendVarint(b, uint64(siz)) b, err = keyMarshaler(b, kaddr, keyWireTag, deterministic) if !nerr.Merge(err) { return b, err } b, err = valMarshaler(b, vaddr, valWireTag, deterministic) if err != ErrNil && !nerr.Merge(err) { // allow nil value in map return b, err } } return b, nerr.E } } // makeOneOfMarshaler returns the sizer and marshaler for a oneof field. // fi is the marshal info of the field. // f is the pointer to the reflect data structure of the field. func makeOneOfMarshaler(fi *marshalFieldInfo, f *reflect.StructField) (sizer, marshaler) { // Oneof field is an interface. We need to get the actual data type on the fly. t := f.Type return func(ptr pointer, _ int) int { p := ptr.getInterfacePointer() if p.isNil() { return 0 } v := ptr.asPointerTo(t).Elem().Elem().Elem() // *interface -> interface -> *struct -> struct telem := v.Type() e := fi.oneofElems[telem] return e.sizer(p, e.tagsize) }, func(b []byte, ptr pointer, _ uint64, deterministic bool) ([]byte, error) { p := ptr.getInterfacePointer() if p.isNil() { return b, nil } v := ptr.asPointerTo(t).Elem().Elem().Elem() // *interface -> interface -> *struct -> struct telem := v.Type() if telem.Field(0).Type.Kind() == reflect.Ptr && p.getPointer().isNil() { return b, errOneofHasNil } e := fi.oneofElems[telem] return e.marshaler(b, p, e.wiretag, deterministic) } } // sizeExtensions computes the size of encoded data for a XXX_InternalExtensions field. func (u *marshalInfo) sizeExtensions(ext *XXX_InternalExtensions) int { m, mu := ext.extensionsRead() if m == nil { return 0 } mu.Lock() n := 0 for _, e := range m { if e.value == nil || e.desc == nil { // Extension is only in its encoded form. n += len(e.enc) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr) n += ei.sizer(p, ei.tagsize) } mu.Unlock() return n } // appendExtensions marshals a XXX_InternalExtensions field to the end of byte slice b. func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, deterministic bool) ([]byte, error) { m, mu := ext.extensionsRead() if m == nil { return b, nil } mu.Lock() defer mu.Unlock() var err error var nerr nonFatal // Fast-path for common cases: zero or one extensions. // Don't bother sorting the keys. if len(m) <= 1 { for _, e := range m { if e.value == nil || e.desc == nil { // Extension is only in its encoded form. b = append(b, e.enc...) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err } } return b, nerr.E } // Sort the keys to provide a deterministic encoding. // Not sure this is required, but the old code does it. keys := make([]int, 0, len(m)) for k := range m { keys = append(keys, int(k)) } sort.Ints(keys) for _, k := range keys { e := m[int32(k)] if e.value == nil || e.desc == nil { // Extension is only in its encoded form. b = append(b, e.enc...) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err } } return b, nerr.E } // message set format is: // message MessageSet { // repeated group Item = 1 { // required int32 type_id = 2; // required string message = 3; // }; // } // sizeMessageSet computes the size of encoded data for a XXX_InternalExtensions field // in message set format (above). func (u *marshalInfo) sizeMessageSet(ext *XXX_InternalExtensions) int { m, mu := ext.extensionsRead() if m == nil { return 0 } mu.Lock() n := 0 for id, e := range m { n += 2 // start group, end group. tag = 1 (size=1) n += SizeVarint(uint64(id)) + 1 // type_id, tag = 2 (size=1) if e.value == nil || e.desc == nil { // Extension is only in its encoded form. msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint siz := len(msgWithLen) n += siz + 1 // message, tag = 3 (size=1) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr) n += ei.sizer(p, 1) // message, tag = 3 (size=1) } mu.Unlock() return n } // appendMessageSet marshals a XXX_InternalExtensions field in message set format (above) // to the end of byte slice b. func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, deterministic bool) ([]byte, error) { m, mu := ext.extensionsRead() if m == nil { return b, nil } mu.Lock() defer mu.Unlock() var err error var nerr nonFatal // Fast-path for common cases: zero or one extensions. // Don't bother sorting the keys. if len(m) <= 1 { for id, e := range m { b = append(b, 1<<3|WireStartGroup) b = append(b, 2<<3|WireVarint) b = appendVarint(b, uint64(id)) if e.value == nil || e.desc == nil { // Extension is only in its encoded form. msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint b = append(b, 3<<3|WireBytes) b = append(b, msgWithLen...) b = append(b, 1<<3|WireEndGroup) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr) b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic) if !nerr.Merge(err) { return b, err } b = append(b, 1<<3|WireEndGroup) } return b, nerr.E } // Sort the keys to provide a deterministic encoding. keys := make([]int, 0, len(m)) for k := range m { keys = append(keys, int(k)) } sort.Ints(keys) for _, id := range keys { e := m[int32(id)] b = append(b, 1<<3|WireStartGroup) b = append(b, 2<<3|WireVarint) b = appendVarint(b, uint64(id)) if e.value == nil || e.desc == nil { // Extension is only in its encoded form. msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint b = append(b, 3<<3|WireBytes) b = append(b, msgWithLen...) b = append(b, 1<<3|WireEndGroup) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr) b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic) b = append(b, 1<<3|WireEndGroup) if !nerr.Merge(err) { return b, err } } return b, nerr.E } // sizeV1Extensions computes the size of encoded data for a V1-API extension field. func (u *marshalInfo) sizeV1Extensions(m map[int32]Extension) int { if m == nil { return 0 } n := 0 for _, e := range m { if e.value == nil || e.desc == nil { // Extension is only in its encoded form. n += len(e.enc) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr) n += ei.sizer(p, ei.tagsize) } return n } // appendV1Extensions marshals a V1-API extension field to the end of byte slice b. func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, deterministic bool) ([]byte, error) { if m == nil { return b, nil } // Sort the keys to provide a deterministic encoding. keys := make([]int, 0, len(m)) for k := range m { keys = append(keys, int(k)) } sort.Ints(keys) var err error var nerr nonFatal for _, k := range keys { e := m[int32(k)] if e.value == nil || e.desc == nil { // Extension is only in its encoded form. b = append(b, e.enc...) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err } } return b, nerr.E } // newMarshaler is the interface representing objects that can marshal themselves. // // This exists to support protoc-gen-go generated messages. // The proto package will stop type-asserting to this interface in the future. // // DO NOT DEPEND ON THIS. type newMarshaler interface { XXX_Size() int XXX_Marshal(b []byte, deterministic bool) ([]byte, error) } // Size returns the encoded size of a protocol buffer message. // This is the main entry point. func Size(pb Message) int { if m, ok := pb.(newMarshaler); ok { return m.XXX_Size() } if m, ok := pb.(Marshaler); ok { // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. b, _ := m.Marshal() return len(b) } // in case somehow we didn't generate the wrapper if pb == nil { return 0 } var info InternalMessageInfo return info.Size(pb) } // Marshal takes a protocol buffer message // and encodes it into the wire format, returning the data. // This is the main entry point. func Marshal(pb Message) ([]byte, error) { if m, ok := pb.(newMarshaler); ok { siz := m.XXX_Size() b := make([]byte, 0, siz) return m.XXX_Marshal(b, false) } if m, ok := pb.(Marshaler); ok { // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. return m.Marshal() } // in case somehow we didn't generate the wrapper if pb == nil { return nil, ErrNil } var info InternalMessageInfo siz := info.Size(pb) b := make([]byte, 0, siz) return info.Marshal(b, pb, false) } // Marshal takes a protocol buffer message // and encodes it into the wire format, writing the result to the // Buffer. // This is an alternative entry point. It is not necessary to use // a Buffer for most applications. func (p *Buffer) Marshal(pb Message) error { var err error if p.deterministic { if _, ok := pb.(Marshaler); ok { return fmt.Errorf("proto: deterministic not supported by the Marshal method of %T", pb) } } if m, ok := pb.(newMarshaler); ok { siz := m.XXX_Size() p.grow(siz) // make sure buf has enough capacity p.buf, err = m.XXX_Marshal(p.buf, p.deterministic) return err } if m, ok := pb.(Marshaler); ok { // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. var b []byte b, err = m.Marshal() p.buf = append(p.buf, b...) return err } // in case somehow we didn't generate the wrapper if pb == nil { return ErrNil } var info InternalMessageInfo siz := info.Size(pb) p.grow(siz) // make sure buf has enough capacity p.buf, err = info.Marshal(p.buf, pb, p.deterministic) return err } // grow grows the buffer's capacity, if necessary, to guarantee space for // another n bytes. After grow(n), at least n bytes can be written to the // buffer without another allocation. func (p *Buffer) grow(n int) { need := len(p.buf) + n if need <= cap(p.buf) { return } newCap := len(p.buf) * 2 if newCap < need { newCap = need } p.buf = append(make([]byte, 0, newCap), p.buf...) } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/table_marshal_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2018, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "reflect" "time" ) // makeMessageRefMarshaler differs a bit from makeMessageMarshaler // It marshal a message T instead of a *T func makeMessageRefMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { siz := u.size(ptr) return siz + SizeVarint(uint64(siz)) + tagsize }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { b = appendVarint(b, wiretag) siz := u.cachedsize(ptr) b = appendVarint(b, uint64(siz)) return u.marshal(b, ptr, deterministic) } } // makeMessageRefSliceMarshaler differs quite a lot from makeMessageSliceMarshaler // It marshals a slice of messages []T instead of []*T func makeMessageRefSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) e := elem.Interface() v := toAddrPointer(&e, false) siz := u.size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) var err, errreq error for i := 0; i < s.Len(); i++ { elem := s.Index(i) e := elem.Interface() v := toAddrPointer(&e, false) b = appendVarint(b, wiretag) siz := u.size(v) b = appendVarint(b, uint64(siz)) b, err = u.marshal(b, v, deterministic) if err != nil { if _, ok := err.(*RequiredNotSetError); ok { // Required field in submessage is not set. // We record the error but keep going, to give a complete marshaling. if errreq == nil { errreq = err } continue } if err == ErrNil { err = errRepeatedHasNil } return b, err } } return b, errreq } } func makeCustomPtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } m := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(custom) siz := m.Size() return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } m := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(custom) siz := m.Size() buf, err := m.Marshal() if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) return b, nil } } func makeCustomMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { m := ptr.asPointerTo(u.typ).Interface().(custom) siz := m.Size() return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { m := ptr.asPointerTo(u.typ).Interface().(custom) siz := m.Size() buf, err := m.Marshal() if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) return b, nil } } func makeTimeMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { t := ptr.asPointerTo(u.typ).Interface().(*time.Time) ts, err := timestampProto(*t) if err != nil { return 0 } siz := Size(ts) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { t := ptr.asPointerTo(u.typ).Interface().(*time.Time) ts, err := timestampProto(*t) if err != nil { return nil, err } buf, err := Marshal(ts) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeTimePtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Time) ts, err := timestampProto(*t) if err != nil { return 0 } siz := Size(ts) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Time) ts, err := timestampProto(*t) if err != nil { return nil, err } buf, err := Marshal(ts) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeTimeSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(time.Time) ts, err := timestampProto(t) if err != nil { return 0 } siz := Size(ts) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(time.Time) ts, err := timestampProto(t) if err != nil { return nil, err } siz := Size(ts) buf, err := Marshal(ts) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeTimePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*time.Time) ts, err := timestampProto(*t) if err != nil { return 0 } siz := Size(ts) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*time.Time) ts, err := timestampProto(*t) if err != nil { return nil, err } siz := Size(ts) buf, err := Marshal(ts) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeDurationMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { d := ptr.asPointerTo(u.typ).Interface().(*time.Duration) dur := durationProto(*d) siz := Size(dur) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { d := ptr.asPointerTo(u.typ).Interface().(*time.Duration) dur := durationProto(*d) buf, err := Marshal(dur) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeDurationPtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } d := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Duration) dur := durationProto(*d) siz := Size(dur) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } d := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*time.Duration) dur := durationProto(*d) buf, err := Marshal(dur) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeDurationSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) d := elem.Interface().(time.Duration) dur := durationProto(d) siz := Size(dur) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) d := elem.Interface().(time.Duration) dur := durationProto(d) siz := Size(dur) buf, err := Marshal(dur) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeDurationPtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) d := elem.Interface().(*time.Duration) dur := durationProto(*d) siz := Size(dur) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) d := elem.Interface().(*time.Duration) dur := durationProto(*d) siz := Size(dur) buf, err := Marshal(dur) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/table_merge.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "fmt" "reflect" "strings" "sync" "sync/atomic" ) // Merge merges the src message into dst. // This assumes that dst and src of the same type and are non-nil. func (a *InternalMessageInfo) Merge(dst, src Message) { mi := atomicLoadMergeInfo(&a.merge) if mi == nil { mi = getMergeInfo(reflect.TypeOf(dst).Elem()) atomicStoreMergeInfo(&a.merge, mi) } mi.merge(toPointer(&dst), toPointer(&src)) } type mergeInfo struct { typ reflect.Type initialized int32 // 0: only typ is valid, 1: everything is valid lock sync.Mutex fields []mergeFieldInfo unrecognized field // Offset of XXX_unrecognized } type mergeFieldInfo struct { field field // Offset of field, guaranteed to be valid // isPointer reports whether the value in the field is a pointer. // This is true for the following situations: // * Pointer to struct // * Pointer to basic type (proto2 only) // * Slice (first value in slice header is a pointer) // * String (first value in string header is a pointer) isPointer bool // basicWidth reports the width of the field assuming that it is directly // embedded in the struct (as is the case for basic types in proto3). // The possible values are: // 0: invalid // 1: bool // 4: int32, uint32, float32 // 8: int64, uint64, float64 basicWidth int // Where dst and src are pointers to the types being merged. merge func(dst, src pointer) } var ( mergeInfoMap = map[reflect.Type]*mergeInfo{} mergeInfoLock sync.Mutex ) func getMergeInfo(t reflect.Type) *mergeInfo { mergeInfoLock.Lock() defer mergeInfoLock.Unlock() mi := mergeInfoMap[t] if mi == nil { mi = &mergeInfo{typ: t} mergeInfoMap[t] = mi } return mi } // merge merges src into dst assuming they are both of type *mi.typ. func (mi *mergeInfo) merge(dst, src pointer) { if dst.isNil() { panic("proto: nil destination") } if src.isNil() { return // Nothing to do. } if atomic.LoadInt32(&mi.initialized) == 0 { mi.computeMergeInfo() } for _, fi := range mi.fields { sfp := src.offset(fi.field) // As an optimization, we can avoid the merge function call cost // if we know for sure that the source will have no effect // by checking if it is the zero value. if unsafeAllowed { if fi.isPointer && sfp.getPointer().isNil() { // Could be slice or string continue } if fi.basicWidth > 0 { switch { case fi.basicWidth == 1 && !*sfp.toBool(): continue case fi.basicWidth == 4 && *sfp.toUint32() == 0: continue case fi.basicWidth == 8 && *sfp.toUint64() == 0: continue } } } dfp := dst.offset(fi.field) fi.merge(dfp, sfp) } // TODO: Make this faster? out := dst.asPointerTo(mi.typ).Elem() in := src.asPointerTo(mi.typ).Elem() if emIn, err := extendable(in.Addr().Interface()); err == nil { emOut, _ := extendable(out.Addr().Interface()) mIn, muIn := emIn.extensionsRead() if mIn != nil { mOut := emOut.extensionsWrite() muIn.Lock() mergeExtension(mOut, mIn) muIn.Unlock() } } if mi.unrecognized.IsValid() { if b := *src.offset(mi.unrecognized).toBytes(); len(b) > 0 { *dst.offset(mi.unrecognized).toBytes() = append([]byte(nil), b...) } } } func (mi *mergeInfo) computeMergeInfo() { mi.lock.Lock() defer mi.lock.Unlock() if mi.initialized != 0 { return } t := mi.typ n := t.NumField() props := GetProperties(t) for i := 0; i < n; i++ { f := t.Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } mfi := mergeFieldInfo{field: toField(&f)} tf := f.Type // As an optimization, we can avoid the merge function call cost // if we know for sure that the source will have no effect // by checking if it is the zero value. if unsafeAllowed { switch tf.Kind() { case reflect.Ptr, reflect.Slice, reflect.String: // As a special case, we assume slices and strings are pointers // since we know that the first field in the SliceSlice or // StringHeader is a data pointer. mfi.isPointer = true case reflect.Bool: mfi.basicWidth = 1 case reflect.Int32, reflect.Uint32, reflect.Float32: mfi.basicWidth = 4 case reflect.Int64, reflect.Uint64, reflect.Float64: mfi.basicWidth = 8 } } // Unwrap tf to get at its most basic type. var isPointer, isSlice bool if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 { isSlice = true tf = tf.Elem() } if tf.Kind() == reflect.Ptr { isPointer = true tf = tf.Elem() } if isPointer && isSlice && tf.Kind() != reflect.Struct { panic("both pointer and slice for basic type in " + tf.Name()) } switch tf.Kind() { case reflect.Int32: switch { case isSlice: // E.g., []int32 mfi.merge = func(dst, src pointer) { // NOTE: toInt32Slice is not defined (see pointer_reflect.go). /* sfsp := src.toInt32Slice() if *sfsp != nil { dfsp := dst.toInt32Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []int64{} } } */ sfs := src.getInt32Slice() if sfs != nil { dfs := dst.getInt32Slice() dfs = append(dfs, sfs...) if dfs == nil { dfs = []int32{} } dst.setInt32Slice(dfs) } } case isPointer: // E.g., *int32 mfi.merge = func(dst, src pointer) { // NOTE: toInt32Ptr is not defined (see pointer_reflect.go). /* sfpp := src.toInt32Ptr() if *sfpp != nil { dfpp := dst.toInt32Ptr() if *dfpp == nil { *dfpp = Int32(**sfpp) } else { **dfpp = **sfpp } } */ sfp := src.getInt32Ptr() if sfp != nil { dfp := dst.getInt32Ptr() if dfp == nil { dst.setInt32Ptr(*sfp) } else { *dfp = *sfp } } } default: // E.g., int32 mfi.merge = func(dst, src pointer) { if v := *src.toInt32(); v != 0 { *dst.toInt32() = v } } } case reflect.Int64: switch { case isSlice: // E.g., []int64 mfi.merge = func(dst, src pointer) { sfsp := src.toInt64Slice() if *sfsp != nil { dfsp := dst.toInt64Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []int64{} } } } case isPointer: // E.g., *int64 mfi.merge = func(dst, src pointer) { sfpp := src.toInt64Ptr() if *sfpp != nil { dfpp := dst.toInt64Ptr() if *dfpp == nil { *dfpp = Int64(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., int64 mfi.merge = func(dst, src pointer) { if v := *src.toInt64(); v != 0 { *dst.toInt64() = v } } } case reflect.Uint32: switch { case isSlice: // E.g., []uint32 mfi.merge = func(dst, src pointer) { sfsp := src.toUint32Slice() if *sfsp != nil { dfsp := dst.toUint32Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []uint32{} } } } case isPointer: // E.g., *uint32 mfi.merge = func(dst, src pointer) { sfpp := src.toUint32Ptr() if *sfpp != nil { dfpp := dst.toUint32Ptr() if *dfpp == nil { *dfpp = Uint32(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., uint32 mfi.merge = func(dst, src pointer) { if v := *src.toUint32(); v != 0 { *dst.toUint32() = v } } } case reflect.Uint64: switch { case isSlice: // E.g., []uint64 mfi.merge = func(dst, src pointer) { sfsp := src.toUint64Slice() if *sfsp != nil { dfsp := dst.toUint64Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []uint64{} } } } case isPointer: // E.g., *uint64 mfi.merge = func(dst, src pointer) { sfpp := src.toUint64Ptr() if *sfpp != nil { dfpp := dst.toUint64Ptr() if *dfpp == nil { *dfpp = Uint64(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., uint64 mfi.merge = func(dst, src pointer) { if v := *src.toUint64(); v != 0 { *dst.toUint64() = v } } } case reflect.Float32: switch { case isSlice: // E.g., []float32 mfi.merge = func(dst, src pointer) { sfsp := src.toFloat32Slice() if *sfsp != nil { dfsp := dst.toFloat32Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []float32{} } } } case isPointer: // E.g., *float32 mfi.merge = func(dst, src pointer) { sfpp := src.toFloat32Ptr() if *sfpp != nil { dfpp := dst.toFloat32Ptr() if *dfpp == nil { *dfpp = Float32(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., float32 mfi.merge = func(dst, src pointer) { if v := *src.toFloat32(); v != 0 { *dst.toFloat32() = v } } } case reflect.Float64: switch { case isSlice: // E.g., []float64 mfi.merge = func(dst, src pointer) { sfsp := src.toFloat64Slice() if *sfsp != nil { dfsp := dst.toFloat64Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []float64{} } } } case isPointer: // E.g., *float64 mfi.merge = func(dst, src pointer) { sfpp := src.toFloat64Ptr() if *sfpp != nil { dfpp := dst.toFloat64Ptr() if *dfpp == nil { *dfpp = Float64(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., float64 mfi.merge = func(dst, src pointer) { if v := *src.toFloat64(); v != 0 { *dst.toFloat64() = v } } } case reflect.Bool: switch { case isSlice: // E.g., []bool mfi.merge = func(dst, src pointer) { sfsp := src.toBoolSlice() if *sfsp != nil { dfsp := dst.toBoolSlice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []bool{} } } } case isPointer: // E.g., *bool mfi.merge = func(dst, src pointer) { sfpp := src.toBoolPtr() if *sfpp != nil { dfpp := dst.toBoolPtr() if *dfpp == nil { *dfpp = Bool(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., bool mfi.merge = func(dst, src pointer) { if v := *src.toBool(); v { *dst.toBool() = v } } } case reflect.String: switch { case isSlice: // E.g., []string mfi.merge = func(dst, src pointer) { sfsp := src.toStringSlice() if *sfsp != nil { dfsp := dst.toStringSlice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []string{} } } } case isPointer: // E.g., *string mfi.merge = func(dst, src pointer) { sfpp := src.toStringPtr() if *sfpp != nil { dfpp := dst.toStringPtr() if *dfpp == nil { *dfpp = String(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., string mfi.merge = func(dst, src pointer) { if v := *src.toString(); v != "" { *dst.toString() = v } } } case reflect.Slice: isProto3 := props.Prop[i].proto3 switch { case isPointer: panic("bad pointer in byte slice case in " + tf.Name()) case tf.Elem().Kind() != reflect.Uint8: panic("bad element kind in byte slice case in " + tf.Name()) case isSlice: // E.g., [][]byte mfi.merge = func(dst, src pointer) { sbsp := src.toBytesSlice() if *sbsp != nil { dbsp := dst.toBytesSlice() for _, sb := range *sbsp { if sb == nil { *dbsp = append(*dbsp, nil) } else { *dbsp = append(*dbsp, append([]byte{}, sb...)) } } if *dbsp == nil { *dbsp = [][]byte{} } } } default: // E.g., []byte mfi.merge = func(dst, src pointer) { sbp := src.toBytes() if *sbp != nil { dbp := dst.toBytes() if !isProto3 || len(*sbp) > 0 { *dbp = append([]byte{}, *sbp...) } } } } case reflect.Struct: switch { case !isPointer: mergeInfo := getMergeInfo(tf) mfi.merge = func(dst, src pointer) { mergeInfo.merge(dst, src) } case isSlice: // E.g., []*pb.T mergeInfo := getMergeInfo(tf) mfi.merge = func(dst, src pointer) { sps := src.getPointerSlice() if sps != nil { dps := dst.getPointerSlice() for _, sp := range sps { var dp pointer if !sp.isNil() { dp = valToPointer(reflect.New(tf)) mergeInfo.merge(dp, sp) } dps = append(dps, dp) } if dps == nil { dps = []pointer{} } dst.setPointerSlice(dps) } } default: // E.g., *pb.T mergeInfo := getMergeInfo(tf) mfi.merge = func(dst, src pointer) { sp := src.getPointer() if !sp.isNil() { dp := dst.getPointer() if dp.isNil() { dp = valToPointer(reflect.New(tf)) dst.setPointer(dp) } mergeInfo.merge(dp, sp) } } } case reflect.Map: switch { case isPointer || isSlice: panic("bad pointer or slice in map case in " + tf.Name()) default: // E.g., map[K]V mfi.merge = func(dst, src pointer) { sm := src.asPointerTo(tf).Elem() if sm.Len() == 0 { return } dm := dst.asPointerTo(tf).Elem() if dm.IsNil() { dm.Set(reflect.MakeMap(tf)) } switch tf.Elem().Kind() { case reflect.Ptr: // Proto struct (e.g., *T) for _, key := range sm.MapKeys() { val := sm.MapIndex(key) val = reflect.ValueOf(Clone(val.Interface().(Message))) dm.SetMapIndex(key, val) } case reflect.Slice: // E.g. Bytes type (e.g., []byte) for _, key := range sm.MapKeys() { val := sm.MapIndex(key) val = reflect.ValueOf(append([]byte{}, val.Bytes()...)) dm.SetMapIndex(key, val) } default: // Basic type (e.g., string) for _, key := range sm.MapKeys() { val := sm.MapIndex(key) dm.SetMapIndex(key, val) } } } } case reflect.Interface: // Must be oneof field. switch { case isPointer || isSlice: panic("bad pointer or slice in interface case in " + tf.Name()) default: // E.g., interface{} // TODO: Make this faster? mfi.merge = func(dst, src pointer) { su := src.asPointerTo(tf).Elem() if !su.IsNil() { du := dst.asPointerTo(tf).Elem() typ := su.Elem().Type() if du.IsNil() || du.Elem().Type() != typ { du.Set(reflect.New(typ.Elem())) // Initialize interface if empty } sv := su.Elem().Elem().Field(0) if sv.Kind() == reflect.Ptr && sv.IsNil() { return } dv := du.Elem().Elem().Field(0) if dv.Kind() == reflect.Ptr && dv.IsNil() { dv.Set(reflect.New(sv.Type().Elem())) // Initialize proto message if empty } switch sv.Type().Kind() { case reflect.Ptr: // Proto struct (e.g., *T) Merge(dv.Interface().(Message), sv.Interface().(Message)) case reflect.Slice: // E.g. Bytes type (e.g., []byte) dv.Set(reflect.ValueOf(append([]byte{}, sv.Bytes()...))) default: // Basic type (e.g., string) dv.Set(sv) } } } } default: panic(fmt.Sprintf("merger not found for type:%s", tf)) } mi.fields = append(mi.fields, mfi) } mi.unrecognized = invalidField if f, ok := t.FieldByName("XXX_unrecognized"); ok { if f.Type != reflect.TypeOf([]byte{}) { panic("expected XXX_unrecognized to be of type []byte") } mi.unrecognized = toField(&f) } atomic.StoreInt32(&mi.initialized, 1) } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/table_unmarshal.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "errors" "fmt" "io" "math" "reflect" "strconv" "strings" "sync" "sync/atomic" "unicode/utf8" ) // Unmarshal is the entry point from the generated .pb.go files. // This function is not intended to be used by non-generated code. // This function is not subject to any compatibility guarantee. // msg contains a pointer to a protocol buffer struct. // b is the data to be unmarshaled into the protocol buffer. // a is a pointer to a place to store cached unmarshal information. func (a *InternalMessageInfo) Unmarshal(msg Message, b []byte) error { // Load the unmarshal information for this message type. // The atomic load ensures memory consistency. u := atomicLoadUnmarshalInfo(&a.unmarshal) if u == nil { // Slow path: find unmarshal info for msg, update a with it. u = getUnmarshalInfo(reflect.TypeOf(msg).Elem()) atomicStoreUnmarshalInfo(&a.unmarshal, u) } // Then do the unmarshaling. err := u.unmarshal(toPointer(&msg), b) return err } type unmarshalInfo struct { typ reflect.Type // type of the protobuf struct // 0 = only typ field is initialized // 1 = completely initialized initialized int32 lock sync.Mutex // prevents double initialization dense []unmarshalFieldInfo // fields indexed by tag # sparse map[uint64]unmarshalFieldInfo // fields indexed by tag # reqFields []string // names of required fields reqMask uint64 // 1< 0 { // Read tag and wire type. // Special case 1 and 2 byte varints. var x uint64 if b[0] < 128 { x = uint64(b[0]) b = b[1:] } else if len(b) >= 2 && b[1] < 128 { x = uint64(b[0]&0x7f) + uint64(b[1])<<7 b = b[2:] } else { var n int x, n = decodeVarint(b) if n == 0 { return io.ErrUnexpectedEOF } b = b[n:] } tag := x >> 3 wire := int(x) & 7 // Dispatch on the tag to one of the unmarshal* functions below. var f unmarshalFieldInfo if tag < uint64(len(u.dense)) { f = u.dense[tag] } else { f = u.sparse[tag] } if fn := f.unmarshal; fn != nil { var err error b, err = fn(b, m.offset(f.field), wire) if err == nil { reqMask |= f.reqMask continue } if r, ok := err.(*RequiredNotSetError); ok { // Remember this error, but keep parsing. We need to produce // a full parse even if a required field is missing. if errLater == nil { errLater = r } reqMask |= f.reqMask continue } if err != errInternalBadWireType { if err == errInvalidUTF8 { if errLater == nil { fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name errLater = &invalidUTF8Error{fullName} } continue } return err } // Fragments with bad wire type are treated as unknown fields. } // Unknown tag. if !u.unrecognized.IsValid() { // Don't keep unrecognized data; just skip it. var err error b, err = skipField(b, wire) if err != nil { return err } continue } // Keep unrecognized data around. // maybe in extensions, maybe in the unrecognized field. z := m.offset(u.unrecognized).toBytes() var emap map[int32]Extension var e Extension for _, r := range u.extensionRanges { if uint64(r.Start) <= tag && tag <= uint64(r.End) { if u.extensions.IsValid() { mp := m.offset(u.extensions).toExtensions() emap = mp.extensionsWrite() e = emap[int32(tag)] z = &e.enc break } if u.oldExtensions.IsValid() { p := m.offset(u.oldExtensions).toOldExtensions() emap = *p if emap == nil { emap = map[int32]Extension{} *p = emap } e = emap[int32(tag)] z = &e.enc break } if u.bytesExtensions.IsValid() { z = m.offset(u.bytesExtensions).toBytes() break } panic("no extensions field available") } } // Use wire type to skip data. var err error b0 := b b, err = skipField(b, wire) if err != nil { return err } *z = encodeVarint(*z, tag<<3|uint64(wire)) *z = append(*z, b0[:len(b0)-len(b)]...) if emap != nil { emap[int32(tag)] = e } } if reqMask != u.reqMask && errLater == nil { // A required field of this message is missing. for _, n := range u.reqFields { if reqMask&1 == 0 { errLater = &RequiredNotSetError{n} } reqMask >>= 1 } } return errLater } // computeUnmarshalInfo fills in u with information for use // in unmarshaling protocol buffers of type u.typ. func (u *unmarshalInfo) computeUnmarshalInfo() { u.lock.Lock() defer u.lock.Unlock() if u.initialized != 0 { return } t := u.typ n := t.NumField() // Set up the "not found" value for the unrecognized byte buffer. // This is the default for proto3. u.unrecognized = invalidField u.extensions = invalidField u.oldExtensions = invalidField u.bytesExtensions = invalidField // List of the generated type and offset for each oneof field. type oneofField struct { ityp reflect.Type // interface type of oneof field field field // offset in containing message } var oneofFields []oneofField for i := 0; i < n; i++ { f := t.Field(i) if f.Name == "XXX_unrecognized" { // The byte slice used to hold unrecognized input is special. if f.Type != reflect.TypeOf(([]byte)(nil)) { panic("bad type for XXX_unrecognized field: " + f.Type.Name()) } u.unrecognized = toField(&f) continue } if f.Name == "XXX_InternalExtensions" { // Ditto here. if f.Type != reflect.TypeOf(XXX_InternalExtensions{}) { panic("bad type for XXX_InternalExtensions field: " + f.Type.Name()) } u.extensions = toField(&f) if f.Tag.Get("protobuf_messageset") == "1" { u.isMessageSet = true } continue } if f.Name == "XXX_extensions" { // An older form of the extensions field. if f.Type == reflect.TypeOf((map[int32]Extension)(nil)) { u.oldExtensions = toField(&f) continue } else if f.Type == reflect.TypeOf(([]byte)(nil)) { u.bytesExtensions = toField(&f) continue } panic("bad type for XXX_extensions field: " + f.Type.Name()) } if f.Name == "XXX_NoUnkeyedLiteral" || f.Name == "XXX_sizecache" { continue } oneof := f.Tag.Get("protobuf_oneof") if oneof != "" { oneofFields = append(oneofFields, oneofField{f.Type, toField(&f)}) // The rest of oneof processing happens below. continue } tags := f.Tag.Get("protobuf") tagArray := strings.Split(tags, ",") if len(tagArray) < 2 { panic("protobuf tag not enough fields in " + t.Name() + "." + f.Name + ": " + tags) } tag, err := strconv.Atoi(tagArray[1]) if err != nil { panic("protobuf tag field not an integer: " + tagArray[1]) } name := "" for _, tag := range tagArray[3:] { if strings.HasPrefix(tag, "name=") { name = tag[5:] } } // Extract unmarshaling function from the field (its type and tags). unmarshal := fieldUnmarshaler(&f) // Required field? var reqMask uint64 if tagArray[2] == "req" { bit := len(u.reqFields) u.reqFields = append(u.reqFields, name) reqMask = uint64(1) << uint(bit) // TODO: if we have more than 64 required fields, we end up // not verifying that all required fields are present. // Fix this, perhaps using a count of required fields? } // Store the info in the correct slot in the message. u.setTag(tag, toField(&f), unmarshal, reqMask, name) } // Find any types associated with oneof fields. // TODO: XXX_OneofFuncs returns more info than we need. Get rid of some of it? fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("XXX_OneofFuncs") // gogo: len(oneofFields) > 0 is needed for embedded oneof messages, without a marshaler and unmarshaler if fn.IsValid() && len(oneofFields) > 0 { res := fn.Call(nil)[3] // last return value from XXX_OneofFuncs: []interface{} for i := res.Len() - 1; i >= 0; i-- { v := res.Index(i) // interface{} tptr := reflect.ValueOf(v.Interface()).Type() // *Msg_X typ := tptr.Elem() // Msg_X f := typ.Field(0) // oneof implementers have one field baseUnmarshal := fieldUnmarshaler(&f) tags := strings.Split(f.Tag.Get("protobuf"), ",") fieldNum, err := strconv.Atoi(tags[1]) if err != nil { panic("protobuf tag field not an integer: " + tags[1]) } var name string for _, tag := range tags { if strings.HasPrefix(tag, "name=") { name = strings.TrimPrefix(tag, "name=") break } } // Find the oneof field that this struct implements. // Might take O(n^2) to process all of the oneofs, but who cares. for _, of := range oneofFields { if tptr.Implements(of.ityp) { // We have found the corresponding interface for this struct. // That lets us know where this struct should be stored // when we encounter it during unmarshaling. unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal) u.setTag(fieldNum, of.field, unmarshal, 0, name) } } } } // Get extension ranges, if any. fn = reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray") if fn.IsValid() { if !u.extensions.IsValid() && !u.oldExtensions.IsValid() && !u.bytesExtensions.IsValid() { panic("a message with extensions, but no extensions field in " + t.Name()) } u.extensionRanges = fn.Call(nil)[0].Interface().([]ExtensionRange) } // Explicitly disallow tag 0. This will ensure we flag an error // when decoding a buffer of all zeros. Without this code, we // would decode and skip an all-zero buffer of even length. // [0 0] is [tag=0/wiretype=varint varint-encoded-0]. u.setTag(0, zeroField, func(b []byte, f pointer, w int) ([]byte, error) { return nil, fmt.Errorf("proto: %s: illegal tag 0 (wire type %d)", t, w) }, 0, "") // Set mask for required field check. u.reqMask = uint64(1)<= 0 && (tag < 16 || tag < 2*n) { // TODO: what are the right numbers here? for len(u.dense) <= tag { u.dense = append(u.dense, unmarshalFieldInfo{}) } u.dense[tag] = i return } if u.sparse == nil { u.sparse = map[uint64]unmarshalFieldInfo{} } u.sparse[uint64(tag)] = i } // fieldUnmarshaler returns an unmarshaler for the given field. func fieldUnmarshaler(f *reflect.StructField) unmarshaler { if f.Type.Kind() == reflect.Map { return makeUnmarshalMap(f) } return typeUnmarshaler(f.Type, f.Tag.Get("protobuf")) } // typeUnmarshaler returns an unmarshaler for the given field type / field tag pair. func typeUnmarshaler(t reflect.Type, tags string) unmarshaler { tagArray := strings.Split(tags, ",") encoding := tagArray[0] name := "unknown" ctype := false isTime := false isDuration := false isWktPointer := false proto3 := false validateUTF8 := true for _, tag := range tagArray[3:] { if strings.HasPrefix(tag, "name=") { name = tag[5:] } if tag == "proto3" { proto3 = true } if strings.HasPrefix(tag, "customtype=") { ctype = true } if tag == "stdtime" { isTime = true } if tag == "stdduration" { isDuration = true } if tag == "wktptr" { isWktPointer = true } } validateUTF8 = validateUTF8 && proto3 // Figure out packaging (pointer, slice, or both) slice := false pointer := false if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 { slice = true t = t.Elem() } if t.Kind() == reflect.Ptr { pointer = true t = t.Elem() } if ctype { if reflect.PtrTo(t).Implements(customType) { if slice { return makeUnmarshalCustomSlice(getUnmarshalInfo(t), name) } if pointer { return makeUnmarshalCustomPtr(getUnmarshalInfo(t), name) } return makeUnmarshalCustom(getUnmarshalInfo(t), name) } else { panic(fmt.Sprintf("custom type: type: %v, does not implement the proto.custom interface", t)) } } if isTime { if pointer { if slice { return makeUnmarshalTimePtrSlice(getUnmarshalInfo(t), name) } return makeUnmarshalTimePtr(getUnmarshalInfo(t), name) } if slice { return makeUnmarshalTimeSlice(getUnmarshalInfo(t), name) } return makeUnmarshalTime(getUnmarshalInfo(t), name) } if isDuration { if pointer { if slice { return makeUnmarshalDurationPtrSlice(getUnmarshalInfo(t), name) } return makeUnmarshalDurationPtr(getUnmarshalInfo(t), name) } if slice { return makeUnmarshalDurationSlice(getUnmarshalInfo(t), name) } return makeUnmarshalDuration(getUnmarshalInfo(t), name) } if isWktPointer { switch t.Kind() { case reflect.Float64: if pointer { if slice { return makeStdDoubleValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdDoubleValuePtrUnmarshaler(getUnmarshalInfo(t), name) } if slice { return makeStdDoubleValueSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdDoubleValueUnmarshaler(getUnmarshalInfo(t), name) case reflect.Float32: if pointer { if slice { return makeStdFloatValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdFloatValuePtrUnmarshaler(getUnmarshalInfo(t), name) } if slice { return makeStdFloatValueSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdFloatValueUnmarshaler(getUnmarshalInfo(t), name) case reflect.Int64: if pointer { if slice { return makeStdInt64ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdInt64ValuePtrUnmarshaler(getUnmarshalInfo(t), name) } if slice { return makeStdInt64ValueSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdInt64ValueUnmarshaler(getUnmarshalInfo(t), name) case reflect.Uint64: if pointer { if slice { return makeStdUInt64ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdUInt64ValuePtrUnmarshaler(getUnmarshalInfo(t), name) } if slice { return makeStdUInt64ValueSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdUInt64ValueUnmarshaler(getUnmarshalInfo(t), name) case reflect.Int32: if pointer { if slice { return makeStdInt32ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdInt32ValuePtrUnmarshaler(getUnmarshalInfo(t), name) } if slice { return makeStdInt32ValueSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdInt32ValueUnmarshaler(getUnmarshalInfo(t), name) case reflect.Uint32: if pointer { if slice { return makeStdUInt32ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdUInt32ValuePtrUnmarshaler(getUnmarshalInfo(t), name) } if slice { return makeStdUInt32ValueSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdUInt32ValueUnmarshaler(getUnmarshalInfo(t), name) case reflect.Bool: if pointer { if slice { return makeStdBoolValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdBoolValuePtrUnmarshaler(getUnmarshalInfo(t), name) } if slice { return makeStdBoolValueSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdBoolValueUnmarshaler(getUnmarshalInfo(t), name) case reflect.String: if pointer { if slice { return makeStdStringValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdStringValuePtrUnmarshaler(getUnmarshalInfo(t), name) } if slice { return makeStdStringValueSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdStringValueUnmarshaler(getUnmarshalInfo(t), name) case uint8SliceType: if pointer { if slice { return makeStdBytesValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdBytesValuePtrUnmarshaler(getUnmarshalInfo(t), name) } if slice { return makeStdBytesValueSliceUnmarshaler(getUnmarshalInfo(t), name) } return makeStdBytesValueUnmarshaler(getUnmarshalInfo(t), name) default: panic(fmt.Sprintf("unknown wktpointer type %#v", t)) } } // We'll never have both pointer and slice for basic types. if pointer && slice && t.Kind() != reflect.Struct { panic("both pointer and slice for basic type in " + t.Name()) } switch t.Kind() { case reflect.Bool: if pointer { return unmarshalBoolPtr } if slice { return unmarshalBoolSlice } return unmarshalBoolValue case reflect.Int32: switch encoding { case "fixed32": if pointer { return unmarshalFixedS32Ptr } if slice { return unmarshalFixedS32Slice } return unmarshalFixedS32Value case "varint": // this could be int32 or enum if pointer { return unmarshalInt32Ptr } if slice { return unmarshalInt32Slice } return unmarshalInt32Value case "zigzag32": if pointer { return unmarshalSint32Ptr } if slice { return unmarshalSint32Slice } return unmarshalSint32Value } case reflect.Int64: switch encoding { case "fixed64": if pointer { return unmarshalFixedS64Ptr } if slice { return unmarshalFixedS64Slice } return unmarshalFixedS64Value case "varint": if pointer { return unmarshalInt64Ptr } if slice { return unmarshalInt64Slice } return unmarshalInt64Value case "zigzag64": if pointer { return unmarshalSint64Ptr } if slice { return unmarshalSint64Slice } return unmarshalSint64Value } case reflect.Uint32: switch encoding { case "fixed32": if pointer { return unmarshalFixed32Ptr } if slice { return unmarshalFixed32Slice } return unmarshalFixed32Value case "varint": if pointer { return unmarshalUint32Ptr } if slice { return unmarshalUint32Slice } return unmarshalUint32Value } case reflect.Uint64: switch encoding { case "fixed64": if pointer { return unmarshalFixed64Ptr } if slice { return unmarshalFixed64Slice } return unmarshalFixed64Value case "varint": if pointer { return unmarshalUint64Ptr } if slice { return unmarshalUint64Slice } return unmarshalUint64Value } case reflect.Float32: if pointer { return unmarshalFloat32Ptr } if slice { return unmarshalFloat32Slice } return unmarshalFloat32Value case reflect.Float64: if pointer { return unmarshalFloat64Ptr } if slice { return unmarshalFloat64Slice } return unmarshalFloat64Value case reflect.Map: panic("map type in typeUnmarshaler in " + t.Name()) case reflect.Slice: if pointer { panic("bad pointer in slice case in " + t.Name()) } if slice { return unmarshalBytesSlice } return unmarshalBytesValue case reflect.String: if validateUTF8 { if pointer { return unmarshalUTF8StringPtr } if slice { return unmarshalUTF8StringSlice } return unmarshalUTF8StringValue } if pointer { return unmarshalStringPtr } if slice { return unmarshalStringSlice } return unmarshalStringValue case reflect.Struct: // message or group field if !pointer { switch encoding { case "bytes": if slice { return makeUnmarshalMessageSlice(getUnmarshalInfo(t), name) } return makeUnmarshalMessage(getUnmarshalInfo(t), name) } } switch encoding { case "bytes": if slice { return makeUnmarshalMessageSlicePtr(getUnmarshalInfo(t), name) } return makeUnmarshalMessagePtr(getUnmarshalInfo(t), name) case "group": if slice { return makeUnmarshalGroupSlicePtr(getUnmarshalInfo(t), name) } return makeUnmarshalGroupPtr(getUnmarshalInfo(t), name) } } panic(fmt.Sprintf("unmarshaler not found type:%s encoding:%s", t, encoding)) } // Below are all the unmarshalers for individual fields of various types. func unmarshalInt64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x) *f.toInt64() = v return b, nil } func unmarshalInt64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x) *f.toInt64Ptr() = &v return b, nil } func unmarshalInt64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x) s := f.toInt64Slice() *s = append(*s, v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x) s := f.toInt64Slice() *s = append(*s, v) return b, nil } func unmarshalSint64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x>>1) ^ int64(x)<<63>>63 *f.toInt64() = v return b, nil } func unmarshalSint64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x>>1) ^ int64(x)<<63>>63 *f.toInt64Ptr() = &v return b, nil } func unmarshalSint64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x>>1) ^ int64(x)<<63>>63 s := f.toInt64Slice() *s = append(*s, v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x>>1) ^ int64(x)<<63>>63 s := f.toInt64Slice() *s = append(*s, v) return b, nil } func unmarshalUint64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint64(x) *f.toUint64() = v return b, nil } func unmarshalUint64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint64(x) *f.toUint64Ptr() = &v return b, nil } func unmarshalUint64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint64(x) s := f.toUint64Slice() *s = append(*s, v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint64(x) s := f.toUint64Slice() *s = append(*s, v) return b, nil } func unmarshalInt32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x) *f.toInt32() = v return b, nil } func unmarshalInt32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x) f.setInt32Ptr(v) return b, nil } func unmarshalInt32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x) f.appendInt32Slice(v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x) f.appendInt32Slice(v) return b, nil } func unmarshalSint32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x>>1) ^ int32(x)<<31>>31 *f.toInt32() = v return b, nil } func unmarshalSint32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x>>1) ^ int32(x)<<31>>31 f.setInt32Ptr(v) return b, nil } func unmarshalSint32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x>>1) ^ int32(x)<<31>>31 f.appendInt32Slice(v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x>>1) ^ int32(x)<<31>>31 f.appendInt32Slice(v) return b, nil } func unmarshalUint32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint32(x) *f.toUint32() = v return b, nil } func unmarshalUint32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint32(x) *f.toUint32Ptr() = &v return b, nil } func unmarshalUint32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint32(x) s := f.toUint32Slice() *s = append(*s, v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint32(x) s := f.toUint32Slice() *s = append(*s, v) return b, nil } func unmarshalFixed64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 *f.toUint64() = v return b[8:], nil } func unmarshalFixed64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 *f.toUint64Ptr() = &v return b[8:], nil } func unmarshalFixed64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 s := f.toUint64Slice() *s = append(*s, v) b = b[8:] } return res, nil } if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 s := f.toUint64Slice() *s = append(*s, v) return b[8:], nil } func unmarshalFixedS64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56 *f.toInt64() = v return b[8:], nil } func unmarshalFixedS64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56 *f.toInt64Ptr() = &v return b[8:], nil } func unmarshalFixedS64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56 s := f.toInt64Slice() *s = append(*s, v) b = b[8:] } return res, nil } if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56 s := f.toInt64Slice() *s = append(*s, v) return b[8:], nil } func unmarshalFixed32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 *f.toUint32() = v return b[4:], nil } func unmarshalFixed32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 *f.toUint32Ptr() = &v return b[4:], nil } func unmarshalFixed32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 s := f.toUint32Slice() *s = append(*s, v) b = b[4:] } return res, nil } if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 s := f.toUint32Slice() *s = append(*s, v) return b[4:], nil } func unmarshalFixedS32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24 *f.toInt32() = v return b[4:], nil } func unmarshalFixedS32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24 f.setInt32Ptr(v) return b[4:], nil } func unmarshalFixedS32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24 f.appendInt32Slice(v) b = b[4:] } return res, nil } if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24 f.appendInt32Slice(v) return b[4:], nil } func unmarshalBoolValue(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } // Note: any length varint is allowed, even though any sane // encoder will use one byte. // See https://github.com/golang/protobuf/issues/76 x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } // TODO: check if x>1? Tests seem to indicate no. v := x != 0 *f.toBool() = v return b[n:], nil } func unmarshalBoolPtr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } v := x != 0 *f.toBoolPtr() = &v return b[n:], nil } func unmarshalBoolSlice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } v := x != 0 s := f.toBoolSlice() *s = append(*s, v) b = b[n:] } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } v := x != 0 s := f.toBoolSlice() *s = append(*s, v) return b[n:], nil } func unmarshalFloat64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56) *f.toFloat64() = v return b[8:], nil } func unmarshalFloat64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56) *f.toFloat64Ptr() = &v return b[8:], nil } func unmarshalFloat64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56) s := f.toFloat64Slice() *s = append(*s, v) b = b[8:] } return res, nil } if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56) s := f.toFloat64Slice() *s = append(*s, v) return b[8:], nil } func unmarshalFloat32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24) *f.toFloat32() = v return b[4:], nil } func unmarshalFloat32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24) *f.toFloat32Ptr() = &v return b[4:], nil } func unmarshalFloat32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24) s := f.toFloat32Slice() *s = append(*s, v) b = b[4:] } return res, nil } if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24) s := f.toFloat32Slice() *s = append(*s, v) return b[4:], nil } func unmarshalStringValue(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) *f.toString() = v return b[x:], nil } func unmarshalStringPtr(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) *f.toStringPtr() = &v return b[x:], nil } func unmarshalStringSlice(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) s := f.toStringSlice() *s = append(*s, v) return b[x:], nil } func unmarshalUTF8StringValue(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) *f.toString() = v if !utf8.ValidString(v) { return b[x:], errInvalidUTF8 } return b[x:], nil } func unmarshalUTF8StringPtr(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) *f.toStringPtr() = &v if !utf8.ValidString(v) { return b[x:], errInvalidUTF8 } return b[x:], nil } func unmarshalUTF8StringSlice(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) s := f.toStringSlice() *s = append(*s, v) if !utf8.ValidString(v) { return b[x:], errInvalidUTF8 } return b[x:], nil } var emptyBuf [0]byte func unmarshalBytesValue(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } // The use of append here is a trick which avoids the zeroing // that would be required if we used a make/copy pair. // We append to emptyBuf instead of nil because we want // a non-nil result even when the length is 0. v := append(emptyBuf[:], b[:x]...) *f.toBytes() = v return b[x:], nil } func unmarshalBytesSlice(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := append(emptyBuf[:], b[:x]...) s := f.toBytesSlice() *s = append(*s, v) return b[x:], nil } func makeUnmarshalMessagePtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } // First read the message field to see if something is there. // The semantics of multiple submessages are weird. Instead of // the last one winning (as it is for all other fields), multiple // submessages are merged. v := f.getPointer() if v.isNil() { v = valToPointer(reflect.New(sub.typ)) f.setPointer(v) } err := sub.unmarshal(v, b[:x]) if err != nil { if r, ok := err.(*RequiredNotSetError); ok { r.field = name + "." + r.field } else { return nil, err } } return b[x:], err } } func makeUnmarshalMessageSlicePtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := valToPointer(reflect.New(sub.typ)) err := sub.unmarshal(v, b[:x]) if err != nil { if r, ok := err.(*RequiredNotSetError); ok { r.field = name + "." + r.field } else { return nil, err } } f.appendPointer(v) return b[x:], err } } func makeUnmarshalGroupPtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireStartGroup { return b, errInternalBadWireType } x, y := findEndGroup(b) if x < 0 { return nil, io.ErrUnexpectedEOF } v := f.getPointer() if v.isNil() { v = valToPointer(reflect.New(sub.typ)) f.setPointer(v) } err := sub.unmarshal(v, b[:x]) if err != nil { if r, ok := err.(*RequiredNotSetError); ok { r.field = name + "." + r.field } else { return nil, err } } return b[y:], err } } func makeUnmarshalGroupSlicePtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireStartGroup { return b, errInternalBadWireType } x, y := findEndGroup(b) if x < 0 { return nil, io.ErrUnexpectedEOF } v := valToPointer(reflect.New(sub.typ)) err := sub.unmarshal(v, b[:x]) if err != nil { if r, ok := err.(*RequiredNotSetError); ok { r.field = name + "." + r.field } else { return nil, err } } f.appendPointer(v) return b[y:], err } } func makeUnmarshalMap(f *reflect.StructField) unmarshaler { t := f.Type kt := t.Key() vt := t.Elem() tagArray := strings.Split(f.Tag.Get("protobuf"), ",") valTags := strings.Split(f.Tag.Get("protobuf_val"), ",") for _, t := range tagArray { if strings.HasPrefix(t, "customtype=") { valTags = append(valTags, t) } if t == "stdtime" { valTags = append(valTags, t) } if t == "stdduration" { valTags = append(valTags, t) } if t == "wktptr" { valTags = append(valTags, t) } } unmarshalKey := typeUnmarshaler(kt, f.Tag.Get("protobuf_key")) unmarshalVal := typeUnmarshaler(vt, strings.Join(valTags, ",")) return func(b []byte, f pointer, w int) ([]byte, error) { // The map entry is a submessage. Figure out how big it is. if w != WireBytes { return nil, fmt.Errorf("proto: bad wiretype for map field: got %d want %d", w, WireBytes) } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } r := b[x:] // unused data to return b = b[:x] // data for map entry // Note: we could use #keys * #values ~= 200 functions // to do map decoding without reflection. Probably not worth it. // Maps will be somewhat slow. Oh well. // Read key and value from data. var nerr nonFatal k := reflect.New(kt) v := reflect.New(vt) for len(b) > 0 { x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } wire := int(x) & 7 b = b[n:] var err error switch x >> 3 { case 1: b, err = unmarshalKey(b, valToPointer(k), wire) case 2: b, err = unmarshalVal(b, valToPointer(v), wire) default: err = errInternalBadWireType // skip unknown tag } if nerr.Merge(err) { continue } if err != errInternalBadWireType { return nil, err } // Skip past unknown fields. b, err = skipField(b, wire) if err != nil { return nil, err } } // Get map, allocate if needed. m := f.asPointerTo(t).Elem() // an addressable map[K]T if m.IsNil() { m.Set(reflect.MakeMap(t)) } // Insert into map. m.SetMapIndex(k.Elem(), v.Elem()) return r, nerr.E } } // makeUnmarshalOneof makes an unmarshaler for oneof fields. // for: // message Msg { // oneof F { // int64 X = 1; // float64 Y = 2; // } // } // typ is the type of the concrete entry for a oneof case (e.g. Msg_X). // ityp is the interface type of the oneof field (e.g. isMsg_F). // unmarshal is the unmarshaler for the base type of the oneof case (e.g. int64). // Note that this function will be called once for each case in the oneof. func makeUnmarshalOneof(typ, ityp reflect.Type, unmarshal unmarshaler) unmarshaler { sf := typ.Field(0) field0 := toField(&sf) return func(b []byte, f pointer, w int) ([]byte, error) { // Allocate holder for value. v := reflect.New(typ) // Unmarshal data into holder. // We unmarshal into the first field of the holder object. var err error var nerr nonFatal b, err = unmarshal(b, valToPointer(v).offset(field0), w) if !nerr.Merge(err) { return nil, err } // Write pointer to holder into target field. f.asPointerTo(ityp).Elem().Set(v) return b, nerr.E } } // Error used by decode internally. var errInternalBadWireType = errors.New("proto: internal error: bad wiretype") // skipField skips past a field of type wire and returns the remaining bytes. func skipField(b []byte, wire int) ([]byte, error) { switch wire { case WireVarint: _, k := decodeVarint(b) if k == 0 { return b, io.ErrUnexpectedEOF } b = b[k:] case WireFixed32: if len(b) < 4 { return b, io.ErrUnexpectedEOF } b = b[4:] case WireFixed64: if len(b) < 8 { return b, io.ErrUnexpectedEOF } b = b[8:] case WireBytes: m, k := decodeVarint(b) if k == 0 || uint64(len(b)-k) < m { return b, io.ErrUnexpectedEOF } b = b[uint64(k)+m:] case WireStartGroup: _, i := findEndGroup(b) if i == -1 { return b, io.ErrUnexpectedEOF } b = b[i:] default: return b, fmt.Errorf("proto: can't skip unknown wire type %d", wire) } return b, nil } // findEndGroup finds the index of the next EndGroup tag. // Groups may be nested, so the "next" EndGroup tag is the first // unpaired EndGroup. // findEndGroup returns the indexes of the start and end of the EndGroup tag. // Returns (-1,-1) if it can't find one. func findEndGroup(b []byte) (int, int) { depth := 1 i := 0 for { x, n := decodeVarint(b[i:]) if n == 0 { return -1, -1 } j := i i += n switch x & 7 { case WireVarint: _, k := decodeVarint(b[i:]) if k == 0 { return -1, -1 } i += k case WireFixed32: if len(b)-4 < i { return -1, -1 } i += 4 case WireFixed64: if len(b)-8 < i { return -1, -1 } i += 8 case WireBytes: m, k := decodeVarint(b[i:]) if k == 0 { return -1, -1 } i += k if uint64(len(b)-i) < m { return -1, -1 } i += int(m) case WireStartGroup: depth++ case WireEndGroup: depth-- if depth == 0 { return j, i } default: return -1, -1 } } } // encodeVarint appends a varint-encoded integer to b and returns the result. func encodeVarint(b []byte, x uint64) []byte { for x >= 1<<7 { b = append(b, byte(x&0x7f|0x80)) x >>= 7 } return append(b, byte(x)) } // decodeVarint reads a varint-encoded integer from b. // Returns the decoded integer and the number of bytes read. // If there is an error, it returns 0,0. func decodeVarint(b []byte) (uint64, int) { var x, y uint64 if len(b) == 0 { goto bad } x = uint64(b[0]) if x < 0x80 { return x, 1 } x -= 0x80 if len(b) <= 1 { goto bad } y = uint64(b[1]) x += y << 7 if y < 0x80 { return x, 2 } x -= 0x80 << 7 if len(b) <= 2 { goto bad } y = uint64(b[2]) x += y << 14 if y < 0x80 { return x, 3 } x -= 0x80 << 14 if len(b) <= 3 { goto bad } y = uint64(b[3]) x += y << 21 if y < 0x80 { return x, 4 } x -= 0x80 << 21 if len(b) <= 4 { goto bad } y = uint64(b[4]) x += y << 28 if y < 0x80 { return x, 5 } x -= 0x80 << 28 if len(b) <= 5 { goto bad } y = uint64(b[5]) x += y << 35 if y < 0x80 { return x, 6 } x -= 0x80 << 35 if len(b) <= 6 { goto bad } y = uint64(b[6]) x += y << 42 if y < 0x80 { return x, 7 } x -= 0x80 << 42 if len(b) <= 7 { goto bad } y = uint64(b[7]) x += y << 49 if y < 0x80 { return x, 8 } x -= 0x80 << 49 if len(b) <= 8 { goto bad } y = uint64(b[8]) x += y << 56 if y < 0x80 { return x, 9 } x -= 0x80 << 56 if len(b) <= 9 { goto bad } y = uint64(b[9]) x += y << 63 if y < 2 { return x, 10 } bad: return 0, 0 } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/table_unmarshal_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2018, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "io" "reflect" ) func makeUnmarshalMessage(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } // First read the message field to see if something is there. // The semantics of multiple submessages are weird. Instead of // the last one winning (as it is for all other fields), multiple // submessages are merged. v := f // gogo: changed from v := f.getPointer() if v.isNil() { v = valToPointer(reflect.New(sub.typ)) f.setPointer(v) } err := sub.unmarshal(v, b[:x]) if err != nil { if r, ok := err.(*RequiredNotSetError); ok { r.field = name + "." + r.field } else { return nil, err } } return b[x:], err } } func makeUnmarshalMessageSlice(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := valToPointer(reflect.New(sub.typ)) err := sub.unmarshal(v, b[:x]) if err != nil { if r, ok := err.(*RequiredNotSetError); ok { r.field = name + "." + r.field } else { return nil, err } } f.appendRef(v, sub.typ) // gogo: changed from f.appendPointer(v) return b[x:], err } } func makeUnmarshalCustomPtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.New(sub.typ)) m := s.Interface().(custom) if err := m.Unmarshal(b[:x]); err != nil { return nil, err } return b[x:], nil } } func makeUnmarshalCustomSlice(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := reflect.New(sub.typ) c := m.Interface().(custom) if err := c.Unmarshal(b[:x]); err != nil { return nil, err } v := valToPointer(m) f.appendRef(v, sub.typ) return b[x:], nil } } func makeUnmarshalCustom(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := f.asPointerTo(sub.typ).Interface().(custom) if err := m.Unmarshal(b[:x]); err != nil { return nil, err } return b[x:], nil } } func makeUnmarshalTime(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := ×tamp{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } t, err := timestampFromProto(m) if err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(t)) return b[x:], nil } } func makeUnmarshalTimePtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := ×tamp{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } t, err := timestampFromProto(m) if err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&t)) return b[x:], nil } } func makeUnmarshalTimePtrSlice(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := ×tamp{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } t, err := timestampFromProto(m) if err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&t)) slice.Set(newSlice) return b[x:], nil } } func makeUnmarshalTimeSlice(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := ×tamp{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } t, err := timestampFromProto(m) if err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(t)) slice.Set(newSlice) return b[x:], nil } } func makeUnmarshalDurationPtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &duration{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } d, err := durationFromProto(m) if err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&d)) return b[x:], nil } } func makeUnmarshalDuration(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &duration{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } d, err := durationFromProto(m) if err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(d)) return b[x:], nil } } func makeUnmarshalDurationPtrSlice(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &duration{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } d, err := durationFromProto(m) if err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&d)) slice.Set(newSlice) return b[x:], nil } } func makeUnmarshalDurationSlice(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &duration{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } d, err := durationFromProto(m) if err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(d)) slice.Set(newSlice) return b[x:], nil } } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/text.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto // Functions for writing the text protocol buffer format. import ( "bufio" "bytes" "encoding" "errors" "fmt" "io" "log" "math" "reflect" "sort" "strings" "sync" "time" ) var ( newline = []byte("\n") spaces = []byte(" ") endBraceNewline = []byte("}\n") backslashN = []byte{'\\', 'n'} backslashR = []byte{'\\', 'r'} backslashT = []byte{'\\', 't'} backslashDQ = []byte{'\\', '"'} backslashBS = []byte{'\\', '\\'} posInf = []byte("inf") negInf = []byte("-inf") nan = []byte("nan") ) type writer interface { io.Writer WriteByte(byte) error } // textWriter is an io.Writer that tracks its indentation level. type textWriter struct { ind int complete bool // if the current position is a complete line compact bool // whether to write out as a one-liner w writer } func (w *textWriter) WriteString(s string) (n int, err error) { if !strings.Contains(s, "\n") { if !w.compact && w.complete { w.writeIndent() } w.complete = false return io.WriteString(w.w, s) } // WriteString is typically called without newlines, so this // codepath and its copy are rare. We copy to avoid // duplicating all of Write's logic here. return w.Write([]byte(s)) } func (w *textWriter) Write(p []byte) (n int, err error) { newlines := bytes.Count(p, newline) if newlines == 0 { if !w.compact && w.complete { w.writeIndent() } n, err = w.w.Write(p) w.complete = false return n, err } frags := bytes.SplitN(p, newline, newlines+1) if w.compact { for i, frag := range frags { if i > 0 { if err := w.w.WriteByte(' '); err != nil { return n, err } n++ } nn, err := w.w.Write(frag) n += nn if err != nil { return n, err } } return n, nil } for i, frag := range frags { if w.complete { w.writeIndent() } nn, err := w.w.Write(frag) n += nn if err != nil { return n, err } if i+1 < len(frags) { if err := w.w.WriteByte('\n'); err != nil { return n, err } n++ } } w.complete = len(frags[len(frags)-1]) == 0 return n, nil } func (w *textWriter) WriteByte(c byte) error { if w.compact && c == '\n' { c = ' ' } if !w.compact && w.complete { w.writeIndent() } err := w.w.WriteByte(c) w.complete = c == '\n' return err } func (w *textWriter) indent() { w.ind++ } func (w *textWriter) unindent() { if w.ind == 0 { log.Print("proto: textWriter unindented too far") return } w.ind-- } func writeName(w *textWriter, props *Properties) error { if _, err := w.WriteString(props.OrigName); err != nil { return err } if props.Wire != "group" { return w.WriteByte(':') } return nil } func requiresQuotes(u string) bool { // When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted. for _, ch := range u { switch { case ch == '.' || ch == '/' || ch == '_': continue case '0' <= ch && ch <= '9': continue case 'A' <= ch && ch <= 'Z': continue case 'a' <= ch && ch <= 'z': continue default: return true } } return false } // isAny reports whether sv is a google.protobuf.Any message func isAny(sv reflect.Value) bool { type wkt interface { XXX_WellKnownType() string } t, ok := sv.Addr().Interface().(wkt) return ok && t.XXX_WellKnownType() == "Any" } // writeProto3Any writes an expanded google.protobuf.Any message. // // It returns (false, nil) if sv value can't be unmarshaled (e.g. because // required messages are not linked in). // // It returns (true, error) when sv was written in expanded format or an error // was encountered. func (tm *TextMarshaler) writeProto3Any(w *textWriter, sv reflect.Value) (bool, error) { turl := sv.FieldByName("TypeUrl") val := sv.FieldByName("Value") if !turl.IsValid() || !val.IsValid() { return true, errors.New("proto: invalid google.protobuf.Any message") } b, ok := val.Interface().([]byte) if !ok { return true, errors.New("proto: invalid google.protobuf.Any message") } parts := strings.Split(turl.String(), "/") mt := MessageType(parts[len(parts)-1]) if mt == nil { return false, nil } m := reflect.New(mt.Elem()) if err := Unmarshal(b, m.Interface().(Message)); err != nil { return false, nil } w.Write([]byte("[")) u := turl.String() if requiresQuotes(u) { writeString(w, u) } else { w.Write([]byte(u)) } if w.compact { w.Write([]byte("]:<")) } else { w.Write([]byte("]: <\n")) w.ind++ } if err := tm.writeStruct(w, m.Elem()); err != nil { return true, err } if w.compact { w.Write([]byte("> ")) } else { w.ind-- w.Write([]byte(">\n")) } return true, nil } func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error { if tm.ExpandAny && isAny(sv) { if canExpand, err := tm.writeProto3Any(w, sv); canExpand { return err } } st := sv.Type() sprops := GetProperties(st) for i := 0; i < sv.NumField(); i++ { fv := sv.Field(i) props := sprops.Prop[i] name := st.Field(i).Name if name == "XXX_NoUnkeyedLiteral" { continue } if strings.HasPrefix(name, "XXX_") { // There are two XXX_ fields: // XXX_unrecognized []byte // XXX_extensions map[int32]proto.Extension // The first is handled here; // the second is handled at the bottom of this function. if name == "XXX_unrecognized" && !fv.IsNil() { if err := writeUnknownStruct(w, fv.Interface().([]byte)); err != nil { return err } } continue } if fv.Kind() == reflect.Ptr && fv.IsNil() { // Field not filled in. This could be an optional field or // a required field that wasn't filled in. Either way, there // isn't anything we can show for it. continue } if fv.Kind() == reflect.Slice && fv.IsNil() { // Repeated field that is empty, or a bytes field that is unused. continue } if props.Repeated && fv.Kind() == reflect.Slice { // Repeated field. for j := 0; j < fv.Len(); j++ { if err := writeName(w, props); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } v := fv.Index(j) if v.Kind() == reflect.Ptr && v.IsNil() { // A nil message in a repeated field is not valid, // but we can handle that more gracefully than panicking. if _, err := w.Write([]byte("\n")); err != nil { return err } continue } if len(props.Enum) > 0 { if err := tm.writeEnum(w, v, props); err != nil { return err } } else if err := tm.writeAny(w, v, props); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } } continue } if fv.Kind() == reflect.Map { // Map fields are rendered as a repeated struct with key/value fields. keys := fv.MapKeys() sort.Sort(mapKeys(keys)) for _, key := range keys { val := fv.MapIndex(key) if err := writeName(w, props); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } // open struct if err := w.WriteByte('<'); err != nil { return err } if !w.compact { if err := w.WriteByte('\n'); err != nil { return err } } w.indent() // key if _, err := w.WriteString("key:"); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } if err := tm.writeAny(w, key, props.MapKeyProp); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } // nil values aren't legal, but we can avoid panicking because of them. if val.Kind() != reflect.Ptr || !val.IsNil() { // value if _, err := w.WriteString("value:"); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } if err := tm.writeAny(w, val, props.MapValProp); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } } // close struct w.unindent() if err := w.WriteByte('>'); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } } continue } if props.proto3 && fv.Kind() == reflect.Slice && fv.Len() == 0 { // empty bytes field continue } if props.proto3 && fv.Kind() != reflect.Ptr && fv.Kind() != reflect.Slice { // proto3 non-repeated scalar field; skip if zero value if isProto3Zero(fv) { continue } } if fv.Kind() == reflect.Interface { // Check if it is a oneof. if st.Field(i).Tag.Get("protobuf_oneof") != "" { // fv is nil, or holds a pointer to generated struct. // That generated struct has exactly one field, // which has a protobuf struct tag. if fv.IsNil() { continue } inner := fv.Elem().Elem() // interface -> *T -> T tag := inner.Type().Field(0).Tag.Get("protobuf") props = new(Properties) // Overwrite the outer props var, but not its pointee. props.Parse(tag) // Write the value in the oneof, not the oneof itself. fv = inner.Field(0) // Special case to cope with malformed messages gracefully: // If the value in the oneof is a nil pointer, don't panic // in writeAny. if fv.Kind() == reflect.Ptr && fv.IsNil() { // Use errors.New so writeAny won't render quotes. msg := errors.New("/* nil */") fv = reflect.ValueOf(&msg).Elem() } } } if err := writeName(w, props); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } if len(props.Enum) > 0 { if err := tm.writeEnum(w, fv, props); err != nil { return err } } else if err := tm.writeAny(w, fv, props); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } } // Extensions (the XXX_extensions field). pv := sv if pv.CanAddr() { pv = sv.Addr() } else { pv = reflect.New(sv.Type()) pv.Elem().Set(sv) } if _, err := extendable(pv.Interface()); err == nil { if err := tm.writeExtensions(w, pv); err != nil { return err } } return nil } // writeAny writes an arbitrary field. func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error { v = reflect.Indirect(v) if props != nil { if len(props.CustomType) > 0 { custom, ok := v.Interface().(Marshaler) if ok { data, err := custom.Marshal() if err != nil { return err } if err := writeString(w, string(data)); err != nil { return err } return nil } } else if len(props.CastType) > 0 { if _, ok := v.Interface().(interface { String() string }); ok { switch v.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: _, err := fmt.Fprintf(w, "%d", v.Interface()) return err } } } else if props.StdTime { t, ok := v.Interface().(time.Time) if !ok { return fmt.Errorf("stdtime is not time.Time, but %T", v.Interface()) } tproto, err := timestampProto(t) if err != nil { return err } propsCopy := *props // Make a copy so that this is goroutine-safe propsCopy.StdTime = false err = tm.writeAny(w, reflect.ValueOf(tproto), &propsCopy) return err } else if props.StdDuration { d, ok := v.Interface().(time.Duration) if !ok { return fmt.Errorf("stdtime is not time.Duration, but %T", v.Interface()) } dproto := durationProto(d) propsCopy := *props // Make a copy so that this is goroutine-safe propsCopy.StdDuration = false err := tm.writeAny(w, reflect.ValueOf(dproto), &propsCopy) return err } } // Floats have special cases. if v.Kind() == reflect.Float32 || v.Kind() == reflect.Float64 { x := v.Float() var b []byte switch { case math.IsInf(x, 1): b = posInf case math.IsInf(x, -1): b = negInf case math.IsNaN(x): b = nan } if b != nil { _, err := w.Write(b) return err } // Other values are handled below. } // We don't attempt to serialise every possible value type; only those // that can occur in protocol buffers. switch v.Kind() { case reflect.Slice: // Should only be a []byte; repeated fields are handled in writeStruct. if err := writeString(w, string(v.Bytes())); err != nil { return err } case reflect.String: if err := writeString(w, v.String()); err != nil { return err } case reflect.Struct: // Required/optional group/message. var bra, ket byte = '<', '>' if props != nil && props.Wire == "group" { bra, ket = '{', '}' } if err := w.WriteByte(bra); err != nil { return err } if !w.compact { if err := w.WriteByte('\n'); err != nil { return err } } w.indent() if v.CanAddr() { // Calling v.Interface on a struct causes the reflect package to // copy the entire struct. This is racy with the new Marshaler // since we atomically update the XXX_sizecache. // // Thus, we retrieve a pointer to the struct if possible to avoid // a race since v.Interface on the pointer doesn't copy the struct. // // If v is not addressable, then we are not worried about a race // since it implies that the binary Marshaler cannot possibly be // mutating this value. v = v.Addr() } if etm, ok := v.Interface().(encoding.TextMarshaler); ok { text, err := etm.MarshalText() if err != nil { return err } if _, err = w.Write(text); err != nil { return err } } else { if v.Kind() == reflect.Ptr { v = v.Elem() } if err := tm.writeStruct(w, v); err != nil { return err } } w.unindent() if err := w.WriteByte(ket); err != nil { return err } default: _, err := fmt.Fprint(w, v.Interface()) return err } return nil } // equivalent to C's isprint. func isprint(c byte) bool { return c >= 0x20 && c < 0x7f } // writeString writes a string in the protocol buffer text format. // It is similar to strconv.Quote except we don't use Go escape sequences, // we treat the string as a byte sequence, and we use octal escapes. // These differences are to maintain interoperability with the other // languages' implementations of the text format. func writeString(w *textWriter, s string) error { // use WriteByte here to get any needed indent if err := w.WriteByte('"'); err != nil { return err } // Loop over the bytes, not the runes. for i := 0; i < len(s); i++ { var err error // Divergence from C++: we don't escape apostrophes. // There's no need to escape them, and the C++ parser // copes with a naked apostrophe. switch c := s[i]; c { case '\n': _, err = w.w.Write(backslashN) case '\r': _, err = w.w.Write(backslashR) case '\t': _, err = w.w.Write(backslashT) case '"': _, err = w.w.Write(backslashDQ) case '\\': _, err = w.w.Write(backslashBS) default: if isprint(c) { err = w.w.WriteByte(c) } else { _, err = fmt.Fprintf(w.w, "\\%03o", c) } } if err != nil { return err } } return w.WriteByte('"') } func writeUnknownStruct(w *textWriter, data []byte) (err error) { if !w.compact { if _, err := fmt.Fprintf(w, "/* %d unknown bytes */\n", len(data)); err != nil { return err } } b := NewBuffer(data) for b.index < len(b.buf) { x, err := b.DecodeVarint() if err != nil { _, ferr := fmt.Fprintf(w, "/* %v */\n", err) return ferr } wire, tag := x&7, x>>3 if wire == WireEndGroup { w.unindent() if _, werr := w.Write(endBraceNewline); werr != nil { return werr } continue } if _, ferr := fmt.Fprint(w, tag); ferr != nil { return ferr } if wire != WireStartGroup { if err = w.WriteByte(':'); err != nil { return err } } if !w.compact || wire == WireStartGroup { if err = w.WriteByte(' '); err != nil { return err } } switch wire { case WireBytes: buf, e := b.DecodeRawBytes(false) if e == nil { _, err = fmt.Fprintf(w, "%q", buf) } else { _, err = fmt.Fprintf(w, "/* %v */", e) } case WireFixed32: x, err = b.DecodeFixed32() err = writeUnknownInt(w, x, err) case WireFixed64: x, err = b.DecodeFixed64() err = writeUnknownInt(w, x, err) case WireStartGroup: err = w.WriteByte('{') w.indent() case WireVarint: x, err = b.DecodeVarint() err = writeUnknownInt(w, x, err) default: _, err = fmt.Fprintf(w, "/* unknown wire type %d */", wire) } if err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } } return nil } func writeUnknownInt(w *textWriter, x uint64, err error) error { if err == nil { _, err = fmt.Fprint(w, x) } else { _, err = fmt.Fprintf(w, "/* %v */", err) } return err } type int32Slice []int32 func (s int32Slice) Len() int { return len(s) } func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] } func (s int32Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } // writeExtensions writes all the extensions in pv. // pv is assumed to be a pointer to a protocol message struct that is extendable. func (tm *TextMarshaler) writeExtensions(w *textWriter, pv reflect.Value) error { emap := extensionMaps[pv.Type().Elem()] e := pv.Interface().(Message) var m map[int32]Extension var mu sync.Locker if em, ok := e.(extensionsBytes); ok { eb := em.GetExtensions() var err error m, err = BytesToExtensionsMap(*eb) if err != nil { return err } mu = notLocker{} } else if _, ok := e.(extendableProto); ok { ep, _ := extendable(e) m, mu = ep.extensionsRead() if m == nil { return nil } } // Order the extensions by ID. // This isn't strictly necessary, but it will give us // canonical output, which will also make testing easier. mu.Lock() ids := make([]int32, 0, len(m)) for id := range m { ids = append(ids, id) } sort.Sort(int32Slice(ids)) mu.Unlock() for _, extNum := range ids { ext := m[extNum] var desc *ExtensionDesc if emap != nil { desc = emap[extNum] } if desc == nil { // Unknown extension. if err := writeUnknownStruct(w, ext.enc); err != nil { return err } continue } pb, err := GetExtension(e, desc) if err != nil { return fmt.Errorf("failed getting extension: %v", err) } // Repeated extensions will appear as a slice. if !desc.repeated() { if err := tm.writeExtension(w, desc.Name, pb); err != nil { return err } } else { v := reflect.ValueOf(pb) for i := 0; i < v.Len(); i++ { if err := tm.writeExtension(w, desc.Name, v.Index(i).Interface()); err != nil { return err } } } } return nil } func (tm *TextMarshaler) writeExtension(w *textWriter, name string, pb interface{}) error { if _, err := fmt.Fprintf(w, "[%s]:", name); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } if err := tm.writeAny(w, reflect.ValueOf(pb), nil); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } return nil } func (w *textWriter) writeIndent() { if !w.complete { return } remain := w.ind * 2 for remain > 0 { n := remain if n > len(spaces) { n = len(spaces) } w.w.Write(spaces[:n]) remain -= n } w.complete = false } // TextMarshaler is a configurable text format marshaler. type TextMarshaler struct { Compact bool // use compact text format (one line). ExpandAny bool // expand google.protobuf.Any messages of known types } // Marshal writes a given protocol buffer in text format. // The only errors returned are from w. func (tm *TextMarshaler) Marshal(w io.Writer, pb Message) error { val := reflect.ValueOf(pb) if pb == nil || val.IsNil() { w.Write([]byte("")) return nil } var bw *bufio.Writer ww, ok := w.(writer) if !ok { bw = bufio.NewWriter(w) ww = bw } aw := &textWriter{ w: ww, complete: true, compact: tm.Compact, } if etm, ok := pb.(encoding.TextMarshaler); ok { text, err := etm.MarshalText() if err != nil { return err } if _, err = aw.Write(text); err != nil { return err } if bw != nil { return bw.Flush() } return nil } // Dereference the received pointer so we don't have outer < and >. v := reflect.Indirect(val) if err := tm.writeStruct(aw, v); err != nil { return err } if bw != nil { return bw.Flush() } return nil } // Text is the same as Marshal, but returns the string directly. func (tm *TextMarshaler) Text(pb Message) string { var buf bytes.Buffer tm.Marshal(&buf, pb) return buf.String() } var ( defaultTextMarshaler = TextMarshaler{} compactTextMarshaler = TextMarshaler{Compact: true} ) // TODO: consider removing some of the Marshal functions below. // MarshalText writes a given protocol buffer in text format. // The only errors returned are from w. func MarshalText(w io.Writer, pb Message) error { return defaultTextMarshaler.Marshal(w, pb) } // MarshalTextString is the same as MarshalText, but returns the string directly. func MarshalTextString(pb Message) string { return defaultTextMarshaler.Text(pb) } // CompactText writes a given protocol buffer in compact text format (one line). func CompactText(w io.Writer, pb Message) error { return compactTextMarshaler.Marshal(w, pb) } // CompactTextString is the same as CompactText, but returns the string directly. func CompactTextString(pb Message) string { return compactTextMarshaler.Text(pb) } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/text_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "fmt" "reflect" ) func (tm *TextMarshaler) writeEnum(w *textWriter, v reflect.Value, props *Properties) error { m, ok := enumStringMaps[props.Enum] if !ok { if err := tm.writeAny(w, v, props); err != nil { return err } } key := int32(0) if v.Kind() == reflect.Ptr { key = int32(v.Elem().Int()) } else { key = int32(v.Int()) } s, ok := m[key] if !ok { if err := tm.writeAny(w, v, props); err != nil { return err } } _, err := fmt.Fprint(w, s) return err } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/text_parser.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto // Functions for parsing the Text protocol buffer format. // TODO: message sets. import ( "encoding" "errors" "fmt" "reflect" "strconv" "strings" "time" "unicode/utf8" ) // Error string emitted when deserializing Any and fields are already set const anyRepeatedlyUnpacked = "Any message unpacked multiple times, or %q already set" type ParseError struct { Message string Line int // 1-based line number Offset int // 0-based byte offset from start of input } func (p *ParseError) Error() string { if p.Line == 1 { // show offset only for first line return fmt.Sprintf("line 1.%d: %v", p.Offset, p.Message) } return fmt.Sprintf("line %d: %v", p.Line, p.Message) } type token struct { value string err *ParseError line int // line number offset int // byte number from start of input, not start of line unquoted string // the unquoted version of value, if it was a quoted string } func (t *token) String() string { if t.err == nil { return fmt.Sprintf("%q (line=%d, offset=%d)", t.value, t.line, t.offset) } return fmt.Sprintf("parse error: %v", t.err) } type textParser struct { s string // remaining input done bool // whether the parsing is finished (success or error) backed bool // whether back() was called offset, line int cur token } func newTextParser(s string) *textParser { p := new(textParser) p.s = s p.line = 1 p.cur.line = 1 return p } func (p *textParser) errorf(format string, a ...interface{}) *ParseError { pe := &ParseError{fmt.Sprintf(format, a...), p.cur.line, p.cur.offset} p.cur.err = pe p.done = true return pe } // Numbers and identifiers are matched by [-+._A-Za-z0-9] func isIdentOrNumberChar(c byte) bool { switch { case 'A' <= c && c <= 'Z', 'a' <= c && c <= 'z': return true case '0' <= c && c <= '9': return true } switch c { case '-', '+', '.', '_': return true } return false } func isWhitespace(c byte) bool { switch c { case ' ', '\t', '\n', '\r': return true } return false } func isQuote(c byte) bool { switch c { case '"', '\'': return true } return false } func (p *textParser) skipWhitespace() { i := 0 for i < len(p.s) && (isWhitespace(p.s[i]) || p.s[i] == '#') { if p.s[i] == '#' { // comment; skip to end of line or input for i < len(p.s) && p.s[i] != '\n' { i++ } if i == len(p.s) { break } } if p.s[i] == '\n' { p.line++ } i++ } p.offset += i p.s = p.s[i:len(p.s)] if len(p.s) == 0 { p.done = true } } func (p *textParser) advance() { // Skip whitespace p.skipWhitespace() if p.done { return } // Start of non-whitespace p.cur.err = nil p.cur.offset, p.cur.line = p.offset, p.line p.cur.unquoted = "" switch p.s[0] { case '<', '>', '{', '}', ':', '[', ']', ';', ',', '/': // Single symbol p.cur.value, p.s = p.s[0:1], p.s[1:len(p.s)] case '"', '\'': // Quoted string i := 1 for i < len(p.s) && p.s[i] != p.s[0] && p.s[i] != '\n' { if p.s[i] == '\\' && i+1 < len(p.s) { // skip escaped char i++ } i++ } if i >= len(p.s) || p.s[i] != p.s[0] { p.errorf("unmatched quote") return } unq, err := unquoteC(p.s[1:i], rune(p.s[0])) if err != nil { p.errorf("invalid quoted string %s: %v", p.s[0:i+1], err) return } p.cur.value, p.s = p.s[0:i+1], p.s[i+1:len(p.s)] p.cur.unquoted = unq default: i := 0 for i < len(p.s) && isIdentOrNumberChar(p.s[i]) { i++ } if i == 0 { p.errorf("unexpected byte %#x", p.s[0]) return } p.cur.value, p.s = p.s[0:i], p.s[i:len(p.s)] } p.offset += len(p.cur.value) } var ( errBadUTF8 = errors.New("proto: bad UTF-8") ) func unquoteC(s string, quote rune) (string, error) { // This is based on C++'s tokenizer.cc. // Despite its name, this is *not* parsing C syntax. // For instance, "\0" is an invalid quoted string. // Avoid allocation in trivial cases. simple := true for _, r := range s { if r == '\\' || r == quote { simple = false break } } if simple { return s, nil } buf := make([]byte, 0, 3*len(s)/2) for len(s) > 0 { r, n := utf8.DecodeRuneInString(s) if r == utf8.RuneError && n == 1 { return "", errBadUTF8 } s = s[n:] if r != '\\' { if r < utf8.RuneSelf { buf = append(buf, byte(r)) } else { buf = append(buf, string(r)...) } continue } ch, tail, err := unescape(s) if err != nil { return "", err } buf = append(buf, ch...) s = tail } return string(buf), nil } func unescape(s string) (ch string, tail string, err error) { r, n := utf8.DecodeRuneInString(s) if r == utf8.RuneError && n == 1 { return "", "", errBadUTF8 } s = s[n:] switch r { case 'a': return "\a", s, nil case 'b': return "\b", s, nil case 'f': return "\f", s, nil case 'n': return "\n", s, nil case 'r': return "\r", s, nil case 't': return "\t", s, nil case 'v': return "\v", s, nil case '?': return "?", s, nil // trigraph workaround case '\'', '"', '\\': return string(r), s, nil case '0', '1', '2', '3', '4', '5', '6', '7': if len(s) < 2 { return "", "", fmt.Errorf(`\%c requires 2 following digits`, r) } ss := string(r) + s[:2] s = s[2:] i, err := strconv.ParseUint(ss, 8, 8) if err != nil { return "", "", fmt.Errorf(`\%s contains non-octal digits`, ss) } return string([]byte{byte(i)}), s, nil case 'x', 'X', 'u', 'U': var n int switch r { case 'x', 'X': n = 2 case 'u': n = 4 case 'U': n = 8 } if len(s) < n { return "", "", fmt.Errorf(`\%c requires %d following digits`, r, n) } ss := s[:n] s = s[n:] i, err := strconv.ParseUint(ss, 16, 64) if err != nil { return "", "", fmt.Errorf(`\%c%s contains non-hexadecimal digits`, r, ss) } if r == 'x' || r == 'X' { return string([]byte{byte(i)}), s, nil } if i > utf8.MaxRune { return "", "", fmt.Errorf(`\%c%s is not a valid Unicode code point`, r, ss) } return string(i), s, nil } return "", "", fmt.Errorf(`unknown escape \%c`, r) } // Back off the parser by one token. Can only be done between calls to next(). // It makes the next advance() a no-op. func (p *textParser) back() { p.backed = true } // Advances the parser and returns the new current token. func (p *textParser) next() *token { if p.backed || p.done { p.backed = false return &p.cur } p.advance() if p.done { p.cur.value = "" } else if len(p.cur.value) > 0 && isQuote(p.cur.value[0]) { // Look for multiple quoted strings separated by whitespace, // and concatenate them. cat := p.cur for { p.skipWhitespace() if p.done || !isQuote(p.s[0]) { break } p.advance() if p.cur.err != nil { return &p.cur } cat.value += " " + p.cur.value cat.unquoted += p.cur.unquoted } p.done = false // parser may have seen EOF, but we want to return cat p.cur = cat } return &p.cur } func (p *textParser) consumeToken(s string) error { tok := p.next() if tok.err != nil { return tok.err } if tok.value != s { p.back() return p.errorf("expected %q, found %q", s, tok.value) } return nil } // Return a RequiredNotSetError indicating which required field was not set. func (p *textParser) missingRequiredFieldError(sv reflect.Value) *RequiredNotSetError { st := sv.Type() sprops := GetProperties(st) for i := 0; i < st.NumField(); i++ { if !isNil(sv.Field(i)) { continue } props := sprops.Prop[i] if props.Required { return &RequiredNotSetError{fmt.Sprintf("%v.%v", st, props.OrigName)} } } return &RequiredNotSetError{fmt.Sprintf("%v.", st)} // should not happen } // Returns the index in the struct for the named field, as well as the parsed tag properties. func structFieldByName(sprops *StructProperties, name string) (int, *Properties, bool) { i, ok := sprops.decoderOrigNames[name] if ok { return i, sprops.Prop[i], true } return -1, nil, false } // Consume a ':' from the input stream (if the next token is a colon), // returning an error if a colon is needed but not present. func (p *textParser) checkForColon(props *Properties, typ reflect.Type) *ParseError { tok := p.next() if tok.err != nil { return tok.err } if tok.value != ":" { // Colon is optional when the field is a group or message. needColon := true switch props.Wire { case "group": needColon = false case "bytes": // A "bytes" field is either a message, a string, or a repeated field; // those three become *T, *string and []T respectively, so we can check for // this field being a pointer to a non-string. if typ.Kind() == reflect.Ptr { // *T or *string if typ.Elem().Kind() == reflect.String { break } } else if typ.Kind() == reflect.Slice { // []T or []*T if typ.Elem().Kind() != reflect.Ptr { break } } else if typ.Kind() == reflect.String { // The proto3 exception is for a string field, // which requires a colon. break } needColon = false } if needColon { return p.errorf("expected ':', found %q", tok.value) } p.back() } return nil } func (p *textParser) readStruct(sv reflect.Value, terminator string) error { st := sv.Type() sprops := GetProperties(st) reqCount := sprops.reqCount var reqFieldErr error fieldSet := make(map[string]bool) // A struct is a sequence of "name: value", terminated by one of // '>' or '}', or the end of the input. A name may also be // "[extension]" or "[type/url]". // // The whole struct can also be an expanded Any message, like: // [type/url] < ... struct contents ... > for { tok := p.next() if tok.err != nil { return tok.err } if tok.value == terminator { break } if tok.value == "[" { // Looks like an extension or an Any. // // TODO: Check whether we need to handle // namespace rooted names (e.g. ".something.Foo"). extName, err := p.consumeExtName() if err != nil { return err } if s := strings.LastIndex(extName, "/"); s >= 0 { // If it contains a slash, it's an Any type URL. messageName := extName[s+1:] mt := MessageType(messageName) if mt == nil { return p.errorf("unrecognized message %q in google.protobuf.Any", messageName) } tok = p.next() if tok.err != nil { return tok.err } // consume an optional colon if tok.value == ":" { tok = p.next() if tok.err != nil { return tok.err } } var terminator string switch tok.value { case "<": terminator = ">" case "{": terminator = "}" default: return p.errorf("expected '{' or '<', found %q", tok.value) } v := reflect.New(mt.Elem()) if pe := p.readStruct(v.Elem(), terminator); pe != nil { return pe } b, err := Marshal(v.Interface().(Message)) if err != nil { return p.errorf("failed to marshal message of type %q: %v", messageName, err) } if fieldSet["type_url"] { return p.errorf(anyRepeatedlyUnpacked, "type_url") } if fieldSet["value"] { return p.errorf(anyRepeatedlyUnpacked, "value") } sv.FieldByName("TypeUrl").SetString(extName) sv.FieldByName("Value").SetBytes(b) fieldSet["type_url"] = true fieldSet["value"] = true continue } var desc *ExtensionDesc // This could be faster, but it's functional. // TODO: Do something smarter than a linear scan. for _, d := range RegisteredExtensions(reflect.New(st).Interface().(Message)) { if d.Name == extName { desc = d break } } if desc == nil { return p.errorf("unrecognized extension %q", extName) } props := &Properties{} props.Parse(desc.Tag) typ := reflect.TypeOf(desc.ExtensionType) if err := p.checkForColon(props, typ); err != nil { return err } rep := desc.repeated() // Read the extension structure, and set it in // the value we're constructing. var ext reflect.Value if !rep { ext = reflect.New(typ).Elem() } else { ext = reflect.New(typ.Elem()).Elem() } if err := p.readAny(ext, props); err != nil { if _, ok := err.(*RequiredNotSetError); !ok { return err } reqFieldErr = err } ep := sv.Addr().Interface().(Message) if !rep { SetExtension(ep, desc, ext.Interface()) } else { old, err := GetExtension(ep, desc) var sl reflect.Value if err == nil { sl = reflect.ValueOf(old) // existing slice } else { sl = reflect.MakeSlice(typ, 0, 1) } sl = reflect.Append(sl, ext) SetExtension(ep, desc, sl.Interface()) } if err := p.consumeOptionalSeparator(); err != nil { return err } continue } // This is a normal, non-extension field. name := tok.value var dst reflect.Value fi, props, ok := structFieldByName(sprops, name) if ok { dst = sv.Field(fi) } else if oop, ok := sprops.OneofTypes[name]; ok { // It is a oneof. props = oop.Prop nv := reflect.New(oop.Type.Elem()) dst = nv.Elem().Field(0) field := sv.Field(oop.Field) if !field.IsNil() { return p.errorf("field '%s' would overwrite already parsed oneof '%s'", name, sv.Type().Field(oop.Field).Name) } field.Set(nv) } if !dst.IsValid() { return p.errorf("unknown field name %q in %v", name, st) } if dst.Kind() == reflect.Map { // Consume any colon. if err := p.checkForColon(props, dst.Type()); err != nil { return err } // Construct the map if it doesn't already exist. if dst.IsNil() { dst.Set(reflect.MakeMap(dst.Type())) } key := reflect.New(dst.Type().Key()).Elem() val := reflect.New(dst.Type().Elem()).Elem() // The map entry should be this sequence of tokens: // < key : KEY value : VALUE > // However, implementations may omit key or value, and technically // we should support them in any order. See b/28924776 for a time // this went wrong. tok := p.next() var terminator string switch tok.value { case "<": terminator = ">" case "{": terminator = "}" default: return p.errorf("expected '{' or '<', found %q", tok.value) } for { tok := p.next() if tok.err != nil { return tok.err } if tok.value == terminator { break } switch tok.value { case "key": if err := p.consumeToken(":"); err != nil { return err } if err := p.readAny(key, props.MapKeyProp); err != nil { return err } if err := p.consumeOptionalSeparator(); err != nil { return err } case "value": if err := p.checkForColon(props.MapValProp, dst.Type().Elem()); err != nil { return err } if err := p.readAny(val, props.MapValProp); err != nil { return err } if err := p.consumeOptionalSeparator(); err != nil { return err } default: p.back() return p.errorf(`expected "key", "value", or %q, found %q`, terminator, tok.value) } } dst.SetMapIndex(key, val) continue } // Check that it's not already set if it's not a repeated field. if !props.Repeated && fieldSet[name] { return p.errorf("non-repeated field %q was repeated", name) } if err := p.checkForColon(props, dst.Type()); err != nil { return err } // Parse into the field. fieldSet[name] = true if err := p.readAny(dst, props); err != nil { if _, ok := err.(*RequiredNotSetError); !ok { return err } reqFieldErr = err } if props.Required { reqCount-- } if err := p.consumeOptionalSeparator(); err != nil { return err } } if reqCount > 0 { return p.missingRequiredFieldError(sv) } return reqFieldErr } // consumeExtName consumes extension name or expanded Any type URL and the // following ']'. It returns the name or URL consumed. func (p *textParser) consumeExtName() (string, error) { tok := p.next() if tok.err != nil { return "", tok.err } // If extension name or type url is quoted, it's a single token. if len(tok.value) > 2 && isQuote(tok.value[0]) && tok.value[len(tok.value)-1] == tok.value[0] { name, err := unquoteC(tok.value[1:len(tok.value)-1], rune(tok.value[0])) if err != nil { return "", err } return name, p.consumeToken("]") } // Consume everything up to "]" var parts []string for tok.value != "]" { parts = append(parts, tok.value) tok = p.next() if tok.err != nil { return "", p.errorf("unrecognized type_url or extension name: %s", tok.err) } if p.done && tok.value != "]" { return "", p.errorf("unclosed type_url or extension name") } } return strings.Join(parts, ""), nil } // consumeOptionalSeparator consumes an optional semicolon or comma. // It is used in readStruct to provide backward compatibility. func (p *textParser) consumeOptionalSeparator() error { tok := p.next() if tok.err != nil { return tok.err } if tok.value != ";" && tok.value != "," { p.back() } return nil } func (p *textParser) readAny(v reflect.Value, props *Properties) error { tok := p.next() if tok.err != nil { return tok.err } if tok.value == "" { return p.errorf("unexpected EOF") } if len(props.CustomType) > 0 { if props.Repeated { t := reflect.TypeOf(v.Interface()) if t.Kind() == reflect.Slice { tc := reflect.TypeOf(new(Marshaler)) ok := t.Elem().Implements(tc.Elem()) if ok { fv := v flen := fv.Len() if flen == fv.Cap() { nav := reflect.MakeSlice(v.Type(), flen, 2*flen+1) reflect.Copy(nav, fv) fv.Set(nav) } fv.SetLen(flen + 1) // Read one. p.back() return p.readAny(fv.Index(flen), props) } } } if reflect.TypeOf(v.Interface()).Kind() == reflect.Ptr { custom := reflect.New(props.ctype.Elem()).Interface().(Unmarshaler) err := custom.Unmarshal([]byte(tok.unquoted)) if err != nil { return p.errorf("%v %v: %v", err, v.Type(), tok.value) } v.Set(reflect.ValueOf(custom)) } else { custom := reflect.New(reflect.TypeOf(v.Interface())).Interface().(Unmarshaler) err := custom.Unmarshal([]byte(tok.unquoted)) if err != nil { return p.errorf("%v %v: %v", err, v.Type(), tok.value) } v.Set(reflect.Indirect(reflect.ValueOf(custom))) } return nil } if props.StdTime { fv := v p.back() props.StdTime = false tproto := ×tamp{} err := p.readAny(reflect.ValueOf(tproto).Elem(), props) props.StdTime = true if err != nil { return err } tim, err := timestampFromProto(tproto) if err != nil { return err } if props.Repeated { t := reflect.TypeOf(v.Interface()) if t.Kind() == reflect.Slice { if t.Elem().Kind() == reflect.Ptr { ts := fv.Interface().([]*time.Time) ts = append(ts, &tim) fv.Set(reflect.ValueOf(ts)) return nil } else { ts := fv.Interface().([]time.Time) ts = append(ts, tim) fv.Set(reflect.ValueOf(ts)) return nil } } } if reflect.TypeOf(v.Interface()).Kind() == reflect.Ptr { v.Set(reflect.ValueOf(&tim)) } else { v.Set(reflect.Indirect(reflect.ValueOf(&tim))) } return nil } if props.StdDuration { fv := v p.back() props.StdDuration = false dproto := &duration{} err := p.readAny(reflect.ValueOf(dproto).Elem(), props) props.StdDuration = true if err != nil { return err } dur, err := durationFromProto(dproto) if err != nil { return err } if props.Repeated { t := reflect.TypeOf(v.Interface()) if t.Kind() == reflect.Slice { if t.Elem().Kind() == reflect.Ptr { ds := fv.Interface().([]*time.Duration) ds = append(ds, &dur) fv.Set(reflect.ValueOf(ds)) return nil } else { ds := fv.Interface().([]time.Duration) ds = append(ds, dur) fv.Set(reflect.ValueOf(ds)) return nil } } } if reflect.TypeOf(v.Interface()).Kind() == reflect.Ptr { v.Set(reflect.ValueOf(&dur)) } else { v.Set(reflect.Indirect(reflect.ValueOf(&dur))) } return nil } switch fv := v; fv.Kind() { case reflect.Slice: at := v.Type() if at.Elem().Kind() == reflect.Uint8 { // Special case for []byte if tok.value[0] != '"' && tok.value[0] != '\'' { // Deliberately written out here, as the error after // this switch statement would write "invalid []byte: ...", // which is not as user-friendly. return p.errorf("invalid string: %v", tok.value) } bytes := []byte(tok.unquoted) fv.Set(reflect.ValueOf(bytes)) return nil } // Repeated field. if tok.value == "[" { // Repeated field with list notation, like [1,2,3]. for { fv.Set(reflect.Append(fv, reflect.New(at.Elem()).Elem())) err := p.readAny(fv.Index(fv.Len()-1), props) if err != nil { return err } ntok := p.next() if ntok.err != nil { return ntok.err } if ntok.value == "]" { break } if ntok.value != "," { return p.errorf("Expected ']' or ',' found %q", ntok.value) } } return nil } // One value of the repeated field. p.back() fv.Set(reflect.Append(fv, reflect.New(at.Elem()).Elem())) return p.readAny(fv.Index(fv.Len()-1), props) case reflect.Bool: // true/1/t/True or false/f/0/False. switch tok.value { case "true", "1", "t", "True": fv.SetBool(true) return nil case "false", "0", "f", "False": fv.SetBool(false) return nil } case reflect.Float32, reflect.Float64: v := tok.value // Ignore 'f' for compatibility with output generated by C++, but don't // remove 'f' when the value is "-inf" or "inf". if strings.HasSuffix(v, "f") && tok.value != "-inf" && tok.value != "inf" { v = v[:len(v)-1] } if f, err := strconv.ParseFloat(v, fv.Type().Bits()); err == nil { fv.SetFloat(f) return nil } case reflect.Int8: if x, err := strconv.ParseInt(tok.value, 0, 8); err == nil { fv.SetInt(x) return nil } case reflect.Int16: if x, err := strconv.ParseInt(tok.value, 0, 16); err == nil { fv.SetInt(x) return nil } case reflect.Int32: if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil { fv.SetInt(x) return nil } if len(props.Enum) == 0 { break } m, ok := enumValueMaps[props.Enum] if !ok { break } x, ok := m[tok.value] if !ok { break } fv.SetInt(int64(x)) return nil case reflect.Int64: if x, err := strconv.ParseInt(tok.value, 0, 64); err == nil { fv.SetInt(x) return nil } case reflect.Ptr: // A basic field (indirected through pointer), or a repeated message/group p.back() fv.Set(reflect.New(fv.Type().Elem())) return p.readAny(fv.Elem(), props) case reflect.String: if tok.value[0] == '"' || tok.value[0] == '\'' { fv.SetString(tok.unquoted) return nil } case reflect.Struct: var terminator string switch tok.value { case "{": terminator = "}" case "<": terminator = ">" default: return p.errorf("expected '{' or '<', found %q", tok.value) } // TODO: Handle nested messages which implement encoding.TextUnmarshaler. return p.readStruct(fv, terminator) case reflect.Uint8: if x, err := strconv.ParseUint(tok.value, 0, 8); err == nil { fv.SetUint(x) return nil } case reflect.Uint16: if x, err := strconv.ParseUint(tok.value, 0, 16); err == nil { fv.SetUint(x) return nil } case reflect.Uint32: if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil { fv.SetUint(uint64(x)) return nil } case reflect.Uint64: if x, err := strconv.ParseUint(tok.value, 0, 64); err == nil { fv.SetUint(x) return nil } } return p.errorf("invalid %v: %v", v.Type(), tok.value) } // UnmarshalText reads a protocol buffer in Text format. UnmarshalText resets pb // before starting to unmarshal, so any existing data in pb is always removed. // If a required field is not set and no other error occurs, // UnmarshalText returns *RequiredNotSetError. func UnmarshalText(s string, pb Message) error { if um, ok := pb.(encoding.TextUnmarshaler); ok { return um.UnmarshalText([]byte(s)) } pb.Reset() v := reflect.ValueOf(pb) return newTextParser(s).readStruct(v.Elem(), "") } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/timestamp.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto // This file implements operations on google.protobuf.Timestamp. import ( "errors" "fmt" "time" ) const ( // Seconds field of the earliest valid Timestamp. // This is time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC).Unix(). minValidSeconds = -62135596800 // Seconds field just after the latest valid Timestamp. // This is time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC).Unix(). maxValidSeconds = 253402300800 ) // validateTimestamp determines whether a Timestamp is valid. // A valid timestamp represents a time in the range // [0001-01-01, 10000-01-01) and has a Nanos field // in the range [0, 1e9). // // If the Timestamp is valid, validateTimestamp returns nil. // Otherwise, it returns an error that describes // the problem. // // Every valid Timestamp can be represented by a time.Time, but the converse is not true. func validateTimestamp(ts *timestamp) error { if ts == nil { return errors.New("timestamp: nil Timestamp") } if ts.Seconds < minValidSeconds { return fmt.Errorf("timestamp: %#v before 0001-01-01", ts) } if ts.Seconds >= maxValidSeconds { return fmt.Errorf("timestamp: %#v after 10000-01-01", ts) } if ts.Nanos < 0 || ts.Nanos >= 1e9 { return fmt.Errorf("timestamp: %#v: nanos not in range [0, 1e9)", ts) } return nil } // TimestampFromProto converts a google.protobuf.Timestamp proto to a time.Time. // It returns an error if the argument is invalid. // // Unlike most Go functions, if Timestamp returns an error, the first return value // is not the zero time.Time. Instead, it is the value obtained from the // time.Unix function when passed the contents of the Timestamp, in the UTC // locale. This may or may not be a meaningful time; many invalid Timestamps // do map to valid time.Times. // // A nil Timestamp returns an error. The first return value in that case is // undefined. func timestampFromProto(ts *timestamp) (time.Time, error) { // Don't return the zero value on error, because corresponds to a valid // timestamp. Instead return whatever time.Unix gives us. var t time.Time if ts == nil { t = time.Unix(0, 0).UTC() // treat nil like the empty Timestamp } else { t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC() } return t, validateTimestamp(ts) } // TimestampProto converts the time.Time to a google.protobuf.Timestamp proto. // It returns an error if the resulting Timestamp is invalid. func timestampProto(t time.Time) (*timestamp, error) { seconds := t.Unix() nanos := int32(t.Sub(time.Unix(seconds, 0))) ts := ×tamp{ Seconds: seconds, Nanos: nanos, } if err := validateTimestamp(ts); err != nil { return nil, err } return ts, nil } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/timestamp_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2016, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "reflect" "time" ) var timeType = reflect.TypeOf((*time.Time)(nil)).Elem() type timestamp struct { Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` } func (m *timestamp) Reset() { *m = timestamp{} } func (*timestamp) ProtoMessage() {} func (*timestamp) String() string { return "timestamp" } func init() { RegisterType((*timestamp)(nil), "gogo.protobuf.proto.timestamp") } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/wrappers.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2018, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "io" "reflect" ) func makeStdDoubleValueMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { t := ptr.asPointerTo(u.typ).Interface().(*float64) v := &float64Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { t := ptr.asPointerTo(u.typ).Interface().(*float64) v := &float64Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdDoubleValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*float64) v := &float64Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*float64) v := &float64Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdDoubleValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(float64) v := &float64Value{t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(float64) v := &float64Value{t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdDoubleValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*float64) v := &float64Value{*t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*float64) v := &float64Value{*t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdDoubleValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &float64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(m.Value)) return b[x:], nil } } func makeStdDoubleValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &float64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&m.Value)) return b[x:], nil } } func makeStdDoubleValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &float64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdDoubleValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &float64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdFloatValueMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { t := ptr.asPointerTo(u.typ).Interface().(*float32) v := &float32Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { t := ptr.asPointerTo(u.typ).Interface().(*float32) v := &float32Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdFloatValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*float32) v := &float32Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*float32) v := &float32Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdFloatValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(float32) v := &float32Value{t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(float32) v := &float32Value{t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdFloatValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*float32) v := &float32Value{*t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*float32) v := &float32Value{*t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdFloatValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &float32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(m.Value)) return b[x:], nil } } func makeStdFloatValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &float32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&m.Value)) return b[x:], nil } } func makeStdFloatValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &float32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdFloatValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &float32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdInt64ValueMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { t := ptr.asPointerTo(u.typ).Interface().(*int64) v := &int64Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { t := ptr.asPointerTo(u.typ).Interface().(*int64) v := &int64Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdInt64ValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*int64) v := &int64Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*int64) v := &int64Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdInt64ValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(int64) v := &int64Value{t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(int64) v := &int64Value{t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdInt64ValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*int64) v := &int64Value{*t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*int64) v := &int64Value{*t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdInt64ValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &int64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(m.Value)) return b[x:], nil } } func makeStdInt64ValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &int64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&m.Value)) return b[x:], nil } } func makeStdInt64ValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &int64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdInt64ValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &int64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdUInt64ValueMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { t := ptr.asPointerTo(u.typ).Interface().(*uint64) v := &uint64Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { t := ptr.asPointerTo(u.typ).Interface().(*uint64) v := &uint64Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdUInt64ValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*uint64) v := &uint64Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*uint64) v := &uint64Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdUInt64ValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(uint64) v := &uint64Value{t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(uint64) v := &uint64Value{t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdUInt64ValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*uint64) v := &uint64Value{*t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*uint64) v := &uint64Value{*t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdUInt64ValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &uint64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(m.Value)) return b[x:], nil } } func makeStdUInt64ValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &uint64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&m.Value)) return b[x:], nil } } func makeStdUInt64ValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &uint64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdUInt64ValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &uint64Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdInt32ValueMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { t := ptr.asPointerTo(u.typ).Interface().(*int32) v := &int32Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { t := ptr.asPointerTo(u.typ).Interface().(*int32) v := &int32Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdInt32ValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*int32) v := &int32Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*int32) v := &int32Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdInt32ValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(int32) v := &int32Value{t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(int32) v := &int32Value{t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdInt32ValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*int32) v := &int32Value{*t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*int32) v := &int32Value{*t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdInt32ValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &int32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(m.Value)) return b[x:], nil } } func makeStdInt32ValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &int32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&m.Value)) return b[x:], nil } } func makeStdInt32ValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &int32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdInt32ValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &int32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdUInt32ValueMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { t := ptr.asPointerTo(u.typ).Interface().(*uint32) v := &uint32Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { t := ptr.asPointerTo(u.typ).Interface().(*uint32) v := &uint32Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdUInt32ValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*uint32) v := &uint32Value{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*uint32) v := &uint32Value{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdUInt32ValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(uint32) v := &uint32Value{t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(uint32) v := &uint32Value{t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdUInt32ValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*uint32) v := &uint32Value{*t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*uint32) v := &uint32Value{*t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdUInt32ValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &uint32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(m.Value)) return b[x:], nil } } func makeStdUInt32ValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &uint32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&m.Value)) return b[x:], nil } } func makeStdUInt32ValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &uint32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdUInt32ValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &uint32Value{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdBoolValueMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { t := ptr.asPointerTo(u.typ).Interface().(*bool) v := &boolValue{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { t := ptr.asPointerTo(u.typ).Interface().(*bool) v := &boolValue{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdBoolValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*bool) v := &boolValue{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*bool) v := &boolValue{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdBoolValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(bool) v := &boolValue{t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(bool) v := &boolValue{t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdBoolValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*bool) v := &boolValue{*t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*bool) v := &boolValue{*t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdBoolValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &boolValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(m.Value)) return b[x:], nil } } func makeStdBoolValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &boolValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&m.Value)) return b[x:], nil } } func makeStdBoolValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &boolValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdBoolValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &boolValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdStringValueMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { t := ptr.asPointerTo(u.typ).Interface().(*string) v := &stringValue{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { t := ptr.asPointerTo(u.typ).Interface().(*string) v := &stringValue{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdStringValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*string) v := &stringValue{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*string) v := &stringValue{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdStringValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(string) v := &stringValue{t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(string) v := &stringValue{t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdStringValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*string) v := &stringValue{*t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*string) v := &stringValue{*t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdStringValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &stringValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(m.Value)) return b[x:], nil } } func makeStdStringValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &stringValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&m.Value)) return b[x:], nil } } func makeStdStringValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &stringValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdStringValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &stringValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdBytesValueMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { t := ptr.asPointerTo(u.typ).Interface().(*[]byte) v := &bytesValue{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { t := ptr.asPointerTo(u.typ).Interface().(*[]byte) v := &bytesValue{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdBytesValuePtrMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { if ptr.isNil() { return 0 } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*[]byte) v := &bytesValue{*t} siz := Size(v) return tagsize + SizeVarint(uint64(siz)) + siz }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { if ptr.isNil() { return b, nil } t := ptr.asPointerTo(reflect.PtrTo(u.typ)).Elem().Interface().(*[]byte) v := &bytesValue{*t} buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(buf))) b = append(b, buf...) return b, nil } } func makeStdBytesValueSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(u.typ) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().([]byte) v := &bytesValue{t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(u.typ) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().([]byte) v := &bytesValue{t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdBytesValuePtrSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getSlice(reflect.PtrTo(u.typ)) n := 0 for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*[]byte) v := &bytesValue{*t} siz := Size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getSlice(reflect.PtrTo(u.typ)) for i := 0; i < s.Len(); i++ { elem := s.Index(i) t := elem.Interface().(*[]byte) v := &bytesValue{*t} siz := Size(v) buf, err := Marshal(v) if err != nil { return nil, err } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(siz)) b = append(b, buf...) } return b, nil } } func makeStdBytesValueUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &bytesValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(sub.typ).Elem() s.Set(reflect.ValueOf(m.Value)) return b[x:], nil } } func makeStdBytesValuePtrUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &bytesValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } s := f.asPointerTo(reflect.PtrTo(sub.typ)).Elem() s.Set(reflect.ValueOf(&m.Value)) return b[x:], nil } } func makeStdBytesValuePtrSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &bytesValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(reflect.PtrTo(sub.typ)) newSlice := reflect.Append(slice, reflect.ValueOf(&m.Value)) slice.Set(newSlice) return b[x:], nil } } func makeStdBytesValueSliceUnmarshaler(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return nil, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } m := &bytesValue{} if err := Unmarshal(b[:x], m); err != nil { return nil, err } slice := f.getSlice(sub.typ) newSlice := reflect.Append(slice, reflect.ValueOf(m.Value)) slice.Set(newSlice) return b[x:], nil } } ================================================ FILE: vendor/github.com/gogo/protobuf/proto/wrappers_gogo.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2018, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto type float64Value struct { Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *float64Value) Reset() { *m = float64Value{} } func (*float64Value) ProtoMessage() {} func (*float64Value) String() string { return "float64" } type float32Value struct { Value float32 `protobuf:"fixed32,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *float32Value) Reset() { *m = float32Value{} } func (*float32Value) ProtoMessage() {} func (*float32Value) String() string { return "float32" } type int64Value struct { Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *int64Value) Reset() { *m = int64Value{} } func (*int64Value) ProtoMessage() {} func (*int64Value) String() string { return "int64" } type uint64Value struct { Value uint64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *uint64Value) Reset() { *m = uint64Value{} } func (*uint64Value) ProtoMessage() {} func (*uint64Value) String() string { return "uint64" } type int32Value struct { Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *int32Value) Reset() { *m = int32Value{} } func (*int32Value) ProtoMessage() {} func (*int32Value) String() string { return "int32" } type uint32Value struct { Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *uint32Value) Reset() { *m = uint32Value{} } func (*uint32Value) ProtoMessage() {} func (*uint32Value) String() string { return "uint32" } type boolValue struct { Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *boolValue) Reset() { *m = boolValue{} } func (*boolValue) ProtoMessage() {} func (*boolValue) String() string { return "bool" } type stringValue struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *stringValue) Reset() { *m = stringValue{} } func (*stringValue) ProtoMessage() {} func (*stringValue) String() string { return "string" } type bytesValue struct { Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } func (m *bytesValue) Reset() { *m = bytesValue{} } func (*bytesValue) ProtoMessage() {} func (*bytesValue) String() string { return "[]byte" } func init() { RegisterType((*float64Value)(nil), "gogo.protobuf.proto.DoubleValue") RegisterType((*float32Value)(nil), "gogo.protobuf.proto.FloatValue") RegisterType((*int64Value)(nil), "gogo.protobuf.proto.Int64Value") RegisterType((*uint64Value)(nil), "gogo.protobuf.proto.UInt64Value") RegisterType((*int32Value)(nil), "gogo.protobuf.proto.Int32Value") RegisterType((*uint32Value)(nil), "gogo.protobuf.proto.UInt32Value") RegisterType((*boolValue)(nil), "gogo.protobuf.proto.BoolValue") RegisterType((*stringValue)(nil), "gogo.protobuf.proto.StringValue") RegisterType((*bytesValue)(nil), "gogo.protobuf.proto.BytesValue") } ================================================ FILE: vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/Makefile ================================================ # Go support for Protocol Buffers - Google's data interchange format # # Copyright 2010 The Go Authors. All rights reserved. # https://github.com/golang/protobuf # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. regenerate: go install github.com/gogo/protobuf/protoc-gen-gogo go install github.com/gogo/protobuf/protoc-gen-gostring protoc --gogo_out=. -I=../../protobuf/google/protobuf ../../protobuf/google/protobuf/descriptor.proto protoc --gostring_out=. -I=../../protobuf/google/protobuf ../../protobuf/google/protobuf/descriptor.proto ================================================ FILE: vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Package descriptor provides functions for obtaining protocol buffer // descriptors for generated Go types. // // These functions cannot go in package proto because they depend on the // generated protobuf descriptor messages, which themselves depend on proto. package descriptor import ( "bytes" "compress/gzip" "fmt" "io/ioutil" "github.com/gogo/protobuf/proto" ) // extractFile extracts a FileDescriptorProto from a gzip'd buffer. func extractFile(gz []byte) (*FileDescriptorProto, error) { r, err := gzip.NewReader(bytes.NewReader(gz)) if err != nil { return nil, fmt.Errorf("failed to open gzip reader: %v", err) } defer r.Close() b, err := ioutil.ReadAll(r) if err != nil { return nil, fmt.Errorf("failed to uncompress descriptor: %v", err) } fd := new(FileDescriptorProto) if err := proto.Unmarshal(b, fd); err != nil { return nil, fmt.Errorf("malformed FileDescriptorProto: %v", err) } return fd, nil } // Message is a proto.Message with a method to return its descriptor. // // Message types generated by the protocol compiler always satisfy // the Message interface. type Message interface { proto.Message Descriptor() ([]byte, []int) } // ForMessage returns a FileDescriptorProto and a DescriptorProto from within it // describing the given message. func ForMessage(msg Message) (fd *FileDescriptorProto, md *DescriptorProto) { gz, path := msg.Descriptor() fd, err := extractFile(gz) if err != nil { panic(fmt.Sprintf("invalid FileDescriptorProto for %T: %v", msg, err)) } md = fd.MessageType[path[0]] for _, i := range path[1:] { md = md.NestedType[i] } return fd, md } // Is this field a scalar numeric type? func (field *FieldDescriptorProto) IsScalar() bool { if field.Type == nil { return false } switch *field.Type { case FieldDescriptorProto_TYPE_DOUBLE, FieldDescriptorProto_TYPE_FLOAT, FieldDescriptorProto_TYPE_INT64, FieldDescriptorProto_TYPE_UINT64, FieldDescriptorProto_TYPE_INT32, FieldDescriptorProto_TYPE_FIXED64, FieldDescriptorProto_TYPE_FIXED32, FieldDescriptorProto_TYPE_BOOL, FieldDescriptorProto_TYPE_UINT32, FieldDescriptorProto_TYPE_ENUM, FieldDescriptorProto_TYPE_SFIXED32, FieldDescriptorProto_TYPE_SFIXED64, FieldDescriptorProto_TYPE_SINT32, FieldDescriptorProto_TYPE_SINT64: return true default: return false } } ================================================ FILE: vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.pb.go ================================================ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: descriptor.proto package descriptor import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type FieldDescriptorProto_Type int32 const ( // 0 is reserved for errors. // Order is weird for historical reasons. FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1 FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2 // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if // negative values are likely. FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3 FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4 // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if // negative values are likely. FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5 FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6 FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7 FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8 FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9 // Tag-delimited aggregate. // Group type is deprecated and not supported in proto3. However, Proto3 // implementations should still be able to parse the group wire format and // treat group fields as unknown fields. FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10 FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11 // New in version 2. FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12 FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13 FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14 FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15 FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16 FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17 FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18 ) var FieldDescriptorProto_Type_name = map[int32]string{ 1: "TYPE_DOUBLE", 2: "TYPE_FLOAT", 3: "TYPE_INT64", 4: "TYPE_UINT64", 5: "TYPE_INT32", 6: "TYPE_FIXED64", 7: "TYPE_FIXED32", 8: "TYPE_BOOL", 9: "TYPE_STRING", 10: "TYPE_GROUP", 11: "TYPE_MESSAGE", 12: "TYPE_BYTES", 13: "TYPE_UINT32", 14: "TYPE_ENUM", 15: "TYPE_SFIXED32", 16: "TYPE_SFIXED64", 17: "TYPE_SINT32", 18: "TYPE_SINT64", } var FieldDescriptorProto_Type_value = map[string]int32{ "TYPE_DOUBLE": 1, "TYPE_FLOAT": 2, "TYPE_INT64": 3, "TYPE_UINT64": 4, "TYPE_INT32": 5, "TYPE_FIXED64": 6, "TYPE_FIXED32": 7, "TYPE_BOOL": 8, "TYPE_STRING": 9, "TYPE_GROUP": 10, "TYPE_MESSAGE": 11, "TYPE_BYTES": 12, "TYPE_UINT32": 13, "TYPE_ENUM": 14, "TYPE_SFIXED32": 15, "TYPE_SFIXED64": 16, "TYPE_SINT32": 17, "TYPE_SINT64": 18, } func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type { p := new(FieldDescriptorProto_Type) *p = x return p } func (x FieldDescriptorProto_Type) String() string { return proto.EnumName(FieldDescriptorProto_Type_name, int32(x)) } func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Type_value, data, "FieldDescriptorProto_Type") if err != nil { return err } *x = FieldDescriptorProto_Type(value) return nil } func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{4, 0} } type FieldDescriptorProto_Label int32 const ( // 0 is reserved for errors FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1 FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3 ) var FieldDescriptorProto_Label_name = map[int32]string{ 1: "LABEL_OPTIONAL", 2: "LABEL_REQUIRED", 3: "LABEL_REPEATED", } var FieldDescriptorProto_Label_value = map[string]int32{ "LABEL_OPTIONAL": 1, "LABEL_REQUIRED": 2, "LABEL_REPEATED": 3, } func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label { p := new(FieldDescriptorProto_Label) *p = x return p } func (x FieldDescriptorProto_Label) String() string { return proto.EnumName(FieldDescriptorProto_Label_name, int32(x)) } func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Label_value, data, "FieldDescriptorProto_Label") if err != nil { return err } *x = FieldDescriptorProto_Label(value) return nil } func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{4, 1} } // Generated classes can be optimized for speed or code size. type FileOptions_OptimizeMode int32 const ( FileOptions_SPEED FileOptions_OptimizeMode = 1 // etc. FileOptions_CODE_SIZE FileOptions_OptimizeMode = 2 FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3 ) var FileOptions_OptimizeMode_name = map[int32]string{ 1: "SPEED", 2: "CODE_SIZE", 3: "LITE_RUNTIME", } var FileOptions_OptimizeMode_value = map[string]int32{ "SPEED": 1, "CODE_SIZE": 2, "LITE_RUNTIME": 3, } func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode { p := new(FileOptions_OptimizeMode) *p = x return p } func (x FileOptions_OptimizeMode) String() string { return proto.EnumName(FileOptions_OptimizeMode_name, int32(x)) } func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode") if err != nil { return err } *x = FileOptions_OptimizeMode(value) return nil } func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{10, 0} } type FieldOptions_CType int32 const ( // Default mode. FieldOptions_STRING FieldOptions_CType = 0 FieldOptions_CORD FieldOptions_CType = 1 FieldOptions_STRING_PIECE FieldOptions_CType = 2 ) var FieldOptions_CType_name = map[int32]string{ 0: "STRING", 1: "CORD", 2: "STRING_PIECE", } var FieldOptions_CType_value = map[string]int32{ "STRING": 0, "CORD": 1, "STRING_PIECE": 2, } func (x FieldOptions_CType) Enum() *FieldOptions_CType { p := new(FieldOptions_CType) *p = x return p } func (x FieldOptions_CType) String() string { return proto.EnumName(FieldOptions_CType_name, int32(x)) } func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FieldOptions_CType_value, data, "FieldOptions_CType") if err != nil { return err } *x = FieldOptions_CType(value) return nil } func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{12, 0} } type FieldOptions_JSType int32 const ( // Use the default type. FieldOptions_JS_NORMAL FieldOptions_JSType = 0 // Use JavaScript strings. FieldOptions_JS_STRING FieldOptions_JSType = 1 // Use JavaScript numbers. FieldOptions_JS_NUMBER FieldOptions_JSType = 2 ) var FieldOptions_JSType_name = map[int32]string{ 0: "JS_NORMAL", 1: "JS_STRING", 2: "JS_NUMBER", } var FieldOptions_JSType_value = map[string]int32{ "JS_NORMAL": 0, "JS_STRING": 1, "JS_NUMBER": 2, } func (x FieldOptions_JSType) Enum() *FieldOptions_JSType { p := new(FieldOptions_JSType) *p = x return p } func (x FieldOptions_JSType) String() string { return proto.EnumName(FieldOptions_JSType_name, int32(x)) } func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FieldOptions_JSType_value, data, "FieldOptions_JSType") if err != nil { return err } *x = FieldOptions_JSType(value) return nil } func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{12, 1} } // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, // or neither? HTTP based RPC implementation may choose GET verb for safe // methods, and PUT verb for idempotent methods instead of the default POST. type MethodOptions_IdempotencyLevel int32 const ( MethodOptions_IDEMPOTENCY_UNKNOWN MethodOptions_IdempotencyLevel = 0 MethodOptions_NO_SIDE_EFFECTS MethodOptions_IdempotencyLevel = 1 MethodOptions_IDEMPOTENT MethodOptions_IdempotencyLevel = 2 ) var MethodOptions_IdempotencyLevel_name = map[int32]string{ 0: "IDEMPOTENCY_UNKNOWN", 1: "NO_SIDE_EFFECTS", 2: "IDEMPOTENT", } var MethodOptions_IdempotencyLevel_value = map[string]int32{ "IDEMPOTENCY_UNKNOWN": 0, "NO_SIDE_EFFECTS": 1, "IDEMPOTENT": 2, } func (x MethodOptions_IdempotencyLevel) Enum() *MethodOptions_IdempotencyLevel { p := new(MethodOptions_IdempotencyLevel) *p = x return p } func (x MethodOptions_IdempotencyLevel) String() string { return proto.EnumName(MethodOptions_IdempotencyLevel_name, int32(x)) } func (x *MethodOptions_IdempotencyLevel) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(MethodOptions_IdempotencyLevel_value, data, "MethodOptions_IdempotencyLevel") if err != nil { return err } *x = MethodOptions_IdempotencyLevel(value) return nil } func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{17, 0} } // The protocol compiler can output a FileDescriptorSet containing the .proto // files it parses. type FileDescriptorSet struct { File []*FileDescriptorProto `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *FileDescriptorSet) Reset() { *m = FileDescriptorSet{} } func (m *FileDescriptorSet) String() string { return proto.CompactTextString(m) } func (*FileDescriptorSet) ProtoMessage() {} func (*FileDescriptorSet) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{0} } func (m *FileDescriptorSet) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FileDescriptorSet.Unmarshal(m, b) } func (m *FileDescriptorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FileDescriptorSet.Marshal(b, m, deterministic) } func (m *FileDescriptorSet) XXX_Merge(src proto.Message) { xxx_messageInfo_FileDescriptorSet.Merge(m, src) } func (m *FileDescriptorSet) XXX_Size() int { return xxx_messageInfo_FileDescriptorSet.Size(m) } func (m *FileDescriptorSet) XXX_DiscardUnknown() { xxx_messageInfo_FileDescriptorSet.DiscardUnknown(m) } var xxx_messageInfo_FileDescriptorSet proto.InternalMessageInfo func (m *FileDescriptorSet) GetFile() []*FileDescriptorProto { if m != nil { return m.File } return nil } // Describes a complete .proto file. type FileDescriptorProto struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"` // Names of files imported by this file. Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"` // Indexes of the public imported files in the dependency list above. PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"` // Indexes of the weak imported files in the dependency list. // For Google-internal migration only. Do not use. WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"` // All top-level definitions in this file. MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"` EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"` Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"` Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` // This field contains optional information about the original source code. // You may safely remove this entire field without harming runtime // functionality of the descriptors -- the information is needed only by // development tools. SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"` // The syntax of the proto file. // The supported values are "proto2" and "proto3". Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *FileDescriptorProto) Reset() { *m = FileDescriptorProto{} } func (m *FileDescriptorProto) String() string { return proto.CompactTextString(m) } func (*FileDescriptorProto) ProtoMessage() {} func (*FileDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{1} } func (m *FileDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FileDescriptorProto.Unmarshal(m, b) } func (m *FileDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FileDescriptorProto.Marshal(b, m, deterministic) } func (m *FileDescriptorProto) XXX_Merge(src proto.Message) { xxx_messageInfo_FileDescriptorProto.Merge(m, src) } func (m *FileDescriptorProto) XXX_Size() int { return xxx_messageInfo_FileDescriptorProto.Size(m) } func (m *FileDescriptorProto) XXX_DiscardUnknown() { xxx_messageInfo_FileDescriptorProto.DiscardUnknown(m) } var xxx_messageInfo_FileDescriptorProto proto.InternalMessageInfo func (m *FileDescriptorProto) GetName() string { if m != nil && m.Name != nil { return *m.Name } return "" } func (m *FileDescriptorProto) GetPackage() string { if m != nil && m.Package != nil { return *m.Package } return "" } func (m *FileDescriptorProto) GetDependency() []string { if m != nil { return m.Dependency } return nil } func (m *FileDescriptorProto) GetPublicDependency() []int32 { if m != nil { return m.PublicDependency } return nil } func (m *FileDescriptorProto) GetWeakDependency() []int32 { if m != nil { return m.WeakDependency } return nil } func (m *FileDescriptorProto) GetMessageType() []*DescriptorProto { if m != nil { return m.MessageType } return nil } func (m *FileDescriptorProto) GetEnumType() []*EnumDescriptorProto { if m != nil { return m.EnumType } return nil } func (m *FileDescriptorProto) GetService() []*ServiceDescriptorProto { if m != nil { return m.Service } return nil } func (m *FileDescriptorProto) GetExtension() []*FieldDescriptorProto { if m != nil { return m.Extension } return nil } func (m *FileDescriptorProto) GetOptions() *FileOptions { if m != nil { return m.Options } return nil } func (m *FileDescriptorProto) GetSourceCodeInfo() *SourceCodeInfo { if m != nil { return m.SourceCodeInfo } return nil } func (m *FileDescriptorProto) GetSyntax() string { if m != nil && m.Syntax != nil { return *m.Syntax } return "" } // Describes a message type. type DescriptorProto struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"` Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"` NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type,json=nestedType" json:"nested_type,omitempty"` EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range,json=extensionRange" json:"extension_range,omitempty"` OneofDecl []*OneofDescriptorProto `protobuf:"bytes,8,rep,name=oneof_decl,json=oneofDecl" json:"oneof_decl,omitempty"` Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"` ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` // Reserved field names, which may not be used by fields in the same message. // A given name may only be reserved once. ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DescriptorProto) Reset() { *m = DescriptorProto{} } func (m *DescriptorProto) String() string { return proto.CompactTextString(m) } func (*DescriptorProto) ProtoMessage() {} func (*DescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{2} } func (m *DescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DescriptorProto.Unmarshal(m, b) } func (m *DescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DescriptorProto.Marshal(b, m, deterministic) } func (m *DescriptorProto) XXX_Merge(src proto.Message) { xxx_messageInfo_DescriptorProto.Merge(m, src) } func (m *DescriptorProto) XXX_Size() int { return xxx_messageInfo_DescriptorProto.Size(m) } func (m *DescriptorProto) XXX_DiscardUnknown() { xxx_messageInfo_DescriptorProto.DiscardUnknown(m) } var xxx_messageInfo_DescriptorProto proto.InternalMessageInfo func (m *DescriptorProto) GetName() string { if m != nil && m.Name != nil { return *m.Name } return "" } func (m *DescriptorProto) GetField() []*FieldDescriptorProto { if m != nil { return m.Field } return nil } func (m *DescriptorProto) GetExtension() []*FieldDescriptorProto { if m != nil { return m.Extension } return nil } func (m *DescriptorProto) GetNestedType() []*DescriptorProto { if m != nil { return m.NestedType } return nil } func (m *DescriptorProto) GetEnumType() []*EnumDescriptorProto { if m != nil { return m.EnumType } return nil } func (m *DescriptorProto) GetExtensionRange() []*DescriptorProto_ExtensionRange { if m != nil { return m.ExtensionRange } return nil } func (m *DescriptorProto) GetOneofDecl() []*OneofDescriptorProto { if m != nil { return m.OneofDecl } return nil } func (m *DescriptorProto) GetOptions() *MessageOptions { if m != nil { return m.Options } return nil } func (m *DescriptorProto) GetReservedRange() []*DescriptorProto_ReservedRange { if m != nil { return m.ReservedRange } return nil } func (m *DescriptorProto) GetReservedName() []string { if m != nil { return m.ReservedName } return nil } type DescriptorProto_ExtensionRange struct { Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` Options *ExtensionRangeOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DescriptorProto_ExtensionRange) Reset() { *m = DescriptorProto_ExtensionRange{} } func (m *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(m) } func (*DescriptorProto_ExtensionRange) ProtoMessage() {} func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{2, 0} } func (m *DescriptorProto_ExtensionRange) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DescriptorProto_ExtensionRange.Unmarshal(m, b) } func (m *DescriptorProto_ExtensionRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DescriptorProto_ExtensionRange.Marshal(b, m, deterministic) } func (m *DescriptorProto_ExtensionRange) XXX_Merge(src proto.Message) { xxx_messageInfo_DescriptorProto_ExtensionRange.Merge(m, src) } func (m *DescriptorProto_ExtensionRange) XXX_Size() int { return xxx_messageInfo_DescriptorProto_ExtensionRange.Size(m) } func (m *DescriptorProto_ExtensionRange) XXX_DiscardUnknown() { xxx_messageInfo_DescriptorProto_ExtensionRange.DiscardUnknown(m) } var xxx_messageInfo_DescriptorProto_ExtensionRange proto.InternalMessageInfo func (m *DescriptorProto_ExtensionRange) GetStart() int32 { if m != nil && m.Start != nil { return *m.Start } return 0 } func (m *DescriptorProto_ExtensionRange) GetEnd() int32 { if m != nil && m.End != nil { return *m.End } return 0 } func (m *DescriptorProto_ExtensionRange) GetOptions() *ExtensionRangeOptions { if m != nil { return m.Options } return nil } // Range of reserved tag numbers. Reserved tag numbers may not be used by // fields or extension ranges in the same message. Reserved ranges may // not overlap. type DescriptorProto_ReservedRange struct { Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DescriptorProto_ReservedRange) Reset() { *m = DescriptorProto_ReservedRange{} } func (m *DescriptorProto_ReservedRange) String() string { return proto.CompactTextString(m) } func (*DescriptorProto_ReservedRange) ProtoMessage() {} func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{2, 1} } func (m *DescriptorProto_ReservedRange) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DescriptorProto_ReservedRange.Unmarshal(m, b) } func (m *DescriptorProto_ReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DescriptorProto_ReservedRange.Marshal(b, m, deterministic) } func (m *DescriptorProto_ReservedRange) XXX_Merge(src proto.Message) { xxx_messageInfo_DescriptorProto_ReservedRange.Merge(m, src) } func (m *DescriptorProto_ReservedRange) XXX_Size() int { return xxx_messageInfo_DescriptorProto_ReservedRange.Size(m) } func (m *DescriptorProto_ReservedRange) XXX_DiscardUnknown() { xxx_messageInfo_DescriptorProto_ReservedRange.DiscardUnknown(m) } var xxx_messageInfo_DescriptorProto_ReservedRange proto.InternalMessageInfo func (m *DescriptorProto_ReservedRange) GetStart() int32 { if m != nil && m.Start != nil { return *m.Start } return 0 } func (m *DescriptorProto_ReservedRange) GetEnd() int32 { if m != nil && m.End != nil { return *m.End } return 0 } type ExtensionRangeOptions struct { // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ExtensionRangeOptions) Reset() { *m = ExtensionRangeOptions{} } func (m *ExtensionRangeOptions) String() string { return proto.CompactTextString(m) } func (*ExtensionRangeOptions) ProtoMessage() {} func (*ExtensionRangeOptions) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{3} } var extRange_ExtensionRangeOptions = []proto.ExtensionRange{ {Start: 1000, End: 536870911}, } func (*ExtensionRangeOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_ExtensionRangeOptions } func (m *ExtensionRangeOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExtensionRangeOptions.Unmarshal(m, b) } func (m *ExtensionRangeOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ExtensionRangeOptions.Marshal(b, m, deterministic) } func (m *ExtensionRangeOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_ExtensionRangeOptions.Merge(m, src) } func (m *ExtensionRangeOptions) XXX_Size() int { return xxx_messageInfo_ExtensionRangeOptions.Size(m) } func (m *ExtensionRangeOptions) XXX_DiscardUnknown() { xxx_messageInfo_ExtensionRangeOptions.DiscardUnknown(m) } var xxx_messageInfo_ExtensionRangeOptions proto.InternalMessageInfo func (m *ExtensionRangeOptions) GetUninterpretedOption() []*UninterpretedOption { if m != nil { return m.UninterpretedOption } return nil } // Describes a field within a message. type FieldDescriptorProto struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"` Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=google.protobuf.FieldDescriptorProto_Label" json:"label,omitempty"` // If type_name is set, this need not be set. If both this and type_name // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=google.protobuf.FieldDescriptorProto_Type" json:"type,omitempty"` // For message and enum types, this is the name of the type. If the name // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping // rules are used to find the type (i.e. first the nested types within this // message are searched, then within the parent, on up to the root // namespace). TypeName *string `protobuf:"bytes,6,opt,name=type_name,json=typeName" json:"type_name,omitempty"` // For extensions, this is the name of the type being extended. It is // resolved in the same manner as type_name. Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"` // For numeric types, contains the original text representation of the value. // For booleans, "true" or "false". // For strings, contains the default text contents (not escaped in any way). // For bytes, contains the C escaped value. All bytes >= 128 are escaped. // TODO(kenton): Base-64 encode? DefaultValue *string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"` // If set, gives the index of a oneof in the containing type's oneof_decl // list. This field is a member of that oneof. OneofIndex *int32 `protobuf:"varint,9,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"` // JSON name of this field. The value is set by protocol compiler. If the // user has set a "json_name" option on this field, that option's value // will be used. Otherwise, it's deduced from the field's name by converting // it to camelCase. JsonName *string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"` Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *FieldDescriptorProto) Reset() { *m = FieldDescriptorProto{} } func (m *FieldDescriptorProto) String() string { return proto.CompactTextString(m) } func (*FieldDescriptorProto) ProtoMessage() {} func (*FieldDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{4} } func (m *FieldDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FieldDescriptorProto.Unmarshal(m, b) } func (m *FieldDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FieldDescriptorProto.Marshal(b, m, deterministic) } func (m *FieldDescriptorProto) XXX_Merge(src proto.Message) { xxx_messageInfo_FieldDescriptorProto.Merge(m, src) } func (m *FieldDescriptorProto) XXX_Size() int { return xxx_messageInfo_FieldDescriptorProto.Size(m) } func (m *FieldDescriptorProto) XXX_DiscardUnknown() { xxx_messageInfo_FieldDescriptorProto.DiscardUnknown(m) } var xxx_messageInfo_FieldDescriptorProto proto.InternalMessageInfo func (m *FieldDescriptorProto) GetName() string { if m != nil && m.Name != nil { return *m.Name } return "" } func (m *FieldDescriptorProto) GetNumber() int32 { if m != nil && m.Number != nil { return *m.Number } return 0 } func (m *FieldDescriptorProto) GetLabel() FieldDescriptorProto_Label { if m != nil && m.Label != nil { return *m.Label } return FieldDescriptorProto_LABEL_OPTIONAL } func (m *FieldDescriptorProto) GetType() FieldDescriptorProto_Type { if m != nil && m.Type != nil { return *m.Type } return FieldDescriptorProto_TYPE_DOUBLE } func (m *FieldDescriptorProto) GetTypeName() string { if m != nil && m.TypeName != nil { return *m.TypeName } return "" } func (m *FieldDescriptorProto) GetExtendee() string { if m != nil && m.Extendee != nil { return *m.Extendee } return "" } func (m *FieldDescriptorProto) GetDefaultValue() string { if m != nil && m.DefaultValue != nil { return *m.DefaultValue } return "" } func (m *FieldDescriptorProto) GetOneofIndex() int32 { if m != nil && m.OneofIndex != nil { return *m.OneofIndex } return 0 } func (m *FieldDescriptorProto) GetJsonName() string { if m != nil && m.JsonName != nil { return *m.JsonName } return "" } func (m *FieldDescriptorProto) GetOptions() *FieldOptions { if m != nil { return m.Options } return nil } // Describes a oneof. type OneofDescriptorProto struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Options *OneofOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *OneofDescriptorProto) Reset() { *m = OneofDescriptorProto{} } func (m *OneofDescriptorProto) String() string { return proto.CompactTextString(m) } func (*OneofDescriptorProto) ProtoMessage() {} func (*OneofDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{5} } func (m *OneofDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OneofDescriptorProto.Unmarshal(m, b) } func (m *OneofDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OneofDescriptorProto.Marshal(b, m, deterministic) } func (m *OneofDescriptorProto) XXX_Merge(src proto.Message) { xxx_messageInfo_OneofDescriptorProto.Merge(m, src) } func (m *OneofDescriptorProto) XXX_Size() int { return xxx_messageInfo_OneofDescriptorProto.Size(m) } func (m *OneofDescriptorProto) XXX_DiscardUnknown() { xxx_messageInfo_OneofDescriptorProto.DiscardUnknown(m) } var xxx_messageInfo_OneofDescriptorProto proto.InternalMessageInfo func (m *OneofDescriptorProto) GetName() string { if m != nil && m.Name != nil { return *m.Name } return "" } func (m *OneofDescriptorProto) GetOptions() *OneofOptions { if m != nil { return m.Options } return nil } // Describes an enum type. type EnumDescriptorProto struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"` Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` // Range of reserved numeric values. Reserved numeric values may not be used // by enum values in the same enum declaration. Reserved ranges may not // overlap. ReservedRange []*EnumDescriptorProto_EnumReservedRange `protobuf:"bytes,4,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` // Reserved enum value names, which may not be reused. A given name may only // be reserved once. ReservedName []string `protobuf:"bytes,5,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *EnumDescriptorProto) Reset() { *m = EnumDescriptorProto{} } func (m *EnumDescriptorProto) String() string { return proto.CompactTextString(m) } func (*EnumDescriptorProto) ProtoMessage() {} func (*EnumDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{6} } func (m *EnumDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumDescriptorProto.Unmarshal(m, b) } func (m *EnumDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_EnumDescriptorProto.Marshal(b, m, deterministic) } func (m *EnumDescriptorProto) XXX_Merge(src proto.Message) { xxx_messageInfo_EnumDescriptorProto.Merge(m, src) } func (m *EnumDescriptorProto) XXX_Size() int { return xxx_messageInfo_EnumDescriptorProto.Size(m) } func (m *EnumDescriptorProto) XXX_DiscardUnknown() { xxx_messageInfo_EnumDescriptorProto.DiscardUnknown(m) } var xxx_messageInfo_EnumDescriptorProto proto.InternalMessageInfo func (m *EnumDescriptorProto) GetName() string { if m != nil && m.Name != nil { return *m.Name } return "" } func (m *EnumDescriptorProto) GetValue() []*EnumValueDescriptorProto { if m != nil { return m.Value } return nil } func (m *EnumDescriptorProto) GetOptions() *EnumOptions { if m != nil { return m.Options } return nil } func (m *EnumDescriptorProto) GetReservedRange() []*EnumDescriptorProto_EnumReservedRange { if m != nil { return m.ReservedRange } return nil } func (m *EnumDescriptorProto) GetReservedName() []string { if m != nil { return m.ReservedName } return nil } // Range of reserved numeric values. Reserved values may not be used by // entries in the same enum. Reserved ranges may not overlap. // // Note that this is distinct from DescriptorProto.ReservedRange in that it // is inclusive such that it can appropriately represent the entire int32 // domain. type EnumDescriptorProto_EnumReservedRange struct { Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *EnumDescriptorProto_EnumReservedRange) Reset() { *m = EnumDescriptorProto_EnumReservedRange{} } func (m *EnumDescriptorProto_EnumReservedRange) String() string { return proto.CompactTextString(m) } func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage() {} func (*EnumDescriptorProto_EnumReservedRange) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{6, 0} } func (m *EnumDescriptorProto_EnumReservedRange) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Unmarshal(m, b) } func (m *EnumDescriptorProto_EnumReservedRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Marshal(b, m, deterministic) } func (m *EnumDescriptorProto_EnumReservedRange) XXX_Merge(src proto.Message) { xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Merge(m, src) } func (m *EnumDescriptorProto_EnumReservedRange) XXX_Size() int { return xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.Size(m) } func (m *EnumDescriptorProto_EnumReservedRange) XXX_DiscardUnknown() { xxx_messageInfo_EnumDescriptorProto_EnumReservedRange.DiscardUnknown(m) } var xxx_messageInfo_EnumDescriptorProto_EnumReservedRange proto.InternalMessageInfo func (m *EnumDescriptorProto_EnumReservedRange) GetStart() int32 { if m != nil && m.Start != nil { return *m.Start } return 0 } func (m *EnumDescriptorProto_EnumReservedRange) GetEnd() int32 { if m != nil && m.End != nil { return *m.End } return 0 } // Describes a value within an enum. type EnumValueDescriptorProto struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *EnumValueDescriptorProto) Reset() { *m = EnumValueDescriptorProto{} } func (m *EnumValueDescriptorProto) String() string { return proto.CompactTextString(m) } func (*EnumValueDescriptorProto) ProtoMessage() {} func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{7} } func (m *EnumValueDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumValueDescriptorProto.Unmarshal(m, b) } func (m *EnumValueDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_EnumValueDescriptorProto.Marshal(b, m, deterministic) } func (m *EnumValueDescriptorProto) XXX_Merge(src proto.Message) { xxx_messageInfo_EnumValueDescriptorProto.Merge(m, src) } func (m *EnumValueDescriptorProto) XXX_Size() int { return xxx_messageInfo_EnumValueDescriptorProto.Size(m) } func (m *EnumValueDescriptorProto) XXX_DiscardUnknown() { xxx_messageInfo_EnumValueDescriptorProto.DiscardUnknown(m) } var xxx_messageInfo_EnumValueDescriptorProto proto.InternalMessageInfo func (m *EnumValueDescriptorProto) GetName() string { if m != nil && m.Name != nil { return *m.Name } return "" } func (m *EnumValueDescriptorProto) GetNumber() int32 { if m != nil && m.Number != nil { return *m.Number } return 0 } func (m *EnumValueDescriptorProto) GetOptions() *EnumValueOptions { if m != nil { return m.Options } return nil } // Describes a service. type ServiceDescriptorProto struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"` Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ServiceDescriptorProto) Reset() { *m = ServiceDescriptorProto{} } func (m *ServiceDescriptorProto) String() string { return proto.CompactTextString(m) } func (*ServiceDescriptorProto) ProtoMessage() {} func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{8} } func (m *ServiceDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServiceDescriptorProto.Unmarshal(m, b) } func (m *ServiceDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ServiceDescriptorProto.Marshal(b, m, deterministic) } func (m *ServiceDescriptorProto) XXX_Merge(src proto.Message) { xxx_messageInfo_ServiceDescriptorProto.Merge(m, src) } func (m *ServiceDescriptorProto) XXX_Size() int { return xxx_messageInfo_ServiceDescriptorProto.Size(m) } func (m *ServiceDescriptorProto) XXX_DiscardUnknown() { xxx_messageInfo_ServiceDescriptorProto.DiscardUnknown(m) } var xxx_messageInfo_ServiceDescriptorProto proto.InternalMessageInfo func (m *ServiceDescriptorProto) GetName() string { if m != nil && m.Name != nil { return *m.Name } return "" } func (m *ServiceDescriptorProto) GetMethod() []*MethodDescriptorProto { if m != nil { return m.Method } return nil } func (m *ServiceDescriptorProto) GetOptions() *ServiceOptions { if m != nil { return m.Options } return nil } // Describes a method of a service. type MethodDescriptorProto struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Input and output type names. These are resolved in the same way as // FieldDescriptorProto.type_name, but must refer to a message type. InputType *string `protobuf:"bytes,2,opt,name=input_type,json=inputType" json:"input_type,omitempty"` OutputType *string `protobuf:"bytes,3,opt,name=output_type,json=outputType" json:"output_type,omitempty"` Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"` // Identifies if client streams multiple client messages ClientStreaming *bool `protobuf:"varint,5,opt,name=client_streaming,json=clientStreaming,def=0" json:"client_streaming,omitempty"` // Identifies if server streams multiple server messages ServerStreaming *bool `protobuf:"varint,6,opt,name=server_streaming,json=serverStreaming,def=0" json:"server_streaming,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *MethodDescriptorProto) Reset() { *m = MethodDescriptorProto{} } func (m *MethodDescriptorProto) String() string { return proto.CompactTextString(m) } func (*MethodDescriptorProto) ProtoMessage() {} func (*MethodDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{9} } func (m *MethodDescriptorProto) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MethodDescriptorProto.Unmarshal(m, b) } func (m *MethodDescriptorProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MethodDescriptorProto.Marshal(b, m, deterministic) } func (m *MethodDescriptorProto) XXX_Merge(src proto.Message) { xxx_messageInfo_MethodDescriptorProto.Merge(m, src) } func (m *MethodDescriptorProto) XXX_Size() int { return xxx_messageInfo_MethodDescriptorProto.Size(m) } func (m *MethodDescriptorProto) XXX_DiscardUnknown() { xxx_messageInfo_MethodDescriptorProto.DiscardUnknown(m) } var xxx_messageInfo_MethodDescriptorProto proto.InternalMessageInfo const Default_MethodDescriptorProto_ClientStreaming bool = false const Default_MethodDescriptorProto_ServerStreaming bool = false func (m *MethodDescriptorProto) GetName() string { if m != nil && m.Name != nil { return *m.Name } return "" } func (m *MethodDescriptorProto) GetInputType() string { if m != nil && m.InputType != nil { return *m.InputType } return "" } func (m *MethodDescriptorProto) GetOutputType() string { if m != nil && m.OutputType != nil { return *m.OutputType } return "" } func (m *MethodDescriptorProto) GetOptions() *MethodOptions { if m != nil { return m.Options } return nil } func (m *MethodDescriptorProto) GetClientStreaming() bool { if m != nil && m.ClientStreaming != nil { return *m.ClientStreaming } return Default_MethodDescriptorProto_ClientStreaming } func (m *MethodDescriptorProto) GetServerStreaming() bool { if m != nil && m.ServerStreaming != nil { return *m.ServerStreaming } return Default_MethodDescriptorProto_ServerStreaming } type FileOptions struct { // Sets the Java package where classes generated from this .proto will be // placed. By default, the proto package is used, but this is often // inappropriate because proto packages do not normally start with backwards // domain names. JavaPackage *string `protobuf:"bytes,1,opt,name=java_package,json=javaPackage" json:"java_package,omitempty"` // If set, all the classes from the .proto file are wrapped in a single // outer class with the given name. This applies to both Proto1 // (equivalent to the old "--one_java_file" option) and Proto2 (where // a .proto always translates to a single class, but you may want to // explicitly choose the class name). JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname,json=javaOuterClassname" json:"java_outer_classname,omitempty"` // If set true, then the Java code generator will generate a separate .java // file for each top-level message, enum, and service defined in the .proto // file. Thus, these types will *not* be nested inside the outer class // named by java_outer_classname. However, the outer class will still be // generated to contain the file's getDescriptor() method as well as any // top-level extensions defined in the file. JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,json=javaMultipleFiles,def=0" json:"java_multiple_files,omitempty"` // This option does nothing. JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash" json:"java_generate_equals_and_hash,omitempty"` // Deprecated: Do not use. // If set true, then the Java2 code generator will generate code that // throws an exception whenever an attempt is made to assign a non-UTF-8 // byte sequence to a string field. // Message reflection will do the same. // However, an extension field still accepts non-UTF-8 byte sequences. // This option has no effect on when used with the lite runtime. JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"` OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"` // Sets the Go package where structs generated from this .proto will be // placed. If omitted, the Go package will be derived from the following: // - The basename of the package import path, if provided. // - Otherwise, the package statement in the .proto file, if present. // - Otherwise, the basename of the .proto file, without extension. GoPackage *string `protobuf:"bytes,11,opt,name=go_package,json=goPackage" json:"go_package,omitempty"` // Should generic services be generated in each language? "Generic" services // are not specific to any particular RPC system. They are generated by the // main code generators in each language (without additional plugins). // Generic services were the only kind of service generation supported by // early versions of google.protobuf. // // Generic services are now considered deprecated in favor of using plugins // that generate code specific to your particular RPC system. Therefore, // these default to false. Old code which depends on generic services should // explicitly set them to true. CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,json=ccGenericServices,def=0" json:"cc_generic_services,omitempty"` JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,json=javaGenericServices,def=0" json:"java_generic_services,omitempty"` PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,json=pyGenericServices,def=0" json:"py_generic_services,omitempty"` PhpGenericServices *bool `protobuf:"varint,42,opt,name=php_generic_services,json=phpGenericServices,def=0" json:"php_generic_services,omitempty"` // Is this file deprecated? // Depending on the target platform, this can emit Deprecated annotations // for everything in the file, or it will be completely ignored; in the very // least, this is a formalization for deprecating files. Deprecated *bool `protobuf:"varint,23,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // Enables the use of arenas for the proto messages in this file. This applies // only to generated classes for C++. CcEnableArenas *bool `protobuf:"varint,31,opt,name=cc_enable_arenas,json=ccEnableArenas,def=0" json:"cc_enable_arenas,omitempty"` // Sets the objective c class prefix which is prepended to all objective c // generated classes from this .proto. There is no default. ObjcClassPrefix *string `protobuf:"bytes,36,opt,name=objc_class_prefix,json=objcClassPrefix" json:"objc_class_prefix,omitempty"` // Namespace for generated classes; defaults to the package. CsharpNamespace *string `protobuf:"bytes,37,opt,name=csharp_namespace,json=csharpNamespace" json:"csharp_namespace,omitempty"` // By default Swift generators will take the proto package and CamelCase it // replacing '.' with underscore and use that to prefix the types/symbols // defined. When this options is provided, they will use this value instead // to prefix the types/symbols defined. SwiftPrefix *string `protobuf:"bytes,39,opt,name=swift_prefix,json=swiftPrefix" json:"swift_prefix,omitempty"` // Sets the php class prefix which is prepended to all php generated classes // from this .proto. Default is empty. PhpClassPrefix *string `protobuf:"bytes,40,opt,name=php_class_prefix,json=phpClassPrefix" json:"php_class_prefix,omitempty"` // Use this option to change the namespace of php generated classes. Default // is empty. When this option is empty, the package name will be used for // determining the namespace. PhpNamespace *string `protobuf:"bytes,41,opt,name=php_namespace,json=phpNamespace" json:"php_namespace,omitempty"` // Use this option to change the namespace of php generated metadata classes. // Default is empty. When this option is empty, the proto file name will be used // for determining the namespace. PhpMetadataNamespace *string `protobuf:"bytes,44,opt,name=php_metadata_namespace,json=phpMetadataNamespace" json:"php_metadata_namespace,omitempty"` // Use this option to change the package of ruby generated classes. Default // is empty. When this option is not set, the package name will be used for // determining the ruby package. RubyPackage *string `protobuf:"bytes,45,opt,name=ruby_package,json=rubyPackage" json:"ruby_package,omitempty"` // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *FileOptions) Reset() { *m = FileOptions{} } func (m *FileOptions) String() string { return proto.CompactTextString(m) } func (*FileOptions) ProtoMessage() {} func (*FileOptions) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{10} } var extRange_FileOptions = []proto.ExtensionRange{ {Start: 1000, End: 536870911}, } func (*FileOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_FileOptions } func (m *FileOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FileOptions.Unmarshal(m, b) } func (m *FileOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FileOptions.Marshal(b, m, deterministic) } func (m *FileOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_FileOptions.Merge(m, src) } func (m *FileOptions) XXX_Size() int { return xxx_messageInfo_FileOptions.Size(m) } func (m *FileOptions) XXX_DiscardUnknown() { xxx_messageInfo_FileOptions.DiscardUnknown(m) } var xxx_messageInfo_FileOptions proto.InternalMessageInfo const Default_FileOptions_JavaMultipleFiles bool = false const Default_FileOptions_JavaStringCheckUtf8 bool = false const Default_FileOptions_OptimizeFor FileOptions_OptimizeMode = FileOptions_SPEED const Default_FileOptions_CcGenericServices bool = false const Default_FileOptions_JavaGenericServices bool = false const Default_FileOptions_PyGenericServices bool = false const Default_FileOptions_PhpGenericServices bool = false const Default_FileOptions_Deprecated bool = false const Default_FileOptions_CcEnableArenas bool = false func (m *FileOptions) GetJavaPackage() string { if m != nil && m.JavaPackage != nil { return *m.JavaPackage } return "" } func (m *FileOptions) GetJavaOuterClassname() string { if m != nil && m.JavaOuterClassname != nil { return *m.JavaOuterClassname } return "" } func (m *FileOptions) GetJavaMultipleFiles() bool { if m != nil && m.JavaMultipleFiles != nil { return *m.JavaMultipleFiles } return Default_FileOptions_JavaMultipleFiles } // Deprecated: Do not use. func (m *FileOptions) GetJavaGenerateEqualsAndHash() bool { if m != nil && m.JavaGenerateEqualsAndHash != nil { return *m.JavaGenerateEqualsAndHash } return false } func (m *FileOptions) GetJavaStringCheckUtf8() bool { if m != nil && m.JavaStringCheckUtf8 != nil { return *m.JavaStringCheckUtf8 } return Default_FileOptions_JavaStringCheckUtf8 } func (m *FileOptions) GetOptimizeFor() FileOptions_OptimizeMode { if m != nil && m.OptimizeFor != nil { return *m.OptimizeFor } return Default_FileOptions_OptimizeFor } func (m *FileOptions) GetGoPackage() string { if m != nil && m.GoPackage != nil { return *m.GoPackage } return "" } func (m *FileOptions) GetCcGenericServices() bool { if m != nil && m.CcGenericServices != nil { return *m.CcGenericServices } return Default_FileOptions_CcGenericServices } func (m *FileOptions) GetJavaGenericServices() bool { if m != nil && m.JavaGenericServices != nil { return *m.JavaGenericServices } return Default_FileOptions_JavaGenericServices } func (m *FileOptions) GetPyGenericServices() bool { if m != nil && m.PyGenericServices != nil { return *m.PyGenericServices } return Default_FileOptions_PyGenericServices } func (m *FileOptions) GetPhpGenericServices() bool { if m != nil && m.PhpGenericServices != nil { return *m.PhpGenericServices } return Default_FileOptions_PhpGenericServices } func (m *FileOptions) GetDeprecated() bool { if m != nil && m.Deprecated != nil { return *m.Deprecated } return Default_FileOptions_Deprecated } func (m *FileOptions) GetCcEnableArenas() bool { if m != nil && m.CcEnableArenas != nil { return *m.CcEnableArenas } return Default_FileOptions_CcEnableArenas } func (m *FileOptions) GetObjcClassPrefix() string { if m != nil && m.ObjcClassPrefix != nil { return *m.ObjcClassPrefix } return "" } func (m *FileOptions) GetCsharpNamespace() string { if m != nil && m.CsharpNamespace != nil { return *m.CsharpNamespace } return "" } func (m *FileOptions) GetSwiftPrefix() string { if m != nil && m.SwiftPrefix != nil { return *m.SwiftPrefix } return "" } func (m *FileOptions) GetPhpClassPrefix() string { if m != nil && m.PhpClassPrefix != nil { return *m.PhpClassPrefix } return "" } func (m *FileOptions) GetPhpNamespace() string { if m != nil && m.PhpNamespace != nil { return *m.PhpNamespace } return "" } func (m *FileOptions) GetPhpMetadataNamespace() string { if m != nil && m.PhpMetadataNamespace != nil { return *m.PhpMetadataNamespace } return "" } func (m *FileOptions) GetRubyPackage() string { if m != nil && m.RubyPackage != nil { return *m.RubyPackage } return "" } func (m *FileOptions) GetUninterpretedOption() []*UninterpretedOption { if m != nil { return m.UninterpretedOption } return nil } type MessageOptions struct { // Set true to use the old proto1 MessageSet wire format for extensions. // This is provided for backwards-compatibility with the MessageSet wire // format. You should not use this for any other reason: It's less // efficient, has fewer features, and is more complicated. // // The message must be defined exactly as follows: // message Foo { // option message_set_wire_format = true; // extensions 4 to max; // } // Note that the message cannot have any defined fields; MessageSets only // have extensions. // // All extensions of your type must be singular messages; e.g. they cannot // be int32s, enums, or repeated messages. // // Because this is an option, the above two restrictions are not enforced by // the protocol compiler. MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,json=messageSetWireFormat,def=0" json:"message_set_wire_format,omitempty"` // Disables the generation of the standard "descriptor()" accessor, which can // conflict with a field of the same name. This is meant to make migration // from proto1 easier; new code should avoid fields named "descriptor". NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,json=noStandardDescriptorAccessor,def=0" json:"no_standard_descriptor_accessor,omitempty"` // Is this message deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the message, or it will be completely ignored; in the very least, // this is a formalization for deprecating messages. Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // Whether the message is an automatically generated map entry type for the // maps field. // // For maps fields: // map map_field = 1; // The parsed descriptor looks like: // message MapFieldEntry { // option map_entry = true; // optional KeyType key = 1; // optional ValueType value = 2; // } // repeated MapFieldEntry map_field = 1; // // Implementations may choose not to generate the map_entry=true message, but // use a native map in the target language to hold the keys and values. // The reflection APIs in such implementions still need to work as // if the field is a repeated message field. // // NOTE: Do not set the option in .proto files. Always use the maps syntax // instead. The option should only be implicitly set by the proto compiler // parser. MapEntry *bool `protobuf:"varint,7,opt,name=map_entry,json=mapEntry" json:"map_entry,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *MessageOptions) Reset() { *m = MessageOptions{} } func (m *MessageOptions) String() string { return proto.CompactTextString(m) } func (*MessageOptions) ProtoMessage() {} func (*MessageOptions) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{11} } var extRange_MessageOptions = []proto.ExtensionRange{ {Start: 1000, End: 536870911}, } func (*MessageOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_MessageOptions } func (m *MessageOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MessageOptions.Unmarshal(m, b) } func (m *MessageOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MessageOptions.Marshal(b, m, deterministic) } func (m *MessageOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_MessageOptions.Merge(m, src) } func (m *MessageOptions) XXX_Size() int { return xxx_messageInfo_MessageOptions.Size(m) } func (m *MessageOptions) XXX_DiscardUnknown() { xxx_messageInfo_MessageOptions.DiscardUnknown(m) } var xxx_messageInfo_MessageOptions proto.InternalMessageInfo const Default_MessageOptions_MessageSetWireFormat bool = false const Default_MessageOptions_NoStandardDescriptorAccessor bool = false const Default_MessageOptions_Deprecated bool = false func (m *MessageOptions) GetMessageSetWireFormat() bool { if m != nil && m.MessageSetWireFormat != nil { return *m.MessageSetWireFormat } return Default_MessageOptions_MessageSetWireFormat } func (m *MessageOptions) GetNoStandardDescriptorAccessor() bool { if m != nil && m.NoStandardDescriptorAccessor != nil { return *m.NoStandardDescriptorAccessor } return Default_MessageOptions_NoStandardDescriptorAccessor } func (m *MessageOptions) GetDeprecated() bool { if m != nil && m.Deprecated != nil { return *m.Deprecated } return Default_MessageOptions_Deprecated } func (m *MessageOptions) GetMapEntry() bool { if m != nil && m.MapEntry != nil { return *m.MapEntry } return false } func (m *MessageOptions) GetUninterpretedOption() []*UninterpretedOption { if m != nil { return m.UninterpretedOption } return nil } type FieldOptions struct { // The ctype option instructs the C++ code generator to use a different // representation of the field than it normally would. See the specific // options below. This option is not yet implemented in the open source // release -- sorry, we'll try to include it in a future version! Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=google.protobuf.FieldOptions_CType,def=0" json:"ctype,omitempty"` // The packed option can be enabled for repeated primitive fields to enable // a more efficient representation on the wire. Rather than repeatedly // writing the tag and type for each element, the entire array is encoded as // a single length-delimited blob. In proto3, only explicit setting it to // false will avoid using packed encoding. Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"` // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING // is represented as JavaScript string, which avoids loss of precision that // can happen when a large value is converted to a floating point JavaScript. // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to // use the JavaScript "number" type. The behavior of the default option // JS_NORMAL is implementation dependent. // // This option is an enum to permit additional types to be added, e.g. // goog.math.Integer. Jstype *FieldOptions_JSType `protobuf:"varint,6,opt,name=jstype,enum=google.protobuf.FieldOptions_JSType,def=0" json:"jstype,omitempty"` // Should this field be parsed lazily? Lazy applies only to message-type // fields. It means that when the outer message is initially parsed, the // inner message's contents will not be parsed but instead stored in encoded // form. The inner message will actually be parsed when it is first accessed. // // This is only a hint. Implementations are free to choose whether to use // eager or lazy parsing regardless of the value of this option. However, // setting this option true suggests that the protocol author believes that // using lazy parsing on this field is worth the additional bookkeeping // overhead typically needed to implement it. // // This option does not affect the public interface of any generated code; // all method signatures remain the same. Furthermore, thread-safety of the // interface is not affected by this option; const methods remain safe to // call from multiple threads concurrently, while non-const methods continue // to require exclusive access. // // // Note that implementations may choose not to check required fields within // a lazy sub-message. That is, calling IsInitialized() on the outer message // may return true even if the inner message has missing required fields. // This is necessary because otherwise the inner message would have to be // parsed in order to perform the check, defeating the purpose of lazy // parsing. An implementation which chooses not to check required fields // must be consistent about it. That is, for any particular sub-message, the // implementation must either *always* check its required fields, or *never* // check its required fields, regardless of whether or not the message has // been parsed. Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"` // Is this field deprecated? // Depending on the target platform, this can emit Deprecated annotations // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // For Google-internal migration only. Do not use. Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *FieldOptions) Reset() { *m = FieldOptions{} } func (m *FieldOptions) String() string { return proto.CompactTextString(m) } func (*FieldOptions) ProtoMessage() {} func (*FieldOptions) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{12} } var extRange_FieldOptions = []proto.ExtensionRange{ {Start: 1000, End: 536870911}, } func (*FieldOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_FieldOptions } func (m *FieldOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FieldOptions.Unmarshal(m, b) } func (m *FieldOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_FieldOptions.Marshal(b, m, deterministic) } func (m *FieldOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_FieldOptions.Merge(m, src) } func (m *FieldOptions) XXX_Size() int { return xxx_messageInfo_FieldOptions.Size(m) } func (m *FieldOptions) XXX_DiscardUnknown() { xxx_messageInfo_FieldOptions.DiscardUnknown(m) } var xxx_messageInfo_FieldOptions proto.InternalMessageInfo const Default_FieldOptions_Ctype FieldOptions_CType = FieldOptions_STRING const Default_FieldOptions_Jstype FieldOptions_JSType = FieldOptions_JS_NORMAL const Default_FieldOptions_Lazy bool = false const Default_FieldOptions_Deprecated bool = false const Default_FieldOptions_Weak bool = false func (m *FieldOptions) GetCtype() FieldOptions_CType { if m != nil && m.Ctype != nil { return *m.Ctype } return Default_FieldOptions_Ctype } func (m *FieldOptions) GetPacked() bool { if m != nil && m.Packed != nil { return *m.Packed } return false } func (m *FieldOptions) GetJstype() FieldOptions_JSType { if m != nil && m.Jstype != nil { return *m.Jstype } return Default_FieldOptions_Jstype } func (m *FieldOptions) GetLazy() bool { if m != nil && m.Lazy != nil { return *m.Lazy } return Default_FieldOptions_Lazy } func (m *FieldOptions) GetDeprecated() bool { if m != nil && m.Deprecated != nil { return *m.Deprecated } return Default_FieldOptions_Deprecated } func (m *FieldOptions) GetWeak() bool { if m != nil && m.Weak != nil { return *m.Weak } return Default_FieldOptions_Weak } func (m *FieldOptions) GetUninterpretedOption() []*UninterpretedOption { if m != nil { return m.UninterpretedOption } return nil } type OneofOptions struct { // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *OneofOptions) Reset() { *m = OneofOptions{} } func (m *OneofOptions) String() string { return proto.CompactTextString(m) } func (*OneofOptions) ProtoMessage() {} func (*OneofOptions) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{13} } var extRange_OneofOptions = []proto.ExtensionRange{ {Start: 1000, End: 536870911}, } func (*OneofOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_OneofOptions } func (m *OneofOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OneofOptions.Unmarshal(m, b) } func (m *OneofOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_OneofOptions.Marshal(b, m, deterministic) } func (m *OneofOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_OneofOptions.Merge(m, src) } func (m *OneofOptions) XXX_Size() int { return xxx_messageInfo_OneofOptions.Size(m) } func (m *OneofOptions) XXX_DiscardUnknown() { xxx_messageInfo_OneofOptions.DiscardUnknown(m) } var xxx_messageInfo_OneofOptions proto.InternalMessageInfo func (m *OneofOptions) GetUninterpretedOption() []*UninterpretedOption { if m != nil { return m.UninterpretedOption } return nil } type EnumOptions struct { // Set this option to true to allow mapping different tag names to the same // value. AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias" json:"allow_alias,omitempty"` // Is this enum deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum, or it will be completely ignored; in the very least, this // is a formalization for deprecating enums. Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *EnumOptions) Reset() { *m = EnumOptions{} } func (m *EnumOptions) String() string { return proto.CompactTextString(m) } func (*EnumOptions) ProtoMessage() {} func (*EnumOptions) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{14} } var extRange_EnumOptions = []proto.ExtensionRange{ {Start: 1000, End: 536870911}, } func (*EnumOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_EnumOptions } func (m *EnumOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumOptions.Unmarshal(m, b) } func (m *EnumOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_EnumOptions.Marshal(b, m, deterministic) } func (m *EnumOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_EnumOptions.Merge(m, src) } func (m *EnumOptions) XXX_Size() int { return xxx_messageInfo_EnumOptions.Size(m) } func (m *EnumOptions) XXX_DiscardUnknown() { xxx_messageInfo_EnumOptions.DiscardUnknown(m) } var xxx_messageInfo_EnumOptions proto.InternalMessageInfo const Default_EnumOptions_Deprecated bool = false func (m *EnumOptions) GetAllowAlias() bool { if m != nil && m.AllowAlias != nil { return *m.AllowAlias } return false } func (m *EnumOptions) GetDeprecated() bool { if m != nil && m.Deprecated != nil { return *m.Deprecated } return Default_EnumOptions_Deprecated } func (m *EnumOptions) GetUninterpretedOption() []*UninterpretedOption { if m != nil { return m.UninterpretedOption } return nil } type EnumValueOptions struct { // Is this enum value deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *EnumValueOptions) Reset() { *m = EnumValueOptions{} } func (m *EnumValueOptions) String() string { return proto.CompactTextString(m) } func (*EnumValueOptions) ProtoMessage() {} func (*EnumValueOptions) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{15} } var extRange_EnumValueOptions = []proto.ExtensionRange{ {Start: 1000, End: 536870911}, } func (*EnumValueOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_EnumValueOptions } func (m *EnumValueOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumValueOptions.Unmarshal(m, b) } func (m *EnumValueOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_EnumValueOptions.Marshal(b, m, deterministic) } func (m *EnumValueOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_EnumValueOptions.Merge(m, src) } func (m *EnumValueOptions) XXX_Size() int { return xxx_messageInfo_EnumValueOptions.Size(m) } func (m *EnumValueOptions) XXX_DiscardUnknown() { xxx_messageInfo_EnumValueOptions.DiscardUnknown(m) } var xxx_messageInfo_EnumValueOptions proto.InternalMessageInfo const Default_EnumValueOptions_Deprecated bool = false func (m *EnumValueOptions) GetDeprecated() bool { if m != nil && m.Deprecated != nil { return *m.Deprecated } return Default_EnumValueOptions_Deprecated } func (m *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption { if m != nil { return m.UninterpretedOption } return nil } type ServiceOptions struct { // Is this service deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, // this is a formalization for deprecating services. Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ServiceOptions) Reset() { *m = ServiceOptions{} } func (m *ServiceOptions) String() string { return proto.CompactTextString(m) } func (*ServiceOptions) ProtoMessage() {} func (*ServiceOptions) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{16} } var extRange_ServiceOptions = []proto.ExtensionRange{ {Start: 1000, End: 536870911}, } func (*ServiceOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_ServiceOptions } func (m *ServiceOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ServiceOptions.Unmarshal(m, b) } func (m *ServiceOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_ServiceOptions.Marshal(b, m, deterministic) } func (m *ServiceOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_ServiceOptions.Merge(m, src) } func (m *ServiceOptions) XXX_Size() int { return xxx_messageInfo_ServiceOptions.Size(m) } func (m *ServiceOptions) XXX_DiscardUnknown() { xxx_messageInfo_ServiceOptions.DiscardUnknown(m) } var xxx_messageInfo_ServiceOptions proto.InternalMessageInfo const Default_ServiceOptions_Deprecated bool = false func (m *ServiceOptions) GetDeprecated() bool { if m != nil && m.Deprecated != nil { return *m.Deprecated } return Default_ServiceOptions_Deprecated } func (m *ServiceOptions) GetUninterpretedOption() []*UninterpretedOption { if m != nil { return m.UninterpretedOption } return nil } type MethodOptions struct { // Is this method deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the method, or it will be completely ignored; in the very least, // this is a formalization for deprecating methods. Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` IdempotencyLevel *MethodOptions_IdempotencyLevel `protobuf:"varint,34,opt,name=idempotency_level,json=idempotencyLevel,enum=google.protobuf.MethodOptions_IdempotencyLevel,def=0" json:"idempotency_level,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *MethodOptions) Reset() { *m = MethodOptions{} } func (m *MethodOptions) String() string { return proto.CompactTextString(m) } func (*MethodOptions) ProtoMessage() {} func (*MethodOptions) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{17} } var extRange_MethodOptions = []proto.ExtensionRange{ {Start: 1000, End: 536870911}, } func (*MethodOptions) ExtensionRangeArray() []proto.ExtensionRange { return extRange_MethodOptions } func (m *MethodOptions) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MethodOptions.Unmarshal(m, b) } func (m *MethodOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_MethodOptions.Marshal(b, m, deterministic) } func (m *MethodOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_MethodOptions.Merge(m, src) } func (m *MethodOptions) XXX_Size() int { return xxx_messageInfo_MethodOptions.Size(m) } func (m *MethodOptions) XXX_DiscardUnknown() { xxx_messageInfo_MethodOptions.DiscardUnknown(m) } var xxx_messageInfo_MethodOptions proto.InternalMessageInfo const Default_MethodOptions_Deprecated bool = false const Default_MethodOptions_IdempotencyLevel MethodOptions_IdempotencyLevel = MethodOptions_IDEMPOTENCY_UNKNOWN func (m *MethodOptions) GetDeprecated() bool { if m != nil && m.Deprecated != nil { return *m.Deprecated } return Default_MethodOptions_Deprecated } func (m *MethodOptions) GetIdempotencyLevel() MethodOptions_IdempotencyLevel { if m != nil && m.IdempotencyLevel != nil { return *m.IdempotencyLevel } return Default_MethodOptions_IdempotencyLevel } func (m *MethodOptions) GetUninterpretedOption() []*UninterpretedOption { if m != nil { return m.UninterpretedOption } return nil } // A message representing a option the parser does not recognize. This only // appears in options protos created by the compiler::Parser class. // DescriptorPool resolves these when building Descriptor objects. Therefore, // options protos in descriptor objects (e.g. returned by Descriptor::options(), // or produced by Descriptor::CopyTo()) will never have UninterpretedOptions // in them. type UninterpretedOption struct { Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"` // The value of the uninterpreted option, in whatever type the tokenizer // identified it as during parsing. Exactly one of these should be set. IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value,json=identifierValue" json:"identifier_value,omitempty"` PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value,json=positiveIntValue" json:"positive_int_value,omitempty"` NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value,json=negativeIntValue" json:"negative_int_value,omitempty"` DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"` StringValue []byte `protobuf:"bytes,7,opt,name=string_value,json=stringValue" json:"string_value,omitempty"` AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value,json=aggregateValue" json:"aggregate_value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *UninterpretedOption) Reset() { *m = UninterpretedOption{} } func (m *UninterpretedOption) String() string { return proto.CompactTextString(m) } func (*UninterpretedOption) ProtoMessage() {} func (*UninterpretedOption) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{18} } func (m *UninterpretedOption) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UninterpretedOption.Unmarshal(m, b) } func (m *UninterpretedOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UninterpretedOption.Marshal(b, m, deterministic) } func (m *UninterpretedOption) XXX_Merge(src proto.Message) { xxx_messageInfo_UninterpretedOption.Merge(m, src) } func (m *UninterpretedOption) XXX_Size() int { return xxx_messageInfo_UninterpretedOption.Size(m) } func (m *UninterpretedOption) XXX_DiscardUnknown() { xxx_messageInfo_UninterpretedOption.DiscardUnknown(m) } var xxx_messageInfo_UninterpretedOption proto.InternalMessageInfo func (m *UninterpretedOption) GetName() []*UninterpretedOption_NamePart { if m != nil { return m.Name } return nil } func (m *UninterpretedOption) GetIdentifierValue() string { if m != nil && m.IdentifierValue != nil { return *m.IdentifierValue } return "" } func (m *UninterpretedOption) GetPositiveIntValue() uint64 { if m != nil && m.PositiveIntValue != nil { return *m.PositiveIntValue } return 0 } func (m *UninterpretedOption) GetNegativeIntValue() int64 { if m != nil && m.NegativeIntValue != nil { return *m.NegativeIntValue } return 0 } func (m *UninterpretedOption) GetDoubleValue() float64 { if m != nil && m.DoubleValue != nil { return *m.DoubleValue } return 0 } func (m *UninterpretedOption) GetStringValue() []byte { if m != nil { return m.StringValue } return nil } func (m *UninterpretedOption) GetAggregateValue() string { if m != nil && m.AggregateValue != nil { return *m.AggregateValue } return "" } // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents // "foo.(bar.baz).qux". type UninterpretedOption_NamePart struct { NamePart *string `protobuf:"bytes,1,req,name=name_part,json=namePart" json:"name_part,omitempty"` IsExtension *bool `protobuf:"varint,2,req,name=is_extension,json=isExtension" json:"is_extension,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *UninterpretedOption_NamePart) Reset() { *m = UninterpretedOption_NamePart{} } func (m *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(m) } func (*UninterpretedOption_NamePart) ProtoMessage() {} func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{18, 0} } func (m *UninterpretedOption_NamePart) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UninterpretedOption_NamePart.Unmarshal(m, b) } func (m *UninterpretedOption_NamePart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UninterpretedOption_NamePart.Marshal(b, m, deterministic) } func (m *UninterpretedOption_NamePart) XXX_Merge(src proto.Message) { xxx_messageInfo_UninterpretedOption_NamePart.Merge(m, src) } func (m *UninterpretedOption_NamePart) XXX_Size() int { return xxx_messageInfo_UninterpretedOption_NamePart.Size(m) } func (m *UninterpretedOption_NamePart) XXX_DiscardUnknown() { xxx_messageInfo_UninterpretedOption_NamePart.DiscardUnknown(m) } var xxx_messageInfo_UninterpretedOption_NamePart proto.InternalMessageInfo func (m *UninterpretedOption_NamePart) GetNamePart() string { if m != nil && m.NamePart != nil { return *m.NamePart } return "" } func (m *UninterpretedOption_NamePart) GetIsExtension() bool { if m != nil && m.IsExtension != nil { return *m.IsExtension } return false } // Encapsulates information about the original source file from which a // FileDescriptorProto was generated. type SourceCodeInfo struct { // A Location identifies a piece of source code in a .proto file which // corresponds to a particular definition. This information is intended // to be useful to IDEs, code indexers, documentation generators, and similar // tools. // // For example, say we have a file like: // message Foo { // optional string foo = 1; // } // Let's look at just the field definition: // optional string foo = 1; // ^ ^^ ^^ ^ ^^^ // a bc de f ghi // We have the following locations: // span path represents // [a,i) [ 4, 0, 2, 0 ] The whole field definition. // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). // // Notes: // - A location may refer to a repeated field itself (i.e. not to any // particular index within it). This is used whenever a set of elements are // logically enclosed in a single code segment. For example, an entire // extend block (possibly containing multiple extension definitions) will // have an outer location whose path refers to the "extensions" repeated // field without an index. // - Multiple locations may have the same path. This happens when a single // logical declaration is spread out across multiple places. The most // obvious example is the "extend" block again -- there may be multiple // extend blocks in the same scope, each of which will have the same path. // - A location's span is not always a subset of its parent's span. For // example, the "extendee" of an extension declaration appears at the // beginning of the "extend" block and is shared by all extensions within // the block. // - Just because a location's span is a subset of some other location's span // does not mean that it is a descendent. For example, a "group" defines // both a type and a field in a single declaration. Thus, the locations // corresponding to the type and field and their components will overlap. // - Code which tries to interpret locations should probably be designed to // ignore those that it doesn't understand, as more types of locations could // be recorded in the future. Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SourceCodeInfo) Reset() { *m = SourceCodeInfo{} } func (m *SourceCodeInfo) String() string { return proto.CompactTextString(m) } func (*SourceCodeInfo) ProtoMessage() {} func (*SourceCodeInfo) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{19} } func (m *SourceCodeInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SourceCodeInfo.Unmarshal(m, b) } func (m *SourceCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SourceCodeInfo.Marshal(b, m, deterministic) } func (m *SourceCodeInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_SourceCodeInfo.Merge(m, src) } func (m *SourceCodeInfo) XXX_Size() int { return xxx_messageInfo_SourceCodeInfo.Size(m) } func (m *SourceCodeInfo) XXX_DiscardUnknown() { xxx_messageInfo_SourceCodeInfo.DiscardUnknown(m) } var xxx_messageInfo_SourceCodeInfo proto.InternalMessageInfo func (m *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location { if m != nil { return m.Location } return nil } type SourceCodeInfo_Location struct { // Identifies which part of the FileDescriptorProto was defined at this // location. // // Each element is a field number or an index. They form a path from // the root FileDescriptorProto to the place where the definition. For // example, this path: // [ 4, 3, 2, 7, 1 ] // refers to: // file.message_type(3) // 4, 3 // .field(7) // 2, 7 // .name() // 1 // This is because FileDescriptorProto.message_type has field number 4: // repeated DescriptorProto message_type = 4; // and DescriptorProto.field has field number 2: // repeated FieldDescriptorProto field = 2; // and FieldDescriptorProto.name has field number 1: // optional string name = 1; // // Thus, the above path gives the location of a field name. If we removed // the last element: // [ 4, 3, 2, 7 ] // this path refers to the whole field declaration (from the beginning // of the label to the terminating semicolon). Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` // Always has exactly three or four elements: start line, start column, // end line (optional, otherwise assumed same as start line), end column. // These are packed into a single field for efficiency. Note that line // and column numbers are zero-based -- typically you will want to add // 1 to each before displaying to a user. Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"` // If this SourceCodeInfo represents a complete declaration, these are any // comments appearing before and after the declaration which appear to be // attached to the declaration. // // A series of line comments appearing on consecutive lines, with no other // tokens appearing on those lines, will be treated as a single comment. // // leading_detached_comments will keep paragraphs of comments that appear // before (but not connected to) the current element. Each paragraph, // separated by empty lines, will be one comment element in the repeated // field. // // Only the comment content is provided; comment markers (e.g. //) are // stripped out. For block comments, leading whitespace and an asterisk // will be stripped from the beginning of each line other than the first. // Newlines are included in the output. // // Examples: // // optional int32 foo = 1; // Comment attached to foo. // // Comment attached to bar. // optional int32 bar = 2; // // optional string baz = 3; // // Comment attached to baz. // // Another line attached to baz. // // // Comment attached to qux. // // // // Another line attached to qux. // optional double qux = 4; // // // Detached comment for corge. This is not leading or trailing comments // // to qux or corge because there are blank lines separating it from // // both. // // // Detached comment for corge paragraph 2. // // optional string corge = 5; // /* Block comment attached // * to corge. Leading asterisks // * will be removed. */ // /* Block comment attached to // * grault. */ // optional int32 grault = 6; // // // ignored detached comments. LeadingComments *string `protobuf:"bytes,3,opt,name=leading_comments,json=leadingComments" json:"leading_comments,omitempty"` TrailingComments *string `protobuf:"bytes,4,opt,name=trailing_comments,json=trailingComments" json:"trailing_comments,omitempty"` LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments" json:"leading_detached_comments,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *SourceCodeInfo_Location) Reset() { *m = SourceCodeInfo_Location{} } func (m *SourceCodeInfo_Location) String() string { return proto.CompactTextString(m) } func (*SourceCodeInfo_Location) ProtoMessage() {} func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{19, 0} } func (m *SourceCodeInfo_Location) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SourceCodeInfo_Location.Unmarshal(m, b) } func (m *SourceCodeInfo_Location) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SourceCodeInfo_Location.Marshal(b, m, deterministic) } func (m *SourceCodeInfo_Location) XXX_Merge(src proto.Message) { xxx_messageInfo_SourceCodeInfo_Location.Merge(m, src) } func (m *SourceCodeInfo_Location) XXX_Size() int { return xxx_messageInfo_SourceCodeInfo_Location.Size(m) } func (m *SourceCodeInfo_Location) XXX_DiscardUnknown() { xxx_messageInfo_SourceCodeInfo_Location.DiscardUnknown(m) } var xxx_messageInfo_SourceCodeInfo_Location proto.InternalMessageInfo func (m *SourceCodeInfo_Location) GetPath() []int32 { if m != nil { return m.Path } return nil } func (m *SourceCodeInfo_Location) GetSpan() []int32 { if m != nil { return m.Span } return nil } func (m *SourceCodeInfo_Location) GetLeadingComments() string { if m != nil && m.LeadingComments != nil { return *m.LeadingComments } return "" } func (m *SourceCodeInfo_Location) GetTrailingComments() string { if m != nil && m.TrailingComments != nil { return *m.TrailingComments } return "" } func (m *SourceCodeInfo_Location) GetLeadingDetachedComments() []string { if m != nil { return m.LeadingDetachedComments } return nil } // Describes the relationship between generated code and its original source // file. A GeneratedCodeInfo message is associated with only one generated // source file, but may contain references to different source .proto files. type GeneratedCodeInfo struct { // An Annotation connects some span of text in generated code to an element // of its generating .proto file. Annotation []*GeneratedCodeInfo_Annotation `protobuf:"bytes,1,rep,name=annotation" json:"annotation,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *GeneratedCodeInfo) Reset() { *m = GeneratedCodeInfo{} } func (m *GeneratedCodeInfo) String() string { return proto.CompactTextString(m) } func (*GeneratedCodeInfo) ProtoMessage() {} func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{20} } func (m *GeneratedCodeInfo) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GeneratedCodeInfo.Unmarshal(m, b) } func (m *GeneratedCodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GeneratedCodeInfo.Marshal(b, m, deterministic) } func (m *GeneratedCodeInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_GeneratedCodeInfo.Merge(m, src) } func (m *GeneratedCodeInfo) XXX_Size() int { return xxx_messageInfo_GeneratedCodeInfo.Size(m) } func (m *GeneratedCodeInfo) XXX_DiscardUnknown() { xxx_messageInfo_GeneratedCodeInfo.DiscardUnknown(m) } var xxx_messageInfo_GeneratedCodeInfo proto.InternalMessageInfo func (m *GeneratedCodeInfo) GetAnnotation() []*GeneratedCodeInfo_Annotation { if m != nil { return m.Annotation } return nil } type GeneratedCodeInfo_Annotation struct { // Identifies the element in the original source .proto file. This field // is formatted the same as SourceCodeInfo.Location.path. Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` // Identifies the filesystem path to the original source .proto. SourceFile *string `protobuf:"bytes,2,opt,name=source_file,json=sourceFile" json:"source_file,omitempty"` // Identifies the starting offset in bytes in the generated code // that relates to the identified object. Begin *int32 `protobuf:"varint,3,opt,name=begin" json:"begin,omitempty"` // Identifies the ending offset in bytes in the generated code that // relates to the identified offset. The end offset should be one past // the last relevant byte (so the length of the text = end - begin). End *int32 `protobuf:"varint,4,opt,name=end" json:"end,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *GeneratedCodeInfo_Annotation) Reset() { *m = GeneratedCodeInfo_Annotation{} } func (m *GeneratedCodeInfo_Annotation) String() string { return proto.CompactTextString(m) } func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) { return fileDescriptor_308767df5ffe18af, []int{20, 0} } func (m *GeneratedCodeInfo_Annotation) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GeneratedCodeInfo_Annotation.Unmarshal(m, b) } func (m *GeneratedCodeInfo_Annotation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_GeneratedCodeInfo_Annotation.Marshal(b, m, deterministic) } func (m *GeneratedCodeInfo_Annotation) XXX_Merge(src proto.Message) { xxx_messageInfo_GeneratedCodeInfo_Annotation.Merge(m, src) } func (m *GeneratedCodeInfo_Annotation) XXX_Size() int { return xxx_messageInfo_GeneratedCodeInfo_Annotation.Size(m) } func (m *GeneratedCodeInfo_Annotation) XXX_DiscardUnknown() { xxx_messageInfo_GeneratedCodeInfo_Annotation.DiscardUnknown(m) } var xxx_messageInfo_GeneratedCodeInfo_Annotation proto.InternalMessageInfo func (m *GeneratedCodeInfo_Annotation) GetPath() []int32 { if m != nil { return m.Path } return nil } func (m *GeneratedCodeInfo_Annotation) GetSourceFile() string { if m != nil && m.SourceFile != nil { return *m.SourceFile } return "" } func (m *GeneratedCodeInfo_Annotation) GetBegin() int32 { if m != nil && m.Begin != nil { return *m.Begin } return 0 } func (m *GeneratedCodeInfo_Annotation) GetEnd() int32 { if m != nil && m.End != nil { return *m.End } return 0 } func init() { proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value) proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value) proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value) proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value) proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value) proto.RegisterEnum("google.protobuf.MethodOptions_IdempotencyLevel", MethodOptions_IdempotencyLevel_name, MethodOptions_IdempotencyLevel_value) proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet") proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto") proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto") proto.RegisterType((*DescriptorProto_ExtensionRange)(nil), "google.protobuf.DescriptorProto.ExtensionRange") proto.RegisterType((*DescriptorProto_ReservedRange)(nil), "google.protobuf.DescriptorProto.ReservedRange") proto.RegisterType((*ExtensionRangeOptions)(nil), "google.protobuf.ExtensionRangeOptions") proto.RegisterType((*FieldDescriptorProto)(nil), "google.protobuf.FieldDescriptorProto") proto.RegisterType((*OneofDescriptorProto)(nil), "google.protobuf.OneofDescriptorProto") proto.RegisterType((*EnumDescriptorProto)(nil), "google.protobuf.EnumDescriptorProto") proto.RegisterType((*EnumDescriptorProto_EnumReservedRange)(nil), "google.protobuf.EnumDescriptorProto.EnumReservedRange") proto.RegisterType((*EnumValueDescriptorProto)(nil), "google.protobuf.EnumValueDescriptorProto") proto.RegisterType((*ServiceDescriptorProto)(nil), "google.protobuf.ServiceDescriptorProto") proto.RegisterType((*MethodDescriptorProto)(nil), "google.protobuf.MethodDescriptorProto") proto.RegisterType((*FileOptions)(nil), "google.protobuf.FileOptions") proto.RegisterType((*MessageOptions)(nil), "google.protobuf.MessageOptions") proto.RegisterType((*FieldOptions)(nil), "google.protobuf.FieldOptions") proto.RegisterType((*OneofOptions)(nil), "google.protobuf.OneofOptions") proto.RegisterType((*EnumOptions)(nil), "google.protobuf.EnumOptions") proto.RegisterType((*EnumValueOptions)(nil), "google.protobuf.EnumValueOptions") proto.RegisterType((*ServiceOptions)(nil), "google.protobuf.ServiceOptions") proto.RegisterType((*MethodOptions)(nil), "google.protobuf.MethodOptions") proto.RegisterType((*UninterpretedOption)(nil), "google.protobuf.UninterpretedOption") proto.RegisterType((*UninterpretedOption_NamePart)(nil), "google.protobuf.UninterpretedOption.NamePart") proto.RegisterType((*SourceCodeInfo)(nil), "google.protobuf.SourceCodeInfo") proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location") proto.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo") proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation") } func init() { proto.RegisterFile("descriptor.proto", fileDescriptor_308767df5ffe18af) } var fileDescriptor_308767df5ffe18af = []byte{ // 2522 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x6f, 0xdb, 0xc8, 0x15, 0x5f, 0x7d, 0x5a, 0x7a, 0x92, 0x65, 0x7a, 0xec, 0x75, 0x18, 0xef, 0x47, 0x1c, 0xed, 0x66, 0xe3, 0x24, 0xbb, 0xca, 0xc2, 0x49, 0x9c, 0xac, 0x53, 0x6c, 0x2b, 0x4b, 0x8c, 0x57, 0xa9, 0xbe, 0x4a, 0xc9, 0xdd, 0x64, 0x8b, 0x82, 0x18, 0x93, 0x23, 0x89, 0x09, 0x45, 0x72, 0x49, 0x2a, 0x89, 0x83, 0x1e, 0x02, 0xf4, 0x54, 0xa0, 0x7f, 0x40, 0x51, 0x14, 0x3d, 0xf4, 0xb2, 0x40, 0xff, 0x80, 0x02, 0xed, 0xbd, 0xd7, 0x02, 0xbd, 0xf7, 0x50, 0xa0, 0x05, 0xda, 0x3f, 0xa1, 0xc7, 0x62, 0x66, 0x48, 0x8a, 0xd4, 0x47, 0xe2, 0x5d, 0x20, 0xd9, 0x93, 0x3d, 0xef, 0xfd, 0xde, 0x9b, 0x37, 0x8f, 0xbf, 0x79, 0xf3, 0x66, 0x04, 0x82, 0x46, 0x5c, 0xd5, 0xd1, 0x6d, 0xcf, 0x72, 0x2a, 0xb6, 0x63, 0x79, 0x16, 0x5a, 0x1b, 0x5a, 0xd6, 0xd0, 0x20, 0x7c, 0x74, 0x32, 0x19, 0x94, 0x5b, 0xb0, 0x7e, 0x4f, 0x37, 0x48, 0x3d, 0x04, 0xf6, 0x88, 0x87, 0xee, 0x40, 0x7a, 0xa0, 0x1b, 0x44, 0x4c, 0xec, 0xa4, 0x76, 0x0b, 0x7b, 0x1f, 0x56, 0x66, 0x8c, 0x2a, 0x71, 0x8b, 0x2e, 0x15, 0xcb, 0xcc, 0xa2, 0xfc, 0xef, 0x34, 0x6c, 0x2c, 0xd0, 0x22, 0x04, 0x69, 0x13, 0x8f, 0xa9, 0xc7, 0xc4, 0x6e, 0x5e, 0x66, 0xff, 0x23, 0x11, 0x56, 0x6c, 0xac, 0x3e, 0xc6, 0x43, 0x22, 0x26, 0x99, 0x38, 0x18, 0xa2, 0xf7, 0x01, 0x34, 0x62, 0x13, 0x53, 0x23, 0xa6, 0x7a, 0x2a, 0xa6, 0x76, 0x52, 0xbb, 0x79, 0x39, 0x22, 0x41, 0xd7, 0x60, 0xdd, 0x9e, 0x9c, 0x18, 0xba, 0xaa, 0x44, 0x60, 0xb0, 0x93, 0xda, 0xcd, 0xc8, 0x02, 0x57, 0xd4, 0xa7, 0xe0, 0xcb, 0xb0, 0xf6, 0x94, 0xe0, 0xc7, 0x51, 0x68, 0x81, 0x41, 0x4b, 0x54, 0x1c, 0x01, 0xd6, 0xa0, 0x38, 0x26, 0xae, 0x8b, 0x87, 0x44, 0xf1, 0x4e, 0x6d, 0x22, 0xa6, 0xd9, 0xea, 0x77, 0xe6, 0x56, 0x3f, 0xbb, 0xf2, 0x82, 0x6f, 0xd5, 0x3f, 0xb5, 0x09, 0xaa, 0x42, 0x9e, 0x98, 0x93, 0x31, 0xf7, 0x90, 0x59, 0x92, 0x3f, 0xc9, 0x9c, 0x8c, 0x67, 0xbd, 0xe4, 0xa8, 0x99, 0xef, 0x62, 0xc5, 0x25, 0xce, 0x13, 0x5d, 0x25, 0x62, 0x96, 0x39, 0xb8, 0x3c, 0xe7, 0xa0, 0xc7, 0xf5, 0xb3, 0x3e, 0x02, 0x3b, 0x54, 0x83, 0x3c, 0x79, 0xe6, 0x11, 0xd3, 0xd5, 0x2d, 0x53, 0x5c, 0x61, 0x4e, 0x2e, 0x2d, 0xf8, 0x8a, 0xc4, 0xd0, 0x66, 0x5d, 0x4c, 0xed, 0xd0, 0x3e, 0xac, 0x58, 0xb6, 0xa7, 0x5b, 0xa6, 0x2b, 0xe6, 0x76, 0x12, 0xbb, 0x85, 0xbd, 0x77, 0x17, 0x12, 0xa1, 0xc3, 0x31, 0x72, 0x00, 0x46, 0x0d, 0x10, 0x5c, 0x6b, 0xe2, 0xa8, 0x44, 0x51, 0x2d, 0x8d, 0x28, 0xba, 0x39, 0xb0, 0xc4, 0x3c, 0x73, 0x70, 0x61, 0x7e, 0x21, 0x0c, 0x58, 0xb3, 0x34, 0xd2, 0x30, 0x07, 0x96, 0x5c, 0x72, 0x63, 0x63, 0xb4, 0x05, 0x59, 0xf7, 0xd4, 0xf4, 0xf0, 0x33, 0xb1, 0xc8, 0x18, 0xe2, 0x8f, 0xca, 0x7f, 0xce, 0xc2, 0xda, 0x59, 0x28, 0x76, 0x17, 0x32, 0x03, 0xba, 0x4a, 0x31, 0xf9, 0x6d, 0x72, 0xc0, 0x6d, 0xe2, 0x49, 0xcc, 0x7e, 0xc7, 0x24, 0x56, 0xa1, 0x60, 0x12, 0xd7, 0x23, 0x1a, 0x67, 0x44, 0xea, 0x8c, 0x9c, 0x02, 0x6e, 0x34, 0x4f, 0xa9, 0xf4, 0x77, 0xa2, 0xd4, 0x03, 0x58, 0x0b, 0x43, 0x52, 0x1c, 0x6c, 0x0e, 0x03, 0x6e, 0x5e, 0x7f, 0x55, 0x24, 0x15, 0x29, 0xb0, 0x93, 0xa9, 0x99, 0x5c, 0x22, 0xb1, 0x31, 0xaa, 0x03, 0x58, 0x26, 0xb1, 0x06, 0x8a, 0x46, 0x54, 0x43, 0xcc, 0x2d, 0xc9, 0x52, 0x87, 0x42, 0xe6, 0xb2, 0x64, 0x71, 0xa9, 0x6a, 0xa0, 0xcf, 0xa6, 0x54, 0x5b, 0x59, 0xc2, 0x94, 0x16, 0xdf, 0x64, 0x73, 0x6c, 0x3b, 0x86, 0x92, 0x43, 0x28, 0xef, 0x89, 0xe6, 0xaf, 0x2c, 0xcf, 0x82, 0xa8, 0xbc, 0x72, 0x65, 0xb2, 0x6f, 0xc6, 0x17, 0xb6, 0xea, 0x44, 0x87, 0xe8, 0x03, 0x08, 0x05, 0x0a, 0xa3, 0x15, 0xb0, 0x2a, 0x54, 0x0c, 0x84, 0x6d, 0x3c, 0x26, 0xdb, 0xcf, 0xa1, 0x14, 0x4f, 0x0f, 0xda, 0x84, 0x8c, 0xeb, 0x61, 0xc7, 0x63, 0x2c, 0xcc, 0xc8, 0x7c, 0x80, 0x04, 0x48, 0x11, 0x53, 0x63, 0x55, 0x2e, 0x23, 0xd3, 0x7f, 0xd1, 0x8f, 0xa6, 0x0b, 0x4e, 0xb1, 0x05, 0x7f, 0x34, 0xff, 0x45, 0x63, 0x9e, 0x67, 0xd7, 0xbd, 0x7d, 0x1b, 0x56, 0x63, 0x0b, 0x38, 0xeb, 0xd4, 0xe5, 0x5f, 0xc0, 0xdb, 0x0b, 0x5d, 0xa3, 0x07, 0xb0, 0x39, 0x31, 0x75, 0xd3, 0x23, 0x8e, 0xed, 0x10, 0xca, 0x58, 0x3e, 0x95, 0xf8, 0x9f, 0x95, 0x25, 0x9c, 0x3b, 0x8e, 0xa2, 0xb9, 0x17, 0x79, 0x63, 0x32, 0x2f, 0xbc, 0x9a, 0xcf, 0xfd, 0x77, 0x45, 0x78, 0xf1, 0xe2, 0xc5, 0x8b, 0x64, 0xf9, 0x37, 0x59, 0xd8, 0x5c, 0xb4, 0x67, 0x16, 0x6e, 0xdf, 0x2d, 0xc8, 0x9a, 0x93, 0xf1, 0x09, 0x71, 0x58, 0x92, 0x32, 0xb2, 0x3f, 0x42, 0x55, 0xc8, 0x18, 0xf8, 0x84, 0x18, 0x62, 0x7a, 0x27, 0xb1, 0x5b, 0xda, 0xbb, 0x76, 0xa6, 0x5d, 0x59, 0x69, 0x52, 0x13, 0x99, 0x5b, 0xa2, 0xcf, 0x21, 0xed, 0x97, 0x68, 0xea, 0xe1, 0xea, 0xd9, 0x3c, 0xd0, 0xbd, 0x24, 0x33, 0x3b, 0xf4, 0x0e, 0xe4, 0xe9, 0x5f, 0xce, 0x8d, 0x2c, 0x8b, 0x39, 0x47, 0x05, 0x94, 0x17, 0x68, 0x1b, 0x72, 0x6c, 0x9b, 0x68, 0x24, 0x38, 0xda, 0xc2, 0x31, 0x25, 0x96, 0x46, 0x06, 0x78, 0x62, 0x78, 0xca, 0x13, 0x6c, 0x4c, 0x08, 0x23, 0x7c, 0x5e, 0x2e, 0xfa, 0xc2, 0x9f, 0x52, 0x19, 0xba, 0x00, 0x05, 0xbe, 0xab, 0x74, 0x53, 0x23, 0xcf, 0x58, 0xf5, 0xcc, 0xc8, 0x7c, 0xa3, 0x35, 0xa8, 0x84, 0x4e, 0xff, 0xc8, 0xb5, 0xcc, 0x80, 0x9a, 0x6c, 0x0a, 0x2a, 0x60, 0xd3, 0xdf, 0x9e, 0x2d, 0xdc, 0xef, 0x2d, 0x5e, 0xde, 0x2c, 0xa7, 0xca, 0x7f, 0x4a, 0x42, 0x9a, 0xd5, 0x8b, 0x35, 0x28, 0xf4, 0x1f, 0x76, 0x25, 0xa5, 0xde, 0x39, 0x3e, 0x6c, 0x4a, 0x42, 0x02, 0x95, 0x00, 0x98, 0xe0, 0x5e, 0xb3, 0x53, 0xed, 0x0b, 0xc9, 0x70, 0xdc, 0x68, 0xf7, 0xf7, 0x6f, 0x0a, 0xa9, 0xd0, 0xe0, 0x98, 0x0b, 0xd2, 0x51, 0xc0, 0x8d, 0x3d, 0x21, 0x83, 0x04, 0x28, 0x72, 0x07, 0x8d, 0x07, 0x52, 0x7d, 0xff, 0xa6, 0x90, 0x8d, 0x4b, 0x6e, 0xec, 0x09, 0x2b, 0x68, 0x15, 0xf2, 0x4c, 0x72, 0xd8, 0xe9, 0x34, 0x85, 0x5c, 0xe8, 0xb3, 0xd7, 0x97, 0x1b, 0xed, 0x23, 0x21, 0x1f, 0xfa, 0x3c, 0x92, 0x3b, 0xc7, 0x5d, 0x01, 0x42, 0x0f, 0x2d, 0xa9, 0xd7, 0xab, 0x1e, 0x49, 0x42, 0x21, 0x44, 0x1c, 0x3e, 0xec, 0x4b, 0x3d, 0xa1, 0x18, 0x0b, 0xeb, 0xc6, 0x9e, 0xb0, 0x1a, 0x4e, 0x21, 0xb5, 0x8f, 0x5b, 0x42, 0x09, 0xad, 0xc3, 0x2a, 0x9f, 0x22, 0x08, 0x62, 0x6d, 0x46, 0xb4, 0x7f, 0x53, 0x10, 0xa6, 0x81, 0x70, 0x2f, 0xeb, 0x31, 0xc1, 0xfe, 0x4d, 0x01, 0x95, 0x6b, 0x90, 0x61, 0xec, 0x42, 0x08, 0x4a, 0xcd, 0xea, 0xa1, 0xd4, 0x54, 0x3a, 0xdd, 0x7e, 0xa3, 0xd3, 0xae, 0x36, 0x85, 0xc4, 0x54, 0x26, 0x4b, 0x3f, 0x39, 0x6e, 0xc8, 0x52, 0x5d, 0x48, 0x46, 0x65, 0x5d, 0xa9, 0xda, 0x97, 0xea, 0x42, 0xaa, 0xac, 0xc2, 0xe6, 0xa2, 0x3a, 0xb9, 0x70, 0x67, 0x44, 0x3e, 0x71, 0x72, 0xc9, 0x27, 0x66, 0xbe, 0xe6, 0x3e, 0xf1, 0xbf, 0x92, 0xb0, 0xb1, 0xe0, 0xac, 0x58, 0x38, 0xc9, 0x0f, 0x21, 0xc3, 0x29, 0xca, 0x4f, 0xcf, 0x2b, 0x0b, 0x0f, 0x1d, 0x46, 0xd8, 0xb9, 0x13, 0x94, 0xd9, 0x45, 0x3b, 0x88, 0xd4, 0x92, 0x0e, 0x82, 0xba, 0x98, 0xab, 0xe9, 0x3f, 0x9f, 0xab, 0xe9, 0xfc, 0xd8, 0xdb, 0x3f, 0xcb, 0xb1, 0xc7, 0x64, 0xdf, 0xae, 0xb6, 0x67, 0x16, 0xd4, 0xf6, 0xbb, 0xb0, 0x3e, 0xe7, 0xe8, 0xcc, 0x35, 0xf6, 0x97, 0x09, 0x10, 0x97, 0x25, 0xe7, 0x15, 0x95, 0x2e, 0x19, 0xab, 0x74, 0x77, 0x67, 0x33, 0x78, 0x71, 0xf9, 0x47, 0x98, 0xfb, 0xd6, 0xdf, 0x24, 0x60, 0x6b, 0x71, 0xa7, 0xb8, 0x30, 0x86, 0xcf, 0x21, 0x3b, 0x26, 0xde, 0xc8, 0x0a, 0xba, 0xa5, 0x8f, 0x16, 0x9c, 0xc1, 0x54, 0x3d, 0xfb, 0xb1, 0x7d, 0xab, 0xe8, 0x21, 0x9e, 0x5a, 0xd6, 0xee, 0xf1, 0x68, 0xe6, 0x22, 0xfd, 0x55, 0x12, 0xde, 0x5e, 0xe8, 0x7c, 0x61, 0xa0, 0xef, 0x01, 0xe8, 0xa6, 0x3d, 0xf1, 0x78, 0x47, 0xc4, 0x0b, 0x6c, 0x9e, 0x49, 0x58, 0xf1, 0xa2, 0xc5, 0x73, 0xe2, 0x85, 0xfa, 0x14, 0xd3, 0x03, 0x17, 0x31, 0xc0, 0x9d, 0x69, 0xa0, 0x69, 0x16, 0xe8, 0xfb, 0x4b, 0x56, 0x3a, 0x47, 0xcc, 0x4f, 0x41, 0x50, 0x0d, 0x9d, 0x98, 0x9e, 0xe2, 0x7a, 0x0e, 0xc1, 0x63, 0xdd, 0x1c, 0xb2, 0x13, 0x24, 0x77, 0x90, 0x19, 0x60, 0xc3, 0x25, 0xf2, 0x1a, 0x57, 0xf7, 0x02, 0x2d, 0xb5, 0x60, 0x04, 0x72, 0x22, 0x16, 0xd9, 0x98, 0x05, 0x57, 0x87, 0x16, 0xe5, 0x5f, 0xe7, 0xa1, 0x10, 0xe9, 0xab, 0xd1, 0x45, 0x28, 0x3e, 0xc2, 0x4f, 0xb0, 0x12, 0xdc, 0x95, 0x78, 0x26, 0x0a, 0x54, 0xd6, 0xf5, 0xef, 0x4b, 0x9f, 0xc2, 0x26, 0x83, 0x58, 0x13, 0x8f, 0x38, 0x8a, 0x6a, 0x60, 0xd7, 0x65, 0x49, 0xcb, 0x31, 0x28, 0xa2, 0xba, 0x0e, 0x55, 0xd5, 0x02, 0x0d, 0xba, 0x05, 0x1b, 0xcc, 0x62, 0x3c, 0x31, 0x3c, 0xdd, 0x36, 0x88, 0x42, 0x6f, 0x6f, 0x2e, 0x3b, 0x49, 0xc2, 0xc8, 0xd6, 0x29, 0xa2, 0xe5, 0x03, 0x68, 0x44, 0x2e, 0xaa, 0xc3, 0x7b, 0xcc, 0x6c, 0x48, 0x4c, 0xe2, 0x60, 0x8f, 0x28, 0xe4, 0xeb, 0x09, 0x36, 0x5c, 0x05, 0x9b, 0x9a, 0x32, 0xc2, 0xee, 0x48, 0xdc, 0xa4, 0x0e, 0x0e, 0x93, 0x62, 0x42, 0x3e, 0x4f, 0x81, 0x47, 0x3e, 0x4e, 0x62, 0xb0, 0xaa, 0xa9, 0x7d, 0x81, 0xdd, 0x11, 0x3a, 0x80, 0x2d, 0xe6, 0xc5, 0xf5, 0x1c, 0xdd, 0x1c, 0x2a, 0xea, 0x88, 0xa8, 0x8f, 0x95, 0x89, 0x37, 0xb8, 0x23, 0xbe, 0x13, 0x9d, 0x9f, 0x45, 0xd8, 0x63, 0x98, 0x1a, 0x85, 0x1c, 0x7b, 0x83, 0x3b, 0xa8, 0x07, 0x45, 0xfa, 0x31, 0xc6, 0xfa, 0x73, 0xa2, 0x0c, 0x2c, 0x87, 0x1d, 0x8d, 0xa5, 0x05, 0xa5, 0x29, 0x92, 0xc1, 0x4a, 0xc7, 0x37, 0x68, 0x59, 0x1a, 0x39, 0xc8, 0xf4, 0xba, 0x92, 0x54, 0x97, 0x0b, 0x81, 0x97, 0x7b, 0x96, 0x43, 0x09, 0x35, 0xb4, 0xc2, 0x04, 0x17, 0x38, 0xa1, 0x86, 0x56, 0x90, 0xde, 0x5b, 0xb0, 0xa1, 0xaa, 0x7c, 0xcd, 0xba, 0xaa, 0xf8, 0x77, 0x2c, 0x57, 0x14, 0x62, 0xc9, 0x52, 0xd5, 0x23, 0x0e, 0xf0, 0x39, 0xee, 0xa2, 0xcf, 0xe0, 0xed, 0x69, 0xb2, 0xa2, 0x86, 0xeb, 0x73, 0xab, 0x9c, 0x35, 0xbd, 0x05, 0x1b, 0xf6, 0xe9, 0xbc, 0x21, 0x8a, 0xcd, 0x68, 0x9f, 0xce, 0x9a, 0xdd, 0x86, 0x4d, 0x7b, 0x64, 0xcf, 0xdb, 0x5d, 0x8d, 0xda, 0x21, 0x7b, 0x64, 0xcf, 0x1a, 0x5e, 0x62, 0x17, 0x6e, 0x87, 0xa8, 0xd8, 0x23, 0x9a, 0x78, 0x2e, 0x0a, 0x8f, 0x28, 0xd0, 0x75, 0x10, 0x54, 0x55, 0x21, 0x26, 0x3e, 0x31, 0x88, 0x82, 0x1d, 0x62, 0x62, 0x57, 0xbc, 0x10, 0x05, 0x97, 0x54, 0x55, 0x62, 0xda, 0x2a, 0x53, 0xa2, 0xab, 0xb0, 0x6e, 0x9d, 0x3c, 0x52, 0x39, 0x25, 0x15, 0xdb, 0x21, 0x03, 0xfd, 0x99, 0xf8, 0x21, 0xcb, 0xef, 0x1a, 0x55, 0x30, 0x42, 0x76, 0x99, 0x18, 0x5d, 0x01, 0x41, 0x75, 0x47, 0xd8, 0xb1, 0x59, 0x4d, 0x76, 0x6d, 0xac, 0x12, 0xf1, 0x12, 0x87, 0x72, 0x79, 0x3b, 0x10, 0xd3, 0x2d, 0xe1, 0x3e, 0xd5, 0x07, 0x5e, 0xe0, 0xf1, 0x32, 0xdf, 0x12, 0x4c, 0xe6, 0x7b, 0xdb, 0x05, 0x81, 0xa6, 0x22, 0x36, 0xf1, 0x2e, 0x83, 0x95, 0xec, 0x91, 0x1d, 0x9d, 0xf7, 0x03, 0x58, 0xa5, 0xc8, 0xe9, 0xa4, 0x57, 0x78, 0x43, 0x66, 0x8f, 0x22, 0x33, 0xde, 0x84, 0x2d, 0x0a, 0x1a, 0x13, 0x0f, 0x6b, 0xd8, 0xc3, 0x11, 0xf4, 0xc7, 0x0c, 0x4d, 0xf3, 0xde, 0xf2, 0x95, 0xb1, 0x38, 0x9d, 0xc9, 0xc9, 0x69, 0xc8, 0xac, 0x4f, 0x78, 0x9c, 0x54, 0x16, 0x70, 0xeb, 0xb5, 0x35, 0xdd, 0xe5, 0x03, 0x28, 0x46, 0x89, 0x8f, 0xf2, 0xc0, 0xa9, 0x2f, 0x24, 0x68, 0x17, 0x54, 0xeb, 0xd4, 0x69, 0xff, 0xf2, 0x95, 0x24, 0x24, 0x69, 0x1f, 0xd5, 0x6c, 0xf4, 0x25, 0x45, 0x3e, 0x6e, 0xf7, 0x1b, 0x2d, 0x49, 0x48, 0x45, 0x1b, 0xf6, 0xbf, 0x26, 0xa1, 0x14, 0xbf, 0x7b, 0xa1, 0x1f, 0xc0, 0xb9, 0xe0, 0xa1, 0xc4, 0x25, 0x9e, 0xf2, 0x54, 0x77, 0xd8, 0x5e, 0x1c, 0x63, 0x7e, 0x2e, 0x86, 0x6c, 0xd8, 0xf4, 0x51, 0x3d, 0xe2, 0x7d, 0xa9, 0x3b, 0x74, 0xa7, 0x8d, 0xb1, 0x87, 0x9a, 0x70, 0xc1, 0xb4, 0x14, 0xd7, 0xc3, 0xa6, 0x86, 0x1d, 0x4d, 0x99, 0x3e, 0x51, 0x29, 0x58, 0x55, 0x89, 0xeb, 0x5a, 0xfc, 0x0c, 0x0c, 0xbd, 0xbc, 0x6b, 0x5a, 0x3d, 0x1f, 0x3c, 0x3d, 0x1c, 0xaa, 0x3e, 0x74, 0x86, 0xb9, 0xa9, 0x65, 0xcc, 0x7d, 0x07, 0xf2, 0x63, 0x6c, 0x2b, 0xc4, 0xf4, 0x9c, 0x53, 0xd6, 0x71, 0xe7, 0xe4, 0xdc, 0x18, 0xdb, 0x12, 0x1d, 0xbf, 0x99, 0x8b, 0xcf, 0x3f, 0x52, 0x50, 0x8c, 0x76, 0xdd, 0xf4, 0x12, 0xa3, 0xb2, 0x03, 0x2a, 0xc1, 0x4a, 0xd8, 0x07, 0x2f, 0xed, 0xd1, 0x2b, 0x35, 0x7a, 0x72, 0x1d, 0x64, 0x79, 0x2f, 0x2c, 0x73, 0x4b, 0xda, 0x35, 0x50, 0x6a, 0x11, 0xde, 0x7b, 0xe4, 0x64, 0x7f, 0x84, 0x8e, 0x20, 0xfb, 0xc8, 0x65, 0xbe, 0xb3, 0xcc, 0xf7, 0x87, 0x2f, 0xf7, 0x7d, 0xbf, 0xc7, 0x9c, 0xe7, 0xef, 0xf7, 0x94, 0x76, 0x47, 0x6e, 0x55, 0x9b, 0xb2, 0x6f, 0x8e, 0xce, 0x43, 0xda, 0xc0, 0xcf, 0x4f, 0xe3, 0x67, 0x1c, 0x13, 0x9d, 0x35, 0xf1, 0xe7, 0x21, 0xfd, 0x94, 0xe0, 0xc7, 0xf1, 0x93, 0x85, 0x89, 0x5e, 0x23, 0xf5, 0xaf, 0x43, 0x86, 0xe5, 0x0b, 0x01, 0xf8, 0x19, 0x13, 0xde, 0x42, 0x39, 0x48, 0xd7, 0x3a, 0x32, 0xa5, 0xbf, 0x00, 0x45, 0x2e, 0x55, 0xba, 0x0d, 0xa9, 0x26, 0x09, 0xc9, 0xf2, 0x2d, 0xc8, 0xf2, 0x24, 0xd0, 0xad, 0x11, 0xa6, 0x41, 0x78, 0xcb, 0x1f, 0xfa, 0x3e, 0x12, 0x81, 0xf6, 0xb8, 0x75, 0x28, 0xc9, 0x42, 0x32, 0xfa, 0x79, 0x5d, 0x28, 0x46, 0x1b, 0xee, 0x37, 0xc3, 0xa9, 0xbf, 0x24, 0xa0, 0x10, 0x69, 0xa0, 0x69, 0xe7, 0x83, 0x0d, 0xc3, 0x7a, 0xaa, 0x60, 0x43, 0xc7, 0xae, 0x4f, 0x0a, 0x60, 0xa2, 0x2a, 0x95, 0x9c, 0xf5, 0xa3, 0xbd, 0x91, 0xe0, 0x7f, 0x9f, 0x00, 0x61, 0xb6, 0x77, 0x9d, 0x09, 0x30, 0xf1, 0xbd, 0x06, 0xf8, 0xbb, 0x04, 0x94, 0xe2, 0x0d, 0xeb, 0x4c, 0x78, 0x17, 0xbf, 0xd7, 0xf0, 0xfe, 0x99, 0x84, 0xd5, 0x58, 0x9b, 0x7a, 0xd6, 0xe8, 0xbe, 0x86, 0x75, 0x5d, 0x23, 0x63, 0xdb, 0xf2, 0x88, 0xa9, 0x9e, 0x2a, 0x06, 0x79, 0x42, 0x0c, 0xb1, 0xcc, 0x0a, 0xc5, 0xf5, 0x97, 0x37, 0xc2, 0x95, 0xc6, 0xd4, 0xae, 0x49, 0xcd, 0x0e, 0x36, 0x1a, 0x75, 0xa9, 0xd5, 0xed, 0xf4, 0xa5, 0x76, 0xed, 0xa1, 0x72, 0xdc, 0xfe, 0x71, 0xbb, 0xf3, 0x65, 0x5b, 0x16, 0xf4, 0x19, 0xd8, 0x6b, 0xdc, 0xea, 0x5d, 0x10, 0x66, 0x83, 0x42, 0xe7, 0x60, 0x51, 0x58, 0xc2, 0x5b, 0x68, 0x03, 0xd6, 0xda, 0x1d, 0xa5, 0xd7, 0xa8, 0x4b, 0x8a, 0x74, 0xef, 0x9e, 0x54, 0xeb, 0xf7, 0xf8, 0xd3, 0x46, 0x88, 0xee, 0xc7, 0x37, 0xf5, 0x6f, 0x53, 0xb0, 0xb1, 0x20, 0x12, 0x54, 0xf5, 0x2f, 0x25, 0xfc, 0x9e, 0xf4, 0xc9, 0x59, 0xa2, 0xaf, 0xd0, 0xae, 0xa0, 0x8b, 0x1d, 0xcf, 0xbf, 0xc3, 0x5c, 0x01, 0x9a, 0x25, 0xd3, 0xd3, 0x07, 0x3a, 0x71, 0xfc, 0x97, 0x20, 0x7e, 0x53, 0x59, 0x9b, 0xca, 0xf9, 0x63, 0xd0, 0xc7, 0x80, 0x6c, 0xcb, 0xd5, 0x3d, 0xfd, 0x09, 0x51, 0x74, 0x33, 0x78, 0x36, 0xa2, 0x37, 0x97, 0xb4, 0x2c, 0x04, 0x9a, 0x86, 0xe9, 0x85, 0x68, 0x93, 0x0c, 0xf1, 0x0c, 0x9a, 0x16, 0xf0, 0x94, 0x2c, 0x04, 0x9a, 0x10, 0x7d, 0x11, 0x8a, 0x9a, 0x35, 0xa1, 0xed, 0x1c, 0xc7, 0xd1, 0xf3, 0x22, 0x21, 0x17, 0xb8, 0x2c, 0x84, 0xf8, 0x8d, 0xfa, 0xf4, 0xbd, 0xaa, 0x28, 0x17, 0xb8, 0x8c, 0x43, 0x2e, 0xc3, 0x1a, 0x1e, 0x0e, 0x1d, 0xea, 0x3c, 0x70, 0xc4, 0xaf, 0x1e, 0xa5, 0x50, 0xcc, 0x80, 0xdb, 0xf7, 0x21, 0x17, 0xe4, 0x81, 0x1e, 0xc9, 0x34, 0x13, 0x8a, 0xcd, 0xef, 0xd3, 0xc9, 0xdd, 0xbc, 0x9c, 0x33, 0x03, 0xe5, 0x45, 0x28, 0xea, 0xae, 0x32, 0x7d, 0x7e, 0x4f, 0xee, 0x24, 0x77, 0x73, 0x72, 0x41, 0x77, 0xc3, 0xa7, 0xcb, 0xf2, 0x37, 0x49, 0x28, 0xc5, 0x7f, 0x3e, 0x40, 0x75, 0xc8, 0x19, 0x96, 0x8a, 0x19, 0xb5, 0xf8, 0x6f, 0x57, 0xbb, 0xaf, 0xf8, 0xc5, 0xa1, 0xd2, 0xf4, 0xf1, 0x72, 0x68, 0xb9, 0xfd, 0xb7, 0x04, 0xe4, 0x02, 0x31, 0xda, 0x82, 0xb4, 0x8d, 0xbd, 0x11, 0x73, 0x97, 0x39, 0x4c, 0x0a, 0x09, 0x99, 0x8d, 0xa9, 0xdc, 0xb5, 0xb1, 0xc9, 0x28, 0xe0, 0xcb, 0xe9, 0x98, 0x7e, 0x57, 0x83, 0x60, 0x8d, 0xdd, 0x6b, 0xac, 0xf1, 0x98, 0x98, 0x9e, 0x1b, 0x7c, 0x57, 0x5f, 0x5e, 0xf3, 0xc5, 0xe8, 0x1a, 0xac, 0x7b, 0x0e, 0xd6, 0x8d, 0x18, 0x36, 0xcd, 0xb0, 0x42, 0xa0, 0x08, 0xc1, 0x07, 0x70, 0x3e, 0xf0, 0xab, 0x11, 0x0f, 0xab, 0x23, 0xa2, 0x4d, 0x8d, 0xb2, 0xec, 0xfd, 0xe2, 0x9c, 0x0f, 0xa8, 0xfb, 0xfa, 0xc0, 0xb6, 0xfc, 0xf7, 0x04, 0xac, 0x07, 0x37, 0x31, 0x2d, 0x4c, 0x56, 0x0b, 0x00, 0x9b, 0xa6, 0xe5, 0x45, 0xd3, 0x35, 0x4f, 0xe5, 0x39, 0xbb, 0x4a, 0x35, 0x34, 0x92, 0x23, 0x0e, 0xb6, 0xc7, 0x00, 0x53, 0xcd, 0xd2, 0xb4, 0x5d, 0x80, 0x82, 0xff, 0xdb, 0x10, 0xfb, 0x81, 0x91, 0xdf, 0xdd, 0x81, 0x8b, 0xe8, 0x95, 0x0d, 0x6d, 0x42, 0xe6, 0x84, 0x0c, 0x75, 0xd3, 0x7f, 0xf1, 0xe5, 0x83, 0xe0, 0x85, 0x25, 0x1d, 0xbe, 0xb0, 0x1c, 0xfe, 0x0c, 0x36, 0x54, 0x6b, 0x3c, 0x1b, 0xee, 0xa1, 0x30, 0xf3, 0x7e, 0xe0, 0x7e, 0x91, 0xf8, 0x0a, 0xa6, 0x2d, 0xe6, 0xff, 0x12, 0x89, 0x3f, 0x24, 0x53, 0x47, 0xdd, 0xc3, 0x3f, 0x26, 0xb7, 0x8f, 0xb8, 0x69, 0x37, 0x58, 0xa9, 0x4c, 0x06, 0x06, 0x51, 0x69, 0xf4, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x88, 0x17, 0xc1, 0xbe, 0x38, 0x1d, 0x00, 0x00, } ================================================ FILE: vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor_gostring.gen.go ================================================ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: descriptor.proto package descriptor import ( fmt "fmt" github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto" math "math" reflect "reflect" sort "sort" strconv "strconv" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf func (this *FileDescriptorSet) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&descriptor.FileDescriptorSet{") if this.File != nil { s = append(s, "File: "+fmt.Sprintf("%#v", this.File)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *FileDescriptorProto) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 16) s = append(s, "&descriptor.FileDescriptorProto{") if this.Name != nil { s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") } if this.Package != nil { s = append(s, "Package: "+valueToGoStringDescriptor(this.Package, "string")+",\n") } if this.Dependency != nil { s = append(s, "Dependency: "+fmt.Sprintf("%#v", this.Dependency)+",\n") } if this.PublicDependency != nil { s = append(s, "PublicDependency: "+fmt.Sprintf("%#v", this.PublicDependency)+",\n") } if this.WeakDependency != nil { s = append(s, "WeakDependency: "+fmt.Sprintf("%#v", this.WeakDependency)+",\n") } if this.MessageType != nil { s = append(s, "MessageType: "+fmt.Sprintf("%#v", this.MessageType)+",\n") } if this.EnumType != nil { s = append(s, "EnumType: "+fmt.Sprintf("%#v", this.EnumType)+",\n") } if this.Service != nil { s = append(s, "Service: "+fmt.Sprintf("%#v", this.Service)+",\n") } if this.Extension != nil { s = append(s, "Extension: "+fmt.Sprintf("%#v", this.Extension)+",\n") } if this.Options != nil { s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") } if this.SourceCodeInfo != nil { s = append(s, "SourceCodeInfo: "+fmt.Sprintf("%#v", this.SourceCodeInfo)+",\n") } if this.Syntax != nil { s = append(s, "Syntax: "+valueToGoStringDescriptor(this.Syntax, "string")+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *DescriptorProto) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 14) s = append(s, "&descriptor.DescriptorProto{") if this.Name != nil { s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") } if this.Field != nil { s = append(s, "Field: "+fmt.Sprintf("%#v", this.Field)+",\n") } if this.Extension != nil { s = append(s, "Extension: "+fmt.Sprintf("%#v", this.Extension)+",\n") } if this.NestedType != nil { s = append(s, "NestedType: "+fmt.Sprintf("%#v", this.NestedType)+",\n") } if this.EnumType != nil { s = append(s, "EnumType: "+fmt.Sprintf("%#v", this.EnumType)+",\n") } if this.ExtensionRange != nil { s = append(s, "ExtensionRange: "+fmt.Sprintf("%#v", this.ExtensionRange)+",\n") } if this.OneofDecl != nil { s = append(s, "OneofDecl: "+fmt.Sprintf("%#v", this.OneofDecl)+",\n") } if this.Options != nil { s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") } if this.ReservedRange != nil { s = append(s, "ReservedRange: "+fmt.Sprintf("%#v", this.ReservedRange)+",\n") } if this.ReservedName != nil { s = append(s, "ReservedName: "+fmt.Sprintf("%#v", this.ReservedName)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *DescriptorProto_ExtensionRange) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&descriptor.DescriptorProto_ExtensionRange{") if this.Start != nil { s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n") } if this.End != nil { s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n") } if this.Options != nil { s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *DescriptorProto_ReservedRange) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&descriptor.DescriptorProto_ReservedRange{") if this.Start != nil { s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n") } if this.End != nil { s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *ExtensionRangeOptions) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&descriptor.ExtensionRangeOptions{") if this.UninterpretedOption != nil { s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") } s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *FieldDescriptorProto) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 14) s = append(s, "&descriptor.FieldDescriptorProto{") if this.Name != nil { s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") } if this.Number != nil { s = append(s, "Number: "+valueToGoStringDescriptor(this.Number, "int32")+",\n") } if this.Label != nil { s = append(s, "Label: "+valueToGoStringDescriptor(this.Label, "FieldDescriptorProto_Label")+",\n") } if this.Type != nil { s = append(s, "Type: "+valueToGoStringDescriptor(this.Type, "FieldDescriptorProto_Type")+",\n") } if this.TypeName != nil { s = append(s, "TypeName: "+valueToGoStringDescriptor(this.TypeName, "string")+",\n") } if this.Extendee != nil { s = append(s, "Extendee: "+valueToGoStringDescriptor(this.Extendee, "string")+",\n") } if this.DefaultValue != nil { s = append(s, "DefaultValue: "+valueToGoStringDescriptor(this.DefaultValue, "string")+",\n") } if this.OneofIndex != nil { s = append(s, "OneofIndex: "+valueToGoStringDescriptor(this.OneofIndex, "int32")+",\n") } if this.JsonName != nil { s = append(s, "JsonName: "+valueToGoStringDescriptor(this.JsonName, "string")+",\n") } if this.Options != nil { s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *OneofDescriptorProto) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&descriptor.OneofDescriptorProto{") if this.Name != nil { s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") } if this.Options != nil { s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *EnumDescriptorProto) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 9) s = append(s, "&descriptor.EnumDescriptorProto{") if this.Name != nil { s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") } if this.Value != nil { s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") } if this.Options != nil { s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") } if this.ReservedRange != nil { s = append(s, "ReservedRange: "+fmt.Sprintf("%#v", this.ReservedRange)+",\n") } if this.ReservedName != nil { s = append(s, "ReservedName: "+fmt.Sprintf("%#v", this.ReservedName)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *EnumDescriptorProto_EnumReservedRange) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&descriptor.EnumDescriptorProto_EnumReservedRange{") if this.Start != nil { s = append(s, "Start: "+valueToGoStringDescriptor(this.Start, "int32")+",\n") } if this.End != nil { s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *EnumValueDescriptorProto) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&descriptor.EnumValueDescriptorProto{") if this.Name != nil { s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") } if this.Number != nil { s = append(s, "Number: "+valueToGoStringDescriptor(this.Number, "int32")+",\n") } if this.Options != nil { s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *ServiceDescriptorProto) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&descriptor.ServiceDescriptorProto{") if this.Name != nil { s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") } if this.Method != nil { s = append(s, "Method: "+fmt.Sprintf("%#v", this.Method)+",\n") } if this.Options != nil { s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *MethodDescriptorProto) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 10) s = append(s, "&descriptor.MethodDescriptorProto{") if this.Name != nil { s = append(s, "Name: "+valueToGoStringDescriptor(this.Name, "string")+",\n") } if this.InputType != nil { s = append(s, "InputType: "+valueToGoStringDescriptor(this.InputType, "string")+",\n") } if this.OutputType != nil { s = append(s, "OutputType: "+valueToGoStringDescriptor(this.OutputType, "string")+",\n") } if this.Options != nil { s = append(s, "Options: "+fmt.Sprintf("%#v", this.Options)+",\n") } if this.ClientStreaming != nil { s = append(s, "ClientStreaming: "+valueToGoStringDescriptor(this.ClientStreaming, "bool")+",\n") } if this.ServerStreaming != nil { s = append(s, "ServerStreaming: "+valueToGoStringDescriptor(this.ServerStreaming, "bool")+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *FileOptions) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 25) s = append(s, "&descriptor.FileOptions{") if this.JavaPackage != nil { s = append(s, "JavaPackage: "+valueToGoStringDescriptor(this.JavaPackage, "string")+",\n") } if this.JavaOuterClassname != nil { s = append(s, "JavaOuterClassname: "+valueToGoStringDescriptor(this.JavaOuterClassname, "string")+",\n") } if this.JavaMultipleFiles != nil { s = append(s, "JavaMultipleFiles: "+valueToGoStringDescriptor(this.JavaMultipleFiles, "bool")+",\n") } if this.JavaGenerateEqualsAndHash != nil { s = append(s, "JavaGenerateEqualsAndHash: "+valueToGoStringDescriptor(this.JavaGenerateEqualsAndHash, "bool")+",\n") } if this.JavaStringCheckUtf8 != nil { s = append(s, "JavaStringCheckUtf8: "+valueToGoStringDescriptor(this.JavaStringCheckUtf8, "bool")+",\n") } if this.OptimizeFor != nil { s = append(s, "OptimizeFor: "+valueToGoStringDescriptor(this.OptimizeFor, "FileOptions_OptimizeMode")+",\n") } if this.GoPackage != nil { s = append(s, "GoPackage: "+valueToGoStringDescriptor(this.GoPackage, "string")+",\n") } if this.CcGenericServices != nil { s = append(s, "CcGenericServices: "+valueToGoStringDescriptor(this.CcGenericServices, "bool")+",\n") } if this.JavaGenericServices != nil { s = append(s, "JavaGenericServices: "+valueToGoStringDescriptor(this.JavaGenericServices, "bool")+",\n") } if this.PyGenericServices != nil { s = append(s, "PyGenericServices: "+valueToGoStringDescriptor(this.PyGenericServices, "bool")+",\n") } if this.PhpGenericServices != nil { s = append(s, "PhpGenericServices: "+valueToGoStringDescriptor(this.PhpGenericServices, "bool")+",\n") } if this.Deprecated != nil { s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") } if this.CcEnableArenas != nil { s = append(s, "CcEnableArenas: "+valueToGoStringDescriptor(this.CcEnableArenas, "bool")+",\n") } if this.ObjcClassPrefix != nil { s = append(s, "ObjcClassPrefix: "+valueToGoStringDescriptor(this.ObjcClassPrefix, "string")+",\n") } if this.CsharpNamespace != nil { s = append(s, "CsharpNamespace: "+valueToGoStringDescriptor(this.CsharpNamespace, "string")+",\n") } if this.SwiftPrefix != nil { s = append(s, "SwiftPrefix: "+valueToGoStringDescriptor(this.SwiftPrefix, "string")+",\n") } if this.PhpClassPrefix != nil { s = append(s, "PhpClassPrefix: "+valueToGoStringDescriptor(this.PhpClassPrefix, "string")+",\n") } if this.PhpNamespace != nil { s = append(s, "PhpNamespace: "+valueToGoStringDescriptor(this.PhpNamespace, "string")+",\n") } if this.PhpMetadataNamespace != nil { s = append(s, "PhpMetadataNamespace: "+valueToGoStringDescriptor(this.PhpMetadataNamespace, "string")+",\n") } if this.RubyPackage != nil { s = append(s, "RubyPackage: "+valueToGoStringDescriptor(this.RubyPackage, "string")+",\n") } if this.UninterpretedOption != nil { s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") } s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *MessageOptions) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 9) s = append(s, "&descriptor.MessageOptions{") if this.MessageSetWireFormat != nil { s = append(s, "MessageSetWireFormat: "+valueToGoStringDescriptor(this.MessageSetWireFormat, "bool")+",\n") } if this.NoStandardDescriptorAccessor != nil { s = append(s, "NoStandardDescriptorAccessor: "+valueToGoStringDescriptor(this.NoStandardDescriptorAccessor, "bool")+",\n") } if this.Deprecated != nil { s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") } if this.MapEntry != nil { s = append(s, "MapEntry: "+valueToGoStringDescriptor(this.MapEntry, "bool")+",\n") } if this.UninterpretedOption != nil { s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") } s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *FieldOptions) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 11) s = append(s, "&descriptor.FieldOptions{") if this.Ctype != nil { s = append(s, "Ctype: "+valueToGoStringDescriptor(this.Ctype, "FieldOptions_CType")+",\n") } if this.Packed != nil { s = append(s, "Packed: "+valueToGoStringDescriptor(this.Packed, "bool")+",\n") } if this.Jstype != nil { s = append(s, "Jstype: "+valueToGoStringDescriptor(this.Jstype, "FieldOptions_JSType")+",\n") } if this.Lazy != nil { s = append(s, "Lazy: "+valueToGoStringDescriptor(this.Lazy, "bool")+",\n") } if this.Deprecated != nil { s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") } if this.Weak != nil { s = append(s, "Weak: "+valueToGoStringDescriptor(this.Weak, "bool")+",\n") } if this.UninterpretedOption != nil { s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") } s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *OneofOptions) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&descriptor.OneofOptions{") if this.UninterpretedOption != nil { s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") } s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *EnumOptions) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&descriptor.EnumOptions{") if this.AllowAlias != nil { s = append(s, "AllowAlias: "+valueToGoStringDescriptor(this.AllowAlias, "bool")+",\n") } if this.Deprecated != nil { s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") } if this.UninterpretedOption != nil { s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") } s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *EnumValueOptions) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&descriptor.EnumValueOptions{") if this.Deprecated != nil { s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") } if this.UninterpretedOption != nil { s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") } s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *ServiceOptions) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&descriptor.ServiceOptions{") if this.Deprecated != nil { s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") } if this.UninterpretedOption != nil { s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") } s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *MethodOptions) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 7) s = append(s, "&descriptor.MethodOptions{") if this.Deprecated != nil { s = append(s, "Deprecated: "+valueToGoStringDescriptor(this.Deprecated, "bool")+",\n") } if this.IdempotencyLevel != nil { s = append(s, "IdempotencyLevel: "+valueToGoStringDescriptor(this.IdempotencyLevel, "MethodOptions_IdempotencyLevel")+",\n") } if this.UninterpretedOption != nil { s = append(s, "UninterpretedOption: "+fmt.Sprintf("%#v", this.UninterpretedOption)+",\n") } s = append(s, "XXX_InternalExtensions: "+extensionToGoStringDescriptor(this)+",\n") if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *UninterpretedOption) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 11) s = append(s, "&descriptor.UninterpretedOption{") if this.Name != nil { s = append(s, "Name: "+fmt.Sprintf("%#v", this.Name)+",\n") } if this.IdentifierValue != nil { s = append(s, "IdentifierValue: "+valueToGoStringDescriptor(this.IdentifierValue, "string")+",\n") } if this.PositiveIntValue != nil { s = append(s, "PositiveIntValue: "+valueToGoStringDescriptor(this.PositiveIntValue, "uint64")+",\n") } if this.NegativeIntValue != nil { s = append(s, "NegativeIntValue: "+valueToGoStringDescriptor(this.NegativeIntValue, "int64")+",\n") } if this.DoubleValue != nil { s = append(s, "DoubleValue: "+valueToGoStringDescriptor(this.DoubleValue, "float64")+",\n") } if this.StringValue != nil { s = append(s, "StringValue: "+valueToGoStringDescriptor(this.StringValue, "byte")+",\n") } if this.AggregateValue != nil { s = append(s, "AggregateValue: "+valueToGoStringDescriptor(this.AggregateValue, "string")+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *UninterpretedOption_NamePart) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 6) s = append(s, "&descriptor.UninterpretedOption_NamePart{") if this.NamePart != nil { s = append(s, "NamePart: "+valueToGoStringDescriptor(this.NamePart, "string")+",\n") } if this.IsExtension != nil { s = append(s, "IsExtension: "+valueToGoStringDescriptor(this.IsExtension, "bool")+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *SourceCodeInfo) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&descriptor.SourceCodeInfo{") if this.Location != nil { s = append(s, "Location: "+fmt.Sprintf("%#v", this.Location)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *SourceCodeInfo_Location) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 9) s = append(s, "&descriptor.SourceCodeInfo_Location{") if this.Path != nil { s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") } if this.Span != nil { s = append(s, "Span: "+fmt.Sprintf("%#v", this.Span)+",\n") } if this.LeadingComments != nil { s = append(s, "LeadingComments: "+valueToGoStringDescriptor(this.LeadingComments, "string")+",\n") } if this.TrailingComments != nil { s = append(s, "TrailingComments: "+valueToGoStringDescriptor(this.TrailingComments, "string")+",\n") } if this.LeadingDetachedComments != nil { s = append(s, "LeadingDetachedComments: "+fmt.Sprintf("%#v", this.LeadingDetachedComments)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *GeneratedCodeInfo) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 5) s = append(s, "&descriptor.GeneratedCodeInfo{") if this.Annotation != nil { s = append(s, "Annotation: "+fmt.Sprintf("%#v", this.Annotation)+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func (this *GeneratedCodeInfo_Annotation) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 8) s = append(s, "&descriptor.GeneratedCodeInfo_Annotation{") if this.Path != nil { s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n") } if this.SourceFile != nil { s = append(s, "SourceFile: "+valueToGoStringDescriptor(this.SourceFile, "string")+",\n") } if this.Begin != nil { s = append(s, "Begin: "+valueToGoStringDescriptor(this.Begin, "int32")+",\n") } if this.End != nil { s = append(s, "End: "+valueToGoStringDescriptor(this.End, "int32")+",\n") } if this.XXX_unrecognized != nil { s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n") } s = append(s, "}") return strings.Join(s, "") } func valueToGoStringDescriptor(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } func extensionToGoStringDescriptor(m github_com_gogo_protobuf_proto.Message) string { e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m) if e == nil { return "nil" } s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{" keys := make([]int, 0, len(e)) for k := range e { keys = append(keys, int(k)) } sort.Ints(keys) ss := []string{} for _, k := range keys { ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) } s += strings.Join(ss, ",") + "})" return s } ================================================ FILE: vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/helper.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package descriptor import ( "strings" ) func (msg *DescriptorProto) GetMapFields() (*FieldDescriptorProto, *FieldDescriptorProto) { if !msg.GetOptions().GetMapEntry() { return nil, nil } return msg.GetField()[0], msg.GetField()[1] } func dotToUnderscore(r rune) rune { if r == '.' { return '_' } return r } func (field *FieldDescriptorProto) WireType() (wire int) { switch *field.Type { case FieldDescriptorProto_TYPE_DOUBLE: return 1 case FieldDescriptorProto_TYPE_FLOAT: return 5 case FieldDescriptorProto_TYPE_INT64: return 0 case FieldDescriptorProto_TYPE_UINT64: return 0 case FieldDescriptorProto_TYPE_INT32: return 0 case FieldDescriptorProto_TYPE_UINT32: return 0 case FieldDescriptorProto_TYPE_FIXED64: return 1 case FieldDescriptorProto_TYPE_FIXED32: return 5 case FieldDescriptorProto_TYPE_BOOL: return 0 case FieldDescriptorProto_TYPE_STRING: return 2 case FieldDescriptorProto_TYPE_GROUP: return 2 case FieldDescriptorProto_TYPE_MESSAGE: return 2 case FieldDescriptorProto_TYPE_BYTES: return 2 case FieldDescriptorProto_TYPE_ENUM: return 0 case FieldDescriptorProto_TYPE_SFIXED32: return 5 case FieldDescriptorProto_TYPE_SFIXED64: return 1 case FieldDescriptorProto_TYPE_SINT32: return 0 case FieldDescriptorProto_TYPE_SINT64: return 0 } panic("unreachable") } func (field *FieldDescriptorProto) GetKeyUint64() (x uint64) { packed := field.IsPacked() wireType := field.WireType() fieldNumber := field.GetNumber() if packed { wireType = 2 } x = uint64(uint32(fieldNumber)<<3 | uint32(wireType)) return x } func (field *FieldDescriptorProto) GetKey3Uint64() (x uint64) { packed := field.IsPacked3() wireType := field.WireType() fieldNumber := field.GetNumber() if packed { wireType = 2 } x = uint64(uint32(fieldNumber)<<3 | uint32(wireType)) return x } func (field *FieldDescriptorProto) GetKey() []byte { x := field.GetKeyUint64() i := 0 keybuf := make([]byte, 0) for i = 0; x > 127; i++ { keybuf = append(keybuf, 0x80|uint8(x&0x7F)) x >>= 7 } keybuf = append(keybuf, uint8(x)) return keybuf } func (field *FieldDescriptorProto) GetKey3() []byte { x := field.GetKey3Uint64() i := 0 keybuf := make([]byte, 0) for i = 0; x > 127; i++ { keybuf = append(keybuf, 0x80|uint8(x&0x7F)) x >>= 7 } keybuf = append(keybuf, uint8(x)) return keybuf } func (desc *FileDescriptorSet) GetField(packageName, messageName, fieldName string) *FieldDescriptorProto { msg := desc.GetMessage(packageName, messageName) if msg == nil { return nil } for _, field := range msg.GetField() { if field.GetName() == fieldName { return field } } return nil } func (file *FileDescriptorProto) GetMessage(typeName string) *DescriptorProto { for _, msg := range file.GetMessageType() { if msg.GetName() == typeName { return msg } nes := file.GetNestedMessage(msg, strings.TrimPrefix(typeName, msg.GetName()+".")) if nes != nil { return nes } } return nil } func (file *FileDescriptorProto) GetNestedMessage(msg *DescriptorProto, typeName string) *DescriptorProto { for _, nes := range msg.GetNestedType() { if nes.GetName() == typeName { return nes } res := file.GetNestedMessage(nes, strings.TrimPrefix(typeName, nes.GetName()+".")) if res != nil { return res } } return nil } func (desc *FileDescriptorSet) GetMessage(packageName string, typeName string) *DescriptorProto { for _, file := range desc.GetFile() { if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) { continue } for _, msg := range file.GetMessageType() { if msg.GetName() == typeName { return msg } } for _, msg := range file.GetMessageType() { for _, nes := range msg.GetNestedType() { if nes.GetName() == typeName { return nes } if msg.GetName()+"."+nes.GetName() == typeName { return nes } } } } return nil } func (desc *FileDescriptorSet) IsProto3(packageName string, typeName string) bool { for _, file := range desc.GetFile() { if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) { continue } for _, msg := range file.GetMessageType() { if msg.GetName() == typeName { return file.GetSyntax() == "proto3" } } for _, msg := range file.GetMessageType() { for _, nes := range msg.GetNestedType() { if nes.GetName() == typeName { return file.GetSyntax() == "proto3" } if msg.GetName()+"."+nes.GetName() == typeName { return file.GetSyntax() == "proto3" } } } } return false } func (msg *DescriptorProto) IsExtendable() bool { return len(msg.GetExtensionRange()) > 0 } func (desc *FileDescriptorSet) FindExtension(packageName string, typeName string, fieldName string) (extPackageName string, field *FieldDescriptorProto) { parent := desc.GetMessage(packageName, typeName) if parent == nil { return "", nil } if !parent.IsExtendable() { return "", nil } extendee := "." + packageName + "." + typeName for _, file := range desc.GetFile() { for _, ext := range file.GetExtension() { if strings.Map(dotToUnderscore, file.GetPackage()) == strings.Map(dotToUnderscore, packageName) { if !(ext.GetExtendee() == typeName || ext.GetExtendee() == extendee) { continue } } else { if ext.GetExtendee() != extendee { continue } } if ext.GetName() == fieldName { return file.GetPackage(), ext } } } return "", nil } func (desc *FileDescriptorSet) FindExtensionByFieldNumber(packageName string, typeName string, fieldNum int32) (extPackageName string, field *FieldDescriptorProto) { parent := desc.GetMessage(packageName, typeName) if parent == nil { return "", nil } if !parent.IsExtendable() { return "", nil } extendee := "." + packageName + "." + typeName for _, file := range desc.GetFile() { for _, ext := range file.GetExtension() { if strings.Map(dotToUnderscore, file.GetPackage()) == strings.Map(dotToUnderscore, packageName) { if !(ext.GetExtendee() == typeName || ext.GetExtendee() == extendee) { continue } } else { if ext.GetExtendee() != extendee { continue } } if ext.GetNumber() == fieldNum { return file.GetPackage(), ext } } } return "", nil } func (desc *FileDescriptorSet) FindMessage(packageName string, typeName string, fieldName string) (msgPackageName string, msgName string) { parent := desc.GetMessage(packageName, typeName) if parent == nil { return "", "" } field := parent.GetFieldDescriptor(fieldName) if field == nil { var extPackageName string extPackageName, field = desc.FindExtension(packageName, typeName, fieldName) if field == nil { return "", "" } packageName = extPackageName } typeNames := strings.Split(field.GetTypeName(), ".") if len(typeNames) == 1 { msg := desc.GetMessage(packageName, typeName) if msg == nil { return "", "" } return packageName, msg.GetName() } if len(typeNames) > 2 { for i := 1; i < len(typeNames)-1; i++ { packageName = strings.Join(typeNames[1:len(typeNames)-i], ".") typeName = strings.Join(typeNames[len(typeNames)-i:], ".") msg := desc.GetMessage(packageName, typeName) if msg != nil { typeNames := strings.Split(msg.GetName(), ".") if len(typeNames) == 1 { return packageName, msg.GetName() } return strings.Join(typeNames[1:len(typeNames)-1], "."), typeNames[len(typeNames)-1] } } } return "", "" } func (msg *DescriptorProto) GetFieldDescriptor(fieldName string) *FieldDescriptorProto { for _, field := range msg.GetField() { if field.GetName() == fieldName { return field } } return nil } func (desc *FileDescriptorSet) GetEnum(packageName string, typeName string) *EnumDescriptorProto { for _, file := range desc.GetFile() { if strings.Map(dotToUnderscore, file.GetPackage()) != strings.Map(dotToUnderscore, packageName) { continue } for _, enum := range file.GetEnumType() { if enum.GetName() == typeName { return enum } } } return nil } func (f *FieldDescriptorProto) IsEnum() bool { return *f.Type == FieldDescriptorProto_TYPE_ENUM } func (f *FieldDescriptorProto) IsMessage() bool { return *f.Type == FieldDescriptorProto_TYPE_MESSAGE } func (f *FieldDescriptorProto) IsBytes() bool { return *f.Type == FieldDescriptorProto_TYPE_BYTES } func (f *FieldDescriptorProto) IsRepeated() bool { return f.Label != nil && *f.Label == FieldDescriptorProto_LABEL_REPEATED } func (f *FieldDescriptorProto) IsString() bool { return *f.Type == FieldDescriptorProto_TYPE_STRING } func (f *FieldDescriptorProto) IsBool() bool { return *f.Type == FieldDescriptorProto_TYPE_BOOL } func (f *FieldDescriptorProto) IsRequired() bool { return f.Label != nil && *f.Label == FieldDescriptorProto_LABEL_REQUIRED } func (f *FieldDescriptorProto) IsPacked() bool { return f.Options != nil && f.GetOptions().GetPacked() } func (f *FieldDescriptorProto) IsPacked3() bool { if f.IsRepeated() && f.IsScalar() { if f.Options == nil || f.GetOptions().Packed == nil { return true } return f.Options != nil && f.GetOptions().GetPacked() } return false } func (m *DescriptorProto) HasExtension() bool { return len(m.ExtensionRange) > 0 } ================================================ FILE: vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go ================================================ // Protocol Buffers for Go with Gadgets // // Copyright (c) 2013, The GoGo Authors. All rights reserved. // http://github.com/gogo/protobuf // // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package sortkeys import ( "sort" ) func Strings(l []string) { sort.Strings(l) } func Float64s(l []float64) { sort.Float64s(l) } func Float32s(l []float32) { sort.Sort(Float32Slice(l)) } func Int64s(l []int64) { sort.Sort(Int64Slice(l)) } func Int32s(l []int32) { sort.Sort(Int32Slice(l)) } func Uint64s(l []uint64) { sort.Sort(Uint64Slice(l)) } func Uint32s(l []uint32) { sort.Sort(Uint32Slice(l)) } func Bools(l []bool) { sort.Sort(BoolSlice(l)) } type BoolSlice []bool func (p BoolSlice) Len() int { return len(p) } func (p BoolSlice) Less(i, j int) bool { return p[j] } func (p BoolSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } type Int64Slice []int64 func (p Int64Slice) Len() int { return len(p) } func (p Int64Slice) Less(i, j int) bool { return p[i] < p[j] } func (p Int64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } type Int32Slice []int32 func (p Int32Slice) Len() int { return len(p) } func (p Int32Slice) Less(i, j int) bool { return p[i] < p[j] } func (p Int32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } type Uint64Slice []uint64 func (p Uint64Slice) Len() int { return len(p) } func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } type Uint32Slice []uint32 func (p Uint32Slice) Len() int { return len(p) } func (p Uint32Slice) Less(i, j int) bool { return p[i] < p[j] } func (p Uint32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } type Float32Slice []float32 func (p Float32Slice) Len() int { return len(p) } func (p Float32Slice) Less(i, j int) bool { return p[i] < p[j] } func (p Float32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } ================================================ FILE: vendor/github.com/golang/glog/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/golang/glog/README ================================================ glog ==== Leveled execution logs for Go. This is an efficient pure Go implementation of leveled logs in the manner of the open source C++ package https://github.com/google/glog By binding methods to booleans it is possible to use the log package without paying the expense of evaluating the arguments to the log. Through the -vmodule flag, the package also provides fine-grained control over logging at the file level. The comment from glog.go introduces the ideas: Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. It provides functions Info, Warning, Error, Fatal, plus formatting variants such as Infof. It also provides V-style logging controlled by the -v and -vmodule=file=2 flags. Basic examples: glog.Info("Prepare to repel boarders") glog.Fatalf("Initialization failed: %s", err) See the documentation for the V function for an explanation of these examples: if glog.V(2) { glog.Info("Starting transaction...") } glog.V(2).Infoln("Processed", nItems, "elements") The repository contains an open source version of the log package used inside Google. The master copy of the source lives inside Google, not here. The code in this repo is for export only and is not itself under development. Feature requests will be ignored. Send bug reports to golang-nuts@googlegroups.com. ================================================ FILE: vendor/github.com/golang/glog/glog.go ================================================ // Go support for leveled logs, analogous to https://code.google.com/p/google-glog/ // // Copyright 2013 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. // It provides functions Info, Warning, Error, Fatal, plus formatting variants such as // Infof. It also provides V-style logging controlled by the -v and -vmodule=file=2 flags. // // Basic examples: // // glog.Info("Prepare to repel boarders") // // glog.Fatalf("Initialization failed: %s", err) // // See the documentation for the V function for an explanation of these examples: // // if glog.V(2) { // glog.Info("Starting transaction...") // } // // glog.V(2).Infoln("Processed", nItems, "elements") // // Log output is buffered and written periodically using Flush. Programs // should call Flush before exiting to guarantee all log output is written. // // By default, all log statements write to files in a temporary directory. // This package provides several flags that modify this behavior. // As a result, flag.Parse must be called before any logging is done. // // -logtostderr=false // Logs are written to standard error instead of to files. // -alsologtostderr=false // Logs are written to standard error as well as to files. // -stderrthreshold=ERROR // Log events at or above this severity are logged to standard // error as well as to files. // -log_dir="" // Log files will be written to this directory instead of the // default temporary directory. // // Other flags provide aids to debugging. // // -log_backtrace_at="" // When set to a file and line number holding a logging statement, // such as // -log_backtrace_at=gopherflakes.go:234 // a stack trace will be written to the Info log whenever execution // hits that statement. (Unlike with -vmodule, the ".go" must be // present.) // -v=0 // Enable V-leveled logging at the specified level. // -vmodule="" // The syntax of the argument is a comma-separated list of pattern=N, // where pattern is a literal file name (minus the ".go" suffix) or // "glob" pattern and N is a V level. For instance, // -vmodule=gopher*=3 // sets the V level to 3 in all Go files whose names begin "gopher". // package glog import ( "bufio" "bytes" "errors" "flag" "fmt" "io" stdLog "log" "os" "path/filepath" "runtime" "strconv" "strings" "sync" "sync/atomic" "time" ) // severity identifies the sort of log: info, warning etc. It also implements // the flag.Value interface. The -stderrthreshold flag is of type severity and // should be modified only through the flag.Value interface. The values match // the corresponding constants in C++. type severity int32 // sync/atomic int32 // These constants identify the log levels in order of increasing severity. // A message written to a high-severity log file is also written to each // lower-severity log file. const ( infoLog severity = iota warningLog errorLog fatalLog numSeverity = 4 ) const severityChar = "IWEF" var severityName = []string{ infoLog: "INFO", warningLog: "WARNING", errorLog: "ERROR", fatalLog: "FATAL", } // get returns the value of the severity. func (s *severity) get() severity { return severity(atomic.LoadInt32((*int32)(s))) } // set sets the value of the severity. func (s *severity) set(val severity) { atomic.StoreInt32((*int32)(s), int32(val)) } // String is part of the flag.Value interface. func (s *severity) String() string { return strconv.FormatInt(int64(*s), 10) } // Get is part of the flag.Value interface. func (s *severity) Get() interface{} { return *s } // Set is part of the flag.Value interface. func (s *severity) Set(value string) error { var threshold severity // Is it a known name? if v, ok := severityByName(value); ok { threshold = v } else { v, err := strconv.Atoi(value) if err != nil { return err } threshold = severity(v) } logging.stderrThreshold.set(threshold) return nil } func severityByName(s string) (severity, bool) { s = strings.ToUpper(s) for i, name := range severityName { if name == s { return severity(i), true } } return 0, false } // OutputStats tracks the number of output lines and bytes written. type OutputStats struct { lines int64 bytes int64 } // Lines returns the number of lines written. func (s *OutputStats) Lines() int64 { return atomic.LoadInt64(&s.lines) } // Bytes returns the number of bytes written. func (s *OutputStats) Bytes() int64 { return atomic.LoadInt64(&s.bytes) } // Stats tracks the number of lines of output and number of bytes // per severity level. Values must be read with atomic.LoadInt64. var Stats struct { Info, Warning, Error OutputStats } var severityStats = [numSeverity]*OutputStats{ infoLog: &Stats.Info, warningLog: &Stats.Warning, errorLog: &Stats.Error, } // Level is exported because it appears in the arguments to V and is // the type of the v flag, which can be set programmatically. // It's a distinct type because we want to discriminate it from logType. // Variables of type level are only changed under logging.mu. // The -v flag is read only with atomic ops, so the state of the logging // module is consistent. // Level is treated as a sync/atomic int32. // Level specifies a level of verbosity for V logs. *Level implements // flag.Value; the -v flag is of type Level and should be modified // only through the flag.Value interface. type Level int32 // get returns the value of the Level. func (l *Level) get() Level { return Level(atomic.LoadInt32((*int32)(l))) } // set sets the value of the Level. func (l *Level) set(val Level) { atomic.StoreInt32((*int32)(l), int32(val)) } // String is part of the flag.Value interface. func (l *Level) String() string { return strconv.FormatInt(int64(*l), 10) } // Get is part of the flag.Value interface. func (l *Level) Get() interface{} { return *l } // Set is part of the flag.Value interface. func (l *Level) Set(value string) error { v, err := strconv.Atoi(value) if err != nil { return err } logging.mu.Lock() defer logging.mu.Unlock() logging.setVState(Level(v), logging.vmodule.filter, false) return nil } // moduleSpec represents the setting of the -vmodule flag. type moduleSpec struct { filter []modulePat } // modulePat contains a filter for the -vmodule flag. // It holds a verbosity level and a file pattern to match. type modulePat struct { pattern string literal bool // The pattern is a literal string level Level } // match reports whether the file matches the pattern. It uses a string // comparison if the pattern contains no metacharacters. func (m *modulePat) match(file string) bool { if m.literal { return file == m.pattern } match, _ := filepath.Match(m.pattern, file) return match } func (m *moduleSpec) String() string { // Lock because the type is not atomic. TODO: clean this up. logging.mu.Lock() defer logging.mu.Unlock() var b bytes.Buffer for i, f := range m.filter { if i > 0 { b.WriteRune(',') } fmt.Fprintf(&b, "%s=%d", f.pattern, f.level) } return b.String() } // Get is part of the (Go 1.2) flag.Getter interface. It always returns nil for this flag type since the // struct is not exported. func (m *moduleSpec) Get() interface{} { return nil } var errVmoduleSyntax = errors.New("syntax error: expect comma-separated list of filename=N") // Syntax: -vmodule=recordio=2,file=1,gfs*=3 func (m *moduleSpec) Set(value string) error { var filter []modulePat for _, pat := range strings.Split(value, ",") { if len(pat) == 0 { // Empty strings such as from a trailing comma can be ignored. continue } patLev := strings.Split(pat, "=") if len(patLev) != 2 || len(patLev[0]) == 0 || len(patLev[1]) == 0 { return errVmoduleSyntax } pattern := patLev[0] v, err := strconv.Atoi(patLev[1]) if err != nil { return errors.New("syntax error: expect comma-separated list of filename=N") } if v < 0 { return errors.New("negative value for vmodule level") } if v == 0 { continue // Ignore. It's harmless but no point in paying the overhead. } // TODO: check syntax of filter? filter = append(filter, modulePat{pattern, isLiteral(pattern), Level(v)}) } logging.mu.Lock() defer logging.mu.Unlock() logging.setVState(logging.verbosity, filter, true) return nil } // isLiteral reports whether the pattern is a literal string, that is, has no metacharacters // that require filepath.Match to be called to match the pattern. func isLiteral(pattern string) bool { return !strings.ContainsAny(pattern, `\*?[]`) } // traceLocation represents the setting of the -log_backtrace_at flag. type traceLocation struct { file string line int } // isSet reports whether the trace location has been specified. // logging.mu is held. func (t *traceLocation) isSet() bool { return t.line > 0 } // match reports whether the specified file and line matches the trace location. // The argument file name is the full path, not the basename specified in the flag. // logging.mu is held. func (t *traceLocation) match(file string, line int) bool { if t.line != line { return false } if i := strings.LastIndex(file, "/"); i >= 0 { file = file[i+1:] } return t.file == file } func (t *traceLocation) String() string { // Lock because the type is not atomic. TODO: clean this up. logging.mu.Lock() defer logging.mu.Unlock() return fmt.Sprintf("%s:%d", t.file, t.line) } // Get is part of the (Go 1.2) flag.Getter interface. It always returns nil for this flag type since the // struct is not exported func (t *traceLocation) Get() interface{} { return nil } var errTraceSyntax = errors.New("syntax error: expect file.go:234") // Syntax: -log_backtrace_at=gopherflakes.go:234 // Note that unlike vmodule the file extension is included here. func (t *traceLocation) Set(value string) error { if value == "" { // Unset. t.line = 0 t.file = "" } fields := strings.Split(value, ":") if len(fields) != 2 { return errTraceSyntax } file, line := fields[0], fields[1] if !strings.Contains(file, ".") { return errTraceSyntax } v, err := strconv.Atoi(line) if err != nil { return errTraceSyntax } if v <= 0 { return errors.New("negative or zero value for level") } logging.mu.Lock() defer logging.mu.Unlock() t.line = v t.file = file return nil } // flushSyncWriter is the interface satisfied by logging destinations. type flushSyncWriter interface { Flush() error Sync() error io.Writer } func init() { flag.BoolVar(&logging.toStderr, "logtostderr", false, "log to standard error instead of files") flag.BoolVar(&logging.alsoToStderr, "alsologtostderr", false, "log to standard error as well as files") flag.Var(&logging.verbosity, "v", "log level for V logs") flag.Var(&logging.stderrThreshold, "stderrthreshold", "logs at or above this threshold go to stderr") flag.Var(&logging.vmodule, "vmodule", "comma-separated list of pattern=N settings for file-filtered logging") flag.Var(&logging.traceLocation, "log_backtrace_at", "when logging hits line file:N, emit a stack trace") // Default stderrThreshold is ERROR. logging.stderrThreshold = errorLog logging.setVState(0, nil, false) go logging.flushDaemon() } // Flush flushes all pending log I/O. func Flush() { logging.lockAndFlushAll() } // loggingT collects all the global state of the logging setup. type loggingT struct { // Boolean flags. Not handled atomically because the flag.Value interface // does not let us avoid the =true, and that shorthand is necessary for // compatibility. TODO: does this matter enough to fix? Seems unlikely. toStderr bool // The -logtostderr flag. alsoToStderr bool // The -alsologtostderr flag. // Level flag. Handled atomically. stderrThreshold severity // The -stderrthreshold flag. // freeList is a list of byte buffers, maintained under freeListMu. freeList *buffer // freeListMu maintains the free list. It is separate from the main mutex // so buffers can be grabbed and printed to without holding the main lock, // for better parallelization. freeListMu sync.Mutex // mu protects the remaining elements of this structure and is // used to synchronize logging. mu sync.Mutex // file holds writer for each of the log types. file [numSeverity]flushSyncWriter // pcs is used in V to avoid an allocation when computing the caller's PC. pcs [1]uintptr // vmap is a cache of the V Level for each V() call site, identified by PC. // It is wiped whenever the vmodule flag changes state. vmap map[uintptr]Level // filterLength stores the length of the vmodule filter chain. If greater // than zero, it means vmodule is enabled. It may be read safely // using sync.LoadInt32, but is only modified under mu. filterLength int32 // traceLocation is the state of the -log_backtrace_at flag. traceLocation traceLocation // These flags are modified only under lock, although verbosity may be fetched // safely using atomic.LoadInt32. vmodule moduleSpec // The state of the -vmodule flag. verbosity Level // V logging level, the value of the -v flag/ } // buffer holds a byte Buffer for reuse. The zero value is ready for use. type buffer struct { bytes.Buffer tmp [64]byte // temporary byte array for creating headers. next *buffer } var logging loggingT // setVState sets a consistent state for V logging. // l.mu is held. func (l *loggingT) setVState(verbosity Level, filter []modulePat, setFilter bool) { // Turn verbosity off so V will not fire while we are in transition. logging.verbosity.set(0) // Ditto for filter length. atomic.StoreInt32(&logging.filterLength, 0) // Set the new filters and wipe the pc->Level map if the filter has changed. if setFilter { logging.vmodule.filter = filter logging.vmap = make(map[uintptr]Level) } // Things are consistent now, so enable filtering and verbosity. // They are enabled in order opposite to that in V. atomic.StoreInt32(&logging.filterLength, int32(len(filter))) logging.verbosity.set(verbosity) } // getBuffer returns a new, ready-to-use buffer. func (l *loggingT) getBuffer() *buffer { l.freeListMu.Lock() b := l.freeList if b != nil { l.freeList = b.next } l.freeListMu.Unlock() if b == nil { b = new(buffer) } else { b.next = nil b.Reset() } return b } // putBuffer returns a buffer to the free list. func (l *loggingT) putBuffer(b *buffer) { if b.Len() >= 256 { // Let big buffers die a natural death. return } l.freeListMu.Lock() b.next = l.freeList l.freeList = b l.freeListMu.Unlock() } var timeNow = time.Now // Stubbed out for testing. /* header formats a log header as defined by the C++ implementation. It returns a buffer containing the formatted header and the user's file and line number. The depth specifies how many stack frames above lives the source line to be identified in the log message. Log lines have this form: Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg... where the fields are defined as follows: L A single character, representing the log level (eg 'I' for INFO) mm The month (zero padded; ie May is '05') dd The day (zero padded) hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds threadid The space-padded thread ID as returned by GetTID() file The file name line The line number msg The user-supplied message */ func (l *loggingT) header(s severity, depth int) (*buffer, string, int) { _, file, line, ok := runtime.Caller(3 + depth) if !ok { file = "???" line = 1 } else { slash := strings.LastIndex(file, "/") if slash >= 0 { file = file[slash+1:] } } return l.formatHeader(s, file, line), file, line } // formatHeader formats a log header using the provided file name and line number. func (l *loggingT) formatHeader(s severity, file string, line int) *buffer { now := timeNow() if line < 0 { line = 0 // not a real line number, but acceptable to someDigits } if s > fatalLog { s = infoLog // for safety. } buf := l.getBuffer() // Avoid Fprintf, for speed. The format is so simple that we can do it quickly by hand. // It's worth about 3X. Fprintf is hard. _, month, day := now.Date() hour, minute, second := now.Clock() // Lmmdd hh:mm:ss.uuuuuu threadid file:line] buf.tmp[0] = severityChar[s] buf.twoDigits(1, int(month)) buf.twoDigits(3, day) buf.tmp[5] = ' ' buf.twoDigits(6, hour) buf.tmp[8] = ':' buf.twoDigits(9, minute) buf.tmp[11] = ':' buf.twoDigits(12, second) buf.tmp[14] = '.' buf.nDigits(6, 15, now.Nanosecond()/1000, '0') buf.tmp[21] = ' ' buf.nDigits(7, 22, pid, ' ') // TODO: should be TID buf.tmp[29] = ' ' buf.Write(buf.tmp[:30]) buf.WriteString(file) buf.tmp[0] = ':' n := buf.someDigits(1, line) buf.tmp[n+1] = ']' buf.tmp[n+2] = ' ' buf.Write(buf.tmp[:n+3]) return buf } // Some custom tiny helper functions to print the log header efficiently. const digits = "0123456789" // twoDigits formats a zero-prefixed two-digit integer at buf.tmp[i]. func (buf *buffer) twoDigits(i, d int) { buf.tmp[i+1] = digits[d%10] d /= 10 buf.tmp[i] = digits[d%10] } // nDigits formats an n-digit integer at buf.tmp[i], // padding with pad on the left. // It assumes d >= 0. func (buf *buffer) nDigits(n, i, d int, pad byte) { j := n - 1 for ; j >= 0 && d > 0; j-- { buf.tmp[i+j] = digits[d%10] d /= 10 } for ; j >= 0; j-- { buf.tmp[i+j] = pad } } // someDigits formats a zero-prefixed variable-width integer at buf.tmp[i]. func (buf *buffer) someDigits(i, d int) int { // Print into the top, then copy down. We know there's space for at least // a 10-digit number. j := len(buf.tmp) for { j-- buf.tmp[j] = digits[d%10] d /= 10 if d == 0 { break } } return copy(buf.tmp[i:], buf.tmp[j:]) } func (l *loggingT) println(s severity, args ...interface{}) { buf, file, line := l.header(s, 0) fmt.Fprintln(buf, args...) l.output(s, buf, file, line, false) } func (l *loggingT) print(s severity, args ...interface{}) { l.printDepth(s, 1, args...) } func (l *loggingT) printDepth(s severity, depth int, args ...interface{}) { buf, file, line := l.header(s, depth) fmt.Fprint(buf, args...) if buf.Bytes()[buf.Len()-1] != '\n' { buf.WriteByte('\n') } l.output(s, buf, file, line, false) } func (l *loggingT) printf(s severity, format string, args ...interface{}) { buf, file, line := l.header(s, 0) fmt.Fprintf(buf, format, args...) if buf.Bytes()[buf.Len()-1] != '\n' { buf.WriteByte('\n') } l.output(s, buf, file, line, false) } // printWithFileLine behaves like print but uses the provided file and line number. If // alsoLogToStderr is true, the log message always appears on standard error; it // will also appear in the log file unless --logtostderr is set. func (l *loggingT) printWithFileLine(s severity, file string, line int, alsoToStderr bool, args ...interface{}) { buf := l.formatHeader(s, file, line) fmt.Fprint(buf, args...) if buf.Bytes()[buf.Len()-1] != '\n' { buf.WriteByte('\n') } l.output(s, buf, file, line, alsoToStderr) } // output writes the data to the log files and releases the buffer. func (l *loggingT) output(s severity, buf *buffer, file string, line int, alsoToStderr bool) { l.mu.Lock() if l.traceLocation.isSet() { if l.traceLocation.match(file, line) { buf.Write(stacks(false)) } } data := buf.Bytes() if !flag.Parsed() { os.Stderr.Write([]byte("ERROR: logging before flag.Parse: ")) os.Stderr.Write(data) } else if l.toStderr { os.Stderr.Write(data) } else { if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() { os.Stderr.Write(data) } if l.file[s] == nil { if err := l.createFiles(s); err != nil { os.Stderr.Write(data) // Make sure the message appears somewhere. l.exit(err) } } switch s { case fatalLog: l.file[fatalLog].Write(data) fallthrough case errorLog: l.file[errorLog].Write(data) fallthrough case warningLog: l.file[warningLog].Write(data) fallthrough case infoLog: l.file[infoLog].Write(data) } } if s == fatalLog { // If we got here via Exit rather than Fatal, print no stacks. if atomic.LoadUint32(&fatalNoStacks) > 0 { l.mu.Unlock() timeoutFlush(10 * time.Second) os.Exit(1) } // Dump all goroutine stacks before exiting. // First, make sure we see the trace for the current goroutine on standard error. // If -logtostderr has been specified, the loop below will do that anyway // as the first stack in the full dump. if !l.toStderr { os.Stderr.Write(stacks(false)) } // Write the stack trace for all goroutines to the files. trace := stacks(true) logExitFunc = func(error) {} // If we get a write error, we'll still exit below. for log := fatalLog; log >= infoLog; log-- { if f := l.file[log]; f != nil { // Can be nil if -logtostderr is set. f.Write(trace) } } l.mu.Unlock() timeoutFlush(10 * time.Second) os.Exit(255) // C++ uses -1, which is silly because it's anded with 255 anyway. } l.putBuffer(buf) l.mu.Unlock() if stats := severityStats[s]; stats != nil { atomic.AddInt64(&stats.lines, 1) atomic.AddInt64(&stats.bytes, int64(len(data))) } } // timeoutFlush calls Flush and returns when it completes or after timeout // elapses, whichever happens first. This is needed because the hooks invoked // by Flush may deadlock when glog.Fatal is called from a hook that holds // a lock. func timeoutFlush(timeout time.Duration) { done := make(chan bool, 1) go func() { Flush() // calls logging.lockAndFlushAll() done <- true }() select { case <-done: case <-time.After(timeout): fmt.Fprintln(os.Stderr, "glog: Flush took longer than", timeout) } } // stacks is a wrapper for runtime.Stack that attempts to recover the data for all goroutines. func stacks(all bool) []byte { // We don't know how big the traces are, so grow a few times if they don't fit. Start large, though. n := 10000 if all { n = 100000 } var trace []byte for i := 0; i < 5; i++ { trace = make([]byte, n) nbytes := runtime.Stack(trace, all) if nbytes < len(trace) { return trace[:nbytes] } n *= 2 } return trace } // logExitFunc provides a simple mechanism to override the default behavior // of exiting on error. Used in testing and to guarantee we reach a required exit // for fatal logs. Instead, exit could be a function rather than a method but that // would make its use clumsier. var logExitFunc func(error) // exit is called if there is trouble creating or writing log files. // It flushes the logs and exits the program; there's no point in hanging around. // l.mu is held. func (l *loggingT) exit(err error) { fmt.Fprintf(os.Stderr, "log: exiting because of error: %s\n", err) // If logExitFunc is set, we do that instead of exiting. if logExitFunc != nil { logExitFunc(err) return } l.flushAll() os.Exit(2) } // syncBuffer joins a bufio.Writer to its underlying file, providing access to the // file's Sync method and providing a wrapper for the Write method that provides log // file rotation. There are conflicting methods, so the file cannot be embedded. // l.mu is held for all its methods. type syncBuffer struct { logger *loggingT *bufio.Writer file *os.File sev severity nbytes uint64 // The number of bytes written to this file } func (sb *syncBuffer) Sync() error { return sb.file.Sync() } func (sb *syncBuffer) Write(p []byte) (n int, err error) { if sb.nbytes+uint64(len(p)) >= MaxSize { if err := sb.rotateFile(time.Now()); err != nil { sb.logger.exit(err) } } n, err = sb.Writer.Write(p) sb.nbytes += uint64(n) if err != nil { sb.logger.exit(err) } return } // rotateFile closes the syncBuffer's file and starts a new one. func (sb *syncBuffer) rotateFile(now time.Time) error { if sb.file != nil { sb.Flush() sb.file.Close() } var err error sb.file, _, err = create(severityName[sb.sev], now) sb.nbytes = 0 if err != nil { return err } sb.Writer = bufio.NewWriterSize(sb.file, bufferSize) // Write header. var buf bytes.Buffer fmt.Fprintf(&buf, "Log file created at: %s\n", now.Format("2006/01/02 15:04:05")) fmt.Fprintf(&buf, "Running on machine: %s\n", host) fmt.Fprintf(&buf, "Binary: Built with %s %s for %s/%s\n", runtime.Compiler, runtime.Version(), runtime.GOOS, runtime.GOARCH) fmt.Fprintf(&buf, "Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg\n") n, err := sb.file.Write(buf.Bytes()) sb.nbytes += uint64(n) return err } // bufferSize sizes the buffer associated with each log file. It's large // so that log records can accumulate without the logging thread blocking // on disk I/O. The flushDaemon will block instead. const bufferSize = 256 * 1024 // createFiles creates all the log files for severity from sev down to infoLog. // l.mu is held. func (l *loggingT) createFiles(sev severity) error { now := time.Now() // Files are created in decreasing severity order, so as soon as we find one // has already been created, we can stop. for s := sev; s >= infoLog && l.file[s] == nil; s-- { sb := &syncBuffer{ logger: l, sev: s, } if err := sb.rotateFile(now); err != nil { return err } l.file[s] = sb } return nil } const flushInterval = 30 * time.Second // flushDaemon periodically flushes the log file buffers. func (l *loggingT) flushDaemon() { for _ = range time.NewTicker(flushInterval).C { l.lockAndFlushAll() } } // lockAndFlushAll is like flushAll but locks l.mu first. func (l *loggingT) lockAndFlushAll() { l.mu.Lock() l.flushAll() l.mu.Unlock() } // flushAll flushes all the logs and attempts to "sync" their data to disk. // l.mu is held. func (l *loggingT) flushAll() { // Flush from fatal down, in case there's trouble flushing. for s := fatalLog; s >= infoLog; s-- { file := l.file[s] if file != nil { file.Flush() // ignore error file.Sync() // ignore error } } } // CopyStandardLogTo arranges for messages written to the Go "log" package's // default logs to also appear in the Google logs for the named and lower // severities. Subsequent changes to the standard log's default output location // or format may break this behavior. // // Valid names are "INFO", "WARNING", "ERROR", and "FATAL". If the name is not // recognized, CopyStandardLogTo panics. func CopyStandardLogTo(name string) { sev, ok := severityByName(name) if !ok { panic(fmt.Sprintf("log.CopyStandardLogTo(%q): unrecognized severity name", name)) } // Set a log format that captures the user's file and line: // d.go:23: message stdLog.SetFlags(stdLog.Lshortfile) stdLog.SetOutput(logBridge(sev)) } // logBridge provides the Write method that enables CopyStandardLogTo to connect // Go's standard logs to the logs provided by this package. type logBridge severity // Write parses the standard logging line and passes its components to the // logger for severity(lb). func (lb logBridge) Write(b []byte) (n int, err error) { var ( file = "???" line = 1 text string ) // Split "d.go:23: message" into "d.go", "23", and "message". if parts := bytes.SplitN(b, []byte{':'}, 3); len(parts) != 3 || len(parts[0]) < 1 || len(parts[2]) < 1 { text = fmt.Sprintf("bad log format: %s", b) } else { file = string(parts[0]) text = string(parts[2][1:]) // skip leading space line, err = strconv.Atoi(string(parts[1])) if err != nil { text = fmt.Sprintf("bad line number: %s", b) line = 1 } } // printWithFileLine with alsoToStderr=true, so standard log messages // always appear on standard error. logging.printWithFileLine(severity(lb), file, line, true, text) return len(b), nil } // setV computes and remembers the V level for a given PC // when vmodule is enabled. // File pattern matching takes the basename of the file, stripped // of its .go suffix, and uses filepath.Match, which is a little more // general than the *? matching used in C++. // l.mu is held. func (l *loggingT) setV(pc uintptr) Level { fn := runtime.FuncForPC(pc) file, _ := fn.FileLine(pc) // The file is something like /a/b/c/d.go. We want just the d. if strings.HasSuffix(file, ".go") { file = file[:len(file)-3] } if slash := strings.LastIndex(file, "/"); slash >= 0 { file = file[slash+1:] } for _, filter := range l.vmodule.filter { if filter.match(file) { l.vmap[pc] = filter.level return filter.level } } l.vmap[pc] = 0 return 0 } // Verbose is a boolean type that implements Infof (like Printf) etc. // See the documentation of V for more information. type Verbose bool // V reports whether verbosity at the call site is at least the requested level. // The returned value is a boolean of type Verbose, which implements Info, Infoln // and Infof. These methods will write to the Info log if called. // Thus, one may write either // if glog.V(2) { glog.Info("log this") } // or // glog.V(2).Info("log this") // The second form is shorter but the first is cheaper if logging is off because it does // not evaluate its arguments. // // Whether an individual call to V generates a log record depends on the setting of // the -v and --vmodule flags; both are off by default. If the level in the call to // V is at least the value of -v, or of -vmodule for the source file containing the // call, the V call will log. func V(level Level) Verbose { // This function tries hard to be cheap unless there's work to do. // The fast path is two atomic loads and compares. // Here is a cheap but safe test to see if V logging is enabled globally. if logging.verbosity.get() >= level { return Verbose(true) } // It's off globally but it vmodule may still be set. // Here is another cheap but safe test to see if vmodule is enabled. if atomic.LoadInt32(&logging.filterLength) > 0 { // Now we need a proper lock to use the logging structure. The pcs field // is shared so we must lock before accessing it. This is fairly expensive, // but if V logging is enabled we're slow anyway. logging.mu.Lock() defer logging.mu.Unlock() if runtime.Callers(2, logging.pcs[:]) == 0 { return Verbose(false) } v, ok := logging.vmap[logging.pcs[0]] if !ok { v = logging.setV(logging.pcs[0]) } return Verbose(v >= level) } return Verbose(false) } // Info is equivalent to the global Info function, guarded by the value of v. // See the documentation of V for usage. func (v Verbose) Info(args ...interface{}) { if v { logging.print(infoLog, args...) } } // Infoln is equivalent to the global Infoln function, guarded by the value of v. // See the documentation of V for usage. func (v Verbose) Infoln(args ...interface{}) { if v { logging.println(infoLog, args...) } } // Infof is equivalent to the global Infof function, guarded by the value of v. // See the documentation of V for usage. func (v Verbose) Infof(format string, args ...interface{}) { if v { logging.printf(infoLog, format, args...) } } // Info logs to the INFO log. // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Info(args ...interface{}) { logging.print(infoLog, args...) } // InfoDepth acts as Info but uses depth to determine which call frame to log. // InfoDepth(0, "msg") is the same as Info("msg"). func InfoDepth(depth int, args ...interface{}) { logging.printDepth(infoLog, depth, args...) } // Infoln logs to the INFO log. // Arguments are handled in the manner of fmt.Println; a newline is appended if missing. func Infoln(args ...interface{}) { logging.println(infoLog, args...) } // Infof logs to the INFO log. // Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. func Infof(format string, args ...interface{}) { logging.printf(infoLog, format, args...) } // Warning logs to the WARNING and INFO logs. // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Warning(args ...interface{}) { logging.print(warningLog, args...) } // WarningDepth acts as Warning but uses depth to determine which call frame to log. // WarningDepth(0, "msg") is the same as Warning("msg"). func WarningDepth(depth int, args ...interface{}) { logging.printDepth(warningLog, depth, args...) } // Warningln logs to the WARNING and INFO logs. // Arguments are handled in the manner of fmt.Println; a newline is appended if missing. func Warningln(args ...interface{}) { logging.println(warningLog, args...) } // Warningf logs to the WARNING and INFO logs. // Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. func Warningf(format string, args ...interface{}) { logging.printf(warningLog, format, args...) } // Error logs to the ERROR, WARNING, and INFO logs. // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Error(args ...interface{}) { logging.print(errorLog, args...) } // ErrorDepth acts as Error but uses depth to determine which call frame to log. // ErrorDepth(0, "msg") is the same as Error("msg"). func ErrorDepth(depth int, args ...interface{}) { logging.printDepth(errorLog, depth, args...) } // Errorln logs to the ERROR, WARNING, and INFO logs. // Arguments are handled in the manner of fmt.Println; a newline is appended if missing. func Errorln(args ...interface{}) { logging.println(errorLog, args...) } // Errorf logs to the ERROR, WARNING, and INFO logs. // Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. func Errorf(format string, args ...interface{}) { logging.printf(errorLog, format, args...) } // Fatal logs to the FATAL, ERROR, WARNING, and INFO logs, // including a stack trace of all running goroutines, then calls os.Exit(255). // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Fatal(args ...interface{}) { logging.print(fatalLog, args...) } // FatalDepth acts as Fatal but uses depth to determine which call frame to log. // FatalDepth(0, "msg") is the same as Fatal("msg"). func FatalDepth(depth int, args ...interface{}) { logging.printDepth(fatalLog, depth, args...) } // Fatalln logs to the FATAL, ERROR, WARNING, and INFO logs, // including a stack trace of all running goroutines, then calls os.Exit(255). // Arguments are handled in the manner of fmt.Println; a newline is appended if missing. func Fatalln(args ...interface{}) { logging.println(fatalLog, args...) } // Fatalf logs to the FATAL, ERROR, WARNING, and INFO logs, // including a stack trace of all running goroutines, then calls os.Exit(255). // Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. func Fatalf(format string, args ...interface{}) { logging.printf(fatalLog, format, args...) } // fatalNoStacks is non-zero if we are to exit without dumping goroutine stacks. // It allows Exit and relatives to use the Fatal logs. var fatalNoStacks uint32 // Exit logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). // Arguments are handled in the manner of fmt.Print; a newline is appended if missing. func Exit(args ...interface{}) { atomic.StoreUint32(&fatalNoStacks, 1) logging.print(fatalLog, args...) } // ExitDepth acts as Exit but uses depth to determine which call frame to log. // ExitDepth(0, "msg") is the same as Exit("msg"). func ExitDepth(depth int, args ...interface{}) { atomic.StoreUint32(&fatalNoStacks, 1) logging.printDepth(fatalLog, depth, args...) } // Exitln logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). func Exitln(args ...interface{}) { atomic.StoreUint32(&fatalNoStacks, 1) logging.println(fatalLog, args...) } // Exitf logs to the FATAL, ERROR, WARNING, and INFO logs, then calls os.Exit(1). // Arguments are handled in the manner of fmt.Printf; a newline is appended if missing. func Exitf(format string, args ...interface{}) { atomic.StoreUint32(&fatalNoStacks, 1) logging.printf(fatalLog, format, args...) } ================================================ FILE: vendor/github.com/golang/glog/glog_file.go ================================================ // Go support for leveled logs, analogous to https://code.google.com/p/google-glog/ // // Copyright 2013 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // File I/O for logs. package glog import ( "errors" "flag" "fmt" "os" "os/user" "path/filepath" "strings" "sync" "time" ) // MaxSize is the maximum size of a log file in bytes. var MaxSize uint64 = 1024 * 1024 * 1800 // logDirs lists the candidate directories for new log files. var logDirs []string // If non-empty, overrides the choice of directory in which to write logs. // See createLogDirs for the full list of possible destinations. var logDir = flag.String("log_dir", "", "If non-empty, write log files in this directory") func createLogDirs() { if *logDir != "" { logDirs = append(logDirs, *logDir) } logDirs = append(logDirs, os.TempDir()) } var ( pid = os.Getpid() program = filepath.Base(os.Args[0]) host = "unknownhost" userName = "unknownuser" ) func init() { h, err := os.Hostname() if err == nil { host = shortHostname(h) } current, err := user.Current() if err == nil { userName = current.Username } // Sanitize userName since it may contain filepath separators on Windows. userName = strings.Replace(userName, `\`, "_", -1) } // shortHostname returns its argument, truncating at the first period. // For instance, given "www.google.com" it returns "www". func shortHostname(hostname string) string { if i := strings.Index(hostname, "."); i >= 0 { return hostname[:i] } return hostname } // logName returns a new log file name containing tag, with start time t, and // the name for the symlink for tag. func logName(tag string, t time.Time) (name, link string) { name = fmt.Sprintf("%s.%s.%s.log.%s.%04d%02d%02d-%02d%02d%02d.%d", program, host, userName, tag, t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), pid) return name, program + "." + tag } var onceLogDirs sync.Once // create creates a new log file and returns the file and its filename, which // contains tag ("INFO", "FATAL", etc.) and t. If the file is created // successfully, create also attempts to update the symlink for that tag, ignoring // errors. func create(tag string, t time.Time) (f *os.File, filename string, err error) { onceLogDirs.Do(createLogDirs) if len(logDirs) == 0 { return nil, "", errors.New("log: no log dirs") } name, link := logName(tag, t) var lastErr error for _, dir := range logDirs { fname := filepath.Join(dir, name) f, err := os.Create(fname) if err == nil { symlink := filepath.Join(dir, link) os.Remove(symlink) // ignore err os.Symlink(name, symlink) // ignore err return f, fname, nil } lastErr = err } return nil, "", fmt.Errorf("log: cannot create log: %v", lastErr) } ================================================ FILE: vendor/github.com/golang/protobuf/AUTHORS ================================================ # This source code refers to The Go Authors for copyright purposes. # The master list of authors is in the main Go distribution, # visible at http://tip.golang.org/AUTHORS. ================================================ FILE: vendor/github.com/golang/protobuf/CONTRIBUTORS ================================================ # This source code was written by the Go contributors. # The master list of contributors is in the main Go distribution, # visible at http://tip.golang.org/CONTRIBUTORS. ================================================ FILE: vendor/github.com/golang/protobuf/LICENSE ================================================ Copyright 2010 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/golang/protobuf/proto/clone.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2011 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Protocol buffer deep copy and merge. // TODO: RawMessage. package proto import ( "fmt" "log" "reflect" "strings" ) // Clone returns a deep copy of a protocol buffer. func Clone(src Message) Message { in := reflect.ValueOf(src) if in.IsNil() { return src } out := reflect.New(in.Type().Elem()) dst := out.Interface().(Message) Merge(dst, src) return dst } // Merger is the interface representing objects that can merge messages of the same type. type Merger interface { // Merge merges src into this message. // Required and optional fields that are set in src will be set to that value in dst. // Elements of repeated fields will be appended. // // Merge may panic if called with a different argument type than the receiver. Merge(src Message) } // generatedMerger is the custom merge method that generated protos will have. // We must add this method since a generate Merge method will conflict with // many existing protos that have a Merge data field already defined. type generatedMerger interface { XXX_Merge(src Message) } // Merge merges src into dst. // Required and optional fields that are set in src will be set to that value in dst. // Elements of repeated fields will be appended. // Merge panics if src and dst are not the same type, or if dst is nil. func Merge(dst, src Message) { if m, ok := dst.(Merger); ok { m.Merge(src) return } in := reflect.ValueOf(src) out := reflect.ValueOf(dst) if out.IsNil() { panic("proto: nil destination") } if in.Type() != out.Type() { panic(fmt.Sprintf("proto.Merge(%T, %T) type mismatch", dst, src)) } if in.IsNil() { return // Merge from nil src is a noop } if m, ok := dst.(generatedMerger); ok { m.XXX_Merge(src) return } mergeStruct(out.Elem(), in.Elem()) } func mergeStruct(out, in reflect.Value) { sprop := GetProperties(in.Type()) for i := 0; i < in.NumField(); i++ { f := in.Type().Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } mergeAny(out.Field(i), in.Field(i), false, sprop.Prop[i]) } if emIn, err := extendable(in.Addr().Interface()); err == nil { emOut, _ := extendable(out.Addr().Interface()) mIn, muIn := emIn.extensionsRead() if mIn != nil { mOut := emOut.extensionsWrite() muIn.Lock() mergeExtension(mOut, mIn) muIn.Unlock() } } uf := in.FieldByName("XXX_unrecognized") if !uf.IsValid() { return } uin := uf.Bytes() if len(uin) > 0 { out.FieldByName("XXX_unrecognized").SetBytes(append([]byte(nil), uin...)) } } // mergeAny performs a merge between two values of the same type. // viaPtr indicates whether the values were indirected through a pointer (implying proto2). // prop is set if this is a struct field (it may be nil). func mergeAny(out, in reflect.Value, viaPtr bool, prop *Properties) { if in.Type() == protoMessageType { if !in.IsNil() { if out.IsNil() { out.Set(reflect.ValueOf(Clone(in.Interface().(Message)))) } else { Merge(out.Interface().(Message), in.Interface().(Message)) } } return } switch in.Kind() { case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, reflect.String, reflect.Uint32, reflect.Uint64: if !viaPtr && isProto3Zero(in) { return } out.Set(in) case reflect.Interface: // Probably a oneof field; copy non-nil values. if in.IsNil() { return } // Allocate destination if it is not set, or set to a different type. // Otherwise we will merge as normal. if out.IsNil() || out.Elem().Type() != in.Elem().Type() { out.Set(reflect.New(in.Elem().Elem().Type())) // interface -> *T -> T -> new(T) } mergeAny(out.Elem(), in.Elem(), false, nil) case reflect.Map: if in.Len() == 0 { return } if out.IsNil() { out.Set(reflect.MakeMap(in.Type())) } // For maps with value types of *T or []byte we need to deep copy each value. elemKind := in.Type().Elem().Kind() for _, key := range in.MapKeys() { var val reflect.Value switch elemKind { case reflect.Ptr: val = reflect.New(in.Type().Elem().Elem()) mergeAny(val, in.MapIndex(key), false, nil) case reflect.Slice: val = in.MapIndex(key) val = reflect.ValueOf(append([]byte{}, val.Bytes()...)) default: val = in.MapIndex(key) } out.SetMapIndex(key, val) } case reflect.Ptr: if in.IsNil() { return } if out.IsNil() { out.Set(reflect.New(in.Elem().Type())) } mergeAny(out.Elem(), in.Elem(), true, nil) case reflect.Slice: if in.IsNil() { return } if in.Type().Elem().Kind() == reflect.Uint8 { // []byte is a scalar bytes field, not a repeated field. // Edge case: if this is in a proto3 message, a zero length // bytes field is considered the zero value, and should not // be merged. if prop != nil && prop.proto3 && in.Len() == 0 { return } // Make a deep copy. // Append to []byte{} instead of []byte(nil) so that we never end up // with a nil result. out.SetBytes(append([]byte{}, in.Bytes()...)) return } n := in.Len() if out.IsNil() { out.Set(reflect.MakeSlice(in.Type(), 0, n)) } switch in.Type().Elem().Kind() { case reflect.Bool, reflect.Float32, reflect.Float64, reflect.Int32, reflect.Int64, reflect.String, reflect.Uint32, reflect.Uint64: out.Set(reflect.AppendSlice(out, in)) default: for i := 0; i < n; i++ { x := reflect.Indirect(reflect.New(in.Type().Elem())) mergeAny(x, in.Index(i), false, nil) out.Set(reflect.Append(out, x)) } } case reflect.Struct: mergeStruct(out, in) default: // unknown type, so not a protocol buffer log.Printf("proto: don't know how to copy %v", in) } } func mergeExtension(out, in map[int32]Extension) { for extNum, eIn := range in { eOut := Extension{desc: eIn.desc} if eIn.value != nil { v := reflect.New(reflect.TypeOf(eIn.value)).Elem() mergeAny(v, reflect.ValueOf(eIn.value), false, nil) eOut.value = v.Interface() } if eIn.enc != nil { eOut.enc = make([]byte, len(eIn.enc)) copy(eOut.enc, eIn.enc) } out[extNum] = eOut } } ================================================ FILE: vendor/github.com/golang/protobuf/proto/decode.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto /* * Routines for decoding protocol buffer data to construct in-memory representations. */ import ( "errors" "fmt" "io" ) // errOverflow is returned when an integer is too large to be represented. var errOverflow = errors.New("proto: integer overflow") // ErrInternalBadWireType is returned by generated code when an incorrect // wire type is encountered. It does not get returned to user code. var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof") // DecodeVarint reads a varint-encoded integer from the slice. // It returns the integer and the number of bytes consumed, or // zero if there is not enough. // This is the format for the // int32, int64, uint32, uint64, bool, and enum // protocol buffer types. func DecodeVarint(buf []byte) (x uint64, n int) { for shift := uint(0); shift < 64; shift += 7 { if n >= len(buf) { return 0, 0 } b := uint64(buf[n]) n++ x |= (b & 0x7F) << shift if (b & 0x80) == 0 { return x, n } } // The number is too large to represent in a 64-bit value. return 0, 0 } func (p *Buffer) decodeVarintSlow() (x uint64, err error) { i := p.index l := len(p.buf) for shift := uint(0); shift < 64; shift += 7 { if i >= l { err = io.ErrUnexpectedEOF return } b := p.buf[i] i++ x |= (uint64(b) & 0x7F) << shift if b < 0x80 { p.index = i return } } // The number is too large to represent in a 64-bit value. err = errOverflow return } // DecodeVarint reads a varint-encoded integer from the Buffer. // This is the format for the // int32, int64, uint32, uint64, bool, and enum // protocol buffer types. func (p *Buffer) DecodeVarint() (x uint64, err error) { i := p.index buf := p.buf if i >= len(buf) { return 0, io.ErrUnexpectedEOF } else if buf[i] < 0x80 { p.index++ return uint64(buf[i]), nil } else if len(buf)-i < 10 { return p.decodeVarintSlow() } var b uint64 // we already checked the first byte x = uint64(buf[i]) - 0x80 i++ b = uint64(buf[i]) i++ x += b << 7 if b&0x80 == 0 { goto done } x -= 0x80 << 7 b = uint64(buf[i]) i++ x += b << 14 if b&0x80 == 0 { goto done } x -= 0x80 << 14 b = uint64(buf[i]) i++ x += b << 21 if b&0x80 == 0 { goto done } x -= 0x80 << 21 b = uint64(buf[i]) i++ x += b << 28 if b&0x80 == 0 { goto done } x -= 0x80 << 28 b = uint64(buf[i]) i++ x += b << 35 if b&0x80 == 0 { goto done } x -= 0x80 << 35 b = uint64(buf[i]) i++ x += b << 42 if b&0x80 == 0 { goto done } x -= 0x80 << 42 b = uint64(buf[i]) i++ x += b << 49 if b&0x80 == 0 { goto done } x -= 0x80 << 49 b = uint64(buf[i]) i++ x += b << 56 if b&0x80 == 0 { goto done } x -= 0x80 << 56 b = uint64(buf[i]) i++ x += b << 63 if b&0x80 == 0 { goto done } return 0, errOverflow done: p.index = i return x, nil } // DecodeFixed64 reads a 64-bit integer from the Buffer. // This is the format for the // fixed64, sfixed64, and double protocol buffer types. func (p *Buffer) DecodeFixed64() (x uint64, err error) { // x, err already 0 i := p.index + 8 if i < 0 || i > len(p.buf) { err = io.ErrUnexpectedEOF return } p.index = i x = uint64(p.buf[i-8]) x |= uint64(p.buf[i-7]) << 8 x |= uint64(p.buf[i-6]) << 16 x |= uint64(p.buf[i-5]) << 24 x |= uint64(p.buf[i-4]) << 32 x |= uint64(p.buf[i-3]) << 40 x |= uint64(p.buf[i-2]) << 48 x |= uint64(p.buf[i-1]) << 56 return } // DecodeFixed32 reads a 32-bit integer from the Buffer. // This is the format for the // fixed32, sfixed32, and float protocol buffer types. func (p *Buffer) DecodeFixed32() (x uint64, err error) { // x, err already 0 i := p.index + 4 if i < 0 || i > len(p.buf) { err = io.ErrUnexpectedEOF return } p.index = i x = uint64(p.buf[i-4]) x |= uint64(p.buf[i-3]) << 8 x |= uint64(p.buf[i-2]) << 16 x |= uint64(p.buf[i-1]) << 24 return } // DecodeZigzag64 reads a zigzag-encoded 64-bit integer // from the Buffer. // This is the format used for the sint64 protocol buffer type. func (p *Buffer) DecodeZigzag64() (x uint64, err error) { x, err = p.DecodeVarint() if err != nil { return } x = (x >> 1) ^ uint64((int64(x&1)<<63)>>63) return } // DecodeZigzag32 reads a zigzag-encoded 32-bit integer // from the Buffer. // This is the format used for the sint32 protocol buffer type. func (p *Buffer) DecodeZigzag32() (x uint64, err error) { x, err = p.DecodeVarint() if err != nil { return } x = uint64((uint32(x) >> 1) ^ uint32((int32(x&1)<<31)>>31)) return } // DecodeRawBytes reads a count-delimited byte buffer from the Buffer. // This is the format used for the bytes protocol buffer // type and for embedded messages. func (p *Buffer) DecodeRawBytes(alloc bool) (buf []byte, err error) { n, err := p.DecodeVarint() if err != nil { return nil, err } nb := int(n) if nb < 0 { return nil, fmt.Errorf("proto: bad byte length %d", nb) } end := p.index + nb if end < p.index || end > len(p.buf) { return nil, io.ErrUnexpectedEOF } if !alloc { // todo: check if can get more uses of alloc=false buf = p.buf[p.index:end] p.index += nb return } buf = make([]byte, nb) copy(buf, p.buf[p.index:]) p.index += nb return } // DecodeStringBytes reads an encoded string from the Buffer. // This is the format used for the proto2 string type. func (p *Buffer) DecodeStringBytes() (s string, err error) { buf, err := p.DecodeRawBytes(false) if err != nil { return } return string(buf), nil } // Unmarshaler is the interface representing objects that can // unmarshal themselves. The argument points to data that may be // overwritten, so implementations should not keep references to the // buffer. // Unmarshal implementations should not clear the receiver. // Any unmarshaled data should be merged into the receiver. // Callers of Unmarshal that do not want to retain existing data // should Reset the receiver before calling Unmarshal. type Unmarshaler interface { Unmarshal([]byte) error } // newUnmarshaler is the interface representing objects that can // unmarshal themselves. The semantics are identical to Unmarshaler. // // This exists to support protoc-gen-go generated messages. // The proto package will stop type-asserting to this interface in the future. // // DO NOT DEPEND ON THIS. type newUnmarshaler interface { XXX_Unmarshal([]byte) error } // Unmarshal parses the protocol buffer representation in buf and places the // decoded result in pb. If the struct underlying pb does not match // the data in buf, the results can be unpredictable. // // Unmarshal resets pb before starting to unmarshal, so any // existing data in pb is always removed. Use UnmarshalMerge // to preserve and append to existing data. func Unmarshal(buf []byte, pb Message) error { pb.Reset() if u, ok := pb.(newUnmarshaler); ok { return u.XXX_Unmarshal(buf) } if u, ok := pb.(Unmarshaler); ok { return u.Unmarshal(buf) } return NewBuffer(buf).Unmarshal(pb) } // UnmarshalMerge parses the protocol buffer representation in buf and // writes the decoded result to pb. If the struct underlying pb does not match // the data in buf, the results can be unpredictable. // // UnmarshalMerge merges into existing data in pb. // Most code should use Unmarshal instead. func UnmarshalMerge(buf []byte, pb Message) error { if u, ok := pb.(newUnmarshaler); ok { return u.XXX_Unmarshal(buf) } if u, ok := pb.(Unmarshaler); ok { // NOTE: The history of proto have unfortunately been inconsistent // whether Unmarshaler should or should not implicitly clear itself. // Some implementations do, most do not. // Thus, calling this here may or may not do what people want. // // See https://github.com/golang/protobuf/issues/424 return u.Unmarshal(buf) } return NewBuffer(buf).Unmarshal(pb) } // DecodeMessage reads a count-delimited message from the Buffer. func (p *Buffer) DecodeMessage(pb Message) error { enc, err := p.DecodeRawBytes(false) if err != nil { return err } return NewBuffer(enc).Unmarshal(pb) } // DecodeGroup reads a tag-delimited group from the Buffer. // StartGroup tag is already consumed. This function consumes // EndGroup tag. func (p *Buffer) DecodeGroup(pb Message) error { b := p.buf[p.index:] x, y := findEndGroup(b) if x < 0 { return io.ErrUnexpectedEOF } err := Unmarshal(b[:x], pb) p.index += y return err } // Unmarshal parses the protocol buffer representation in the // Buffer and places the decoded result in pb. If the struct // underlying pb does not match the data in the buffer, the results can be // unpredictable. // // Unlike proto.Unmarshal, this does not reset pb before starting to unmarshal. func (p *Buffer) Unmarshal(pb Message) error { // If the object can unmarshal itself, let it. if u, ok := pb.(newUnmarshaler); ok { err := u.XXX_Unmarshal(p.buf[p.index:]) p.index = len(p.buf) return err } if u, ok := pb.(Unmarshaler); ok { // NOTE: The history of proto have unfortunately been inconsistent // whether Unmarshaler should or should not implicitly clear itself. // Some implementations do, most do not. // Thus, calling this here may or may not do what people want. // // See https://github.com/golang/protobuf/issues/424 err := u.Unmarshal(p.buf[p.index:]) p.index = len(p.buf) return err } // Slow workaround for messages that aren't Unmarshalers. // This includes some hand-coded .pb.go files and // bootstrap protos. // TODO: fix all of those and then add Unmarshal to // the Message interface. Then: // The cast above and code below can be deleted. // The old unmarshaler can be deleted. // Clients can call Unmarshal directly (can already do that, actually). var info InternalMessageInfo err := info.Unmarshal(pb, p.buf[p.index:]) p.index = len(p.buf) return err } ================================================ FILE: vendor/github.com/golang/protobuf/proto/deprecated.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2018 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import "errors" // Deprecated: do not use. type Stats struct{ Emalloc, Dmalloc, Encode, Decode, Chit, Cmiss, Size uint64 } // Deprecated: do not use. func GetStats() Stats { return Stats{} } // Deprecated: do not use. func MarshalMessageSet(interface{}) ([]byte, error) { return nil, errors.New("proto: not implemented") } // Deprecated: do not use. func UnmarshalMessageSet([]byte, interface{}) error { return errors.New("proto: not implemented") } // Deprecated: do not use. func MarshalMessageSetJSON(interface{}) ([]byte, error) { return nil, errors.New("proto: not implemented") } // Deprecated: do not use. func UnmarshalMessageSetJSON([]byte, interface{}) error { return errors.New("proto: not implemented") } // Deprecated: do not use. func RegisterMessageSetType(Message, int32, string) {} ================================================ FILE: vendor/github.com/golang/protobuf/proto/discard.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2017 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "fmt" "reflect" "strings" "sync" "sync/atomic" ) type generatedDiscarder interface { XXX_DiscardUnknown() } // DiscardUnknown recursively discards all unknown fields from this message // and all embedded messages. // // When unmarshaling a message with unrecognized fields, the tags and values // of such fields are preserved in the Message. This allows a later call to // marshal to be able to produce a message that continues to have those // unrecognized fields. To avoid this, DiscardUnknown is used to // explicitly clear the unknown fields after unmarshaling. // // For proto2 messages, the unknown fields of message extensions are only // discarded from messages that have been accessed via GetExtension. func DiscardUnknown(m Message) { if m, ok := m.(generatedDiscarder); ok { m.XXX_DiscardUnknown() return } // TODO: Dynamically populate a InternalMessageInfo for legacy messages, // but the master branch has no implementation for InternalMessageInfo, // so it would be more work to replicate that approach. discardLegacy(m) } // DiscardUnknown recursively discards all unknown fields. func (a *InternalMessageInfo) DiscardUnknown(m Message) { di := atomicLoadDiscardInfo(&a.discard) if di == nil { di = getDiscardInfo(reflect.TypeOf(m).Elem()) atomicStoreDiscardInfo(&a.discard, di) } di.discard(toPointer(&m)) } type discardInfo struct { typ reflect.Type initialized int32 // 0: only typ is valid, 1: everything is valid lock sync.Mutex fields []discardFieldInfo unrecognized field } type discardFieldInfo struct { field field // Offset of field, guaranteed to be valid discard func(src pointer) } var ( discardInfoMap = map[reflect.Type]*discardInfo{} discardInfoLock sync.Mutex ) func getDiscardInfo(t reflect.Type) *discardInfo { discardInfoLock.Lock() defer discardInfoLock.Unlock() di := discardInfoMap[t] if di == nil { di = &discardInfo{typ: t} discardInfoMap[t] = di } return di } func (di *discardInfo) discard(src pointer) { if src.isNil() { return // Nothing to do. } if atomic.LoadInt32(&di.initialized) == 0 { di.computeDiscardInfo() } for _, fi := range di.fields { sfp := src.offset(fi.field) fi.discard(sfp) } // For proto2 messages, only discard unknown fields in message extensions // that have been accessed via GetExtension. if em, err := extendable(src.asPointerTo(di.typ).Interface()); err == nil { // Ignore lock since DiscardUnknown is not concurrency safe. emm, _ := em.extensionsRead() for _, mx := range emm { if m, ok := mx.value.(Message); ok { DiscardUnknown(m) } } } if di.unrecognized.IsValid() { *src.offset(di.unrecognized).toBytes() = nil } } func (di *discardInfo) computeDiscardInfo() { di.lock.Lock() defer di.lock.Unlock() if di.initialized != 0 { return } t := di.typ n := t.NumField() for i := 0; i < n; i++ { f := t.Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } dfi := discardFieldInfo{field: toField(&f)} tf := f.Type // Unwrap tf to get its most basic type. var isPointer, isSlice bool if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 { isSlice = true tf = tf.Elem() } if tf.Kind() == reflect.Ptr { isPointer = true tf = tf.Elem() } if isPointer && isSlice && tf.Kind() != reflect.Struct { panic(fmt.Sprintf("%v.%s cannot be a slice of pointers to primitive types", t, f.Name)) } switch tf.Kind() { case reflect.Struct: switch { case !isPointer: panic(fmt.Sprintf("%v.%s cannot be a direct struct value", t, f.Name)) case isSlice: // E.g., []*pb.T di := getDiscardInfo(tf) dfi.discard = func(src pointer) { sps := src.getPointerSlice() for _, sp := range sps { if !sp.isNil() { di.discard(sp) } } } default: // E.g., *pb.T di := getDiscardInfo(tf) dfi.discard = func(src pointer) { sp := src.getPointer() if !sp.isNil() { di.discard(sp) } } } case reflect.Map: switch { case isPointer || isSlice: panic(fmt.Sprintf("%v.%s cannot be a pointer to a map or a slice of map values", t, f.Name)) default: // E.g., map[K]V if tf.Elem().Kind() == reflect.Ptr { // Proto struct (e.g., *T) dfi.discard = func(src pointer) { sm := src.asPointerTo(tf).Elem() if sm.Len() == 0 { return } for _, key := range sm.MapKeys() { val := sm.MapIndex(key) DiscardUnknown(val.Interface().(Message)) } } } else { dfi.discard = func(pointer) {} // Noop } } case reflect.Interface: // Must be oneof field. switch { case isPointer || isSlice: panic(fmt.Sprintf("%v.%s cannot be a pointer to a interface or a slice of interface values", t, f.Name)) default: // E.g., interface{} // TODO: Make this faster? dfi.discard = func(src pointer) { su := src.asPointerTo(tf).Elem() if !su.IsNil() { sv := su.Elem().Elem().Field(0) if sv.Kind() == reflect.Ptr && sv.IsNil() { return } switch sv.Type().Kind() { case reflect.Ptr: // Proto struct (e.g., *T) DiscardUnknown(sv.Interface().(Message)) } } } } default: continue } di.fields = append(di.fields, dfi) } di.unrecognized = invalidField if f, ok := t.FieldByName("XXX_unrecognized"); ok { if f.Type != reflect.TypeOf([]byte{}) { panic("expected XXX_unrecognized to be of type []byte") } di.unrecognized = toField(&f) } atomic.StoreInt32(&di.initialized, 1) } func discardLegacy(m Message) { v := reflect.ValueOf(m) if v.Kind() != reflect.Ptr || v.IsNil() { return } v = v.Elem() if v.Kind() != reflect.Struct { return } t := v.Type() for i := 0; i < v.NumField(); i++ { f := t.Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } vf := v.Field(i) tf := f.Type // Unwrap tf to get its most basic type. var isPointer, isSlice bool if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 { isSlice = true tf = tf.Elem() } if tf.Kind() == reflect.Ptr { isPointer = true tf = tf.Elem() } if isPointer && isSlice && tf.Kind() != reflect.Struct { panic(fmt.Sprintf("%T.%s cannot be a slice of pointers to primitive types", m, f.Name)) } switch tf.Kind() { case reflect.Struct: switch { case !isPointer: panic(fmt.Sprintf("%T.%s cannot be a direct struct value", m, f.Name)) case isSlice: // E.g., []*pb.T for j := 0; j < vf.Len(); j++ { discardLegacy(vf.Index(j).Interface().(Message)) } default: // E.g., *pb.T discardLegacy(vf.Interface().(Message)) } case reflect.Map: switch { case isPointer || isSlice: panic(fmt.Sprintf("%T.%s cannot be a pointer to a map or a slice of map values", m, f.Name)) default: // E.g., map[K]V tv := vf.Type().Elem() if tv.Kind() == reflect.Ptr && tv.Implements(protoMessageType) { // Proto struct (e.g., *T) for _, key := range vf.MapKeys() { val := vf.MapIndex(key) discardLegacy(val.Interface().(Message)) } } } case reflect.Interface: // Must be oneof field. switch { case isPointer || isSlice: panic(fmt.Sprintf("%T.%s cannot be a pointer to a interface or a slice of interface values", m, f.Name)) default: // E.g., test_proto.isCommunique_Union interface if !vf.IsNil() && f.Tag.Get("protobuf_oneof") != "" { vf = vf.Elem() // E.g., *test_proto.Communique_Msg if !vf.IsNil() { vf = vf.Elem() // E.g., test_proto.Communique_Msg vf = vf.Field(0) // E.g., Proto struct (e.g., *T) or primitive value if vf.Kind() == reflect.Ptr { discardLegacy(vf.Interface().(Message)) } } } } } } if vf := v.FieldByName("XXX_unrecognized"); vf.IsValid() { if vf.Type() != reflect.TypeOf([]byte{}) { panic("expected XXX_unrecognized to be of type []byte") } vf.Set(reflect.ValueOf([]byte(nil))) } // For proto2 messages, only discard unknown fields in message extensions // that have been accessed via GetExtension. if em, err := extendable(m); err == nil { // Ignore lock since discardLegacy is not concurrency safe. emm, _ := em.extensionsRead() for _, mx := range emm { if m, ok := mx.value.(Message); ok { discardLegacy(m) } } } } ================================================ FILE: vendor/github.com/golang/protobuf/proto/encode.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto /* * Routines for encoding data into the wire format for protocol buffers. */ import ( "errors" "reflect" ) var ( // errRepeatedHasNil is the error returned if Marshal is called with // a struct with a repeated field containing a nil element. errRepeatedHasNil = errors.New("proto: repeated field has nil element") // errOneofHasNil is the error returned if Marshal is called with // a struct with a oneof field containing a nil element. errOneofHasNil = errors.New("proto: oneof field has nil value") // ErrNil is the error returned if Marshal is called with nil. ErrNil = errors.New("proto: Marshal called with nil") // ErrTooLarge is the error returned if Marshal is called with a // message that encodes to >2GB. ErrTooLarge = errors.New("proto: message encodes to over 2 GB") ) // The fundamental encoders that put bytes on the wire. // Those that take integer types all accept uint64 and are // therefore of type valueEncoder. const maxVarintBytes = 10 // maximum length of a varint // EncodeVarint returns the varint encoding of x. // This is the format for the // int32, int64, uint32, uint64, bool, and enum // protocol buffer types. // Not used by the package itself, but helpful to clients // wishing to use the same encoding. func EncodeVarint(x uint64) []byte { var buf [maxVarintBytes]byte var n int for n = 0; x > 127; n++ { buf[n] = 0x80 | uint8(x&0x7F) x >>= 7 } buf[n] = uint8(x) n++ return buf[0:n] } // EncodeVarint writes a varint-encoded integer to the Buffer. // This is the format for the // int32, int64, uint32, uint64, bool, and enum // protocol buffer types. func (p *Buffer) EncodeVarint(x uint64) error { for x >= 1<<7 { p.buf = append(p.buf, uint8(x&0x7f|0x80)) x >>= 7 } p.buf = append(p.buf, uint8(x)) return nil } // SizeVarint returns the varint encoding size of an integer. func SizeVarint(x uint64) int { switch { case x < 1<<7: return 1 case x < 1<<14: return 2 case x < 1<<21: return 3 case x < 1<<28: return 4 case x < 1<<35: return 5 case x < 1<<42: return 6 case x < 1<<49: return 7 case x < 1<<56: return 8 case x < 1<<63: return 9 } return 10 } // EncodeFixed64 writes a 64-bit integer to the Buffer. // This is the format for the // fixed64, sfixed64, and double protocol buffer types. func (p *Buffer) EncodeFixed64(x uint64) error { p.buf = append(p.buf, uint8(x), uint8(x>>8), uint8(x>>16), uint8(x>>24), uint8(x>>32), uint8(x>>40), uint8(x>>48), uint8(x>>56)) return nil } // EncodeFixed32 writes a 32-bit integer to the Buffer. // This is the format for the // fixed32, sfixed32, and float protocol buffer types. func (p *Buffer) EncodeFixed32(x uint64) error { p.buf = append(p.buf, uint8(x), uint8(x>>8), uint8(x>>16), uint8(x>>24)) return nil } // EncodeZigzag64 writes a zigzag-encoded 64-bit integer // to the Buffer. // This is the format used for the sint64 protocol buffer type. func (p *Buffer) EncodeZigzag64(x uint64) error { // use signed number to get arithmetic right shift. return p.EncodeVarint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } // EncodeZigzag32 writes a zigzag-encoded 32-bit integer // to the Buffer. // This is the format used for the sint32 protocol buffer type. func (p *Buffer) EncodeZigzag32(x uint64) error { // use signed number to get arithmetic right shift. return p.EncodeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31)))) } // EncodeRawBytes writes a count-delimited byte buffer to the Buffer. // This is the format used for the bytes protocol buffer // type and for embedded messages. func (p *Buffer) EncodeRawBytes(b []byte) error { p.EncodeVarint(uint64(len(b))) p.buf = append(p.buf, b...) return nil } // EncodeStringBytes writes an encoded string to the Buffer. // This is the format used for the proto2 string type. func (p *Buffer) EncodeStringBytes(s string) error { p.EncodeVarint(uint64(len(s))) p.buf = append(p.buf, s...) return nil } // Marshaler is the interface representing objects that can marshal themselves. type Marshaler interface { Marshal() ([]byte, error) } // EncodeMessage writes the protocol buffer to the Buffer, // prefixed by a varint-encoded length. func (p *Buffer) EncodeMessage(pb Message) error { siz := Size(pb) p.EncodeVarint(uint64(siz)) return p.Marshal(pb) } // All protocol buffer fields are nillable, but be careful. func isNil(v reflect.Value) bool { switch v.Kind() { case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: return v.IsNil() } return false } ================================================ FILE: vendor/github.com/golang/protobuf/proto/equal.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2011 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Protocol buffer comparison. package proto import ( "bytes" "log" "reflect" "strings" ) /* Equal returns true iff protocol buffers a and b are equal. The arguments must both be pointers to protocol buffer structs. Equality is defined in this way: - Two messages are equal iff they are the same type, corresponding fields are equal, unknown field sets are equal, and extensions sets are equal. - Two set scalar fields are equal iff their values are equal. If the fields are of a floating-point type, remember that NaN != x for all x, including NaN. If the message is defined in a proto3 .proto file, fields are not "set"; specifically, zero length proto3 "bytes" fields are equal (nil == {}). - Two repeated fields are equal iff their lengths are the same, and their corresponding elements are equal. Note a "bytes" field, although represented by []byte, is not a repeated field and the rule for the scalar fields described above applies. - Two unset fields are equal. - Two unknown field sets are equal if their current encoded state is equal. - Two extension sets are equal iff they have corresponding elements that are pairwise equal. - Two map fields are equal iff their lengths are the same, and they contain the same set of elements. Zero-length map fields are equal. - Every other combination of things are not equal. The return value is undefined if a and b are not protocol buffers. */ func Equal(a, b Message) bool { if a == nil || b == nil { return a == b } v1, v2 := reflect.ValueOf(a), reflect.ValueOf(b) if v1.Type() != v2.Type() { return false } if v1.Kind() == reflect.Ptr { if v1.IsNil() { return v2.IsNil() } if v2.IsNil() { return false } v1, v2 = v1.Elem(), v2.Elem() } if v1.Kind() != reflect.Struct { return false } return equalStruct(v1, v2) } // v1 and v2 are known to have the same type. func equalStruct(v1, v2 reflect.Value) bool { sprop := GetProperties(v1.Type()) for i := 0; i < v1.NumField(); i++ { f := v1.Type().Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } f1, f2 := v1.Field(i), v2.Field(i) if f.Type.Kind() == reflect.Ptr { if n1, n2 := f1.IsNil(), f2.IsNil(); n1 && n2 { // both unset continue } else if n1 != n2 { // set/unset mismatch return false } f1, f2 = f1.Elem(), f2.Elem() } if !equalAny(f1, f2, sprop.Prop[i]) { return false } } if em1 := v1.FieldByName("XXX_InternalExtensions"); em1.IsValid() { em2 := v2.FieldByName("XXX_InternalExtensions") if !equalExtensions(v1.Type(), em1.Interface().(XXX_InternalExtensions), em2.Interface().(XXX_InternalExtensions)) { return false } } if em1 := v1.FieldByName("XXX_extensions"); em1.IsValid() { em2 := v2.FieldByName("XXX_extensions") if !equalExtMap(v1.Type(), em1.Interface().(map[int32]Extension), em2.Interface().(map[int32]Extension)) { return false } } uf := v1.FieldByName("XXX_unrecognized") if !uf.IsValid() { return true } u1 := uf.Bytes() u2 := v2.FieldByName("XXX_unrecognized").Bytes() return bytes.Equal(u1, u2) } // v1 and v2 are known to have the same type. // prop may be nil. func equalAny(v1, v2 reflect.Value, prop *Properties) bool { if v1.Type() == protoMessageType { m1, _ := v1.Interface().(Message) m2, _ := v2.Interface().(Message) return Equal(m1, m2) } switch v1.Kind() { case reflect.Bool: return v1.Bool() == v2.Bool() case reflect.Float32, reflect.Float64: return v1.Float() == v2.Float() case reflect.Int32, reflect.Int64: return v1.Int() == v2.Int() case reflect.Interface: // Probably a oneof field; compare the inner values. n1, n2 := v1.IsNil(), v2.IsNil() if n1 || n2 { return n1 == n2 } e1, e2 := v1.Elem(), v2.Elem() if e1.Type() != e2.Type() { return false } return equalAny(e1, e2, nil) case reflect.Map: if v1.Len() != v2.Len() { return false } for _, key := range v1.MapKeys() { val2 := v2.MapIndex(key) if !val2.IsValid() { // This key was not found in the second map. return false } if !equalAny(v1.MapIndex(key), val2, nil) { return false } } return true case reflect.Ptr: // Maps may have nil values in them, so check for nil. if v1.IsNil() && v2.IsNil() { return true } if v1.IsNil() != v2.IsNil() { return false } return equalAny(v1.Elem(), v2.Elem(), prop) case reflect.Slice: if v1.Type().Elem().Kind() == reflect.Uint8 { // short circuit: []byte // Edge case: if this is in a proto3 message, a zero length // bytes field is considered the zero value. if prop != nil && prop.proto3 && v1.Len() == 0 && v2.Len() == 0 { return true } if v1.IsNil() != v2.IsNil() { return false } return bytes.Equal(v1.Interface().([]byte), v2.Interface().([]byte)) } if v1.Len() != v2.Len() { return false } for i := 0; i < v1.Len(); i++ { if !equalAny(v1.Index(i), v2.Index(i), prop) { return false } } return true case reflect.String: return v1.Interface().(string) == v2.Interface().(string) case reflect.Struct: return equalStruct(v1, v2) case reflect.Uint32, reflect.Uint64: return v1.Uint() == v2.Uint() } // unknown type, so not a protocol buffer log.Printf("proto: don't know how to compare %v", v1) return false } // base is the struct type that the extensions are based on. // x1 and x2 are InternalExtensions. func equalExtensions(base reflect.Type, x1, x2 XXX_InternalExtensions) bool { em1, _ := x1.extensionsRead() em2, _ := x2.extensionsRead() return equalExtMap(base, em1, em2) } func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool { if len(em1) != len(em2) { return false } for extNum, e1 := range em1 { e2, ok := em2[extNum] if !ok { return false } m1 := extensionAsLegacyType(e1.value) m2 := extensionAsLegacyType(e2.value) if m1 == nil && m2 == nil { // Both have only encoded form. if bytes.Equal(e1.enc, e2.enc) { continue } // The bytes are different, but the extensions might still be // equal. We need to decode them to compare. } if m1 != nil && m2 != nil { // Both are unencoded. if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) { return false } continue } // At least one is encoded. To do a semantically correct comparison // we need to unmarshal them first. var desc *ExtensionDesc if m := extensionMaps[base]; m != nil { desc = m[extNum] } if desc == nil { // If both have only encoded form and the bytes are the same, // it is handled above. We get here when the bytes are different. // We don't know how to decode it, so just compare them as byte // slices. log.Printf("proto: don't know how to compare extension %d of %v", extNum, base) return false } var err error if m1 == nil { m1, err = decodeExtension(e1.enc, desc) } if m2 == nil && err == nil { m2, err = decodeExtension(e2.enc, desc) } if err != nil { // The encoded form is invalid. log.Printf("proto: badly encoded extension %d of %v: %v", extNum, base, err) return false } if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) { return false } } return true } ================================================ FILE: vendor/github.com/golang/protobuf/proto/extensions.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto /* * Types and routines for supporting protocol buffer extensions. */ import ( "errors" "fmt" "io" "reflect" "strconv" "sync" ) // ErrMissingExtension is the error returned by GetExtension if the named extension is not in the message. var ErrMissingExtension = errors.New("proto: missing extension") // ExtensionRange represents a range of message extensions for a protocol buffer. // Used in code generated by the protocol compiler. type ExtensionRange struct { Start, End int32 // both inclusive } // extendableProto is an interface implemented by any protocol buffer generated by the current // proto compiler that may be extended. type extendableProto interface { Message ExtensionRangeArray() []ExtensionRange extensionsWrite() map[int32]Extension extensionsRead() (map[int32]Extension, sync.Locker) } // extendableProtoV1 is an interface implemented by a protocol buffer generated by the previous // version of the proto compiler that may be extended. type extendableProtoV1 interface { Message ExtensionRangeArray() []ExtensionRange ExtensionMap() map[int32]Extension } // extensionAdapter is a wrapper around extendableProtoV1 that implements extendableProto. type extensionAdapter struct { extendableProtoV1 } func (e extensionAdapter) extensionsWrite() map[int32]Extension { return e.ExtensionMap() } func (e extensionAdapter) extensionsRead() (map[int32]Extension, sync.Locker) { return e.ExtensionMap(), notLocker{} } // notLocker is a sync.Locker whose Lock and Unlock methods are nops. type notLocker struct{} func (n notLocker) Lock() {} func (n notLocker) Unlock() {} // extendable returns the extendableProto interface for the given generated proto message. // If the proto message has the old extension format, it returns a wrapper that implements // the extendableProto interface. func extendable(p interface{}) (extendableProto, error) { switch p := p.(type) { case extendableProto: if isNilPtr(p) { return nil, fmt.Errorf("proto: nil %T is not extendable", p) } return p, nil case extendableProtoV1: if isNilPtr(p) { return nil, fmt.Errorf("proto: nil %T is not extendable", p) } return extensionAdapter{p}, nil } // Don't allocate a specific error containing %T: // this is the hot path for Clone and MarshalText. return nil, errNotExtendable } var errNotExtendable = errors.New("proto: not an extendable proto.Message") func isNilPtr(x interface{}) bool { v := reflect.ValueOf(x) return v.Kind() == reflect.Ptr && v.IsNil() } // XXX_InternalExtensions is an internal representation of proto extensions. // // Each generated message struct type embeds an anonymous XXX_InternalExtensions field, // thus gaining the unexported 'extensions' method, which can be called only from the proto package. // // The methods of XXX_InternalExtensions are not concurrency safe in general, // but calls to logically read-only methods such as has and get may be executed concurrently. type XXX_InternalExtensions struct { // The struct must be indirect so that if a user inadvertently copies a // generated message and its embedded XXX_InternalExtensions, they // avoid the mayhem of a copied mutex. // // The mutex serializes all logically read-only operations to p.extensionMap. // It is up to the client to ensure that write operations to p.extensionMap are // mutually exclusive with other accesses. p *struct { mu sync.Mutex extensionMap map[int32]Extension } } // extensionsWrite returns the extension map, creating it on first use. func (e *XXX_InternalExtensions) extensionsWrite() map[int32]Extension { if e.p == nil { e.p = new(struct { mu sync.Mutex extensionMap map[int32]Extension }) e.p.extensionMap = make(map[int32]Extension) } return e.p.extensionMap } // extensionsRead returns the extensions map for read-only use. It may be nil. // The caller must hold the returned mutex's lock when accessing Elements within the map. func (e *XXX_InternalExtensions) extensionsRead() (map[int32]Extension, sync.Locker) { if e.p == nil { return nil, nil } return e.p.extensionMap, &e.p.mu } // ExtensionDesc represents an extension specification. // Used in generated code from the protocol compiler. type ExtensionDesc struct { ExtendedType Message // nil pointer to the type that is being extended ExtensionType interface{} // nil pointer to the extension type Field int32 // field number Name string // fully-qualified name of extension, for text formatting Tag string // protobuf tag style Filename string // name of the file in which the extension is defined } func (ed *ExtensionDesc) repeated() bool { t := reflect.TypeOf(ed.ExtensionType) return t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 } // Extension represents an extension in a message. type Extension struct { // When an extension is stored in a message using SetExtension // only desc and value are set. When the message is marshaled // enc will be set to the encoded form of the message. // // When a message is unmarshaled and contains extensions, each // extension will have only enc set. When such an extension is // accessed using GetExtension (or GetExtensions) desc and value // will be set. desc *ExtensionDesc // value is a concrete value for the extension field. Let the type of // desc.ExtensionType be the "API type" and the type of Extension.value // be the "storage type". The API type and storage type are the same except: // * For scalars (except []byte), the API type uses *T, // while the storage type uses T. // * For repeated fields, the API type uses []T, while the storage type // uses *[]T. // // The reason for the divergence is so that the storage type more naturally // matches what is expected of when retrieving the values through the // protobuf reflection APIs. // // The value may only be populated if desc is also populated. value interface{} // enc is the raw bytes for the extension field. enc []byte } // SetRawExtension is for testing only. func SetRawExtension(base Message, id int32, b []byte) { epb, err := extendable(base) if err != nil { return } extmap := epb.extensionsWrite() extmap[id] = Extension{enc: b} } // isExtensionField returns true iff the given field number is in an extension range. func isExtensionField(pb extendableProto, field int32) bool { for _, er := range pb.ExtensionRangeArray() { if er.Start <= field && field <= er.End { return true } } return false } // checkExtensionTypes checks that the given extension is valid for pb. func checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) error { var pbi interface{} = pb // Check the extended type. if ea, ok := pbi.(extensionAdapter); ok { pbi = ea.extendableProtoV1 } if a, b := reflect.TypeOf(pbi), reflect.TypeOf(extension.ExtendedType); a != b { return fmt.Errorf("proto: bad extended type; %v does not extend %v", b, a) } // Check the range. if !isExtensionField(pb, extension.Field) { return errors.New("proto: bad extension number; not in declared ranges") } return nil } // extPropKey is sufficient to uniquely identify an extension. type extPropKey struct { base reflect.Type field int32 } var extProp = struct { sync.RWMutex m map[extPropKey]*Properties }{ m: make(map[extPropKey]*Properties), } func extensionProperties(ed *ExtensionDesc) *Properties { key := extPropKey{base: reflect.TypeOf(ed.ExtendedType), field: ed.Field} extProp.RLock() if prop, ok := extProp.m[key]; ok { extProp.RUnlock() return prop } extProp.RUnlock() extProp.Lock() defer extProp.Unlock() // Check again. if prop, ok := extProp.m[key]; ok { return prop } prop := new(Properties) prop.Init(reflect.TypeOf(ed.ExtensionType), "unknown_name", ed.Tag, nil) extProp.m[key] = prop return prop } // HasExtension returns whether the given extension is present in pb. func HasExtension(pb Message, extension *ExtensionDesc) bool { // TODO: Check types, field numbers, etc.? epb, err := extendable(pb) if err != nil { return false } extmap, mu := epb.extensionsRead() if extmap == nil { return false } mu.Lock() _, ok := extmap[extension.Field] mu.Unlock() return ok } // ClearExtension removes the given extension from pb. func ClearExtension(pb Message, extension *ExtensionDesc) { epb, err := extendable(pb) if err != nil { return } // TODO: Check types, field numbers, etc.? extmap := epb.extensionsWrite() delete(extmap, extension.Field) } // GetExtension retrieves a proto2 extended field from pb. // // If the descriptor is type complete (i.e., ExtensionDesc.ExtensionType is non-nil), // then GetExtension parses the encoded field and returns a Go value of the specified type. // If the field is not present, then the default value is returned (if one is specified), // otherwise ErrMissingExtension is reported. // // If the descriptor is not type complete (i.e., ExtensionDesc.ExtensionType is nil), // then GetExtension returns the raw encoded bytes of the field extension. func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) { epb, err := extendable(pb) if err != nil { return nil, err } if extension.ExtendedType != nil { // can only check type if this is a complete descriptor if err := checkExtensionTypes(epb, extension); err != nil { return nil, err } } emap, mu := epb.extensionsRead() if emap == nil { return defaultExtensionValue(extension) } mu.Lock() defer mu.Unlock() e, ok := emap[extension.Field] if !ok { // defaultExtensionValue returns the default value or // ErrMissingExtension if there is no default. return defaultExtensionValue(extension) } if e.value != nil { // Already decoded. Check the descriptor, though. if e.desc != extension { // This shouldn't happen. If it does, it means that // GetExtension was called twice with two different // descriptors with the same field number. return nil, errors.New("proto: descriptor conflict") } return extensionAsLegacyType(e.value), nil } if extension.ExtensionType == nil { // incomplete descriptor return e.enc, nil } v, err := decodeExtension(e.enc, extension) if err != nil { return nil, err } // Remember the decoded version and drop the encoded version. // That way it is safe to mutate what we return. e.value = extensionAsStorageType(v) e.desc = extension e.enc = nil emap[extension.Field] = e return extensionAsLegacyType(e.value), nil } // defaultExtensionValue returns the default value for extension. // If no default for an extension is defined ErrMissingExtension is returned. func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) { if extension.ExtensionType == nil { // incomplete descriptor, so no default return nil, ErrMissingExtension } t := reflect.TypeOf(extension.ExtensionType) props := extensionProperties(extension) sf, _, err := fieldDefault(t, props) if err != nil { return nil, err } if sf == nil || sf.value == nil { // There is no default value. return nil, ErrMissingExtension } if t.Kind() != reflect.Ptr { // We do not need to return a Ptr, we can directly return sf.value. return sf.value, nil } // We need to return an interface{} that is a pointer to sf.value. value := reflect.New(t).Elem() value.Set(reflect.New(value.Type().Elem())) if sf.kind == reflect.Int32 { // We may have an int32 or an enum, but the underlying data is int32. // Since we can't set an int32 into a non int32 reflect.value directly // set it as a int32. value.Elem().SetInt(int64(sf.value.(int32))) } else { value.Elem().Set(reflect.ValueOf(sf.value)) } return value.Interface(), nil } // decodeExtension decodes an extension encoded in b. func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) { t := reflect.TypeOf(extension.ExtensionType) unmarshal := typeUnmarshaler(t, extension.Tag) // t is a pointer to a struct, pointer to basic type or a slice. // Allocate space to store the pointer/slice. value := reflect.New(t).Elem() var err error for { x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] wire := int(x) & 7 b, err = unmarshal(b, valToPointer(value.Addr()), wire) if err != nil { return nil, err } if len(b) == 0 { break } } return value.Interface(), nil } // GetExtensions returns a slice of the extensions present in pb that are also listed in es. // The returned slice has the same length as es; missing extensions will appear as nil elements. func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, err error) { epb, err := extendable(pb) if err != nil { return nil, err } extensions = make([]interface{}, len(es)) for i, e := range es { extensions[i], err = GetExtension(epb, e) if err == ErrMissingExtension { err = nil } if err != nil { return } } return } // ExtensionDescs returns a new slice containing pb's extension descriptors, in undefined order. // For non-registered extensions, ExtensionDescs returns an incomplete descriptor containing // just the Field field, which defines the extension's field number. func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) { epb, err := extendable(pb) if err != nil { return nil, err } registeredExtensions := RegisteredExtensions(pb) emap, mu := epb.extensionsRead() if emap == nil { return nil, nil } mu.Lock() defer mu.Unlock() extensions := make([]*ExtensionDesc, 0, len(emap)) for extid, e := range emap { desc := e.desc if desc == nil { desc = registeredExtensions[extid] if desc == nil { desc = &ExtensionDesc{Field: extid} } } extensions = append(extensions, desc) } return extensions, nil } // SetExtension sets the specified extension of pb to the specified value. func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error { epb, err := extendable(pb) if err != nil { return err } if err := checkExtensionTypes(epb, extension); err != nil { return err } typ := reflect.TypeOf(extension.ExtensionType) if typ != reflect.TypeOf(value) { return fmt.Errorf("proto: bad extension value type. got: %T, want: %T", value, extension.ExtensionType) } // nil extension values need to be caught early, because the // encoder can't distinguish an ErrNil due to a nil extension // from an ErrNil due to a missing field. Extensions are // always optional, so the encoder would just swallow the error // and drop all the extensions from the encoded message. if reflect.ValueOf(value).IsNil() { return fmt.Errorf("proto: SetExtension called with nil value of type %T", value) } extmap := epb.extensionsWrite() extmap[extension.Field] = Extension{desc: extension, value: extensionAsStorageType(value)} return nil } // ClearAllExtensions clears all extensions from pb. func ClearAllExtensions(pb Message) { epb, err := extendable(pb) if err != nil { return } m := epb.extensionsWrite() for k := range m { delete(m, k) } } // A global registry of extensions. // The generated code will register the generated descriptors by calling RegisterExtension. var extensionMaps = make(map[reflect.Type]map[int32]*ExtensionDesc) // RegisterExtension is called from the generated code. func RegisterExtension(desc *ExtensionDesc) { st := reflect.TypeOf(desc.ExtendedType).Elem() m := extensionMaps[st] if m == nil { m = make(map[int32]*ExtensionDesc) extensionMaps[st] = m } if _, ok := m[desc.Field]; ok { panic("proto: duplicate extension registered: " + st.String() + " " + strconv.Itoa(int(desc.Field))) } m[desc.Field] = desc } // RegisteredExtensions returns a map of the registered extensions of a // protocol buffer struct, indexed by the extension number. // The argument pb should be a nil pointer to the struct type. func RegisteredExtensions(pb Message) map[int32]*ExtensionDesc { return extensionMaps[reflect.TypeOf(pb).Elem()] } // extensionAsLegacyType converts an value in the storage type as the API type. // See Extension.value. func extensionAsLegacyType(v interface{}) interface{} { switch rv := reflect.ValueOf(v); rv.Kind() { case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String: // Represent primitive types as a pointer to the value. rv2 := reflect.New(rv.Type()) rv2.Elem().Set(rv) v = rv2.Interface() case reflect.Ptr: // Represent slice types as the value itself. switch rv.Type().Elem().Kind() { case reflect.Slice: if rv.IsNil() { v = reflect.Zero(rv.Type().Elem()).Interface() } else { v = rv.Elem().Interface() } } } return v } // extensionAsStorageType converts an value in the API type as the storage type. // See Extension.value. func extensionAsStorageType(v interface{}) interface{} { switch rv := reflect.ValueOf(v); rv.Kind() { case reflect.Ptr: // Represent slice types as the value itself. switch rv.Type().Elem().Kind() { case reflect.Bool, reflect.Int32, reflect.Int64, reflect.Uint32, reflect.Uint64, reflect.Float32, reflect.Float64, reflect.String: if rv.IsNil() { v = reflect.Zero(rv.Type().Elem()).Interface() } else { v = rv.Elem().Interface() } } case reflect.Slice: // Represent slice types as a pointer to the value. if rv.Type().Elem().Kind() != reflect.Uint8 { rv2 := reflect.New(rv.Type()) rv2.Elem().Set(rv) v = rv2.Interface() } } return v } ================================================ FILE: vendor/github.com/golang/protobuf/proto/lib.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Package proto converts data structures to and from the wire format of protocol buffers. It works in concert with the Go source code generated for .proto files by the protocol compiler. A summary of the properties of the protocol buffer interface for a protocol buffer variable v: - Names are turned from camel_case to CamelCase for export. - There are no methods on v to set fields; just treat them as structure fields. - There are getters that return a field's value if set, and return the field's default value if unset. The getters work even if the receiver is a nil message. - The zero value for a struct is its correct initialization state. All desired fields must be set before marshaling. - A Reset() method will restore a protobuf struct to its zero state. - Non-repeated fields are pointers to the values; nil means unset. That is, optional or required field int32 f becomes F *int32. - Repeated fields are slices. - Helper functions are available to aid the setting of fields. msg.Foo = proto.String("hello") // set field - Constants are defined to hold the default values of all fields that have them. They have the form Default_StructName_FieldName. Because the getter methods handle defaulted values, direct use of these constants should be rare. - Enums are given type names and maps from names to values. Enum values are prefixed by the enclosing message's name, or by the enum's type name if it is a top-level enum. Enum types have a String method, and a Enum method to assist in message construction. - Nested messages, groups and enums have type names prefixed with the name of the surrounding message type. - Extensions are given descriptor names that start with E_, followed by an underscore-delimited list of the nested messages that contain it (if any) followed by the CamelCased name of the extension field itself. HasExtension, ClearExtension, GetExtension and SetExtension are functions for manipulating extensions. - Oneof field sets are given a single field in their message, with distinguished wrapper types for each possible field value. - Marshal and Unmarshal are functions to encode and decode the wire format. When the .proto file specifies `syntax="proto3"`, there are some differences: - Non-repeated fields of non-message type are values instead of pointers. - Enum types do not get an Enum method. The simplest way to describe this is to see an example. Given file test.proto, containing package example; enum FOO { X = 17; } message Test { required string label = 1; optional int32 type = 2 [default=77]; repeated int64 reps = 3; optional group OptionalGroup = 4 { required string RequiredField = 5; } oneof union { int32 number = 6; string name = 7; } } The resulting file, test.pb.go, is: package example import proto "github.com/golang/protobuf/proto" import math "math" type FOO int32 const ( FOO_X FOO = 17 ) var FOO_name = map[int32]string{ 17: "X", } var FOO_value = map[string]int32{ "X": 17, } func (x FOO) Enum() *FOO { p := new(FOO) *p = x return p } func (x FOO) String() string { return proto.EnumName(FOO_name, int32(x)) } func (x *FOO) UnmarshalJSON(data []byte) error { value, err := proto.UnmarshalJSONEnum(FOO_value, data) if err != nil { return err } *x = FOO(value) return nil } type Test struct { Label *string `protobuf:"bytes,1,req,name=label" json:"label,omitempty"` Type *int32 `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"` Reps []int64 `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"` Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup" json:"optionalgroup,omitempty"` // Types that are valid to be assigned to Union: // *Test_Number // *Test_Name Union isTest_Union `protobuf_oneof:"union"` XXX_unrecognized []byte `json:"-"` } func (m *Test) Reset() { *m = Test{} } func (m *Test) String() string { return proto.CompactTextString(m) } func (*Test) ProtoMessage() {} type isTest_Union interface { isTest_Union() } type Test_Number struct { Number int32 `protobuf:"varint,6,opt,name=number"` } type Test_Name struct { Name string `protobuf:"bytes,7,opt,name=name"` } func (*Test_Number) isTest_Union() {} func (*Test_Name) isTest_Union() {} func (m *Test) GetUnion() isTest_Union { if m != nil { return m.Union } return nil } const Default_Test_Type int32 = 77 func (m *Test) GetLabel() string { if m != nil && m.Label != nil { return *m.Label } return "" } func (m *Test) GetType() int32 { if m != nil && m.Type != nil { return *m.Type } return Default_Test_Type } func (m *Test) GetOptionalgroup() *Test_OptionalGroup { if m != nil { return m.Optionalgroup } return nil } type Test_OptionalGroup struct { RequiredField *string `protobuf:"bytes,5,req" json:"RequiredField,omitempty"` } func (m *Test_OptionalGroup) Reset() { *m = Test_OptionalGroup{} } func (m *Test_OptionalGroup) String() string { return proto.CompactTextString(m) } func (m *Test_OptionalGroup) GetRequiredField() string { if m != nil && m.RequiredField != nil { return *m.RequiredField } return "" } func (m *Test) GetNumber() int32 { if x, ok := m.GetUnion().(*Test_Number); ok { return x.Number } return 0 } func (m *Test) GetName() string { if x, ok := m.GetUnion().(*Test_Name); ok { return x.Name } return "" } func init() { proto.RegisterEnum("example.FOO", FOO_name, FOO_value) } To create and play with a Test object: package main import ( "log" "github.com/golang/protobuf/proto" pb "./example.pb" ) func main() { test := &pb.Test{ Label: proto.String("hello"), Type: proto.Int32(17), Reps: []int64{1, 2, 3}, Optionalgroup: &pb.Test_OptionalGroup{ RequiredField: proto.String("good bye"), }, Union: &pb.Test_Name{"fred"}, } data, err := proto.Marshal(test) if err != nil { log.Fatal("marshaling error: ", err) } newTest := &pb.Test{} err = proto.Unmarshal(data, newTest) if err != nil { log.Fatal("unmarshaling error: ", err) } // Now test and newTest contain the same data. if test.GetLabel() != newTest.GetLabel() { log.Fatalf("data mismatch %q != %q", test.GetLabel(), newTest.GetLabel()) } // Use a type switch to determine which oneof was set. switch u := test.Union.(type) { case *pb.Test_Number: // u.Number contains the number. case *pb.Test_Name: // u.Name contains the string. } // etc. } */ package proto import ( "encoding/json" "fmt" "log" "reflect" "sort" "strconv" "sync" ) // RequiredNotSetError is an error type returned by either Marshal or Unmarshal. // Marshal reports this when a required field is not initialized. // Unmarshal reports this when a required field is missing from the wire data. type RequiredNotSetError struct{ field string } func (e *RequiredNotSetError) Error() string { if e.field == "" { return fmt.Sprintf("proto: required field not set") } return fmt.Sprintf("proto: required field %q not set", e.field) } func (e *RequiredNotSetError) RequiredNotSet() bool { return true } type invalidUTF8Error struct{ field string } func (e *invalidUTF8Error) Error() string { if e.field == "" { return "proto: invalid UTF-8 detected" } return fmt.Sprintf("proto: field %q contains invalid UTF-8", e.field) } func (e *invalidUTF8Error) InvalidUTF8() bool { return true } // errInvalidUTF8 is a sentinel error to identify fields with invalid UTF-8. // This error should not be exposed to the external API as such errors should // be recreated with the field information. var errInvalidUTF8 = &invalidUTF8Error{} // isNonFatal reports whether the error is either a RequiredNotSet error // or a InvalidUTF8 error. func isNonFatal(err error) bool { if re, ok := err.(interface{ RequiredNotSet() bool }); ok && re.RequiredNotSet() { return true } if re, ok := err.(interface{ InvalidUTF8() bool }); ok && re.InvalidUTF8() { return true } return false } type nonFatal struct{ E error } // Merge merges err into nf and reports whether it was successful. // Otherwise it returns false for any fatal non-nil errors. func (nf *nonFatal) Merge(err error) (ok bool) { if err == nil { return true // not an error } if !isNonFatal(err) { return false // fatal error } if nf.E == nil { nf.E = err // store first instance of non-fatal error } return true } // Message is implemented by generated protocol buffer messages. type Message interface { Reset() String() string ProtoMessage() } // A Buffer is a buffer manager for marshaling and unmarshaling // protocol buffers. It may be reused between invocations to // reduce memory usage. It is not necessary to use a Buffer; // the global functions Marshal and Unmarshal create a // temporary Buffer and are fine for most applications. type Buffer struct { buf []byte // encode/decode byte stream index int // read point deterministic bool } // NewBuffer allocates a new Buffer and initializes its internal data to // the contents of the argument slice. func NewBuffer(e []byte) *Buffer { return &Buffer{buf: e} } // Reset resets the Buffer, ready for marshaling a new protocol buffer. func (p *Buffer) Reset() { p.buf = p.buf[0:0] // for reading/writing p.index = 0 // for reading } // SetBuf replaces the internal buffer with the slice, // ready for unmarshaling the contents of the slice. func (p *Buffer) SetBuf(s []byte) { p.buf = s p.index = 0 } // Bytes returns the contents of the Buffer. func (p *Buffer) Bytes() []byte { return p.buf } // SetDeterministic sets whether to use deterministic serialization. // // Deterministic serialization guarantees that for a given binary, equal // messages will always be serialized to the same bytes. This implies: // // - Repeated serialization of a message will return the same bytes. // - Different processes of the same binary (which may be executing on // different machines) will serialize equal messages to the same bytes. // // Note that the deterministic serialization is NOT canonical across // languages. It is not guaranteed to remain stable over time. It is unstable // across different builds with schema changes due to unknown fields. // Users who need canonical serialization (e.g., persistent storage in a // canonical form, fingerprinting, etc.) should define their own // canonicalization specification and implement their own serializer rather // than relying on this API. // // If deterministic serialization is requested, map entries will be sorted // by keys in lexographical order. This is an implementation detail and // subject to change. func (p *Buffer) SetDeterministic(deterministic bool) { p.deterministic = deterministic } /* * Helper routines for simplifying the creation of optional fields of basic type. */ // Bool is a helper routine that allocates a new bool value // to store v and returns a pointer to it. func Bool(v bool) *bool { return &v } // Int32 is a helper routine that allocates a new int32 value // to store v and returns a pointer to it. func Int32(v int32) *int32 { return &v } // Int is a helper routine that allocates a new int32 value // to store v and returns a pointer to it, but unlike Int32 // its argument value is an int. func Int(v int) *int32 { p := new(int32) *p = int32(v) return p } // Int64 is a helper routine that allocates a new int64 value // to store v and returns a pointer to it. func Int64(v int64) *int64 { return &v } // Float32 is a helper routine that allocates a new float32 value // to store v and returns a pointer to it. func Float32(v float32) *float32 { return &v } // Float64 is a helper routine that allocates a new float64 value // to store v and returns a pointer to it. func Float64(v float64) *float64 { return &v } // Uint32 is a helper routine that allocates a new uint32 value // to store v and returns a pointer to it. func Uint32(v uint32) *uint32 { return &v } // Uint64 is a helper routine that allocates a new uint64 value // to store v and returns a pointer to it. func Uint64(v uint64) *uint64 { return &v } // String is a helper routine that allocates a new string value // to store v and returns a pointer to it. func String(v string) *string { return &v } // EnumName is a helper function to simplify printing protocol buffer enums // by name. Given an enum map and a value, it returns a useful string. func EnumName(m map[int32]string, v int32) string { s, ok := m[v] if ok { return s } return strconv.Itoa(int(v)) } // UnmarshalJSONEnum is a helper function to simplify recovering enum int values // from their JSON-encoded representation. Given a map from the enum's symbolic // names to its int values, and a byte buffer containing the JSON-encoded // value, it returns an int32 that can be cast to the enum type by the caller. // // The function can deal with both JSON representations, numeric and symbolic. func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error) { if data[0] == '"' { // New style: enums are strings. var repr string if err := json.Unmarshal(data, &repr); err != nil { return -1, err } val, ok := m[repr] if !ok { return 0, fmt.Errorf("unrecognized enum %s value %q", enumName, repr) } return val, nil } // Old style: enums are ints. var val int32 if err := json.Unmarshal(data, &val); err != nil { return 0, fmt.Errorf("cannot unmarshal %#q into enum %s", data, enumName) } return val, nil } // DebugPrint dumps the encoded data in b in a debugging format with a header // including the string s. Used in testing but made available for general debugging. func (p *Buffer) DebugPrint(s string, b []byte) { var u uint64 obuf := p.buf index := p.index p.buf = b p.index = 0 depth := 0 fmt.Printf("\n--- %s ---\n", s) out: for { for i := 0; i < depth; i++ { fmt.Print(" ") } index := p.index if index == len(p.buf) { break } op, err := p.DecodeVarint() if err != nil { fmt.Printf("%3d: fetching op err %v\n", index, err) break out } tag := op >> 3 wire := op & 7 switch wire { default: fmt.Printf("%3d: t=%3d unknown wire=%d\n", index, tag, wire) break out case WireBytes: var r []byte r, err = p.DecodeRawBytes(false) if err != nil { break out } fmt.Printf("%3d: t=%3d bytes [%d]", index, tag, len(r)) if len(r) <= 6 { for i := 0; i < len(r); i++ { fmt.Printf(" %.2x", r[i]) } } else { for i := 0; i < 3; i++ { fmt.Printf(" %.2x", r[i]) } fmt.Printf(" ..") for i := len(r) - 3; i < len(r); i++ { fmt.Printf(" %.2x", r[i]) } } fmt.Printf("\n") case WireFixed32: u, err = p.DecodeFixed32() if err != nil { fmt.Printf("%3d: t=%3d fix32 err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d fix32 %d\n", index, tag, u) case WireFixed64: u, err = p.DecodeFixed64() if err != nil { fmt.Printf("%3d: t=%3d fix64 err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d fix64 %d\n", index, tag, u) case WireVarint: u, err = p.DecodeVarint() if err != nil { fmt.Printf("%3d: t=%3d varint err %v\n", index, tag, err) break out } fmt.Printf("%3d: t=%3d varint %d\n", index, tag, u) case WireStartGroup: fmt.Printf("%3d: t=%3d start\n", index, tag) depth++ case WireEndGroup: depth-- fmt.Printf("%3d: t=%3d end\n", index, tag) } } if depth != 0 { fmt.Printf("%3d: start-end not balanced %d\n", p.index, depth) } fmt.Printf("\n") p.buf = obuf p.index = index } // SetDefaults sets unset protocol buffer fields to their default values. // It only modifies fields that are both unset and have defined defaults. // It recursively sets default values in any non-nil sub-messages. func SetDefaults(pb Message) { setDefaults(reflect.ValueOf(pb), true, false) } // v is a pointer to a struct. func setDefaults(v reflect.Value, recur, zeros bool) { v = v.Elem() defaultMu.RLock() dm, ok := defaults[v.Type()] defaultMu.RUnlock() if !ok { dm = buildDefaultMessage(v.Type()) defaultMu.Lock() defaults[v.Type()] = dm defaultMu.Unlock() } for _, sf := range dm.scalars { f := v.Field(sf.index) if !f.IsNil() { // field already set continue } dv := sf.value if dv == nil && !zeros { // no explicit default, and don't want to set zeros continue } fptr := f.Addr().Interface() // **T // TODO: Consider batching the allocations we do here. switch sf.kind { case reflect.Bool: b := new(bool) if dv != nil { *b = dv.(bool) } *(fptr.(**bool)) = b case reflect.Float32: f := new(float32) if dv != nil { *f = dv.(float32) } *(fptr.(**float32)) = f case reflect.Float64: f := new(float64) if dv != nil { *f = dv.(float64) } *(fptr.(**float64)) = f case reflect.Int32: // might be an enum if ft := f.Type(); ft != int32PtrType { // enum f.Set(reflect.New(ft.Elem())) if dv != nil { f.Elem().SetInt(int64(dv.(int32))) } } else { // int32 field i := new(int32) if dv != nil { *i = dv.(int32) } *(fptr.(**int32)) = i } case reflect.Int64: i := new(int64) if dv != nil { *i = dv.(int64) } *(fptr.(**int64)) = i case reflect.String: s := new(string) if dv != nil { *s = dv.(string) } *(fptr.(**string)) = s case reflect.Uint8: // exceptional case: []byte var b []byte if dv != nil { db := dv.([]byte) b = make([]byte, len(db)) copy(b, db) } else { b = []byte{} } *(fptr.(*[]byte)) = b case reflect.Uint32: u := new(uint32) if dv != nil { *u = dv.(uint32) } *(fptr.(**uint32)) = u case reflect.Uint64: u := new(uint64) if dv != nil { *u = dv.(uint64) } *(fptr.(**uint64)) = u default: log.Printf("proto: can't set default for field %v (sf.kind=%v)", f, sf.kind) } } for _, ni := range dm.nested { f := v.Field(ni) // f is *T or []*T or map[T]*T switch f.Kind() { case reflect.Ptr: if f.IsNil() { continue } setDefaults(f, recur, zeros) case reflect.Slice: for i := 0; i < f.Len(); i++ { e := f.Index(i) if e.IsNil() { continue } setDefaults(e, recur, zeros) } case reflect.Map: for _, k := range f.MapKeys() { e := f.MapIndex(k) if e.IsNil() { continue } setDefaults(e, recur, zeros) } } } } var ( // defaults maps a protocol buffer struct type to a slice of the fields, // with its scalar fields set to their proto-declared non-zero default values. defaultMu sync.RWMutex defaults = make(map[reflect.Type]defaultMessage) int32PtrType = reflect.TypeOf((*int32)(nil)) ) // defaultMessage represents information about the default values of a message. type defaultMessage struct { scalars []scalarField nested []int // struct field index of nested messages } type scalarField struct { index int // struct field index kind reflect.Kind // element type (the T in *T or []T) value interface{} // the proto-declared default value, or nil } // t is a struct type. func buildDefaultMessage(t reflect.Type) (dm defaultMessage) { sprop := GetProperties(t) for _, prop := range sprop.Prop { fi, ok := sprop.decoderTags.get(prop.Tag) if !ok { // XXX_unrecognized continue } ft := t.Field(fi).Type sf, nested, err := fieldDefault(ft, prop) switch { case err != nil: log.Print(err) case nested: dm.nested = append(dm.nested, fi) case sf != nil: sf.index = fi dm.scalars = append(dm.scalars, *sf) } } return dm } // fieldDefault returns the scalarField for field type ft. // sf will be nil if the field can not have a default. // nestedMessage will be true if this is a nested message. // Note that sf.index is not set on return. func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMessage bool, err error) { var canHaveDefault bool switch ft.Kind() { case reflect.Ptr: if ft.Elem().Kind() == reflect.Struct { nestedMessage = true } else { canHaveDefault = true // proto2 scalar field } case reflect.Slice: switch ft.Elem().Kind() { case reflect.Ptr: nestedMessage = true // repeated message case reflect.Uint8: canHaveDefault = true // bytes field } case reflect.Map: if ft.Elem().Kind() == reflect.Ptr { nestedMessage = true // map with message values } } if !canHaveDefault { if nestedMessage { return nil, true, nil } return nil, false, nil } // We now know that ft is a pointer or slice. sf = &scalarField{kind: ft.Elem().Kind()} // scalar fields without defaults if !prop.HasDefault { return sf, false, nil } // a scalar field: either *T or []byte switch ft.Elem().Kind() { case reflect.Bool: x, err := strconv.ParseBool(prop.Default) if err != nil { return nil, false, fmt.Errorf("proto: bad default bool %q: %v", prop.Default, err) } sf.value = x case reflect.Float32: x, err := strconv.ParseFloat(prop.Default, 32) if err != nil { return nil, false, fmt.Errorf("proto: bad default float32 %q: %v", prop.Default, err) } sf.value = float32(x) case reflect.Float64: x, err := strconv.ParseFloat(prop.Default, 64) if err != nil { return nil, false, fmt.Errorf("proto: bad default float64 %q: %v", prop.Default, err) } sf.value = x case reflect.Int32: x, err := strconv.ParseInt(prop.Default, 10, 32) if err != nil { return nil, false, fmt.Errorf("proto: bad default int32 %q: %v", prop.Default, err) } sf.value = int32(x) case reflect.Int64: x, err := strconv.ParseInt(prop.Default, 10, 64) if err != nil { return nil, false, fmt.Errorf("proto: bad default int64 %q: %v", prop.Default, err) } sf.value = x case reflect.String: sf.value = prop.Default case reflect.Uint8: // []byte (not *uint8) sf.value = []byte(prop.Default) case reflect.Uint32: x, err := strconv.ParseUint(prop.Default, 10, 32) if err != nil { return nil, false, fmt.Errorf("proto: bad default uint32 %q: %v", prop.Default, err) } sf.value = uint32(x) case reflect.Uint64: x, err := strconv.ParseUint(prop.Default, 10, 64) if err != nil { return nil, false, fmt.Errorf("proto: bad default uint64 %q: %v", prop.Default, err) } sf.value = x default: return nil, false, fmt.Errorf("proto: unhandled def kind %v", ft.Elem().Kind()) } return sf, false, nil } // mapKeys returns a sort.Interface to be used for sorting the map keys. // Map fields may have key types of non-float scalars, strings and enums. func mapKeys(vs []reflect.Value) sort.Interface { s := mapKeySorter{vs: vs} // Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps. if len(vs) == 0 { return s } switch vs[0].Kind() { case reflect.Int32, reflect.Int64: s.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() } case reflect.Uint32, reflect.Uint64: s.less = func(a, b reflect.Value) bool { return a.Uint() < b.Uint() } case reflect.Bool: s.less = func(a, b reflect.Value) bool { return !a.Bool() && b.Bool() } // false < true case reflect.String: s.less = func(a, b reflect.Value) bool { return a.String() < b.String() } default: panic(fmt.Sprintf("unsupported map key type: %v", vs[0].Kind())) } return s } type mapKeySorter struct { vs []reflect.Value less func(a, b reflect.Value) bool } func (s mapKeySorter) Len() int { return len(s.vs) } func (s mapKeySorter) Swap(i, j int) { s.vs[i], s.vs[j] = s.vs[j], s.vs[i] } func (s mapKeySorter) Less(i, j int) bool { return s.less(s.vs[i], s.vs[j]) } // isProto3Zero reports whether v is a zero proto3 value. func isProto3Zero(v reflect.Value) bool { switch v.Kind() { case reflect.Bool: return !v.Bool() case reflect.Int32, reflect.Int64: return v.Int() == 0 case reflect.Uint32, reflect.Uint64: return v.Uint() == 0 case reflect.Float32, reflect.Float64: return v.Float() == 0 case reflect.String: return v.String() == "" } return false } const ( // ProtoPackageIsVersion3 is referenced from generated protocol buffer files // to assert that that code is compatible with this version of the proto package. ProtoPackageIsVersion3 = true // ProtoPackageIsVersion2 is referenced from generated protocol buffer files // to assert that that code is compatible with this version of the proto package. ProtoPackageIsVersion2 = true // ProtoPackageIsVersion1 is referenced from generated protocol buffer files // to assert that that code is compatible with this version of the proto package. ProtoPackageIsVersion1 = true ) // InternalMessageInfo is a type used internally by generated .pb.go files. // This type is not intended to be used by non-generated code. // This type is not subject to any compatibility guarantee. type InternalMessageInfo struct { marshal *marshalInfo unmarshal *unmarshalInfo merge *mergeInfo discard *discardInfo } ================================================ FILE: vendor/github.com/golang/protobuf/proto/message_set.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto /* * Support for message sets. */ import ( "errors" ) // errNoMessageTypeID occurs when a protocol buffer does not have a message type ID. // A message type ID is required for storing a protocol buffer in a message set. var errNoMessageTypeID = errors.New("proto does not have a message type ID") // The first two types (_MessageSet_Item and messageSet) // model what the protocol compiler produces for the following protocol message: // message MessageSet { // repeated group Item = 1 { // required int32 type_id = 2; // required string message = 3; // }; // } // That is the MessageSet wire format. We can't use a proto to generate these // because that would introduce a circular dependency between it and this package. type _MessageSet_Item struct { TypeId *int32 `protobuf:"varint,2,req,name=type_id"` Message []byte `protobuf:"bytes,3,req,name=message"` } type messageSet struct { Item []*_MessageSet_Item `protobuf:"group,1,rep"` XXX_unrecognized []byte // TODO: caching? } // Make sure messageSet is a Message. var _ Message = (*messageSet)(nil) // messageTypeIder is an interface satisfied by a protocol buffer type // that may be stored in a MessageSet. type messageTypeIder interface { MessageTypeId() int32 } func (ms *messageSet) find(pb Message) *_MessageSet_Item { mti, ok := pb.(messageTypeIder) if !ok { return nil } id := mti.MessageTypeId() for _, item := range ms.Item { if *item.TypeId == id { return item } } return nil } func (ms *messageSet) Has(pb Message) bool { return ms.find(pb) != nil } func (ms *messageSet) Unmarshal(pb Message) error { if item := ms.find(pb); item != nil { return Unmarshal(item.Message, pb) } if _, ok := pb.(messageTypeIder); !ok { return errNoMessageTypeID } return nil // TODO: return error instead? } func (ms *messageSet) Marshal(pb Message) error { msg, err := Marshal(pb) if err != nil { return err } if item := ms.find(pb); item != nil { // reuse existing item item.Message = msg return nil } mti, ok := pb.(messageTypeIder) if !ok { return errNoMessageTypeID } mtid := mti.MessageTypeId() ms.Item = append(ms.Item, &_MessageSet_Item{ TypeId: &mtid, Message: msg, }) return nil } func (ms *messageSet) Reset() { *ms = messageSet{} } func (ms *messageSet) String() string { return CompactTextString(ms) } func (*messageSet) ProtoMessage() {} // Support for the message_set_wire_format message option. func skipVarint(buf []byte) []byte { i := 0 for ; buf[i]&0x80 != 0; i++ { } return buf[i+1:] } // unmarshalMessageSet decodes the extension map encoded in buf in the message set wire format. // It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option. func unmarshalMessageSet(buf []byte, exts interface{}) error { var m map[int32]Extension switch exts := exts.(type) { case *XXX_InternalExtensions: m = exts.extensionsWrite() case map[int32]Extension: m = exts default: return errors.New("proto: not an extension map") } ms := new(messageSet) if err := Unmarshal(buf, ms); err != nil { return err } for _, item := range ms.Item { id := *item.TypeId msg := item.Message // Restore wire type and field number varint, plus length varint. // Be careful to preserve duplicate items. b := EncodeVarint(uint64(id)<<3 | WireBytes) if ext, ok := m[id]; ok { // Existing data; rip off the tag and length varint // so we join the new data correctly. // We can assume that ext.enc is set because we are unmarshaling. o := ext.enc[len(b):] // skip wire type and field number _, n := DecodeVarint(o) // calculate length of length varint o = o[n:] // skip length varint msg = append(o, msg...) // join old data and new data } b = append(b, EncodeVarint(uint64(len(msg)))...) b = append(b, msg...) m[id] = Extension{enc: b} } return nil } ================================================ FILE: vendor/github.com/golang/protobuf/proto/pointer_reflect.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2012 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // +build purego appengine js // This file contains an implementation of proto field accesses using package reflect. // It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can // be used on App Engine. package proto import ( "reflect" "sync" ) const unsafeAllowed = false // A field identifies a field in a struct, accessible from a pointer. // In this implementation, a field is identified by the sequence of field indices // passed to reflect's FieldByIndex. type field []int // toField returns a field equivalent to the given reflect field. func toField(f *reflect.StructField) field { return f.Index } // invalidField is an invalid field identifier. var invalidField = field(nil) // zeroField is a noop when calling pointer.offset. var zeroField = field([]int{}) // IsValid reports whether the field identifier is valid. func (f field) IsValid() bool { return f != nil } // The pointer type is for the table-driven decoder. // The implementation here uses a reflect.Value of pointer type to // create a generic pointer. In pointer_unsafe.go we use unsafe // instead of reflect to implement the same (but faster) interface. type pointer struct { v reflect.Value } // toPointer converts an interface of pointer type to a pointer // that points to the same target. func toPointer(i *Message) pointer { return pointer{v: reflect.ValueOf(*i)} } // toAddrPointer converts an interface to a pointer that points to // the interface data. func toAddrPointer(i *interface{}, isptr, deref bool) pointer { v := reflect.ValueOf(*i) u := reflect.New(v.Type()) u.Elem().Set(v) if deref { u = u.Elem() } return pointer{v: u} } // valToPointer converts v to a pointer. v must be of pointer type. func valToPointer(v reflect.Value) pointer { return pointer{v: v} } // offset converts from a pointer to a structure to a pointer to // one of its fields. func (p pointer) offset(f field) pointer { return pointer{v: p.v.Elem().FieldByIndex(f).Addr()} } func (p pointer) isNil() bool { return p.v.IsNil() } // grow updates the slice s in place to make it one element longer. // s must be addressable. // Returns the (addressable) new element. func grow(s reflect.Value) reflect.Value { n, m := s.Len(), s.Cap() if n < m { s.SetLen(n + 1) } else { s.Set(reflect.Append(s, reflect.Zero(s.Type().Elem()))) } return s.Index(n) } func (p pointer) toInt64() *int64 { return p.v.Interface().(*int64) } func (p pointer) toInt64Ptr() **int64 { return p.v.Interface().(**int64) } func (p pointer) toInt64Slice() *[]int64 { return p.v.Interface().(*[]int64) } var int32ptr = reflect.TypeOf((*int32)(nil)) func (p pointer) toInt32() *int32 { return p.v.Convert(int32ptr).Interface().(*int32) } // The toInt32Ptr/Slice methods don't work because of enums. // Instead, we must use set/get methods for the int32ptr/slice case. /* func (p pointer) toInt32Ptr() **int32 { return p.v.Interface().(**int32) } func (p pointer) toInt32Slice() *[]int32 { return p.v.Interface().(*[]int32) } */ func (p pointer) getInt32Ptr() *int32 { if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) { // raw int32 type return p.v.Elem().Interface().(*int32) } // an enum return p.v.Elem().Convert(int32PtrType).Interface().(*int32) } func (p pointer) setInt32Ptr(v int32) { // Allocate value in a *int32. Possibly convert that to a *enum. // Then assign it to a **int32 or **enum. // Note: we can convert *int32 to *enum, but we can't convert // **int32 to **enum! p.v.Elem().Set(reflect.ValueOf(&v).Convert(p.v.Type().Elem())) } // getInt32Slice copies []int32 from p as a new slice. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) getInt32Slice() []int32 { if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) { // raw int32 type return p.v.Elem().Interface().([]int32) } // an enum // Allocate a []int32, then assign []enum's values into it. // Note: we can't convert []enum to []int32. slice := p.v.Elem() s := make([]int32, slice.Len()) for i := 0; i < slice.Len(); i++ { s[i] = int32(slice.Index(i).Int()) } return s } // setInt32Slice copies []int32 into p as a new slice. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) setInt32Slice(v []int32) { if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) { // raw int32 type p.v.Elem().Set(reflect.ValueOf(v)) return } // an enum // Allocate a []enum, then assign []int32's values into it. // Note: we can't convert []enum to []int32. slice := reflect.MakeSlice(p.v.Type().Elem(), len(v), cap(v)) for i, x := range v { slice.Index(i).SetInt(int64(x)) } p.v.Elem().Set(slice) } func (p pointer) appendInt32Slice(v int32) { grow(p.v.Elem()).SetInt(int64(v)) } func (p pointer) toUint64() *uint64 { return p.v.Interface().(*uint64) } func (p pointer) toUint64Ptr() **uint64 { return p.v.Interface().(**uint64) } func (p pointer) toUint64Slice() *[]uint64 { return p.v.Interface().(*[]uint64) } func (p pointer) toUint32() *uint32 { return p.v.Interface().(*uint32) } func (p pointer) toUint32Ptr() **uint32 { return p.v.Interface().(**uint32) } func (p pointer) toUint32Slice() *[]uint32 { return p.v.Interface().(*[]uint32) } func (p pointer) toBool() *bool { return p.v.Interface().(*bool) } func (p pointer) toBoolPtr() **bool { return p.v.Interface().(**bool) } func (p pointer) toBoolSlice() *[]bool { return p.v.Interface().(*[]bool) } func (p pointer) toFloat64() *float64 { return p.v.Interface().(*float64) } func (p pointer) toFloat64Ptr() **float64 { return p.v.Interface().(**float64) } func (p pointer) toFloat64Slice() *[]float64 { return p.v.Interface().(*[]float64) } func (p pointer) toFloat32() *float32 { return p.v.Interface().(*float32) } func (p pointer) toFloat32Ptr() **float32 { return p.v.Interface().(**float32) } func (p pointer) toFloat32Slice() *[]float32 { return p.v.Interface().(*[]float32) } func (p pointer) toString() *string { return p.v.Interface().(*string) } func (p pointer) toStringPtr() **string { return p.v.Interface().(**string) } func (p pointer) toStringSlice() *[]string { return p.v.Interface().(*[]string) } func (p pointer) toBytes() *[]byte { return p.v.Interface().(*[]byte) } func (p pointer) toBytesSlice() *[][]byte { return p.v.Interface().(*[][]byte) } func (p pointer) toExtensions() *XXX_InternalExtensions { return p.v.Interface().(*XXX_InternalExtensions) } func (p pointer) toOldExtensions() *map[int32]Extension { return p.v.Interface().(*map[int32]Extension) } func (p pointer) getPointer() pointer { return pointer{v: p.v.Elem()} } func (p pointer) setPointer(q pointer) { p.v.Elem().Set(q.v) } func (p pointer) appendPointer(q pointer) { grow(p.v.Elem()).Set(q.v) } // getPointerSlice copies []*T from p as a new []pointer. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) getPointerSlice() []pointer { if p.v.IsNil() { return nil } n := p.v.Elem().Len() s := make([]pointer, n) for i := 0; i < n; i++ { s[i] = pointer{v: p.v.Elem().Index(i)} } return s } // setPointerSlice copies []pointer into p as a new []*T. // This behavior differs from the implementation in pointer_unsafe.go. func (p pointer) setPointerSlice(v []pointer) { if v == nil { p.v.Elem().Set(reflect.New(p.v.Elem().Type()).Elem()) return } s := reflect.MakeSlice(p.v.Elem().Type(), 0, len(v)) for _, p := range v { s = reflect.Append(s, p.v) } p.v.Elem().Set(s) } // getInterfacePointer returns a pointer that points to the // interface data of the interface pointed by p. func (p pointer) getInterfacePointer() pointer { if p.v.Elem().IsNil() { return pointer{v: p.v.Elem()} } return pointer{v: p.v.Elem().Elem().Elem().Field(0).Addr()} // *interface -> interface -> *struct -> struct } func (p pointer) asPointerTo(t reflect.Type) reflect.Value { // TODO: check that p.v.Type().Elem() == t? return p.v } func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } func atomicLoadDiscardInfo(p **discardInfo) *discardInfo { atomicLock.Lock() defer atomicLock.Unlock() return *p } func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) { atomicLock.Lock() defer atomicLock.Unlock() *p = v } var atomicLock sync.Mutex ================================================ FILE: vendor/github.com/golang/protobuf/proto/pointer_unsafe.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2012 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // +build !purego,!appengine,!js // This file contains the implementation of the proto field accesses using package unsafe. package proto import ( "reflect" "sync/atomic" "unsafe" ) const unsafeAllowed = true // A field identifies a field in a struct, accessible from a pointer. // In this implementation, a field is identified by its byte offset from the start of the struct. type field uintptr // toField returns a field equivalent to the given reflect field. func toField(f *reflect.StructField) field { return field(f.Offset) } // invalidField is an invalid field identifier. const invalidField = ^field(0) // zeroField is a noop when calling pointer.offset. const zeroField = field(0) // IsValid reports whether the field identifier is valid. func (f field) IsValid() bool { return f != invalidField } // The pointer type below is for the new table-driven encoder/decoder. // The implementation here uses unsafe.Pointer to create a generic pointer. // In pointer_reflect.go we use reflect instead of unsafe to implement // the same (but slower) interface. type pointer struct { p unsafe.Pointer } // size of pointer var ptrSize = unsafe.Sizeof(uintptr(0)) // toPointer converts an interface of pointer type to a pointer // that points to the same target. func toPointer(i *Message) pointer { // Super-tricky - read pointer out of data word of interface value. // Saves ~25ns over the equivalent: // return valToPointer(reflect.ValueOf(*i)) return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]} } // toAddrPointer converts an interface to a pointer that points to // the interface data. func toAddrPointer(i *interface{}, isptr, deref bool) (p pointer) { // Super-tricky - read or get the address of data word of interface value. if isptr { // The interface is of pointer type, thus it is a direct interface. // The data word is the pointer data itself. We take its address. p = pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)} } else { // The interface is not of pointer type. The data word is the pointer // to the data. p = pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]} } if deref { p.p = *(*unsafe.Pointer)(p.p) } return p } // valToPointer converts v to a pointer. v must be of pointer type. func valToPointer(v reflect.Value) pointer { return pointer{p: unsafe.Pointer(v.Pointer())} } // offset converts from a pointer to a structure to a pointer to // one of its fields. func (p pointer) offset(f field) pointer { // For safety, we should panic if !f.IsValid, however calling panic causes // this to no longer be inlineable, which is a serious performance cost. /* if !f.IsValid() { panic("invalid field") } */ return pointer{p: unsafe.Pointer(uintptr(p.p) + uintptr(f))} } func (p pointer) isNil() bool { return p.p == nil } func (p pointer) toInt64() *int64 { return (*int64)(p.p) } func (p pointer) toInt64Ptr() **int64 { return (**int64)(p.p) } func (p pointer) toInt64Slice() *[]int64 { return (*[]int64)(p.p) } func (p pointer) toInt32() *int32 { return (*int32)(p.p) } // See pointer_reflect.go for why toInt32Ptr/Slice doesn't exist. /* func (p pointer) toInt32Ptr() **int32 { return (**int32)(p.p) } func (p pointer) toInt32Slice() *[]int32 { return (*[]int32)(p.p) } */ func (p pointer) getInt32Ptr() *int32 { return *(**int32)(p.p) } func (p pointer) setInt32Ptr(v int32) { *(**int32)(p.p) = &v } // getInt32Slice loads a []int32 from p. // The value returned is aliased with the original slice. // This behavior differs from the implementation in pointer_reflect.go. func (p pointer) getInt32Slice() []int32 { return *(*[]int32)(p.p) } // setInt32Slice stores a []int32 to p. // The value set is aliased with the input slice. // This behavior differs from the implementation in pointer_reflect.go. func (p pointer) setInt32Slice(v []int32) { *(*[]int32)(p.p) = v } // TODO: Can we get rid of appendInt32Slice and use setInt32Slice instead? func (p pointer) appendInt32Slice(v int32) { s := (*[]int32)(p.p) *s = append(*s, v) } func (p pointer) toUint64() *uint64 { return (*uint64)(p.p) } func (p pointer) toUint64Ptr() **uint64 { return (**uint64)(p.p) } func (p pointer) toUint64Slice() *[]uint64 { return (*[]uint64)(p.p) } func (p pointer) toUint32() *uint32 { return (*uint32)(p.p) } func (p pointer) toUint32Ptr() **uint32 { return (**uint32)(p.p) } func (p pointer) toUint32Slice() *[]uint32 { return (*[]uint32)(p.p) } func (p pointer) toBool() *bool { return (*bool)(p.p) } func (p pointer) toBoolPtr() **bool { return (**bool)(p.p) } func (p pointer) toBoolSlice() *[]bool { return (*[]bool)(p.p) } func (p pointer) toFloat64() *float64 { return (*float64)(p.p) } func (p pointer) toFloat64Ptr() **float64 { return (**float64)(p.p) } func (p pointer) toFloat64Slice() *[]float64 { return (*[]float64)(p.p) } func (p pointer) toFloat32() *float32 { return (*float32)(p.p) } func (p pointer) toFloat32Ptr() **float32 { return (**float32)(p.p) } func (p pointer) toFloat32Slice() *[]float32 { return (*[]float32)(p.p) } func (p pointer) toString() *string { return (*string)(p.p) } func (p pointer) toStringPtr() **string { return (**string)(p.p) } func (p pointer) toStringSlice() *[]string { return (*[]string)(p.p) } func (p pointer) toBytes() *[]byte { return (*[]byte)(p.p) } func (p pointer) toBytesSlice() *[][]byte { return (*[][]byte)(p.p) } func (p pointer) toExtensions() *XXX_InternalExtensions { return (*XXX_InternalExtensions)(p.p) } func (p pointer) toOldExtensions() *map[int32]Extension { return (*map[int32]Extension)(p.p) } // getPointerSlice loads []*T from p as a []pointer. // The value returned is aliased with the original slice. // This behavior differs from the implementation in pointer_reflect.go. func (p pointer) getPointerSlice() []pointer { // Super-tricky - p should point to a []*T where T is a // message type. We load it as []pointer. return *(*[]pointer)(p.p) } // setPointerSlice stores []pointer into p as a []*T. // The value set is aliased with the input slice. // This behavior differs from the implementation in pointer_reflect.go. func (p pointer) setPointerSlice(v []pointer) { // Super-tricky - p should point to a []*T where T is a // message type. We store it as []pointer. *(*[]pointer)(p.p) = v } // getPointer loads the pointer at p and returns it. func (p pointer) getPointer() pointer { return pointer{p: *(*unsafe.Pointer)(p.p)} } // setPointer stores the pointer q at p. func (p pointer) setPointer(q pointer) { *(*unsafe.Pointer)(p.p) = q.p } // append q to the slice pointed to by p. func (p pointer) appendPointer(q pointer) { s := (*[]unsafe.Pointer)(p.p) *s = append(*s, q.p) } // getInterfacePointer returns a pointer that points to the // interface data of the interface pointed by p. func (p pointer) getInterfacePointer() pointer { // Super-tricky - read pointer out of data word of interface value. return pointer{p: (*(*[2]unsafe.Pointer)(p.p))[1]} } // asPointerTo returns a reflect.Value that is a pointer to an // object of type t stored at p. func (p pointer) asPointerTo(t reflect.Type) reflect.Value { return reflect.NewAt(t, p.p) } func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo { return (*unmarshalInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) } func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v)) } func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo { return (*marshalInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) } func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v)) } func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo { return (*mergeInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) } func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v)) } func atomicLoadDiscardInfo(p **discardInfo) *discardInfo { return (*discardInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p)))) } func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) { atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v)) } ================================================ FILE: vendor/github.com/golang/protobuf/proto/properties.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto /* * Routines for encoding data into the wire format for protocol buffers. */ import ( "fmt" "log" "reflect" "sort" "strconv" "strings" "sync" ) const debug bool = false // Constants that identify the encoding of a value on the wire. const ( WireVarint = 0 WireFixed64 = 1 WireBytes = 2 WireStartGroup = 3 WireEndGroup = 4 WireFixed32 = 5 ) // tagMap is an optimization over map[int]int for typical protocol buffer // use-cases. Encoded protocol buffers are often in tag order with small tag // numbers. type tagMap struct { fastTags []int slowTags map[int]int } // tagMapFastLimit is the upper bound on the tag number that will be stored in // the tagMap slice rather than its map. const tagMapFastLimit = 1024 func (p *tagMap) get(t int) (int, bool) { if t > 0 && t < tagMapFastLimit { if t >= len(p.fastTags) { return 0, false } fi := p.fastTags[t] return fi, fi >= 0 } fi, ok := p.slowTags[t] return fi, ok } func (p *tagMap) put(t int, fi int) { if t > 0 && t < tagMapFastLimit { for len(p.fastTags) < t+1 { p.fastTags = append(p.fastTags, -1) } p.fastTags[t] = fi return } if p.slowTags == nil { p.slowTags = make(map[int]int) } p.slowTags[t] = fi } // StructProperties represents properties for all the fields of a struct. // decoderTags and decoderOrigNames should only be used by the decoder. type StructProperties struct { Prop []*Properties // properties for each field reqCount int // required count decoderTags tagMap // map from proto tag to struct field number decoderOrigNames map[string]int // map from original name to struct field number order []int // list of struct field numbers in tag order // OneofTypes contains information about the oneof fields in this message. // It is keyed by the original name of a field. OneofTypes map[string]*OneofProperties } // OneofProperties represents information about a specific field in a oneof. type OneofProperties struct { Type reflect.Type // pointer to generated struct type for this oneof field Field int // struct field number of the containing oneof in the message Prop *Properties } // Implement the sorting interface so we can sort the fields in tag order, as recommended by the spec. // See encode.go, (*Buffer).enc_struct. func (sp *StructProperties) Len() int { return len(sp.order) } func (sp *StructProperties) Less(i, j int) bool { return sp.Prop[sp.order[i]].Tag < sp.Prop[sp.order[j]].Tag } func (sp *StructProperties) Swap(i, j int) { sp.order[i], sp.order[j] = sp.order[j], sp.order[i] } // Properties represents the protocol-specific behavior of a single struct field. type Properties struct { Name string // name of the field, for error messages OrigName string // original name before protocol compiler (always set) JSONName string // name to use for JSON; determined by protoc Wire string WireType int Tag int Required bool Optional bool Repeated bool Packed bool // relevant for repeated primitives only Enum string // set for enum types only proto3 bool // whether this is known to be a proto3 field oneof bool // whether this is a oneof field Default string // default value HasDefault bool // whether an explicit default was provided stype reflect.Type // set for struct types only sprop *StructProperties // set for struct types only mtype reflect.Type // set for map types only MapKeyProp *Properties // set for map types only MapValProp *Properties // set for map types only } // String formats the properties in the protobuf struct field tag style. func (p *Properties) String() string { s := p.Wire s += "," s += strconv.Itoa(p.Tag) if p.Required { s += ",req" } if p.Optional { s += ",opt" } if p.Repeated { s += ",rep" } if p.Packed { s += ",packed" } s += ",name=" + p.OrigName if p.JSONName != p.OrigName { s += ",json=" + p.JSONName } if p.proto3 { s += ",proto3" } if p.oneof { s += ",oneof" } if len(p.Enum) > 0 { s += ",enum=" + p.Enum } if p.HasDefault { s += ",def=" + p.Default } return s } // Parse populates p by parsing a string in the protobuf struct field tag style. func (p *Properties) Parse(s string) { // "bytes,49,opt,name=foo,def=hello!" fields := strings.Split(s, ",") // breaks def=, but handled below. if len(fields) < 2 { log.Printf("proto: tag has too few fields: %q", s) return } p.Wire = fields[0] switch p.Wire { case "varint": p.WireType = WireVarint case "fixed32": p.WireType = WireFixed32 case "fixed64": p.WireType = WireFixed64 case "zigzag32": p.WireType = WireVarint case "zigzag64": p.WireType = WireVarint case "bytes", "group": p.WireType = WireBytes // no numeric converter for non-numeric types default: log.Printf("proto: tag has unknown wire type: %q", s) return } var err error p.Tag, err = strconv.Atoi(fields[1]) if err != nil { return } outer: for i := 2; i < len(fields); i++ { f := fields[i] switch { case f == "req": p.Required = true case f == "opt": p.Optional = true case f == "rep": p.Repeated = true case f == "packed": p.Packed = true case strings.HasPrefix(f, "name="): p.OrigName = f[5:] case strings.HasPrefix(f, "json="): p.JSONName = f[5:] case strings.HasPrefix(f, "enum="): p.Enum = f[5:] case f == "proto3": p.proto3 = true case f == "oneof": p.oneof = true case strings.HasPrefix(f, "def="): p.HasDefault = true p.Default = f[4:] // rest of string if i+1 < len(fields) { // Commas aren't escaped, and def is always last. p.Default += "," + strings.Join(fields[i+1:], ",") break outer } } } } var protoMessageType = reflect.TypeOf((*Message)(nil)).Elem() // setFieldProps initializes the field properties for submessages and maps. func (p *Properties) setFieldProps(typ reflect.Type, f *reflect.StructField, lockGetProp bool) { switch t1 := typ; t1.Kind() { case reflect.Ptr: if t1.Elem().Kind() == reflect.Struct { p.stype = t1.Elem() } case reflect.Slice: if t2 := t1.Elem(); t2.Kind() == reflect.Ptr && t2.Elem().Kind() == reflect.Struct { p.stype = t2.Elem() } case reflect.Map: p.mtype = t1 p.MapKeyProp = &Properties{} p.MapKeyProp.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp) p.MapValProp = &Properties{} vtype := p.mtype.Elem() if vtype.Kind() != reflect.Ptr && vtype.Kind() != reflect.Slice { // The value type is not a message (*T) or bytes ([]byte), // so we need encoders for the pointer to this type. vtype = reflect.PtrTo(vtype) } p.MapValProp.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp) } if p.stype != nil { if lockGetProp { p.sprop = GetProperties(p.stype) } else { p.sprop = getPropertiesLocked(p.stype) } } } var ( marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem() ) // Init populates the properties from a protocol buffer struct tag. func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) { p.init(typ, name, tag, f, true) } func (p *Properties) init(typ reflect.Type, name, tag string, f *reflect.StructField, lockGetProp bool) { // "bytes,49,opt,def=hello!" p.Name = name p.OrigName = name if tag == "" { return } p.Parse(tag) p.setFieldProps(typ, f, lockGetProp) } var ( propertiesMu sync.RWMutex propertiesMap = make(map[reflect.Type]*StructProperties) ) // GetProperties returns the list of properties for the type represented by t. // t must represent a generated struct type of a protocol message. func GetProperties(t reflect.Type) *StructProperties { if t.Kind() != reflect.Struct { panic("proto: type must have kind struct") } // Most calls to GetProperties in a long-running program will be // retrieving details for types we have seen before. propertiesMu.RLock() sprop, ok := propertiesMap[t] propertiesMu.RUnlock() if ok { return sprop } propertiesMu.Lock() sprop = getPropertiesLocked(t) propertiesMu.Unlock() return sprop } type ( oneofFuncsIface interface { XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{}) } oneofWrappersIface interface { XXX_OneofWrappers() []interface{} } ) // getPropertiesLocked requires that propertiesMu is held. func getPropertiesLocked(t reflect.Type) *StructProperties { if prop, ok := propertiesMap[t]; ok { return prop } prop := new(StructProperties) // in case of recursive protos, fill this in now. propertiesMap[t] = prop // build properties prop.Prop = make([]*Properties, t.NumField()) prop.order = make([]int, t.NumField()) for i := 0; i < t.NumField(); i++ { f := t.Field(i) p := new(Properties) name := f.Name p.init(f.Type, name, f.Tag.Get("protobuf"), &f, false) oneof := f.Tag.Get("protobuf_oneof") // special case if oneof != "" { // Oneof fields don't use the traditional protobuf tag. p.OrigName = oneof } prop.Prop[i] = p prop.order[i] = i if debug { print(i, " ", f.Name, " ", t.String(), " ") if p.Tag > 0 { print(p.String()) } print("\n") } } // Re-order prop.order. sort.Sort(prop) var oots []interface{} switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { case oneofFuncsIface: _, _, _, oots = m.XXX_OneofFuncs() case oneofWrappersIface: oots = m.XXX_OneofWrappers() } if len(oots) > 0 { // Interpret oneof metadata. prop.OneofTypes = make(map[string]*OneofProperties) for _, oot := range oots { oop := &OneofProperties{ Type: reflect.ValueOf(oot).Type(), // *T Prop: new(Properties), } sft := oop.Type.Elem().Field(0) oop.Prop.Name = sft.Name oop.Prop.Parse(sft.Tag.Get("protobuf")) // There will be exactly one interface field that // this new value is assignable to. for i := 0; i < t.NumField(); i++ { f := t.Field(i) if f.Type.Kind() != reflect.Interface { continue } if !oop.Type.AssignableTo(f.Type) { continue } oop.Field = i break } prop.OneofTypes[oop.Prop.OrigName] = oop } } // build required counts // build tags reqCount := 0 prop.decoderOrigNames = make(map[string]int) for i, p := range prop.Prop { if strings.HasPrefix(p.Name, "XXX_") { // Internal fields should not appear in tags/origNames maps. // They are handled specially when encoding and decoding. continue } if p.Required { reqCount++ } prop.decoderTags.put(p.Tag, i) prop.decoderOrigNames[p.OrigName] = i } prop.reqCount = reqCount return prop } // A global registry of enum types. // The generated code will register the generated maps by calling RegisterEnum. var enumValueMaps = make(map[string]map[string]int32) // RegisterEnum is called from the generated code to install the enum descriptor // maps into the global table to aid parsing text format protocol buffers. func RegisterEnum(typeName string, unusedNameMap map[int32]string, valueMap map[string]int32) { if _, ok := enumValueMaps[typeName]; ok { panic("proto: duplicate enum registered: " + typeName) } enumValueMaps[typeName] = valueMap } // EnumValueMap returns the mapping from names to integers of the // enum type enumType, or a nil if not found. func EnumValueMap(enumType string) map[string]int32 { return enumValueMaps[enumType] } // A registry of all linked message types. // The string is a fully-qualified proto name ("pkg.Message"). var ( protoTypedNils = make(map[string]Message) // a map from proto names to typed nil pointers protoMapTypes = make(map[string]reflect.Type) // a map from proto names to map types revProtoTypes = make(map[reflect.Type]string) ) // RegisterType is called from generated code and maps from the fully qualified // proto name to the type (pointer to struct) of the protocol buffer. func RegisterType(x Message, name string) { if _, ok := protoTypedNils[name]; ok { // TODO: Some day, make this a panic. log.Printf("proto: duplicate proto type registered: %s", name) return } t := reflect.TypeOf(x) if v := reflect.ValueOf(x); v.Kind() == reflect.Ptr && v.Pointer() == 0 { // Generated code always calls RegisterType with nil x. // This check is just for extra safety. protoTypedNils[name] = x } else { protoTypedNils[name] = reflect.Zero(t).Interface().(Message) } revProtoTypes[t] = name } // RegisterMapType is called from generated code and maps from the fully qualified // proto name to the native map type of the proto map definition. func RegisterMapType(x interface{}, name string) { if reflect.TypeOf(x).Kind() != reflect.Map { panic(fmt.Sprintf("RegisterMapType(%T, %q); want map", x, name)) } if _, ok := protoMapTypes[name]; ok { log.Printf("proto: duplicate proto type registered: %s", name) return } t := reflect.TypeOf(x) protoMapTypes[name] = t revProtoTypes[t] = name } // MessageName returns the fully-qualified proto name for the given message type. func MessageName(x Message) string { type xname interface { XXX_MessageName() string } if m, ok := x.(xname); ok { return m.XXX_MessageName() } return revProtoTypes[reflect.TypeOf(x)] } // MessageType returns the message type (pointer to struct) for a named message. // The type is not guaranteed to implement proto.Message if the name refers to a // map entry. func MessageType(name string) reflect.Type { if t, ok := protoTypedNils[name]; ok { return reflect.TypeOf(t) } return protoMapTypes[name] } // A registry of all linked proto files. var ( protoFiles = make(map[string][]byte) // file name => fileDescriptor ) // RegisterFile is called from generated code and maps from the // full file name of a .proto file to its compressed FileDescriptorProto. func RegisterFile(filename string, fileDescriptor []byte) { protoFiles[filename] = fileDescriptor } // FileDescriptor returns the compressed FileDescriptorProto for a .proto file. func FileDescriptor(filename string) []byte { return protoFiles[filename] } ================================================ FILE: vendor/github.com/golang/protobuf/proto/table_marshal.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "errors" "fmt" "math" "reflect" "sort" "strconv" "strings" "sync" "sync/atomic" "unicode/utf8" ) // a sizer takes a pointer to a field and the size of its tag, computes the size of // the encoded data. type sizer func(pointer, int) int // a marshaler takes a byte slice, a pointer to a field, and its tag (in wire format), // marshals the field to the end of the slice, returns the slice and error (if any). type marshaler func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) // marshalInfo is the information used for marshaling a message. type marshalInfo struct { typ reflect.Type fields []*marshalFieldInfo unrecognized field // offset of XXX_unrecognized extensions field // offset of XXX_InternalExtensions v1extensions field // offset of XXX_extensions sizecache field // offset of XXX_sizecache initialized int32 // 0 -- only typ is set, 1 -- fully initialized messageset bool // uses message set wire format hasmarshaler bool // has custom marshaler sync.RWMutex // protect extElems map, also for initialization extElems map[int32]*marshalElemInfo // info of extension elements } // marshalFieldInfo is the information used for marshaling a field of a message. type marshalFieldInfo struct { field field wiretag uint64 // tag in wire format tagsize int // size of tag in wire format sizer sizer marshaler marshaler isPointer bool required bool // field is required name string // name of the field, for error reporting oneofElems map[reflect.Type]*marshalElemInfo // info of oneof elements } // marshalElemInfo is the information used for marshaling an extension or oneof element. type marshalElemInfo struct { wiretag uint64 // tag in wire format tagsize int // size of tag in wire format sizer sizer marshaler marshaler isptr bool // elem is pointer typed, thus interface of this type is a direct interface (extension only) deref bool // dereference the pointer before operating on it; implies isptr } var ( marshalInfoMap = map[reflect.Type]*marshalInfo{} marshalInfoLock sync.Mutex ) // getMarshalInfo returns the information to marshal a given type of message. // The info it returns may not necessarily initialized. // t is the type of the message (NOT the pointer to it). func getMarshalInfo(t reflect.Type) *marshalInfo { marshalInfoLock.Lock() u, ok := marshalInfoMap[t] if !ok { u = &marshalInfo{typ: t} marshalInfoMap[t] = u } marshalInfoLock.Unlock() return u } // Size is the entry point from generated code, // and should be ONLY called by generated code. // It computes the size of encoded data of msg. // a is a pointer to a place to store cached marshal info. func (a *InternalMessageInfo) Size(msg Message) int { u := getMessageMarshalInfo(msg, a) ptr := toPointer(&msg) if ptr.isNil() { // We get here if msg is a typed nil ((*SomeMessage)(nil)), // so it satisfies the interface, and msg == nil wouldn't // catch it. We don't want crash in this case. return 0 } return u.size(ptr) } // Marshal is the entry point from generated code, // and should be ONLY called by generated code. // It marshals msg to the end of b. // a is a pointer to a place to store cached marshal info. func (a *InternalMessageInfo) Marshal(b []byte, msg Message, deterministic bool) ([]byte, error) { u := getMessageMarshalInfo(msg, a) ptr := toPointer(&msg) if ptr.isNil() { // We get here if msg is a typed nil ((*SomeMessage)(nil)), // so it satisfies the interface, and msg == nil wouldn't // catch it. We don't want crash in this case. return b, ErrNil } return u.marshal(b, ptr, deterministic) } func getMessageMarshalInfo(msg interface{}, a *InternalMessageInfo) *marshalInfo { // u := a.marshal, but atomically. // We use an atomic here to ensure memory consistency. u := atomicLoadMarshalInfo(&a.marshal) if u == nil { // Get marshal information from type of message. t := reflect.ValueOf(msg).Type() if t.Kind() != reflect.Ptr { panic(fmt.Sprintf("cannot handle non-pointer message type %v", t)) } u = getMarshalInfo(t.Elem()) // Store it in the cache for later users. // a.marshal = u, but atomically. atomicStoreMarshalInfo(&a.marshal, u) } return u } // size is the main function to compute the size of the encoded data of a message. // ptr is the pointer to the message. func (u *marshalInfo) size(ptr pointer) int { if atomic.LoadInt32(&u.initialized) == 0 { u.computeMarshalInfo() } // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. if u.hasmarshaler { m := ptr.asPointerTo(u.typ).Interface().(Marshaler) b, _ := m.Marshal() return len(b) } n := 0 for _, f := range u.fields { if f.isPointer && ptr.offset(f.field).getPointer().isNil() { // nil pointer always marshals to nothing continue } n += f.sizer(ptr.offset(f.field), f.tagsize) } if u.extensions.IsValid() { e := ptr.offset(u.extensions).toExtensions() if u.messageset { n += u.sizeMessageSet(e) } else { n += u.sizeExtensions(e) } } if u.v1extensions.IsValid() { m := *ptr.offset(u.v1extensions).toOldExtensions() n += u.sizeV1Extensions(m) } if u.unrecognized.IsValid() { s := *ptr.offset(u.unrecognized).toBytes() n += len(s) } // cache the result for use in marshal if u.sizecache.IsValid() { atomic.StoreInt32(ptr.offset(u.sizecache).toInt32(), int32(n)) } return n } // cachedsize gets the size from cache. If there is no cache (i.e. message is not generated), // fall back to compute the size. func (u *marshalInfo) cachedsize(ptr pointer) int { if u.sizecache.IsValid() { return int(atomic.LoadInt32(ptr.offset(u.sizecache).toInt32())) } return u.size(ptr) } // marshal is the main function to marshal a message. It takes a byte slice and appends // the encoded data to the end of the slice, returns the slice and error (if any). // ptr is the pointer to the message. // If deterministic is true, map is marshaled in deterministic order. func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte, error) { if atomic.LoadInt32(&u.initialized) == 0 { u.computeMarshalInfo() } // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. if u.hasmarshaler { m := ptr.asPointerTo(u.typ).Interface().(Marshaler) b1, err := m.Marshal() b = append(b, b1...) return b, err } var err, errLater error // The old marshaler encodes extensions at beginning. if u.extensions.IsValid() { e := ptr.offset(u.extensions).toExtensions() if u.messageset { b, err = u.appendMessageSet(b, e, deterministic) } else { b, err = u.appendExtensions(b, e, deterministic) } if err != nil { return b, err } } if u.v1extensions.IsValid() { m := *ptr.offset(u.v1extensions).toOldExtensions() b, err = u.appendV1Extensions(b, m, deterministic) if err != nil { return b, err } } for _, f := range u.fields { if f.required { if ptr.offset(f.field).getPointer().isNil() { // Required field is not set. // We record the error but keep going, to give a complete marshaling. if errLater == nil { errLater = &RequiredNotSetError{f.name} } continue } } if f.isPointer && ptr.offset(f.field).getPointer().isNil() { // nil pointer always marshals to nothing continue } b, err = f.marshaler(b, ptr.offset(f.field), f.wiretag, deterministic) if err != nil { if err1, ok := err.(*RequiredNotSetError); ok { // Required field in submessage is not set. // We record the error but keep going, to give a complete marshaling. if errLater == nil { errLater = &RequiredNotSetError{f.name + "." + err1.field} } continue } if err == errRepeatedHasNil { err = errors.New("proto: repeated field " + f.name + " has nil element") } if err == errInvalidUTF8 { if errLater == nil { fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name errLater = &invalidUTF8Error{fullName} } continue } return b, err } } if u.unrecognized.IsValid() { s := *ptr.offset(u.unrecognized).toBytes() b = append(b, s...) } return b, errLater } // computeMarshalInfo initializes the marshal info. func (u *marshalInfo) computeMarshalInfo() { u.Lock() defer u.Unlock() if u.initialized != 0 { // non-atomic read is ok as it is protected by the lock return } t := u.typ u.unrecognized = invalidField u.extensions = invalidField u.v1extensions = invalidField u.sizecache = invalidField // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. if reflect.PtrTo(t).Implements(marshalerType) { u.hasmarshaler = true atomic.StoreInt32(&u.initialized, 1) return } // get oneof implementers var oneofImplementers []interface{} switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { case oneofFuncsIface: _, _, _, oneofImplementers = m.XXX_OneofFuncs() case oneofWrappersIface: oneofImplementers = m.XXX_OneofWrappers() } n := t.NumField() // deal with XXX fields first for i := 0; i < t.NumField(); i++ { f := t.Field(i) if !strings.HasPrefix(f.Name, "XXX_") { continue } switch f.Name { case "XXX_sizecache": u.sizecache = toField(&f) case "XXX_unrecognized": u.unrecognized = toField(&f) case "XXX_InternalExtensions": u.extensions = toField(&f) u.messageset = f.Tag.Get("protobuf_messageset") == "1" case "XXX_extensions": u.v1extensions = toField(&f) case "XXX_NoUnkeyedLiteral": // nothing to do default: panic("unknown XXX field: " + f.Name) } n-- } // normal fields fields := make([]marshalFieldInfo, n) // batch allocation u.fields = make([]*marshalFieldInfo, 0, n) for i, j := 0, 0; i < t.NumField(); i++ { f := t.Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } field := &fields[j] j++ field.name = f.Name u.fields = append(u.fields, field) if f.Tag.Get("protobuf_oneof") != "" { field.computeOneofFieldInfo(&f, oneofImplementers) continue } if f.Tag.Get("protobuf") == "" { // field has no tag (not in generated message), ignore it u.fields = u.fields[:len(u.fields)-1] j-- continue } field.computeMarshalFieldInfo(&f) } // fields are marshaled in tag order on the wire. sort.Sort(byTag(u.fields)) atomic.StoreInt32(&u.initialized, 1) } // helper for sorting fields by tag type byTag []*marshalFieldInfo func (a byTag) Len() int { return len(a) } func (a byTag) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a byTag) Less(i, j int) bool { return a[i].wiretag < a[j].wiretag } // getExtElemInfo returns the information to marshal an extension element. // The info it returns is initialized. func (u *marshalInfo) getExtElemInfo(desc *ExtensionDesc) *marshalElemInfo { // get from cache first u.RLock() e, ok := u.extElems[desc.Field] u.RUnlock() if ok { return e } t := reflect.TypeOf(desc.ExtensionType) // pointer or slice to basic type or struct tags := strings.Split(desc.Tag, ",") tag, err := strconv.Atoi(tags[1]) if err != nil { panic("tag is not an integer") } wt := wiretype(tags[0]) if t.Kind() == reflect.Ptr && t.Elem().Kind() != reflect.Struct { t = t.Elem() } sizer, marshaler := typeMarshaler(t, tags, false, false) var deref bool if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 { t = reflect.PtrTo(t) deref = true } e = &marshalElemInfo{ wiretag: uint64(tag)<<3 | wt, tagsize: SizeVarint(uint64(tag) << 3), sizer: sizer, marshaler: marshaler, isptr: t.Kind() == reflect.Ptr, deref: deref, } // update cache u.Lock() if u.extElems == nil { u.extElems = make(map[int32]*marshalElemInfo) } u.extElems[desc.Field] = e u.Unlock() return e } // computeMarshalFieldInfo fills up the information to marshal a field. func (fi *marshalFieldInfo) computeMarshalFieldInfo(f *reflect.StructField) { // parse protobuf tag of the field. // tag has format of "bytes,49,opt,name=foo,def=hello!" tags := strings.Split(f.Tag.Get("protobuf"), ",") if tags[0] == "" { return } tag, err := strconv.Atoi(tags[1]) if err != nil { panic("tag is not an integer") } wt := wiretype(tags[0]) if tags[2] == "req" { fi.required = true } fi.setTag(f, tag, wt) fi.setMarshaler(f, tags) } func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) { fi.field = toField(f) fi.wiretag = math.MaxInt32 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire. fi.isPointer = true fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f) fi.oneofElems = make(map[reflect.Type]*marshalElemInfo) ityp := f.Type // interface type for _, o := range oneofImplementers { t := reflect.TypeOf(o) if !t.Implements(ityp) { continue } sf := t.Elem().Field(0) // oneof implementer is a struct with a single field tags := strings.Split(sf.Tag.Get("protobuf"), ",") tag, err := strconv.Atoi(tags[1]) if err != nil { panic("tag is not an integer") } wt := wiretype(tags[0]) sizer, marshaler := typeMarshaler(sf.Type, tags, false, true) // oneof should not omit any zero value fi.oneofElems[t.Elem()] = &marshalElemInfo{ wiretag: uint64(tag)<<3 | wt, tagsize: SizeVarint(uint64(tag) << 3), sizer: sizer, marshaler: marshaler, } } } // wiretype returns the wire encoding of the type. func wiretype(encoding string) uint64 { switch encoding { case "fixed32": return WireFixed32 case "fixed64": return WireFixed64 case "varint", "zigzag32", "zigzag64": return WireVarint case "bytes": return WireBytes case "group": return WireStartGroup } panic("unknown wire type " + encoding) } // setTag fills up the tag (in wire format) and its size in the info of a field. func (fi *marshalFieldInfo) setTag(f *reflect.StructField, tag int, wt uint64) { fi.field = toField(f) fi.wiretag = uint64(tag)<<3 | wt fi.tagsize = SizeVarint(uint64(tag) << 3) } // setMarshaler fills up the sizer and marshaler in the info of a field. func (fi *marshalFieldInfo) setMarshaler(f *reflect.StructField, tags []string) { switch f.Type.Kind() { case reflect.Map: // map field fi.isPointer = true fi.sizer, fi.marshaler = makeMapMarshaler(f) return case reflect.Ptr, reflect.Slice: fi.isPointer = true } fi.sizer, fi.marshaler = typeMarshaler(f.Type, tags, true, false) } // typeMarshaler returns the sizer and marshaler of a given field. // t is the type of the field. // tags is the generated "protobuf" tag of the field. // If nozero is true, zero value is not marshaled to the wire. // If oneof is true, it is a oneof field. func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (sizer, marshaler) { encoding := tags[0] pointer := false slice := false if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 { slice = true t = t.Elem() } if t.Kind() == reflect.Ptr { pointer = true t = t.Elem() } packed := false proto3 := false validateUTF8 := true for i := 2; i < len(tags); i++ { if tags[i] == "packed" { packed = true } if tags[i] == "proto3" { proto3 = true } } validateUTF8 = validateUTF8 && proto3 switch t.Kind() { case reflect.Bool: if pointer { return sizeBoolPtr, appendBoolPtr } if slice { if packed { return sizeBoolPackedSlice, appendBoolPackedSlice } return sizeBoolSlice, appendBoolSlice } if nozero { return sizeBoolValueNoZero, appendBoolValueNoZero } return sizeBoolValue, appendBoolValue case reflect.Uint32: switch encoding { case "fixed32": if pointer { return sizeFixed32Ptr, appendFixed32Ptr } if slice { if packed { return sizeFixed32PackedSlice, appendFixed32PackedSlice } return sizeFixed32Slice, appendFixed32Slice } if nozero { return sizeFixed32ValueNoZero, appendFixed32ValueNoZero } return sizeFixed32Value, appendFixed32Value case "varint": if pointer { return sizeVarint32Ptr, appendVarint32Ptr } if slice { if packed { return sizeVarint32PackedSlice, appendVarint32PackedSlice } return sizeVarint32Slice, appendVarint32Slice } if nozero { return sizeVarint32ValueNoZero, appendVarint32ValueNoZero } return sizeVarint32Value, appendVarint32Value } case reflect.Int32: switch encoding { case "fixed32": if pointer { return sizeFixedS32Ptr, appendFixedS32Ptr } if slice { if packed { return sizeFixedS32PackedSlice, appendFixedS32PackedSlice } return sizeFixedS32Slice, appendFixedS32Slice } if nozero { return sizeFixedS32ValueNoZero, appendFixedS32ValueNoZero } return sizeFixedS32Value, appendFixedS32Value case "varint": if pointer { return sizeVarintS32Ptr, appendVarintS32Ptr } if slice { if packed { return sizeVarintS32PackedSlice, appendVarintS32PackedSlice } return sizeVarintS32Slice, appendVarintS32Slice } if nozero { return sizeVarintS32ValueNoZero, appendVarintS32ValueNoZero } return sizeVarintS32Value, appendVarintS32Value case "zigzag32": if pointer { return sizeZigzag32Ptr, appendZigzag32Ptr } if slice { if packed { return sizeZigzag32PackedSlice, appendZigzag32PackedSlice } return sizeZigzag32Slice, appendZigzag32Slice } if nozero { return sizeZigzag32ValueNoZero, appendZigzag32ValueNoZero } return sizeZigzag32Value, appendZigzag32Value } case reflect.Uint64: switch encoding { case "fixed64": if pointer { return sizeFixed64Ptr, appendFixed64Ptr } if slice { if packed { return sizeFixed64PackedSlice, appendFixed64PackedSlice } return sizeFixed64Slice, appendFixed64Slice } if nozero { return sizeFixed64ValueNoZero, appendFixed64ValueNoZero } return sizeFixed64Value, appendFixed64Value case "varint": if pointer { return sizeVarint64Ptr, appendVarint64Ptr } if slice { if packed { return sizeVarint64PackedSlice, appendVarint64PackedSlice } return sizeVarint64Slice, appendVarint64Slice } if nozero { return sizeVarint64ValueNoZero, appendVarint64ValueNoZero } return sizeVarint64Value, appendVarint64Value } case reflect.Int64: switch encoding { case "fixed64": if pointer { return sizeFixedS64Ptr, appendFixedS64Ptr } if slice { if packed { return sizeFixedS64PackedSlice, appendFixedS64PackedSlice } return sizeFixedS64Slice, appendFixedS64Slice } if nozero { return sizeFixedS64ValueNoZero, appendFixedS64ValueNoZero } return sizeFixedS64Value, appendFixedS64Value case "varint": if pointer { return sizeVarintS64Ptr, appendVarintS64Ptr } if slice { if packed { return sizeVarintS64PackedSlice, appendVarintS64PackedSlice } return sizeVarintS64Slice, appendVarintS64Slice } if nozero { return sizeVarintS64ValueNoZero, appendVarintS64ValueNoZero } return sizeVarintS64Value, appendVarintS64Value case "zigzag64": if pointer { return sizeZigzag64Ptr, appendZigzag64Ptr } if slice { if packed { return sizeZigzag64PackedSlice, appendZigzag64PackedSlice } return sizeZigzag64Slice, appendZigzag64Slice } if nozero { return sizeZigzag64ValueNoZero, appendZigzag64ValueNoZero } return sizeZigzag64Value, appendZigzag64Value } case reflect.Float32: if pointer { return sizeFloat32Ptr, appendFloat32Ptr } if slice { if packed { return sizeFloat32PackedSlice, appendFloat32PackedSlice } return sizeFloat32Slice, appendFloat32Slice } if nozero { return sizeFloat32ValueNoZero, appendFloat32ValueNoZero } return sizeFloat32Value, appendFloat32Value case reflect.Float64: if pointer { return sizeFloat64Ptr, appendFloat64Ptr } if slice { if packed { return sizeFloat64PackedSlice, appendFloat64PackedSlice } return sizeFloat64Slice, appendFloat64Slice } if nozero { return sizeFloat64ValueNoZero, appendFloat64ValueNoZero } return sizeFloat64Value, appendFloat64Value case reflect.String: if validateUTF8 { if pointer { return sizeStringPtr, appendUTF8StringPtr } if slice { return sizeStringSlice, appendUTF8StringSlice } if nozero { return sizeStringValueNoZero, appendUTF8StringValueNoZero } return sizeStringValue, appendUTF8StringValue } if pointer { return sizeStringPtr, appendStringPtr } if slice { return sizeStringSlice, appendStringSlice } if nozero { return sizeStringValueNoZero, appendStringValueNoZero } return sizeStringValue, appendStringValue case reflect.Slice: if slice { return sizeBytesSlice, appendBytesSlice } if oneof { // Oneof bytes field may also have "proto3" tag. // We want to marshal it as a oneof field. Do this // check before the proto3 check. return sizeBytesOneof, appendBytesOneof } if proto3 { return sizeBytes3, appendBytes3 } return sizeBytes, appendBytes case reflect.Struct: switch encoding { case "group": if slice { return makeGroupSliceMarshaler(getMarshalInfo(t)) } return makeGroupMarshaler(getMarshalInfo(t)) case "bytes": if slice { return makeMessageSliceMarshaler(getMarshalInfo(t)) } return makeMessageMarshaler(getMarshalInfo(t)) } } panic(fmt.Sprintf("unknown or mismatched type: type: %v, wire type: %v", t, encoding)) } // Below are functions to size/marshal a specific type of a field. // They are stored in the field's info, and called by function pointers. // They have type sizer or marshaler. func sizeFixed32Value(_ pointer, tagsize int) int { return 4 + tagsize } func sizeFixed32ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toUint32() if v == 0 { return 0 } return 4 + tagsize } func sizeFixed32Ptr(ptr pointer, tagsize int) int { p := *ptr.toUint32Ptr() if p == nil { return 0 } return 4 + tagsize } func sizeFixed32Slice(ptr pointer, tagsize int) int { s := *ptr.toUint32Slice() return (4 + tagsize) * len(s) } func sizeFixed32PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toUint32Slice() if len(s) == 0 { return 0 } return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize } func sizeFixedS32Value(_ pointer, tagsize int) int { return 4 + tagsize } func sizeFixedS32ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt32() if v == 0 { return 0 } return 4 + tagsize } func sizeFixedS32Ptr(ptr pointer, tagsize int) int { p := ptr.getInt32Ptr() if p == nil { return 0 } return 4 + tagsize } func sizeFixedS32Slice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() return (4 + tagsize) * len(s) } func sizeFixedS32PackedSlice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() if len(s) == 0 { return 0 } return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize } func sizeFloat32Value(_ pointer, tagsize int) int { return 4 + tagsize } func sizeFloat32ValueNoZero(ptr pointer, tagsize int) int { v := math.Float32bits(*ptr.toFloat32()) if v == 0 { return 0 } return 4 + tagsize } func sizeFloat32Ptr(ptr pointer, tagsize int) int { p := *ptr.toFloat32Ptr() if p == nil { return 0 } return 4 + tagsize } func sizeFloat32Slice(ptr pointer, tagsize int) int { s := *ptr.toFloat32Slice() return (4 + tagsize) * len(s) } func sizeFloat32PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toFloat32Slice() if len(s) == 0 { return 0 } return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize } func sizeFixed64Value(_ pointer, tagsize int) int { return 8 + tagsize } func sizeFixed64ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toUint64() if v == 0 { return 0 } return 8 + tagsize } func sizeFixed64Ptr(ptr pointer, tagsize int) int { p := *ptr.toUint64Ptr() if p == nil { return 0 } return 8 + tagsize } func sizeFixed64Slice(ptr pointer, tagsize int) int { s := *ptr.toUint64Slice() return (8 + tagsize) * len(s) } func sizeFixed64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toUint64Slice() if len(s) == 0 { return 0 } return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize } func sizeFixedS64Value(_ pointer, tagsize int) int { return 8 + tagsize } func sizeFixedS64ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt64() if v == 0 { return 0 } return 8 + tagsize } func sizeFixedS64Ptr(ptr pointer, tagsize int) int { p := *ptr.toInt64Ptr() if p == nil { return 0 } return 8 + tagsize } func sizeFixedS64Slice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() return (8 + tagsize) * len(s) } func sizeFixedS64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() if len(s) == 0 { return 0 } return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize } func sizeFloat64Value(_ pointer, tagsize int) int { return 8 + tagsize } func sizeFloat64ValueNoZero(ptr pointer, tagsize int) int { v := math.Float64bits(*ptr.toFloat64()) if v == 0 { return 0 } return 8 + tagsize } func sizeFloat64Ptr(ptr pointer, tagsize int) int { p := *ptr.toFloat64Ptr() if p == nil { return 0 } return 8 + tagsize } func sizeFloat64Slice(ptr pointer, tagsize int) int { s := *ptr.toFloat64Slice() return (8 + tagsize) * len(s) } func sizeFloat64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toFloat64Slice() if len(s) == 0 { return 0 } return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize } func sizeVarint32Value(ptr pointer, tagsize int) int { v := *ptr.toUint32() return SizeVarint(uint64(v)) + tagsize } func sizeVarint32ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toUint32() if v == 0 { return 0 } return SizeVarint(uint64(v)) + tagsize } func sizeVarint32Ptr(ptr pointer, tagsize int) int { p := *ptr.toUint32Ptr() if p == nil { return 0 } return SizeVarint(uint64(*p)) + tagsize } func sizeVarint32Slice(ptr pointer, tagsize int) int { s := *ptr.toUint32Slice() n := 0 for _, v := range s { n += SizeVarint(uint64(v)) + tagsize } return n } func sizeVarint32PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toUint32Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } return n + SizeVarint(uint64(n)) + tagsize } func sizeVarintS32Value(ptr pointer, tagsize int) int { v := *ptr.toInt32() return SizeVarint(uint64(v)) + tagsize } func sizeVarintS32ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt32() if v == 0 { return 0 } return SizeVarint(uint64(v)) + tagsize } func sizeVarintS32Ptr(ptr pointer, tagsize int) int { p := ptr.getInt32Ptr() if p == nil { return 0 } return SizeVarint(uint64(*p)) + tagsize } func sizeVarintS32Slice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() n := 0 for _, v := range s { n += SizeVarint(uint64(v)) + tagsize } return n } func sizeVarintS32PackedSlice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } return n + SizeVarint(uint64(n)) + tagsize } func sizeVarint64Value(ptr pointer, tagsize int) int { v := *ptr.toUint64() return SizeVarint(v) + tagsize } func sizeVarint64ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toUint64() if v == 0 { return 0 } return SizeVarint(v) + tagsize } func sizeVarint64Ptr(ptr pointer, tagsize int) int { p := *ptr.toUint64Ptr() if p == nil { return 0 } return SizeVarint(*p) + tagsize } func sizeVarint64Slice(ptr pointer, tagsize int) int { s := *ptr.toUint64Slice() n := 0 for _, v := range s { n += SizeVarint(v) + tagsize } return n } func sizeVarint64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toUint64Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(v) } return n + SizeVarint(uint64(n)) + tagsize } func sizeVarintS64Value(ptr pointer, tagsize int) int { v := *ptr.toInt64() return SizeVarint(uint64(v)) + tagsize } func sizeVarintS64ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt64() if v == 0 { return 0 } return SizeVarint(uint64(v)) + tagsize } func sizeVarintS64Ptr(ptr pointer, tagsize int) int { p := *ptr.toInt64Ptr() if p == nil { return 0 } return SizeVarint(uint64(*p)) + tagsize } func sizeVarintS64Slice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() n := 0 for _, v := range s { n += SizeVarint(uint64(v)) + tagsize } return n } func sizeVarintS64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } return n + SizeVarint(uint64(n)) + tagsize } func sizeZigzag32Value(ptr pointer, tagsize int) int { v := *ptr.toInt32() return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize } func sizeZigzag32ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt32() if v == 0 { return 0 } return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize } func sizeZigzag32Ptr(ptr pointer, tagsize int) int { p := ptr.getInt32Ptr() if p == nil { return 0 } v := *p return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize } func sizeZigzag32Slice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() n := 0 for _, v := range s { n += SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize } return n } func sizeZigzag32PackedSlice(ptr pointer, tagsize int) int { s := ptr.getInt32Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31)))) } return n + SizeVarint(uint64(n)) + tagsize } func sizeZigzag64Value(ptr pointer, tagsize int) int { v := *ptr.toInt64() return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize } func sizeZigzag64ValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toInt64() if v == 0 { return 0 } return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize } func sizeZigzag64Ptr(ptr pointer, tagsize int) int { p := *ptr.toInt64Ptr() if p == nil { return 0 } v := *p return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize } func sizeZigzag64Slice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() n := 0 for _, v := range s { n += SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize } return n } func sizeZigzag64PackedSlice(ptr pointer, tagsize int) int { s := *ptr.toInt64Slice() if len(s) == 0 { return 0 } n := 0 for _, v := range s { n += SizeVarint(uint64(v<<1) ^ uint64((int64(v) >> 63))) } return n + SizeVarint(uint64(n)) + tagsize } func sizeBoolValue(_ pointer, tagsize int) int { return 1 + tagsize } func sizeBoolValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toBool() if !v { return 0 } return 1 + tagsize } func sizeBoolPtr(ptr pointer, tagsize int) int { p := *ptr.toBoolPtr() if p == nil { return 0 } return 1 + tagsize } func sizeBoolSlice(ptr pointer, tagsize int) int { s := *ptr.toBoolSlice() return (1 + tagsize) * len(s) } func sizeBoolPackedSlice(ptr pointer, tagsize int) int { s := *ptr.toBoolSlice() if len(s) == 0 { return 0 } return len(s) + SizeVarint(uint64(len(s))) + tagsize } func sizeStringValue(ptr pointer, tagsize int) int { v := *ptr.toString() return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeStringValueNoZero(ptr pointer, tagsize int) int { v := *ptr.toString() if v == "" { return 0 } return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeStringPtr(ptr pointer, tagsize int) int { p := *ptr.toStringPtr() if p == nil { return 0 } v := *p return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeStringSlice(ptr pointer, tagsize int) int { s := *ptr.toStringSlice() n := 0 for _, v := range s { n += len(v) + SizeVarint(uint64(len(v))) + tagsize } return n } func sizeBytes(ptr pointer, tagsize int) int { v := *ptr.toBytes() if v == nil { return 0 } return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeBytes3(ptr pointer, tagsize int) int { v := *ptr.toBytes() if len(v) == 0 { return 0 } return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeBytesOneof(ptr pointer, tagsize int) int { v := *ptr.toBytes() return len(v) + SizeVarint(uint64(len(v))) + tagsize } func sizeBytesSlice(ptr pointer, tagsize int) int { s := *ptr.toBytesSlice() n := 0 for _, v := range s { n += len(v) + SizeVarint(uint64(len(v))) + tagsize } return n } // appendFixed32 appends an encoded fixed32 to b. func appendFixed32(b []byte, v uint32) []byte { b = append(b, byte(v), byte(v>>8), byte(v>>16), byte(v>>24)) return b } // appendFixed64 appends an encoded fixed64 to b. func appendFixed64(b []byte, v uint64) []byte { b = append(b, byte(v), byte(v>>8), byte(v>>16), byte(v>>24), byte(v>>32), byte(v>>40), byte(v>>48), byte(v>>56)) return b } // appendVarint appends an encoded varint to b. func appendVarint(b []byte, v uint64) []byte { // TODO: make 1-byte (maybe 2-byte) case inline-able, once we // have non-leaf inliner. switch { case v < 1<<7: b = append(b, byte(v)) case v < 1<<14: b = append(b, byte(v&0x7f|0x80), byte(v>>7)) case v < 1<<21: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte(v>>14)) case v < 1<<28: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte(v>>21)) case v < 1<<35: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte(v>>28)) case v < 1<<42: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte(v>>35)) case v < 1<<49: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte(v>>42)) case v < 1<<56: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte((v>>42)&0x7f|0x80), byte(v>>49)) case v < 1<<63: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte((v>>42)&0x7f|0x80), byte((v>>49)&0x7f|0x80), byte(v>>56)) default: b = append(b, byte(v&0x7f|0x80), byte((v>>7)&0x7f|0x80), byte((v>>14)&0x7f|0x80), byte((v>>21)&0x7f|0x80), byte((v>>28)&0x7f|0x80), byte((v>>35)&0x7f|0x80), byte((v>>42)&0x7f|0x80), byte((v>>49)&0x7f|0x80), byte((v>>56)&0x7f|0x80), 1) } return b } func appendFixed32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint32() b = appendVarint(b, wiretag) b = appendFixed32(b, v) return b, nil } func appendFixed32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint32() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, v) return b, nil } func appendFixed32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toUint32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, *p) return b, nil } func appendFixed32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed32(b, v) } return b, nil } func appendFixed32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(4*len(s))) for _, v := range s { b = appendFixed32(b, v) } return b, nil } func appendFixedS32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() b = appendVarint(b, wiretag) b = appendFixed32(b, uint32(v)) return b, nil } func appendFixedS32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, uint32(v)) return b, nil } func appendFixedS32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := ptr.getInt32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, uint32(*p)) return b, nil } func appendFixedS32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed32(b, uint32(v)) } return b, nil } func appendFixedS32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(4*len(s))) for _, v := range s { b = appendFixed32(b, uint32(v)) } return b, nil } func appendFloat32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := math.Float32bits(*ptr.toFloat32()) b = appendVarint(b, wiretag) b = appendFixed32(b, v) return b, nil } func appendFloat32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := math.Float32bits(*ptr.toFloat32()) if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, v) return b, nil } func appendFloat32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toFloat32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed32(b, math.Float32bits(*p)) return b, nil } func appendFloat32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toFloat32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed32(b, math.Float32bits(v)) } return b, nil } func appendFloat32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toFloat32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(4*len(s))) for _, v := range s { b = appendFixed32(b, math.Float32bits(v)) } return b, nil } func appendFixed64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint64() b = appendVarint(b, wiretag) b = appendFixed64(b, v) return b, nil } func appendFixed64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint64() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, v) return b, nil } func appendFixed64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toUint64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, *p) return b, nil } func appendFixed64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed64(b, v) } return b, nil } func appendFixed64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(8*len(s))) for _, v := range s { b = appendFixed64(b, v) } return b, nil } func appendFixedS64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() b = appendVarint(b, wiretag) b = appendFixed64(b, uint64(v)) return b, nil } func appendFixedS64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, uint64(v)) return b, nil } func appendFixedS64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toInt64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, uint64(*p)) return b, nil } func appendFixedS64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed64(b, uint64(v)) } return b, nil } func appendFixedS64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(8*len(s))) for _, v := range s { b = appendFixed64(b, uint64(v)) } return b, nil } func appendFloat64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := math.Float64bits(*ptr.toFloat64()) b = appendVarint(b, wiretag) b = appendFixed64(b, v) return b, nil } func appendFloat64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := math.Float64bits(*ptr.toFloat64()) if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, v) return b, nil } func appendFloat64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toFloat64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendFixed64(b, math.Float64bits(*p)) return b, nil } func appendFloat64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toFloat64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendFixed64(b, math.Float64bits(v)) } return b, nil } func appendFloat64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toFloat64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(8*len(s))) for _, v := range s { b = appendFixed64(b, math.Float64bits(v)) } return b, nil } func appendVarint32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint32() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarint32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint32() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarint32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toUint32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(*p)) return b, nil } func appendVarint32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) } return b, nil } func appendVarint32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, uint64(v)) } return b, nil } func appendVarintS32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarintS32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarintS32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := ptr.getInt32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(*p)) return b, nil } func appendVarintS32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) } return b, nil } func appendVarintS32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, uint64(v)) } return b, nil } func appendVarint64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint64() b = appendVarint(b, wiretag) b = appendVarint(b, v) return b, nil } func appendVarint64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toUint64() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, v) return b, nil } func appendVarint64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toUint64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, *p) return b, nil } func appendVarint64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, v) } return b, nil } func appendVarint64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toUint64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(v) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, v) } return b, nil } func appendVarintS64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarintS64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) return b, nil } func appendVarintS64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toInt64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(*p)) return b, nil } func appendVarintS64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v)) } return b, nil } func appendVarintS64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(uint64(v)) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, uint64(v)) } return b, nil } func appendZigzag32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() b = appendVarint(b, wiretag) b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) return b, nil } func appendZigzag32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt32() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) return b, nil } func appendZigzag32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := ptr.getInt32Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) v := *p b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) return b, nil } func appendZigzag32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) } return b, nil } func appendZigzag32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := ptr.getInt32Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31)))) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) } return b, nil } func appendZigzag64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63))) return b, nil } func appendZigzag64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toInt64() if v == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63))) return b, nil } func appendZigzag64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toInt64Ptr() if p == nil { return b, nil } b = appendVarint(b, wiretag) v := *p b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63))) return b, nil } func appendZigzag64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63))) } return b, nil } func appendZigzag64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toInt64Slice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) // compute size n := 0 for _, v := range s { n += SizeVarint(uint64(v<<1) ^ uint64((int64(v) >> 63))) } b = appendVarint(b, uint64(n)) for _, v := range s { b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63))) } return b, nil } func appendBoolValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toBool() b = appendVarint(b, wiretag) if v { b = append(b, 1) } else { b = append(b, 0) } return b, nil } func appendBoolValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toBool() if !v { return b, nil } b = appendVarint(b, wiretag) b = append(b, 1) return b, nil } func appendBoolPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toBoolPtr() if p == nil { return b, nil } b = appendVarint(b, wiretag) if *p { b = append(b, 1) } else { b = append(b, 0) } return b, nil } func appendBoolSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toBoolSlice() for _, v := range s { b = appendVarint(b, wiretag) if v { b = append(b, 1) } else { b = append(b, 0) } } return b, nil } func appendBoolPackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toBoolSlice() if len(s) == 0 { return b, nil } b = appendVarint(b, wiretag&^7|WireBytes) b = appendVarint(b, uint64(len(s))) for _, v := range s { if v { b = append(b, 1) } else { b = append(b, 0) } } return b, nil } func appendStringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toString() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendStringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toString() if v == "" { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendStringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { p := *ptr.toStringPtr() if p == nil { return b, nil } v := *p b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendStringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toStringSlice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) } return b, nil } func appendUTF8StringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { var invalidUTF8 bool v := *ptr.toString() if !utf8.ValidString(v) { invalidUTF8 = true } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) if invalidUTF8 { return b, errInvalidUTF8 } return b, nil } func appendUTF8StringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { var invalidUTF8 bool v := *ptr.toString() if v == "" { return b, nil } if !utf8.ValidString(v) { invalidUTF8 = true } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) if invalidUTF8 { return b, errInvalidUTF8 } return b, nil } func appendUTF8StringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { var invalidUTF8 bool p := *ptr.toStringPtr() if p == nil { return b, nil } v := *p if !utf8.ValidString(v) { invalidUTF8 = true } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) if invalidUTF8 { return b, errInvalidUTF8 } return b, nil } func appendUTF8StringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { var invalidUTF8 bool s := *ptr.toStringSlice() for _, v := range s { if !utf8.ValidString(v) { invalidUTF8 = true } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) } if invalidUTF8 { return b, errInvalidUTF8 } return b, nil } func appendBytes(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toBytes() if v == nil { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendBytes3(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toBytes() if len(v) == 0 { return b, nil } b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendBytesOneof(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { v := *ptr.toBytes() b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) return b, nil } func appendBytesSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) { s := *ptr.toBytesSlice() for _, v := range s { b = appendVarint(b, wiretag) b = appendVarint(b, uint64(len(v))) b = append(b, v...) } return b, nil } // makeGroupMarshaler returns the sizer and marshaler for a group. // u is the marshal info of the underlying message. func makeGroupMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { p := ptr.getPointer() if p.isNil() { return 0 } return u.size(p) + 2*tagsize }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { p := ptr.getPointer() if p.isNil() { return b, nil } var err error b = appendVarint(b, wiretag) // start group b, err = u.marshal(b, p, deterministic) b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group return b, err } } // makeGroupSliceMarshaler returns the sizer and marshaler for a group slice. // u is the marshal info of the underlying message. func makeGroupSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getPointerSlice() n := 0 for _, v := range s { if v.isNil() { continue } n += u.size(v) + 2*tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getPointerSlice() var err error var nerr nonFatal for _, v := range s { if v.isNil() { return b, errRepeatedHasNil } b = appendVarint(b, wiretag) // start group b, err = u.marshal(b, v, deterministic) b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group if !nerr.Merge(err) { if err == ErrNil { err = errRepeatedHasNil } return b, err } } return b, nerr.E } } // makeMessageMarshaler returns the sizer and marshaler for a message field. // u is the marshal info of the message. func makeMessageMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { p := ptr.getPointer() if p.isNil() { return 0 } siz := u.size(p) return siz + SizeVarint(uint64(siz)) + tagsize }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { p := ptr.getPointer() if p.isNil() { return b, nil } b = appendVarint(b, wiretag) siz := u.cachedsize(p) b = appendVarint(b, uint64(siz)) return u.marshal(b, p, deterministic) } } // makeMessageSliceMarshaler returns the sizer and marshaler for a message slice. // u is the marshal info of the message. func makeMessageSliceMarshaler(u *marshalInfo) (sizer, marshaler) { return func(ptr pointer, tagsize int) int { s := ptr.getPointerSlice() n := 0 for _, v := range s { if v.isNil() { continue } siz := u.size(v) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) { s := ptr.getPointerSlice() var err error var nerr nonFatal for _, v := range s { if v.isNil() { return b, errRepeatedHasNil } b = appendVarint(b, wiretag) siz := u.cachedsize(v) b = appendVarint(b, uint64(siz)) b, err = u.marshal(b, v, deterministic) if !nerr.Merge(err) { if err == ErrNil { err = errRepeatedHasNil } return b, err } } return b, nerr.E } } // makeMapMarshaler returns the sizer and marshaler for a map field. // f is the pointer to the reflect data structure of the field. func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) { // figure out key and value type t := f.Type keyType := t.Key() valType := t.Elem() keyTags := strings.Split(f.Tag.Get("protobuf_key"), ",") valTags := strings.Split(f.Tag.Get("protobuf_val"), ",") keySizer, keyMarshaler := typeMarshaler(keyType, keyTags, false, false) // don't omit zero value in map valSizer, valMarshaler := typeMarshaler(valType, valTags, false, false) // don't omit zero value in map keyWireTag := 1<<3 | wiretype(keyTags[0]) valWireTag := 2<<3 | wiretype(valTags[0]) // We create an interface to get the addresses of the map key and value. // If value is pointer-typed, the interface is a direct interface, the // idata itself is the value. Otherwise, the idata is the pointer to the // value. // Key cannot be pointer-typed. valIsPtr := valType.Kind() == reflect.Ptr // If value is a message with nested maps, calling // valSizer in marshal may be quadratic. We should use // cached version in marshal (but not in size). // If value is not message type, we don't have size cache, // but it cannot be nested either. Just use valSizer. valCachedSizer := valSizer if valIsPtr && valType.Elem().Kind() == reflect.Struct { u := getMarshalInfo(valType.Elem()) valCachedSizer = func(ptr pointer, tagsize int) int { // Same as message sizer, but use cache. p := ptr.getPointer() if p.isNil() { return 0 } siz := u.cachedsize(p) return siz + SizeVarint(uint64(siz)) + tagsize } } return func(ptr pointer, tagsize int) int { m := ptr.asPointerTo(t).Elem() // the map n := 0 for _, k := range m.MapKeys() { ki := k.Interface() vi := m.MapIndex(k).Interface() kaddr := toAddrPointer(&ki, false, false) // pointer to key vaddr := toAddrPointer(&vi, valIsPtr, false) // pointer to value siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1) n += siz + SizeVarint(uint64(siz)) + tagsize } return n }, func(b []byte, ptr pointer, tag uint64, deterministic bool) ([]byte, error) { m := ptr.asPointerTo(t).Elem() // the map var err error keys := m.MapKeys() if len(keys) > 1 && deterministic { sort.Sort(mapKeys(keys)) } var nerr nonFatal for _, k := range keys { ki := k.Interface() vi := m.MapIndex(k).Interface() kaddr := toAddrPointer(&ki, false, false) // pointer to key vaddr := toAddrPointer(&vi, valIsPtr, false) // pointer to value b = appendVarint(b, tag) siz := keySizer(kaddr, 1) + valCachedSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1) b = appendVarint(b, uint64(siz)) b, err = keyMarshaler(b, kaddr, keyWireTag, deterministic) if !nerr.Merge(err) { return b, err } b, err = valMarshaler(b, vaddr, valWireTag, deterministic) if err != ErrNil && !nerr.Merge(err) { // allow nil value in map return b, err } } return b, nerr.E } } // makeOneOfMarshaler returns the sizer and marshaler for a oneof field. // fi is the marshal info of the field. // f is the pointer to the reflect data structure of the field. func makeOneOfMarshaler(fi *marshalFieldInfo, f *reflect.StructField) (sizer, marshaler) { // Oneof field is an interface. We need to get the actual data type on the fly. t := f.Type return func(ptr pointer, _ int) int { p := ptr.getInterfacePointer() if p.isNil() { return 0 } v := ptr.asPointerTo(t).Elem().Elem().Elem() // *interface -> interface -> *struct -> struct telem := v.Type() e := fi.oneofElems[telem] return e.sizer(p, e.tagsize) }, func(b []byte, ptr pointer, _ uint64, deterministic bool) ([]byte, error) { p := ptr.getInterfacePointer() if p.isNil() { return b, nil } v := ptr.asPointerTo(t).Elem().Elem().Elem() // *interface -> interface -> *struct -> struct telem := v.Type() if telem.Field(0).Type.Kind() == reflect.Ptr && p.getPointer().isNil() { return b, errOneofHasNil } e := fi.oneofElems[telem] return e.marshaler(b, p, e.wiretag, deterministic) } } // sizeExtensions computes the size of encoded data for a XXX_InternalExtensions field. func (u *marshalInfo) sizeExtensions(ext *XXX_InternalExtensions) int { m, mu := ext.extensionsRead() if m == nil { return 0 } mu.Lock() n := 0 for _, e := range m { if e.value == nil || e.desc == nil { // Extension is only in its encoded form. n += len(e.enc) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr, ei.deref) n += ei.sizer(p, ei.tagsize) } mu.Unlock() return n } // appendExtensions marshals a XXX_InternalExtensions field to the end of byte slice b. func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, deterministic bool) ([]byte, error) { m, mu := ext.extensionsRead() if m == nil { return b, nil } mu.Lock() defer mu.Unlock() var err error var nerr nonFatal // Fast-path for common cases: zero or one extensions. // Don't bother sorting the keys. if len(m) <= 1 { for _, e := range m { if e.value == nil || e.desc == nil { // Extension is only in its encoded form. b = append(b, e.enc...) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err } } return b, nerr.E } // Sort the keys to provide a deterministic encoding. // Not sure this is required, but the old code does it. keys := make([]int, 0, len(m)) for k := range m { keys = append(keys, int(k)) } sort.Ints(keys) for _, k := range keys { e := m[int32(k)] if e.value == nil || e.desc == nil { // Extension is only in its encoded form. b = append(b, e.enc...) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err } } return b, nerr.E } // message set format is: // message MessageSet { // repeated group Item = 1 { // required int32 type_id = 2; // required string message = 3; // }; // } // sizeMessageSet computes the size of encoded data for a XXX_InternalExtensions field // in message set format (above). func (u *marshalInfo) sizeMessageSet(ext *XXX_InternalExtensions) int { m, mu := ext.extensionsRead() if m == nil { return 0 } mu.Lock() n := 0 for id, e := range m { n += 2 // start group, end group. tag = 1 (size=1) n += SizeVarint(uint64(id)) + 1 // type_id, tag = 2 (size=1) if e.value == nil || e.desc == nil { // Extension is only in its encoded form. msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint siz := len(msgWithLen) n += siz + 1 // message, tag = 3 (size=1) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr, ei.deref) n += ei.sizer(p, 1) // message, tag = 3 (size=1) } mu.Unlock() return n } // appendMessageSet marshals a XXX_InternalExtensions field in message set format (above) // to the end of byte slice b. func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, deterministic bool) ([]byte, error) { m, mu := ext.extensionsRead() if m == nil { return b, nil } mu.Lock() defer mu.Unlock() var err error var nerr nonFatal // Fast-path for common cases: zero or one extensions. // Don't bother sorting the keys. if len(m) <= 1 { for id, e := range m { b = append(b, 1<<3|WireStartGroup) b = append(b, 2<<3|WireVarint) b = appendVarint(b, uint64(id)) if e.value == nil || e.desc == nil { // Extension is only in its encoded form. msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint b = append(b, 3<<3|WireBytes) b = append(b, msgWithLen...) b = append(b, 1<<3|WireEndGroup) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic) if !nerr.Merge(err) { return b, err } b = append(b, 1<<3|WireEndGroup) } return b, nerr.E } // Sort the keys to provide a deterministic encoding. keys := make([]int, 0, len(m)) for k := range m { keys = append(keys, int(k)) } sort.Ints(keys) for _, id := range keys { e := m[int32(id)] b = append(b, 1<<3|WireStartGroup) b = append(b, 2<<3|WireVarint) b = appendVarint(b, uint64(id)) if e.value == nil || e.desc == nil { // Extension is only in its encoded form. msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint b = append(b, 3<<3|WireBytes) b = append(b, msgWithLen...) b = append(b, 1<<3|WireEndGroup) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic) b = append(b, 1<<3|WireEndGroup) if !nerr.Merge(err) { return b, err } } return b, nerr.E } // sizeV1Extensions computes the size of encoded data for a V1-API extension field. func (u *marshalInfo) sizeV1Extensions(m map[int32]Extension) int { if m == nil { return 0 } n := 0 for _, e := range m { if e.value == nil || e.desc == nil { // Extension is only in its encoded form. n += len(e.enc) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr, ei.deref) n += ei.sizer(p, ei.tagsize) } return n } // appendV1Extensions marshals a V1-API extension field to the end of byte slice b. func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, deterministic bool) ([]byte, error) { if m == nil { return b, nil } // Sort the keys to provide a deterministic encoding. keys := make([]int, 0, len(m)) for k := range m { keys = append(keys, int(k)) } sort.Ints(keys) var err error var nerr nonFatal for _, k := range keys { e := m[int32(k)] if e.value == nil || e.desc == nil { // Extension is only in its encoded form. b = append(b, e.enc...) continue } // We don't skip extensions that have an encoded form set, // because the extension value may have been mutated after // the last time this function was called. ei := u.getExtElemInfo(e.desc) v := e.value p := toAddrPointer(&v, ei.isptr, ei.deref) b, err = ei.marshaler(b, p, ei.wiretag, deterministic) if !nerr.Merge(err) { return b, err } } return b, nerr.E } // newMarshaler is the interface representing objects that can marshal themselves. // // This exists to support protoc-gen-go generated messages. // The proto package will stop type-asserting to this interface in the future. // // DO NOT DEPEND ON THIS. type newMarshaler interface { XXX_Size() int XXX_Marshal(b []byte, deterministic bool) ([]byte, error) } // Size returns the encoded size of a protocol buffer message. // This is the main entry point. func Size(pb Message) int { if m, ok := pb.(newMarshaler); ok { return m.XXX_Size() } if m, ok := pb.(Marshaler); ok { // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. b, _ := m.Marshal() return len(b) } // in case somehow we didn't generate the wrapper if pb == nil { return 0 } var info InternalMessageInfo return info.Size(pb) } // Marshal takes a protocol buffer message // and encodes it into the wire format, returning the data. // This is the main entry point. func Marshal(pb Message) ([]byte, error) { if m, ok := pb.(newMarshaler); ok { siz := m.XXX_Size() b := make([]byte, 0, siz) return m.XXX_Marshal(b, false) } if m, ok := pb.(Marshaler); ok { // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. return m.Marshal() } // in case somehow we didn't generate the wrapper if pb == nil { return nil, ErrNil } var info InternalMessageInfo siz := info.Size(pb) b := make([]byte, 0, siz) return info.Marshal(b, pb, false) } // Marshal takes a protocol buffer message // and encodes it into the wire format, writing the result to the // Buffer. // This is an alternative entry point. It is not necessary to use // a Buffer for most applications. func (p *Buffer) Marshal(pb Message) error { var err error if m, ok := pb.(newMarshaler); ok { siz := m.XXX_Size() p.grow(siz) // make sure buf has enough capacity p.buf, err = m.XXX_Marshal(p.buf, p.deterministic) return err } if m, ok := pb.(Marshaler); ok { // If the message can marshal itself, let it do it, for compatibility. // NOTE: This is not efficient. b, err := m.Marshal() p.buf = append(p.buf, b...) return err } // in case somehow we didn't generate the wrapper if pb == nil { return ErrNil } var info InternalMessageInfo siz := info.Size(pb) p.grow(siz) // make sure buf has enough capacity p.buf, err = info.Marshal(p.buf, pb, p.deterministic) return err } // grow grows the buffer's capacity, if necessary, to guarantee space for // another n bytes. After grow(n), at least n bytes can be written to the // buffer without another allocation. func (p *Buffer) grow(n int) { need := len(p.buf) + n if need <= cap(p.buf) { return } newCap := len(p.buf) * 2 if newCap < need { newCap = need } p.buf = append(make([]byte, 0, newCap), p.buf...) } ================================================ FILE: vendor/github.com/golang/protobuf/proto/table_merge.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "fmt" "reflect" "strings" "sync" "sync/atomic" ) // Merge merges the src message into dst. // This assumes that dst and src of the same type and are non-nil. func (a *InternalMessageInfo) Merge(dst, src Message) { mi := atomicLoadMergeInfo(&a.merge) if mi == nil { mi = getMergeInfo(reflect.TypeOf(dst).Elem()) atomicStoreMergeInfo(&a.merge, mi) } mi.merge(toPointer(&dst), toPointer(&src)) } type mergeInfo struct { typ reflect.Type initialized int32 // 0: only typ is valid, 1: everything is valid lock sync.Mutex fields []mergeFieldInfo unrecognized field // Offset of XXX_unrecognized } type mergeFieldInfo struct { field field // Offset of field, guaranteed to be valid // isPointer reports whether the value in the field is a pointer. // This is true for the following situations: // * Pointer to struct // * Pointer to basic type (proto2 only) // * Slice (first value in slice header is a pointer) // * String (first value in string header is a pointer) isPointer bool // basicWidth reports the width of the field assuming that it is directly // embedded in the struct (as is the case for basic types in proto3). // The possible values are: // 0: invalid // 1: bool // 4: int32, uint32, float32 // 8: int64, uint64, float64 basicWidth int // Where dst and src are pointers to the types being merged. merge func(dst, src pointer) } var ( mergeInfoMap = map[reflect.Type]*mergeInfo{} mergeInfoLock sync.Mutex ) func getMergeInfo(t reflect.Type) *mergeInfo { mergeInfoLock.Lock() defer mergeInfoLock.Unlock() mi := mergeInfoMap[t] if mi == nil { mi = &mergeInfo{typ: t} mergeInfoMap[t] = mi } return mi } // merge merges src into dst assuming they are both of type *mi.typ. func (mi *mergeInfo) merge(dst, src pointer) { if dst.isNil() { panic("proto: nil destination") } if src.isNil() { return // Nothing to do. } if atomic.LoadInt32(&mi.initialized) == 0 { mi.computeMergeInfo() } for _, fi := range mi.fields { sfp := src.offset(fi.field) // As an optimization, we can avoid the merge function call cost // if we know for sure that the source will have no effect // by checking if it is the zero value. if unsafeAllowed { if fi.isPointer && sfp.getPointer().isNil() { // Could be slice or string continue } if fi.basicWidth > 0 { switch { case fi.basicWidth == 1 && !*sfp.toBool(): continue case fi.basicWidth == 4 && *sfp.toUint32() == 0: continue case fi.basicWidth == 8 && *sfp.toUint64() == 0: continue } } } dfp := dst.offset(fi.field) fi.merge(dfp, sfp) } // TODO: Make this faster? out := dst.asPointerTo(mi.typ).Elem() in := src.asPointerTo(mi.typ).Elem() if emIn, err := extendable(in.Addr().Interface()); err == nil { emOut, _ := extendable(out.Addr().Interface()) mIn, muIn := emIn.extensionsRead() if mIn != nil { mOut := emOut.extensionsWrite() muIn.Lock() mergeExtension(mOut, mIn) muIn.Unlock() } } if mi.unrecognized.IsValid() { if b := *src.offset(mi.unrecognized).toBytes(); len(b) > 0 { *dst.offset(mi.unrecognized).toBytes() = append([]byte(nil), b...) } } } func (mi *mergeInfo) computeMergeInfo() { mi.lock.Lock() defer mi.lock.Unlock() if mi.initialized != 0 { return } t := mi.typ n := t.NumField() props := GetProperties(t) for i := 0; i < n; i++ { f := t.Field(i) if strings.HasPrefix(f.Name, "XXX_") { continue } mfi := mergeFieldInfo{field: toField(&f)} tf := f.Type // As an optimization, we can avoid the merge function call cost // if we know for sure that the source will have no effect // by checking if it is the zero value. if unsafeAllowed { switch tf.Kind() { case reflect.Ptr, reflect.Slice, reflect.String: // As a special case, we assume slices and strings are pointers // since we know that the first field in the SliceSlice or // StringHeader is a data pointer. mfi.isPointer = true case reflect.Bool: mfi.basicWidth = 1 case reflect.Int32, reflect.Uint32, reflect.Float32: mfi.basicWidth = 4 case reflect.Int64, reflect.Uint64, reflect.Float64: mfi.basicWidth = 8 } } // Unwrap tf to get at its most basic type. var isPointer, isSlice bool if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 { isSlice = true tf = tf.Elem() } if tf.Kind() == reflect.Ptr { isPointer = true tf = tf.Elem() } if isPointer && isSlice && tf.Kind() != reflect.Struct { panic("both pointer and slice for basic type in " + tf.Name()) } switch tf.Kind() { case reflect.Int32: switch { case isSlice: // E.g., []int32 mfi.merge = func(dst, src pointer) { // NOTE: toInt32Slice is not defined (see pointer_reflect.go). /* sfsp := src.toInt32Slice() if *sfsp != nil { dfsp := dst.toInt32Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []int64{} } } */ sfs := src.getInt32Slice() if sfs != nil { dfs := dst.getInt32Slice() dfs = append(dfs, sfs...) if dfs == nil { dfs = []int32{} } dst.setInt32Slice(dfs) } } case isPointer: // E.g., *int32 mfi.merge = func(dst, src pointer) { // NOTE: toInt32Ptr is not defined (see pointer_reflect.go). /* sfpp := src.toInt32Ptr() if *sfpp != nil { dfpp := dst.toInt32Ptr() if *dfpp == nil { *dfpp = Int32(**sfpp) } else { **dfpp = **sfpp } } */ sfp := src.getInt32Ptr() if sfp != nil { dfp := dst.getInt32Ptr() if dfp == nil { dst.setInt32Ptr(*sfp) } else { *dfp = *sfp } } } default: // E.g., int32 mfi.merge = func(dst, src pointer) { if v := *src.toInt32(); v != 0 { *dst.toInt32() = v } } } case reflect.Int64: switch { case isSlice: // E.g., []int64 mfi.merge = func(dst, src pointer) { sfsp := src.toInt64Slice() if *sfsp != nil { dfsp := dst.toInt64Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []int64{} } } } case isPointer: // E.g., *int64 mfi.merge = func(dst, src pointer) { sfpp := src.toInt64Ptr() if *sfpp != nil { dfpp := dst.toInt64Ptr() if *dfpp == nil { *dfpp = Int64(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., int64 mfi.merge = func(dst, src pointer) { if v := *src.toInt64(); v != 0 { *dst.toInt64() = v } } } case reflect.Uint32: switch { case isSlice: // E.g., []uint32 mfi.merge = func(dst, src pointer) { sfsp := src.toUint32Slice() if *sfsp != nil { dfsp := dst.toUint32Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []uint32{} } } } case isPointer: // E.g., *uint32 mfi.merge = func(dst, src pointer) { sfpp := src.toUint32Ptr() if *sfpp != nil { dfpp := dst.toUint32Ptr() if *dfpp == nil { *dfpp = Uint32(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., uint32 mfi.merge = func(dst, src pointer) { if v := *src.toUint32(); v != 0 { *dst.toUint32() = v } } } case reflect.Uint64: switch { case isSlice: // E.g., []uint64 mfi.merge = func(dst, src pointer) { sfsp := src.toUint64Slice() if *sfsp != nil { dfsp := dst.toUint64Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []uint64{} } } } case isPointer: // E.g., *uint64 mfi.merge = func(dst, src pointer) { sfpp := src.toUint64Ptr() if *sfpp != nil { dfpp := dst.toUint64Ptr() if *dfpp == nil { *dfpp = Uint64(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., uint64 mfi.merge = func(dst, src pointer) { if v := *src.toUint64(); v != 0 { *dst.toUint64() = v } } } case reflect.Float32: switch { case isSlice: // E.g., []float32 mfi.merge = func(dst, src pointer) { sfsp := src.toFloat32Slice() if *sfsp != nil { dfsp := dst.toFloat32Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []float32{} } } } case isPointer: // E.g., *float32 mfi.merge = func(dst, src pointer) { sfpp := src.toFloat32Ptr() if *sfpp != nil { dfpp := dst.toFloat32Ptr() if *dfpp == nil { *dfpp = Float32(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., float32 mfi.merge = func(dst, src pointer) { if v := *src.toFloat32(); v != 0 { *dst.toFloat32() = v } } } case reflect.Float64: switch { case isSlice: // E.g., []float64 mfi.merge = func(dst, src pointer) { sfsp := src.toFloat64Slice() if *sfsp != nil { dfsp := dst.toFloat64Slice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []float64{} } } } case isPointer: // E.g., *float64 mfi.merge = func(dst, src pointer) { sfpp := src.toFloat64Ptr() if *sfpp != nil { dfpp := dst.toFloat64Ptr() if *dfpp == nil { *dfpp = Float64(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., float64 mfi.merge = func(dst, src pointer) { if v := *src.toFloat64(); v != 0 { *dst.toFloat64() = v } } } case reflect.Bool: switch { case isSlice: // E.g., []bool mfi.merge = func(dst, src pointer) { sfsp := src.toBoolSlice() if *sfsp != nil { dfsp := dst.toBoolSlice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []bool{} } } } case isPointer: // E.g., *bool mfi.merge = func(dst, src pointer) { sfpp := src.toBoolPtr() if *sfpp != nil { dfpp := dst.toBoolPtr() if *dfpp == nil { *dfpp = Bool(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., bool mfi.merge = func(dst, src pointer) { if v := *src.toBool(); v { *dst.toBool() = v } } } case reflect.String: switch { case isSlice: // E.g., []string mfi.merge = func(dst, src pointer) { sfsp := src.toStringSlice() if *sfsp != nil { dfsp := dst.toStringSlice() *dfsp = append(*dfsp, *sfsp...) if *dfsp == nil { *dfsp = []string{} } } } case isPointer: // E.g., *string mfi.merge = func(dst, src pointer) { sfpp := src.toStringPtr() if *sfpp != nil { dfpp := dst.toStringPtr() if *dfpp == nil { *dfpp = String(**sfpp) } else { **dfpp = **sfpp } } } default: // E.g., string mfi.merge = func(dst, src pointer) { if v := *src.toString(); v != "" { *dst.toString() = v } } } case reflect.Slice: isProto3 := props.Prop[i].proto3 switch { case isPointer: panic("bad pointer in byte slice case in " + tf.Name()) case tf.Elem().Kind() != reflect.Uint8: panic("bad element kind in byte slice case in " + tf.Name()) case isSlice: // E.g., [][]byte mfi.merge = func(dst, src pointer) { sbsp := src.toBytesSlice() if *sbsp != nil { dbsp := dst.toBytesSlice() for _, sb := range *sbsp { if sb == nil { *dbsp = append(*dbsp, nil) } else { *dbsp = append(*dbsp, append([]byte{}, sb...)) } } if *dbsp == nil { *dbsp = [][]byte{} } } } default: // E.g., []byte mfi.merge = func(dst, src pointer) { sbp := src.toBytes() if *sbp != nil { dbp := dst.toBytes() if !isProto3 || len(*sbp) > 0 { *dbp = append([]byte{}, *sbp...) } } } } case reflect.Struct: switch { case !isPointer: panic(fmt.Sprintf("message field %s without pointer", tf)) case isSlice: // E.g., []*pb.T mi := getMergeInfo(tf) mfi.merge = func(dst, src pointer) { sps := src.getPointerSlice() if sps != nil { dps := dst.getPointerSlice() for _, sp := range sps { var dp pointer if !sp.isNil() { dp = valToPointer(reflect.New(tf)) mi.merge(dp, sp) } dps = append(dps, dp) } if dps == nil { dps = []pointer{} } dst.setPointerSlice(dps) } } default: // E.g., *pb.T mi := getMergeInfo(tf) mfi.merge = func(dst, src pointer) { sp := src.getPointer() if !sp.isNil() { dp := dst.getPointer() if dp.isNil() { dp = valToPointer(reflect.New(tf)) dst.setPointer(dp) } mi.merge(dp, sp) } } } case reflect.Map: switch { case isPointer || isSlice: panic("bad pointer or slice in map case in " + tf.Name()) default: // E.g., map[K]V mfi.merge = func(dst, src pointer) { sm := src.asPointerTo(tf).Elem() if sm.Len() == 0 { return } dm := dst.asPointerTo(tf).Elem() if dm.IsNil() { dm.Set(reflect.MakeMap(tf)) } switch tf.Elem().Kind() { case reflect.Ptr: // Proto struct (e.g., *T) for _, key := range sm.MapKeys() { val := sm.MapIndex(key) val = reflect.ValueOf(Clone(val.Interface().(Message))) dm.SetMapIndex(key, val) } case reflect.Slice: // E.g. Bytes type (e.g., []byte) for _, key := range sm.MapKeys() { val := sm.MapIndex(key) val = reflect.ValueOf(append([]byte{}, val.Bytes()...)) dm.SetMapIndex(key, val) } default: // Basic type (e.g., string) for _, key := range sm.MapKeys() { val := sm.MapIndex(key) dm.SetMapIndex(key, val) } } } } case reflect.Interface: // Must be oneof field. switch { case isPointer || isSlice: panic("bad pointer or slice in interface case in " + tf.Name()) default: // E.g., interface{} // TODO: Make this faster? mfi.merge = func(dst, src pointer) { su := src.asPointerTo(tf).Elem() if !su.IsNil() { du := dst.asPointerTo(tf).Elem() typ := su.Elem().Type() if du.IsNil() || du.Elem().Type() != typ { du.Set(reflect.New(typ.Elem())) // Initialize interface if empty } sv := su.Elem().Elem().Field(0) if sv.Kind() == reflect.Ptr && sv.IsNil() { return } dv := du.Elem().Elem().Field(0) if dv.Kind() == reflect.Ptr && dv.IsNil() { dv.Set(reflect.New(sv.Type().Elem())) // Initialize proto message if empty } switch sv.Type().Kind() { case reflect.Ptr: // Proto struct (e.g., *T) Merge(dv.Interface().(Message), sv.Interface().(Message)) case reflect.Slice: // E.g. Bytes type (e.g., []byte) dv.Set(reflect.ValueOf(append([]byte{}, sv.Bytes()...))) default: // Basic type (e.g., string) dv.Set(sv) } } } } default: panic(fmt.Sprintf("merger not found for type:%s", tf)) } mi.fields = append(mi.fields, mfi) } mi.unrecognized = invalidField if f, ok := t.FieldByName("XXX_unrecognized"); ok { if f.Type != reflect.TypeOf([]byte{}) { panic("expected XXX_unrecognized to be of type []byte") } mi.unrecognized = toField(&f) } atomic.StoreInt32(&mi.initialized, 1) } ================================================ FILE: vendor/github.com/golang/protobuf/proto/table_unmarshal.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto import ( "errors" "fmt" "io" "math" "reflect" "strconv" "strings" "sync" "sync/atomic" "unicode/utf8" ) // Unmarshal is the entry point from the generated .pb.go files. // This function is not intended to be used by non-generated code. // This function is not subject to any compatibility guarantee. // msg contains a pointer to a protocol buffer struct. // b is the data to be unmarshaled into the protocol buffer. // a is a pointer to a place to store cached unmarshal information. func (a *InternalMessageInfo) Unmarshal(msg Message, b []byte) error { // Load the unmarshal information for this message type. // The atomic load ensures memory consistency. u := atomicLoadUnmarshalInfo(&a.unmarshal) if u == nil { // Slow path: find unmarshal info for msg, update a with it. u = getUnmarshalInfo(reflect.TypeOf(msg).Elem()) atomicStoreUnmarshalInfo(&a.unmarshal, u) } // Then do the unmarshaling. err := u.unmarshal(toPointer(&msg), b) return err } type unmarshalInfo struct { typ reflect.Type // type of the protobuf struct // 0 = only typ field is initialized // 1 = completely initialized initialized int32 lock sync.Mutex // prevents double initialization dense []unmarshalFieldInfo // fields indexed by tag # sparse map[uint64]unmarshalFieldInfo // fields indexed by tag # reqFields []string // names of required fields reqMask uint64 // 1< 0 { // Read tag and wire type. // Special case 1 and 2 byte varints. var x uint64 if b[0] < 128 { x = uint64(b[0]) b = b[1:] } else if len(b) >= 2 && b[1] < 128 { x = uint64(b[0]&0x7f) + uint64(b[1])<<7 b = b[2:] } else { var n int x, n = decodeVarint(b) if n == 0 { return io.ErrUnexpectedEOF } b = b[n:] } tag := x >> 3 wire := int(x) & 7 // Dispatch on the tag to one of the unmarshal* functions below. var f unmarshalFieldInfo if tag < uint64(len(u.dense)) { f = u.dense[tag] } else { f = u.sparse[tag] } if fn := f.unmarshal; fn != nil { var err error b, err = fn(b, m.offset(f.field), wire) if err == nil { reqMask |= f.reqMask continue } if r, ok := err.(*RequiredNotSetError); ok { // Remember this error, but keep parsing. We need to produce // a full parse even if a required field is missing. if errLater == nil { errLater = r } reqMask |= f.reqMask continue } if err != errInternalBadWireType { if err == errInvalidUTF8 { if errLater == nil { fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name errLater = &invalidUTF8Error{fullName} } continue } return err } // Fragments with bad wire type are treated as unknown fields. } // Unknown tag. if !u.unrecognized.IsValid() { // Don't keep unrecognized data; just skip it. var err error b, err = skipField(b, wire) if err != nil { return err } continue } // Keep unrecognized data around. // maybe in extensions, maybe in the unrecognized field. z := m.offset(u.unrecognized).toBytes() var emap map[int32]Extension var e Extension for _, r := range u.extensionRanges { if uint64(r.Start) <= tag && tag <= uint64(r.End) { if u.extensions.IsValid() { mp := m.offset(u.extensions).toExtensions() emap = mp.extensionsWrite() e = emap[int32(tag)] z = &e.enc break } if u.oldExtensions.IsValid() { p := m.offset(u.oldExtensions).toOldExtensions() emap = *p if emap == nil { emap = map[int32]Extension{} *p = emap } e = emap[int32(tag)] z = &e.enc break } panic("no extensions field available") } } // Use wire type to skip data. var err error b0 := b b, err = skipField(b, wire) if err != nil { return err } *z = encodeVarint(*z, tag<<3|uint64(wire)) *z = append(*z, b0[:len(b0)-len(b)]...) if emap != nil { emap[int32(tag)] = e } } if reqMask != u.reqMask && errLater == nil { // A required field of this message is missing. for _, n := range u.reqFields { if reqMask&1 == 0 { errLater = &RequiredNotSetError{n} } reqMask >>= 1 } } return errLater } // computeUnmarshalInfo fills in u with information for use // in unmarshaling protocol buffers of type u.typ. func (u *unmarshalInfo) computeUnmarshalInfo() { u.lock.Lock() defer u.lock.Unlock() if u.initialized != 0 { return } t := u.typ n := t.NumField() // Set up the "not found" value for the unrecognized byte buffer. // This is the default for proto3. u.unrecognized = invalidField u.extensions = invalidField u.oldExtensions = invalidField // List of the generated type and offset for each oneof field. type oneofField struct { ityp reflect.Type // interface type of oneof field field field // offset in containing message } var oneofFields []oneofField for i := 0; i < n; i++ { f := t.Field(i) if f.Name == "XXX_unrecognized" { // The byte slice used to hold unrecognized input is special. if f.Type != reflect.TypeOf(([]byte)(nil)) { panic("bad type for XXX_unrecognized field: " + f.Type.Name()) } u.unrecognized = toField(&f) continue } if f.Name == "XXX_InternalExtensions" { // Ditto here. if f.Type != reflect.TypeOf(XXX_InternalExtensions{}) { panic("bad type for XXX_InternalExtensions field: " + f.Type.Name()) } u.extensions = toField(&f) if f.Tag.Get("protobuf_messageset") == "1" { u.isMessageSet = true } continue } if f.Name == "XXX_extensions" { // An older form of the extensions field. if f.Type != reflect.TypeOf((map[int32]Extension)(nil)) { panic("bad type for XXX_extensions field: " + f.Type.Name()) } u.oldExtensions = toField(&f) continue } if f.Name == "XXX_NoUnkeyedLiteral" || f.Name == "XXX_sizecache" { continue } oneof := f.Tag.Get("protobuf_oneof") if oneof != "" { oneofFields = append(oneofFields, oneofField{f.Type, toField(&f)}) // The rest of oneof processing happens below. continue } tags := f.Tag.Get("protobuf") tagArray := strings.Split(tags, ",") if len(tagArray) < 2 { panic("protobuf tag not enough fields in " + t.Name() + "." + f.Name + ": " + tags) } tag, err := strconv.Atoi(tagArray[1]) if err != nil { panic("protobuf tag field not an integer: " + tagArray[1]) } name := "" for _, tag := range tagArray[3:] { if strings.HasPrefix(tag, "name=") { name = tag[5:] } } // Extract unmarshaling function from the field (its type and tags). unmarshal := fieldUnmarshaler(&f) // Required field? var reqMask uint64 if tagArray[2] == "req" { bit := len(u.reqFields) u.reqFields = append(u.reqFields, name) reqMask = uint64(1) << uint(bit) // TODO: if we have more than 64 required fields, we end up // not verifying that all required fields are present. // Fix this, perhaps using a count of required fields? } // Store the info in the correct slot in the message. u.setTag(tag, toField(&f), unmarshal, reqMask, name) } // Find any types associated with oneof fields. var oneofImplementers []interface{} switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) { case oneofFuncsIface: _, _, _, oneofImplementers = m.XXX_OneofFuncs() case oneofWrappersIface: oneofImplementers = m.XXX_OneofWrappers() } for _, v := range oneofImplementers { tptr := reflect.TypeOf(v) // *Msg_X typ := tptr.Elem() // Msg_X f := typ.Field(0) // oneof implementers have one field baseUnmarshal := fieldUnmarshaler(&f) tags := strings.Split(f.Tag.Get("protobuf"), ",") fieldNum, err := strconv.Atoi(tags[1]) if err != nil { panic("protobuf tag field not an integer: " + tags[1]) } var name string for _, tag := range tags { if strings.HasPrefix(tag, "name=") { name = strings.TrimPrefix(tag, "name=") break } } // Find the oneof field that this struct implements. // Might take O(n^2) to process all of the oneofs, but who cares. for _, of := range oneofFields { if tptr.Implements(of.ityp) { // We have found the corresponding interface for this struct. // That lets us know where this struct should be stored // when we encounter it during unmarshaling. unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal) u.setTag(fieldNum, of.field, unmarshal, 0, name) } } } // Get extension ranges, if any. fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray") if fn.IsValid() { if !u.extensions.IsValid() && !u.oldExtensions.IsValid() { panic("a message with extensions, but no extensions field in " + t.Name()) } u.extensionRanges = fn.Call(nil)[0].Interface().([]ExtensionRange) } // Explicitly disallow tag 0. This will ensure we flag an error // when decoding a buffer of all zeros. Without this code, we // would decode and skip an all-zero buffer of even length. // [0 0] is [tag=0/wiretype=varint varint-encoded-0]. u.setTag(0, zeroField, func(b []byte, f pointer, w int) ([]byte, error) { return nil, fmt.Errorf("proto: %s: illegal tag 0 (wire type %d)", t, w) }, 0, "") // Set mask for required field check. u.reqMask = uint64(1)<= 0 && (tag < 16 || tag < 2*n) { // TODO: what are the right numbers here? for len(u.dense) <= tag { u.dense = append(u.dense, unmarshalFieldInfo{}) } u.dense[tag] = i return } if u.sparse == nil { u.sparse = map[uint64]unmarshalFieldInfo{} } u.sparse[uint64(tag)] = i } // fieldUnmarshaler returns an unmarshaler for the given field. func fieldUnmarshaler(f *reflect.StructField) unmarshaler { if f.Type.Kind() == reflect.Map { return makeUnmarshalMap(f) } return typeUnmarshaler(f.Type, f.Tag.Get("protobuf")) } // typeUnmarshaler returns an unmarshaler for the given field type / field tag pair. func typeUnmarshaler(t reflect.Type, tags string) unmarshaler { tagArray := strings.Split(tags, ",") encoding := tagArray[0] name := "unknown" proto3 := false validateUTF8 := true for _, tag := range tagArray[3:] { if strings.HasPrefix(tag, "name=") { name = tag[5:] } if tag == "proto3" { proto3 = true } } validateUTF8 = validateUTF8 && proto3 // Figure out packaging (pointer, slice, or both) slice := false pointer := false if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 { slice = true t = t.Elem() } if t.Kind() == reflect.Ptr { pointer = true t = t.Elem() } // We'll never have both pointer and slice for basic types. if pointer && slice && t.Kind() != reflect.Struct { panic("both pointer and slice for basic type in " + t.Name()) } switch t.Kind() { case reflect.Bool: if pointer { return unmarshalBoolPtr } if slice { return unmarshalBoolSlice } return unmarshalBoolValue case reflect.Int32: switch encoding { case "fixed32": if pointer { return unmarshalFixedS32Ptr } if slice { return unmarshalFixedS32Slice } return unmarshalFixedS32Value case "varint": // this could be int32 or enum if pointer { return unmarshalInt32Ptr } if slice { return unmarshalInt32Slice } return unmarshalInt32Value case "zigzag32": if pointer { return unmarshalSint32Ptr } if slice { return unmarshalSint32Slice } return unmarshalSint32Value } case reflect.Int64: switch encoding { case "fixed64": if pointer { return unmarshalFixedS64Ptr } if slice { return unmarshalFixedS64Slice } return unmarshalFixedS64Value case "varint": if pointer { return unmarshalInt64Ptr } if slice { return unmarshalInt64Slice } return unmarshalInt64Value case "zigzag64": if pointer { return unmarshalSint64Ptr } if slice { return unmarshalSint64Slice } return unmarshalSint64Value } case reflect.Uint32: switch encoding { case "fixed32": if pointer { return unmarshalFixed32Ptr } if slice { return unmarshalFixed32Slice } return unmarshalFixed32Value case "varint": if pointer { return unmarshalUint32Ptr } if slice { return unmarshalUint32Slice } return unmarshalUint32Value } case reflect.Uint64: switch encoding { case "fixed64": if pointer { return unmarshalFixed64Ptr } if slice { return unmarshalFixed64Slice } return unmarshalFixed64Value case "varint": if pointer { return unmarshalUint64Ptr } if slice { return unmarshalUint64Slice } return unmarshalUint64Value } case reflect.Float32: if pointer { return unmarshalFloat32Ptr } if slice { return unmarshalFloat32Slice } return unmarshalFloat32Value case reflect.Float64: if pointer { return unmarshalFloat64Ptr } if slice { return unmarshalFloat64Slice } return unmarshalFloat64Value case reflect.Map: panic("map type in typeUnmarshaler in " + t.Name()) case reflect.Slice: if pointer { panic("bad pointer in slice case in " + t.Name()) } if slice { return unmarshalBytesSlice } return unmarshalBytesValue case reflect.String: if validateUTF8 { if pointer { return unmarshalUTF8StringPtr } if slice { return unmarshalUTF8StringSlice } return unmarshalUTF8StringValue } if pointer { return unmarshalStringPtr } if slice { return unmarshalStringSlice } return unmarshalStringValue case reflect.Struct: // message or group field if !pointer { panic(fmt.Sprintf("message/group field %s:%s without pointer", t, encoding)) } switch encoding { case "bytes": if slice { return makeUnmarshalMessageSlicePtr(getUnmarshalInfo(t), name) } return makeUnmarshalMessagePtr(getUnmarshalInfo(t), name) case "group": if slice { return makeUnmarshalGroupSlicePtr(getUnmarshalInfo(t), name) } return makeUnmarshalGroupPtr(getUnmarshalInfo(t), name) } } panic(fmt.Sprintf("unmarshaler not found type:%s encoding:%s", t, encoding)) } // Below are all the unmarshalers for individual fields of various types. func unmarshalInt64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x) *f.toInt64() = v return b, nil } func unmarshalInt64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x) *f.toInt64Ptr() = &v return b, nil } func unmarshalInt64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x) s := f.toInt64Slice() *s = append(*s, v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x) s := f.toInt64Slice() *s = append(*s, v) return b, nil } func unmarshalSint64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x>>1) ^ int64(x)<<63>>63 *f.toInt64() = v return b, nil } func unmarshalSint64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x>>1) ^ int64(x)<<63>>63 *f.toInt64Ptr() = &v return b, nil } func unmarshalSint64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x>>1) ^ int64(x)<<63>>63 s := f.toInt64Slice() *s = append(*s, v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int64(x>>1) ^ int64(x)<<63>>63 s := f.toInt64Slice() *s = append(*s, v) return b, nil } func unmarshalUint64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint64(x) *f.toUint64() = v return b, nil } func unmarshalUint64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint64(x) *f.toUint64Ptr() = &v return b, nil } func unmarshalUint64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint64(x) s := f.toUint64Slice() *s = append(*s, v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint64(x) s := f.toUint64Slice() *s = append(*s, v) return b, nil } func unmarshalInt32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x) *f.toInt32() = v return b, nil } func unmarshalInt32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x) f.setInt32Ptr(v) return b, nil } func unmarshalInt32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x) f.appendInt32Slice(v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x) f.appendInt32Slice(v) return b, nil } func unmarshalSint32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x>>1) ^ int32(x)<<31>>31 *f.toInt32() = v return b, nil } func unmarshalSint32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x>>1) ^ int32(x)<<31>>31 f.setInt32Ptr(v) return b, nil } func unmarshalSint32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x>>1) ^ int32(x)<<31>>31 f.appendInt32Slice(v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := int32(x>>1) ^ int32(x)<<31>>31 f.appendInt32Slice(v) return b, nil } func unmarshalUint32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint32(x) *f.toUint32() = v return b, nil } func unmarshalUint32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint32(x) *f.toUint32Ptr() = &v return b, nil } func unmarshalUint32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint32(x) s := f.toUint32Slice() *s = append(*s, v) } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] v := uint32(x) s := f.toUint32Slice() *s = append(*s, v) return b, nil } func unmarshalFixed64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 *f.toUint64() = v return b[8:], nil } func unmarshalFixed64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 *f.toUint64Ptr() = &v return b[8:], nil } func unmarshalFixed64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 s := f.toUint64Slice() *s = append(*s, v) b = b[8:] } return res, nil } if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 s := f.toUint64Slice() *s = append(*s, v) return b[8:], nil } func unmarshalFixedS64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56 *f.toInt64() = v return b[8:], nil } func unmarshalFixedS64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56 *f.toInt64Ptr() = &v return b[8:], nil } func unmarshalFixedS64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56 s := f.toInt64Slice() *s = append(*s, v) b = b[8:] } return res, nil } if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56 s := f.toInt64Slice() *s = append(*s, v) return b[8:], nil } func unmarshalFixed32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 *f.toUint32() = v return b[4:], nil } func unmarshalFixed32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 *f.toUint32Ptr() = &v return b[4:], nil } func unmarshalFixed32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 s := f.toUint32Slice() *s = append(*s, v) b = b[4:] } return res, nil } if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 s := f.toUint32Slice() *s = append(*s, v) return b[4:], nil } func unmarshalFixedS32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24 *f.toInt32() = v return b[4:], nil } func unmarshalFixedS32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24 f.setInt32Ptr(v) return b[4:], nil } func unmarshalFixedS32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24 f.appendInt32Slice(v) b = b[4:] } return res, nil } if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24 f.appendInt32Slice(v) return b[4:], nil } func unmarshalBoolValue(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } // Note: any length varint is allowed, even though any sane // encoder will use one byte. // See https://github.com/golang/protobuf/issues/76 x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } // TODO: check if x>1? Tests seem to indicate no. v := x != 0 *f.toBool() = v return b[n:], nil } func unmarshalBoolPtr(b []byte, f pointer, w int) ([]byte, error) { if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } v := x != 0 *f.toBoolPtr() = &v return b[n:], nil } func unmarshalBoolSlice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { x, n = decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } v := x != 0 s := f.toBoolSlice() *s = append(*s, v) b = b[n:] } return res, nil } if w != WireVarint { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } v := x != 0 s := f.toBoolSlice() *s = append(*s, v) return b[n:], nil } func unmarshalFloat64Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56) *f.toFloat64() = v return b[8:], nil } func unmarshalFloat64Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56) *f.toFloat64Ptr() = &v return b[8:], nil } func unmarshalFloat64Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56) s := f.toFloat64Slice() *s = append(*s, v) b = b[8:] } return res, nil } if w != WireFixed64 { return b, errInternalBadWireType } if len(b) < 8 { return nil, io.ErrUnexpectedEOF } v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56) s := f.toFloat64Slice() *s = append(*s, v) return b[8:], nil } func unmarshalFloat32Value(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24) *f.toFloat32() = v return b[4:], nil } func unmarshalFloat32Ptr(b []byte, f pointer, w int) ([]byte, error) { if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24) *f.toFloat32Ptr() = &v return b[4:], nil } func unmarshalFloat32Slice(b []byte, f pointer, w int) ([]byte, error) { if w == WireBytes { // packed x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } res := b[x:] b = b[:x] for len(b) > 0 { if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24) s := f.toFloat32Slice() *s = append(*s, v) b = b[4:] } return res, nil } if w != WireFixed32 { return b, errInternalBadWireType } if len(b) < 4 { return nil, io.ErrUnexpectedEOF } v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24) s := f.toFloat32Slice() *s = append(*s, v) return b[4:], nil } func unmarshalStringValue(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) *f.toString() = v return b[x:], nil } func unmarshalStringPtr(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) *f.toStringPtr() = &v return b[x:], nil } func unmarshalStringSlice(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) s := f.toStringSlice() *s = append(*s, v) return b[x:], nil } func unmarshalUTF8StringValue(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) *f.toString() = v if !utf8.ValidString(v) { return b[x:], errInvalidUTF8 } return b[x:], nil } func unmarshalUTF8StringPtr(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) *f.toStringPtr() = &v if !utf8.ValidString(v) { return b[x:], errInvalidUTF8 } return b[x:], nil } func unmarshalUTF8StringSlice(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := string(b[:x]) s := f.toStringSlice() *s = append(*s, v) if !utf8.ValidString(v) { return b[x:], errInvalidUTF8 } return b[x:], nil } var emptyBuf [0]byte func unmarshalBytesValue(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } // The use of append here is a trick which avoids the zeroing // that would be required if we used a make/copy pair. // We append to emptyBuf instead of nil because we want // a non-nil result even when the length is 0. v := append(emptyBuf[:], b[:x]...) *f.toBytes() = v return b[x:], nil } func unmarshalBytesSlice(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := append(emptyBuf[:], b[:x]...) s := f.toBytesSlice() *s = append(*s, v) return b[x:], nil } func makeUnmarshalMessagePtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } // First read the message field to see if something is there. // The semantics of multiple submessages are weird. Instead of // the last one winning (as it is for all other fields), multiple // submessages are merged. v := f.getPointer() if v.isNil() { v = valToPointer(reflect.New(sub.typ)) f.setPointer(v) } err := sub.unmarshal(v, b[:x]) if err != nil { if r, ok := err.(*RequiredNotSetError); ok { r.field = name + "." + r.field } else { return nil, err } } return b[x:], err } } func makeUnmarshalMessageSlicePtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireBytes { return b, errInternalBadWireType } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } v := valToPointer(reflect.New(sub.typ)) err := sub.unmarshal(v, b[:x]) if err != nil { if r, ok := err.(*RequiredNotSetError); ok { r.field = name + "." + r.field } else { return nil, err } } f.appendPointer(v) return b[x:], err } } func makeUnmarshalGroupPtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireStartGroup { return b, errInternalBadWireType } x, y := findEndGroup(b) if x < 0 { return nil, io.ErrUnexpectedEOF } v := f.getPointer() if v.isNil() { v = valToPointer(reflect.New(sub.typ)) f.setPointer(v) } err := sub.unmarshal(v, b[:x]) if err != nil { if r, ok := err.(*RequiredNotSetError); ok { r.field = name + "." + r.field } else { return nil, err } } return b[y:], err } } func makeUnmarshalGroupSlicePtr(sub *unmarshalInfo, name string) unmarshaler { return func(b []byte, f pointer, w int) ([]byte, error) { if w != WireStartGroup { return b, errInternalBadWireType } x, y := findEndGroup(b) if x < 0 { return nil, io.ErrUnexpectedEOF } v := valToPointer(reflect.New(sub.typ)) err := sub.unmarshal(v, b[:x]) if err != nil { if r, ok := err.(*RequiredNotSetError); ok { r.field = name + "." + r.field } else { return nil, err } } f.appendPointer(v) return b[y:], err } } func makeUnmarshalMap(f *reflect.StructField) unmarshaler { t := f.Type kt := t.Key() vt := t.Elem() unmarshalKey := typeUnmarshaler(kt, f.Tag.Get("protobuf_key")) unmarshalVal := typeUnmarshaler(vt, f.Tag.Get("protobuf_val")) return func(b []byte, f pointer, w int) ([]byte, error) { // The map entry is a submessage. Figure out how big it is. if w != WireBytes { return nil, fmt.Errorf("proto: bad wiretype for map field: got %d want %d", w, WireBytes) } x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } b = b[n:] if x > uint64(len(b)) { return nil, io.ErrUnexpectedEOF } r := b[x:] // unused data to return b = b[:x] // data for map entry // Note: we could use #keys * #values ~= 200 functions // to do map decoding without reflection. Probably not worth it. // Maps will be somewhat slow. Oh well. // Read key and value from data. var nerr nonFatal k := reflect.New(kt) v := reflect.New(vt) for len(b) > 0 { x, n := decodeVarint(b) if n == 0 { return nil, io.ErrUnexpectedEOF } wire := int(x) & 7 b = b[n:] var err error switch x >> 3 { case 1: b, err = unmarshalKey(b, valToPointer(k), wire) case 2: b, err = unmarshalVal(b, valToPointer(v), wire) default: err = errInternalBadWireType // skip unknown tag } if nerr.Merge(err) { continue } if err != errInternalBadWireType { return nil, err } // Skip past unknown fields. b, err = skipField(b, wire) if err != nil { return nil, err } } // Get map, allocate if needed. m := f.asPointerTo(t).Elem() // an addressable map[K]T if m.IsNil() { m.Set(reflect.MakeMap(t)) } // Insert into map. m.SetMapIndex(k.Elem(), v.Elem()) return r, nerr.E } } // makeUnmarshalOneof makes an unmarshaler for oneof fields. // for: // message Msg { // oneof F { // int64 X = 1; // float64 Y = 2; // } // } // typ is the type of the concrete entry for a oneof case (e.g. Msg_X). // ityp is the interface type of the oneof field (e.g. isMsg_F). // unmarshal is the unmarshaler for the base type of the oneof case (e.g. int64). // Note that this function will be called once for each case in the oneof. func makeUnmarshalOneof(typ, ityp reflect.Type, unmarshal unmarshaler) unmarshaler { sf := typ.Field(0) field0 := toField(&sf) return func(b []byte, f pointer, w int) ([]byte, error) { // Allocate holder for value. v := reflect.New(typ) // Unmarshal data into holder. // We unmarshal into the first field of the holder object. var err error var nerr nonFatal b, err = unmarshal(b, valToPointer(v).offset(field0), w) if !nerr.Merge(err) { return nil, err } // Write pointer to holder into target field. f.asPointerTo(ityp).Elem().Set(v) return b, nerr.E } } // Error used by decode internally. var errInternalBadWireType = errors.New("proto: internal error: bad wiretype") // skipField skips past a field of type wire and returns the remaining bytes. func skipField(b []byte, wire int) ([]byte, error) { switch wire { case WireVarint: _, k := decodeVarint(b) if k == 0 { return b, io.ErrUnexpectedEOF } b = b[k:] case WireFixed32: if len(b) < 4 { return b, io.ErrUnexpectedEOF } b = b[4:] case WireFixed64: if len(b) < 8 { return b, io.ErrUnexpectedEOF } b = b[8:] case WireBytes: m, k := decodeVarint(b) if k == 0 || uint64(len(b)-k) < m { return b, io.ErrUnexpectedEOF } b = b[uint64(k)+m:] case WireStartGroup: _, i := findEndGroup(b) if i == -1 { return b, io.ErrUnexpectedEOF } b = b[i:] default: return b, fmt.Errorf("proto: can't skip unknown wire type %d", wire) } return b, nil } // findEndGroup finds the index of the next EndGroup tag. // Groups may be nested, so the "next" EndGroup tag is the first // unpaired EndGroup. // findEndGroup returns the indexes of the start and end of the EndGroup tag. // Returns (-1,-1) if it can't find one. func findEndGroup(b []byte) (int, int) { depth := 1 i := 0 for { x, n := decodeVarint(b[i:]) if n == 0 { return -1, -1 } j := i i += n switch x & 7 { case WireVarint: _, k := decodeVarint(b[i:]) if k == 0 { return -1, -1 } i += k case WireFixed32: if len(b)-4 < i { return -1, -1 } i += 4 case WireFixed64: if len(b)-8 < i { return -1, -1 } i += 8 case WireBytes: m, k := decodeVarint(b[i:]) if k == 0 { return -1, -1 } i += k if uint64(len(b)-i) < m { return -1, -1 } i += int(m) case WireStartGroup: depth++ case WireEndGroup: depth-- if depth == 0 { return j, i } default: return -1, -1 } } } // encodeVarint appends a varint-encoded integer to b and returns the result. func encodeVarint(b []byte, x uint64) []byte { for x >= 1<<7 { b = append(b, byte(x&0x7f|0x80)) x >>= 7 } return append(b, byte(x)) } // decodeVarint reads a varint-encoded integer from b. // Returns the decoded integer and the number of bytes read. // If there is an error, it returns 0,0. func decodeVarint(b []byte) (uint64, int) { var x, y uint64 if len(b) == 0 { goto bad } x = uint64(b[0]) if x < 0x80 { return x, 1 } x -= 0x80 if len(b) <= 1 { goto bad } y = uint64(b[1]) x += y << 7 if y < 0x80 { return x, 2 } x -= 0x80 << 7 if len(b) <= 2 { goto bad } y = uint64(b[2]) x += y << 14 if y < 0x80 { return x, 3 } x -= 0x80 << 14 if len(b) <= 3 { goto bad } y = uint64(b[3]) x += y << 21 if y < 0x80 { return x, 4 } x -= 0x80 << 21 if len(b) <= 4 { goto bad } y = uint64(b[4]) x += y << 28 if y < 0x80 { return x, 5 } x -= 0x80 << 28 if len(b) <= 5 { goto bad } y = uint64(b[5]) x += y << 35 if y < 0x80 { return x, 6 } x -= 0x80 << 35 if len(b) <= 6 { goto bad } y = uint64(b[6]) x += y << 42 if y < 0x80 { return x, 7 } x -= 0x80 << 42 if len(b) <= 7 { goto bad } y = uint64(b[7]) x += y << 49 if y < 0x80 { return x, 8 } x -= 0x80 << 49 if len(b) <= 8 { goto bad } y = uint64(b[8]) x += y << 56 if y < 0x80 { return x, 9 } x -= 0x80 << 56 if len(b) <= 9 { goto bad } y = uint64(b[9]) x += y << 63 if y < 2 { return x, 10 } bad: return 0, 0 } ================================================ FILE: vendor/github.com/golang/protobuf/proto/text.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto // Functions for writing the text protocol buffer format. import ( "bufio" "bytes" "encoding" "errors" "fmt" "io" "log" "math" "reflect" "sort" "strings" ) var ( newline = []byte("\n") spaces = []byte(" ") endBraceNewline = []byte("}\n") backslashN = []byte{'\\', 'n'} backslashR = []byte{'\\', 'r'} backslashT = []byte{'\\', 't'} backslashDQ = []byte{'\\', '"'} backslashBS = []byte{'\\', '\\'} posInf = []byte("inf") negInf = []byte("-inf") nan = []byte("nan") ) type writer interface { io.Writer WriteByte(byte) error } // textWriter is an io.Writer that tracks its indentation level. type textWriter struct { ind int complete bool // if the current position is a complete line compact bool // whether to write out as a one-liner w writer } func (w *textWriter) WriteString(s string) (n int, err error) { if !strings.Contains(s, "\n") { if !w.compact && w.complete { w.writeIndent() } w.complete = false return io.WriteString(w.w, s) } // WriteString is typically called without newlines, so this // codepath and its copy are rare. We copy to avoid // duplicating all of Write's logic here. return w.Write([]byte(s)) } func (w *textWriter) Write(p []byte) (n int, err error) { newlines := bytes.Count(p, newline) if newlines == 0 { if !w.compact && w.complete { w.writeIndent() } n, err = w.w.Write(p) w.complete = false return n, err } frags := bytes.SplitN(p, newline, newlines+1) if w.compact { for i, frag := range frags { if i > 0 { if err := w.w.WriteByte(' '); err != nil { return n, err } n++ } nn, err := w.w.Write(frag) n += nn if err != nil { return n, err } } return n, nil } for i, frag := range frags { if w.complete { w.writeIndent() } nn, err := w.w.Write(frag) n += nn if err != nil { return n, err } if i+1 < len(frags) { if err := w.w.WriteByte('\n'); err != nil { return n, err } n++ } } w.complete = len(frags[len(frags)-1]) == 0 return n, nil } func (w *textWriter) WriteByte(c byte) error { if w.compact && c == '\n' { c = ' ' } if !w.compact && w.complete { w.writeIndent() } err := w.w.WriteByte(c) w.complete = c == '\n' return err } func (w *textWriter) indent() { w.ind++ } func (w *textWriter) unindent() { if w.ind == 0 { log.Print("proto: textWriter unindented too far") return } w.ind-- } func writeName(w *textWriter, props *Properties) error { if _, err := w.WriteString(props.OrigName); err != nil { return err } if props.Wire != "group" { return w.WriteByte(':') } return nil } func requiresQuotes(u string) bool { // When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted. for _, ch := range u { switch { case ch == '.' || ch == '/' || ch == '_': continue case '0' <= ch && ch <= '9': continue case 'A' <= ch && ch <= 'Z': continue case 'a' <= ch && ch <= 'z': continue default: return true } } return false } // isAny reports whether sv is a google.protobuf.Any message func isAny(sv reflect.Value) bool { type wkt interface { XXX_WellKnownType() string } t, ok := sv.Addr().Interface().(wkt) return ok && t.XXX_WellKnownType() == "Any" } // writeProto3Any writes an expanded google.protobuf.Any message. // // It returns (false, nil) if sv value can't be unmarshaled (e.g. because // required messages are not linked in). // // It returns (true, error) when sv was written in expanded format or an error // was encountered. func (tm *TextMarshaler) writeProto3Any(w *textWriter, sv reflect.Value) (bool, error) { turl := sv.FieldByName("TypeUrl") val := sv.FieldByName("Value") if !turl.IsValid() || !val.IsValid() { return true, errors.New("proto: invalid google.protobuf.Any message") } b, ok := val.Interface().([]byte) if !ok { return true, errors.New("proto: invalid google.protobuf.Any message") } parts := strings.Split(turl.String(), "/") mt := MessageType(parts[len(parts)-1]) if mt == nil { return false, nil } m := reflect.New(mt.Elem()) if err := Unmarshal(b, m.Interface().(Message)); err != nil { return false, nil } w.Write([]byte("[")) u := turl.String() if requiresQuotes(u) { writeString(w, u) } else { w.Write([]byte(u)) } if w.compact { w.Write([]byte("]:<")) } else { w.Write([]byte("]: <\n")) w.ind++ } if err := tm.writeStruct(w, m.Elem()); err != nil { return true, err } if w.compact { w.Write([]byte("> ")) } else { w.ind-- w.Write([]byte(">\n")) } return true, nil } func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error { if tm.ExpandAny && isAny(sv) { if canExpand, err := tm.writeProto3Any(w, sv); canExpand { return err } } st := sv.Type() sprops := GetProperties(st) for i := 0; i < sv.NumField(); i++ { fv := sv.Field(i) props := sprops.Prop[i] name := st.Field(i).Name if name == "XXX_NoUnkeyedLiteral" { continue } if strings.HasPrefix(name, "XXX_") { // There are two XXX_ fields: // XXX_unrecognized []byte // XXX_extensions map[int32]proto.Extension // The first is handled here; // the second is handled at the bottom of this function. if name == "XXX_unrecognized" && !fv.IsNil() { if err := writeUnknownStruct(w, fv.Interface().([]byte)); err != nil { return err } } continue } if fv.Kind() == reflect.Ptr && fv.IsNil() { // Field not filled in. This could be an optional field or // a required field that wasn't filled in. Either way, there // isn't anything we can show for it. continue } if fv.Kind() == reflect.Slice && fv.IsNil() { // Repeated field that is empty, or a bytes field that is unused. continue } if props.Repeated && fv.Kind() == reflect.Slice { // Repeated field. for j := 0; j < fv.Len(); j++ { if err := writeName(w, props); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } v := fv.Index(j) if v.Kind() == reflect.Ptr && v.IsNil() { // A nil message in a repeated field is not valid, // but we can handle that more gracefully than panicking. if _, err := w.Write([]byte("\n")); err != nil { return err } continue } if err := tm.writeAny(w, v, props); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } } continue } if fv.Kind() == reflect.Map { // Map fields are rendered as a repeated struct with key/value fields. keys := fv.MapKeys() sort.Sort(mapKeys(keys)) for _, key := range keys { val := fv.MapIndex(key) if err := writeName(w, props); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } // open struct if err := w.WriteByte('<'); err != nil { return err } if !w.compact { if err := w.WriteByte('\n'); err != nil { return err } } w.indent() // key if _, err := w.WriteString("key:"); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } if err := tm.writeAny(w, key, props.MapKeyProp); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } // nil values aren't legal, but we can avoid panicking because of them. if val.Kind() != reflect.Ptr || !val.IsNil() { // value if _, err := w.WriteString("value:"); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } if err := tm.writeAny(w, val, props.MapValProp); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } } // close struct w.unindent() if err := w.WriteByte('>'); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } } continue } if props.proto3 && fv.Kind() == reflect.Slice && fv.Len() == 0 { // empty bytes field continue } if fv.Kind() != reflect.Ptr && fv.Kind() != reflect.Slice { // proto3 non-repeated scalar field; skip if zero value if isProto3Zero(fv) { continue } } if fv.Kind() == reflect.Interface { // Check if it is a oneof. if st.Field(i).Tag.Get("protobuf_oneof") != "" { // fv is nil, or holds a pointer to generated struct. // That generated struct has exactly one field, // which has a protobuf struct tag. if fv.IsNil() { continue } inner := fv.Elem().Elem() // interface -> *T -> T tag := inner.Type().Field(0).Tag.Get("protobuf") props = new(Properties) // Overwrite the outer props var, but not its pointee. props.Parse(tag) // Write the value in the oneof, not the oneof itself. fv = inner.Field(0) // Special case to cope with malformed messages gracefully: // If the value in the oneof is a nil pointer, don't panic // in writeAny. if fv.Kind() == reflect.Ptr && fv.IsNil() { // Use errors.New so writeAny won't render quotes. msg := errors.New("/* nil */") fv = reflect.ValueOf(&msg).Elem() } } } if err := writeName(w, props); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } // Enums have a String method, so writeAny will work fine. if err := tm.writeAny(w, fv, props); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } } // Extensions (the XXX_extensions field). pv := sv.Addr() if _, err := extendable(pv.Interface()); err == nil { if err := tm.writeExtensions(w, pv); err != nil { return err } } return nil } // writeAny writes an arbitrary field. func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error { v = reflect.Indirect(v) // Floats have special cases. if v.Kind() == reflect.Float32 || v.Kind() == reflect.Float64 { x := v.Float() var b []byte switch { case math.IsInf(x, 1): b = posInf case math.IsInf(x, -1): b = negInf case math.IsNaN(x): b = nan } if b != nil { _, err := w.Write(b) return err } // Other values are handled below. } // We don't attempt to serialise every possible value type; only those // that can occur in protocol buffers. switch v.Kind() { case reflect.Slice: // Should only be a []byte; repeated fields are handled in writeStruct. if err := writeString(w, string(v.Bytes())); err != nil { return err } case reflect.String: if err := writeString(w, v.String()); err != nil { return err } case reflect.Struct: // Required/optional group/message. var bra, ket byte = '<', '>' if props != nil && props.Wire == "group" { bra, ket = '{', '}' } if err := w.WriteByte(bra); err != nil { return err } if !w.compact { if err := w.WriteByte('\n'); err != nil { return err } } w.indent() if v.CanAddr() { // Calling v.Interface on a struct causes the reflect package to // copy the entire struct. This is racy with the new Marshaler // since we atomically update the XXX_sizecache. // // Thus, we retrieve a pointer to the struct if possible to avoid // a race since v.Interface on the pointer doesn't copy the struct. // // If v is not addressable, then we are not worried about a race // since it implies that the binary Marshaler cannot possibly be // mutating this value. v = v.Addr() } if etm, ok := v.Interface().(encoding.TextMarshaler); ok { text, err := etm.MarshalText() if err != nil { return err } if _, err = w.Write(text); err != nil { return err } } else { if v.Kind() == reflect.Ptr { v = v.Elem() } if err := tm.writeStruct(w, v); err != nil { return err } } w.unindent() if err := w.WriteByte(ket); err != nil { return err } default: _, err := fmt.Fprint(w, v.Interface()) return err } return nil } // equivalent to C's isprint. func isprint(c byte) bool { return c >= 0x20 && c < 0x7f } // writeString writes a string in the protocol buffer text format. // It is similar to strconv.Quote except we don't use Go escape sequences, // we treat the string as a byte sequence, and we use octal escapes. // These differences are to maintain interoperability with the other // languages' implementations of the text format. func writeString(w *textWriter, s string) error { // use WriteByte here to get any needed indent if err := w.WriteByte('"'); err != nil { return err } // Loop over the bytes, not the runes. for i := 0; i < len(s); i++ { var err error // Divergence from C++: we don't escape apostrophes. // There's no need to escape them, and the C++ parser // copes with a naked apostrophe. switch c := s[i]; c { case '\n': _, err = w.w.Write(backslashN) case '\r': _, err = w.w.Write(backslashR) case '\t': _, err = w.w.Write(backslashT) case '"': _, err = w.w.Write(backslashDQ) case '\\': _, err = w.w.Write(backslashBS) default: if isprint(c) { err = w.w.WriteByte(c) } else { _, err = fmt.Fprintf(w.w, "\\%03o", c) } } if err != nil { return err } } return w.WriteByte('"') } func writeUnknownStruct(w *textWriter, data []byte) (err error) { if !w.compact { if _, err := fmt.Fprintf(w, "/* %d unknown bytes */\n", len(data)); err != nil { return err } } b := NewBuffer(data) for b.index < len(b.buf) { x, err := b.DecodeVarint() if err != nil { _, err := fmt.Fprintf(w, "/* %v */\n", err) return err } wire, tag := x&7, x>>3 if wire == WireEndGroup { w.unindent() if _, err := w.Write(endBraceNewline); err != nil { return err } continue } if _, err := fmt.Fprint(w, tag); err != nil { return err } if wire != WireStartGroup { if err := w.WriteByte(':'); err != nil { return err } } if !w.compact || wire == WireStartGroup { if err := w.WriteByte(' '); err != nil { return err } } switch wire { case WireBytes: buf, e := b.DecodeRawBytes(false) if e == nil { _, err = fmt.Fprintf(w, "%q", buf) } else { _, err = fmt.Fprintf(w, "/* %v */", e) } case WireFixed32: x, err = b.DecodeFixed32() err = writeUnknownInt(w, x, err) case WireFixed64: x, err = b.DecodeFixed64() err = writeUnknownInt(w, x, err) case WireStartGroup: err = w.WriteByte('{') w.indent() case WireVarint: x, err = b.DecodeVarint() err = writeUnknownInt(w, x, err) default: _, err = fmt.Fprintf(w, "/* unknown wire type %d */", wire) } if err != nil { return err } if err = w.WriteByte('\n'); err != nil { return err } } return nil } func writeUnknownInt(w *textWriter, x uint64, err error) error { if err == nil { _, err = fmt.Fprint(w, x) } else { _, err = fmt.Fprintf(w, "/* %v */", err) } return err } type int32Slice []int32 func (s int32Slice) Len() int { return len(s) } func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] } func (s int32Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } // writeExtensions writes all the extensions in pv. // pv is assumed to be a pointer to a protocol message struct that is extendable. func (tm *TextMarshaler) writeExtensions(w *textWriter, pv reflect.Value) error { emap := extensionMaps[pv.Type().Elem()] ep, _ := extendable(pv.Interface()) // Order the extensions by ID. // This isn't strictly necessary, but it will give us // canonical output, which will also make testing easier. m, mu := ep.extensionsRead() if m == nil { return nil } mu.Lock() ids := make([]int32, 0, len(m)) for id := range m { ids = append(ids, id) } sort.Sort(int32Slice(ids)) mu.Unlock() for _, extNum := range ids { ext := m[extNum] var desc *ExtensionDesc if emap != nil { desc = emap[extNum] } if desc == nil { // Unknown extension. if err := writeUnknownStruct(w, ext.enc); err != nil { return err } continue } pb, err := GetExtension(ep, desc) if err != nil { return fmt.Errorf("failed getting extension: %v", err) } // Repeated extensions will appear as a slice. if !desc.repeated() { if err := tm.writeExtension(w, desc.Name, pb); err != nil { return err } } else { v := reflect.ValueOf(pb) for i := 0; i < v.Len(); i++ { if err := tm.writeExtension(w, desc.Name, v.Index(i).Interface()); err != nil { return err } } } } return nil } func (tm *TextMarshaler) writeExtension(w *textWriter, name string, pb interface{}) error { if _, err := fmt.Fprintf(w, "[%s]:", name); err != nil { return err } if !w.compact { if err := w.WriteByte(' '); err != nil { return err } } if err := tm.writeAny(w, reflect.ValueOf(pb), nil); err != nil { return err } if err := w.WriteByte('\n'); err != nil { return err } return nil } func (w *textWriter) writeIndent() { if !w.complete { return } remain := w.ind * 2 for remain > 0 { n := remain if n > len(spaces) { n = len(spaces) } w.w.Write(spaces[:n]) remain -= n } w.complete = false } // TextMarshaler is a configurable text format marshaler. type TextMarshaler struct { Compact bool // use compact text format (one line). ExpandAny bool // expand google.protobuf.Any messages of known types } // Marshal writes a given protocol buffer in text format. // The only errors returned are from w. func (tm *TextMarshaler) Marshal(w io.Writer, pb Message) error { val := reflect.ValueOf(pb) if pb == nil || val.IsNil() { w.Write([]byte("")) return nil } var bw *bufio.Writer ww, ok := w.(writer) if !ok { bw = bufio.NewWriter(w) ww = bw } aw := &textWriter{ w: ww, complete: true, compact: tm.Compact, } if etm, ok := pb.(encoding.TextMarshaler); ok { text, err := etm.MarshalText() if err != nil { return err } if _, err = aw.Write(text); err != nil { return err } if bw != nil { return bw.Flush() } return nil } // Dereference the received pointer so we don't have outer < and >. v := reflect.Indirect(val) if err := tm.writeStruct(aw, v); err != nil { return err } if bw != nil { return bw.Flush() } return nil } // Text is the same as Marshal, but returns the string directly. func (tm *TextMarshaler) Text(pb Message) string { var buf bytes.Buffer tm.Marshal(&buf, pb) return buf.String() } var ( defaultTextMarshaler = TextMarshaler{} compactTextMarshaler = TextMarshaler{Compact: true} ) // TODO: consider removing some of the Marshal functions below. // MarshalText writes a given protocol buffer in text format. // The only errors returned are from w. func MarshalText(w io.Writer, pb Message) error { return defaultTextMarshaler.Marshal(w, pb) } // MarshalTextString is the same as MarshalText, but returns the string directly. func MarshalTextString(pb Message) string { return defaultTextMarshaler.Text(pb) } // CompactText writes a given protocol buffer in compact text format (one line). func CompactText(w io.Writer, pb Message) error { return compactTextMarshaler.Marshal(w, pb) } // CompactTextString is the same as CompactText, but returns the string directly. func CompactTextString(pb Message) string { return compactTextMarshaler.Text(pb) } ================================================ FILE: vendor/github.com/golang/protobuf/proto/text_parser.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2010 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package proto // Functions for parsing the Text protocol buffer format. // TODO: message sets. import ( "encoding" "errors" "fmt" "reflect" "strconv" "strings" "unicode/utf8" ) // Error string emitted when deserializing Any and fields are already set const anyRepeatedlyUnpacked = "Any message unpacked multiple times, or %q already set" type ParseError struct { Message string Line int // 1-based line number Offset int // 0-based byte offset from start of input } func (p *ParseError) Error() string { if p.Line == 1 { // show offset only for first line return fmt.Sprintf("line 1.%d: %v", p.Offset, p.Message) } return fmt.Sprintf("line %d: %v", p.Line, p.Message) } type token struct { value string err *ParseError line int // line number offset int // byte number from start of input, not start of line unquoted string // the unquoted version of value, if it was a quoted string } func (t *token) String() string { if t.err == nil { return fmt.Sprintf("%q (line=%d, offset=%d)", t.value, t.line, t.offset) } return fmt.Sprintf("parse error: %v", t.err) } type textParser struct { s string // remaining input done bool // whether the parsing is finished (success or error) backed bool // whether back() was called offset, line int cur token } func newTextParser(s string) *textParser { p := new(textParser) p.s = s p.line = 1 p.cur.line = 1 return p } func (p *textParser) errorf(format string, a ...interface{}) *ParseError { pe := &ParseError{fmt.Sprintf(format, a...), p.cur.line, p.cur.offset} p.cur.err = pe p.done = true return pe } // Numbers and identifiers are matched by [-+._A-Za-z0-9] func isIdentOrNumberChar(c byte) bool { switch { case 'A' <= c && c <= 'Z', 'a' <= c && c <= 'z': return true case '0' <= c && c <= '9': return true } switch c { case '-', '+', '.', '_': return true } return false } func isWhitespace(c byte) bool { switch c { case ' ', '\t', '\n', '\r': return true } return false } func isQuote(c byte) bool { switch c { case '"', '\'': return true } return false } func (p *textParser) skipWhitespace() { i := 0 for i < len(p.s) && (isWhitespace(p.s[i]) || p.s[i] == '#') { if p.s[i] == '#' { // comment; skip to end of line or input for i < len(p.s) && p.s[i] != '\n' { i++ } if i == len(p.s) { break } } if p.s[i] == '\n' { p.line++ } i++ } p.offset += i p.s = p.s[i:len(p.s)] if len(p.s) == 0 { p.done = true } } func (p *textParser) advance() { // Skip whitespace p.skipWhitespace() if p.done { return } // Start of non-whitespace p.cur.err = nil p.cur.offset, p.cur.line = p.offset, p.line p.cur.unquoted = "" switch p.s[0] { case '<', '>', '{', '}', ':', '[', ']', ';', ',', '/': // Single symbol p.cur.value, p.s = p.s[0:1], p.s[1:len(p.s)] case '"', '\'': // Quoted string i := 1 for i < len(p.s) && p.s[i] != p.s[0] && p.s[i] != '\n' { if p.s[i] == '\\' && i+1 < len(p.s) { // skip escaped char i++ } i++ } if i >= len(p.s) || p.s[i] != p.s[0] { p.errorf("unmatched quote") return } unq, err := unquoteC(p.s[1:i], rune(p.s[0])) if err != nil { p.errorf("invalid quoted string %s: %v", p.s[0:i+1], err) return } p.cur.value, p.s = p.s[0:i+1], p.s[i+1:len(p.s)] p.cur.unquoted = unq default: i := 0 for i < len(p.s) && isIdentOrNumberChar(p.s[i]) { i++ } if i == 0 { p.errorf("unexpected byte %#x", p.s[0]) return } p.cur.value, p.s = p.s[0:i], p.s[i:len(p.s)] } p.offset += len(p.cur.value) } var ( errBadUTF8 = errors.New("proto: bad UTF-8") ) func unquoteC(s string, quote rune) (string, error) { // This is based on C++'s tokenizer.cc. // Despite its name, this is *not* parsing C syntax. // For instance, "\0" is an invalid quoted string. // Avoid allocation in trivial cases. simple := true for _, r := range s { if r == '\\' || r == quote { simple = false break } } if simple { return s, nil } buf := make([]byte, 0, 3*len(s)/2) for len(s) > 0 { r, n := utf8.DecodeRuneInString(s) if r == utf8.RuneError && n == 1 { return "", errBadUTF8 } s = s[n:] if r != '\\' { if r < utf8.RuneSelf { buf = append(buf, byte(r)) } else { buf = append(buf, string(r)...) } continue } ch, tail, err := unescape(s) if err != nil { return "", err } buf = append(buf, ch...) s = tail } return string(buf), nil } func unescape(s string) (ch string, tail string, err error) { r, n := utf8.DecodeRuneInString(s) if r == utf8.RuneError && n == 1 { return "", "", errBadUTF8 } s = s[n:] switch r { case 'a': return "\a", s, nil case 'b': return "\b", s, nil case 'f': return "\f", s, nil case 'n': return "\n", s, nil case 'r': return "\r", s, nil case 't': return "\t", s, nil case 'v': return "\v", s, nil case '?': return "?", s, nil // trigraph workaround case '\'', '"', '\\': return string(r), s, nil case '0', '1', '2', '3', '4', '5', '6', '7': if len(s) < 2 { return "", "", fmt.Errorf(`\%c requires 2 following digits`, r) } ss := string(r) + s[:2] s = s[2:] i, err := strconv.ParseUint(ss, 8, 8) if err != nil { return "", "", fmt.Errorf(`\%s contains non-octal digits`, ss) } return string([]byte{byte(i)}), s, nil case 'x', 'X', 'u', 'U': var n int switch r { case 'x', 'X': n = 2 case 'u': n = 4 case 'U': n = 8 } if len(s) < n { return "", "", fmt.Errorf(`\%c requires %d following digits`, r, n) } ss := s[:n] s = s[n:] i, err := strconv.ParseUint(ss, 16, 64) if err != nil { return "", "", fmt.Errorf(`\%c%s contains non-hexadecimal digits`, r, ss) } if r == 'x' || r == 'X' { return string([]byte{byte(i)}), s, nil } if i > utf8.MaxRune { return "", "", fmt.Errorf(`\%c%s is not a valid Unicode code point`, r, ss) } return string(i), s, nil } return "", "", fmt.Errorf(`unknown escape \%c`, r) } // Back off the parser by one token. Can only be done between calls to next(). // It makes the next advance() a no-op. func (p *textParser) back() { p.backed = true } // Advances the parser and returns the new current token. func (p *textParser) next() *token { if p.backed || p.done { p.backed = false return &p.cur } p.advance() if p.done { p.cur.value = "" } else if len(p.cur.value) > 0 && isQuote(p.cur.value[0]) { // Look for multiple quoted strings separated by whitespace, // and concatenate them. cat := p.cur for { p.skipWhitespace() if p.done || !isQuote(p.s[0]) { break } p.advance() if p.cur.err != nil { return &p.cur } cat.value += " " + p.cur.value cat.unquoted += p.cur.unquoted } p.done = false // parser may have seen EOF, but we want to return cat p.cur = cat } return &p.cur } func (p *textParser) consumeToken(s string) error { tok := p.next() if tok.err != nil { return tok.err } if tok.value != s { p.back() return p.errorf("expected %q, found %q", s, tok.value) } return nil } // Return a RequiredNotSetError indicating which required field was not set. func (p *textParser) missingRequiredFieldError(sv reflect.Value) *RequiredNotSetError { st := sv.Type() sprops := GetProperties(st) for i := 0; i < st.NumField(); i++ { if !isNil(sv.Field(i)) { continue } props := sprops.Prop[i] if props.Required { return &RequiredNotSetError{fmt.Sprintf("%v.%v", st, props.OrigName)} } } return &RequiredNotSetError{fmt.Sprintf("%v.", st)} // should not happen } // Returns the index in the struct for the named field, as well as the parsed tag properties. func structFieldByName(sprops *StructProperties, name string) (int, *Properties, bool) { i, ok := sprops.decoderOrigNames[name] if ok { return i, sprops.Prop[i], true } return -1, nil, false } // Consume a ':' from the input stream (if the next token is a colon), // returning an error if a colon is needed but not present. func (p *textParser) checkForColon(props *Properties, typ reflect.Type) *ParseError { tok := p.next() if tok.err != nil { return tok.err } if tok.value != ":" { // Colon is optional when the field is a group or message. needColon := true switch props.Wire { case "group": needColon = false case "bytes": // A "bytes" field is either a message, a string, or a repeated field; // those three become *T, *string and []T respectively, so we can check for // this field being a pointer to a non-string. if typ.Kind() == reflect.Ptr { // *T or *string if typ.Elem().Kind() == reflect.String { break } } else if typ.Kind() == reflect.Slice { // []T or []*T if typ.Elem().Kind() != reflect.Ptr { break } } else if typ.Kind() == reflect.String { // The proto3 exception is for a string field, // which requires a colon. break } needColon = false } if needColon { return p.errorf("expected ':', found %q", tok.value) } p.back() } return nil } func (p *textParser) readStruct(sv reflect.Value, terminator string) error { st := sv.Type() sprops := GetProperties(st) reqCount := sprops.reqCount var reqFieldErr error fieldSet := make(map[string]bool) // A struct is a sequence of "name: value", terminated by one of // '>' or '}', or the end of the input. A name may also be // "[extension]" or "[type/url]". // // The whole struct can also be an expanded Any message, like: // [type/url] < ... struct contents ... > for { tok := p.next() if tok.err != nil { return tok.err } if tok.value == terminator { break } if tok.value == "[" { // Looks like an extension or an Any. // // TODO: Check whether we need to handle // namespace rooted names (e.g. ".something.Foo"). extName, err := p.consumeExtName() if err != nil { return err } if s := strings.LastIndex(extName, "/"); s >= 0 { // If it contains a slash, it's an Any type URL. messageName := extName[s+1:] mt := MessageType(messageName) if mt == nil { return p.errorf("unrecognized message %q in google.protobuf.Any", messageName) } tok = p.next() if tok.err != nil { return tok.err } // consume an optional colon if tok.value == ":" { tok = p.next() if tok.err != nil { return tok.err } } var terminator string switch tok.value { case "<": terminator = ">" case "{": terminator = "}" default: return p.errorf("expected '{' or '<', found %q", tok.value) } v := reflect.New(mt.Elem()) if pe := p.readStruct(v.Elem(), terminator); pe != nil { return pe } b, err := Marshal(v.Interface().(Message)) if err != nil { return p.errorf("failed to marshal message of type %q: %v", messageName, err) } if fieldSet["type_url"] { return p.errorf(anyRepeatedlyUnpacked, "type_url") } if fieldSet["value"] { return p.errorf(anyRepeatedlyUnpacked, "value") } sv.FieldByName("TypeUrl").SetString(extName) sv.FieldByName("Value").SetBytes(b) fieldSet["type_url"] = true fieldSet["value"] = true continue } var desc *ExtensionDesc // This could be faster, but it's functional. // TODO: Do something smarter than a linear scan. for _, d := range RegisteredExtensions(reflect.New(st).Interface().(Message)) { if d.Name == extName { desc = d break } } if desc == nil { return p.errorf("unrecognized extension %q", extName) } props := &Properties{} props.Parse(desc.Tag) typ := reflect.TypeOf(desc.ExtensionType) if err := p.checkForColon(props, typ); err != nil { return err } rep := desc.repeated() // Read the extension structure, and set it in // the value we're constructing. var ext reflect.Value if !rep { ext = reflect.New(typ).Elem() } else { ext = reflect.New(typ.Elem()).Elem() } if err := p.readAny(ext, props); err != nil { if _, ok := err.(*RequiredNotSetError); !ok { return err } reqFieldErr = err } ep := sv.Addr().Interface().(Message) if !rep { SetExtension(ep, desc, ext.Interface()) } else { old, err := GetExtension(ep, desc) var sl reflect.Value if err == nil { sl = reflect.ValueOf(old) // existing slice } else { sl = reflect.MakeSlice(typ, 0, 1) } sl = reflect.Append(sl, ext) SetExtension(ep, desc, sl.Interface()) } if err := p.consumeOptionalSeparator(); err != nil { return err } continue } // This is a normal, non-extension field. name := tok.value var dst reflect.Value fi, props, ok := structFieldByName(sprops, name) if ok { dst = sv.Field(fi) } else if oop, ok := sprops.OneofTypes[name]; ok { // It is a oneof. props = oop.Prop nv := reflect.New(oop.Type.Elem()) dst = nv.Elem().Field(0) field := sv.Field(oop.Field) if !field.IsNil() { return p.errorf("field '%s' would overwrite already parsed oneof '%s'", name, sv.Type().Field(oop.Field).Name) } field.Set(nv) } if !dst.IsValid() { return p.errorf("unknown field name %q in %v", name, st) } if dst.Kind() == reflect.Map { // Consume any colon. if err := p.checkForColon(props, dst.Type()); err != nil { return err } // Construct the map if it doesn't already exist. if dst.IsNil() { dst.Set(reflect.MakeMap(dst.Type())) } key := reflect.New(dst.Type().Key()).Elem() val := reflect.New(dst.Type().Elem()).Elem() // The map entry should be this sequence of tokens: // < key : KEY value : VALUE > // However, implementations may omit key or value, and technically // we should support them in any order. See b/28924776 for a time // this went wrong. tok := p.next() var terminator string switch tok.value { case "<": terminator = ">" case "{": terminator = "}" default: return p.errorf("expected '{' or '<', found %q", tok.value) } for { tok := p.next() if tok.err != nil { return tok.err } if tok.value == terminator { break } switch tok.value { case "key": if err := p.consumeToken(":"); err != nil { return err } if err := p.readAny(key, props.MapKeyProp); err != nil { return err } if err := p.consumeOptionalSeparator(); err != nil { return err } case "value": if err := p.checkForColon(props.MapValProp, dst.Type().Elem()); err != nil { return err } if err := p.readAny(val, props.MapValProp); err != nil { return err } if err := p.consumeOptionalSeparator(); err != nil { return err } default: p.back() return p.errorf(`expected "key", "value", or %q, found %q`, terminator, tok.value) } } dst.SetMapIndex(key, val) continue } // Check that it's not already set if it's not a repeated field. if !props.Repeated && fieldSet[name] { return p.errorf("non-repeated field %q was repeated", name) } if err := p.checkForColon(props, dst.Type()); err != nil { return err } // Parse into the field. fieldSet[name] = true if err := p.readAny(dst, props); err != nil { if _, ok := err.(*RequiredNotSetError); !ok { return err } reqFieldErr = err } if props.Required { reqCount-- } if err := p.consumeOptionalSeparator(); err != nil { return err } } if reqCount > 0 { return p.missingRequiredFieldError(sv) } return reqFieldErr } // consumeExtName consumes extension name or expanded Any type URL and the // following ']'. It returns the name or URL consumed. func (p *textParser) consumeExtName() (string, error) { tok := p.next() if tok.err != nil { return "", tok.err } // If extension name or type url is quoted, it's a single token. if len(tok.value) > 2 && isQuote(tok.value[0]) && tok.value[len(tok.value)-1] == tok.value[0] { name, err := unquoteC(tok.value[1:len(tok.value)-1], rune(tok.value[0])) if err != nil { return "", err } return name, p.consumeToken("]") } // Consume everything up to "]" var parts []string for tok.value != "]" { parts = append(parts, tok.value) tok = p.next() if tok.err != nil { return "", p.errorf("unrecognized type_url or extension name: %s", tok.err) } if p.done && tok.value != "]" { return "", p.errorf("unclosed type_url or extension name") } } return strings.Join(parts, ""), nil } // consumeOptionalSeparator consumes an optional semicolon or comma. // It is used in readStruct to provide backward compatibility. func (p *textParser) consumeOptionalSeparator() error { tok := p.next() if tok.err != nil { return tok.err } if tok.value != ";" && tok.value != "," { p.back() } return nil } func (p *textParser) readAny(v reflect.Value, props *Properties) error { tok := p.next() if tok.err != nil { return tok.err } if tok.value == "" { return p.errorf("unexpected EOF") } switch fv := v; fv.Kind() { case reflect.Slice: at := v.Type() if at.Elem().Kind() == reflect.Uint8 { // Special case for []byte if tok.value[0] != '"' && tok.value[0] != '\'' { // Deliberately written out here, as the error after // this switch statement would write "invalid []byte: ...", // which is not as user-friendly. return p.errorf("invalid string: %v", tok.value) } bytes := []byte(tok.unquoted) fv.Set(reflect.ValueOf(bytes)) return nil } // Repeated field. if tok.value == "[" { // Repeated field with list notation, like [1,2,3]. for { fv.Set(reflect.Append(fv, reflect.New(at.Elem()).Elem())) err := p.readAny(fv.Index(fv.Len()-1), props) if err != nil { return err } tok := p.next() if tok.err != nil { return tok.err } if tok.value == "]" { break } if tok.value != "," { return p.errorf("Expected ']' or ',' found %q", tok.value) } } return nil } // One value of the repeated field. p.back() fv.Set(reflect.Append(fv, reflect.New(at.Elem()).Elem())) return p.readAny(fv.Index(fv.Len()-1), props) case reflect.Bool: // true/1/t/True or false/f/0/False. switch tok.value { case "true", "1", "t", "True": fv.SetBool(true) return nil case "false", "0", "f", "False": fv.SetBool(false) return nil } case reflect.Float32, reflect.Float64: v := tok.value // Ignore 'f' for compatibility with output generated by C++, but don't // remove 'f' when the value is "-inf" or "inf". if strings.HasSuffix(v, "f") && tok.value != "-inf" && tok.value != "inf" { v = v[:len(v)-1] } if f, err := strconv.ParseFloat(v, fv.Type().Bits()); err == nil { fv.SetFloat(f) return nil } case reflect.Int32: if x, err := strconv.ParseInt(tok.value, 0, 32); err == nil { fv.SetInt(x) return nil } if len(props.Enum) == 0 { break } m, ok := enumValueMaps[props.Enum] if !ok { break } x, ok := m[tok.value] if !ok { break } fv.SetInt(int64(x)) return nil case reflect.Int64: if x, err := strconv.ParseInt(tok.value, 0, 64); err == nil { fv.SetInt(x) return nil } case reflect.Ptr: // A basic field (indirected through pointer), or a repeated message/group p.back() fv.Set(reflect.New(fv.Type().Elem())) return p.readAny(fv.Elem(), props) case reflect.String: if tok.value[0] == '"' || tok.value[0] == '\'' { fv.SetString(tok.unquoted) return nil } case reflect.Struct: var terminator string switch tok.value { case "{": terminator = "}" case "<": terminator = ">" default: return p.errorf("expected '{' or '<', found %q", tok.value) } // TODO: Handle nested messages which implement encoding.TextUnmarshaler. return p.readStruct(fv, terminator) case reflect.Uint32: if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil { fv.SetUint(uint64(x)) return nil } case reflect.Uint64: if x, err := strconv.ParseUint(tok.value, 0, 64); err == nil { fv.SetUint(x) return nil } } return p.errorf("invalid %v: %v", v.Type(), tok.value) } // UnmarshalText reads a protocol buffer in Text format. UnmarshalText resets pb // before starting to unmarshal, so any existing data in pb is always removed. // If a required field is not set and no other error occurs, // UnmarshalText returns *RequiredNotSetError. func UnmarshalText(s string, pb Message) error { if um, ok := pb.(encoding.TextUnmarshaler); ok { return um.UnmarshalText([]byte(s)) } pb.Reset() v := reflect.ValueOf(pb) return newTextParser(s).readStruct(v.Elem(), "") } ================================================ FILE: vendor/github.com/golang/protobuf/ptypes/any/any.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/protobuf/any.proto package any import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // // Protobuf library provides support to pack/unpack Any values in the form // of utility functions or additional generated methods of the Any type. // // Example 1: Pack and unpack a message in C++. // // Foo foo = ...; // Any any; // any.PackFrom(foo); // ... // if (any.UnpackTo(&foo)) { // ... // } // // Example 2: Pack and unpack a message in Java. // // Foo foo = ...; // Any any = Any.pack(foo); // ... // if (any.is(Foo.class)) { // foo = any.unpack(Foo.class); // } // // Example 3: Pack and unpack a message in Python. // // foo = Foo(...) // any = Any() // any.Pack(foo) // ... // if any.Is(Foo.DESCRIPTOR): // any.Unpack(foo) // ... // // Example 4: Pack and unpack a message in Go // // foo := &pb.Foo{...} // any, err := ptypes.MarshalAny(foo) // ... // foo := &pb.Foo{} // if err := ptypes.UnmarshalAny(any, foo); err != nil { // ... // } // // The pack methods provided by protobuf library will by default use // 'type.googleapis.com/full.type.name' as the type URL and the unpack // methods only use the fully qualified type name after the last '/' // in the type URL, for example "foo.bar.com/x/y.z" will yield type // name "y.z". // // // JSON // ==== // The JSON representation of an `Any` value uses the regular // representation of the deserialized, embedded message, with an // additional field `@type` which contains the type URL. Example: // // package google.profile; // message Person { // string first_name = 1; // string last_name = 2; // } // // { // "@type": "type.googleapis.com/google.profile.Person", // "firstName": , // "lastName": // } // // If the embedded message type is well-known and has a custom JSON // representation, that representation will be embedded adding a field // `value` which holds the custom JSON in addition to the `@type` // field. Example (for message [google.protobuf.Duration][]): // // { // "@type": "type.googleapis.com/google.protobuf.Duration", // "value": "1.212s" // } // type Any struct { // A URL/resource name that uniquely identifies the type of the serialized // protocol buffer message. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). // // In practice, teams usually precompile into the binary all types that they // expect it to use in the context of Any. However, for URLs which use the // scheme `http`, `https`, or no scheme, one can optionally set up a type // server that maps type URLs to message definitions as follows: // // * If no scheme is provided, `https` is assumed. // * An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // * Applications are allowed to cache lookup results based on the // URL, or have them precompiled into a binary to avoid any // lookup. Therefore, binary compatibility needs to be preserved // on changes to types. (Use versioned type names to manage // breaking changes.) // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with // type.googleapis.com. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. // TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` // Must be a valid serialized protocol buffer of the above specified type. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Any) Reset() { *m = Any{} } func (m *Any) String() string { return proto.CompactTextString(m) } func (*Any) ProtoMessage() {} func (*Any) Descriptor() ([]byte, []int) { return fileDescriptor_b53526c13ae22eb4, []int{0} } func (*Any) XXX_WellKnownType() string { return "Any" } func (m *Any) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Any.Unmarshal(m, b) } func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Any.Marshal(b, m, deterministic) } func (m *Any) XXX_Merge(src proto.Message) { xxx_messageInfo_Any.Merge(m, src) } func (m *Any) XXX_Size() int { return xxx_messageInfo_Any.Size(m) } func (m *Any) XXX_DiscardUnknown() { xxx_messageInfo_Any.DiscardUnknown(m) } var xxx_messageInfo_Any proto.InternalMessageInfo func (m *Any) GetTypeUrl() string { if m != nil { return m.TypeUrl } return "" } func (m *Any) GetValue() []byte { if m != nil { return m.Value } return nil } func init() { proto.RegisterType((*Any)(nil), "google.protobuf.Any") } func init() { proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4) } var fileDescriptor_b53526c13ae22eb4 = []byte{ // 185 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4, 0x03, 0x73, 0x84, 0xf8, 0x21, 0x52, 0x7a, 0x30, 0x29, 0x25, 0x33, 0x2e, 0x66, 0xc7, 0xbc, 0x4a, 0x21, 0x49, 0x2e, 0x8e, 0x92, 0xca, 0x82, 0xd4, 0xf8, 0xd2, 0xa2, 0x1c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x76, 0x10, 0x3f, 0xb4, 0x28, 0x47, 0x48, 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xc2, 0x71, 0xca, 0xe7, 0x12, 0x4e, 0xce, 0xcf, 0xd5, 0x43, 0x33, 0xce, 0x89, 0xc3, 0x31, 0xaf, 0x32, 0x00, 0xc4, 0x09, 0x60, 0x8c, 0x52, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0x47, 0xb8, 0xa8, 0x00, 0x64, 0x7a, 0x31, 0xc8, 0x61, 0x8b, 0x98, 0x98, 0xdd, 0x03, 0x9c, 0x56, 0x31, 0xc9, 0xb9, 0x43, 0x8c, 0x0a, 0x80, 0x2a, 0xd1, 0x0b, 0x4f, 0xcd, 0xc9, 0xf1, 0xce, 0xcb, 0x2f, 0xcf, 0x0b, 0x01, 0x29, 0x4d, 0x62, 0x03, 0xeb, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x13, 0xf8, 0xe8, 0x42, 0xdd, 0x00, 0x00, 0x00, } ================================================ FILE: vendor/github.com/golang/protobuf/ptypes/any/any.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "github.com/golang/protobuf/ptypes/any"; option java_package = "com.google.protobuf"; option java_outer_classname = "AnyProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // // Protobuf library provides support to pack/unpack Any values in the form // of utility functions or additional generated methods of the Any type. // // Example 1: Pack and unpack a message in C++. // // Foo foo = ...; // Any any; // any.PackFrom(foo); // ... // if (any.UnpackTo(&foo)) { // ... // } // // Example 2: Pack and unpack a message in Java. // // Foo foo = ...; // Any any = Any.pack(foo); // ... // if (any.is(Foo.class)) { // foo = any.unpack(Foo.class); // } // // Example 3: Pack and unpack a message in Python. // // foo = Foo(...) // any = Any() // any.Pack(foo) // ... // if any.Is(Foo.DESCRIPTOR): // any.Unpack(foo) // ... // // Example 4: Pack and unpack a message in Go // // foo := &pb.Foo{...} // any, err := ptypes.MarshalAny(foo) // ... // foo := &pb.Foo{} // if err := ptypes.UnmarshalAny(any, foo); err != nil { // ... // } // // The pack methods provided by protobuf library will by default use // 'type.googleapis.com/full.type.name' as the type URL and the unpack // methods only use the fully qualified type name after the last '/' // in the type URL, for example "foo.bar.com/x/y.z" will yield type // name "y.z". // // // JSON // ==== // The JSON representation of an `Any` value uses the regular // representation of the deserialized, embedded message, with an // additional field `@type` which contains the type URL. Example: // // package google.profile; // message Person { // string first_name = 1; // string last_name = 2; // } // // { // "@type": "type.googleapis.com/google.profile.Person", // "firstName": , // "lastName": // } // // If the embedded message type is well-known and has a custom JSON // representation, that representation will be embedded adding a field // `value` which holds the custom JSON in addition to the `@type` // field. Example (for message [google.protobuf.Duration][]): // // { // "@type": "type.googleapis.com/google.protobuf.Duration", // "value": "1.212s" // } // message Any { // A URL/resource name that uniquely identifies the type of the serialized // protocol buffer message. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). // // In practice, teams usually precompile into the binary all types that they // expect it to use in the context of Any. However, for URLs which use the // scheme `http`, `https`, or no scheme, one can optionally set up a type // server that maps type URLs to message definitions as follows: // // * If no scheme is provided, `https` is assumed. // * An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // * Applications are allowed to cache lookup results based on the // URL, or have them precompiled into a binary to avoid any // lookup. Therefore, binary compatibility needs to be preserved // on changes to types. (Use versioned type names to manage // breaking changes.) // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with // type.googleapis.com. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. // string type_url = 1; // Must be a valid serialized protocol buffer of the above specified type. bytes value = 2; } ================================================ FILE: vendor/github.com/golang/protobuf/ptypes/any.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package ptypes // This file implements functions to marshal proto.Message to/from // google.protobuf.Any message. import ( "fmt" "reflect" "strings" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes/any" ) const googleApis = "type.googleapis.com/" // AnyMessageName returns the name of the message contained in a google.protobuf.Any message. // // Note that regular type assertions should be done using the Is // function. AnyMessageName is provided for less common use cases like filtering a // sequence of Any messages based on a set of allowed message type names. func AnyMessageName(any *any.Any) (string, error) { if any == nil { return "", fmt.Errorf("message is nil") } slash := strings.LastIndex(any.TypeUrl, "/") if slash < 0 { return "", fmt.Errorf("message type url %q is invalid", any.TypeUrl) } return any.TypeUrl[slash+1:], nil } // MarshalAny takes the protocol buffer and encodes it into google.protobuf.Any. func MarshalAny(pb proto.Message) (*any.Any, error) { value, err := proto.Marshal(pb) if err != nil { return nil, err } return &any.Any{TypeUrl: googleApis + proto.MessageName(pb), Value: value}, nil } // DynamicAny is a value that can be passed to UnmarshalAny to automatically // allocate a proto.Message for the type specified in a google.protobuf.Any // message. The allocated message is stored in the embedded proto.Message. // // Example: // // var x ptypes.DynamicAny // if err := ptypes.UnmarshalAny(a, &x); err != nil { ... } // fmt.Printf("unmarshaled message: %v", x.Message) type DynamicAny struct { proto.Message } // Empty returns a new proto.Message of the type specified in a // google.protobuf.Any message. It returns an error if corresponding message // type isn't linked in. func Empty(any *any.Any) (proto.Message, error) { aname, err := AnyMessageName(any) if err != nil { return nil, err } t := proto.MessageType(aname) if t == nil { return nil, fmt.Errorf("any: message type %q isn't linked in", aname) } return reflect.New(t.Elem()).Interface().(proto.Message), nil } // UnmarshalAny parses the protocol buffer representation in a google.protobuf.Any // message and places the decoded result in pb. It returns an error if type of // contents of Any message does not match type of pb message. // // pb can be a proto.Message, or a *DynamicAny. func UnmarshalAny(any *any.Any, pb proto.Message) error { if d, ok := pb.(*DynamicAny); ok { if d.Message == nil { var err error d.Message, err = Empty(any) if err != nil { return err } } return UnmarshalAny(any, d.Message) } aname, err := AnyMessageName(any) if err != nil { return err } mname := proto.MessageName(pb) if aname != mname { return fmt.Errorf("mismatched message type: got %q want %q", aname, mname) } return proto.Unmarshal(any.Value, pb) } // Is returns true if any value contains a given message type. func Is(any *any.Any, pb proto.Message) bool { // The following is equivalent to AnyMessageName(any) == proto.MessageName(pb), // but it avoids scanning TypeUrl for the slash. if any == nil { return false } name := proto.MessageName(pb) prefix := len(any.TypeUrl) - len(name) return prefix >= 1 && any.TypeUrl[prefix-1] == '/' && any.TypeUrl[prefix:] == name } ================================================ FILE: vendor/github.com/golang/protobuf/ptypes/doc.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* Package ptypes contains code for interacting with well-known types. */ package ptypes ================================================ FILE: vendor/github.com/golang/protobuf/ptypes/duration/duration.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/protobuf/duration.proto package duration import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // A Duration represents a signed, fixed-length span of time represented // as a count of seconds and fractions of seconds at nanosecond // resolution. It is independent of any calendar and concepts like "day" // or "month". It is related to Timestamp in that the difference between // two Timestamp values is a Duration and it can be added or subtracted // from a Timestamp. Range is approximately +-10,000 years. // // # Examples // // Example 1: Compute Duration from two Timestamps in pseudo code. // // Timestamp start = ...; // Timestamp end = ...; // Duration duration = ...; // // duration.seconds = end.seconds - start.seconds; // duration.nanos = end.nanos - start.nanos; // // if (duration.seconds < 0 && duration.nanos > 0) { // duration.seconds += 1; // duration.nanos -= 1000000000; // } else if (durations.seconds > 0 && duration.nanos < 0) { // duration.seconds -= 1; // duration.nanos += 1000000000; // } // // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. // // Timestamp start = ...; // Duration duration = ...; // Timestamp end = ...; // // end.seconds = start.seconds + duration.seconds; // end.nanos = start.nanos + duration.nanos; // // if (end.nanos < 0) { // end.seconds -= 1; // end.nanos += 1000000000; // } else if (end.nanos >= 1000000000) { // end.seconds += 1; // end.nanos -= 1000000000; // } // // Example 3: Compute Duration from datetime.timedelta in Python. // // td = datetime.timedelta(days=3, minutes=10) // duration = Duration() // duration.FromTimedelta(td) // // # JSON Mapping // // In JSON format, the Duration type is encoded as a string rather than an // object, where the string ends in the suffix "s" (indicating seconds) and // is preceded by the number of seconds, with nanoseconds expressed as // fractional seconds. For example, 3 seconds with 0 nanoseconds should be // encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should // be expressed in JSON format as "3.000000001s", and 3 seconds and 1 // microsecond should be expressed in JSON format as "3.000001s". // // type Duration struct { // Signed seconds of the span of time. Must be from -315,576,000,000 // to +315,576,000,000 inclusive. Note: these bounds are computed from: // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` // Signed fractions of a second at nanosecond resolution of the span // of time. Durations less than one second are represented with a 0 // `seconds` field and a positive or negative `nanos` field. For durations // of one second or more, a non-zero value for the `nanos` field must be // of the same sign as the `seconds` field. Must be from -999,999,999 // to +999,999,999 inclusive. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Duration) Reset() { *m = Duration{} } func (m *Duration) String() string { return proto.CompactTextString(m) } func (*Duration) ProtoMessage() {} func (*Duration) Descriptor() ([]byte, []int) { return fileDescriptor_23597b2ebd7ac6c5, []int{0} } func (*Duration) XXX_WellKnownType() string { return "Duration" } func (m *Duration) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Duration.Unmarshal(m, b) } func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Duration.Marshal(b, m, deterministic) } func (m *Duration) XXX_Merge(src proto.Message) { xxx_messageInfo_Duration.Merge(m, src) } func (m *Duration) XXX_Size() int { return xxx_messageInfo_Duration.Size(m) } func (m *Duration) XXX_DiscardUnknown() { xxx_messageInfo_Duration.DiscardUnknown(m) } var xxx_messageInfo_Duration proto.InternalMessageInfo func (m *Duration) GetSeconds() int64 { if m != nil { return m.Seconds } return 0 } func (m *Duration) GetNanos() int32 { if m != nil { return m.Nanos } return 0 } func init() { proto.RegisterType((*Duration)(nil), "google.protobuf.Duration") } func init() { proto.RegisterFile("google/protobuf/duration.proto", fileDescriptor_23597b2ebd7ac6c5) } var fileDescriptor_23597b2ebd7ac6c5 = []byte{ // 190 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0x29, 0x2d, 0x4a, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x8b, 0x08, 0xf1, 0x43, 0xe4, 0xf5, 0x60, 0xf2, 0x4a, 0x56, 0x5c, 0x1c, 0x2e, 0x50, 0x25, 0x42, 0x12, 0x5c, 0xec, 0xc5, 0xa9, 0xc9, 0xf9, 0x79, 0x29, 0xc5, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xcc, 0x41, 0x30, 0xae, 0x90, 0x08, 0x17, 0x6b, 0x5e, 0x62, 0x5e, 0x7e, 0xb1, 0x04, 0x93, 0x02, 0xa3, 0x06, 0x6b, 0x10, 0x84, 0xe3, 0x54, 0xc3, 0x25, 0x9c, 0x9c, 0x9f, 0xab, 0x87, 0x66, 0xa4, 0x13, 0x2f, 0xcc, 0xc0, 0x00, 0x90, 0x48, 0x00, 0x63, 0x94, 0x56, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x7a, 0x7e, 0x4e, 0x62, 0x5e, 0x3a, 0xc2, 0x7d, 0x05, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x70, 0x67, 0xfe, 0x60, 0x64, 0x5c, 0xc4, 0xc4, 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0x62, 0x6e, 0x00, 0x54, 0xa9, 0x5e, 0x78, 0x6a, 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x08, 0x48, 0x4b, 0x12, 0x1b, 0xd8, 0x0c, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x84, 0x30, 0xff, 0xf3, 0x00, 0x00, 0x00, } ================================================ FILE: vendor/github.com/golang/protobuf/ptypes/duration/duration.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "github.com/golang/protobuf/ptypes/duration"; option java_package = "com.google.protobuf"; option java_outer_classname = "DurationProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Duration represents a signed, fixed-length span of time represented // as a count of seconds and fractions of seconds at nanosecond // resolution. It is independent of any calendar and concepts like "day" // or "month". It is related to Timestamp in that the difference between // two Timestamp values is a Duration and it can be added or subtracted // from a Timestamp. Range is approximately +-10,000 years. // // # Examples // // Example 1: Compute Duration from two Timestamps in pseudo code. // // Timestamp start = ...; // Timestamp end = ...; // Duration duration = ...; // // duration.seconds = end.seconds - start.seconds; // duration.nanos = end.nanos - start.nanos; // // if (duration.seconds < 0 && duration.nanos > 0) { // duration.seconds += 1; // duration.nanos -= 1000000000; // } else if (durations.seconds > 0 && duration.nanos < 0) { // duration.seconds -= 1; // duration.nanos += 1000000000; // } // // Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. // // Timestamp start = ...; // Duration duration = ...; // Timestamp end = ...; // // end.seconds = start.seconds + duration.seconds; // end.nanos = start.nanos + duration.nanos; // // if (end.nanos < 0) { // end.seconds -= 1; // end.nanos += 1000000000; // } else if (end.nanos >= 1000000000) { // end.seconds += 1; // end.nanos -= 1000000000; // } // // Example 3: Compute Duration from datetime.timedelta in Python. // // td = datetime.timedelta(days=3, minutes=10) // duration = Duration() // duration.FromTimedelta(td) // // # JSON Mapping // // In JSON format, the Duration type is encoded as a string rather than an // object, where the string ends in the suffix "s" (indicating seconds) and // is preceded by the number of seconds, with nanoseconds expressed as // fractional seconds. For example, 3 seconds with 0 nanoseconds should be // encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should // be expressed in JSON format as "3.000000001s", and 3 seconds and 1 // microsecond should be expressed in JSON format as "3.000001s". // // message Duration { // Signed seconds of the span of time. Must be from -315,576,000,000 // to +315,576,000,000 inclusive. Note: these bounds are computed from: // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years int64 seconds = 1; // Signed fractions of a second at nanosecond resolution of the span // of time. Durations less than one second are represented with a 0 // `seconds` field and a positive or negative `nanos` field. For durations // of one second or more, a non-zero value for the `nanos` field must be // of the same sign as the `seconds` field. Must be from -999,999,999 // to +999,999,999 inclusive. int32 nanos = 2; } ================================================ FILE: vendor/github.com/golang/protobuf/ptypes/duration.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package ptypes // This file implements conversions between google.protobuf.Duration // and time.Duration. import ( "errors" "fmt" "time" durpb "github.com/golang/protobuf/ptypes/duration" ) const ( // Range of a durpb.Duration in seconds, as specified in // google/protobuf/duration.proto. This is about 10,000 years in seconds. maxSeconds = int64(10000 * 365.25 * 24 * 60 * 60) minSeconds = -maxSeconds ) // validateDuration determines whether the durpb.Duration is valid according to the // definition in google/protobuf/duration.proto. A valid durpb.Duration // may still be too large to fit into a time.Duration (the range of durpb.Duration // is about 10,000 years, and the range of time.Duration is about 290). func validateDuration(d *durpb.Duration) error { if d == nil { return errors.New("duration: nil Duration") } if d.Seconds < minSeconds || d.Seconds > maxSeconds { return fmt.Errorf("duration: %v: seconds out of range", d) } if d.Nanos <= -1e9 || d.Nanos >= 1e9 { return fmt.Errorf("duration: %v: nanos out of range", d) } // Seconds and Nanos must have the same sign, unless d.Nanos is zero. if (d.Seconds < 0 && d.Nanos > 0) || (d.Seconds > 0 && d.Nanos < 0) { return fmt.Errorf("duration: %v: seconds and nanos have different signs", d) } return nil } // Duration converts a durpb.Duration to a time.Duration. Duration // returns an error if the durpb.Duration is invalid or is too large to be // represented in a time.Duration. func Duration(p *durpb.Duration) (time.Duration, error) { if err := validateDuration(p); err != nil { return 0, err } d := time.Duration(p.Seconds) * time.Second if int64(d/time.Second) != p.Seconds { return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p) } if p.Nanos != 0 { d += time.Duration(p.Nanos) * time.Nanosecond if (d < 0) != (p.Nanos < 0) { return 0, fmt.Errorf("duration: %v is out of range for time.Duration", p) } } return d, nil } // DurationProto converts a time.Duration to a durpb.Duration. func DurationProto(d time.Duration) *durpb.Duration { nanos := d.Nanoseconds() secs := nanos / 1e9 nanos -= secs * 1e9 return &durpb.Duration{ Seconds: secs, Nanos: int32(nanos), } } ================================================ FILE: vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.pb.go ================================================ // Code generated by protoc-gen-go. DO NOT EDIT. // source: google/protobuf/timestamp.proto package timestamp import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package // A Timestamp represents a point in time independent of any time zone // or calendar, represented as seconds and fractions of seconds at // nanosecond resolution in UTC Epoch time. It is encoded using the // Proleptic Gregorian Calendar which extends the Gregorian calendar // backwards to year one. It is encoded assuming all minutes are 60 // seconds long, i.e. leap seconds are "smeared" so that no leap second // table is needed for interpretation. Range is from // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. // By restricting to that range, we ensure that we can convert to // and from RFC 3339 date strings. // See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). // // # Examples // // Example 1: Compute Timestamp from POSIX `time()`. // // Timestamp timestamp; // timestamp.set_seconds(time(NULL)); // timestamp.set_nanos(0); // // Example 2: Compute Timestamp from POSIX `gettimeofday()`. // // struct timeval tv; // gettimeofday(&tv, NULL); // // Timestamp timestamp; // timestamp.set_seconds(tv.tv_sec); // timestamp.set_nanos(tv.tv_usec * 1000); // // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. // // FILETIME ft; // GetSystemTimeAsFileTime(&ft); // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. // Timestamp timestamp; // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); // // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. // // long millis = System.currentTimeMillis(); // // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) // .setNanos((int) ((millis % 1000) * 1000000)).build(); // // // Example 5: Compute Timestamp from current time in Python. // // timestamp = Timestamp() // timestamp.GetCurrentTime() // // # JSON Mapping // // In JSON format, the Timestamp type is encoded as a string in the // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" // where {year} is always expressed using four digits while {month}, {day}, // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone // is required. A proto3 JSON serializer should always use UTC (as indicated by // "Z") when printing the Timestamp type and a proto3 JSON parser should be // able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. // // In JavaScript, one can convert a Date object to this format using the // standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] // method. In Python, a standard `datetime.datetime` object can be converted // to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) // with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one // can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- // ) to obtain a formatter capable of generating timestamps in this format. // // type Timestamp struct { // Represents seconds of UTC time since Unix epoch // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to // 9999-12-31T23:59:59Z inclusive. Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` // Non-negative fractions of a second at nanosecond resolution. Negative // second values with fractions must still have non-negative nanos values // that count forward in time. Must be from 0 to 999,999,999 // inclusive. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Timestamp) Reset() { *m = Timestamp{} } func (m *Timestamp) String() string { return proto.CompactTextString(m) } func (*Timestamp) ProtoMessage() {} func (*Timestamp) Descriptor() ([]byte, []int) { return fileDescriptor_292007bbfe81227e, []int{0} } func (*Timestamp) XXX_WellKnownType() string { return "Timestamp" } func (m *Timestamp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Timestamp.Unmarshal(m, b) } func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic) } func (m *Timestamp) XXX_Merge(src proto.Message) { xxx_messageInfo_Timestamp.Merge(m, src) } func (m *Timestamp) XXX_Size() int { return xxx_messageInfo_Timestamp.Size(m) } func (m *Timestamp) XXX_DiscardUnknown() { xxx_messageInfo_Timestamp.DiscardUnknown(m) } var xxx_messageInfo_Timestamp proto.InternalMessageInfo func (m *Timestamp) GetSeconds() int64 { if m != nil { return m.Seconds } return 0 } func (m *Timestamp) GetNanos() int32 { if m != nil { return m.Nanos } return 0 } func init() { proto.RegisterType((*Timestamp)(nil), "google.protobuf.Timestamp") } func init() { proto.RegisterFile("google/protobuf/timestamp.proto", fileDescriptor_292007bbfe81227e) } var fileDescriptor_292007bbfe81227e = []byte{ // 191 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0xc9, 0xcc, 0x4d, 0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0xd0, 0x03, 0x0b, 0x09, 0xf1, 0x43, 0x14, 0xe8, 0xc1, 0x14, 0x28, 0x59, 0x73, 0x71, 0x86, 0xc0, 0xd4, 0x08, 0x49, 0x70, 0xb1, 0x17, 0xa7, 0x26, 0xe7, 0xe7, 0xa5, 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0xc1, 0xb8, 0x42, 0x22, 0x5c, 0xac, 0x79, 0x89, 0x79, 0xf9, 0xc5, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x10, 0x8e, 0x53, 0x1d, 0x97, 0x70, 0x72, 0x7e, 0xae, 0x1e, 0x9a, 0x99, 0x4e, 0x7c, 0x70, 0x13, 0x03, 0x40, 0x42, 0x01, 0x8c, 0x51, 0xda, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe9, 0xf9, 0x39, 0x89, 0x79, 0xe9, 0x08, 0x27, 0x16, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x23, 0x5c, 0xfa, 0x83, 0x91, 0x71, 0x11, 0x13, 0xb3, 0x7b, 0x80, 0xd3, 0x2a, 0x26, 0x39, 0x77, 0x88, 0xc9, 0x01, 0x50, 0xb5, 0x7a, 0xe1, 0xa9, 0x39, 0x39, 0xde, 0x79, 0xf9, 0xe5, 0x79, 0x21, 0x20, 0x3d, 0x49, 0x6c, 0x60, 0x43, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x77, 0x4a, 0x07, 0xf7, 0x00, 0x00, 0x00, } ================================================ FILE: vendor/github.com/golang/protobuf/ptypes/timestamp/timestamp.proto ================================================ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option cc_enable_arenas = true; option go_package = "github.com/golang/protobuf/ptypes/timestamp"; option java_package = "com.google.protobuf"; option java_outer_classname = "TimestampProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // A Timestamp represents a point in time independent of any time zone // or calendar, represented as seconds and fractions of seconds at // nanosecond resolution in UTC Epoch time. It is encoded using the // Proleptic Gregorian Calendar which extends the Gregorian calendar // backwards to year one. It is encoded assuming all minutes are 60 // seconds long, i.e. leap seconds are "smeared" so that no leap second // table is needed for interpretation. Range is from // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. // By restricting to that range, we ensure that we can convert to // and from RFC 3339 date strings. // See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). // // # Examples // // Example 1: Compute Timestamp from POSIX `time()`. // // Timestamp timestamp; // timestamp.set_seconds(time(NULL)); // timestamp.set_nanos(0); // // Example 2: Compute Timestamp from POSIX `gettimeofday()`. // // struct timeval tv; // gettimeofday(&tv, NULL); // // Timestamp timestamp; // timestamp.set_seconds(tv.tv_sec); // timestamp.set_nanos(tv.tv_usec * 1000); // // Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. // // FILETIME ft; // GetSystemTimeAsFileTime(&ft); // UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // // // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. // Timestamp timestamp; // timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); // timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); // // Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. // // long millis = System.currentTimeMillis(); // // Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) // .setNanos((int) ((millis % 1000) * 1000000)).build(); // // // Example 5: Compute Timestamp from current time in Python. // // timestamp = Timestamp() // timestamp.GetCurrentTime() // // # JSON Mapping // // In JSON format, the Timestamp type is encoded as a string in the // [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the // format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" // where {year} is always expressed using four digits while {month}, {day}, // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone // is required. A proto3 JSON serializer should always use UTC (as indicated by // "Z") when printing the Timestamp type and a proto3 JSON parser should be // able to accept both UTC and other timezones (as indicated by an offset). // // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past // 01:30 UTC on January 15, 2017. // // In JavaScript, one can convert a Date object to this format using the // standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] // method. In Python, a standard `datetime.datetime` object can be converted // to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) // with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one // can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( // http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- // ) to obtain a formatter capable of generating timestamps in this format. // // message Timestamp { // Represents seconds of UTC time since Unix epoch // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to // 9999-12-31T23:59:59Z inclusive. int64 seconds = 1; // Non-negative fractions of a second at nanosecond resolution. Negative // second values with fractions must still have non-negative nanos values // that count forward in time. Must be from 0 to 999,999,999 // inclusive. int32 nanos = 2; } ================================================ FILE: vendor/github.com/golang/protobuf/ptypes/timestamp.go ================================================ // Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package ptypes // This file implements operations on google.protobuf.Timestamp. import ( "errors" "fmt" "time" tspb "github.com/golang/protobuf/ptypes/timestamp" ) const ( // Seconds field of the earliest valid Timestamp. // This is time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC).Unix(). minValidSeconds = -62135596800 // Seconds field just after the latest valid Timestamp. // This is time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC).Unix(). maxValidSeconds = 253402300800 ) // validateTimestamp determines whether a Timestamp is valid. // A valid timestamp represents a time in the range // [0001-01-01, 10000-01-01) and has a Nanos field // in the range [0, 1e9). // // If the Timestamp is valid, validateTimestamp returns nil. // Otherwise, it returns an error that describes // the problem. // // Every valid Timestamp can be represented by a time.Time, but the converse is not true. func validateTimestamp(ts *tspb.Timestamp) error { if ts == nil { return errors.New("timestamp: nil Timestamp") } if ts.Seconds < minValidSeconds { return fmt.Errorf("timestamp: %v before 0001-01-01", ts) } if ts.Seconds >= maxValidSeconds { return fmt.Errorf("timestamp: %v after 10000-01-01", ts) } if ts.Nanos < 0 || ts.Nanos >= 1e9 { return fmt.Errorf("timestamp: %v: nanos not in range [0, 1e9)", ts) } return nil } // Timestamp converts a google.protobuf.Timestamp proto to a time.Time. // It returns an error if the argument is invalid. // // Unlike most Go functions, if Timestamp returns an error, the first return value // is not the zero time.Time. Instead, it is the value obtained from the // time.Unix function when passed the contents of the Timestamp, in the UTC // locale. This may or may not be a meaningful time; many invalid Timestamps // do map to valid time.Times. // // A nil Timestamp returns an error. The first return value in that case is // undefined. func Timestamp(ts *tspb.Timestamp) (time.Time, error) { // Don't return the zero value on error, because corresponds to a valid // timestamp. Instead return whatever time.Unix gives us. var t time.Time if ts == nil { t = time.Unix(0, 0).UTC() // treat nil like the empty Timestamp } else { t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC() } return t, validateTimestamp(ts) } // TimestampNow returns a google.protobuf.Timestamp for the current time. func TimestampNow() *tspb.Timestamp { ts, err := TimestampProto(time.Now()) if err != nil { panic("ptypes: time.Now() out of Timestamp range") } return ts } // TimestampProto converts the time.Time to a google.protobuf.Timestamp proto. // It returns an error if the resulting Timestamp is invalid. func TimestampProto(t time.Time) (*tspb.Timestamp, error) { ts := &tspb.Timestamp{ Seconds: t.Unix(), Nanos: int32(t.Nanosecond()), } if err := validateTimestamp(ts); err != nil { return nil, err } return ts, nil } // TimestampString returns the RFC 3339 string for valid Timestamps. For invalid // Timestamps, it returns an error message in parentheses. func TimestampString(ts *tspb.Timestamp) string { t, err := Timestamp(ts) if err != nil { return fmt.Sprintf("(%v)", err) } return t.Format(time.RFC3339Nano) } ================================================ FILE: vendor/github.com/google/btree/.travis.yml ================================================ language: go ================================================ FILE: vendor/github.com/google/btree/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/google/btree/README.md ================================================ # BTree implementation for Go ![Travis CI Build Status](https://api.travis-ci.org/google/btree.svg?branch=master) This package provides an in-memory B-Tree implementation for Go, useful as an ordered, mutable data structure. The API is based off of the wonderful http://godoc.org/github.com/petar/GoLLRB/llrb, and is meant to allow btree to act as a drop-in replacement for gollrb trees. See http://godoc.org/github.com/google/btree for documentation. ================================================ FILE: vendor/github.com/google/btree/btree.go ================================================ // Copyright 2014 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package btree implements in-memory B-Trees of arbitrary degree. // // btree implements an in-memory B-Tree for use as an ordered data structure. // It is not meant for persistent storage solutions. // // It has a flatter structure than an equivalent red-black or other binary tree, // which in some cases yields better memory usage and/or performance. // See some discussion on the matter here: // http://google-opensource.blogspot.com/2013/01/c-containers-that-save-memory-and-time.html // Note, though, that this project is in no way related to the C++ B-Tree // implementation written about there. // // Within this tree, each node contains a slice of items and a (possibly nil) // slice of children. For basic numeric values or raw structs, this can cause // efficiency differences when compared to equivalent C++ template code that // stores values in arrays within the node: // * Due to the overhead of storing values as interfaces (each // value needs to be stored as the value itself, then 2 words for the // interface pointing to that value and its type), resulting in higher // memory use. // * Since interfaces can point to values anywhere in memory, values are // most likely not stored in contiguous blocks, resulting in a higher // number of cache misses. // These issues don't tend to matter, though, when working with strings or other // heap-allocated structures, since C++-equivalent structures also must store // pointers and also distribute their values across the heap. // // This implementation is designed to be a drop-in replacement to gollrb.LLRB // trees, (http://github.com/petar/gollrb), an excellent and probably the most // widely used ordered tree implementation in the Go ecosystem currently. // Its functions, therefore, exactly mirror those of // llrb.LLRB where possible. Unlike gollrb, though, we currently don't // support storing multiple equivalent values. package btree import ( "fmt" "io" "sort" "strings" "sync" ) // Item represents a single object in the tree. type Item interface { // Less tests whether the current item is less than the given argument. // // This must provide a strict weak ordering. // If !a.Less(b) && !b.Less(a), we treat this to mean a == b (i.e. we can only // hold one of either a or b in the tree). Less(than Item) bool } const ( DefaultFreeListSize = 32 ) var ( nilItems = make(items, 16) nilChildren = make(children, 16) ) // FreeList represents a free list of btree nodes. By default each // BTree has its own FreeList, but multiple BTrees can share the same // FreeList. // Two Btrees using the same freelist are safe for concurrent write access. type FreeList struct { mu sync.Mutex freelist []*node } // NewFreeList creates a new free list. // size is the maximum size of the returned free list. func NewFreeList(size int) *FreeList { return &FreeList{freelist: make([]*node, 0, size)} } func (f *FreeList) newNode() (n *node) { f.mu.Lock() index := len(f.freelist) - 1 if index < 0 { f.mu.Unlock() return new(node) } n = f.freelist[index] f.freelist[index] = nil f.freelist = f.freelist[:index] f.mu.Unlock() return } // freeNode adds the given node to the list, returning true if it was added // and false if it was discarded. func (f *FreeList) freeNode(n *node) (out bool) { f.mu.Lock() if len(f.freelist) < cap(f.freelist) { f.freelist = append(f.freelist, n) out = true } f.mu.Unlock() return } // ItemIterator allows callers of Ascend* to iterate in-order over portions of // the tree. When this function returns false, iteration will stop and the // associated Ascend* function will immediately return. type ItemIterator func(i Item) bool // New creates a new B-Tree with the given degree. // // New(2), for example, will create a 2-3-4 tree (each node contains 1-3 items // and 2-4 children). func New(degree int) *BTree { return NewWithFreeList(degree, NewFreeList(DefaultFreeListSize)) } // NewWithFreeList creates a new B-Tree that uses the given node free list. func NewWithFreeList(degree int, f *FreeList) *BTree { if degree <= 1 { panic("bad degree") } return &BTree{ degree: degree, cow: ©OnWriteContext{freelist: f}, } } // items stores items in a node. type items []Item // insertAt inserts a value into the given index, pushing all subsequent values // forward. func (s *items) insertAt(index int, item Item) { *s = append(*s, nil) if index < len(*s) { copy((*s)[index+1:], (*s)[index:]) } (*s)[index] = item } // removeAt removes a value at a given index, pulling all subsequent values // back. func (s *items) removeAt(index int) Item { item := (*s)[index] copy((*s)[index:], (*s)[index+1:]) (*s)[len(*s)-1] = nil *s = (*s)[:len(*s)-1] return item } // pop removes and returns the last element in the list. func (s *items) pop() (out Item) { index := len(*s) - 1 out = (*s)[index] (*s)[index] = nil *s = (*s)[:index] return } // truncate truncates this instance at index so that it contains only the // first index items. index must be less than or equal to length. func (s *items) truncate(index int) { var toClear items *s, toClear = (*s)[:index], (*s)[index:] for len(toClear) > 0 { toClear = toClear[copy(toClear, nilItems):] } } // find returns the index where the given item should be inserted into this // list. 'found' is true if the item already exists in the list at the given // index. func (s items) find(item Item) (index int, found bool) { i := sort.Search(len(s), func(i int) bool { return item.Less(s[i]) }) if i > 0 && !s[i-1].Less(item) { return i - 1, true } return i, false } // children stores child nodes in a node. type children []*node // insertAt inserts a value into the given index, pushing all subsequent values // forward. func (s *children) insertAt(index int, n *node) { *s = append(*s, nil) if index < len(*s) { copy((*s)[index+1:], (*s)[index:]) } (*s)[index] = n } // removeAt removes a value at a given index, pulling all subsequent values // back. func (s *children) removeAt(index int) *node { n := (*s)[index] copy((*s)[index:], (*s)[index+1:]) (*s)[len(*s)-1] = nil *s = (*s)[:len(*s)-1] return n } // pop removes and returns the last element in the list. func (s *children) pop() (out *node) { index := len(*s) - 1 out = (*s)[index] (*s)[index] = nil *s = (*s)[:index] return } // truncate truncates this instance at index so that it contains only the // first index children. index must be less than or equal to length. func (s *children) truncate(index int) { var toClear children *s, toClear = (*s)[:index], (*s)[index:] for len(toClear) > 0 { toClear = toClear[copy(toClear, nilChildren):] } } // node is an internal node in a tree. // // It must at all times maintain the invariant that either // * len(children) == 0, len(items) unconstrained // * len(children) == len(items) + 1 type node struct { items items children children cow *copyOnWriteContext } func (n *node) mutableFor(cow *copyOnWriteContext) *node { if n.cow == cow { return n } out := cow.newNode() if cap(out.items) >= len(n.items) { out.items = out.items[:len(n.items)] } else { out.items = make(items, len(n.items), cap(n.items)) } copy(out.items, n.items) // Copy children if cap(out.children) >= len(n.children) { out.children = out.children[:len(n.children)] } else { out.children = make(children, len(n.children), cap(n.children)) } copy(out.children, n.children) return out } func (n *node) mutableChild(i int) *node { c := n.children[i].mutableFor(n.cow) n.children[i] = c return c } // split splits the given node at the given index. The current node shrinks, // and this function returns the item that existed at that index and a new node // containing all items/children after it. func (n *node) split(i int) (Item, *node) { item := n.items[i] next := n.cow.newNode() next.items = append(next.items, n.items[i+1:]...) n.items.truncate(i) if len(n.children) > 0 { next.children = append(next.children, n.children[i+1:]...) n.children.truncate(i + 1) } return item, next } // maybeSplitChild checks if a child should be split, and if so splits it. // Returns whether or not a split occurred. func (n *node) maybeSplitChild(i, maxItems int) bool { if len(n.children[i].items) < maxItems { return false } first := n.mutableChild(i) item, second := first.split(maxItems / 2) n.items.insertAt(i, item) n.children.insertAt(i+1, second) return true } // insert inserts an item into the subtree rooted at this node, making sure // no nodes in the subtree exceed maxItems items. Should an equivalent item be // be found/replaced by insert, it will be returned. func (n *node) insert(item Item, maxItems int) Item { i, found := n.items.find(item) if found { out := n.items[i] n.items[i] = item return out } if len(n.children) == 0 { n.items.insertAt(i, item) return nil } if n.maybeSplitChild(i, maxItems) { inTree := n.items[i] switch { case item.Less(inTree): // no change, we want first split node case inTree.Less(item): i++ // we want second split node default: out := n.items[i] n.items[i] = item return out } } return n.mutableChild(i).insert(item, maxItems) } // get finds the given key in the subtree and returns it. func (n *node) get(key Item) Item { i, found := n.items.find(key) if found { return n.items[i] } else if len(n.children) > 0 { return n.children[i].get(key) } return nil } // min returns the first item in the subtree. func min(n *node) Item { if n == nil { return nil } for len(n.children) > 0 { n = n.children[0] } if len(n.items) == 0 { return nil } return n.items[0] } // max returns the last item in the subtree. func max(n *node) Item { if n == nil { return nil } for len(n.children) > 0 { n = n.children[len(n.children)-1] } if len(n.items) == 0 { return nil } return n.items[len(n.items)-1] } // toRemove details what item to remove in a node.remove call. type toRemove int const ( removeItem toRemove = iota // removes the given item removeMin // removes smallest item in the subtree removeMax // removes largest item in the subtree ) // remove removes an item from the subtree rooted at this node. func (n *node) remove(item Item, minItems int, typ toRemove) Item { var i int var found bool switch typ { case removeMax: if len(n.children) == 0 { return n.items.pop() } i = len(n.items) case removeMin: if len(n.children) == 0 { return n.items.removeAt(0) } i = 0 case removeItem: i, found = n.items.find(item) if len(n.children) == 0 { if found { return n.items.removeAt(i) } return nil } default: panic("invalid type") } // If we get to here, we have children. if len(n.children[i].items) <= minItems { return n.growChildAndRemove(i, item, minItems, typ) } child := n.mutableChild(i) // Either we had enough items to begin with, or we've done some // merging/stealing, because we've got enough now and we're ready to return // stuff. if found { // The item exists at index 'i', and the child we've selected can give us a // predecessor, since if we've gotten here it's got > minItems items in it. out := n.items[i] // We use our special-case 'remove' call with typ=maxItem to pull the // predecessor of item i (the rightmost leaf of our immediate left child) // and set it into where we pulled the item from. n.items[i] = child.remove(nil, minItems, removeMax) return out } // Final recursive call. Once we're here, we know that the item isn't in this // node and that the child is big enough to remove from. return child.remove(item, minItems, typ) } // growChildAndRemove grows child 'i' to make sure it's possible to remove an // item from it while keeping it at minItems, then calls remove to actually // remove it. // // Most documentation says we have to do two sets of special casing: // 1) item is in this node // 2) item is in child // In both cases, we need to handle the two subcases: // A) node has enough values that it can spare one // B) node doesn't have enough values // For the latter, we have to check: // a) left sibling has node to spare // b) right sibling has node to spare // c) we must merge // To simplify our code here, we handle cases #1 and #2 the same: // If a node doesn't have enough items, we make sure it does (using a,b,c). // We then simply redo our remove call, and the second time (regardless of // whether we're in case 1 or 2), we'll have enough items and can guarantee // that we hit case A. func (n *node) growChildAndRemove(i int, item Item, minItems int, typ toRemove) Item { if i > 0 && len(n.children[i-1].items) > minItems { // Steal from left child child := n.mutableChild(i) stealFrom := n.mutableChild(i - 1) stolenItem := stealFrom.items.pop() child.items.insertAt(0, n.items[i-1]) n.items[i-1] = stolenItem if len(stealFrom.children) > 0 { child.children.insertAt(0, stealFrom.children.pop()) } } else if i < len(n.items) && len(n.children[i+1].items) > minItems { // steal from right child child := n.mutableChild(i) stealFrom := n.mutableChild(i + 1) stolenItem := stealFrom.items.removeAt(0) child.items = append(child.items, n.items[i]) n.items[i] = stolenItem if len(stealFrom.children) > 0 { child.children = append(child.children, stealFrom.children.removeAt(0)) } } else { if i >= len(n.items) { i-- } child := n.mutableChild(i) // merge with right child mergeItem := n.items.removeAt(i) mergeChild := n.children.removeAt(i + 1) child.items = append(child.items, mergeItem) child.items = append(child.items, mergeChild.items...) child.children = append(child.children, mergeChild.children...) n.cow.freeNode(mergeChild) } return n.remove(item, minItems, typ) } type direction int const ( descend = direction(-1) ascend = direction(+1) ) // iterate provides a simple method for iterating over elements in the tree. // // When ascending, the 'start' should be less than 'stop' and when descending, // the 'start' should be greater than 'stop'. Setting 'includeStart' to true // will force the iterator to include the first item when it equals 'start', // thus creating a "greaterOrEqual" or "lessThanEqual" rather than just a // "greaterThan" or "lessThan" queries. func (n *node) iterate(dir direction, start, stop Item, includeStart bool, hit bool, iter ItemIterator) (bool, bool) { var ok bool switch dir { case ascend: for i := 0; i < len(n.items); i++ { if start != nil && n.items[i].Less(start) { continue } if len(n.children) > 0 { if hit, ok = n.children[i].iterate(dir, start, stop, includeStart, hit, iter); !ok { return hit, false } } if !includeStart && !hit && start != nil && !start.Less(n.items[i]) { hit = true continue } hit = true if stop != nil && !n.items[i].Less(stop) { return hit, false } if !iter(n.items[i]) { return hit, false } } if len(n.children) > 0 { if hit, ok = n.children[len(n.children)-1].iterate(dir, start, stop, includeStart, hit, iter); !ok { return hit, false } } case descend: for i := len(n.items) - 1; i >= 0; i-- { if start != nil && !n.items[i].Less(start) { if !includeStart || hit || start.Less(n.items[i]) { continue } } if len(n.children) > 0 { if hit, ok = n.children[i+1].iterate(dir, start, stop, includeStart, hit, iter); !ok { return hit, false } } if stop != nil && !stop.Less(n.items[i]) { return hit, false // continue } hit = true if !iter(n.items[i]) { return hit, false } } if len(n.children) > 0 { if hit, ok = n.children[0].iterate(dir, start, stop, includeStart, hit, iter); !ok { return hit, false } } } return hit, true } // Used for testing/debugging purposes. func (n *node) print(w io.Writer, level int) { fmt.Fprintf(w, "%sNODE:%v\n", strings.Repeat(" ", level), n.items) for _, c := range n.children { c.print(w, level+1) } } // BTree is an implementation of a B-Tree. // // BTree stores Item instances in an ordered structure, allowing easy insertion, // removal, and iteration. // // Write operations are not safe for concurrent mutation by multiple // goroutines, but Read operations are. type BTree struct { degree int length int root *node cow *copyOnWriteContext } // copyOnWriteContext pointers determine node ownership... a tree with a write // context equivalent to a node's write context is allowed to modify that node. // A tree whose write context does not match a node's is not allowed to modify // it, and must create a new, writable copy (IE: it's a Clone). // // When doing any write operation, we maintain the invariant that the current // node's context is equal to the context of the tree that requested the write. // We do this by, before we descend into any node, creating a copy with the // correct context if the contexts don't match. // // Since the node we're currently visiting on any write has the requesting // tree's context, that node is modifiable in place. Children of that node may // not share context, but before we descend into them, we'll make a mutable // copy. type copyOnWriteContext struct { freelist *FreeList } // Clone clones the btree, lazily. Clone should not be called concurrently, // but the original tree (t) and the new tree (t2) can be used concurrently // once the Clone call completes. // // The internal tree structure of b is marked read-only and shared between t and // t2. Writes to both t and t2 use copy-on-write logic, creating new nodes // whenever one of b's original nodes would have been modified. Read operations // should have no performance degredation. Write operations for both t and t2 // will initially experience minor slow-downs caused by additional allocs and // copies due to the aforementioned copy-on-write logic, but should converge to // the original performance characteristics of the original tree. func (t *BTree) Clone() (t2 *BTree) { // Create two entirely new copy-on-write contexts. // This operation effectively creates three trees: // the original, shared nodes (old b.cow) // the new b.cow nodes // the new out.cow nodes cow1, cow2 := *t.cow, *t.cow out := *t t.cow = &cow1 out.cow = &cow2 return &out } // maxItems returns the max number of items to allow per node. func (t *BTree) maxItems() int { return t.degree*2 - 1 } // minItems returns the min number of items to allow per node (ignored for the // root node). func (t *BTree) minItems() int { return t.degree - 1 } func (c *copyOnWriteContext) newNode() (n *node) { n = c.freelist.newNode() n.cow = c return } type freeType int const ( ftFreelistFull freeType = iota // node was freed (available for GC, not stored in freelist) ftStored // node was stored in the freelist for later use ftNotOwned // node was ignored by COW, since it's owned by another one ) // freeNode frees a node within a given COW context, if it's owned by that // context. It returns what happened to the node (see freeType const // documentation). func (c *copyOnWriteContext) freeNode(n *node) freeType { if n.cow == c { // clear to allow GC n.items.truncate(0) n.children.truncate(0) n.cow = nil if c.freelist.freeNode(n) { return ftStored } else { return ftFreelistFull } } else { return ftNotOwned } } // ReplaceOrInsert adds the given item to the tree. If an item in the tree // already equals the given one, it is removed from the tree and returned. // Otherwise, nil is returned. // // nil cannot be added to the tree (will panic). func (t *BTree) ReplaceOrInsert(item Item) Item { if item == nil { panic("nil item being added to BTree") } if t.root == nil { t.root = t.cow.newNode() t.root.items = append(t.root.items, item) t.length++ return nil } else { t.root = t.root.mutableFor(t.cow) if len(t.root.items) >= t.maxItems() { item2, second := t.root.split(t.maxItems() / 2) oldroot := t.root t.root = t.cow.newNode() t.root.items = append(t.root.items, item2) t.root.children = append(t.root.children, oldroot, second) } } out := t.root.insert(item, t.maxItems()) if out == nil { t.length++ } return out } // Delete removes an item equal to the passed in item from the tree, returning // it. If no such item exists, returns nil. func (t *BTree) Delete(item Item) Item { return t.deleteItem(item, removeItem) } // DeleteMin removes the smallest item in the tree and returns it. // If no such item exists, returns nil. func (t *BTree) DeleteMin() Item { return t.deleteItem(nil, removeMin) } // DeleteMax removes the largest item in the tree and returns it. // If no such item exists, returns nil. func (t *BTree) DeleteMax() Item { return t.deleteItem(nil, removeMax) } func (t *BTree) deleteItem(item Item, typ toRemove) Item { if t.root == nil || len(t.root.items) == 0 { return nil } t.root = t.root.mutableFor(t.cow) out := t.root.remove(item, t.minItems(), typ) if len(t.root.items) == 0 && len(t.root.children) > 0 { oldroot := t.root t.root = t.root.children[0] t.cow.freeNode(oldroot) } if out != nil { t.length-- } return out } // AscendRange calls the iterator for every value in the tree within the range // [greaterOrEqual, lessThan), until iterator returns false. func (t *BTree) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) { if t.root == nil { return } t.root.iterate(ascend, greaterOrEqual, lessThan, true, false, iterator) } // AscendLessThan calls the iterator for every value in the tree within the range // [first, pivot), until iterator returns false. func (t *BTree) AscendLessThan(pivot Item, iterator ItemIterator) { if t.root == nil { return } t.root.iterate(ascend, nil, pivot, false, false, iterator) } // AscendGreaterOrEqual calls the iterator for every value in the tree within // the range [pivot, last], until iterator returns false. func (t *BTree) AscendGreaterOrEqual(pivot Item, iterator ItemIterator) { if t.root == nil { return } t.root.iterate(ascend, pivot, nil, true, false, iterator) } // Ascend calls the iterator for every value in the tree within the range // [first, last], until iterator returns false. func (t *BTree) Ascend(iterator ItemIterator) { if t.root == nil { return } t.root.iterate(ascend, nil, nil, false, false, iterator) } // DescendRange calls the iterator for every value in the tree within the range // [lessOrEqual, greaterThan), until iterator returns false. func (t *BTree) DescendRange(lessOrEqual, greaterThan Item, iterator ItemIterator) { if t.root == nil { return } t.root.iterate(descend, lessOrEqual, greaterThan, true, false, iterator) } // DescendLessOrEqual calls the iterator for every value in the tree within the range // [pivot, first], until iterator returns false. func (t *BTree) DescendLessOrEqual(pivot Item, iterator ItemIterator) { if t.root == nil { return } t.root.iterate(descend, pivot, nil, true, false, iterator) } // DescendGreaterThan calls the iterator for every value in the tree within // the range (pivot, last], until iterator returns false. func (t *BTree) DescendGreaterThan(pivot Item, iterator ItemIterator) { if t.root == nil { return } t.root.iterate(descend, nil, pivot, false, false, iterator) } // Descend calls the iterator for every value in the tree within the range // [last, first], until iterator returns false. func (t *BTree) Descend(iterator ItemIterator) { if t.root == nil { return } t.root.iterate(descend, nil, nil, false, false, iterator) } // Get looks for the key item in the tree, returning it. It returns nil if // unable to find that item. func (t *BTree) Get(key Item) Item { if t.root == nil { return nil } return t.root.get(key) } // Min returns the smallest item in the tree, or nil if the tree is empty. func (t *BTree) Min() Item { return min(t.root) } // Max returns the largest item in the tree, or nil if the tree is empty. func (t *BTree) Max() Item { return max(t.root) } // Has returns true if the given key is in the tree. func (t *BTree) Has(key Item) bool { return t.Get(key) != nil } // Len returns the number of items currently in the tree. func (t *BTree) Len() int { return t.length } // Clear removes all items from the btree. If addNodesToFreelist is true, // t's nodes are added to its freelist as part of this call, until the freelist // is full. Otherwise, the root node is simply dereferenced and the subtree // left to Go's normal GC processes. // // This can be much faster // than calling Delete on all elements, because that requires finding/removing // each element in the tree and updating the tree accordingly. It also is // somewhat faster than creating a new tree to replace the old one, because // nodes from the old tree are reclaimed into the freelist for use by the new // one, instead of being lost to the garbage collector. // // This call takes: // O(1): when addNodesToFreelist is false, this is a single operation. // O(1): when the freelist is already full, it breaks out immediately // O(freelist size): when the freelist is empty and the nodes are all owned // by this tree, nodes are added to the freelist until full. // O(tree size): when all nodes are owned by another tree, all nodes are // iterated over looking for nodes to add to the freelist, and due to // ownership, none are. func (t *BTree) Clear(addNodesToFreelist bool) { if t.root != nil && addNodesToFreelist { t.root.reset(t.cow) } t.root, t.length = nil, 0 } // reset returns a subtree to the freelist. It breaks out immediately if the // freelist is full, since the only benefit of iterating is to fill that // freelist up. Returns true if parent reset call should continue. func (n *node) reset(c *copyOnWriteContext) bool { for _, child := range n.children { if !child.reset(c) { return false } } return c.freeNode(n) != ftFreelistFull } // Int implements the Item interface for integers. type Int int // Less returns true if int(a) < int(b). func (a Int) Less(b Item) bool { return a < b.(Int) } ================================================ FILE: vendor/github.com/google/gofuzz/.travis.yml ================================================ language: go go: - 1.4 - 1.3 - 1.2 - tip install: - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi script: - go test -cover ================================================ FILE: vendor/github.com/google/gofuzz/CONTRIBUTING.md ================================================ # How to contribute # We'd love to accept your patches and contributions to this project. There are a just a few small guidelines you need to follow. ## Contributor License Agreement ## Contributions to any Google project must be accompanied by a Contributor License Agreement. This is not a copyright **assignment**, it simply gives Google permission to use and redistribute your contributions as part of the project. * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA][]. * If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA][]. You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again. [individual CLA]: https://developers.google.com/open-source/cla/individual [corporate CLA]: https://developers.google.com/open-source/cla/corporate ## Submitting a patch ## 1. It's generally best to start by opening a new issue describing the bug or feature you're intending to fix. Even if you think it's relatively minor, it's helpful to know what people are working on. Mention in the initial issue that you are planning to work on that bug or feature so that it can be assigned to you. 1. Follow the normal process of [forking][] the project, and setup a new branch to work in. It's important that each group of changes be done in separate branches in order to ensure that a pull request only includes the commits related to that bug or feature. 1. Go makes it very simple to ensure properly formatted code, so always run `go fmt` on your code before committing it. You should also run [golint][] over your code. As noted in the [golint readme][], it's not strictly necessary that your code be completely "lint-free", but this will help you find common style issues. 1. Any significant changes should almost always be accompanied by tests. The project already has good test coverage, so look at some of the existing tests if you're unsure how to go about it. [gocov][] and [gocov-html][] are invaluable tools for seeing which parts of your code aren't being exercised by your tests. 1. Do your best to have [well-formed commit messages][] for each change. This provides consistency throughout the project, and ensures that commit messages are able to be formatted properly by various git tools. 1. Finally, push the commits to your fork and submit a [pull request][]. [forking]: https://help.github.com/articles/fork-a-repo [golint]: https://github.com/golang/lint [golint readme]: https://github.com/golang/lint/blob/master/README [gocov]: https://github.com/axw/gocov [gocov-html]: https://github.com/matm/gocov-html [well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html [squash]: http://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits [pull request]: https://help.github.com/articles/creating-a-pull-request ================================================ FILE: vendor/github.com/google/gofuzz/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/google/gofuzz/README.md ================================================ gofuzz ====== gofuzz is a library for populating go objects with random values. [![GoDoc](https://godoc.org/github.com/google/gofuzz?status.png)](https://godoc.org/github.com/google/gofuzz) [![Travis](https://travis-ci.org/google/gofuzz.svg?branch=master)](https://travis-ci.org/google/gofuzz) This is useful for testing: * Do your project's objects really serialize/unserialize correctly in all cases? * Is there an incorrectly formatted object that will cause your project to panic? Import with ```import "github.com/google/gofuzz"``` You can use it on single variables: ```go f := fuzz.New() var myInt int f.Fuzz(&myInt) // myInt gets a random value. ``` You can use it on maps: ```go f := fuzz.New().NilChance(0).NumElements(1, 1) var myMap map[ComplexKeyType]string f.Fuzz(&myMap) // myMap will have exactly one element. ``` Customize the chance of getting a nil pointer: ```go f := fuzz.New().NilChance(.5) var fancyStruct struct { A, B, C, D *string } f.Fuzz(&fancyStruct) // About half the pointers should be set. ``` You can even customize the randomization completely if needed: ```go type MyEnum string const ( A MyEnum = "A" B MyEnum = "B" ) type MyInfo struct { Type MyEnum AInfo *string BInfo *string } f := fuzz.New().NilChance(0).Funcs( func(e *MyInfo, c fuzz.Continue) { switch c.Intn(2) { case 0: e.Type = A c.Fuzz(&e.AInfo) case 1: e.Type = B c.Fuzz(&e.BInfo) } }, ) var myObject MyInfo f.Fuzz(&myObject) // Type will correspond to whether A or B info is set. ``` See more examples in ```example_test.go```. Happy testing! ================================================ FILE: vendor/github.com/google/gofuzz/doc.go ================================================ /* Copyright 2014 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package fuzz is a library for populating go objects with random values. package fuzz ================================================ FILE: vendor/github.com/google/gofuzz/fuzz.go ================================================ /* Copyright 2014 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fuzz import ( "fmt" "math/rand" "reflect" "time" ) // fuzzFuncMap is a map from a type to a fuzzFunc that handles that type. type fuzzFuncMap map[reflect.Type]reflect.Value // Fuzzer knows how to fill any object with random fields. type Fuzzer struct { fuzzFuncs fuzzFuncMap defaultFuzzFuncs fuzzFuncMap r *rand.Rand nilChance float64 minElements int maxElements int maxDepth int } // New returns a new Fuzzer. Customize your Fuzzer further by calling Funcs, // RandSource, NilChance, or NumElements in any order. func New() *Fuzzer { return NewWithSeed(time.Now().UnixNano()) } func NewWithSeed(seed int64) *Fuzzer { f := &Fuzzer{ defaultFuzzFuncs: fuzzFuncMap{ reflect.TypeOf(&time.Time{}): reflect.ValueOf(fuzzTime), }, fuzzFuncs: fuzzFuncMap{}, r: rand.New(rand.NewSource(seed)), nilChance: .2, minElements: 1, maxElements: 10, maxDepth: 100, } return f } // Funcs adds each entry in fuzzFuncs as a custom fuzzing function. // // Each entry in fuzzFuncs must be a function taking two parameters. // The first parameter must be a pointer or map. It is the variable that // function will fill with random data. The second parameter must be a // fuzz.Continue, which will provide a source of randomness and a way // to automatically continue fuzzing smaller pieces of the first parameter. // // These functions are called sensibly, e.g., if you wanted custom string // fuzzing, the function `func(s *string, c fuzz.Continue)` would get // called and passed the address of strings. Maps and pointers will always // be made/new'd for you, ignoring the NilChange option. For slices, it // doesn't make much sense to pre-create them--Fuzzer doesn't know how // long you want your slice--so take a pointer to a slice, and make it // yourself. (If you don't want your map/pointer type pre-made, take a // pointer to it, and make it yourself.) See the examples for a range of // custom functions. func (f *Fuzzer) Funcs(fuzzFuncs ...interface{}) *Fuzzer { for i := range fuzzFuncs { v := reflect.ValueOf(fuzzFuncs[i]) if v.Kind() != reflect.Func { panic("Need only funcs!") } t := v.Type() if t.NumIn() != 2 || t.NumOut() != 0 { panic("Need 2 in and 0 out params!") } argT := t.In(0) switch argT.Kind() { case reflect.Ptr, reflect.Map: default: panic("fuzzFunc must take pointer or map type") } if t.In(1) != reflect.TypeOf(Continue{}) { panic("fuzzFunc's second parameter must be type fuzz.Continue") } f.fuzzFuncs[argT] = v } return f } // RandSource causes f to get values from the given source of randomness. // Use if you want deterministic fuzzing. func (f *Fuzzer) RandSource(s rand.Source) *Fuzzer { f.r = rand.New(s) return f } // NilChance sets the probability of creating a nil pointer, map, or slice to // 'p'. 'p' should be between 0 (no nils) and 1 (all nils), inclusive. func (f *Fuzzer) NilChance(p float64) *Fuzzer { if p < 0 || p > 1 { panic("p should be between 0 and 1, inclusive.") } f.nilChance = p return f } // NumElements sets the minimum and maximum number of elements that will be // added to a non-nil map or slice. func (f *Fuzzer) NumElements(atLeast, atMost int) *Fuzzer { if atLeast > atMost { panic("atLeast must be <= atMost") } if atLeast < 0 { panic("atLeast must be >= 0") } f.minElements = atLeast f.maxElements = atMost return f } func (f *Fuzzer) genElementCount() int { if f.minElements == f.maxElements { return f.minElements } return f.minElements + f.r.Intn(f.maxElements-f.minElements+1) } func (f *Fuzzer) genShouldFill() bool { return f.r.Float64() > f.nilChance } // MaxDepth sets the maximum number of recursive fuzz calls that will be made // before stopping. This includes struct members, pointers, and map and slice // elements. func (f *Fuzzer) MaxDepth(d int) *Fuzzer { f.maxDepth = d return f } // Fuzz recursively fills all of obj's fields with something random. First // this tries to find a custom fuzz function (see Funcs). If there is no // custom function this tests whether the object implements fuzz.Interface and, // if so, calls Fuzz on it to fuzz itself. If that fails, this will see if // there is a default fuzz function provided by this package. If all of that // fails, this will generate random values for all primitive fields and then // recurse for all non-primitives. // // This is safe for cyclic or tree-like structs, up to a limit. Use the // MaxDepth method to adjust how deep you need it to recurse. // // obj must be a pointer. Only exported (public) fields can be set (thanks, // golang :/ ) Intended for tests, so will panic on bad input or unimplemented // fields. func (f *Fuzzer) Fuzz(obj interface{}) { v := reflect.ValueOf(obj) if v.Kind() != reflect.Ptr { panic("needed ptr!") } v = v.Elem() f.fuzzWithContext(v, 0) } // FuzzNoCustom is just like Fuzz, except that any custom fuzz function for // obj's type will not be called and obj will not be tested for fuzz.Interface // conformance. This applies only to obj and not other instances of obj's // type. // Not safe for cyclic or tree-like structs! // obj must be a pointer. Only exported (public) fields can be set (thanks, golang :/ ) // Intended for tests, so will panic on bad input or unimplemented fields. func (f *Fuzzer) FuzzNoCustom(obj interface{}) { v := reflect.ValueOf(obj) if v.Kind() != reflect.Ptr { panic("needed ptr!") } v = v.Elem() f.fuzzWithContext(v, flagNoCustomFuzz) } const ( // Do not try to find a custom fuzz function. Does not apply recursively. flagNoCustomFuzz uint64 = 1 << iota ) func (f *Fuzzer) fuzzWithContext(v reflect.Value, flags uint64) { fc := &fuzzerContext{fuzzer: f} fc.doFuzz(v, flags) } // fuzzerContext carries context about a single fuzzing run, which lets Fuzzer // be thread-safe. type fuzzerContext struct { fuzzer *Fuzzer curDepth int } func (fc *fuzzerContext) doFuzz(v reflect.Value, flags uint64) { if fc.curDepth >= fc.fuzzer.maxDepth { return } fc.curDepth++ defer func() { fc.curDepth-- }() if !v.CanSet() { return } if flags&flagNoCustomFuzz == 0 { // Check for both pointer and non-pointer custom functions. if v.CanAddr() && fc.tryCustom(v.Addr()) { return } if fc.tryCustom(v) { return } } if fn, ok := fillFuncMap[v.Kind()]; ok { fn(v, fc.fuzzer.r) return } switch v.Kind() { case reflect.Map: if fc.fuzzer.genShouldFill() { v.Set(reflect.MakeMap(v.Type())) n := fc.fuzzer.genElementCount() for i := 0; i < n; i++ { key := reflect.New(v.Type().Key()).Elem() fc.doFuzz(key, 0) val := reflect.New(v.Type().Elem()).Elem() fc.doFuzz(val, 0) v.SetMapIndex(key, val) } return } v.Set(reflect.Zero(v.Type())) case reflect.Ptr: if fc.fuzzer.genShouldFill() { v.Set(reflect.New(v.Type().Elem())) fc.doFuzz(v.Elem(), 0) return } v.Set(reflect.Zero(v.Type())) case reflect.Slice: if fc.fuzzer.genShouldFill() { n := fc.fuzzer.genElementCount() v.Set(reflect.MakeSlice(v.Type(), n, n)) for i := 0; i < n; i++ { fc.doFuzz(v.Index(i), 0) } return } v.Set(reflect.Zero(v.Type())) case reflect.Array: if fc.fuzzer.genShouldFill() { n := v.Len() for i := 0; i < n; i++ { fc.doFuzz(v.Index(i), 0) } return } v.Set(reflect.Zero(v.Type())) case reflect.Struct: for i := 0; i < v.NumField(); i++ { fc.doFuzz(v.Field(i), 0) } case reflect.Chan: fallthrough case reflect.Func: fallthrough case reflect.Interface: fallthrough default: panic(fmt.Sprintf("Can't handle %#v", v.Interface())) } } // tryCustom searches for custom handlers, and returns true iff it finds a match // and successfully randomizes v. func (fc *fuzzerContext) tryCustom(v reflect.Value) bool { // First: see if we have a fuzz function for it. doCustom, ok := fc.fuzzer.fuzzFuncs[v.Type()] if !ok { // Second: see if it can fuzz itself. if v.CanInterface() { intf := v.Interface() if fuzzable, ok := intf.(Interface); ok { fuzzable.Fuzz(Continue{fc: fc, Rand: fc.fuzzer.r}) return true } } // Finally: see if there is a default fuzz function. doCustom, ok = fc.fuzzer.defaultFuzzFuncs[v.Type()] if !ok { return false } } switch v.Kind() { case reflect.Ptr: if v.IsNil() { if !v.CanSet() { return false } v.Set(reflect.New(v.Type().Elem())) } case reflect.Map: if v.IsNil() { if !v.CanSet() { return false } v.Set(reflect.MakeMap(v.Type())) } default: return false } doCustom.Call([]reflect.Value{v, reflect.ValueOf(Continue{ fc: fc, Rand: fc.fuzzer.r, })}) return true } // Interface represents an object that knows how to fuzz itself. Any time we // find a type that implements this interface we will delegate the act of // fuzzing itself. type Interface interface { Fuzz(c Continue) } // Continue can be passed to custom fuzzing functions to allow them to use // the correct source of randomness and to continue fuzzing their members. type Continue struct { fc *fuzzerContext // For convenience, Continue implements rand.Rand via embedding. // Use this for generating any randomness if you want your fuzzing // to be repeatable for a given seed. *rand.Rand } // Fuzz continues fuzzing obj. obj must be a pointer. func (c Continue) Fuzz(obj interface{}) { v := reflect.ValueOf(obj) if v.Kind() != reflect.Ptr { panic("needed ptr!") } v = v.Elem() c.fc.doFuzz(v, 0) } // FuzzNoCustom continues fuzzing obj, except that any custom fuzz function for // obj's type will not be called and obj will not be tested for fuzz.Interface // conformance. This applies only to obj and not other instances of obj's // type. func (c Continue) FuzzNoCustom(obj interface{}) { v := reflect.ValueOf(obj) if v.Kind() != reflect.Ptr { panic("needed ptr!") } v = v.Elem() c.fc.doFuzz(v, flagNoCustomFuzz) } // RandString makes a random string up to 20 characters long. The returned string // may include a variety of (valid) UTF-8 encodings. func (c Continue) RandString() string { return randString(c.Rand) } // RandUint64 makes random 64 bit numbers. // Weirdly, rand doesn't have a function that gives you 64 random bits. func (c Continue) RandUint64() uint64 { return randUint64(c.Rand) } // RandBool returns true or false randomly. func (c Continue) RandBool() bool { return randBool(c.Rand) } func fuzzInt(v reflect.Value, r *rand.Rand) { v.SetInt(int64(randUint64(r))) } func fuzzUint(v reflect.Value, r *rand.Rand) { v.SetUint(randUint64(r)) } func fuzzTime(t *time.Time, c Continue) { var sec, nsec int64 // Allow for about 1000 years of random time values, which keeps things // like JSON parsing reasonably happy. sec = c.Rand.Int63n(1000 * 365 * 24 * 60 * 60) c.Fuzz(&nsec) *t = time.Unix(sec, nsec) } var fillFuncMap = map[reflect.Kind]func(reflect.Value, *rand.Rand){ reflect.Bool: func(v reflect.Value, r *rand.Rand) { v.SetBool(randBool(r)) }, reflect.Int: fuzzInt, reflect.Int8: fuzzInt, reflect.Int16: fuzzInt, reflect.Int32: fuzzInt, reflect.Int64: fuzzInt, reflect.Uint: fuzzUint, reflect.Uint8: fuzzUint, reflect.Uint16: fuzzUint, reflect.Uint32: fuzzUint, reflect.Uint64: fuzzUint, reflect.Uintptr: fuzzUint, reflect.Float32: func(v reflect.Value, r *rand.Rand) { v.SetFloat(float64(r.Float32())) }, reflect.Float64: func(v reflect.Value, r *rand.Rand) { v.SetFloat(r.Float64()) }, reflect.Complex64: func(v reflect.Value, r *rand.Rand) { panic("unimplemented") }, reflect.Complex128: func(v reflect.Value, r *rand.Rand) { panic("unimplemented") }, reflect.String: func(v reflect.Value, r *rand.Rand) { v.SetString(randString(r)) }, reflect.UnsafePointer: func(v reflect.Value, r *rand.Rand) { panic("unimplemented") }, } // randBool returns true or false randomly. func randBool(r *rand.Rand) bool { if r.Int()&1 == 1 { return true } return false } type charRange struct { first, last rune } // choose returns a random unicode character from the given range, using the // given randomness source. func (r *charRange) choose(rand *rand.Rand) rune { count := int64(r.last - r.first) return r.first + rune(rand.Int63n(count)) } var unicodeRanges = []charRange{ {' ', '~'}, // ASCII characters {'\u00a0', '\u02af'}, // Multi-byte encoded characters {'\u4e00', '\u9fff'}, // Common CJK (even longer encodings) } // randString makes a random string up to 20 characters long. The returned string // may include a variety of (valid) UTF-8 encodings. func randString(r *rand.Rand) string { n := r.Intn(20) runes := make([]rune, n) for i := range runes { runes[i] = unicodeRanges[r.Intn(len(unicodeRanges))].choose(r) } return string(runes) } // randUint64 makes random 64 bit numbers. // Weirdly, rand doesn't have a function that gives you 64 random bits. func randUint64(r *rand.Rand) uint64 { return uint64(r.Uint32())<<32 | uint64(r.Uint32()) } ================================================ FILE: vendor/github.com/google/gofuzz/go.mod ================================================ module github.com/google/gofuzz go 1.12 ================================================ FILE: vendor/github.com/googleapis/gnostic/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go ================================================ // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // THIS FILE IS AUTOMATICALLY GENERATED. package openapi_v2 import ( "fmt" "github.com/googleapis/gnostic/compiler" "gopkg.in/yaml.v2" "regexp" "strings" ) // Version returns the package name (and OpenAPI version). func Version() string { return "openapi_v2" } // NewAdditionalPropertiesItem creates an object of type AdditionalPropertiesItem if possible, returning an error if not. func NewAdditionalPropertiesItem(in interface{}, context *compiler.Context) (*AdditionalPropertiesItem, error) { errors := make([]error, 0) x := &AdditionalPropertiesItem{} matched := false // Schema schema = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewSchema(m, compiler.NewContext("schema", context)) if matchingError == nil { x.Oneof = &AdditionalPropertiesItem_Schema{Schema: t} matched = true } else { errors = append(errors, matchingError) } } } // bool boolean = 2; boolValue, ok := in.(bool) if ok { x.Oneof = &AdditionalPropertiesItem_Boolean{Boolean: boolValue} } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } return x, compiler.NewErrorGroupOrNil(errors) } // NewAny creates an object of type Any if possible, returning an error if not. func NewAny(in interface{}, context *compiler.Context) (*Any, error) { errors := make([]error, 0) x := &Any{} bytes, _ := yaml.Marshal(in) x.Yaml = string(bytes) return x, compiler.NewErrorGroupOrNil(errors) } // NewApiKeySecurity creates an object of type ApiKeySecurity if possible, returning an error if not. func NewApiKeySecurity(in interface{}, context *compiler.Context) (*ApiKeySecurity, error) { errors := make([]error, 0) x := &ApiKeySecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"in", "name", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "in", "name", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [apiKey] if ok && !compiler.StringArrayContainsValue([]string{"apiKey"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string name = 2; v2 := compiler.MapValueForKey(m, "name") if v2 != nil { x.Name, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string in = 3; v3 := compiler.MapValueForKey(m, "in") if v3 != nil { x.In, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [header query] if ok && !compiler.StringArrayContainsValue([]string{"header", "query"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // string description = 4; v4 := compiler.MapValueForKey(m, "description") if v4 != nil { x.Description, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 5; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewBasicAuthenticationSecurity creates an object of type BasicAuthenticationSecurity if possible, returning an error if not. func NewBasicAuthenticationSecurity(in interface{}, context *compiler.Context) (*BasicAuthenticationSecurity, error) { errors := make([]error, 0) x := &BasicAuthenticationSecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [basic] if ok && !compiler.StringArrayContainsValue([]string{"basic"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string description = 2; v2 := compiler.MapValueForKey(m, "description") if v2 != nil { x.Description, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 3; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewBodyParameter creates an object of type BodyParameter if possible, returning an error if not. func NewBodyParameter(in interface{}, context *compiler.Context) (*BodyParameter, error) { errors := make([]error, 0) x := &BodyParameter{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"in", "name", "schema"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "in", "name", "required", "schema"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string description = 1; v1 := compiler.MapValueForKey(m, "description") if v1 != nil { x.Description, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string name = 2; v2 := compiler.MapValueForKey(m, "name") if v2 != nil { x.Name, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string in = 3; v3 := compiler.MapValueForKey(m, "in") if v3 != nil { x.In, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [body] if ok && !compiler.StringArrayContainsValue([]string{"body"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // bool required = 4; v4 := compiler.MapValueForKey(m, "required") if v4 != nil { x.Required, ok = v4.(bool) if !ok { message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // Schema schema = 5; v5 := compiler.MapValueForKey(m, "schema") if v5 != nil { var err error x.Schema, err = NewSchema(v5, compiler.NewContext("schema", context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewContact creates an object of type Contact if possible, returning an error if not. func NewContact(in interface{}, context *compiler.Context) (*Contact, error) { errors := make([]error, 0) x := &Contact{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"email", "name", "url"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string url = 2; v2 := compiler.MapValueForKey(m, "url") if v2 != nil { x.Url, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for url: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string email = 3; v3 := compiler.MapValueForKey(m, "email") if v3 != nil { x.Email, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for email: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 4; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewDefault creates an object of type Default if possible, returning an error if not. func NewDefault(in interface{}, context *compiler.Context) (*Default, error) { errors := make([]error, 0) x := &Default{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedAny additional_properties = 1; // MAP: Any x.AdditionalProperties = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewDefinitions creates an object of type Definitions if possible, returning an error if not. func NewDefinitions(in interface{}, context *compiler.Context) (*Definitions, error) { errors := make([]error, 0) x := &Definitions{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedSchema additional_properties = 1; // MAP: Schema x.AdditionalProperties = make([]*NamedSchema, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedSchema{} pair.Name = k var err error pair.Value, err = NewSchema(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewDocument creates an object of type Document if possible, returning an error if not. func NewDocument(in interface{}, context *compiler.Context) (*Document, error) { errors := make([]error, 0) x := &Document{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"info", "paths", "swagger"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"basePath", "consumes", "definitions", "externalDocs", "host", "info", "parameters", "paths", "produces", "responses", "schemes", "security", "securityDefinitions", "swagger", "tags"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string swagger = 1; v1 := compiler.MapValueForKey(m, "swagger") if v1 != nil { x.Swagger, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for swagger: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [2.0] if ok && !compiler.StringArrayContainsValue([]string{"2.0"}, x.Swagger) { message := fmt.Sprintf("has unexpected value for swagger: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // Info info = 2; v2 := compiler.MapValueForKey(m, "info") if v2 != nil { var err error x.Info, err = NewInfo(v2, compiler.NewContext("info", context)) if err != nil { errors = append(errors, err) } } // string host = 3; v3 := compiler.MapValueForKey(m, "host") if v3 != nil { x.Host, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for host: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // string base_path = 4; v4 := compiler.MapValueForKey(m, "basePath") if v4 != nil { x.BasePath, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for basePath: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // repeated string schemes = 5; v5 := compiler.MapValueForKey(m, "schemes") if v5 != nil { v, ok := v5.([]interface{}) if ok { x.Schemes = compiler.ConvertInterfaceArrayToStringArray(v) } else { message := fmt.Sprintf("has unexpected value for schemes: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [http https ws wss] if ok && !compiler.StringArrayContainsValues([]string{"http", "https", "ws", "wss"}, x.Schemes) { message := fmt.Sprintf("has unexpected value for schemes: %+v", v5) errors = append(errors, compiler.NewError(context, message)) } } // repeated string consumes = 6; v6 := compiler.MapValueForKey(m, "consumes") if v6 != nil { v, ok := v6.([]interface{}) if ok { x.Consumes = compiler.ConvertInterfaceArrayToStringArray(v) } else { message := fmt.Sprintf("has unexpected value for consumes: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // repeated string produces = 7; v7 := compiler.MapValueForKey(m, "produces") if v7 != nil { v, ok := v7.([]interface{}) if ok { x.Produces = compiler.ConvertInterfaceArrayToStringArray(v) } else { message := fmt.Sprintf("has unexpected value for produces: %+v (%T)", v7, v7) errors = append(errors, compiler.NewError(context, message)) } } // Paths paths = 8; v8 := compiler.MapValueForKey(m, "paths") if v8 != nil { var err error x.Paths, err = NewPaths(v8, compiler.NewContext("paths", context)) if err != nil { errors = append(errors, err) } } // Definitions definitions = 9; v9 := compiler.MapValueForKey(m, "definitions") if v9 != nil { var err error x.Definitions, err = NewDefinitions(v9, compiler.NewContext("definitions", context)) if err != nil { errors = append(errors, err) } } // ParameterDefinitions parameters = 10; v10 := compiler.MapValueForKey(m, "parameters") if v10 != nil { var err error x.Parameters, err = NewParameterDefinitions(v10, compiler.NewContext("parameters", context)) if err != nil { errors = append(errors, err) } } // ResponseDefinitions responses = 11; v11 := compiler.MapValueForKey(m, "responses") if v11 != nil { var err error x.Responses, err = NewResponseDefinitions(v11, compiler.NewContext("responses", context)) if err != nil { errors = append(errors, err) } } // repeated SecurityRequirement security = 12; v12 := compiler.MapValueForKey(m, "security") if v12 != nil { // repeated SecurityRequirement x.Security = make([]*SecurityRequirement, 0) a, ok := v12.([]interface{}) if ok { for _, item := range a { y, err := NewSecurityRequirement(item, compiler.NewContext("security", context)) if err != nil { errors = append(errors, err) } x.Security = append(x.Security, y) } } } // SecurityDefinitions security_definitions = 13; v13 := compiler.MapValueForKey(m, "securityDefinitions") if v13 != nil { var err error x.SecurityDefinitions, err = NewSecurityDefinitions(v13, compiler.NewContext("securityDefinitions", context)) if err != nil { errors = append(errors, err) } } // repeated Tag tags = 14; v14 := compiler.MapValueForKey(m, "tags") if v14 != nil { // repeated Tag x.Tags = make([]*Tag, 0) a, ok := v14.([]interface{}) if ok { for _, item := range a { y, err := NewTag(item, compiler.NewContext("tags", context)) if err != nil { errors = append(errors, err) } x.Tags = append(x.Tags, y) } } } // ExternalDocs external_docs = 15; v15 := compiler.MapValueForKey(m, "externalDocs") if v15 != nil { var err error x.ExternalDocs, err = NewExternalDocs(v15, compiler.NewContext("externalDocs", context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 16; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewExamples creates an object of type Examples if possible, returning an error if not. func NewExamples(in interface{}, context *compiler.Context) (*Examples, error) { errors := make([]error, 0) x := &Examples{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedAny additional_properties = 1; // MAP: Any x.AdditionalProperties = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewExternalDocs creates an object of type ExternalDocs if possible, returning an error if not. func NewExternalDocs(in interface{}, context *compiler.Context) (*ExternalDocs, error) { errors := make([]error, 0) x := &ExternalDocs{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"url"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "url"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string description = 1; v1 := compiler.MapValueForKey(m, "description") if v1 != nil { x.Description, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string url = 2; v2 := compiler.MapValueForKey(m, "url") if v2 != nil { x.Url, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for url: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 3; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewFileSchema creates an object of type FileSchema if possible, returning an error if not. func NewFileSchema(in interface{}, context *compiler.Context) (*FileSchema, error) { errors := make([]error, 0) x := &FileSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"default", "description", "example", "externalDocs", "format", "readOnly", "required", "title", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string format = 1; v1 := compiler.MapValueForKey(m, "format") if v1 != nil { x.Format, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string title = 2; v2 := compiler.MapValueForKey(m, "title") if v2 != nil { x.Title, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for title: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 4; v4 := compiler.MapValueForKey(m, "default") if v4 != nil { var err error x.Default, err = NewAny(v4, compiler.NewContext("default", context)) if err != nil { errors = append(errors, err) } } // repeated string required = 5; v5 := compiler.MapValueForKey(m, "required") if v5 != nil { v, ok := v5.([]interface{}) if ok { x.Required = compiler.ConvertInterfaceArrayToStringArray(v) } else { message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // string type = 6; v6 := compiler.MapValueForKey(m, "type") if v6 != nil { x.Type, ok = v6.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [file] if ok && !compiler.StringArrayContainsValue([]string{"file"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // bool read_only = 7; v7 := compiler.MapValueForKey(m, "readOnly") if v7 != nil { x.ReadOnly, ok = v7.(bool) if !ok { message := fmt.Sprintf("has unexpected value for readOnly: %+v (%T)", v7, v7) errors = append(errors, compiler.NewError(context, message)) } } // ExternalDocs external_docs = 8; v8 := compiler.MapValueForKey(m, "externalDocs") if v8 != nil { var err error x.ExternalDocs, err = NewExternalDocs(v8, compiler.NewContext("externalDocs", context)) if err != nil { errors = append(errors, err) } } // Any example = 9; v9 := compiler.MapValueForKey(m, "example") if v9 != nil { var err error x.Example, err = NewAny(v9, compiler.NewContext("example", context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 10; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewFormDataParameterSubSchema creates an object of type FormDataParameterSubSchema if possible, returning an error if not. func NewFormDataParameterSubSchema(in interface{}, context *compiler.Context) (*FormDataParameterSubSchema, error) { errors := make([]error, 0) x := &FormDataParameterSubSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"allowEmptyValue", "collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { x.Required, ok = v1.(bool) if !ok { message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { x.In, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [formData] if ok && !compiler.StringArrayContainsValue([]string{"formData"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { x.Name, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // bool allow_empty_value = 5; v5 := compiler.MapValueForKey(m, "allowEmptyValue") if v5 != nil { x.AllowEmptyValue, ok = v5.(bool) if !ok { message := fmt.Sprintf("has unexpected value for allowEmptyValue: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // string type = 6; v6 := compiler.MapValueForKey(m, "type") if v6 != nil { x.Type, ok = v6.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array file] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array", "file"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // string format = 7; v7 := compiler.MapValueForKey(m, "format") if v7 != nil { x.Format, ok = v7.(string) if !ok { message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v7, v7) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 8; v8 := compiler.MapValueForKey(m, "items") if v8 != nil { var err error x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", context)) if err != nil { errors = append(errors, err) } } // string collection_format = 9; v9 := compiler.MapValueForKey(m, "collectionFormat") if v9 != nil { x.CollectionFormat, ok = v9.(string) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v9, v9) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes multi] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes", "multi"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v9, v9) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 10; v10 := compiler.MapValueForKey(m, "default") if v10 != nil { var err error x.Default, err = NewAny(v10, compiler.NewContext("default", context)) if err != nil { errors = append(errors, err) } } // float maximum = 11; v11 := compiler.MapValueForKey(m, "maximum") if v11 != nil { switch v11 := v11.(type) { case float64: x.Maximum = v11 case float32: x.Maximum = float64(v11) case uint64: x.Maximum = float64(v11) case uint32: x.Maximum = float64(v11) case int64: x.Maximum = float64(v11) case int32: x.Maximum = float64(v11) case int: x.Maximum = float64(v11) default: message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v11, v11) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 12; v12 := compiler.MapValueForKey(m, "exclusiveMaximum") if v12 != nil { x.ExclusiveMaximum, ok = v12.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v12, v12) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 13; v13 := compiler.MapValueForKey(m, "minimum") if v13 != nil { switch v13 := v13.(type) { case float64: x.Minimum = v13 case float32: x.Minimum = float64(v13) case uint64: x.Minimum = float64(v13) case uint32: x.Minimum = float64(v13) case int64: x.Minimum = float64(v13) case int32: x.Minimum = float64(v13) case int: x.Minimum = float64(v13) default: message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v13, v13) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 14; v14 := compiler.MapValueForKey(m, "exclusiveMinimum") if v14 != nil { x.ExclusiveMinimum, ok = v14.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v14, v14) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 15; v15 := compiler.MapValueForKey(m, "maxLength") if v15 != nil { t, ok := v15.(int) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v15, v15) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 16; v16 := compiler.MapValueForKey(m, "minLength") if v16 != nil { t, ok := v16.(int) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v16, v16) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 17; v17 := compiler.MapValueForKey(m, "pattern") if v17 != nil { x.Pattern, ok = v17.(string) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v17, v17) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 18; v18 := compiler.MapValueForKey(m, "maxItems") if v18 != nil { t, ok := v18.(int) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v18, v18) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 19; v19 := compiler.MapValueForKey(m, "minItems") if v19 != nil { t, ok := v19.(int) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v19, v19) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 20; v20 := compiler.MapValueForKey(m, "uniqueItems") if v20 != nil { x.UniqueItems, ok = v20.(bool) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v20, v20) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 21; v21 := compiler.MapValueForKey(m, "enum") if v21 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := v21.([]interface{}) if ok { for _, item := range a { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 22; v22 := compiler.MapValueForKey(m, "multipleOf") if v22 != nil { switch v22 := v22.(type) { case float64: x.MultipleOf = v22 case float32: x.MultipleOf = float64(v22) case uint64: x.MultipleOf = float64(v22) case uint32: x.MultipleOf = float64(v22) case int64: x.MultipleOf = float64(v22) case int32: x.MultipleOf = float64(v22) case int: x.MultipleOf = float64(v22) default: message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v22, v22) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 23; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewHeader creates an object of type Header if possible, returning an error if not. func NewHeader(in interface{}, context *compiler.Context) (*Header, error) { errors := make([]error, 0) x := &Header{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "pattern", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number integer boolean array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "integer", "boolean", "array"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string format = 2; v2 := compiler.MapValueForKey(m, "format") if v2 != nil { x.Format, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 3; v3 := compiler.MapValueForKey(m, "items") if v3 != nil { var err error x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", context)) if err != nil { errors = append(errors, err) } } // string collection_format = 4; v4 := compiler.MapValueForKey(m, "collectionFormat") if v4 != nil { x.CollectionFormat, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 5; v5 := compiler.MapValueForKey(m, "default") if v5 != nil { var err error x.Default, err = NewAny(v5, compiler.NewContext("default", context)) if err != nil { errors = append(errors, err) } } // float maximum = 6; v6 := compiler.MapValueForKey(m, "maximum") if v6 != nil { switch v6 := v6.(type) { case float64: x.Maximum = v6 case float32: x.Maximum = float64(v6) case uint64: x.Maximum = float64(v6) case uint32: x.Maximum = float64(v6) case int64: x.Maximum = float64(v6) case int32: x.Maximum = float64(v6) case int: x.Maximum = float64(v6) default: message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 7; v7 := compiler.MapValueForKey(m, "exclusiveMaximum") if v7 != nil { x.ExclusiveMaximum, ok = v7.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v7, v7) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 8; v8 := compiler.MapValueForKey(m, "minimum") if v8 != nil { switch v8 := v8.(type) { case float64: x.Minimum = v8 case float32: x.Minimum = float64(v8) case uint64: x.Minimum = float64(v8) case uint32: x.Minimum = float64(v8) case int64: x.Minimum = float64(v8) case int32: x.Minimum = float64(v8) case int: x.Minimum = float64(v8) default: message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v8, v8) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 9; v9 := compiler.MapValueForKey(m, "exclusiveMinimum") if v9 != nil { x.ExclusiveMinimum, ok = v9.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v9, v9) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 10; v10 := compiler.MapValueForKey(m, "maxLength") if v10 != nil { t, ok := v10.(int) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v10, v10) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 11; v11 := compiler.MapValueForKey(m, "minLength") if v11 != nil { t, ok := v11.(int) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v11, v11) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 12; v12 := compiler.MapValueForKey(m, "pattern") if v12 != nil { x.Pattern, ok = v12.(string) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v12, v12) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 13; v13 := compiler.MapValueForKey(m, "maxItems") if v13 != nil { t, ok := v13.(int) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v13, v13) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 14; v14 := compiler.MapValueForKey(m, "minItems") if v14 != nil { t, ok := v14.(int) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v14, v14) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 15; v15 := compiler.MapValueForKey(m, "uniqueItems") if v15 != nil { x.UniqueItems, ok = v15.(bool) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v15, v15) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 16; v16 := compiler.MapValueForKey(m, "enum") if v16 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := v16.([]interface{}) if ok { for _, item := range a { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 17; v17 := compiler.MapValueForKey(m, "multipleOf") if v17 != nil { switch v17 := v17.(type) { case float64: x.MultipleOf = v17 case float32: x.MultipleOf = float64(v17) case uint64: x.MultipleOf = float64(v17) case uint32: x.MultipleOf = float64(v17) case int64: x.MultipleOf = float64(v17) case int32: x.MultipleOf = float64(v17) case int: x.MultipleOf = float64(v17) default: message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v17, v17) errors = append(errors, compiler.NewError(context, message)) } } // string description = 18; v18 := compiler.MapValueForKey(m, "description") if v18 != nil { x.Description, ok = v18.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v18, v18) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 19; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewHeaderParameterSubSchema creates an object of type HeaderParameterSubSchema if possible, returning an error if not. func NewHeaderParameterSubSchema(in interface{}, context *compiler.Context) (*HeaderParameterSubSchema, error) { errors := make([]error, 0) x := &HeaderParameterSubSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { x.Required, ok = v1.(bool) if !ok { message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { x.In, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [header] if ok && !compiler.StringArrayContainsValue([]string{"header"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { x.Name, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // string type = 5; v5 := compiler.MapValueForKey(m, "type") if v5 != nil { x.Type, ok = v5.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // string format = 6; v6 := compiler.MapValueForKey(m, "format") if v6 != nil { x.Format, ok = v6.(string) if !ok { message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 7; v7 := compiler.MapValueForKey(m, "items") if v7 != nil { var err error x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", context)) if err != nil { errors = append(errors, err) } } // string collection_format = 8; v8 := compiler.MapValueForKey(m, "collectionFormat") if v8 != nil { x.CollectionFormat, ok = v8.(string) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v8, v8) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v8, v8) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 9; v9 := compiler.MapValueForKey(m, "default") if v9 != nil { var err error x.Default, err = NewAny(v9, compiler.NewContext("default", context)) if err != nil { errors = append(errors, err) } } // float maximum = 10; v10 := compiler.MapValueForKey(m, "maximum") if v10 != nil { switch v10 := v10.(type) { case float64: x.Maximum = v10 case float32: x.Maximum = float64(v10) case uint64: x.Maximum = float64(v10) case uint32: x.Maximum = float64(v10) case int64: x.Maximum = float64(v10) case int32: x.Maximum = float64(v10) case int: x.Maximum = float64(v10) default: message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v10, v10) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 11; v11 := compiler.MapValueForKey(m, "exclusiveMaximum") if v11 != nil { x.ExclusiveMaximum, ok = v11.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v11, v11) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 12; v12 := compiler.MapValueForKey(m, "minimum") if v12 != nil { switch v12 := v12.(type) { case float64: x.Minimum = v12 case float32: x.Minimum = float64(v12) case uint64: x.Minimum = float64(v12) case uint32: x.Minimum = float64(v12) case int64: x.Minimum = float64(v12) case int32: x.Minimum = float64(v12) case int: x.Minimum = float64(v12) default: message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v12, v12) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 13; v13 := compiler.MapValueForKey(m, "exclusiveMinimum") if v13 != nil { x.ExclusiveMinimum, ok = v13.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v13, v13) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 14; v14 := compiler.MapValueForKey(m, "maxLength") if v14 != nil { t, ok := v14.(int) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v14, v14) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 15; v15 := compiler.MapValueForKey(m, "minLength") if v15 != nil { t, ok := v15.(int) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v15, v15) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 16; v16 := compiler.MapValueForKey(m, "pattern") if v16 != nil { x.Pattern, ok = v16.(string) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v16, v16) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 17; v17 := compiler.MapValueForKey(m, "maxItems") if v17 != nil { t, ok := v17.(int) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v17, v17) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 18; v18 := compiler.MapValueForKey(m, "minItems") if v18 != nil { t, ok := v18.(int) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v18, v18) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 19; v19 := compiler.MapValueForKey(m, "uniqueItems") if v19 != nil { x.UniqueItems, ok = v19.(bool) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v19, v19) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 20; v20 := compiler.MapValueForKey(m, "enum") if v20 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := v20.([]interface{}) if ok { for _, item := range a { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 21; v21 := compiler.MapValueForKey(m, "multipleOf") if v21 != nil { switch v21 := v21.(type) { case float64: x.MultipleOf = v21 case float32: x.MultipleOf = float64(v21) case uint64: x.MultipleOf = float64(v21) case uint32: x.MultipleOf = float64(v21) case int64: x.MultipleOf = float64(v21) case int32: x.MultipleOf = float64(v21) case int: x.MultipleOf = float64(v21) default: message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v21, v21) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 22; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewHeaders creates an object of type Headers if possible, returning an error if not. func NewHeaders(in interface{}, context *compiler.Context) (*Headers, error) { errors := make([]error, 0) x := &Headers{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedHeader additional_properties = 1; // MAP: Header x.AdditionalProperties = make([]*NamedHeader, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedHeader{} pair.Name = k var err error pair.Value, err = NewHeader(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewInfo creates an object of type Info if possible, returning an error if not. func NewInfo(in interface{}, context *compiler.Context) (*Info, error) { errors := make([]error, 0) x := &Info{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"title", "version"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"contact", "description", "license", "termsOfService", "title", "version"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string title = 1; v1 := compiler.MapValueForKey(m, "title") if v1 != nil { x.Title, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for title: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string version = 2; v2 := compiler.MapValueForKey(m, "version") if v2 != nil { x.Version, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for version: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // string terms_of_service = 4; v4 := compiler.MapValueForKey(m, "termsOfService") if v4 != nil { x.TermsOfService, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for termsOfService: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // Contact contact = 5; v5 := compiler.MapValueForKey(m, "contact") if v5 != nil { var err error x.Contact, err = NewContact(v5, compiler.NewContext("contact", context)) if err != nil { errors = append(errors, err) } } // License license = 6; v6 := compiler.MapValueForKey(m, "license") if v6 != nil { var err error x.License, err = NewLicense(v6, compiler.NewContext("license", context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 7; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewItemsItem creates an object of type ItemsItem if possible, returning an error if not. func NewItemsItem(in interface{}, context *compiler.Context) (*ItemsItem, error) { errors := make([]error, 0) x := &ItemsItem{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value for item array: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { x.Schema = make([]*Schema, 0) y, err := NewSchema(m, compiler.NewContext("", context)) if err != nil { return nil, err } x.Schema = append(x.Schema, y) } return x, compiler.NewErrorGroupOrNil(errors) } // NewJsonReference creates an object of type JsonReference if possible, returning an error if not. func NewJsonReference(in interface{}, context *compiler.Context) (*JsonReference, error) { errors := make([]error, 0) x := &JsonReference{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"$ref"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"$ref", "description"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string _ref = 1; v1 := compiler.MapValueForKey(m, "$ref") if v1 != nil { x.XRef, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for $ref: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string description = 2; v2 := compiler.MapValueForKey(m, "description") if v2 != nil { x.Description, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewLicense creates an object of type License if possible, returning an error if not. func NewLicense(in interface{}, context *compiler.Context) (*License, error) { errors := make([]error, 0) x := &License{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"name"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"name", "url"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string url = 2; v2 := compiler.MapValueForKey(m, "url") if v2 != nil { x.Url, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for url: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 3; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedAny creates an object of type NamedAny if possible, returning an error if not. func NewNamedAny(in interface{}, context *compiler.Context) (*NamedAny, error) { errors := make([]error, 0) x := &NamedAny{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // Any value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewAny(v2, compiler.NewContext("value", context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedHeader creates an object of type NamedHeader if possible, returning an error if not. func NewNamedHeader(in interface{}, context *compiler.Context) (*NamedHeader, error) { errors := make([]error, 0) x := &NamedHeader{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // Header value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewHeader(v2, compiler.NewContext("value", context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedParameter creates an object of type NamedParameter if possible, returning an error if not. func NewNamedParameter(in interface{}, context *compiler.Context) (*NamedParameter, error) { errors := make([]error, 0) x := &NamedParameter{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // Parameter value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewParameter(v2, compiler.NewContext("value", context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedPathItem creates an object of type NamedPathItem if possible, returning an error if not. func NewNamedPathItem(in interface{}, context *compiler.Context) (*NamedPathItem, error) { errors := make([]error, 0) x := &NamedPathItem{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // PathItem value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewPathItem(v2, compiler.NewContext("value", context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedResponse creates an object of type NamedResponse if possible, returning an error if not. func NewNamedResponse(in interface{}, context *compiler.Context) (*NamedResponse, error) { errors := make([]error, 0) x := &NamedResponse{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // Response value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewResponse(v2, compiler.NewContext("value", context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedResponseValue creates an object of type NamedResponseValue if possible, returning an error if not. func NewNamedResponseValue(in interface{}, context *compiler.Context) (*NamedResponseValue, error) { errors := make([]error, 0) x := &NamedResponseValue{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // ResponseValue value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewResponseValue(v2, compiler.NewContext("value", context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedSchema creates an object of type NamedSchema if possible, returning an error if not. func NewNamedSchema(in interface{}, context *compiler.Context) (*NamedSchema, error) { errors := make([]error, 0) x := &NamedSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // Schema value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewSchema(v2, compiler.NewContext("value", context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedSecurityDefinitionsItem creates an object of type NamedSecurityDefinitionsItem if possible, returning an error if not. func NewNamedSecurityDefinitionsItem(in interface{}, context *compiler.Context) (*NamedSecurityDefinitionsItem, error) { errors := make([]error, 0) x := &NamedSecurityDefinitionsItem{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // SecurityDefinitionsItem value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewSecurityDefinitionsItem(v2, compiler.NewContext("value", context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedString creates an object of type NamedString if possible, returning an error if not. func NewNamedString(in interface{}, context *compiler.Context) (*NamedString, error) { errors := make([]error, 0) x := &NamedString{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { x.Value, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for value: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNamedStringArray creates an object of type NamedStringArray if possible, returning an error if not. func NewNamedStringArray(in interface{}, context *compiler.Context) (*NamedStringArray, error) { errors := make([]error, 0) x := &NamedStringArray{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"name", "value"} var allowedPatterns []*regexp.Regexp invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // StringArray value = 2; v2 := compiler.MapValueForKey(m, "value") if v2 != nil { var err error x.Value, err = NewStringArray(v2, compiler.NewContext("value", context)) if err != nil { errors = append(errors, err) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewNonBodyParameter creates an object of type NonBodyParameter if possible, returning an error if not. func NewNonBodyParameter(in interface{}, context *compiler.Context) (*NonBodyParameter, error) { errors := make([]error, 0) x := &NonBodyParameter{} matched := false m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"in", "name", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // HeaderParameterSubSchema header_parameter_sub_schema = 1; { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewHeaderParameterSubSchema(m, compiler.NewContext("headerParameterSubSchema", context)) if matchingError == nil { x.Oneof = &NonBodyParameter_HeaderParameterSubSchema{HeaderParameterSubSchema: t} matched = true } else { errors = append(errors, matchingError) } } // FormDataParameterSubSchema form_data_parameter_sub_schema = 2; { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewFormDataParameterSubSchema(m, compiler.NewContext("formDataParameterSubSchema", context)) if matchingError == nil { x.Oneof = &NonBodyParameter_FormDataParameterSubSchema{FormDataParameterSubSchema: t} matched = true } else { errors = append(errors, matchingError) } } // QueryParameterSubSchema query_parameter_sub_schema = 3; { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewQueryParameterSubSchema(m, compiler.NewContext("queryParameterSubSchema", context)) if matchingError == nil { x.Oneof = &NonBodyParameter_QueryParameterSubSchema{QueryParameterSubSchema: t} matched = true } else { errors = append(errors, matchingError) } } // PathParameterSubSchema path_parameter_sub_schema = 4; { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewPathParameterSubSchema(m, compiler.NewContext("pathParameterSubSchema", context)) if matchingError == nil { x.Oneof = &NonBodyParameter_PathParameterSubSchema{PathParameterSubSchema: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } return x, compiler.NewErrorGroupOrNil(errors) } // NewOauth2AccessCodeSecurity creates an object of type Oauth2AccessCodeSecurity if possible, returning an error if not. func NewOauth2AccessCodeSecurity(in interface{}, context *compiler.Context) (*Oauth2AccessCodeSecurity, error) { errors := make([]error, 0) x := &Oauth2AccessCodeSecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"authorizationUrl", "flow", "tokenUrl", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"authorizationUrl", "description", "flow", "scopes", "tokenUrl", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { x.Flow, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [accessCode] if ok && !compiler.StringArrayContainsValue([]string{"accessCode"}, x.Flow) { message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // Oauth2Scopes scopes = 3; v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context)) if err != nil { errors = append(errors, err) } } // string authorization_url = 4; v4 := compiler.MapValueForKey(m, "authorizationUrl") if v4 != nil { x.AuthorizationUrl, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for authorizationUrl: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // string token_url = 5; v5 := compiler.MapValueForKey(m, "tokenUrl") if v5 != nil { x.TokenUrl, ok = v5.(string) if !ok { message := fmt.Sprintf("has unexpected value for tokenUrl: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // string description = 6; v6 := compiler.MapValueForKey(m, "description") if v6 != nil { x.Description, ok = v6.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 7; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewOauth2ApplicationSecurity creates an object of type Oauth2ApplicationSecurity if possible, returning an error if not. func NewOauth2ApplicationSecurity(in interface{}, context *compiler.Context) (*Oauth2ApplicationSecurity, error) { errors := make([]error, 0) x := &Oauth2ApplicationSecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"flow", "tokenUrl", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "flow", "scopes", "tokenUrl", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { x.Flow, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [application] if ok && !compiler.StringArrayContainsValue([]string{"application"}, x.Flow) { message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // Oauth2Scopes scopes = 3; v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context)) if err != nil { errors = append(errors, err) } } // string token_url = 4; v4 := compiler.MapValueForKey(m, "tokenUrl") if v4 != nil { x.TokenUrl, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for tokenUrl: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // string description = 5; v5 := compiler.MapValueForKey(m, "description") if v5 != nil { x.Description, ok = v5.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewOauth2ImplicitSecurity creates an object of type Oauth2ImplicitSecurity if possible, returning an error if not. func NewOauth2ImplicitSecurity(in interface{}, context *compiler.Context) (*Oauth2ImplicitSecurity, error) { errors := make([]error, 0) x := &Oauth2ImplicitSecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"authorizationUrl", "flow", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"authorizationUrl", "description", "flow", "scopes", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { x.Flow, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [implicit] if ok && !compiler.StringArrayContainsValue([]string{"implicit"}, x.Flow) { message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // Oauth2Scopes scopes = 3; v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context)) if err != nil { errors = append(errors, err) } } // string authorization_url = 4; v4 := compiler.MapValueForKey(m, "authorizationUrl") if v4 != nil { x.AuthorizationUrl, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for authorizationUrl: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // string description = 5; v5 := compiler.MapValueForKey(m, "description") if v5 != nil { x.Description, ok = v5.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewOauth2PasswordSecurity creates an object of type Oauth2PasswordSecurity if possible, returning an error if not. func NewOauth2PasswordSecurity(in interface{}, context *compiler.Context) (*Oauth2PasswordSecurity, error) { errors := make([]error, 0) x := &Oauth2PasswordSecurity{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"flow", "tokenUrl", "type"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "flow", "scopes", "tokenUrl", "type"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [oauth2] if ok && !compiler.StringArrayContainsValue([]string{"oauth2"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string flow = 2; v2 := compiler.MapValueForKey(m, "flow") if v2 != nil { x.Flow, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [password] if ok && !compiler.StringArrayContainsValue([]string{"password"}, x.Flow) { message := fmt.Sprintf("has unexpected value for flow: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // Oauth2Scopes scopes = 3; v3 := compiler.MapValueForKey(m, "scopes") if v3 != nil { var err error x.Scopes, err = NewOauth2Scopes(v3, compiler.NewContext("scopes", context)) if err != nil { errors = append(errors, err) } } // string token_url = 4; v4 := compiler.MapValueForKey(m, "tokenUrl") if v4 != nil { x.TokenUrl, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for tokenUrl: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // string description = 5; v5 := compiler.MapValueForKey(m, "description") if v5 != nil { x.Description, ok = v5.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewOauth2Scopes creates an object of type Oauth2Scopes if possible, returning an error if not. func NewOauth2Scopes(in interface{}, context *compiler.Context) (*Oauth2Scopes, error) { errors := make([]error, 0) x := &Oauth2Scopes{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedString additional_properties = 1; // MAP: string x.AdditionalProperties = make([]*NamedString, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedString{} pair.Name = k pair.Value = v.(string) x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewOperation creates an object of type Operation if possible, returning an error if not. func NewOperation(in interface{}, context *compiler.Context) (*Operation, error) { errors := make([]error, 0) x := &Operation{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"responses"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"consumes", "deprecated", "description", "externalDocs", "operationId", "parameters", "produces", "responses", "schemes", "security", "summary", "tags"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // repeated string tags = 1; v1 := compiler.MapValueForKey(m, "tags") if v1 != nil { v, ok := v1.([]interface{}) if ok { x.Tags = compiler.ConvertInterfaceArrayToStringArray(v) } else { message := fmt.Sprintf("has unexpected value for tags: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string summary = 2; v2 := compiler.MapValueForKey(m, "summary") if v2 != nil { x.Summary, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for summary: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // ExternalDocs external_docs = 4; v4 := compiler.MapValueForKey(m, "externalDocs") if v4 != nil { var err error x.ExternalDocs, err = NewExternalDocs(v4, compiler.NewContext("externalDocs", context)) if err != nil { errors = append(errors, err) } } // string operation_id = 5; v5 := compiler.MapValueForKey(m, "operationId") if v5 != nil { x.OperationId, ok = v5.(string) if !ok { message := fmt.Sprintf("has unexpected value for operationId: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // repeated string produces = 6; v6 := compiler.MapValueForKey(m, "produces") if v6 != nil { v, ok := v6.([]interface{}) if ok { x.Produces = compiler.ConvertInterfaceArrayToStringArray(v) } else { message := fmt.Sprintf("has unexpected value for produces: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // repeated string consumes = 7; v7 := compiler.MapValueForKey(m, "consumes") if v7 != nil { v, ok := v7.([]interface{}) if ok { x.Consumes = compiler.ConvertInterfaceArrayToStringArray(v) } else { message := fmt.Sprintf("has unexpected value for consumes: %+v (%T)", v7, v7) errors = append(errors, compiler.NewError(context, message)) } } // repeated ParametersItem parameters = 8; v8 := compiler.MapValueForKey(m, "parameters") if v8 != nil { // repeated ParametersItem x.Parameters = make([]*ParametersItem, 0) a, ok := v8.([]interface{}) if ok { for _, item := range a { y, err := NewParametersItem(item, compiler.NewContext("parameters", context)) if err != nil { errors = append(errors, err) } x.Parameters = append(x.Parameters, y) } } } // Responses responses = 9; v9 := compiler.MapValueForKey(m, "responses") if v9 != nil { var err error x.Responses, err = NewResponses(v9, compiler.NewContext("responses", context)) if err != nil { errors = append(errors, err) } } // repeated string schemes = 10; v10 := compiler.MapValueForKey(m, "schemes") if v10 != nil { v, ok := v10.([]interface{}) if ok { x.Schemes = compiler.ConvertInterfaceArrayToStringArray(v) } else { message := fmt.Sprintf("has unexpected value for schemes: %+v (%T)", v10, v10) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [http https ws wss] if ok && !compiler.StringArrayContainsValues([]string{"http", "https", "ws", "wss"}, x.Schemes) { message := fmt.Sprintf("has unexpected value for schemes: %+v", v10) errors = append(errors, compiler.NewError(context, message)) } } // bool deprecated = 11; v11 := compiler.MapValueForKey(m, "deprecated") if v11 != nil { x.Deprecated, ok = v11.(bool) if !ok { message := fmt.Sprintf("has unexpected value for deprecated: %+v (%T)", v11, v11) errors = append(errors, compiler.NewError(context, message)) } } // repeated SecurityRequirement security = 12; v12 := compiler.MapValueForKey(m, "security") if v12 != nil { // repeated SecurityRequirement x.Security = make([]*SecurityRequirement, 0) a, ok := v12.([]interface{}) if ok { for _, item := range a { y, err := NewSecurityRequirement(item, compiler.NewContext("security", context)) if err != nil { errors = append(errors, err) } x.Security = append(x.Security, y) } } } // repeated NamedAny vendor_extension = 13; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewParameter creates an object of type Parameter if possible, returning an error if not. func NewParameter(in interface{}, context *compiler.Context) (*Parameter, error) { errors := make([]error, 0) x := &Parameter{} matched := false // BodyParameter body_parameter = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewBodyParameter(m, compiler.NewContext("bodyParameter", context)) if matchingError == nil { x.Oneof = &Parameter_BodyParameter{BodyParameter: t} matched = true } else { errors = append(errors, matchingError) } } } // NonBodyParameter non_body_parameter = 2; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewNonBodyParameter(m, compiler.NewContext("nonBodyParameter", context)) if matchingError == nil { x.Oneof = &Parameter_NonBodyParameter{NonBodyParameter: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } return x, compiler.NewErrorGroupOrNil(errors) } // NewParameterDefinitions creates an object of type ParameterDefinitions if possible, returning an error if not. func NewParameterDefinitions(in interface{}, context *compiler.Context) (*ParameterDefinitions, error) { errors := make([]error, 0) x := &ParameterDefinitions{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedParameter additional_properties = 1; // MAP: Parameter x.AdditionalProperties = make([]*NamedParameter, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedParameter{} pair.Name = k var err error pair.Value, err = NewParameter(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewParametersItem creates an object of type ParametersItem if possible, returning an error if not. func NewParametersItem(in interface{}, context *compiler.Context) (*ParametersItem, error) { errors := make([]error, 0) x := &ParametersItem{} matched := false // Parameter parameter = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewParameter(m, compiler.NewContext("parameter", context)) if matchingError == nil { x.Oneof = &ParametersItem_Parameter{Parameter: t} matched = true } else { errors = append(errors, matchingError) } } } // JsonReference json_reference = 2; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", context)) if matchingError == nil { x.Oneof = &ParametersItem_JsonReference{JsonReference: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } return x, compiler.NewErrorGroupOrNil(errors) } // NewPathItem creates an object of type PathItem if possible, returning an error if not. func NewPathItem(in interface{}, context *compiler.Context) (*PathItem, error) { errors := make([]error, 0) x := &PathItem{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"$ref", "delete", "get", "head", "options", "parameters", "patch", "post", "put"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string _ref = 1; v1 := compiler.MapValueForKey(m, "$ref") if v1 != nil { x.XRef, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for $ref: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // Operation get = 2; v2 := compiler.MapValueForKey(m, "get") if v2 != nil { var err error x.Get, err = NewOperation(v2, compiler.NewContext("get", context)) if err != nil { errors = append(errors, err) } } // Operation put = 3; v3 := compiler.MapValueForKey(m, "put") if v3 != nil { var err error x.Put, err = NewOperation(v3, compiler.NewContext("put", context)) if err != nil { errors = append(errors, err) } } // Operation post = 4; v4 := compiler.MapValueForKey(m, "post") if v4 != nil { var err error x.Post, err = NewOperation(v4, compiler.NewContext("post", context)) if err != nil { errors = append(errors, err) } } // Operation delete = 5; v5 := compiler.MapValueForKey(m, "delete") if v5 != nil { var err error x.Delete, err = NewOperation(v5, compiler.NewContext("delete", context)) if err != nil { errors = append(errors, err) } } // Operation options = 6; v6 := compiler.MapValueForKey(m, "options") if v6 != nil { var err error x.Options, err = NewOperation(v6, compiler.NewContext("options", context)) if err != nil { errors = append(errors, err) } } // Operation head = 7; v7 := compiler.MapValueForKey(m, "head") if v7 != nil { var err error x.Head, err = NewOperation(v7, compiler.NewContext("head", context)) if err != nil { errors = append(errors, err) } } // Operation patch = 8; v8 := compiler.MapValueForKey(m, "patch") if v8 != nil { var err error x.Patch, err = NewOperation(v8, compiler.NewContext("patch", context)) if err != nil { errors = append(errors, err) } } // repeated ParametersItem parameters = 9; v9 := compiler.MapValueForKey(m, "parameters") if v9 != nil { // repeated ParametersItem x.Parameters = make([]*ParametersItem, 0) a, ok := v9.([]interface{}) if ok { for _, item := range a { y, err := NewParametersItem(item, compiler.NewContext("parameters", context)) if err != nil { errors = append(errors, err) } x.Parameters = append(x.Parameters, y) } } } // repeated NamedAny vendor_extension = 10; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewPathParameterSubSchema creates an object of type PathParameterSubSchema if possible, returning an error if not. func NewPathParameterSubSchema(in interface{}, context *compiler.Context) (*PathParameterSubSchema, error) { errors := make([]error, 0) x := &PathParameterSubSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"required"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { x.Required, ok = v1.(bool) if !ok { message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { x.In, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [path] if ok && !compiler.StringArrayContainsValue([]string{"path"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { x.Name, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // string type = 5; v5 := compiler.MapValueForKey(m, "type") if v5 != nil { x.Type, ok = v5.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // string format = 6; v6 := compiler.MapValueForKey(m, "format") if v6 != nil { x.Format, ok = v6.(string) if !ok { message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 7; v7 := compiler.MapValueForKey(m, "items") if v7 != nil { var err error x.Items, err = NewPrimitivesItems(v7, compiler.NewContext("items", context)) if err != nil { errors = append(errors, err) } } // string collection_format = 8; v8 := compiler.MapValueForKey(m, "collectionFormat") if v8 != nil { x.CollectionFormat, ok = v8.(string) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v8, v8) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v8, v8) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 9; v9 := compiler.MapValueForKey(m, "default") if v9 != nil { var err error x.Default, err = NewAny(v9, compiler.NewContext("default", context)) if err != nil { errors = append(errors, err) } } // float maximum = 10; v10 := compiler.MapValueForKey(m, "maximum") if v10 != nil { switch v10 := v10.(type) { case float64: x.Maximum = v10 case float32: x.Maximum = float64(v10) case uint64: x.Maximum = float64(v10) case uint32: x.Maximum = float64(v10) case int64: x.Maximum = float64(v10) case int32: x.Maximum = float64(v10) case int: x.Maximum = float64(v10) default: message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v10, v10) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 11; v11 := compiler.MapValueForKey(m, "exclusiveMaximum") if v11 != nil { x.ExclusiveMaximum, ok = v11.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v11, v11) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 12; v12 := compiler.MapValueForKey(m, "minimum") if v12 != nil { switch v12 := v12.(type) { case float64: x.Minimum = v12 case float32: x.Minimum = float64(v12) case uint64: x.Minimum = float64(v12) case uint32: x.Minimum = float64(v12) case int64: x.Minimum = float64(v12) case int32: x.Minimum = float64(v12) case int: x.Minimum = float64(v12) default: message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v12, v12) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 13; v13 := compiler.MapValueForKey(m, "exclusiveMinimum") if v13 != nil { x.ExclusiveMinimum, ok = v13.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v13, v13) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 14; v14 := compiler.MapValueForKey(m, "maxLength") if v14 != nil { t, ok := v14.(int) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v14, v14) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 15; v15 := compiler.MapValueForKey(m, "minLength") if v15 != nil { t, ok := v15.(int) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v15, v15) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 16; v16 := compiler.MapValueForKey(m, "pattern") if v16 != nil { x.Pattern, ok = v16.(string) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v16, v16) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 17; v17 := compiler.MapValueForKey(m, "maxItems") if v17 != nil { t, ok := v17.(int) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v17, v17) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 18; v18 := compiler.MapValueForKey(m, "minItems") if v18 != nil { t, ok := v18.(int) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v18, v18) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 19; v19 := compiler.MapValueForKey(m, "uniqueItems") if v19 != nil { x.UniqueItems, ok = v19.(bool) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v19, v19) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 20; v20 := compiler.MapValueForKey(m, "enum") if v20 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := v20.([]interface{}) if ok { for _, item := range a { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 21; v21 := compiler.MapValueForKey(m, "multipleOf") if v21 != nil { switch v21 := v21.(type) { case float64: x.MultipleOf = v21 case float32: x.MultipleOf = float64(v21) case uint64: x.MultipleOf = float64(v21) case uint32: x.MultipleOf = float64(v21) case int64: x.MultipleOf = float64(v21) case int32: x.MultipleOf = float64(v21) case int: x.MultipleOf = float64(v21) default: message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v21, v21) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 22; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewPaths creates an object of type Paths if possible, returning an error if not. func NewPaths(in interface{}, context *compiler.Context) (*Paths, error) { errors := make([]error, 0) x := &Paths{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{} allowedPatterns := []*regexp.Regexp{pattern0, pattern1} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // repeated NamedAny vendor_extension = 1; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } // repeated NamedPathItem path = 2; // MAP: PathItem ^/ x.Path = make([]*NamedPathItem, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "/") { pair := &NamedPathItem{} pair.Name = k var err error pair.Value, err = NewPathItem(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } x.Path = append(x.Path, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewPrimitivesItems creates an object of type PrimitivesItems if possible, returning an error if not. func NewPrimitivesItems(in interface{}, context *compiler.Context) (*PrimitivesItems, error) { errors := make([]error, 0) x := &PrimitivesItems{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"collectionFormat", "default", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "pattern", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string type = 1; v1 := compiler.MapValueForKey(m, "type") if v1 != nil { x.Type, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number integer boolean array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "integer", "boolean", "array"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string format = 2; v2 := compiler.MapValueForKey(m, "format") if v2 != nil { x.Format, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 3; v3 := compiler.MapValueForKey(m, "items") if v3 != nil { var err error x.Items, err = NewPrimitivesItems(v3, compiler.NewContext("items", context)) if err != nil { errors = append(errors, err) } } // string collection_format = 4; v4 := compiler.MapValueForKey(m, "collectionFormat") if v4 != nil { x.CollectionFormat, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 5; v5 := compiler.MapValueForKey(m, "default") if v5 != nil { var err error x.Default, err = NewAny(v5, compiler.NewContext("default", context)) if err != nil { errors = append(errors, err) } } // float maximum = 6; v6 := compiler.MapValueForKey(m, "maximum") if v6 != nil { switch v6 := v6.(type) { case float64: x.Maximum = v6 case float32: x.Maximum = float64(v6) case uint64: x.Maximum = float64(v6) case uint32: x.Maximum = float64(v6) case int64: x.Maximum = float64(v6) case int32: x.Maximum = float64(v6) case int: x.Maximum = float64(v6) default: message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 7; v7 := compiler.MapValueForKey(m, "exclusiveMaximum") if v7 != nil { x.ExclusiveMaximum, ok = v7.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v7, v7) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 8; v8 := compiler.MapValueForKey(m, "minimum") if v8 != nil { switch v8 := v8.(type) { case float64: x.Minimum = v8 case float32: x.Minimum = float64(v8) case uint64: x.Minimum = float64(v8) case uint32: x.Minimum = float64(v8) case int64: x.Minimum = float64(v8) case int32: x.Minimum = float64(v8) case int: x.Minimum = float64(v8) default: message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v8, v8) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 9; v9 := compiler.MapValueForKey(m, "exclusiveMinimum") if v9 != nil { x.ExclusiveMinimum, ok = v9.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v9, v9) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 10; v10 := compiler.MapValueForKey(m, "maxLength") if v10 != nil { t, ok := v10.(int) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v10, v10) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 11; v11 := compiler.MapValueForKey(m, "minLength") if v11 != nil { t, ok := v11.(int) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v11, v11) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 12; v12 := compiler.MapValueForKey(m, "pattern") if v12 != nil { x.Pattern, ok = v12.(string) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v12, v12) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 13; v13 := compiler.MapValueForKey(m, "maxItems") if v13 != nil { t, ok := v13.(int) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v13, v13) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 14; v14 := compiler.MapValueForKey(m, "minItems") if v14 != nil { t, ok := v14.(int) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v14, v14) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 15; v15 := compiler.MapValueForKey(m, "uniqueItems") if v15 != nil { x.UniqueItems, ok = v15.(bool) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v15, v15) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 16; v16 := compiler.MapValueForKey(m, "enum") if v16 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := v16.([]interface{}) if ok { for _, item := range a { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 17; v17 := compiler.MapValueForKey(m, "multipleOf") if v17 != nil { switch v17 := v17.(type) { case float64: x.MultipleOf = v17 case float32: x.MultipleOf = float64(v17) case uint64: x.MultipleOf = float64(v17) case uint32: x.MultipleOf = float64(v17) case int64: x.MultipleOf = float64(v17) case int32: x.MultipleOf = float64(v17) case int: x.MultipleOf = float64(v17) default: message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v17, v17) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 18; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewProperties creates an object of type Properties if possible, returning an error if not. func NewProperties(in interface{}, context *compiler.Context) (*Properties, error) { errors := make([]error, 0) x := &Properties{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedSchema additional_properties = 1; // MAP: Schema x.AdditionalProperties = make([]*NamedSchema, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedSchema{} pair.Name = k var err error pair.Value, err = NewSchema(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewQueryParameterSubSchema creates an object of type QueryParameterSubSchema if possible, returning an error if not. func NewQueryParameterSubSchema(in interface{}, context *compiler.Context) (*QueryParameterSubSchema, error) { errors := make([]error, 0) x := &QueryParameterSubSchema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"allowEmptyValue", "collectionFormat", "default", "description", "enum", "exclusiveMaximum", "exclusiveMinimum", "format", "in", "items", "maxItems", "maxLength", "maximum", "minItems", "minLength", "minimum", "multipleOf", "name", "pattern", "required", "type", "uniqueItems"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // bool required = 1; v1 := compiler.MapValueForKey(m, "required") if v1 != nil { x.Required, ok = v1.(bool) if !ok { message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string in = 2; v2 := compiler.MapValueForKey(m, "in") if v2 != nil { x.In, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [query] if ok && !compiler.StringArrayContainsValue([]string{"query"}, x.In) { message := fmt.Sprintf("has unexpected value for in: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string description = 3; v3 := compiler.MapValueForKey(m, "description") if v3 != nil { x.Description, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // string name = 4; v4 := compiler.MapValueForKey(m, "name") if v4 != nil { x.Name, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // bool allow_empty_value = 5; v5 := compiler.MapValueForKey(m, "allowEmptyValue") if v5 != nil { x.AllowEmptyValue, ok = v5.(bool) if !ok { message := fmt.Sprintf("has unexpected value for allowEmptyValue: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // string type = 6; v6 := compiler.MapValueForKey(m, "type") if v6 != nil { x.Type, ok = v6.(string) if !ok { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [string number boolean integer array] if ok && !compiler.StringArrayContainsValue([]string{"string", "number", "boolean", "integer", "array"}, x.Type) { message := fmt.Sprintf("has unexpected value for type: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // string format = 7; v7 := compiler.MapValueForKey(m, "format") if v7 != nil { x.Format, ok = v7.(string) if !ok { message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v7, v7) errors = append(errors, compiler.NewError(context, message)) } } // PrimitivesItems items = 8; v8 := compiler.MapValueForKey(m, "items") if v8 != nil { var err error x.Items, err = NewPrimitivesItems(v8, compiler.NewContext("items", context)) if err != nil { errors = append(errors, err) } } // string collection_format = 9; v9 := compiler.MapValueForKey(m, "collectionFormat") if v9 != nil { x.CollectionFormat, ok = v9.(string) if !ok { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v9, v9) errors = append(errors, compiler.NewError(context, message)) } // check for valid enum values // [csv ssv tsv pipes multi] if ok && !compiler.StringArrayContainsValue([]string{"csv", "ssv", "tsv", "pipes", "multi"}, x.CollectionFormat) { message := fmt.Sprintf("has unexpected value for collectionFormat: %+v (%T)", v9, v9) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 10; v10 := compiler.MapValueForKey(m, "default") if v10 != nil { var err error x.Default, err = NewAny(v10, compiler.NewContext("default", context)) if err != nil { errors = append(errors, err) } } // float maximum = 11; v11 := compiler.MapValueForKey(m, "maximum") if v11 != nil { switch v11 := v11.(type) { case float64: x.Maximum = v11 case float32: x.Maximum = float64(v11) case uint64: x.Maximum = float64(v11) case uint32: x.Maximum = float64(v11) case int64: x.Maximum = float64(v11) case int32: x.Maximum = float64(v11) case int: x.Maximum = float64(v11) default: message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v11, v11) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 12; v12 := compiler.MapValueForKey(m, "exclusiveMaximum") if v12 != nil { x.ExclusiveMaximum, ok = v12.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v12, v12) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 13; v13 := compiler.MapValueForKey(m, "minimum") if v13 != nil { switch v13 := v13.(type) { case float64: x.Minimum = v13 case float32: x.Minimum = float64(v13) case uint64: x.Minimum = float64(v13) case uint32: x.Minimum = float64(v13) case int64: x.Minimum = float64(v13) case int32: x.Minimum = float64(v13) case int: x.Minimum = float64(v13) default: message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v13, v13) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 14; v14 := compiler.MapValueForKey(m, "exclusiveMinimum") if v14 != nil { x.ExclusiveMinimum, ok = v14.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v14, v14) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 15; v15 := compiler.MapValueForKey(m, "maxLength") if v15 != nil { t, ok := v15.(int) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v15, v15) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 16; v16 := compiler.MapValueForKey(m, "minLength") if v16 != nil { t, ok := v16.(int) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v16, v16) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 17; v17 := compiler.MapValueForKey(m, "pattern") if v17 != nil { x.Pattern, ok = v17.(string) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v17, v17) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 18; v18 := compiler.MapValueForKey(m, "maxItems") if v18 != nil { t, ok := v18.(int) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v18, v18) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 19; v19 := compiler.MapValueForKey(m, "minItems") if v19 != nil { t, ok := v19.(int) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v19, v19) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 20; v20 := compiler.MapValueForKey(m, "uniqueItems") if v20 != nil { x.UniqueItems, ok = v20.(bool) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v20, v20) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 21; v21 := compiler.MapValueForKey(m, "enum") if v21 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := v21.([]interface{}) if ok { for _, item := range a { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // float multiple_of = 22; v22 := compiler.MapValueForKey(m, "multipleOf") if v22 != nil { switch v22 := v22.(type) { case float64: x.MultipleOf = v22 case float32: x.MultipleOf = float64(v22) case uint64: x.MultipleOf = float64(v22) case uint32: x.MultipleOf = float64(v22) case int64: x.MultipleOf = float64(v22) case int32: x.MultipleOf = float64(v22) case int: x.MultipleOf = float64(v22) default: message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v22, v22) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 23; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewResponse creates an object of type Response if possible, returning an error if not. func NewResponse(in interface{}, context *compiler.Context) (*Response, error) { errors := make([]error, 0) x := &Response{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"description"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "examples", "headers", "schema"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string description = 1; v1 := compiler.MapValueForKey(m, "description") if v1 != nil { x.Description, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // SchemaItem schema = 2; v2 := compiler.MapValueForKey(m, "schema") if v2 != nil { var err error x.Schema, err = NewSchemaItem(v2, compiler.NewContext("schema", context)) if err != nil { errors = append(errors, err) } } // Headers headers = 3; v3 := compiler.MapValueForKey(m, "headers") if v3 != nil { var err error x.Headers, err = NewHeaders(v3, compiler.NewContext("headers", context)) if err != nil { errors = append(errors, err) } } // Examples examples = 4; v4 := compiler.MapValueForKey(m, "examples") if v4 != nil { var err error x.Examples, err = NewExamples(v4, compiler.NewContext("examples", context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 5; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewResponseDefinitions creates an object of type ResponseDefinitions if possible, returning an error if not. func NewResponseDefinitions(in interface{}, context *compiler.Context) (*ResponseDefinitions, error) { errors := make([]error, 0) x := &ResponseDefinitions{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedResponse additional_properties = 1; // MAP: Response x.AdditionalProperties = make([]*NamedResponse, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedResponse{} pair.Name = k var err error pair.Value, err = NewResponse(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewResponseValue creates an object of type ResponseValue if possible, returning an error if not. func NewResponseValue(in interface{}, context *compiler.Context) (*ResponseValue, error) { errors := make([]error, 0) x := &ResponseValue{} matched := false // Response response = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewResponse(m, compiler.NewContext("response", context)) if matchingError == nil { x.Oneof = &ResponseValue_Response{Response: t} matched = true } else { errors = append(errors, matchingError) } } } // JsonReference json_reference = 2; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewJsonReference(m, compiler.NewContext("jsonReference", context)) if matchingError == nil { x.Oneof = &ResponseValue_JsonReference{JsonReference: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } return x, compiler.NewErrorGroupOrNil(errors) } // NewResponses creates an object of type Responses if possible, returning an error if not. func NewResponses(in interface{}, context *compiler.Context) (*Responses, error) { errors := make([]error, 0) x := &Responses{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{} allowedPatterns := []*regexp.Regexp{pattern2, pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // repeated NamedResponseValue response_code = 1; // MAP: ResponseValue ^([0-9]{3})$|^(default)$ x.ResponseCode = make([]*NamedResponseValue, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if pattern2.MatchString(k) { pair := &NamedResponseValue{} pair.Name = k var err error pair.Value, err = NewResponseValue(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } x.ResponseCode = append(x.ResponseCode, pair) } } } // repeated NamedAny vendor_extension = 2; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewSchema creates an object of type Schema if possible, returning an error if not. func NewSchema(in interface{}, context *compiler.Context) (*Schema, error) { errors := make([]error, 0) x := &Schema{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"$ref", "additionalProperties", "allOf", "default", "description", "discriminator", "enum", "example", "exclusiveMaximum", "exclusiveMinimum", "externalDocs", "format", "items", "maxItems", "maxLength", "maxProperties", "maximum", "minItems", "minLength", "minProperties", "minimum", "multipleOf", "pattern", "properties", "readOnly", "required", "title", "type", "uniqueItems", "xml"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string _ref = 1; v1 := compiler.MapValueForKey(m, "$ref") if v1 != nil { x.XRef, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for $ref: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string format = 2; v2 := compiler.MapValueForKey(m, "format") if v2 != nil { x.Format, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for format: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string title = 3; v3 := compiler.MapValueForKey(m, "title") if v3 != nil { x.Title, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for title: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // string description = 4; v4 := compiler.MapValueForKey(m, "description") if v4 != nil { x.Description, ok = v4.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // Any default = 5; v5 := compiler.MapValueForKey(m, "default") if v5 != nil { var err error x.Default, err = NewAny(v5, compiler.NewContext("default", context)) if err != nil { errors = append(errors, err) } } // float multiple_of = 6; v6 := compiler.MapValueForKey(m, "multipleOf") if v6 != nil { switch v6 := v6.(type) { case float64: x.MultipleOf = v6 case float32: x.MultipleOf = float64(v6) case uint64: x.MultipleOf = float64(v6) case uint32: x.MultipleOf = float64(v6) case int64: x.MultipleOf = float64(v6) case int32: x.MultipleOf = float64(v6) case int: x.MultipleOf = float64(v6) default: message := fmt.Sprintf("has unexpected value for multipleOf: %+v (%T)", v6, v6) errors = append(errors, compiler.NewError(context, message)) } } // float maximum = 7; v7 := compiler.MapValueForKey(m, "maximum") if v7 != nil { switch v7 := v7.(type) { case float64: x.Maximum = v7 case float32: x.Maximum = float64(v7) case uint64: x.Maximum = float64(v7) case uint32: x.Maximum = float64(v7) case int64: x.Maximum = float64(v7) case int32: x.Maximum = float64(v7) case int: x.Maximum = float64(v7) default: message := fmt.Sprintf("has unexpected value for maximum: %+v (%T)", v7, v7) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_maximum = 8; v8 := compiler.MapValueForKey(m, "exclusiveMaximum") if v8 != nil { x.ExclusiveMaximum, ok = v8.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMaximum: %+v (%T)", v8, v8) errors = append(errors, compiler.NewError(context, message)) } } // float minimum = 9; v9 := compiler.MapValueForKey(m, "minimum") if v9 != nil { switch v9 := v9.(type) { case float64: x.Minimum = v9 case float32: x.Minimum = float64(v9) case uint64: x.Minimum = float64(v9) case uint32: x.Minimum = float64(v9) case int64: x.Minimum = float64(v9) case int32: x.Minimum = float64(v9) case int: x.Minimum = float64(v9) default: message := fmt.Sprintf("has unexpected value for minimum: %+v (%T)", v9, v9) errors = append(errors, compiler.NewError(context, message)) } } // bool exclusive_minimum = 10; v10 := compiler.MapValueForKey(m, "exclusiveMinimum") if v10 != nil { x.ExclusiveMinimum, ok = v10.(bool) if !ok { message := fmt.Sprintf("has unexpected value for exclusiveMinimum: %+v (%T)", v10, v10) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_length = 11; v11 := compiler.MapValueForKey(m, "maxLength") if v11 != nil { t, ok := v11.(int) if ok { x.MaxLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxLength: %+v (%T)", v11, v11) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_length = 12; v12 := compiler.MapValueForKey(m, "minLength") if v12 != nil { t, ok := v12.(int) if ok { x.MinLength = int64(t) } else { message := fmt.Sprintf("has unexpected value for minLength: %+v (%T)", v12, v12) errors = append(errors, compiler.NewError(context, message)) } } // string pattern = 13; v13 := compiler.MapValueForKey(m, "pattern") if v13 != nil { x.Pattern, ok = v13.(string) if !ok { message := fmt.Sprintf("has unexpected value for pattern: %+v (%T)", v13, v13) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_items = 14; v14 := compiler.MapValueForKey(m, "maxItems") if v14 != nil { t, ok := v14.(int) if ok { x.MaxItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxItems: %+v (%T)", v14, v14) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_items = 15; v15 := compiler.MapValueForKey(m, "minItems") if v15 != nil { t, ok := v15.(int) if ok { x.MinItems = int64(t) } else { message := fmt.Sprintf("has unexpected value for minItems: %+v (%T)", v15, v15) errors = append(errors, compiler.NewError(context, message)) } } // bool unique_items = 16; v16 := compiler.MapValueForKey(m, "uniqueItems") if v16 != nil { x.UniqueItems, ok = v16.(bool) if !ok { message := fmt.Sprintf("has unexpected value for uniqueItems: %+v (%T)", v16, v16) errors = append(errors, compiler.NewError(context, message)) } } // int64 max_properties = 17; v17 := compiler.MapValueForKey(m, "maxProperties") if v17 != nil { t, ok := v17.(int) if ok { x.MaxProperties = int64(t) } else { message := fmt.Sprintf("has unexpected value for maxProperties: %+v (%T)", v17, v17) errors = append(errors, compiler.NewError(context, message)) } } // int64 min_properties = 18; v18 := compiler.MapValueForKey(m, "minProperties") if v18 != nil { t, ok := v18.(int) if ok { x.MinProperties = int64(t) } else { message := fmt.Sprintf("has unexpected value for minProperties: %+v (%T)", v18, v18) errors = append(errors, compiler.NewError(context, message)) } } // repeated string required = 19; v19 := compiler.MapValueForKey(m, "required") if v19 != nil { v, ok := v19.([]interface{}) if ok { x.Required = compiler.ConvertInterfaceArrayToStringArray(v) } else { message := fmt.Sprintf("has unexpected value for required: %+v (%T)", v19, v19) errors = append(errors, compiler.NewError(context, message)) } } // repeated Any enum = 20; v20 := compiler.MapValueForKey(m, "enum") if v20 != nil { // repeated Any x.Enum = make([]*Any, 0) a, ok := v20.([]interface{}) if ok { for _, item := range a { y, err := NewAny(item, compiler.NewContext("enum", context)) if err != nil { errors = append(errors, err) } x.Enum = append(x.Enum, y) } } } // AdditionalPropertiesItem additional_properties = 21; v21 := compiler.MapValueForKey(m, "additionalProperties") if v21 != nil { var err error x.AdditionalProperties, err = NewAdditionalPropertiesItem(v21, compiler.NewContext("additionalProperties", context)) if err != nil { errors = append(errors, err) } } // TypeItem type = 22; v22 := compiler.MapValueForKey(m, "type") if v22 != nil { var err error x.Type, err = NewTypeItem(v22, compiler.NewContext("type", context)) if err != nil { errors = append(errors, err) } } // ItemsItem items = 23; v23 := compiler.MapValueForKey(m, "items") if v23 != nil { var err error x.Items, err = NewItemsItem(v23, compiler.NewContext("items", context)) if err != nil { errors = append(errors, err) } } // repeated Schema all_of = 24; v24 := compiler.MapValueForKey(m, "allOf") if v24 != nil { // repeated Schema x.AllOf = make([]*Schema, 0) a, ok := v24.([]interface{}) if ok { for _, item := range a { y, err := NewSchema(item, compiler.NewContext("allOf", context)) if err != nil { errors = append(errors, err) } x.AllOf = append(x.AllOf, y) } } } // Properties properties = 25; v25 := compiler.MapValueForKey(m, "properties") if v25 != nil { var err error x.Properties, err = NewProperties(v25, compiler.NewContext("properties", context)) if err != nil { errors = append(errors, err) } } // string discriminator = 26; v26 := compiler.MapValueForKey(m, "discriminator") if v26 != nil { x.Discriminator, ok = v26.(string) if !ok { message := fmt.Sprintf("has unexpected value for discriminator: %+v (%T)", v26, v26) errors = append(errors, compiler.NewError(context, message)) } } // bool read_only = 27; v27 := compiler.MapValueForKey(m, "readOnly") if v27 != nil { x.ReadOnly, ok = v27.(bool) if !ok { message := fmt.Sprintf("has unexpected value for readOnly: %+v (%T)", v27, v27) errors = append(errors, compiler.NewError(context, message)) } } // Xml xml = 28; v28 := compiler.MapValueForKey(m, "xml") if v28 != nil { var err error x.Xml, err = NewXml(v28, compiler.NewContext("xml", context)) if err != nil { errors = append(errors, err) } } // ExternalDocs external_docs = 29; v29 := compiler.MapValueForKey(m, "externalDocs") if v29 != nil { var err error x.ExternalDocs, err = NewExternalDocs(v29, compiler.NewContext("externalDocs", context)) if err != nil { errors = append(errors, err) } } // Any example = 30; v30 := compiler.MapValueForKey(m, "example") if v30 != nil { var err error x.Example, err = NewAny(v30, compiler.NewContext("example", context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 31; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewSchemaItem creates an object of type SchemaItem if possible, returning an error if not. func NewSchemaItem(in interface{}, context *compiler.Context) (*SchemaItem, error) { errors := make([]error, 0) x := &SchemaItem{} matched := false // Schema schema = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewSchema(m, compiler.NewContext("schema", context)) if matchingError == nil { x.Oneof = &SchemaItem_Schema{Schema: t} matched = true } else { errors = append(errors, matchingError) } } } // FileSchema file_schema = 2; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewFileSchema(m, compiler.NewContext("fileSchema", context)) if matchingError == nil { x.Oneof = &SchemaItem_FileSchema{FileSchema: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } return x, compiler.NewErrorGroupOrNil(errors) } // NewSecurityDefinitions creates an object of type SecurityDefinitions if possible, returning an error if not. func NewSecurityDefinitions(in interface{}, context *compiler.Context) (*SecurityDefinitions, error) { errors := make([]error, 0) x := &SecurityDefinitions{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedSecurityDefinitionsItem additional_properties = 1; // MAP: SecurityDefinitionsItem x.AdditionalProperties = make([]*NamedSecurityDefinitionsItem, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedSecurityDefinitionsItem{} pair.Name = k var err error pair.Value, err = NewSecurityDefinitionsItem(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewSecurityDefinitionsItem creates an object of type SecurityDefinitionsItem if possible, returning an error if not. func NewSecurityDefinitionsItem(in interface{}, context *compiler.Context) (*SecurityDefinitionsItem, error) { errors := make([]error, 0) x := &SecurityDefinitionsItem{} matched := false // BasicAuthenticationSecurity basic_authentication_security = 1; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewBasicAuthenticationSecurity(m, compiler.NewContext("basicAuthenticationSecurity", context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_BasicAuthenticationSecurity{BasicAuthenticationSecurity: t} matched = true } else { errors = append(errors, matchingError) } } } // ApiKeySecurity api_key_security = 2; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewApiKeySecurity(m, compiler.NewContext("apiKeySecurity", context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_ApiKeySecurity{ApiKeySecurity: t} matched = true } else { errors = append(errors, matchingError) } } } // Oauth2ImplicitSecurity oauth2_implicit_security = 3; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewOauth2ImplicitSecurity(m, compiler.NewContext("oauth2ImplicitSecurity", context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2ImplicitSecurity{Oauth2ImplicitSecurity: t} matched = true } else { errors = append(errors, matchingError) } } } // Oauth2PasswordSecurity oauth2_password_security = 4; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewOauth2PasswordSecurity(m, compiler.NewContext("oauth2PasswordSecurity", context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2PasswordSecurity{Oauth2PasswordSecurity: t} matched = true } else { errors = append(errors, matchingError) } } } // Oauth2ApplicationSecurity oauth2_application_security = 5; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewOauth2ApplicationSecurity(m, compiler.NewContext("oauth2ApplicationSecurity", context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2ApplicationSecurity{Oauth2ApplicationSecurity: t} matched = true } else { errors = append(errors, matchingError) } } } // Oauth2AccessCodeSecurity oauth2_access_code_security = 6; { m, ok := compiler.UnpackMap(in) if ok { // errors might be ok here, they mean we just don't have the right subtype t, matchingError := NewOauth2AccessCodeSecurity(m, compiler.NewContext("oauth2AccessCodeSecurity", context)) if matchingError == nil { x.Oneof = &SecurityDefinitionsItem_Oauth2AccessCodeSecurity{Oauth2AccessCodeSecurity: t} matched = true } else { errors = append(errors, matchingError) } } } if matched { // since the oneof matched one of its possibilities, discard any matching errors errors = make([]error, 0) } return x, compiler.NewErrorGroupOrNil(errors) } // NewSecurityRequirement creates an object of type SecurityRequirement if possible, returning an error if not. func NewSecurityRequirement(in interface{}, context *compiler.Context) (*SecurityRequirement, error) { errors := make([]error, 0) x := &SecurityRequirement{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedStringArray additional_properties = 1; // MAP: StringArray x.AdditionalProperties = make([]*NamedStringArray, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedStringArray{} pair.Name = k var err error pair.Value, err = NewStringArray(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewStringArray creates an object of type StringArray if possible, returning an error if not. func NewStringArray(in interface{}, context *compiler.Context) (*StringArray, error) { errors := make([]error, 0) x := &StringArray{} a, ok := in.([]interface{}) if !ok { message := fmt.Sprintf("has unexpected value for StringArray: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { x.Value = make([]string, 0) for _, s := range a { x.Value = append(x.Value, s.(string)) } } return x, compiler.NewErrorGroupOrNil(errors) } // NewTag creates an object of type Tag if possible, returning an error if not. func NewTag(in interface{}, context *compiler.Context) (*Tag, error) { errors := make([]error, 0) x := &Tag{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { requiredKeys := []string{"name"} missingKeys := compiler.MissingKeysInMap(m, requiredKeys) if len(missingKeys) > 0 { message := fmt.Sprintf("is missing required %s: %+v", compiler.PluralProperties(len(missingKeys)), strings.Join(missingKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } allowedKeys := []string{"description", "externalDocs", "name"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string description = 2; v2 := compiler.MapValueForKey(m, "description") if v2 != nil { x.Description, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for description: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // ExternalDocs external_docs = 3; v3 := compiler.MapValueForKey(m, "externalDocs") if v3 != nil { var err error x.ExternalDocs, err = NewExternalDocs(v3, compiler.NewContext("externalDocs", context)) if err != nil { errors = append(errors, err) } } // repeated NamedAny vendor_extension = 4; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewTypeItem creates an object of type TypeItem if possible, returning an error if not. func NewTypeItem(in interface{}, context *compiler.Context) (*TypeItem, error) { errors := make([]error, 0) x := &TypeItem{} switch in := in.(type) { case string: x.Value = make([]string, 0) x.Value = append(x.Value, in) case []interface{}: x.Value = make([]string, 0) for _, v := range in { value, ok := v.(string) if ok { x.Value = append(x.Value, value) } else { message := fmt.Sprintf("has unexpected value for string array element: %+v (%T)", value, value) errors = append(errors, compiler.NewError(context, message)) } } default: message := fmt.Sprintf("has unexpected value for string array: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } return x, compiler.NewErrorGroupOrNil(errors) } // NewVendorExtension creates an object of type VendorExtension if possible, returning an error if not. func NewVendorExtension(in interface{}, context *compiler.Context) (*VendorExtension, error) { errors := make([]error, 0) x := &VendorExtension{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { // repeated NamedAny additional_properties = 1; // MAP: Any x.AdditionalProperties = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.AdditionalProperties = append(x.AdditionalProperties, pair) } } } return x, compiler.NewErrorGroupOrNil(errors) } // NewXml creates an object of type Xml if possible, returning an error if not. func NewXml(in interface{}, context *compiler.Context) (*Xml, error) { errors := make([]error, 0) x := &Xml{} m, ok := compiler.UnpackMap(in) if !ok { message := fmt.Sprintf("has unexpected value: %+v (%T)", in, in) errors = append(errors, compiler.NewError(context, message)) } else { allowedKeys := []string{"attribute", "name", "namespace", "prefix", "wrapped"} allowedPatterns := []*regexp.Regexp{pattern0} invalidKeys := compiler.InvalidKeysInMap(m, allowedKeys, allowedPatterns) if len(invalidKeys) > 0 { message := fmt.Sprintf("has invalid %s: %+v", compiler.PluralProperties(len(invalidKeys)), strings.Join(invalidKeys, ", ")) errors = append(errors, compiler.NewError(context, message)) } // string name = 1; v1 := compiler.MapValueForKey(m, "name") if v1 != nil { x.Name, ok = v1.(string) if !ok { message := fmt.Sprintf("has unexpected value for name: %+v (%T)", v1, v1) errors = append(errors, compiler.NewError(context, message)) } } // string namespace = 2; v2 := compiler.MapValueForKey(m, "namespace") if v2 != nil { x.Namespace, ok = v2.(string) if !ok { message := fmt.Sprintf("has unexpected value for namespace: %+v (%T)", v2, v2) errors = append(errors, compiler.NewError(context, message)) } } // string prefix = 3; v3 := compiler.MapValueForKey(m, "prefix") if v3 != nil { x.Prefix, ok = v3.(string) if !ok { message := fmt.Sprintf("has unexpected value for prefix: %+v (%T)", v3, v3) errors = append(errors, compiler.NewError(context, message)) } } // bool attribute = 4; v4 := compiler.MapValueForKey(m, "attribute") if v4 != nil { x.Attribute, ok = v4.(bool) if !ok { message := fmt.Sprintf("has unexpected value for attribute: %+v (%T)", v4, v4) errors = append(errors, compiler.NewError(context, message)) } } // bool wrapped = 5; v5 := compiler.MapValueForKey(m, "wrapped") if v5 != nil { x.Wrapped, ok = v5.(bool) if !ok { message := fmt.Sprintf("has unexpected value for wrapped: %+v (%T)", v5, v5) errors = append(errors, compiler.NewError(context, message)) } } // repeated NamedAny vendor_extension = 6; // MAP: Any ^x- x.VendorExtension = make([]*NamedAny, 0) for _, item := range m { k, ok := compiler.StringValue(item.Key) if ok { v := item.Value if strings.HasPrefix(k, "x-") { pair := &NamedAny{} pair.Name = k result := &Any{} handled, resultFromExt, err := compiler.HandleExtension(context, v, k) if handled { if err != nil { errors = append(errors, err) } else { bytes, _ := yaml.Marshal(v) result.Yaml = string(bytes) result.Value = resultFromExt pair.Value = result } } else { pair.Value, err = NewAny(v, compiler.NewContext(k, context)) if err != nil { errors = append(errors, err) } } x.VendorExtension = append(x.VendorExtension, pair) } } } } return x, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside AdditionalPropertiesItem objects. func (m *AdditionalPropertiesItem) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*AdditionalPropertiesItem_Schema) if ok { _, err := p.Schema.ResolveReferences(root) if err != nil { return nil, err } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Any objects. func (m *Any) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ApiKeySecurity objects. func (m *ApiKeySecurity) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside BasicAuthenticationSecurity objects. func (m *BasicAuthenticationSecurity) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside BodyParameter objects. func (m *BodyParameter) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Schema != nil { _, err := m.Schema.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Contact objects. func (m *Contact) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Default objects. func (m *Default) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Definitions objects. func (m *Definitions) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Document objects. func (m *Document) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Info != nil { _, err := m.Info.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Paths != nil { _, err := m.Paths.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Definitions != nil { _, err := m.Definitions.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Parameters != nil { _, err := m.Parameters.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Responses != nil { _, err := m.Responses.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Security { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } if m.SecurityDefinitions != nil { _, err := m.SecurityDefinitions.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Tags { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Examples objects. func (m *Examples) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ExternalDocs objects. func (m *ExternalDocs) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside FileSchema objects. func (m *FileSchema) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Example != nil { _, err := m.Example.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside FormDataParameterSubSchema objects. func (m *FormDataParameterSubSchema) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Header objects. func (m *Header) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside HeaderParameterSubSchema objects. func (m *HeaderParameterSubSchema) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Headers objects. func (m *Headers) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Info objects. func (m *Info) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Contact != nil { _, err := m.Contact.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.License != nil { _, err := m.License.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ItemsItem objects. func (m *ItemsItem) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.Schema { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside JsonReference objects. func (m *JsonReference) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.XRef != "" { info, err := compiler.ReadInfoForRef(root, m.XRef) if err != nil { return nil, err } if info != nil { replacement, err := NewJsonReference(info, nil) if err == nil { *m = *replacement return m.ResolveReferences(root) } } return info, nil } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside License objects. func (m *License) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedAny objects. func (m *NamedAny) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedHeader objects. func (m *NamedHeader) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedParameter objects. func (m *NamedParameter) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedPathItem objects. func (m *NamedPathItem) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedResponse objects. func (m *NamedResponse) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedResponseValue objects. func (m *NamedResponseValue) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedSchema objects. func (m *NamedSchema) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedSecurityDefinitionsItem objects. func (m *NamedSecurityDefinitionsItem) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedString objects. func (m *NamedString) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NamedStringArray objects. func (m *NamedStringArray) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Value != nil { _, err := m.Value.ResolveReferences(root) if err != nil { errors = append(errors, err) } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside NonBodyParameter objects. func (m *NonBodyParameter) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*NonBodyParameter_HeaderParameterSubSchema) if ok { _, err := p.HeaderParameterSubSchema.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*NonBodyParameter_FormDataParameterSubSchema) if ok { _, err := p.FormDataParameterSubSchema.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*NonBodyParameter_QueryParameterSubSchema) if ok { _, err := p.QueryParameterSubSchema.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*NonBodyParameter_PathParameterSubSchema) if ok { _, err := p.PathParameterSubSchema.ResolveReferences(root) if err != nil { return nil, err } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Oauth2AccessCodeSecurity objects. func (m *Oauth2AccessCodeSecurity) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Oauth2ApplicationSecurity objects. func (m *Oauth2ApplicationSecurity) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Oauth2ImplicitSecurity objects. func (m *Oauth2ImplicitSecurity) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Oauth2PasswordSecurity objects. func (m *Oauth2PasswordSecurity) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Scopes != nil { _, err := m.Scopes.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Oauth2Scopes objects. func (m *Oauth2Scopes) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Operation objects. func (m *Operation) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Parameters { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } if m.Responses != nil { _, err := m.Responses.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Security { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Parameter objects. func (m *Parameter) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*Parameter_BodyParameter) if ok { _, err := p.BodyParameter.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*Parameter_NonBodyParameter) if ok { _, err := p.NonBodyParameter.ResolveReferences(root) if err != nil { return nil, err } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ParameterDefinitions objects. func (m *ParameterDefinitions) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ParametersItem objects. func (m *ParametersItem) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*ParametersItem_Parameter) if ok { _, err := p.Parameter.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*ParametersItem_JsonReference) if ok { info, err := p.JsonReference.ResolveReferences(root) if err != nil { return nil, err } else if info != nil { n, err := NewParametersItem(info, nil) if err != nil { return nil, err } else if n != nil { *m = *n return nil, nil } } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside PathItem objects. func (m *PathItem) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.XRef != "" { info, err := compiler.ReadInfoForRef(root, m.XRef) if err != nil { return nil, err } if info != nil { replacement, err := NewPathItem(info, nil) if err == nil { *m = *replacement return m.ResolveReferences(root) } } return info, nil } if m.Get != nil { _, err := m.Get.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Put != nil { _, err := m.Put.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Post != nil { _, err := m.Post.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Delete != nil { _, err := m.Delete.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Options != nil { _, err := m.Options.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Head != nil { _, err := m.Head.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Patch != nil { _, err := m.Patch.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Parameters { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside PathParameterSubSchema objects. func (m *PathParameterSubSchema) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Paths objects. func (m *Paths) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.Path { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside PrimitivesItems objects. func (m *PrimitivesItems) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Properties objects. func (m *Properties) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside QueryParameterSubSchema objects. func (m *QueryParameterSubSchema) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Response objects. func (m *Response) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.Schema != nil { _, err := m.Schema.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Headers != nil { _, err := m.Headers.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Examples != nil { _, err := m.Examples.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ResponseDefinitions objects. func (m *ResponseDefinitions) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside ResponseValue objects. func (m *ResponseValue) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*ResponseValue_Response) if ok { _, err := p.Response.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*ResponseValue_JsonReference) if ok { info, err := p.JsonReference.ResolveReferences(root) if err != nil { return nil, err } else if info != nil { n, err := NewResponseValue(info, nil) if err != nil { return nil, err } else if n != nil { *m = *n return nil, nil } } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Responses objects. func (m *Responses) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.ResponseCode { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Schema objects. func (m *Schema) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.XRef != "" { info, err := compiler.ReadInfoForRef(root, m.XRef) if err != nil { return nil, err } if info != nil { replacement, err := NewSchema(info, nil) if err == nil { *m = *replacement return m.ResolveReferences(root) } } return info, nil } if m.Default != nil { _, err := m.Default.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.Enum { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } if m.AdditionalProperties != nil { _, err := m.AdditionalProperties.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Type != nil { _, err := m.Type.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Items != nil { _, err := m.Items.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.AllOf { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } if m.Properties != nil { _, err := m.Properties.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Xml != nil { _, err := m.Xml.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) if err != nil { errors = append(errors, err) } } if m.Example != nil { _, err := m.Example.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside SchemaItem objects. func (m *SchemaItem) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*SchemaItem_Schema) if ok { _, err := p.Schema.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SchemaItem_FileSchema) if ok { _, err := p.FileSchema.ResolveReferences(root) if err != nil { return nil, err } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside SecurityDefinitions objects. func (m *SecurityDefinitions) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside SecurityDefinitionsItem objects. func (m *SecurityDefinitionsItem) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) { p, ok := m.Oneof.(*SecurityDefinitionsItem_BasicAuthenticationSecurity) if ok { _, err := p.BasicAuthenticationSecurity.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SecurityDefinitionsItem_ApiKeySecurity) if ok { _, err := p.ApiKeySecurity.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2ImplicitSecurity) if ok { _, err := p.Oauth2ImplicitSecurity.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2PasswordSecurity) if ok { _, err := p.Oauth2PasswordSecurity.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2ApplicationSecurity) if ok { _, err := p.Oauth2ApplicationSecurity.ResolveReferences(root) if err != nil { return nil, err } } } { p, ok := m.Oneof.(*SecurityDefinitionsItem_Oauth2AccessCodeSecurity) if ok { _, err := p.Oauth2AccessCodeSecurity.ResolveReferences(root) if err != nil { return nil, err } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside SecurityRequirement objects. func (m *SecurityRequirement) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside StringArray objects. func (m *StringArray) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Tag objects. func (m *Tag) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) if m.ExternalDocs != nil { _, err := m.ExternalDocs.ResolveReferences(root) if err != nil { errors = append(errors, err) } } for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside TypeItem objects. func (m *TypeItem) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside VendorExtension objects. func (m *VendorExtension) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.AdditionalProperties { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ResolveReferences resolves references found inside Xml objects. func (m *Xml) ResolveReferences(root string) (interface{}, error) { errors := make([]error, 0) for _, item := range m.VendorExtension { if item != nil { _, err := item.ResolveReferences(root) if err != nil { errors = append(errors, err) } } } return nil, compiler.NewErrorGroupOrNil(errors) } // ToRawInfo returns a description of AdditionalPropertiesItem suitable for JSON or YAML export. func (m *AdditionalPropertiesItem) ToRawInfo() interface{} { // ONE OF WRAPPER // AdditionalPropertiesItem // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetSchema() if v0 != nil { return v0.ToRawInfo() } // {Name:boolean Type:bool StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if v1, ok := m.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { return v1.Boolean } return nil } // ToRawInfo returns a description of Any suitable for JSON or YAML export. func (m *Any) ToRawInfo() interface{} { var err error var info1 []yaml.MapSlice err = yaml.Unmarshal([]byte(m.Yaml), &info1) if err == nil { return info1 } var info2 yaml.MapSlice err = yaml.Unmarshal([]byte(m.Yaml), &info2) if err == nil { return info2 } var info3 interface{} err = yaml.Unmarshal([]byte(m.Yaml), &info3) if err == nil { return info3 } return nil } // ToRawInfo returns a description of ApiKeySecurity suitable for JSON or YAML export. func (m *ApiKeySecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.In != "" { info = append(info, yaml.MapItem{"in", m.In}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of BasicAuthenticationSecurity suitable for JSON or YAML export. func (m *BasicAuthenticationSecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of BodyParameter suitable for JSON or YAML export. func (m *BodyParameter) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.In != "" { info = append(info, yaml.MapItem{"in", m.In}) } if m.Required != false { info = append(info, yaml.MapItem{"required", m.Required}) } if m.Schema != nil { info = append(info, yaml.MapItem{"schema", m.Schema.ToRawInfo()}) } // &{Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Contact suitable for JSON or YAML export. func (m *Contact) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.Url != "" { info = append(info, yaml.MapItem{"url", m.Url}) } if m.Email != "" { info = append(info, yaml.MapItem{"email", m.Email}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Default suitable for JSON or YAML export. func (m *Default) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:false Description:} return info } // ToRawInfo returns a description of Definitions suitable for JSON or YAML export. func (m *Definitions) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedSchema StringEnumValues:[] MapType:Schema Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of Document suitable for JSON or YAML export. func (m *Document) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Swagger != "" { info = append(info, yaml.MapItem{"swagger", m.Swagger}) } if m.Info != nil { info = append(info, yaml.MapItem{"info", m.Info.ToRawInfo()}) } // &{Name:info Type:Info StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Host != "" { info = append(info, yaml.MapItem{"host", m.Host}) } if m.BasePath != "" { info = append(info, yaml.MapItem{"basePath", m.BasePath}) } if len(m.Schemes) != 0 { info = append(info, yaml.MapItem{"schemes", m.Schemes}) } if len(m.Consumes) != 0 { info = append(info, yaml.MapItem{"consumes", m.Consumes}) } if len(m.Produces) != 0 { info = append(info, yaml.MapItem{"produces", m.Produces}) } if m.Paths != nil { info = append(info, yaml.MapItem{"paths", m.Paths.ToRawInfo()}) } // &{Name:paths Type:Paths StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Definitions != nil { info = append(info, yaml.MapItem{"definitions", m.Definitions.ToRawInfo()}) } // &{Name:definitions Type:Definitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Parameters != nil { info = append(info, yaml.MapItem{"parameters", m.Parameters.ToRawInfo()}) } // &{Name:parameters Type:ParameterDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Responses != nil { info = append(info, yaml.MapItem{"responses", m.Responses.ToRawInfo()}) } // &{Name:responses Type:ResponseDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Security) != 0 { items := make([]interface{}, 0) for _, item := range m.Security { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"security", items}) } // &{Name:security Type:SecurityRequirement StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.SecurityDefinitions != nil { info = append(info, yaml.MapItem{"securityDefinitions", m.SecurityDefinitions.ToRawInfo()}) } // &{Name:securityDefinitions Type:SecurityDefinitions StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Tags) != 0 { items := make([]interface{}, 0) for _, item := range m.Tags { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"tags", items}) } // &{Name:tags Type:Tag StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.ExternalDocs != nil { info = append(info, yaml.MapItem{"externalDocs", m.ExternalDocs.ToRawInfo()}) } // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Examples suitable for JSON or YAML export. func (m *Examples) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of ExternalDocs suitable for JSON or YAML export. func (m *ExternalDocs) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.Url != "" { info = append(info, yaml.MapItem{"url", m.Url}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of FileSchema suitable for JSON or YAML export. func (m *FileSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Format != "" { info = append(info, yaml.MapItem{"format", m.Format}) } if m.Title != "" { info = append(info, yaml.MapItem{"title", m.Title}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.Default != nil { info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Required) != 0 { info = append(info, yaml.MapItem{"required", m.Required}) } if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.ReadOnly != false { info = append(info, yaml.MapItem{"readOnly", m.ReadOnly}) } if m.ExternalDocs != nil { info = append(info, yaml.MapItem{"externalDocs", m.ExternalDocs.ToRawInfo()}) } // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Example != nil { info = append(info, yaml.MapItem{"example", m.Example.ToRawInfo()}) } // &{Name:example Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of FormDataParameterSubSchema suitable for JSON or YAML export. func (m *FormDataParameterSubSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Required != false { info = append(info, yaml.MapItem{"required", m.Required}) } if m.In != "" { info = append(info, yaml.MapItem{"in", m.In}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.AllowEmptyValue != false { info = append(info, yaml.MapItem{"allowEmptyValue", m.AllowEmptyValue}) } if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Header suitable for JSON or YAML export. func (m *Header) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of HeaderParameterSubSchema suitable for JSON or YAML export. func (m *HeaderParameterSubSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Required != false { info = append(info, yaml.MapItem{"required", m.Required}) } if m.In != "" { info = append(info, yaml.MapItem{"in", m.In}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Headers suitable for JSON or YAML export. func (m *Headers) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedHeader StringEnumValues:[] MapType:Header Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of Info suitable for JSON or YAML export. func (m *Info) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Title != "" { info = append(info, yaml.MapItem{"title", m.Title}) } if m.Version != "" { info = append(info, yaml.MapItem{"version", m.Version}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.TermsOfService != "" { info = append(info, yaml.MapItem{"termsOfService", m.TermsOfService}) } if m.Contact != nil { info = append(info, yaml.MapItem{"contact", m.Contact.ToRawInfo()}) } // &{Name:contact Type:Contact StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.License != nil { info = append(info, yaml.MapItem{"license", m.License.ToRawInfo()}) } // &{Name:license Type:License StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of ItemsItem suitable for JSON or YAML export. func (m *ItemsItem) ToRawInfo() interface{} { info := yaml.MapSlice{} if len(m.Schema) != 0 { items := make([]interface{}, 0) for _, item := range m.Schema { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"schema", items}) } // &{Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} return info } // ToRawInfo returns a description of JsonReference suitable for JSON or YAML export. func (m *JsonReference) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.XRef != "" { info = append(info, yaml.MapItem{"$ref", m.XRef}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } return info } // ToRawInfo returns a description of License suitable for JSON or YAML export. func (m *License) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.Url != "" { info = append(info, yaml.MapItem{"url", m.Url}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of NamedAny suitable for JSON or YAML export. func (m *NamedAny) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedHeader suitable for JSON or YAML export. func (m *NamedHeader) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:Header StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedParameter suitable for JSON or YAML export. func (m *NamedParameter) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedPathItem suitable for JSON or YAML export. func (m *NamedPathItem) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:PathItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedResponse suitable for JSON or YAML export. func (m *NamedResponse) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedResponseValue suitable for JSON or YAML export. func (m *NamedResponseValue) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:ResponseValue StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedSchema suitable for JSON or YAML export. func (m *NamedSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedSecurityDefinitionsItem suitable for JSON or YAML export. func (m *NamedSecurityDefinitionsItem) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:SecurityDefinitionsItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NamedString suitable for JSON or YAML export. func (m *NamedString) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.Value != "" { info = append(info, yaml.MapItem{"value", m.Value}) } return info } // ToRawInfo returns a description of NamedStringArray suitable for JSON or YAML export. func (m *NamedStringArray) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } // &{Name:value Type:StringArray StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:Mapped value} return info } // ToRawInfo returns a description of NonBodyParameter suitable for JSON or YAML export. func (m *NonBodyParameter) ToRawInfo() interface{} { // ONE OF WRAPPER // NonBodyParameter // {Name:headerParameterSubSchema Type:HeaderParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetHeaderParameterSubSchema() if v0 != nil { return v0.ToRawInfo() } // {Name:formDataParameterSubSchema Type:FormDataParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetFormDataParameterSubSchema() if v1 != nil { return v1.ToRawInfo() } // {Name:queryParameterSubSchema Type:QueryParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v2 := m.GetQueryParameterSubSchema() if v2 != nil { return v2.ToRawInfo() } // {Name:pathParameterSubSchema Type:PathParameterSubSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v3 := m.GetPathParameterSubSchema() if v3 != nil { return v3.ToRawInfo() } return nil } // ToRawInfo returns a description of Oauth2AccessCodeSecurity suitable for JSON or YAML export. func (m *Oauth2AccessCodeSecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Flow != "" { info = append(info, yaml.MapItem{"flow", m.Flow}) } if m.Scopes != nil { info = append(info, yaml.MapItem{"scopes", m.Scopes.ToRawInfo()}) } // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.AuthorizationUrl != "" { info = append(info, yaml.MapItem{"authorizationUrl", m.AuthorizationUrl}) } if m.TokenUrl != "" { info = append(info, yaml.MapItem{"tokenUrl", m.TokenUrl}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Oauth2ApplicationSecurity suitable for JSON or YAML export. func (m *Oauth2ApplicationSecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Flow != "" { info = append(info, yaml.MapItem{"flow", m.Flow}) } if m.Scopes != nil { info = append(info, yaml.MapItem{"scopes", m.Scopes.ToRawInfo()}) } // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.TokenUrl != "" { info = append(info, yaml.MapItem{"tokenUrl", m.TokenUrl}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Oauth2ImplicitSecurity suitable for JSON or YAML export. func (m *Oauth2ImplicitSecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Flow != "" { info = append(info, yaml.MapItem{"flow", m.Flow}) } if m.Scopes != nil { info = append(info, yaml.MapItem{"scopes", m.Scopes.ToRawInfo()}) } // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.AuthorizationUrl != "" { info = append(info, yaml.MapItem{"authorizationUrl", m.AuthorizationUrl}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Oauth2PasswordSecurity suitable for JSON or YAML export. func (m *Oauth2PasswordSecurity) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Flow != "" { info = append(info, yaml.MapItem{"flow", m.Flow}) } if m.Scopes != nil { info = append(info, yaml.MapItem{"scopes", m.Scopes.ToRawInfo()}) } // &{Name:scopes Type:Oauth2Scopes StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.TokenUrl != "" { info = append(info, yaml.MapItem{"tokenUrl", m.TokenUrl}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Oauth2Scopes suitable for JSON or YAML export. func (m *Oauth2Scopes) ToRawInfo() interface{} { info := yaml.MapSlice{} // &{Name:additionalProperties Type:NamedString StringEnumValues:[] MapType:string Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of Operation suitable for JSON or YAML export. func (m *Operation) ToRawInfo() interface{} { info := yaml.MapSlice{} if len(m.Tags) != 0 { info = append(info, yaml.MapItem{"tags", m.Tags}) } if m.Summary != "" { info = append(info, yaml.MapItem{"summary", m.Summary}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.ExternalDocs != nil { info = append(info, yaml.MapItem{"externalDocs", m.ExternalDocs.ToRawInfo()}) } // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.OperationId != "" { info = append(info, yaml.MapItem{"operationId", m.OperationId}) } if len(m.Produces) != 0 { info = append(info, yaml.MapItem{"produces", m.Produces}) } if len(m.Consumes) != 0 { info = append(info, yaml.MapItem{"consumes", m.Consumes}) } if len(m.Parameters) != 0 { items := make([]interface{}, 0) for _, item := range m.Parameters { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"parameters", items}) } // &{Name:parameters Type:ParametersItem StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:The parameters needed to send a valid API call.} if m.Responses != nil { info = append(info, yaml.MapItem{"responses", m.Responses.ToRawInfo()}) } // &{Name:responses Type:Responses StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Schemes) != 0 { info = append(info, yaml.MapItem{"schemes", m.Schemes}) } if m.Deprecated != false { info = append(info, yaml.MapItem{"deprecated", m.Deprecated}) } if len(m.Security) != 0 { items := make([]interface{}, 0) for _, item := range m.Security { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"security", items}) } // &{Name:security Type:SecurityRequirement StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Parameter suitable for JSON or YAML export. func (m *Parameter) ToRawInfo() interface{} { // ONE OF WRAPPER // Parameter // {Name:bodyParameter Type:BodyParameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetBodyParameter() if v0 != nil { return v0.ToRawInfo() } // {Name:nonBodyParameter Type:NonBodyParameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetNonBodyParameter() if v1 != nil { return v1.ToRawInfo() } return nil } // ToRawInfo returns a description of ParameterDefinitions suitable for JSON or YAML export. func (m *ParameterDefinitions) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedParameter StringEnumValues:[] MapType:Parameter Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of ParametersItem suitable for JSON or YAML export. func (m *ParametersItem) ToRawInfo() interface{} { // ONE OF WRAPPER // ParametersItem // {Name:parameter Type:Parameter StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetParameter() if v0 != nil { return v0.ToRawInfo() } // {Name:jsonReference Type:JsonReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetJsonReference() if v1 != nil { return v1.ToRawInfo() } return nil } // ToRawInfo returns a description of PathItem suitable for JSON or YAML export. func (m *PathItem) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.XRef != "" { info = append(info, yaml.MapItem{"$ref", m.XRef}) } if m.Get != nil { info = append(info, yaml.MapItem{"get", m.Get.ToRawInfo()}) } // &{Name:get Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Put != nil { info = append(info, yaml.MapItem{"put", m.Put.ToRawInfo()}) } // &{Name:put Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Post != nil { info = append(info, yaml.MapItem{"post", m.Post.ToRawInfo()}) } // &{Name:post Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Delete != nil { info = append(info, yaml.MapItem{"delete", m.Delete.ToRawInfo()}) } // &{Name:delete Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Options != nil { info = append(info, yaml.MapItem{"options", m.Options.ToRawInfo()}) } // &{Name:options Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Head != nil { info = append(info, yaml.MapItem{"head", m.Head.ToRawInfo()}) } // &{Name:head Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Patch != nil { info = append(info, yaml.MapItem{"patch", m.Patch.ToRawInfo()}) } // &{Name:patch Type:Operation StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.Parameters) != 0 { items := make([]interface{}, 0) for _, item := range m.Parameters { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"parameters", items}) } // &{Name:parameters Type:ParametersItem StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:The parameters needed to send a valid API call.} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of PathParameterSubSchema suitable for JSON or YAML export. func (m *PathParameterSubSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Required != false { info = append(info, yaml.MapItem{"required", m.Required}) } if m.In != "" { info = append(info, yaml.MapItem{"in", m.In}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Paths suitable for JSON or YAML export. func (m *Paths) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} if m.Path != nil { for _, item := range m.Path { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:Path Type:NamedPathItem StringEnumValues:[] MapType:PathItem Repeated:true Pattern:^/ Implicit:true Description:} return info } // ToRawInfo returns a description of PrimitivesItems suitable for JSON or YAML export. func (m *PrimitivesItems) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Properties suitable for JSON or YAML export. func (m *Properties) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedSchema StringEnumValues:[] MapType:Schema Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of QueryParameterSubSchema suitable for JSON or YAML export. func (m *QueryParameterSubSchema) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Required != false { info = append(info, yaml.MapItem{"required", m.Required}) } if m.In != "" { info = append(info, yaml.MapItem{"in", m.In}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.AllowEmptyValue != false { info = append(info, yaml.MapItem{"allowEmptyValue", m.AllowEmptyValue}) } if m.Type != "" { info = append(info, yaml.MapItem{"type", m.Type}) } if m.Format != "" { info = append(info, yaml.MapItem{"format", m.Format}) } if m.Items != nil { info = append(info, yaml.MapItem{"items", m.Items.ToRawInfo()}) } // &{Name:items Type:PrimitivesItems StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.CollectionFormat != "" { info = append(info, yaml.MapItem{"collectionFormat", m.CollectionFormat}) } if m.Default != nil { info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Maximum != 0.0 { info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Response suitable for JSON or YAML export. func (m *Response) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.Schema != nil { info = append(info, yaml.MapItem{"schema", m.Schema.ToRawInfo()}) } // &{Name:schema Type:SchemaItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Headers != nil { info = append(info, yaml.MapItem{"headers", m.Headers.ToRawInfo()}) } // &{Name:headers Type:Headers StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Examples != nil { info = append(info, yaml.MapItem{"examples", m.Examples.ToRawInfo()}) } // &{Name:examples Type:Examples StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of ResponseDefinitions suitable for JSON or YAML export. func (m *ResponseDefinitions) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedResponse StringEnumValues:[] MapType:Response Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of ResponseValue suitable for JSON or YAML export. func (m *ResponseValue) ToRawInfo() interface{} { // ONE OF WRAPPER // ResponseValue // {Name:response Type:Response StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetResponse() if v0 != nil { return v0.ToRawInfo() } // {Name:jsonReference Type:JsonReference StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetJsonReference() if v1 != nil { return v1.ToRawInfo() } return nil } // ToRawInfo returns a description of Responses suitable for JSON or YAML export. func (m *Responses) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.ResponseCode != nil { for _, item := range m.ResponseCode { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:ResponseCode Type:NamedResponseValue StringEnumValues:[] MapType:ResponseValue Repeated:true Pattern:^([0-9]{3})$|^(default)$ Implicit:true Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of Schema suitable for JSON or YAML export. func (m *Schema) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.XRef != "" { info = append(info, yaml.MapItem{"$ref", m.XRef}) } if m.Format != "" { info = append(info, yaml.MapItem{"format", m.Format}) } if m.Title != "" { info = append(info, yaml.MapItem{"title", m.Title}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.Default != nil { info = append(info, yaml.MapItem{"default", m.Default.ToRawInfo()}) } // &{Name:default Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.MultipleOf != 0.0 { info = append(info, yaml.MapItem{"multipleOf", m.MultipleOf}) } if m.Maximum != 0.0 { info = append(info, yaml.MapItem{"maximum", m.Maximum}) } if m.ExclusiveMaximum != false { info = append(info, yaml.MapItem{"exclusiveMaximum", m.ExclusiveMaximum}) } if m.Minimum != 0.0 { info = append(info, yaml.MapItem{"minimum", m.Minimum}) } if m.ExclusiveMinimum != false { info = append(info, yaml.MapItem{"exclusiveMinimum", m.ExclusiveMinimum}) } if m.MaxLength != 0 { info = append(info, yaml.MapItem{"maxLength", m.MaxLength}) } if m.MinLength != 0 { info = append(info, yaml.MapItem{"minLength", m.MinLength}) } if m.Pattern != "" { info = append(info, yaml.MapItem{"pattern", m.Pattern}) } if m.MaxItems != 0 { info = append(info, yaml.MapItem{"maxItems", m.MaxItems}) } if m.MinItems != 0 { info = append(info, yaml.MapItem{"minItems", m.MinItems}) } if m.UniqueItems != false { info = append(info, yaml.MapItem{"uniqueItems", m.UniqueItems}) } if m.MaxProperties != 0 { info = append(info, yaml.MapItem{"maxProperties", m.MaxProperties}) } if m.MinProperties != 0 { info = append(info, yaml.MapItem{"minProperties", m.MinProperties}) } if len(m.Required) != 0 { info = append(info, yaml.MapItem{"required", m.Required}) } if len(m.Enum) != 0 { items := make([]interface{}, 0) for _, item := range m.Enum { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"enum", items}) } // &{Name:enum Type:Any StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.AdditionalProperties != nil { info = append(info, yaml.MapItem{"additionalProperties", m.AdditionalProperties.ToRawInfo()}) } // &{Name:additionalProperties Type:AdditionalPropertiesItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Type != nil { if len(m.Type.Value) == 1 { info = append(info, yaml.MapItem{"type", m.Type.Value[0]}) } else { info = append(info, yaml.MapItem{"type", m.Type.Value}) } } // &{Name:type Type:TypeItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Items != nil { items := make([]interface{}, 0) for _, item := range m.Items.Schema { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"items", items[0]}) } // &{Name:items Type:ItemsItem StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if len(m.AllOf) != 0 { items := make([]interface{}, 0) for _, item := range m.AllOf { items = append(items, item.ToRawInfo()) } info = append(info, yaml.MapItem{"allOf", items}) } // &{Name:allOf Type:Schema StringEnumValues:[] MapType: Repeated:true Pattern: Implicit:false Description:} if m.Properties != nil { info = append(info, yaml.MapItem{"properties", m.Properties.ToRawInfo()}) } // &{Name:properties Type:Properties StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Discriminator != "" { info = append(info, yaml.MapItem{"discriminator", m.Discriminator}) } if m.ReadOnly != false { info = append(info, yaml.MapItem{"readOnly", m.ReadOnly}) } if m.Xml != nil { info = append(info, yaml.MapItem{"xml", m.Xml.ToRawInfo()}) } // &{Name:xml Type:Xml StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.ExternalDocs != nil { info = append(info, yaml.MapItem{"externalDocs", m.ExternalDocs.ToRawInfo()}) } // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.Example != nil { info = append(info, yaml.MapItem{"example", m.Example.ToRawInfo()}) } // &{Name:example Type:Any StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of SchemaItem suitable for JSON or YAML export. func (m *SchemaItem) ToRawInfo() interface{} { // ONE OF WRAPPER // SchemaItem // {Name:schema Type:Schema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetSchema() if v0 != nil { return v0.ToRawInfo() } // {Name:fileSchema Type:FileSchema StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetFileSchema() if v1 != nil { return v1.ToRawInfo() } return nil } // ToRawInfo returns a description of SecurityDefinitions suitable for JSON or YAML export. func (m *SecurityDefinitions) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedSecurityDefinitionsItem StringEnumValues:[] MapType:SecurityDefinitionsItem Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of SecurityDefinitionsItem suitable for JSON or YAML export. func (m *SecurityDefinitionsItem) ToRawInfo() interface{} { // ONE OF WRAPPER // SecurityDefinitionsItem // {Name:basicAuthenticationSecurity Type:BasicAuthenticationSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v0 := m.GetBasicAuthenticationSecurity() if v0 != nil { return v0.ToRawInfo() } // {Name:apiKeySecurity Type:ApiKeySecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v1 := m.GetApiKeySecurity() if v1 != nil { return v1.ToRawInfo() } // {Name:oauth2ImplicitSecurity Type:Oauth2ImplicitSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v2 := m.GetOauth2ImplicitSecurity() if v2 != nil { return v2.ToRawInfo() } // {Name:oauth2PasswordSecurity Type:Oauth2PasswordSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v3 := m.GetOauth2PasswordSecurity() if v3 != nil { return v3.ToRawInfo() } // {Name:oauth2ApplicationSecurity Type:Oauth2ApplicationSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v4 := m.GetOauth2ApplicationSecurity() if v4 != nil { return v4.ToRawInfo() } // {Name:oauth2AccessCodeSecurity Type:Oauth2AccessCodeSecurity StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} v5 := m.GetOauth2AccessCodeSecurity() if v5 != nil { return v5.ToRawInfo() } return nil } // ToRawInfo returns a description of SecurityRequirement suitable for JSON or YAML export. func (m *SecurityRequirement) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedStringArray StringEnumValues:[] MapType:StringArray Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of StringArray suitable for JSON or YAML export. func (m *StringArray) ToRawInfo() interface{} { return m.Value } // ToRawInfo returns a description of Tag suitable for JSON or YAML export. func (m *Tag) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.Description != "" { info = append(info, yaml.MapItem{"description", m.Description}) } if m.ExternalDocs != nil { info = append(info, yaml.MapItem{"externalDocs", m.ExternalDocs.ToRawInfo()}) } // &{Name:externalDocs Type:ExternalDocs StringEnumValues:[] MapType: Repeated:false Pattern: Implicit:false Description:} if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } // ToRawInfo returns a description of TypeItem suitable for JSON or YAML export. func (m *TypeItem) ToRawInfo() interface{} { info := yaml.MapSlice{} if len(m.Value) != 0 { info = append(info, yaml.MapItem{"value", m.Value}) } return info } // ToRawInfo returns a description of VendorExtension suitable for JSON or YAML export. func (m *VendorExtension) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.AdditionalProperties != nil { for _, item := range m.AdditionalProperties { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:additionalProperties Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern: Implicit:true Description:} return info } // ToRawInfo returns a description of Xml suitable for JSON or YAML export. func (m *Xml) ToRawInfo() interface{} { info := yaml.MapSlice{} if m.Name != "" { info = append(info, yaml.MapItem{"name", m.Name}) } if m.Namespace != "" { info = append(info, yaml.MapItem{"namespace", m.Namespace}) } if m.Prefix != "" { info = append(info, yaml.MapItem{"prefix", m.Prefix}) } if m.Attribute != false { info = append(info, yaml.MapItem{"attribute", m.Attribute}) } if m.Wrapped != false { info = append(info, yaml.MapItem{"wrapped", m.Wrapped}) } if m.VendorExtension != nil { for _, item := range m.VendorExtension { info = append(info, yaml.MapItem{item.Name, item.Value.ToRawInfo()}) } } // &{Name:VendorExtension Type:NamedAny StringEnumValues:[] MapType:Any Repeated:true Pattern:^x- Implicit:true Description:} return info } var ( pattern0 = regexp.MustCompile("^x-") pattern1 = regexp.MustCompile("^/") pattern2 = regexp.MustCompile("^([0-9]{3})$|^(default)$") ) ================================================ FILE: vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.pb.go ================================================ // Code generated by protoc-gen-go. // source: OpenAPIv2/OpenAPIv2.proto // DO NOT EDIT! /* Package openapi_v2 is a generated protocol buffer package. It is generated from these files: OpenAPIv2/OpenAPIv2.proto It has these top-level messages: AdditionalPropertiesItem Any ApiKeySecurity BasicAuthenticationSecurity BodyParameter Contact Default Definitions Document Examples ExternalDocs FileSchema FormDataParameterSubSchema Header HeaderParameterSubSchema Headers Info ItemsItem JsonReference License NamedAny NamedHeader NamedParameter NamedPathItem NamedResponse NamedResponseValue NamedSchema NamedSecurityDefinitionsItem NamedString NamedStringArray NonBodyParameter Oauth2AccessCodeSecurity Oauth2ApplicationSecurity Oauth2ImplicitSecurity Oauth2PasswordSecurity Oauth2Scopes Operation Parameter ParameterDefinitions ParametersItem PathItem PathParameterSubSchema Paths PrimitivesItems Properties QueryParameterSubSchema Response ResponseDefinitions ResponseValue Responses Schema SchemaItem SecurityDefinitions SecurityDefinitionsItem SecurityRequirement StringArray Tag TypeItem VendorExtension Xml */ package openapi_v2 import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import google_protobuf "github.com/golang/protobuf/ptypes/any" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type AdditionalPropertiesItem struct { // Types that are valid to be assigned to Oneof: // *AdditionalPropertiesItem_Schema // *AdditionalPropertiesItem_Boolean Oneof isAdditionalPropertiesItem_Oneof `protobuf_oneof:"oneof"` } func (m *AdditionalPropertiesItem) Reset() { *m = AdditionalPropertiesItem{} } func (m *AdditionalPropertiesItem) String() string { return proto.CompactTextString(m) } func (*AdditionalPropertiesItem) ProtoMessage() {} func (*AdditionalPropertiesItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } type isAdditionalPropertiesItem_Oneof interface { isAdditionalPropertiesItem_Oneof() } type AdditionalPropertiesItem_Schema struct { Schema *Schema `protobuf:"bytes,1,opt,name=schema,oneof"` } type AdditionalPropertiesItem_Boolean struct { Boolean bool `protobuf:"varint,2,opt,name=boolean,oneof"` } func (*AdditionalPropertiesItem_Schema) isAdditionalPropertiesItem_Oneof() {} func (*AdditionalPropertiesItem_Boolean) isAdditionalPropertiesItem_Oneof() {} func (m *AdditionalPropertiesItem) GetOneof() isAdditionalPropertiesItem_Oneof { if m != nil { return m.Oneof } return nil } func (m *AdditionalPropertiesItem) GetSchema() *Schema { if x, ok := m.GetOneof().(*AdditionalPropertiesItem_Schema); ok { return x.Schema } return nil } func (m *AdditionalPropertiesItem) GetBoolean() bool { if x, ok := m.GetOneof().(*AdditionalPropertiesItem_Boolean); ok { return x.Boolean } return false } // XXX_OneofFuncs is for the internal use of the proto package. func (*AdditionalPropertiesItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _AdditionalPropertiesItem_OneofMarshaler, _AdditionalPropertiesItem_OneofUnmarshaler, _AdditionalPropertiesItem_OneofSizer, []interface{}{ (*AdditionalPropertiesItem_Schema)(nil), (*AdditionalPropertiesItem_Boolean)(nil), } } func _AdditionalPropertiesItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*AdditionalPropertiesItem) // oneof switch x := m.Oneof.(type) { case *AdditionalPropertiesItem_Schema: b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Schema); err != nil { return err } case *AdditionalPropertiesItem_Boolean: t := uint64(0) if x.Boolean { t = 1 } b.EncodeVarint(2<<3 | proto.WireVarint) b.EncodeVarint(t) case nil: default: return fmt.Errorf("AdditionalPropertiesItem.Oneof has unexpected type %T", x) } return nil } func _AdditionalPropertiesItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*AdditionalPropertiesItem) switch tag { case 1: // oneof.schema if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(Schema) err := b.DecodeMessage(msg) m.Oneof = &AdditionalPropertiesItem_Schema{msg} return true, err case 2: // oneof.boolean if wire != proto.WireVarint { return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() m.Oneof = &AdditionalPropertiesItem_Boolean{x != 0} return true, err default: return false, nil } } func _AdditionalPropertiesItem_OneofSizer(msg proto.Message) (n int) { m := msg.(*AdditionalPropertiesItem) // oneof switch x := m.Oneof.(type) { case *AdditionalPropertiesItem_Schema: s := proto.Size(x.Schema) n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *AdditionalPropertiesItem_Boolean: n += proto.SizeVarint(2<<3 | proto.WireVarint) n += 1 case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } type Any struct { Value *google_protobuf.Any `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` Yaml string `protobuf:"bytes,2,opt,name=yaml" json:"yaml,omitempty"` } func (m *Any) Reset() { *m = Any{} } func (m *Any) String() string { return proto.CompactTextString(m) } func (*Any) ProtoMessage() {} func (*Any) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *Any) GetValue() *google_protobuf.Any { if m != nil { return m.Value } return nil } func (m *Any) GetYaml() string { if m != nil { return m.Yaml } return "" } type ApiKeySecurity struct { Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` In string `protobuf:"bytes,3,opt,name=in" json:"in,omitempty"` Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *ApiKeySecurity) Reset() { *m = ApiKeySecurity{} } func (m *ApiKeySecurity) String() string { return proto.CompactTextString(m) } func (*ApiKeySecurity) ProtoMessage() {} func (*ApiKeySecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *ApiKeySecurity) GetType() string { if m != nil { return m.Type } return "" } func (m *ApiKeySecurity) GetName() string { if m != nil { return m.Name } return "" } func (m *ApiKeySecurity) GetIn() string { if m != nil { return m.In } return "" } func (m *ApiKeySecurity) GetDescription() string { if m != nil { return m.Description } return "" } func (m *ApiKeySecurity) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type BasicAuthenticationSecurity struct { Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *BasicAuthenticationSecurity) Reset() { *m = BasicAuthenticationSecurity{} } func (m *BasicAuthenticationSecurity) String() string { return proto.CompactTextString(m) } func (*BasicAuthenticationSecurity) ProtoMessage() {} func (*BasicAuthenticationSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *BasicAuthenticationSecurity) GetType() string { if m != nil { return m.Type } return "" } func (m *BasicAuthenticationSecurity) GetDescription() string { if m != nil { return m.Description } return "" } func (m *BasicAuthenticationSecurity) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type BodyParameter struct { // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` // The name of the parameter. Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` // Determines the location of the parameter. In string `protobuf:"bytes,3,opt,name=in" json:"in,omitempty"` // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,4,opt,name=required" json:"required,omitempty"` Schema *Schema `protobuf:"bytes,5,opt,name=schema" json:"schema,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *BodyParameter) Reset() { *m = BodyParameter{} } func (m *BodyParameter) String() string { return proto.CompactTextString(m) } func (*BodyParameter) ProtoMessage() {} func (*BodyParameter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } func (m *BodyParameter) GetDescription() string { if m != nil { return m.Description } return "" } func (m *BodyParameter) GetName() string { if m != nil { return m.Name } return "" } func (m *BodyParameter) GetIn() string { if m != nil { return m.In } return "" } func (m *BodyParameter) GetRequired() bool { if m != nil { return m.Required } return false } func (m *BodyParameter) GetSchema() *Schema { if m != nil { return m.Schema } return nil } func (m *BodyParameter) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } // Contact information for the owners of the API. type Contact struct { // The identifying name of the contact person/organization. Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // The URL pointing to the contact information. Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` // The email address of the contact person/organization. Email string `protobuf:"bytes,3,opt,name=email" json:"email,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Contact) Reset() { *m = Contact{} } func (m *Contact) String() string { return proto.CompactTextString(m) } func (*Contact) ProtoMessage() {} func (*Contact) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } func (m *Contact) GetName() string { if m != nil { return m.Name } return "" } func (m *Contact) GetUrl() string { if m != nil { return m.Url } return "" } func (m *Contact) GetEmail() string { if m != nil { return m.Email } return "" } func (m *Contact) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Default struct { AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *Default) Reset() { *m = Default{} } func (m *Default) String() string { return proto.CompactTextString(m) } func (*Default) ProtoMessage() {} func (*Default) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } func (m *Default) GetAdditionalProperties() []*NamedAny { if m != nil { return m.AdditionalProperties } return nil } // One or more JSON objects describing the schemas being consumed and produced by the API. type Definitions struct { AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *Definitions) Reset() { *m = Definitions{} } func (m *Definitions) String() string { return proto.CompactTextString(m) } func (*Definitions) ProtoMessage() {} func (*Definitions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } func (m *Definitions) GetAdditionalProperties() []*NamedSchema { if m != nil { return m.AdditionalProperties } return nil } type Document struct { // The Swagger version of this document. Swagger string `protobuf:"bytes,1,opt,name=swagger" json:"swagger,omitempty"` Info *Info `protobuf:"bytes,2,opt,name=info" json:"info,omitempty"` // The host (name or ip) of the API. Example: 'swagger.io' Host string `protobuf:"bytes,3,opt,name=host" json:"host,omitempty"` // The base path to the API. Example: '/api'. BasePath string `protobuf:"bytes,4,opt,name=base_path,json=basePath" json:"base_path,omitempty"` // The transfer protocol of the API. Schemes []string `protobuf:"bytes,5,rep,name=schemes" json:"schemes,omitempty"` // A list of MIME types accepted by the API. Consumes []string `protobuf:"bytes,6,rep,name=consumes" json:"consumes,omitempty"` // A list of MIME types the API can produce. Produces []string `protobuf:"bytes,7,rep,name=produces" json:"produces,omitempty"` Paths *Paths `protobuf:"bytes,8,opt,name=paths" json:"paths,omitempty"` Definitions *Definitions `protobuf:"bytes,9,opt,name=definitions" json:"definitions,omitempty"` Parameters *ParameterDefinitions `protobuf:"bytes,10,opt,name=parameters" json:"parameters,omitempty"` Responses *ResponseDefinitions `protobuf:"bytes,11,opt,name=responses" json:"responses,omitempty"` Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security" json:"security,omitempty"` SecurityDefinitions *SecurityDefinitions `protobuf:"bytes,13,opt,name=security_definitions,json=securityDefinitions" json:"security_definitions,omitempty"` Tags []*Tag `protobuf:"bytes,14,rep,name=tags" json:"tags,omitempty"` ExternalDocs *ExternalDocs `protobuf:"bytes,15,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,16,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Document) Reset() { *m = Document{} } func (m *Document) String() string { return proto.CompactTextString(m) } func (*Document) ProtoMessage() {} func (*Document) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } func (m *Document) GetSwagger() string { if m != nil { return m.Swagger } return "" } func (m *Document) GetInfo() *Info { if m != nil { return m.Info } return nil } func (m *Document) GetHost() string { if m != nil { return m.Host } return "" } func (m *Document) GetBasePath() string { if m != nil { return m.BasePath } return "" } func (m *Document) GetSchemes() []string { if m != nil { return m.Schemes } return nil } func (m *Document) GetConsumes() []string { if m != nil { return m.Consumes } return nil } func (m *Document) GetProduces() []string { if m != nil { return m.Produces } return nil } func (m *Document) GetPaths() *Paths { if m != nil { return m.Paths } return nil } func (m *Document) GetDefinitions() *Definitions { if m != nil { return m.Definitions } return nil } func (m *Document) GetParameters() *ParameterDefinitions { if m != nil { return m.Parameters } return nil } func (m *Document) GetResponses() *ResponseDefinitions { if m != nil { return m.Responses } return nil } func (m *Document) GetSecurity() []*SecurityRequirement { if m != nil { return m.Security } return nil } func (m *Document) GetSecurityDefinitions() *SecurityDefinitions { if m != nil { return m.SecurityDefinitions } return nil } func (m *Document) GetTags() []*Tag { if m != nil { return m.Tags } return nil } func (m *Document) GetExternalDocs() *ExternalDocs { if m != nil { return m.ExternalDocs } return nil } func (m *Document) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Examples struct { AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *Examples) Reset() { *m = Examples{} } func (m *Examples) String() string { return proto.CompactTextString(m) } func (*Examples) ProtoMessage() {} func (*Examples) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } func (m *Examples) GetAdditionalProperties() []*NamedAny { if m != nil { return m.AdditionalProperties } return nil } // information about external documentation type ExternalDocs struct { Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *ExternalDocs) Reset() { *m = ExternalDocs{} } func (m *ExternalDocs) String() string { return proto.CompactTextString(m) } func (*ExternalDocs) ProtoMessage() {} func (*ExternalDocs) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } func (m *ExternalDocs) GetDescription() string { if m != nil { return m.Description } return "" } func (m *ExternalDocs) GetUrl() string { if m != nil { return m.Url } return "" } func (m *ExternalDocs) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } // A deterministic version of a JSON Schema object. type FileSchema struct { Format string `protobuf:"bytes,1,opt,name=format" json:"format,omitempty"` Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` Default *Any `protobuf:"bytes,4,opt,name=default" json:"default,omitempty"` Required []string `protobuf:"bytes,5,rep,name=required" json:"required,omitempty"` Type string `protobuf:"bytes,6,opt,name=type" json:"type,omitempty"` ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly" json:"read_only,omitempty"` ExternalDocs *ExternalDocs `protobuf:"bytes,8,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` Example *Any `protobuf:"bytes,9,opt,name=example" json:"example,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *FileSchema) Reset() { *m = FileSchema{} } func (m *FileSchema) String() string { return proto.CompactTextString(m) } func (*FileSchema) ProtoMessage() {} func (*FileSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } func (m *FileSchema) GetFormat() string { if m != nil { return m.Format } return "" } func (m *FileSchema) GetTitle() string { if m != nil { return m.Title } return "" } func (m *FileSchema) GetDescription() string { if m != nil { return m.Description } return "" } func (m *FileSchema) GetDefault() *Any { if m != nil { return m.Default } return nil } func (m *FileSchema) GetRequired() []string { if m != nil { return m.Required } return nil } func (m *FileSchema) GetType() string { if m != nil { return m.Type } return "" } func (m *FileSchema) GetReadOnly() bool { if m != nil { return m.ReadOnly } return false } func (m *FileSchema) GetExternalDocs() *ExternalDocs { if m != nil { return m.ExternalDocs } return nil } func (m *FileSchema) GetExample() *Any { if m != nil { return m.Example } return nil } func (m *FileSchema) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type FormDataParameterSubSchema struct { // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` // Determines the location of the parameter. In string `protobuf:"bytes,2,opt,name=in" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` // The name of the parameter. Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` // allows sending a parameter by name only or with an empty value. AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue" json:"allow_empty_value,omitempty"` Type string `protobuf:"bytes,6,opt,name=type" json:"type,omitempty"` Format string `protobuf:"bytes,7,opt,name=format" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,10,opt,name=default" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,11,opt,name=maximum" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,13,opt,name=minimum" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,17,opt,name=pattern" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,21,rep,name=enum" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *FormDataParameterSubSchema) Reset() { *m = FormDataParameterSubSchema{} } func (m *FormDataParameterSubSchema) String() string { return proto.CompactTextString(m) } func (*FormDataParameterSubSchema) ProtoMessage() {} func (*FormDataParameterSubSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } func (m *FormDataParameterSubSchema) GetRequired() bool { if m != nil { return m.Required } return false } func (m *FormDataParameterSubSchema) GetIn() string { if m != nil { return m.In } return "" } func (m *FormDataParameterSubSchema) GetDescription() string { if m != nil { return m.Description } return "" } func (m *FormDataParameterSubSchema) GetName() string { if m != nil { return m.Name } return "" } func (m *FormDataParameterSubSchema) GetAllowEmptyValue() bool { if m != nil { return m.AllowEmptyValue } return false } func (m *FormDataParameterSubSchema) GetType() string { if m != nil { return m.Type } return "" } func (m *FormDataParameterSubSchema) GetFormat() string { if m != nil { return m.Format } return "" } func (m *FormDataParameterSubSchema) GetItems() *PrimitivesItems { if m != nil { return m.Items } return nil } func (m *FormDataParameterSubSchema) GetCollectionFormat() string { if m != nil { return m.CollectionFormat } return "" } func (m *FormDataParameterSubSchema) GetDefault() *Any { if m != nil { return m.Default } return nil } func (m *FormDataParameterSubSchema) GetMaximum() float64 { if m != nil { return m.Maximum } return 0 } func (m *FormDataParameterSubSchema) GetExclusiveMaximum() bool { if m != nil { return m.ExclusiveMaximum } return false } func (m *FormDataParameterSubSchema) GetMinimum() float64 { if m != nil { return m.Minimum } return 0 } func (m *FormDataParameterSubSchema) GetExclusiveMinimum() bool { if m != nil { return m.ExclusiveMinimum } return false } func (m *FormDataParameterSubSchema) GetMaxLength() int64 { if m != nil { return m.MaxLength } return 0 } func (m *FormDataParameterSubSchema) GetMinLength() int64 { if m != nil { return m.MinLength } return 0 } func (m *FormDataParameterSubSchema) GetPattern() string { if m != nil { return m.Pattern } return "" } func (m *FormDataParameterSubSchema) GetMaxItems() int64 { if m != nil { return m.MaxItems } return 0 } func (m *FormDataParameterSubSchema) GetMinItems() int64 { if m != nil { return m.MinItems } return 0 } func (m *FormDataParameterSubSchema) GetUniqueItems() bool { if m != nil { return m.UniqueItems } return false } func (m *FormDataParameterSubSchema) GetEnum() []*Any { if m != nil { return m.Enum } return nil } func (m *FormDataParameterSubSchema) GetMultipleOf() float64 { if m != nil { return m.MultipleOf } return 0 } func (m *FormDataParameterSubSchema) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Header struct { Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` Format string `protobuf:"bytes,2,opt,name=format" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,5,opt,name=default" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,6,opt,name=maximum" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,8,opt,name=minimum" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,12,opt,name=pattern" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,16,rep,name=enum" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` Description string `protobuf:"bytes,18,opt,name=description" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,19,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Header) Reset() { *m = Header{} } func (m *Header) String() string { return proto.CompactTextString(m) } func (*Header) ProtoMessage() {} func (*Header) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } func (m *Header) GetType() string { if m != nil { return m.Type } return "" } func (m *Header) GetFormat() string { if m != nil { return m.Format } return "" } func (m *Header) GetItems() *PrimitivesItems { if m != nil { return m.Items } return nil } func (m *Header) GetCollectionFormat() string { if m != nil { return m.CollectionFormat } return "" } func (m *Header) GetDefault() *Any { if m != nil { return m.Default } return nil } func (m *Header) GetMaximum() float64 { if m != nil { return m.Maximum } return 0 } func (m *Header) GetExclusiveMaximum() bool { if m != nil { return m.ExclusiveMaximum } return false } func (m *Header) GetMinimum() float64 { if m != nil { return m.Minimum } return 0 } func (m *Header) GetExclusiveMinimum() bool { if m != nil { return m.ExclusiveMinimum } return false } func (m *Header) GetMaxLength() int64 { if m != nil { return m.MaxLength } return 0 } func (m *Header) GetMinLength() int64 { if m != nil { return m.MinLength } return 0 } func (m *Header) GetPattern() string { if m != nil { return m.Pattern } return "" } func (m *Header) GetMaxItems() int64 { if m != nil { return m.MaxItems } return 0 } func (m *Header) GetMinItems() int64 { if m != nil { return m.MinItems } return 0 } func (m *Header) GetUniqueItems() bool { if m != nil { return m.UniqueItems } return false } func (m *Header) GetEnum() []*Any { if m != nil { return m.Enum } return nil } func (m *Header) GetMultipleOf() float64 { if m != nil { return m.MultipleOf } return 0 } func (m *Header) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Header) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type HeaderParameterSubSchema struct { // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` // Determines the location of the parameter. In string `protobuf:"bytes,2,opt,name=in" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` // The name of the parameter. Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` Type string `protobuf:"bytes,5,opt,name=type" json:"type,omitempty"` Format string `protobuf:"bytes,6,opt,name=format" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,9,opt,name=default" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,10,opt,name=maximum" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,12,opt,name=minimum" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,16,opt,name=pattern" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,20,rep,name=enum" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *HeaderParameterSubSchema) Reset() { *m = HeaderParameterSubSchema{} } func (m *HeaderParameterSubSchema) String() string { return proto.CompactTextString(m) } func (*HeaderParameterSubSchema) ProtoMessage() {} func (*HeaderParameterSubSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } func (m *HeaderParameterSubSchema) GetRequired() bool { if m != nil { return m.Required } return false } func (m *HeaderParameterSubSchema) GetIn() string { if m != nil { return m.In } return "" } func (m *HeaderParameterSubSchema) GetDescription() string { if m != nil { return m.Description } return "" } func (m *HeaderParameterSubSchema) GetName() string { if m != nil { return m.Name } return "" } func (m *HeaderParameterSubSchema) GetType() string { if m != nil { return m.Type } return "" } func (m *HeaderParameterSubSchema) GetFormat() string { if m != nil { return m.Format } return "" } func (m *HeaderParameterSubSchema) GetItems() *PrimitivesItems { if m != nil { return m.Items } return nil } func (m *HeaderParameterSubSchema) GetCollectionFormat() string { if m != nil { return m.CollectionFormat } return "" } func (m *HeaderParameterSubSchema) GetDefault() *Any { if m != nil { return m.Default } return nil } func (m *HeaderParameterSubSchema) GetMaximum() float64 { if m != nil { return m.Maximum } return 0 } func (m *HeaderParameterSubSchema) GetExclusiveMaximum() bool { if m != nil { return m.ExclusiveMaximum } return false } func (m *HeaderParameterSubSchema) GetMinimum() float64 { if m != nil { return m.Minimum } return 0 } func (m *HeaderParameterSubSchema) GetExclusiveMinimum() bool { if m != nil { return m.ExclusiveMinimum } return false } func (m *HeaderParameterSubSchema) GetMaxLength() int64 { if m != nil { return m.MaxLength } return 0 } func (m *HeaderParameterSubSchema) GetMinLength() int64 { if m != nil { return m.MinLength } return 0 } func (m *HeaderParameterSubSchema) GetPattern() string { if m != nil { return m.Pattern } return "" } func (m *HeaderParameterSubSchema) GetMaxItems() int64 { if m != nil { return m.MaxItems } return 0 } func (m *HeaderParameterSubSchema) GetMinItems() int64 { if m != nil { return m.MinItems } return 0 } func (m *HeaderParameterSubSchema) GetUniqueItems() bool { if m != nil { return m.UniqueItems } return false } func (m *HeaderParameterSubSchema) GetEnum() []*Any { if m != nil { return m.Enum } return nil } func (m *HeaderParameterSubSchema) GetMultipleOf() float64 { if m != nil { return m.MultipleOf } return 0 } func (m *HeaderParameterSubSchema) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Headers struct { AdditionalProperties []*NamedHeader `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *Headers) Reset() { *m = Headers{} } func (m *Headers) String() string { return proto.CompactTextString(m) } func (*Headers) ProtoMessage() {} func (*Headers) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } func (m *Headers) GetAdditionalProperties() []*NamedHeader { if m != nil { return m.AdditionalProperties } return nil } // General information about the API. type Info struct { // A unique and precise title of the API. Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` // A semantic version number of the API. Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` // The terms of service for the API. TermsOfService string `protobuf:"bytes,4,opt,name=terms_of_service,json=termsOfService" json:"terms_of_service,omitempty"` Contact *Contact `protobuf:"bytes,5,opt,name=contact" json:"contact,omitempty"` License *License `protobuf:"bytes,6,opt,name=license" json:"license,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Info) Reset() { *m = Info{} } func (m *Info) String() string { return proto.CompactTextString(m) } func (*Info) ProtoMessage() {} func (*Info) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } func (m *Info) GetTitle() string { if m != nil { return m.Title } return "" } func (m *Info) GetVersion() string { if m != nil { return m.Version } return "" } func (m *Info) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Info) GetTermsOfService() string { if m != nil { return m.TermsOfService } return "" } func (m *Info) GetContact() *Contact { if m != nil { return m.Contact } return nil } func (m *Info) GetLicense() *License { if m != nil { return m.License } return nil } func (m *Info) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type ItemsItem struct { Schema []*Schema `protobuf:"bytes,1,rep,name=schema" json:"schema,omitempty"` } func (m *ItemsItem) Reset() { *m = ItemsItem{} } func (m *ItemsItem) String() string { return proto.CompactTextString(m) } func (*ItemsItem) ProtoMessage() {} func (*ItemsItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } func (m *ItemsItem) GetSchema() []*Schema { if m != nil { return m.Schema } return nil } type JsonReference struct { XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref" json:"_ref,omitempty"` Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` } func (m *JsonReference) Reset() { *m = JsonReference{} } func (m *JsonReference) String() string { return proto.CompactTextString(m) } func (*JsonReference) ProtoMessage() {} func (*JsonReference) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } func (m *JsonReference) GetXRef() string { if m != nil { return m.XRef } return "" } func (m *JsonReference) GetDescription() string { if m != nil { return m.Description } return "" } type License struct { // The name of the license type. It's encouraged to use an OSI compatible license. Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // The URL pointing to the license. Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,3,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *License) Reset() { *m = License{} } func (m *License) String() string { return proto.CompactTextString(m) } func (*License) ProtoMessage() {} func (*License) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } func (m *License) GetName() string { if m != nil { return m.Name } return "" } func (m *License) GetUrl() string { if m != nil { return m.Url } return "" } func (m *License) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } // Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. type NamedAny struct { // Map key Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value Value *Any `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } func (m *NamedAny) Reset() { *m = NamedAny{} } func (m *NamedAny) String() string { return proto.CompactTextString(m) } func (*NamedAny) ProtoMessage() {} func (*NamedAny) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } func (m *NamedAny) GetName() string { if m != nil { return m.Name } return "" } func (m *NamedAny) GetValue() *Any { if m != nil { return m.Value } return nil } // Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. type NamedHeader struct { // Map key Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value Value *Header `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } func (m *NamedHeader) Reset() { *m = NamedHeader{} } func (m *NamedHeader) String() string { return proto.CompactTextString(m) } func (*NamedHeader) ProtoMessage() {} func (*NamedHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } func (m *NamedHeader) GetName() string { if m != nil { return m.Name } return "" } func (m *NamedHeader) GetValue() *Header { if m != nil { return m.Value } return nil } // Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. type NamedParameter struct { // Map key Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value Value *Parameter `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } func (m *NamedParameter) Reset() { *m = NamedParameter{} } func (m *NamedParameter) String() string { return proto.CompactTextString(m) } func (*NamedParameter) ProtoMessage() {} func (*NamedParameter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } func (m *NamedParameter) GetName() string { if m != nil { return m.Name } return "" } func (m *NamedParameter) GetValue() *Parameter { if m != nil { return m.Value } return nil } // Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. type NamedPathItem struct { // Map key Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value Value *PathItem `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } func (m *NamedPathItem) Reset() { *m = NamedPathItem{} } func (m *NamedPathItem) String() string { return proto.CompactTextString(m) } func (*NamedPathItem) ProtoMessage() {} func (*NamedPathItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } func (m *NamedPathItem) GetName() string { if m != nil { return m.Name } return "" } func (m *NamedPathItem) GetValue() *PathItem { if m != nil { return m.Value } return nil } // Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. type NamedResponse struct { // Map key Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value Value *Response `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } func (m *NamedResponse) Reset() { *m = NamedResponse{} } func (m *NamedResponse) String() string { return proto.CompactTextString(m) } func (*NamedResponse) ProtoMessage() {} func (*NamedResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } func (m *NamedResponse) GetName() string { if m != nil { return m.Name } return "" } func (m *NamedResponse) GetValue() *Response { if m != nil { return m.Value } return nil } // Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. type NamedResponseValue struct { // Map key Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value Value *ResponseValue `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } func (m *NamedResponseValue) Reset() { *m = NamedResponseValue{} } func (m *NamedResponseValue) String() string { return proto.CompactTextString(m) } func (*NamedResponseValue) ProtoMessage() {} func (*NamedResponseValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } func (m *NamedResponseValue) GetName() string { if m != nil { return m.Name } return "" } func (m *NamedResponseValue) GetValue() *ResponseValue { if m != nil { return m.Value } return nil } // Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. type NamedSchema struct { // Map key Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value Value *Schema `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } func (m *NamedSchema) Reset() { *m = NamedSchema{} } func (m *NamedSchema) String() string { return proto.CompactTextString(m) } func (*NamedSchema) ProtoMessage() {} func (*NamedSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } func (m *NamedSchema) GetName() string { if m != nil { return m.Name } return "" } func (m *NamedSchema) GetValue() *Schema { if m != nil { return m.Value } return nil } // Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. type NamedSecurityDefinitionsItem struct { // Map key Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value Value *SecurityDefinitionsItem `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } func (m *NamedSecurityDefinitionsItem) Reset() { *m = NamedSecurityDefinitionsItem{} } func (m *NamedSecurityDefinitionsItem) String() string { return proto.CompactTextString(m) } func (*NamedSecurityDefinitionsItem) ProtoMessage() {} func (*NamedSecurityDefinitionsItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{27} } func (m *NamedSecurityDefinitionsItem) GetName() string { if m != nil { return m.Name } return "" } func (m *NamedSecurityDefinitionsItem) GetValue() *SecurityDefinitionsItem { if m != nil { return m.Value } return nil } // Automatically-generated message used to represent maps of string as ordered (name,value) pairs. type NamedString struct { // Map key Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } func (m *NamedString) Reset() { *m = NamedString{} } func (m *NamedString) String() string { return proto.CompactTextString(m) } func (*NamedString) ProtoMessage() {} func (*NamedString) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{28} } func (m *NamedString) GetName() string { if m != nil { return m.Name } return "" } func (m *NamedString) GetValue() string { if m != nil { return m.Value } return "" } // Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. type NamedStringArray struct { // Map key Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // Mapped value Value *StringArray `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` } func (m *NamedStringArray) Reset() { *m = NamedStringArray{} } func (m *NamedStringArray) String() string { return proto.CompactTextString(m) } func (*NamedStringArray) ProtoMessage() {} func (*NamedStringArray) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{29} } func (m *NamedStringArray) GetName() string { if m != nil { return m.Name } return "" } func (m *NamedStringArray) GetValue() *StringArray { if m != nil { return m.Value } return nil } type NonBodyParameter struct { // Types that are valid to be assigned to Oneof: // *NonBodyParameter_HeaderParameterSubSchema // *NonBodyParameter_FormDataParameterSubSchema // *NonBodyParameter_QueryParameterSubSchema // *NonBodyParameter_PathParameterSubSchema Oneof isNonBodyParameter_Oneof `protobuf_oneof:"oneof"` } func (m *NonBodyParameter) Reset() { *m = NonBodyParameter{} } func (m *NonBodyParameter) String() string { return proto.CompactTextString(m) } func (*NonBodyParameter) ProtoMessage() {} func (*NonBodyParameter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{30} } type isNonBodyParameter_Oneof interface { isNonBodyParameter_Oneof() } type NonBodyParameter_HeaderParameterSubSchema struct { HeaderParameterSubSchema *HeaderParameterSubSchema `protobuf:"bytes,1,opt,name=header_parameter_sub_schema,json=headerParameterSubSchema,oneof"` } type NonBodyParameter_FormDataParameterSubSchema struct { FormDataParameterSubSchema *FormDataParameterSubSchema `protobuf:"bytes,2,opt,name=form_data_parameter_sub_schema,json=formDataParameterSubSchema,oneof"` } type NonBodyParameter_QueryParameterSubSchema struct { QueryParameterSubSchema *QueryParameterSubSchema `protobuf:"bytes,3,opt,name=query_parameter_sub_schema,json=queryParameterSubSchema,oneof"` } type NonBodyParameter_PathParameterSubSchema struct { PathParameterSubSchema *PathParameterSubSchema `protobuf:"bytes,4,opt,name=path_parameter_sub_schema,json=pathParameterSubSchema,oneof"` } func (*NonBodyParameter_HeaderParameterSubSchema) isNonBodyParameter_Oneof() {} func (*NonBodyParameter_FormDataParameterSubSchema) isNonBodyParameter_Oneof() {} func (*NonBodyParameter_QueryParameterSubSchema) isNonBodyParameter_Oneof() {} func (*NonBodyParameter_PathParameterSubSchema) isNonBodyParameter_Oneof() {} func (m *NonBodyParameter) GetOneof() isNonBodyParameter_Oneof { if m != nil { return m.Oneof } return nil } func (m *NonBodyParameter) GetHeaderParameterSubSchema() *HeaderParameterSubSchema { if x, ok := m.GetOneof().(*NonBodyParameter_HeaderParameterSubSchema); ok { return x.HeaderParameterSubSchema } return nil } func (m *NonBodyParameter) GetFormDataParameterSubSchema() *FormDataParameterSubSchema { if x, ok := m.GetOneof().(*NonBodyParameter_FormDataParameterSubSchema); ok { return x.FormDataParameterSubSchema } return nil } func (m *NonBodyParameter) GetQueryParameterSubSchema() *QueryParameterSubSchema { if x, ok := m.GetOneof().(*NonBodyParameter_QueryParameterSubSchema); ok { return x.QueryParameterSubSchema } return nil } func (m *NonBodyParameter) GetPathParameterSubSchema() *PathParameterSubSchema { if x, ok := m.GetOneof().(*NonBodyParameter_PathParameterSubSchema); ok { return x.PathParameterSubSchema } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*NonBodyParameter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _NonBodyParameter_OneofMarshaler, _NonBodyParameter_OneofUnmarshaler, _NonBodyParameter_OneofSizer, []interface{}{ (*NonBodyParameter_HeaderParameterSubSchema)(nil), (*NonBodyParameter_FormDataParameterSubSchema)(nil), (*NonBodyParameter_QueryParameterSubSchema)(nil), (*NonBodyParameter_PathParameterSubSchema)(nil), } } func _NonBodyParameter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*NonBodyParameter) // oneof switch x := m.Oneof.(type) { case *NonBodyParameter_HeaderParameterSubSchema: b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.HeaderParameterSubSchema); err != nil { return err } case *NonBodyParameter_FormDataParameterSubSchema: b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.FormDataParameterSubSchema); err != nil { return err } case *NonBodyParameter_QueryParameterSubSchema: b.EncodeVarint(3<<3 | proto.WireBytes) if err := b.EncodeMessage(x.QueryParameterSubSchema); err != nil { return err } case *NonBodyParameter_PathParameterSubSchema: b.EncodeVarint(4<<3 | proto.WireBytes) if err := b.EncodeMessage(x.PathParameterSubSchema); err != nil { return err } case nil: default: return fmt.Errorf("NonBodyParameter.Oneof has unexpected type %T", x) } return nil } func _NonBodyParameter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*NonBodyParameter) switch tag { case 1: // oneof.header_parameter_sub_schema if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(HeaderParameterSubSchema) err := b.DecodeMessage(msg) m.Oneof = &NonBodyParameter_HeaderParameterSubSchema{msg} return true, err case 2: // oneof.form_data_parameter_sub_schema if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(FormDataParameterSubSchema) err := b.DecodeMessage(msg) m.Oneof = &NonBodyParameter_FormDataParameterSubSchema{msg} return true, err case 3: // oneof.query_parameter_sub_schema if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(QueryParameterSubSchema) err := b.DecodeMessage(msg) m.Oneof = &NonBodyParameter_QueryParameterSubSchema{msg} return true, err case 4: // oneof.path_parameter_sub_schema if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(PathParameterSubSchema) err := b.DecodeMessage(msg) m.Oneof = &NonBodyParameter_PathParameterSubSchema{msg} return true, err default: return false, nil } } func _NonBodyParameter_OneofSizer(msg proto.Message) (n int) { m := msg.(*NonBodyParameter) // oneof switch x := m.Oneof.(type) { case *NonBodyParameter_HeaderParameterSubSchema: s := proto.Size(x.HeaderParameterSubSchema) n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *NonBodyParameter_FormDataParameterSubSchema: s := proto.Size(x.FormDataParameterSubSchema) n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *NonBodyParameter_QueryParameterSubSchema: s := proto.Size(x.QueryParameterSubSchema) n += proto.SizeVarint(3<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *NonBodyParameter_PathParameterSubSchema: s := proto.Size(x.PathParameterSubSchema) n += proto.SizeVarint(4<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } type Oauth2AccessCodeSecurity struct { Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` Flow string `protobuf:"bytes,2,opt,name=flow" json:"flow,omitempty"` Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes" json:"scopes,omitempty"` AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl" json:"authorization_url,omitempty"` TokenUrl string `protobuf:"bytes,5,opt,name=token_url,json=tokenUrl" json:"token_url,omitempty"` Description string `protobuf:"bytes,6,opt,name=description" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,7,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Oauth2AccessCodeSecurity) Reset() { *m = Oauth2AccessCodeSecurity{} } func (m *Oauth2AccessCodeSecurity) String() string { return proto.CompactTextString(m) } func (*Oauth2AccessCodeSecurity) ProtoMessage() {} func (*Oauth2AccessCodeSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{31} } func (m *Oauth2AccessCodeSecurity) GetType() string { if m != nil { return m.Type } return "" } func (m *Oauth2AccessCodeSecurity) GetFlow() string { if m != nil { return m.Flow } return "" } func (m *Oauth2AccessCodeSecurity) GetScopes() *Oauth2Scopes { if m != nil { return m.Scopes } return nil } func (m *Oauth2AccessCodeSecurity) GetAuthorizationUrl() string { if m != nil { return m.AuthorizationUrl } return "" } func (m *Oauth2AccessCodeSecurity) GetTokenUrl() string { if m != nil { return m.TokenUrl } return "" } func (m *Oauth2AccessCodeSecurity) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Oauth2AccessCodeSecurity) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Oauth2ApplicationSecurity struct { Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` Flow string `protobuf:"bytes,2,opt,name=flow" json:"flow,omitempty"` Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes" json:"scopes,omitempty"` TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl" json:"token_url,omitempty"` Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Oauth2ApplicationSecurity) Reset() { *m = Oauth2ApplicationSecurity{} } func (m *Oauth2ApplicationSecurity) String() string { return proto.CompactTextString(m) } func (*Oauth2ApplicationSecurity) ProtoMessage() {} func (*Oauth2ApplicationSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{32} } func (m *Oauth2ApplicationSecurity) GetType() string { if m != nil { return m.Type } return "" } func (m *Oauth2ApplicationSecurity) GetFlow() string { if m != nil { return m.Flow } return "" } func (m *Oauth2ApplicationSecurity) GetScopes() *Oauth2Scopes { if m != nil { return m.Scopes } return nil } func (m *Oauth2ApplicationSecurity) GetTokenUrl() string { if m != nil { return m.TokenUrl } return "" } func (m *Oauth2ApplicationSecurity) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Oauth2ApplicationSecurity) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Oauth2ImplicitSecurity struct { Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` Flow string `protobuf:"bytes,2,opt,name=flow" json:"flow,omitempty"` Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes" json:"scopes,omitempty"` AuthorizationUrl string `protobuf:"bytes,4,opt,name=authorization_url,json=authorizationUrl" json:"authorization_url,omitempty"` Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Oauth2ImplicitSecurity) Reset() { *m = Oauth2ImplicitSecurity{} } func (m *Oauth2ImplicitSecurity) String() string { return proto.CompactTextString(m) } func (*Oauth2ImplicitSecurity) ProtoMessage() {} func (*Oauth2ImplicitSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{33} } func (m *Oauth2ImplicitSecurity) GetType() string { if m != nil { return m.Type } return "" } func (m *Oauth2ImplicitSecurity) GetFlow() string { if m != nil { return m.Flow } return "" } func (m *Oauth2ImplicitSecurity) GetScopes() *Oauth2Scopes { if m != nil { return m.Scopes } return nil } func (m *Oauth2ImplicitSecurity) GetAuthorizationUrl() string { if m != nil { return m.AuthorizationUrl } return "" } func (m *Oauth2ImplicitSecurity) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Oauth2ImplicitSecurity) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Oauth2PasswordSecurity struct { Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` Flow string `protobuf:"bytes,2,opt,name=flow" json:"flow,omitempty"` Scopes *Oauth2Scopes `protobuf:"bytes,3,opt,name=scopes" json:"scopes,omitempty"` TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl" json:"token_url,omitempty"` Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Oauth2PasswordSecurity) Reset() { *m = Oauth2PasswordSecurity{} } func (m *Oauth2PasswordSecurity) String() string { return proto.CompactTextString(m) } func (*Oauth2PasswordSecurity) ProtoMessage() {} func (*Oauth2PasswordSecurity) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{34} } func (m *Oauth2PasswordSecurity) GetType() string { if m != nil { return m.Type } return "" } func (m *Oauth2PasswordSecurity) GetFlow() string { if m != nil { return m.Flow } return "" } func (m *Oauth2PasswordSecurity) GetScopes() *Oauth2Scopes { if m != nil { return m.Scopes } return nil } func (m *Oauth2PasswordSecurity) GetTokenUrl() string { if m != nil { return m.TokenUrl } return "" } func (m *Oauth2PasswordSecurity) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Oauth2PasswordSecurity) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Oauth2Scopes struct { AdditionalProperties []*NamedString `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *Oauth2Scopes) Reset() { *m = Oauth2Scopes{} } func (m *Oauth2Scopes) String() string { return proto.CompactTextString(m) } func (*Oauth2Scopes) ProtoMessage() {} func (*Oauth2Scopes) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{35} } func (m *Oauth2Scopes) GetAdditionalProperties() []*NamedString { if m != nil { return m.AdditionalProperties } return nil } type Operation struct { Tags []string `protobuf:"bytes,1,rep,name=tags" json:"tags,omitempty"` // A brief summary of the operation. Summary string `protobuf:"bytes,2,opt,name=summary" json:"summary,omitempty"` // A longer description of the operation, GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` ExternalDocs *ExternalDocs `protobuf:"bytes,4,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` // A unique identifier of the operation. OperationId string `protobuf:"bytes,5,opt,name=operation_id,json=operationId" json:"operation_id,omitempty"` // A list of MIME types the API can produce. Produces []string `protobuf:"bytes,6,rep,name=produces" json:"produces,omitempty"` // A list of MIME types the API can consume. Consumes []string `protobuf:"bytes,7,rep,name=consumes" json:"consumes,omitempty"` // The parameters needed to send a valid API call. Parameters []*ParametersItem `protobuf:"bytes,8,rep,name=parameters" json:"parameters,omitempty"` Responses *Responses `protobuf:"bytes,9,opt,name=responses" json:"responses,omitempty"` // The transfer protocol of the API. Schemes []string `protobuf:"bytes,10,rep,name=schemes" json:"schemes,omitempty"` Deprecated bool `protobuf:"varint,11,opt,name=deprecated" json:"deprecated,omitempty"` Security []*SecurityRequirement `protobuf:"bytes,12,rep,name=security" json:"security,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,13,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Operation) Reset() { *m = Operation{} } func (m *Operation) String() string { return proto.CompactTextString(m) } func (*Operation) ProtoMessage() {} func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{36} } func (m *Operation) GetTags() []string { if m != nil { return m.Tags } return nil } func (m *Operation) GetSummary() string { if m != nil { return m.Summary } return "" } func (m *Operation) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Operation) GetExternalDocs() *ExternalDocs { if m != nil { return m.ExternalDocs } return nil } func (m *Operation) GetOperationId() string { if m != nil { return m.OperationId } return "" } func (m *Operation) GetProduces() []string { if m != nil { return m.Produces } return nil } func (m *Operation) GetConsumes() []string { if m != nil { return m.Consumes } return nil } func (m *Operation) GetParameters() []*ParametersItem { if m != nil { return m.Parameters } return nil } func (m *Operation) GetResponses() *Responses { if m != nil { return m.Responses } return nil } func (m *Operation) GetSchemes() []string { if m != nil { return m.Schemes } return nil } func (m *Operation) GetDeprecated() bool { if m != nil { return m.Deprecated } return false } func (m *Operation) GetSecurity() []*SecurityRequirement { if m != nil { return m.Security } return nil } func (m *Operation) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Parameter struct { // Types that are valid to be assigned to Oneof: // *Parameter_BodyParameter // *Parameter_NonBodyParameter Oneof isParameter_Oneof `protobuf_oneof:"oneof"` } func (m *Parameter) Reset() { *m = Parameter{} } func (m *Parameter) String() string { return proto.CompactTextString(m) } func (*Parameter) ProtoMessage() {} func (*Parameter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{37} } type isParameter_Oneof interface { isParameter_Oneof() } type Parameter_BodyParameter struct { BodyParameter *BodyParameter `protobuf:"bytes,1,opt,name=body_parameter,json=bodyParameter,oneof"` } type Parameter_NonBodyParameter struct { NonBodyParameter *NonBodyParameter `protobuf:"bytes,2,opt,name=non_body_parameter,json=nonBodyParameter,oneof"` } func (*Parameter_BodyParameter) isParameter_Oneof() {} func (*Parameter_NonBodyParameter) isParameter_Oneof() {} func (m *Parameter) GetOneof() isParameter_Oneof { if m != nil { return m.Oneof } return nil } func (m *Parameter) GetBodyParameter() *BodyParameter { if x, ok := m.GetOneof().(*Parameter_BodyParameter); ok { return x.BodyParameter } return nil } func (m *Parameter) GetNonBodyParameter() *NonBodyParameter { if x, ok := m.GetOneof().(*Parameter_NonBodyParameter); ok { return x.NonBodyParameter } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*Parameter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _Parameter_OneofMarshaler, _Parameter_OneofUnmarshaler, _Parameter_OneofSizer, []interface{}{ (*Parameter_BodyParameter)(nil), (*Parameter_NonBodyParameter)(nil), } } func _Parameter_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*Parameter) // oneof switch x := m.Oneof.(type) { case *Parameter_BodyParameter: b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.BodyParameter); err != nil { return err } case *Parameter_NonBodyParameter: b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.NonBodyParameter); err != nil { return err } case nil: default: return fmt.Errorf("Parameter.Oneof has unexpected type %T", x) } return nil } func _Parameter_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*Parameter) switch tag { case 1: // oneof.body_parameter if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(BodyParameter) err := b.DecodeMessage(msg) m.Oneof = &Parameter_BodyParameter{msg} return true, err case 2: // oneof.non_body_parameter if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(NonBodyParameter) err := b.DecodeMessage(msg) m.Oneof = &Parameter_NonBodyParameter{msg} return true, err default: return false, nil } } func _Parameter_OneofSizer(msg proto.Message) (n int) { m := msg.(*Parameter) // oneof switch x := m.Oneof.(type) { case *Parameter_BodyParameter: s := proto.Size(x.BodyParameter) n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *Parameter_NonBodyParameter: s := proto.Size(x.NonBodyParameter) n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } // One or more JSON representations for parameters type ParameterDefinitions struct { AdditionalProperties []*NamedParameter `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *ParameterDefinitions) Reset() { *m = ParameterDefinitions{} } func (m *ParameterDefinitions) String() string { return proto.CompactTextString(m) } func (*ParameterDefinitions) ProtoMessage() {} func (*ParameterDefinitions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{38} } func (m *ParameterDefinitions) GetAdditionalProperties() []*NamedParameter { if m != nil { return m.AdditionalProperties } return nil } type ParametersItem struct { // Types that are valid to be assigned to Oneof: // *ParametersItem_Parameter // *ParametersItem_JsonReference Oneof isParametersItem_Oneof `protobuf_oneof:"oneof"` } func (m *ParametersItem) Reset() { *m = ParametersItem{} } func (m *ParametersItem) String() string { return proto.CompactTextString(m) } func (*ParametersItem) ProtoMessage() {} func (*ParametersItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{39} } type isParametersItem_Oneof interface { isParametersItem_Oneof() } type ParametersItem_Parameter struct { Parameter *Parameter `protobuf:"bytes,1,opt,name=parameter,oneof"` } type ParametersItem_JsonReference struct { JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,oneof"` } func (*ParametersItem_Parameter) isParametersItem_Oneof() {} func (*ParametersItem_JsonReference) isParametersItem_Oneof() {} func (m *ParametersItem) GetOneof() isParametersItem_Oneof { if m != nil { return m.Oneof } return nil } func (m *ParametersItem) GetParameter() *Parameter { if x, ok := m.GetOneof().(*ParametersItem_Parameter); ok { return x.Parameter } return nil } func (m *ParametersItem) GetJsonReference() *JsonReference { if x, ok := m.GetOneof().(*ParametersItem_JsonReference); ok { return x.JsonReference } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*ParametersItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _ParametersItem_OneofMarshaler, _ParametersItem_OneofUnmarshaler, _ParametersItem_OneofSizer, []interface{}{ (*ParametersItem_Parameter)(nil), (*ParametersItem_JsonReference)(nil), } } func _ParametersItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*ParametersItem) // oneof switch x := m.Oneof.(type) { case *ParametersItem_Parameter: b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Parameter); err != nil { return err } case *ParametersItem_JsonReference: b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.JsonReference); err != nil { return err } case nil: default: return fmt.Errorf("ParametersItem.Oneof has unexpected type %T", x) } return nil } func _ParametersItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*ParametersItem) switch tag { case 1: // oneof.parameter if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(Parameter) err := b.DecodeMessage(msg) m.Oneof = &ParametersItem_Parameter{msg} return true, err case 2: // oneof.json_reference if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(JsonReference) err := b.DecodeMessage(msg) m.Oneof = &ParametersItem_JsonReference{msg} return true, err default: return false, nil } } func _ParametersItem_OneofSizer(msg proto.Message) (n int) { m := msg.(*ParametersItem) // oneof switch x := m.Oneof.(type) { case *ParametersItem_Parameter: s := proto.Size(x.Parameter) n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *ParametersItem_JsonReference: s := proto.Size(x.JsonReference) n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } type PathItem struct { XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref" json:"_ref,omitempty"` Get *Operation `protobuf:"bytes,2,opt,name=get" json:"get,omitempty"` Put *Operation `protobuf:"bytes,3,opt,name=put" json:"put,omitempty"` Post *Operation `protobuf:"bytes,4,opt,name=post" json:"post,omitempty"` Delete *Operation `protobuf:"bytes,5,opt,name=delete" json:"delete,omitempty"` Options *Operation `protobuf:"bytes,6,opt,name=options" json:"options,omitempty"` Head *Operation `protobuf:"bytes,7,opt,name=head" json:"head,omitempty"` Patch *Operation `protobuf:"bytes,8,opt,name=patch" json:"patch,omitempty"` // The parameters needed to send a valid API call. Parameters []*ParametersItem `protobuf:"bytes,9,rep,name=parameters" json:"parameters,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,10,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *PathItem) Reset() { *m = PathItem{} } func (m *PathItem) String() string { return proto.CompactTextString(m) } func (*PathItem) ProtoMessage() {} func (*PathItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{40} } func (m *PathItem) GetXRef() string { if m != nil { return m.XRef } return "" } func (m *PathItem) GetGet() *Operation { if m != nil { return m.Get } return nil } func (m *PathItem) GetPut() *Operation { if m != nil { return m.Put } return nil } func (m *PathItem) GetPost() *Operation { if m != nil { return m.Post } return nil } func (m *PathItem) GetDelete() *Operation { if m != nil { return m.Delete } return nil } func (m *PathItem) GetOptions() *Operation { if m != nil { return m.Options } return nil } func (m *PathItem) GetHead() *Operation { if m != nil { return m.Head } return nil } func (m *PathItem) GetPatch() *Operation { if m != nil { return m.Patch } return nil } func (m *PathItem) GetParameters() []*ParametersItem { if m != nil { return m.Parameters } return nil } func (m *PathItem) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type PathParameterSubSchema struct { // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` // Determines the location of the parameter. In string `protobuf:"bytes,2,opt,name=in" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` // The name of the parameter. Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` Type string `protobuf:"bytes,5,opt,name=type" json:"type,omitempty"` Format string `protobuf:"bytes,6,opt,name=format" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,7,opt,name=items" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,8,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,9,opt,name=default" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,10,opt,name=maximum" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,11,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,12,opt,name=minimum" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,13,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,14,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,15,opt,name=min_length,json=minLength" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,16,opt,name=pattern" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,17,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,18,opt,name=min_items,json=minItems" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,19,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,20,rep,name=enum" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,21,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,22,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *PathParameterSubSchema) Reset() { *m = PathParameterSubSchema{} } func (m *PathParameterSubSchema) String() string { return proto.CompactTextString(m) } func (*PathParameterSubSchema) ProtoMessage() {} func (*PathParameterSubSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{41} } func (m *PathParameterSubSchema) GetRequired() bool { if m != nil { return m.Required } return false } func (m *PathParameterSubSchema) GetIn() string { if m != nil { return m.In } return "" } func (m *PathParameterSubSchema) GetDescription() string { if m != nil { return m.Description } return "" } func (m *PathParameterSubSchema) GetName() string { if m != nil { return m.Name } return "" } func (m *PathParameterSubSchema) GetType() string { if m != nil { return m.Type } return "" } func (m *PathParameterSubSchema) GetFormat() string { if m != nil { return m.Format } return "" } func (m *PathParameterSubSchema) GetItems() *PrimitivesItems { if m != nil { return m.Items } return nil } func (m *PathParameterSubSchema) GetCollectionFormat() string { if m != nil { return m.CollectionFormat } return "" } func (m *PathParameterSubSchema) GetDefault() *Any { if m != nil { return m.Default } return nil } func (m *PathParameterSubSchema) GetMaximum() float64 { if m != nil { return m.Maximum } return 0 } func (m *PathParameterSubSchema) GetExclusiveMaximum() bool { if m != nil { return m.ExclusiveMaximum } return false } func (m *PathParameterSubSchema) GetMinimum() float64 { if m != nil { return m.Minimum } return 0 } func (m *PathParameterSubSchema) GetExclusiveMinimum() bool { if m != nil { return m.ExclusiveMinimum } return false } func (m *PathParameterSubSchema) GetMaxLength() int64 { if m != nil { return m.MaxLength } return 0 } func (m *PathParameterSubSchema) GetMinLength() int64 { if m != nil { return m.MinLength } return 0 } func (m *PathParameterSubSchema) GetPattern() string { if m != nil { return m.Pattern } return "" } func (m *PathParameterSubSchema) GetMaxItems() int64 { if m != nil { return m.MaxItems } return 0 } func (m *PathParameterSubSchema) GetMinItems() int64 { if m != nil { return m.MinItems } return 0 } func (m *PathParameterSubSchema) GetUniqueItems() bool { if m != nil { return m.UniqueItems } return false } func (m *PathParameterSubSchema) GetEnum() []*Any { if m != nil { return m.Enum } return nil } func (m *PathParameterSubSchema) GetMultipleOf() float64 { if m != nil { return m.MultipleOf } return 0 } func (m *PathParameterSubSchema) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } // Relative paths to the individual endpoints. They must be relative to the 'basePath'. type Paths struct { VendorExtension []*NamedAny `protobuf:"bytes,1,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` Path []*NamedPathItem `protobuf:"bytes,2,rep,name=path" json:"path,omitempty"` } func (m *Paths) Reset() { *m = Paths{} } func (m *Paths) String() string { return proto.CompactTextString(m) } func (*Paths) ProtoMessage() {} func (*Paths) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{42} } func (m *Paths) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } func (m *Paths) GetPath() []*NamedPathItem { if m != nil { return m.Path } return nil } type PrimitivesItems struct { Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` Format string `protobuf:"bytes,2,opt,name=format" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,3,opt,name=items" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,4,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,5,opt,name=default" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,6,opt,name=maximum" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,7,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,8,opt,name=minimum" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,9,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,10,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,11,opt,name=min_length,json=minLength" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,12,opt,name=pattern" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,13,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,14,opt,name=min_items,json=minItems" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,15,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,16,rep,name=enum" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,17,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,18,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *PrimitivesItems) Reset() { *m = PrimitivesItems{} } func (m *PrimitivesItems) String() string { return proto.CompactTextString(m) } func (*PrimitivesItems) ProtoMessage() {} func (*PrimitivesItems) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{43} } func (m *PrimitivesItems) GetType() string { if m != nil { return m.Type } return "" } func (m *PrimitivesItems) GetFormat() string { if m != nil { return m.Format } return "" } func (m *PrimitivesItems) GetItems() *PrimitivesItems { if m != nil { return m.Items } return nil } func (m *PrimitivesItems) GetCollectionFormat() string { if m != nil { return m.CollectionFormat } return "" } func (m *PrimitivesItems) GetDefault() *Any { if m != nil { return m.Default } return nil } func (m *PrimitivesItems) GetMaximum() float64 { if m != nil { return m.Maximum } return 0 } func (m *PrimitivesItems) GetExclusiveMaximum() bool { if m != nil { return m.ExclusiveMaximum } return false } func (m *PrimitivesItems) GetMinimum() float64 { if m != nil { return m.Minimum } return 0 } func (m *PrimitivesItems) GetExclusiveMinimum() bool { if m != nil { return m.ExclusiveMinimum } return false } func (m *PrimitivesItems) GetMaxLength() int64 { if m != nil { return m.MaxLength } return 0 } func (m *PrimitivesItems) GetMinLength() int64 { if m != nil { return m.MinLength } return 0 } func (m *PrimitivesItems) GetPattern() string { if m != nil { return m.Pattern } return "" } func (m *PrimitivesItems) GetMaxItems() int64 { if m != nil { return m.MaxItems } return 0 } func (m *PrimitivesItems) GetMinItems() int64 { if m != nil { return m.MinItems } return 0 } func (m *PrimitivesItems) GetUniqueItems() bool { if m != nil { return m.UniqueItems } return false } func (m *PrimitivesItems) GetEnum() []*Any { if m != nil { return m.Enum } return nil } func (m *PrimitivesItems) GetMultipleOf() float64 { if m != nil { return m.MultipleOf } return 0 } func (m *PrimitivesItems) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Properties struct { AdditionalProperties []*NamedSchema `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *Properties) Reset() { *m = Properties{} } func (m *Properties) String() string { return proto.CompactTextString(m) } func (*Properties) ProtoMessage() {} func (*Properties) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{44} } func (m *Properties) GetAdditionalProperties() []*NamedSchema { if m != nil { return m.AdditionalProperties } return nil } type QueryParameterSubSchema struct { // Determines whether or not this parameter is required or optional. Required bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` // Determines the location of the parameter. In string `protobuf:"bytes,2,opt,name=in" json:"in,omitempty"` // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. Description string `protobuf:"bytes,3,opt,name=description" json:"description,omitempty"` // The name of the parameter. Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` // allows sending a parameter by name only or with an empty value. AllowEmptyValue bool `protobuf:"varint,5,opt,name=allow_empty_value,json=allowEmptyValue" json:"allow_empty_value,omitempty"` Type string `protobuf:"bytes,6,opt,name=type" json:"type,omitempty"` Format string `protobuf:"bytes,7,opt,name=format" json:"format,omitempty"` Items *PrimitivesItems `protobuf:"bytes,8,opt,name=items" json:"items,omitempty"` CollectionFormat string `protobuf:"bytes,9,opt,name=collection_format,json=collectionFormat" json:"collection_format,omitempty"` Default *Any `protobuf:"bytes,10,opt,name=default" json:"default,omitempty"` Maximum float64 `protobuf:"fixed64,11,opt,name=maximum" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,12,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,13,opt,name=minimum" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,14,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,15,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,16,opt,name=min_length,json=minLength" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,17,opt,name=pattern" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,18,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,19,opt,name=min_items,json=minItems" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,20,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` Enum []*Any `protobuf:"bytes,21,rep,name=enum" json:"enum,omitempty"` MultipleOf float64 `protobuf:"fixed64,22,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,23,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *QueryParameterSubSchema) Reset() { *m = QueryParameterSubSchema{} } func (m *QueryParameterSubSchema) String() string { return proto.CompactTextString(m) } func (*QueryParameterSubSchema) ProtoMessage() {} func (*QueryParameterSubSchema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{45} } func (m *QueryParameterSubSchema) GetRequired() bool { if m != nil { return m.Required } return false } func (m *QueryParameterSubSchema) GetIn() string { if m != nil { return m.In } return "" } func (m *QueryParameterSubSchema) GetDescription() string { if m != nil { return m.Description } return "" } func (m *QueryParameterSubSchema) GetName() string { if m != nil { return m.Name } return "" } func (m *QueryParameterSubSchema) GetAllowEmptyValue() bool { if m != nil { return m.AllowEmptyValue } return false } func (m *QueryParameterSubSchema) GetType() string { if m != nil { return m.Type } return "" } func (m *QueryParameterSubSchema) GetFormat() string { if m != nil { return m.Format } return "" } func (m *QueryParameterSubSchema) GetItems() *PrimitivesItems { if m != nil { return m.Items } return nil } func (m *QueryParameterSubSchema) GetCollectionFormat() string { if m != nil { return m.CollectionFormat } return "" } func (m *QueryParameterSubSchema) GetDefault() *Any { if m != nil { return m.Default } return nil } func (m *QueryParameterSubSchema) GetMaximum() float64 { if m != nil { return m.Maximum } return 0 } func (m *QueryParameterSubSchema) GetExclusiveMaximum() bool { if m != nil { return m.ExclusiveMaximum } return false } func (m *QueryParameterSubSchema) GetMinimum() float64 { if m != nil { return m.Minimum } return 0 } func (m *QueryParameterSubSchema) GetExclusiveMinimum() bool { if m != nil { return m.ExclusiveMinimum } return false } func (m *QueryParameterSubSchema) GetMaxLength() int64 { if m != nil { return m.MaxLength } return 0 } func (m *QueryParameterSubSchema) GetMinLength() int64 { if m != nil { return m.MinLength } return 0 } func (m *QueryParameterSubSchema) GetPattern() string { if m != nil { return m.Pattern } return "" } func (m *QueryParameterSubSchema) GetMaxItems() int64 { if m != nil { return m.MaxItems } return 0 } func (m *QueryParameterSubSchema) GetMinItems() int64 { if m != nil { return m.MinItems } return 0 } func (m *QueryParameterSubSchema) GetUniqueItems() bool { if m != nil { return m.UniqueItems } return false } func (m *QueryParameterSubSchema) GetEnum() []*Any { if m != nil { return m.Enum } return nil } func (m *QueryParameterSubSchema) GetMultipleOf() float64 { if m != nil { return m.MultipleOf } return 0 } func (m *QueryParameterSubSchema) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type Response struct { Description string `protobuf:"bytes,1,opt,name=description" json:"description,omitempty"` Schema *SchemaItem `protobuf:"bytes,2,opt,name=schema" json:"schema,omitempty"` Headers *Headers `protobuf:"bytes,3,opt,name=headers" json:"headers,omitempty"` Examples *Examples `protobuf:"bytes,4,opt,name=examples" json:"examples,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,5,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Response) Reset() { *m = Response{} } func (m *Response) String() string { return proto.CompactTextString(m) } func (*Response) ProtoMessage() {} func (*Response) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{46} } func (m *Response) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Response) GetSchema() *SchemaItem { if m != nil { return m.Schema } return nil } func (m *Response) GetHeaders() *Headers { if m != nil { return m.Headers } return nil } func (m *Response) GetExamples() *Examples { if m != nil { return m.Examples } return nil } func (m *Response) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } // One or more JSON representations for parameters type ResponseDefinitions struct { AdditionalProperties []*NamedResponse `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *ResponseDefinitions) Reset() { *m = ResponseDefinitions{} } func (m *ResponseDefinitions) String() string { return proto.CompactTextString(m) } func (*ResponseDefinitions) ProtoMessage() {} func (*ResponseDefinitions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{47} } func (m *ResponseDefinitions) GetAdditionalProperties() []*NamedResponse { if m != nil { return m.AdditionalProperties } return nil } type ResponseValue struct { // Types that are valid to be assigned to Oneof: // *ResponseValue_Response // *ResponseValue_JsonReference Oneof isResponseValue_Oneof `protobuf_oneof:"oneof"` } func (m *ResponseValue) Reset() { *m = ResponseValue{} } func (m *ResponseValue) String() string { return proto.CompactTextString(m) } func (*ResponseValue) ProtoMessage() {} func (*ResponseValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{48} } type isResponseValue_Oneof interface { isResponseValue_Oneof() } type ResponseValue_Response struct { Response *Response `protobuf:"bytes,1,opt,name=response,oneof"` } type ResponseValue_JsonReference struct { JsonReference *JsonReference `protobuf:"bytes,2,opt,name=json_reference,json=jsonReference,oneof"` } func (*ResponseValue_Response) isResponseValue_Oneof() {} func (*ResponseValue_JsonReference) isResponseValue_Oneof() {} func (m *ResponseValue) GetOneof() isResponseValue_Oneof { if m != nil { return m.Oneof } return nil } func (m *ResponseValue) GetResponse() *Response { if x, ok := m.GetOneof().(*ResponseValue_Response); ok { return x.Response } return nil } func (m *ResponseValue) GetJsonReference() *JsonReference { if x, ok := m.GetOneof().(*ResponseValue_JsonReference); ok { return x.JsonReference } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*ResponseValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _ResponseValue_OneofMarshaler, _ResponseValue_OneofUnmarshaler, _ResponseValue_OneofSizer, []interface{}{ (*ResponseValue_Response)(nil), (*ResponseValue_JsonReference)(nil), } } func _ResponseValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*ResponseValue) // oneof switch x := m.Oneof.(type) { case *ResponseValue_Response: b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Response); err != nil { return err } case *ResponseValue_JsonReference: b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.JsonReference); err != nil { return err } case nil: default: return fmt.Errorf("ResponseValue.Oneof has unexpected type %T", x) } return nil } func _ResponseValue_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*ResponseValue) switch tag { case 1: // oneof.response if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(Response) err := b.DecodeMessage(msg) m.Oneof = &ResponseValue_Response{msg} return true, err case 2: // oneof.json_reference if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(JsonReference) err := b.DecodeMessage(msg) m.Oneof = &ResponseValue_JsonReference{msg} return true, err default: return false, nil } } func _ResponseValue_OneofSizer(msg proto.Message) (n int) { m := msg.(*ResponseValue) // oneof switch x := m.Oneof.(type) { case *ResponseValue_Response: s := proto.Size(x.Response) n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *ResponseValue_JsonReference: s := proto.Size(x.JsonReference) n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } // Response objects names can either be any valid HTTP status code or 'default'. type Responses struct { ResponseCode []*NamedResponseValue `protobuf:"bytes,1,rep,name=response_code,json=responseCode" json:"response_code,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,2,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Responses) Reset() { *m = Responses{} } func (m *Responses) String() string { return proto.CompactTextString(m) } func (*Responses) ProtoMessage() {} func (*Responses) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{49} } func (m *Responses) GetResponseCode() []*NamedResponseValue { if m != nil { return m.ResponseCode } return nil } func (m *Responses) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } // A deterministic version of a JSON Schema object. type Schema struct { XRef string `protobuf:"bytes,1,opt,name=_ref,json=Ref" json:"_ref,omitempty"` Format string `protobuf:"bytes,2,opt,name=format" json:"format,omitempty"` Title string `protobuf:"bytes,3,opt,name=title" json:"title,omitempty"` Description string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` Default *Any `protobuf:"bytes,5,opt,name=default" json:"default,omitempty"` MultipleOf float64 `protobuf:"fixed64,6,opt,name=multiple_of,json=multipleOf" json:"multiple_of,omitempty"` Maximum float64 `protobuf:"fixed64,7,opt,name=maximum" json:"maximum,omitempty"` ExclusiveMaximum bool `protobuf:"varint,8,opt,name=exclusive_maximum,json=exclusiveMaximum" json:"exclusive_maximum,omitempty"` Minimum float64 `protobuf:"fixed64,9,opt,name=minimum" json:"minimum,omitempty"` ExclusiveMinimum bool `protobuf:"varint,10,opt,name=exclusive_minimum,json=exclusiveMinimum" json:"exclusive_minimum,omitempty"` MaxLength int64 `protobuf:"varint,11,opt,name=max_length,json=maxLength" json:"max_length,omitempty"` MinLength int64 `protobuf:"varint,12,opt,name=min_length,json=minLength" json:"min_length,omitempty"` Pattern string `protobuf:"bytes,13,opt,name=pattern" json:"pattern,omitempty"` MaxItems int64 `protobuf:"varint,14,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` MinItems int64 `protobuf:"varint,15,opt,name=min_items,json=minItems" json:"min_items,omitempty"` UniqueItems bool `protobuf:"varint,16,opt,name=unique_items,json=uniqueItems" json:"unique_items,omitempty"` MaxProperties int64 `protobuf:"varint,17,opt,name=max_properties,json=maxProperties" json:"max_properties,omitempty"` MinProperties int64 `protobuf:"varint,18,opt,name=min_properties,json=minProperties" json:"min_properties,omitempty"` Required []string `protobuf:"bytes,19,rep,name=required" json:"required,omitempty"` Enum []*Any `protobuf:"bytes,20,rep,name=enum" json:"enum,omitempty"` AdditionalProperties *AdditionalPropertiesItem `protobuf:"bytes,21,opt,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` Type *TypeItem `protobuf:"bytes,22,opt,name=type" json:"type,omitempty"` Items *ItemsItem `protobuf:"bytes,23,opt,name=items" json:"items,omitempty"` AllOf []*Schema `protobuf:"bytes,24,rep,name=all_of,json=allOf" json:"all_of,omitempty"` Properties *Properties `protobuf:"bytes,25,opt,name=properties" json:"properties,omitempty"` Discriminator string `protobuf:"bytes,26,opt,name=discriminator" json:"discriminator,omitempty"` ReadOnly bool `protobuf:"varint,27,opt,name=read_only,json=readOnly" json:"read_only,omitempty"` Xml *Xml `protobuf:"bytes,28,opt,name=xml" json:"xml,omitempty"` ExternalDocs *ExternalDocs `protobuf:"bytes,29,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` Example *Any `protobuf:"bytes,30,opt,name=example" json:"example,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,31,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Schema) Reset() { *m = Schema{} } func (m *Schema) String() string { return proto.CompactTextString(m) } func (*Schema) ProtoMessage() {} func (*Schema) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{50} } func (m *Schema) GetXRef() string { if m != nil { return m.XRef } return "" } func (m *Schema) GetFormat() string { if m != nil { return m.Format } return "" } func (m *Schema) GetTitle() string { if m != nil { return m.Title } return "" } func (m *Schema) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Schema) GetDefault() *Any { if m != nil { return m.Default } return nil } func (m *Schema) GetMultipleOf() float64 { if m != nil { return m.MultipleOf } return 0 } func (m *Schema) GetMaximum() float64 { if m != nil { return m.Maximum } return 0 } func (m *Schema) GetExclusiveMaximum() bool { if m != nil { return m.ExclusiveMaximum } return false } func (m *Schema) GetMinimum() float64 { if m != nil { return m.Minimum } return 0 } func (m *Schema) GetExclusiveMinimum() bool { if m != nil { return m.ExclusiveMinimum } return false } func (m *Schema) GetMaxLength() int64 { if m != nil { return m.MaxLength } return 0 } func (m *Schema) GetMinLength() int64 { if m != nil { return m.MinLength } return 0 } func (m *Schema) GetPattern() string { if m != nil { return m.Pattern } return "" } func (m *Schema) GetMaxItems() int64 { if m != nil { return m.MaxItems } return 0 } func (m *Schema) GetMinItems() int64 { if m != nil { return m.MinItems } return 0 } func (m *Schema) GetUniqueItems() bool { if m != nil { return m.UniqueItems } return false } func (m *Schema) GetMaxProperties() int64 { if m != nil { return m.MaxProperties } return 0 } func (m *Schema) GetMinProperties() int64 { if m != nil { return m.MinProperties } return 0 } func (m *Schema) GetRequired() []string { if m != nil { return m.Required } return nil } func (m *Schema) GetEnum() []*Any { if m != nil { return m.Enum } return nil } func (m *Schema) GetAdditionalProperties() *AdditionalPropertiesItem { if m != nil { return m.AdditionalProperties } return nil } func (m *Schema) GetType() *TypeItem { if m != nil { return m.Type } return nil } func (m *Schema) GetItems() *ItemsItem { if m != nil { return m.Items } return nil } func (m *Schema) GetAllOf() []*Schema { if m != nil { return m.AllOf } return nil } func (m *Schema) GetProperties() *Properties { if m != nil { return m.Properties } return nil } func (m *Schema) GetDiscriminator() string { if m != nil { return m.Discriminator } return "" } func (m *Schema) GetReadOnly() bool { if m != nil { return m.ReadOnly } return false } func (m *Schema) GetXml() *Xml { if m != nil { return m.Xml } return nil } func (m *Schema) GetExternalDocs() *ExternalDocs { if m != nil { return m.ExternalDocs } return nil } func (m *Schema) GetExample() *Any { if m != nil { return m.Example } return nil } func (m *Schema) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type SchemaItem struct { // Types that are valid to be assigned to Oneof: // *SchemaItem_Schema // *SchemaItem_FileSchema Oneof isSchemaItem_Oneof `protobuf_oneof:"oneof"` } func (m *SchemaItem) Reset() { *m = SchemaItem{} } func (m *SchemaItem) String() string { return proto.CompactTextString(m) } func (*SchemaItem) ProtoMessage() {} func (*SchemaItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{51} } type isSchemaItem_Oneof interface { isSchemaItem_Oneof() } type SchemaItem_Schema struct { Schema *Schema `protobuf:"bytes,1,opt,name=schema,oneof"` } type SchemaItem_FileSchema struct { FileSchema *FileSchema `protobuf:"bytes,2,opt,name=file_schema,json=fileSchema,oneof"` } func (*SchemaItem_Schema) isSchemaItem_Oneof() {} func (*SchemaItem_FileSchema) isSchemaItem_Oneof() {} func (m *SchemaItem) GetOneof() isSchemaItem_Oneof { if m != nil { return m.Oneof } return nil } func (m *SchemaItem) GetSchema() *Schema { if x, ok := m.GetOneof().(*SchemaItem_Schema); ok { return x.Schema } return nil } func (m *SchemaItem) GetFileSchema() *FileSchema { if x, ok := m.GetOneof().(*SchemaItem_FileSchema); ok { return x.FileSchema } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*SchemaItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _SchemaItem_OneofMarshaler, _SchemaItem_OneofUnmarshaler, _SchemaItem_OneofSizer, []interface{}{ (*SchemaItem_Schema)(nil), (*SchemaItem_FileSchema)(nil), } } func _SchemaItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*SchemaItem) // oneof switch x := m.Oneof.(type) { case *SchemaItem_Schema: b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Schema); err != nil { return err } case *SchemaItem_FileSchema: b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.FileSchema); err != nil { return err } case nil: default: return fmt.Errorf("SchemaItem.Oneof has unexpected type %T", x) } return nil } func _SchemaItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*SchemaItem) switch tag { case 1: // oneof.schema if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(Schema) err := b.DecodeMessage(msg) m.Oneof = &SchemaItem_Schema{msg} return true, err case 2: // oneof.file_schema if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(FileSchema) err := b.DecodeMessage(msg) m.Oneof = &SchemaItem_FileSchema{msg} return true, err default: return false, nil } } func _SchemaItem_OneofSizer(msg proto.Message) (n int) { m := msg.(*SchemaItem) // oneof switch x := m.Oneof.(type) { case *SchemaItem_Schema: s := proto.Size(x.Schema) n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *SchemaItem_FileSchema: s := proto.Size(x.FileSchema) n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } type SecurityDefinitions struct { AdditionalProperties []*NamedSecurityDefinitionsItem `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *SecurityDefinitions) Reset() { *m = SecurityDefinitions{} } func (m *SecurityDefinitions) String() string { return proto.CompactTextString(m) } func (*SecurityDefinitions) ProtoMessage() {} func (*SecurityDefinitions) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{52} } func (m *SecurityDefinitions) GetAdditionalProperties() []*NamedSecurityDefinitionsItem { if m != nil { return m.AdditionalProperties } return nil } type SecurityDefinitionsItem struct { // Types that are valid to be assigned to Oneof: // *SecurityDefinitionsItem_BasicAuthenticationSecurity // *SecurityDefinitionsItem_ApiKeySecurity // *SecurityDefinitionsItem_Oauth2ImplicitSecurity // *SecurityDefinitionsItem_Oauth2PasswordSecurity // *SecurityDefinitionsItem_Oauth2ApplicationSecurity // *SecurityDefinitionsItem_Oauth2AccessCodeSecurity Oneof isSecurityDefinitionsItem_Oneof `protobuf_oneof:"oneof"` } func (m *SecurityDefinitionsItem) Reset() { *m = SecurityDefinitionsItem{} } func (m *SecurityDefinitionsItem) String() string { return proto.CompactTextString(m) } func (*SecurityDefinitionsItem) ProtoMessage() {} func (*SecurityDefinitionsItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{53} } type isSecurityDefinitionsItem_Oneof interface { isSecurityDefinitionsItem_Oneof() } type SecurityDefinitionsItem_BasicAuthenticationSecurity struct { BasicAuthenticationSecurity *BasicAuthenticationSecurity `protobuf:"bytes,1,opt,name=basic_authentication_security,json=basicAuthenticationSecurity,oneof"` } type SecurityDefinitionsItem_ApiKeySecurity struct { ApiKeySecurity *ApiKeySecurity `protobuf:"bytes,2,opt,name=api_key_security,json=apiKeySecurity,oneof"` } type SecurityDefinitionsItem_Oauth2ImplicitSecurity struct { Oauth2ImplicitSecurity *Oauth2ImplicitSecurity `protobuf:"bytes,3,opt,name=oauth2_implicit_security,json=oauth2ImplicitSecurity,oneof"` } type SecurityDefinitionsItem_Oauth2PasswordSecurity struct { Oauth2PasswordSecurity *Oauth2PasswordSecurity `protobuf:"bytes,4,opt,name=oauth2_password_security,json=oauth2PasswordSecurity,oneof"` } type SecurityDefinitionsItem_Oauth2ApplicationSecurity struct { Oauth2ApplicationSecurity *Oauth2ApplicationSecurity `protobuf:"bytes,5,opt,name=oauth2_application_security,json=oauth2ApplicationSecurity,oneof"` } type SecurityDefinitionsItem_Oauth2AccessCodeSecurity struct { Oauth2AccessCodeSecurity *Oauth2AccessCodeSecurity `protobuf:"bytes,6,opt,name=oauth2_access_code_security,json=oauth2AccessCodeSecurity,oneof"` } func (*SecurityDefinitionsItem_BasicAuthenticationSecurity) isSecurityDefinitionsItem_Oneof() {} func (*SecurityDefinitionsItem_ApiKeySecurity) isSecurityDefinitionsItem_Oneof() {} func (*SecurityDefinitionsItem_Oauth2ImplicitSecurity) isSecurityDefinitionsItem_Oneof() {} func (*SecurityDefinitionsItem_Oauth2PasswordSecurity) isSecurityDefinitionsItem_Oneof() {} func (*SecurityDefinitionsItem_Oauth2ApplicationSecurity) isSecurityDefinitionsItem_Oneof() {} func (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity) isSecurityDefinitionsItem_Oneof() {} func (m *SecurityDefinitionsItem) GetOneof() isSecurityDefinitionsItem_Oneof { if m != nil { return m.Oneof } return nil } func (m *SecurityDefinitionsItem) GetBasicAuthenticationSecurity() *BasicAuthenticationSecurity { if x, ok := m.GetOneof().(*SecurityDefinitionsItem_BasicAuthenticationSecurity); ok { return x.BasicAuthenticationSecurity } return nil } func (m *SecurityDefinitionsItem) GetApiKeySecurity() *ApiKeySecurity { if x, ok := m.GetOneof().(*SecurityDefinitionsItem_ApiKeySecurity); ok { return x.ApiKeySecurity } return nil } func (m *SecurityDefinitionsItem) GetOauth2ImplicitSecurity() *Oauth2ImplicitSecurity { if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2ImplicitSecurity); ok { return x.Oauth2ImplicitSecurity } return nil } func (m *SecurityDefinitionsItem) GetOauth2PasswordSecurity() *Oauth2PasswordSecurity { if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2PasswordSecurity); ok { return x.Oauth2PasswordSecurity } return nil } func (m *SecurityDefinitionsItem) GetOauth2ApplicationSecurity() *Oauth2ApplicationSecurity { if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2ApplicationSecurity); ok { return x.Oauth2ApplicationSecurity } return nil } func (m *SecurityDefinitionsItem) GetOauth2AccessCodeSecurity() *Oauth2AccessCodeSecurity { if x, ok := m.GetOneof().(*SecurityDefinitionsItem_Oauth2AccessCodeSecurity); ok { return x.Oauth2AccessCodeSecurity } return nil } // XXX_OneofFuncs is for the internal use of the proto package. func (*SecurityDefinitionsItem) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _SecurityDefinitionsItem_OneofMarshaler, _SecurityDefinitionsItem_OneofUnmarshaler, _SecurityDefinitionsItem_OneofSizer, []interface{}{ (*SecurityDefinitionsItem_BasicAuthenticationSecurity)(nil), (*SecurityDefinitionsItem_ApiKeySecurity)(nil), (*SecurityDefinitionsItem_Oauth2ImplicitSecurity)(nil), (*SecurityDefinitionsItem_Oauth2PasswordSecurity)(nil), (*SecurityDefinitionsItem_Oauth2ApplicationSecurity)(nil), (*SecurityDefinitionsItem_Oauth2AccessCodeSecurity)(nil), } } func _SecurityDefinitionsItem_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { m := msg.(*SecurityDefinitionsItem) // oneof switch x := m.Oneof.(type) { case *SecurityDefinitionsItem_BasicAuthenticationSecurity: b.EncodeVarint(1<<3 | proto.WireBytes) if err := b.EncodeMessage(x.BasicAuthenticationSecurity); err != nil { return err } case *SecurityDefinitionsItem_ApiKeySecurity: b.EncodeVarint(2<<3 | proto.WireBytes) if err := b.EncodeMessage(x.ApiKeySecurity); err != nil { return err } case *SecurityDefinitionsItem_Oauth2ImplicitSecurity: b.EncodeVarint(3<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Oauth2ImplicitSecurity); err != nil { return err } case *SecurityDefinitionsItem_Oauth2PasswordSecurity: b.EncodeVarint(4<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Oauth2PasswordSecurity); err != nil { return err } case *SecurityDefinitionsItem_Oauth2ApplicationSecurity: b.EncodeVarint(5<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Oauth2ApplicationSecurity); err != nil { return err } case *SecurityDefinitionsItem_Oauth2AccessCodeSecurity: b.EncodeVarint(6<<3 | proto.WireBytes) if err := b.EncodeMessage(x.Oauth2AccessCodeSecurity); err != nil { return err } case nil: default: return fmt.Errorf("SecurityDefinitionsItem.Oneof has unexpected type %T", x) } return nil } func _SecurityDefinitionsItem_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { m := msg.(*SecurityDefinitionsItem) switch tag { case 1: // oneof.basic_authentication_security if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(BasicAuthenticationSecurity) err := b.DecodeMessage(msg) m.Oneof = &SecurityDefinitionsItem_BasicAuthenticationSecurity{msg} return true, err case 2: // oneof.api_key_security if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(ApiKeySecurity) err := b.DecodeMessage(msg) m.Oneof = &SecurityDefinitionsItem_ApiKeySecurity{msg} return true, err case 3: // oneof.oauth2_implicit_security if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(Oauth2ImplicitSecurity) err := b.DecodeMessage(msg) m.Oneof = &SecurityDefinitionsItem_Oauth2ImplicitSecurity{msg} return true, err case 4: // oneof.oauth2_password_security if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(Oauth2PasswordSecurity) err := b.DecodeMessage(msg) m.Oneof = &SecurityDefinitionsItem_Oauth2PasswordSecurity{msg} return true, err case 5: // oneof.oauth2_application_security if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(Oauth2ApplicationSecurity) err := b.DecodeMessage(msg) m.Oneof = &SecurityDefinitionsItem_Oauth2ApplicationSecurity{msg} return true, err case 6: // oneof.oauth2_access_code_security if wire != proto.WireBytes { return true, proto.ErrInternalBadWireType } msg := new(Oauth2AccessCodeSecurity) err := b.DecodeMessage(msg) m.Oneof = &SecurityDefinitionsItem_Oauth2AccessCodeSecurity{msg} return true, err default: return false, nil } } func _SecurityDefinitionsItem_OneofSizer(msg proto.Message) (n int) { m := msg.(*SecurityDefinitionsItem) // oneof switch x := m.Oneof.(type) { case *SecurityDefinitionsItem_BasicAuthenticationSecurity: s := proto.Size(x.BasicAuthenticationSecurity) n += proto.SizeVarint(1<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *SecurityDefinitionsItem_ApiKeySecurity: s := proto.Size(x.ApiKeySecurity) n += proto.SizeVarint(2<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *SecurityDefinitionsItem_Oauth2ImplicitSecurity: s := proto.Size(x.Oauth2ImplicitSecurity) n += proto.SizeVarint(3<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *SecurityDefinitionsItem_Oauth2PasswordSecurity: s := proto.Size(x.Oauth2PasswordSecurity) n += proto.SizeVarint(4<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *SecurityDefinitionsItem_Oauth2ApplicationSecurity: s := proto.Size(x.Oauth2ApplicationSecurity) n += proto.SizeVarint(5<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case *SecurityDefinitionsItem_Oauth2AccessCodeSecurity: s := proto.Size(x.Oauth2AccessCodeSecurity) n += proto.SizeVarint(6<<3 | proto.WireBytes) n += proto.SizeVarint(uint64(s)) n += s case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) } return n } type SecurityRequirement struct { AdditionalProperties []*NamedStringArray `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *SecurityRequirement) Reset() { *m = SecurityRequirement{} } func (m *SecurityRequirement) String() string { return proto.CompactTextString(m) } func (*SecurityRequirement) ProtoMessage() {} func (*SecurityRequirement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{54} } func (m *SecurityRequirement) GetAdditionalProperties() []*NamedStringArray { if m != nil { return m.AdditionalProperties } return nil } type StringArray struct { Value []string `protobuf:"bytes,1,rep,name=value" json:"value,omitempty"` } func (m *StringArray) Reset() { *m = StringArray{} } func (m *StringArray) String() string { return proto.CompactTextString(m) } func (*StringArray) ProtoMessage() {} func (*StringArray) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{55} } func (m *StringArray) GetValue() []string { if m != nil { return m.Value } return nil } type Tag struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` ExternalDocs *ExternalDocs `protobuf:"bytes,3,opt,name=external_docs,json=externalDocs" json:"external_docs,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,4,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Tag) Reset() { *m = Tag{} } func (m *Tag) String() string { return proto.CompactTextString(m) } func (*Tag) ProtoMessage() {} func (*Tag) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{56} } func (m *Tag) GetName() string { if m != nil { return m.Name } return "" } func (m *Tag) GetDescription() string { if m != nil { return m.Description } return "" } func (m *Tag) GetExternalDocs() *ExternalDocs { if m != nil { return m.ExternalDocs } return nil } func (m *Tag) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } type TypeItem struct { Value []string `protobuf:"bytes,1,rep,name=value" json:"value,omitempty"` } func (m *TypeItem) Reset() { *m = TypeItem{} } func (m *TypeItem) String() string { return proto.CompactTextString(m) } func (*TypeItem) ProtoMessage() {} func (*TypeItem) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{57} } func (m *TypeItem) GetValue() []string { if m != nil { return m.Value } return nil } // Any property starting with x- is valid. type VendorExtension struct { AdditionalProperties []*NamedAny `protobuf:"bytes,1,rep,name=additional_properties,json=additionalProperties" json:"additional_properties,omitempty"` } func (m *VendorExtension) Reset() { *m = VendorExtension{} } func (m *VendorExtension) String() string { return proto.CompactTextString(m) } func (*VendorExtension) ProtoMessage() {} func (*VendorExtension) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{58} } func (m *VendorExtension) GetAdditionalProperties() []*NamedAny { if m != nil { return m.AdditionalProperties } return nil } type Xml struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Namespace string `protobuf:"bytes,2,opt,name=namespace" json:"namespace,omitempty"` Prefix string `protobuf:"bytes,3,opt,name=prefix" json:"prefix,omitempty"` Attribute bool `protobuf:"varint,4,opt,name=attribute" json:"attribute,omitempty"` Wrapped bool `protobuf:"varint,5,opt,name=wrapped" json:"wrapped,omitempty"` VendorExtension []*NamedAny `protobuf:"bytes,6,rep,name=vendor_extension,json=vendorExtension" json:"vendor_extension,omitempty"` } func (m *Xml) Reset() { *m = Xml{} } func (m *Xml) String() string { return proto.CompactTextString(m) } func (*Xml) ProtoMessage() {} func (*Xml) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{59} } func (m *Xml) GetName() string { if m != nil { return m.Name } return "" } func (m *Xml) GetNamespace() string { if m != nil { return m.Namespace } return "" } func (m *Xml) GetPrefix() string { if m != nil { return m.Prefix } return "" } func (m *Xml) GetAttribute() bool { if m != nil { return m.Attribute } return false } func (m *Xml) GetWrapped() bool { if m != nil { return m.Wrapped } return false } func (m *Xml) GetVendorExtension() []*NamedAny { if m != nil { return m.VendorExtension } return nil } func init() { proto.RegisterType((*AdditionalPropertiesItem)(nil), "openapi.v2.AdditionalPropertiesItem") proto.RegisterType((*Any)(nil), "openapi.v2.Any") proto.RegisterType((*ApiKeySecurity)(nil), "openapi.v2.ApiKeySecurity") proto.RegisterType((*BasicAuthenticationSecurity)(nil), "openapi.v2.BasicAuthenticationSecurity") proto.RegisterType((*BodyParameter)(nil), "openapi.v2.BodyParameter") proto.RegisterType((*Contact)(nil), "openapi.v2.Contact") proto.RegisterType((*Default)(nil), "openapi.v2.Default") proto.RegisterType((*Definitions)(nil), "openapi.v2.Definitions") proto.RegisterType((*Document)(nil), "openapi.v2.Document") proto.RegisterType((*Examples)(nil), "openapi.v2.Examples") proto.RegisterType((*ExternalDocs)(nil), "openapi.v2.ExternalDocs") proto.RegisterType((*FileSchema)(nil), "openapi.v2.FileSchema") proto.RegisterType((*FormDataParameterSubSchema)(nil), "openapi.v2.FormDataParameterSubSchema") proto.RegisterType((*Header)(nil), "openapi.v2.Header") proto.RegisterType((*HeaderParameterSubSchema)(nil), "openapi.v2.HeaderParameterSubSchema") proto.RegisterType((*Headers)(nil), "openapi.v2.Headers") proto.RegisterType((*Info)(nil), "openapi.v2.Info") proto.RegisterType((*ItemsItem)(nil), "openapi.v2.ItemsItem") proto.RegisterType((*JsonReference)(nil), "openapi.v2.JsonReference") proto.RegisterType((*License)(nil), "openapi.v2.License") proto.RegisterType((*NamedAny)(nil), "openapi.v2.NamedAny") proto.RegisterType((*NamedHeader)(nil), "openapi.v2.NamedHeader") proto.RegisterType((*NamedParameter)(nil), "openapi.v2.NamedParameter") proto.RegisterType((*NamedPathItem)(nil), "openapi.v2.NamedPathItem") proto.RegisterType((*NamedResponse)(nil), "openapi.v2.NamedResponse") proto.RegisterType((*NamedResponseValue)(nil), "openapi.v2.NamedResponseValue") proto.RegisterType((*NamedSchema)(nil), "openapi.v2.NamedSchema") proto.RegisterType((*NamedSecurityDefinitionsItem)(nil), "openapi.v2.NamedSecurityDefinitionsItem") proto.RegisterType((*NamedString)(nil), "openapi.v2.NamedString") proto.RegisterType((*NamedStringArray)(nil), "openapi.v2.NamedStringArray") proto.RegisterType((*NonBodyParameter)(nil), "openapi.v2.NonBodyParameter") proto.RegisterType((*Oauth2AccessCodeSecurity)(nil), "openapi.v2.Oauth2AccessCodeSecurity") proto.RegisterType((*Oauth2ApplicationSecurity)(nil), "openapi.v2.Oauth2ApplicationSecurity") proto.RegisterType((*Oauth2ImplicitSecurity)(nil), "openapi.v2.Oauth2ImplicitSecurity") proto.RegisterType((*Oauth2PasswordSecurity)(nil), "openapi.v2.Oauth2PasswordSecurity") proto.RegisterType((*Oauth2Scopes)(nil), "openapi.v2.Oauth2Scopes") proto.RegisterType((*Operation)(nil), "openapi.v2.Operation") proto.RegisterType((*Parameter)(nil), "openapi.v2.Parameter") proto.RegisterType((*ParameterDefinitions)(nil), "openapi.v2.ParameterDefinitions") proto.RegisterType((*ParametersItem)(nil), "openapi.v2.ParametersItem") proto.RegisterType((*PathItem)(nil), "openapi.v2.PathItem") proto.RegisterType((*PathParameterSubSchema)(nil), "openapi.v2.PathParameterSubSchema") proto.RegisterType((*Paths)(nil), "openapi.v2.Paths") proto.RegisterType((*PrimitivesItems)(nil), "openapi.v2.PrimitivesItems") proto.RegisterType((*Properties)(nil), "openapi.v2.Properties") proto.RegisterType((*QueryParameterSubSchema)(nil), "openapi.v2.QueryParameterSubSchema") proto.RegisterType((*Response)(nil), "openapi.v2.Response") proto.RegisterType((*ResponseDefinitions)(nil), "openapi.v2.ResponseDefinitions") proto.RegisterType((*ResponseValue)(nil), "openapi.v2.ResponseValue") proto.RegisterType((*Responses)(nil), "openapi.v2.Responses") proto.RegisterType((*Schema)(nil), "openapi.v2.Schema") proto.RegisterType((*SchemaItem)(nil), "openapi.v2.SchemaItem") proto.RegisterType((*SecurityDefinitions)(nil), "openapi.v2.SecurityDefinitions") proto.RegisterType((*SecurityDefinitionsItem)(nil), "openapi.v2.SecurityDefinitionsItem") proto.RegisterType((*SecurityRequirement)(nil), "openapi.v2.SecurityRequirement") proto.RegisterType((*StringArray)(nil), "openapi.v2.StringArray") proto.RegisterType((*Tag)(nil), "openapi.v2.Tag") proto.RegisterType((*TypeItem)(nil), "openapi.v2.TypeItem") proto.RegisterType((*VendorExtension)(nil), "openapi.v2.VendorExtension") proto.RegisterType((*Xml)(nil), "openapi.v2.Xml") } func init() { proto.RegisterFile("OpenAPIv2/OpenAPIv2.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ // 3129 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xec, 0x3b, 0x4b, 0x73, 0x1c, 0x57, 0xd5, 0xf3, 0x7e, 0x1c, 0x69, 0x46, 0xa3, 0x96, 0x2c, 0xb7, 0x24, 0xc7, 0x71, 0xe4, 0x3c, 0x6c, 0xe7, 0xb3, 0x9c, 0x4f, 0x29, 0x48, 0x05, 0x2a, 0x05, 0xf2, 0xab, 0xc6, 0xc4, 0x44, 0x4a, 0xcb, 0x0e, 0x09, 0x04, 0xba, 0xae, 0x66, 0xee, 0x48, 0x9d, 0x74, 0xf7, 0x6d, 0x77, 0xf7, 0xc8, 0x1a, 0x16, 0x2c, 0xa0, 0x8a, 0x35, 0x50, 0x59, 0x53, 0x15, 0x16, 0x14, 0x55, 0x59, 0xb0, 0x62, 0xc5, 0x1f, 0x60, 0xc7, 0x3f, 0x60, 0x0d, 0x5b, 0xaa, 0x58, 0x51, 0x3c, 0xea, 0xbe, 0xfa, 0x31, 0x7d, 0x7b, 0x1e, 0x96, 0x0b, 0x28, 0xd0, 0x6a, 0xe6, 0xde, 0x73, 0xee, 0xb9, 0xa7, 0x4f, 0x9f, 0xd7, 0x3d, 0xe7, 0x36, 0xac, 0xef, 0x79, 0xd8, 0xdd, 0xdd, 0x7f, 0x70, 0xb2, 0x73, 0x2b, 0xfa, 0xb7, 0xed, 0xf9, 0x24, 0x24, 0x1a, 0x10, 0x0f, 0xbb, 0xc8, 0xb3, 0xb6, 0x4f, 0x76, 0x36, 0xd6, 0x8f, 0x08, 0x39, 0xb2, 0xf1, 0x2d, 0x06, 0x39, 0x1c, 0x0e, 0x6e, 0x21, 0x77, 0xc4, 0xd1, 0xb6, 0x1c, 0xd0, 0x77, 0xfb, 0x7d, 0x2b, 0xb4, 0x88, 0x8b, 0xec, 0x7d, 0x9f, 0x78, 0xd8, 0x0f, 0x2d, 0x1c, 0x3c, 0x08, 0xb1, 0xa3, 0xfd, 0x1f, 0xd4, 0x82, 0xde, 0x31, 0x76, 0x90, 0x5e, 0xbc, 0x52, 0xbc, 0xb6, 0xb0, 0xa3, 0x6d, 0xc7, 0x34, 0xb7, 0x0f, 0x18, 0xa4, 0x5b, 0x30, 0x04, 0x8e, 0xb6, 0x01, 0xf5, 0x43, 0x42, 0x6c, 0x8c, 0x5c, 0xbd, 0x74, 0xa5, 0x78, 0xad, 0xd1, 0x2d, 0x18, 0x72, 0xe2, 0x76, 0x1d, 0xaa, 0xc4, 0xc5, 0x64, 0xb0, 0x75, 0x0f, 0xca, 0xbb, 0xee, 0x48, 0xbb, 0x01, 0xd5, 0x13, 0x64, 0x0f, 0xb1, 0x20, 0xbc, 0xba, 0xcd, 0x19, 0xdc, 0x96, 0x0c, 0x6e, 0xef, 0xba, 0x23, 0x83, 0xa3, 0x68, 0x1a, 0x54, 0x46, 0xc8, 0xb1, 0x19, 0xd1, 0xa6, 0xc1, 0xfe, 0x6f, 0x7d, 0x51, 0x84, 0xf6, 0xae, 0x67, 0xbd, 0x8b, 0x47, 0x07, 0xb8, 0x37, 0xf4, 0xad, 0x70, 0x44, 0xd1, 0xc2, 0x91, 0xc7, 0x29, 0x36, 0x0d, 0xf6, 0x9f, 0xce, 0xb9, 0xc8, 0xc1, 0x72, 0x29, 0xfd, 0xaf, 0xb5, 0xa1, 0x64, 0xb9, 0x7a, 0x99, 0xcd, 0x94, 0x2c, 0x57, 0xbb, 0x02, 0x0b, 0x7d, 0x1c, 0xf4, 0x7c, 0xcb, 0xa3, 0x32, 0xd0, 0x2b, 0x0c, 0x90, 0x9c, 0xd2, 0xbe, 0x06, 0x9d, 0x13, 0xec, 0xf6, 0x89, 0x6f, 0xe2, 0xd3, 0x10, 0xbb, 0x01, 0x45, 0xab, 0x5e, 0x29, 0x33, 0xbe, 0x13, 0x02, 0x79, 0x0f, 0x39, 0xb8, 0x4f, 0xf9, 0x5e, 0xe2, 0xd8, 0xf7, 0x24, 0xf2, 0xd6, 0x67, 0x45, 0xd8, 0xbc, 0x8d, 0x02, 0xab, 0xb7, 0x3b, 0x0c, 0x8f, 0xb1, 0x1b, 0x5a, 0x3d, 0x44, 0x09, 0x4f, 0x64, 0x7d, 0x8c, 0xad, 0xd2, 0x6c, 0x6c, 0x95, 0xe7, 0x61, 0xeb, 0x0f, 0x45, 0x68, 0xdd, 0x26, 0xfd, 0xd1, 0x3e, 0xf2, 0x91, 0x83, 0x43, 0xec, 0x8f, 0x6f, 0x5a, 0xcc, 0x6e, 0x3a, 0x8b, 0x44, 0x37, 0xa0, 0xe1, 0xe3, 0x27, 0x43, 0xcb, 0xc7, 0x7d, 0x26, 0xce, 0x86, 0x11, 0x8d, 0xb5, 0x1b, 0x91, 0x4a, 0x55, 0xf3, 0x54, 0x2a, 0x52, 0x28, 0xd5, 0x03, 0xd6, 0xe6, 0x79, 0xc0, 0x1f, 0x17, 0xa1, 0x7e, 0x87, 0xb8, 0x21, 0xea, 0x85, 0x11, 0xe3, 0xc5, 0x04, 0xe3, 0x1d, 0x28, 0x0f, 0x7d, 0xa9, 0x58, 0xf4, 0xaf, 0xb6, 0x0a, 0x55, 0xec, 0x20, 0xcb, 0x16, 0x4f, 0xc3, 0x07, 0x4a, 0x46, 0x2a, 0xf3, 0x30, 0xf2, 0x08, 0xea, 0x77, 0xf1, 0x00, 0x0d, 0xed, 0x50, 0x7b, 0x00, 0x17, 0x50, 0x64, 0x6f, 0xa6, 0x17, 0x19, 0x9c, 0x5e, 0x9c, 0x40, 0x70, 0x15, 0x29, 0x4c, 0x74, 0xeb, 0x3b, 0xb0, 0x70, 0x17, 0x0f, 0x2c, 0x97, 0x41, 0x02, 0xed, 0xe1, 0x64, 0xca, 0x17, 0x33, 0x94, 0x85, 0xb8, 0xd5, 0xc4, 0xff, 0x58, 0x85, 0xc6, 0x5d, 0xd2, 0x1b, 0x3a, 0xd8, 0x0d, 0x35, 0x1d, 0xea, 0xc1, 0x53, 0x74, 0x74, 0x84, 0x7d, 0x21, 0x3f, 0x39, 0xd4, 0x5e, 0x86, 0x8a, 0xe5, 0x0e, 0x08, 0x93, 0xe1, 0xc2, 0x4e, 0x27, 0xb9, 0xc7, 0x03, 0x77, 0x40, 0x0c, 0x06, 0xa5, 0xc2, 0x3f, 0x26, 0x41, 0x28, 0xa4, 0xca, 0xfe, 0x6b, 0x9b, 0xd0, 0x3c, 0x44, 0x01, 0x36, 0x3d, 0x14, 0x1e, 0x0b, 0xab, 0x6b, 0xd0, 0x89, 0x7d, 0x14, 0x1e, 0xb3, 0x0d, 0x29, 0x77, 0x38, 0x60, 0x96, 0x46, 0x37, 0xe4, 0x43, 0xaa, 0x5c, 0x3d, 0xe2, 0x06, 0x43, 0x0a, 0xaa, 0x31, 0x50, 0x34, 0xa6, 0x30, 0xcf, 0x27, 0xfd, 0x61, 0x0f, 0x07, 0x7a, 0x9d, 0xc3, 0xe4, 0x58, 0x7b, 0x0d, 0xaa, 0x74, 0xa7, 0x40, 0x6f, 0x30, 0x4e, 0x97, 0x93, 0x9c, 0xd2, 0x2d, 0x03, 0x83, 0xc3, 0xb5, 0xb7, 0xa9, 0x0d, 0x44, 0x52, 0xd5, 0x9b, 0x0c, 0x3d, 0x25, 0xbc, 0x84, 0xd0, 0x8d, 0x24, 0xae, 0xf6, 0x75, 0x00, 0x4f, 0xda, 0x52, 0xa0, 0x03, 0x5b, 0x79, 0x25, 0xbd, 0x91, 0x80, 0x26, 0x49, 0x24, 0xd6, 0x68, 0xef, 0x40, 0xd3, 0xc7, 0x81, 0x47, 0xdc, 0x00, 0x07, 0xfa, 0x02, 0x23, 0xf0, 0x62, 0x92, 0x80, 0x21, 0x80, 0xc9, 0xf5, 0xf1, 0x0a, 0xed, 0xab, 0xd0, 0x08, 0x84, 0x53, 0xd1, 0x17, 0xd9, 0x5b, 0x4f, 0xad, 0x96, 0x0e, 0xc7, 0xe0, 0xd6, 0x48, 0x5f, 0xad, 0x11, 0x2d, 0xd0, 0x0c, 0x58, 0x95, 0xff, 0xcd, 0xa4, 0x04, 0x5a, 0x59, 0x36, 0x24, 0xa1, 0x24, 0x1b, 0x2b, 0x41, 0x76, 0x52, 0xbb, 0x0a, 0x95, 0x10, 0x1d, 0x05, 0x7a, 0x9b, 0x31, 0xb3, 0x94, 0xa4, 0xf1, 0x08, 0x1d, 0x19, 0x0c, 0xa8, 0xbd, 0x03, 0x2d, 0x6a, 0x57, 0x3e, 0x55, 0xdb, 0x3e, 0xe9, 0x05, 0xfa, 0x12, 0xdb, 0x51, 0x4f, 0x62, 0xdf, 0x13, 0x08, 0x77, 0x49, 0x2f, 0x30, 0x16, 0x71, 0x62, 0xa4, 0xb4, 0xce, 0xce, 0x3c, 0xd6, 0xf9, 0x18, 0x1a, 0xf7, 0x4e, 0x91, 0xe3, 0xd9, 0x38, 0x78, 0x9e, 0xe6, 0xf9, 0xa3, 0x22, 0x2c, 0x26, 0xd9, 0x9e, 0xc1, 0xbb, 0x66, 0x1d, 0xd2, 0x99, 0x9d, 0xfc, 0x3f, 0x4a, 0x00, 0xf7, 0x2d, 0x1b, 0x73, 0x63, 0xd7, 0xd6, 0xa0, 0x36, 0x20, 0xbe, 0x83, 0x42, 0xb1, 0xbd, 0x18, 0x51, 0xc7, 0x17, 0x5a, 0xa1, 0x2d, 0x1d, 0x3b, 0x1f, 0x8c, 0x73, 0x5c, 0xce, 0x72, 0x7c, 0x1d, 0xea, 0x7d, 0xee, 0xd9, 0x98, 0x0d, 0x8f, 0xbd, 0x63, 0xca, 0x91, 0x84, 0xa7, 0xc2, 0x02, 0x37, 0xea, 0x38, 0x2c, 0xc8, 0x08, 0x58, 0x4b, 0x44, 0xc0, 0x4d, 0x6a, 0x0b, 0xa8, 0x6f, 0x12, 0xd7, 0x1e, 0xe9, 0x75, 0x19, 0x47, 0x50, 0x7f, 0xcf, 0xb5, 0x47, 0x59, 0x9d, 0x69, 0xcc, 0xa5, 0x33, 0xd7, 0xa1, 0x8e, 0xf9, 0x2b, 0x17, 0x06, 0x9e, 0x65, 0x5b, 0xc0, 0x95, 0x6f, 0x00, 0xe6, 0x79, 0x03, 0x5f, 0xd4, 0x60, 0xe3, 0x3e, 0xf1, 0x9d, 0xbb, 0x28, 0x44, 0x91, 0x03, 0x38, 0x18, 0x1e, 0x1e, 0xc8, 0xb4, 0x29, 0x16, 0x4b, 0x71, 0x2c, 0x5a, 0xf2, 0xc8, 0x5a, 0xca, 0xcb, 0x55, 0xca, 0xf9, 0xf1, 0xb9, 0x92, 0x08, 0x73, 0x37, 0x60, 0x19, 0xd9, 0x36, 0x79, 0x6a, 0x62, 0xc7, 0x0b, 0x47, 0x26, 0x4f, 0xbc, 0xaa, 0x6c, 0xab, 0x25, 0x06, 0xb8, 0x47, 0xe7, 0x3f, 0x90, 0xc9, 0x56, 0xe6, 0x45, 0xc4, 0x3a, 0x53, 0x4f, 0xe9, 0xcc, 0xff, 0x43, 0xd5, 0x0a, 0xb1, 0x23, 0x65, 0xbf, 0x99, 0xf2, 0x74, 0xbe, 0xe5, 0x58, 0xa1, 0x75, 0xc2, 0x33, 0xc9, 0xc0, 0xe0, 0x98, 0xda, 0xeb, 0xb0, 0xdc, 0x23, 0xb6, 0x8d, 0x7b, 0x94, 0x59, 0x53, 0x50, 0x6d, 0x32, 0xaa, 0x9d, 0x18, 0x70, 0x9f, 0xd3, 0x4f, 0xe8, 0x16, 0x4c, 0xd1, 0x2d, 0x1d, 0xea, 0x0e, 0x3a, 0xb5, 0x9c, 0xa1, 0xc3, 0xbc, 0x66, 0xd1, 0x90, 0x43, 0xba, 0x23, 0x3e, 0xed, 0xd9, 0xc3, 0xc0, 0x3a, 0xc1, 0xa6, 0xc4, 0x59, 0x64, 0x0f, 0xdf, 0x89, 0x00, 0xdf, 0x14, 0xc8, 0x94, 0x8c, 0xe5, 0x32, 0x94, 0x96, 0x20, 0xc3, 0x87, 0x63, 0x64, 0x04, 0x4e, 0x7b, 0x9c, 0x8c, 0x40, 0x7e, 0x01, 0xc0, 0x41, 0xa7, 0xa6, 0x8d, 0xdd, 0xa3, 0xf0, 0x98, 0x79, 0xb3, 0xb2, 0xd1, 0x74, 0xd0, 0xe9, 0x43, 0x36, 0xc1, 0xc0, 0x96, 0x2b, 0xc1, 0x1d, 0x01, 0xb6, 0x5c, 0x01, 0xd6, 0xa1, 0xee, 0xa1, 0x90, 0x2a, 0xab, 0xbe, 0xcc, 0x83, 0xad, 0x18, 0x52, 0x8b, 0xa0, 0x74, 0xb9, 0xd0, 0x35, 0xb6, 0xae, 0xe1, 0xa0, 0x53, 0x26, 0x61, 0x06, 0xb4, 0x5c, 0x01, 0x5c, 0x11, 0x40, 0xcb, 0xe5, 0xc0, 0x97, 0x60, 0x71, 0xe8, 0x5a, 0x4f, 0x86, 0x58, 0xc0, 0x57, 0x19, 0xe7, 0x0b, 0x7c, 0x8e, 0xa3, 0x5c, 0x85, 0x0a, 0x76, 0x87, 0x8e, 0x7e, 0x21, 0xeb, 0xaa, 0xa9, 0xa8, 0x19, 0x50, 0x7b, 0x11, 0x16, 0x9c, 0xa1, 0x1d, 0x5a, 0x9e, 0x8d, 0x4d, 0x32, 0xd0, 0xd7, 0x98, 0x90, 0x40, 0x4e, 0xed, 0x0d, 0x94, 0xd6, 0x72, 0x71, 0x2e, 0x6b, 0xa9, 0x42, 0xad, 0x8b, 0x51, 0x1f, 0xfb, 0xca, 0xb4, 0x38, 0xd6, 0xc5, 0x92, 0x5a, 0x17, 0xcb, 0x67, 0xd3, 0xc5, 0xca, 0x74, 0x5d, 0xac, 0xce, 0xae, 0x8b, 0xb5, 0x19, 0x74, 0xb1, 0x3e, 0x5d, 0x17, 0x1b, 0x33, 0xe8, 0x62, 0x73, 0x26, 0x5d, 0x84, 0xc9, 0xba, 0xb8, 0x30, 0x41, 0x17, 0x17, 0x27, 0xe8, 0x62, 0x6b, 0x92, 0x2e, 0xb6, 0xa7, 0xe8, 0xe2, 0x52, 0xbe, 0x2e, 0x76, 0xe6, 0xd0, 0xc5, 0xe5, 0x8c, 0x2e, 0x8e, 0x79, 0x4b, 0x6d, 0xb6, 0x23, 0xd4, 0xca, 0x3c, 0xda, 0xfa, 0xb7, 0x2a, 0xe8, 0x5c, 0x5b, 0xff, 0x2d, 0x9e, 0x5d, 0x5a, 0x48, 0x55, 0x69, 0x21, 0x35, 0xb5, 0x85, 0xd4, 0xcf, 0x66, 0x21, 0x8d, 0xe9, 0x16, 0xd2, 0x9c, 0xdd, 0x42, 0x60, 0x06, 0x0b, 0x59, 0x98, 0x6e, 0x21, 0x8b, 0x33, 0x58, 0x48, 0x6b, 0x26, 0x0b, 0x69, 0x4f, 0xb6, 0x90, 0xa5, 0x09, 0x16, 0xd2, 0x99, 0x60, 0x21, 0xcb, 0x93, 0x2c, 0x44, 0x9b, 0x62, 0x21, 0x2b, 0xf9, 0x16, 0xb2, 0x3a, 0x87, 0x85, 0x5c, 0x98, 0xc9, 0x5b, 0xaf, 0xcd, 0xa3, 0xff, 0xdf, 0x82, 0x3a, 0x57, 0xff, 0x67, 0x38, 0x7e, 0xf2, 0x85, 0x39, 0xc9, 0xf3, 0xe7, 0x25, 0xa8, 0xd0, 0x03, 0x64, 0x9c, 0x98, 0x16, 0x93, 0x89, 0xa9, 0x0e, 0xf5, 0x13, 0xec, 0x07, 0x71, 0x65, 0x44, 0x0e, 0x67, 0x30, 0xa4, 0x6b, 0xd0, 0x09, 0xb1, 0xef, 0x04, 0x26, 0x19, 0x98, 0x01, 0xf6, 0x4f, 0xac, 0x9e, 0x34, 0xaa, 0x36, 0x9b, 0xdf, 0x1b, 0x1c, 0xf0, 0x59, 0xed, 0x26, 0xd4, 0x7b, 0xbc, 0x7c, 0x20, 0x9c, 0xfe, 0x4a, 0xf2, 0x21, 0x44, 0x65, 0xc1, 0x90, 0x38, 0x14, 0xdd, 0xb6, 0x7a, 0xd8, 0x0d, 0x78, 0xfa, 0x34, 0x86, 0xfe, 0x90, 0x83, 0x0c, 0x89, 0xa3, 0x14, 0x7e, 0x7d, 0x1e, 0xe1, 0xbf, 0x05, 0x4d, 0xa6, 0x0c, 0xac, 0x56, 0x77, 0x23, 0x51, 0xab, 0x2b, 0x4f, 0x2e, 0xac, 0x6c, 0xdd, 0x85, 0xd6, 0x37, 0x02, 0xe2, 0x1a, 0x78, 0x80, 0x7d, 0xec, 0xf6, 0xb0, 0xb6, 0x0c, 0x15, 0xd3, 0xc7, 0x03, 0x21, 0xe3, 0xb2, 0x81, 0x07, 0xd3, 0xeb, 0x4f, 0x5b, 0x1e, 0xd4, 0xc5, 0x33, 0xcd, 0x58, 0x5c, 0x39, 0xf3, 0x59, 0xe6, 0x1e, 0x34, 0x24, 0x50, 0xb9, 0xe5, 0x2b, 0xb2, 0xaa, 0x58, 0x52, 0x3b, 0x20, 0x0e, 0xdd, 0x7a, 0x17, 0x16, 0x12, 0x0a, 0xa8, 0xa4, 0x74, 0x2d, 0x4d, 0x29, 0x25, 0x4c, 0xa1, 0xb7, 0x82, 0xd8, 0xfb, 0xd0, 0x66, 0xc4, 0xe2, 0x22, 0x9a, 0x8a, 0xde, 0xeb, 0x69, 0x7a, 0x17, 0x94, 0x45, 0x01, 0x49, 0x72, 0x0f, 0x5a, 0x82, 0x64, 0x78, 0xcc, 0xde, 0xad, 0x8a, 0xe2, 0x8d, 0x34, 0xc5, 0xd5, 0xf1, 0x7a, 0x06, 0x5d, 0x38, 0x4e, 0x50, 0x56, 0x0f, 0xe6, 0x26, 0x28, 0x17, 0x4a, 0x82, 0x1f, 0x81, 0x96, 0x22, 0x18, 0x9d, 0x1d, 0x32, 0x54, 0x6f, 0xa5, 0xa9, 0xae, 0xab, 0xa8, 0xb2, 0xd5, 0xe3, 0x2f, 0x47, 0xc4, 0xd0, 0x79, 0x5f, 0x8e, 0xd0, 0x74, 0x41, 0xcc, 0x81, 0x4b, 0x9c, 0x58, 0xb6, 0x34, 0x91, 0x2b, 0xd8, 0xb7, 0xd3, 0xd4, 0xaf, 0x4e, 0xa9, 0x7b, 0x24, 0xe5, 0xfc, 0x96, 0xe4, 0x3d, 0xf4, 0x2d, 0xf7, 0x48, 0x49, 0x7d, 0x35, 0x49, 0xbd, 0x29, 0x17, 0x3e, 0x86, 0x4e, 0x62, 0xe1, 0xae, 0xef, 0x23, 0xb5, 0x82, 0xdf, 0x4c, 0xf3, 0x96, 0xf2, 0xa9, 0x89, 0xb5, 0x92, 0xec, 0x6f, 0xca, 0xd0, 0x79, 0x8f, 0xb8, 0xe9, 0x1a, 0x2f, 0x86, 0xcd, 0x63, 0xa6, 0xc1, 0x66, 0x54, 0x77, 0x32, 0x83, 0xe1, 0xa1, 0x99, 0xaa, 0xf4, 0xbf, 0x9c, 0x55, 0xf8, 0x6c, 0x82, 0xd3, 0x2d, 0x18, 0xfa, 0x71, 0x5e, 0xf2, 0x63, 0xc3, 0x65, 0x9a, 0x30, 0x98, 0x7d, 0x14, 0x22, 0xf5, 0x4e, 0xfc, 0x19, 0x5e, 0x4d, 0xee, 0x94, 0x7f, 0x4c, 0xee, 0x16, 0x8c, 0x8d, 0x41, 0xfe, 0x21, 0xfa, 0x10, 0x36, 0x9e, 0x0c, 0xb1, 0x3f, 0x52, 0xef, 0x54, 0xce, 0xbe, 0xc9, 0xf7, 0x29, 0xb6, 0x72, 0x9b, 0x8b, 0x4f, 0xd4, 0x20, 0xcd, 0x84, 0x75, 0x0f, 0x85, 0xc7, 0xea, 0x2d, 0x78, 0xf1, 0x63, 0x6b, 0xdc, 0x0a, 0x95, 0x3b, 0xac, 0x79, 0x4a, 0x48, 0xdc, 0x24, 0xf9, 0xbc, 0x04, 0xfa, 0x1e, 0x1a, 0x86, 0xc7, 0x3b, 0xbb, 0xbd, 0x1e, 0x0e, 0x82, 0x3b, 0xa4, 0x8f, 0xa7, 0xf5, 0x39, 0x06, 0x36, 0x79, 0x2a, 0xab, 0xf2, 0xf4, 0xbf, 0xf6, 0x06, 0x0d, 0x08, 0xc4, 0xc3, 0xf2, 0x48, 0x94, 0x2a, 0x8d, 0x70, 0xea, 0x07, 0x0c, 0x6e, 0x08, 0x3c, 0x9a, 0x35, 0xd1, 0x69, 0xe2, 0x5b, 0xdf, 0x67, 0xfd, 0x09, 0x93, 0xfa, 0x6f, 0x71, 0x20, 0x4a, 0x01, 0x1e, 0xfb, 0x36, 0x4d, 0x60, 0x42, 0xf2, 0x29, 0xe6, 0x48, 0x3c, 0xff, 0x6c, 0xb0, 0x09, 0x0a, 0x1c, 0x0b, 0x1e, 0xb5, 0xd9, 0x32, 0xef, 0xb9, 0x82, 0xdf, 0x5f, 0x8a, 0xb0, 0x2e, 0x64, 0xe4, 0x79, 0xf6, 0x2c, 0x1d, 0x95, 0xe7, 0x23, 0xa4, 0xd4, 0x73, 0x57, 0x26, 0x3f, 0x77, 0x75, 0xb6, 0xe7, 0x9e, 0xab, 0xa7, 0xf1, 0xc3, 0x12, 0xac, 0x71, 0xc6, 0x1e, 0x38, 0xf4, 0xb9, 0xad, 0xf0, 0x3f, 0x4d, 0x33, 0xfe, 0x05, 0x42, 0xf8, 0x73, 0x51, 0x0a, 0x61, 0x1f, 0x05, 0xc1, 0x53, 0xe2, 0xf7, 0xff, 0x07, 0xde, 0xfc, 0xc7, 0xb0, 0x98, 0xe4, 0xeb, 0x19, 0xfa, 0x3d, 0x2c, 0x42, 0xe4, 0x24, 0xdc, 0x3f, 0xaf, 0x40, 0x73, 0xcf, 0xc3, 0x3e, 0x92, 0x87, 0x4d, 0x56, 0xb7, 0x2f, 0xb2, 0x3a, 0x2d, 0x2f, 0xd3, 0xeb, 0x50, 0x0f, 0x86, 0x8e, 0x83, 0xfc, 0x91, 0xcc, 0xb9, 0xc5, 0x70, 0x86, 0x9c, 0x3b, 0x53, 0xae, 0xad, 0xcc, 0x55, 0xae, 0x7d, 0x09, 0x16, 0x89, 0xe4, 0xcd, 0xb4, 0xfa, 0x52, 0xbc, 0xd1, 0xdc, 0x83, 0x7e, 0xaa, 0xf7, 0x53, 0x1b, 0xeb, 0xfd, 0x24, 0x7b, 0x46, 0xf5, 0xb1, 0x9e, 0xd1, 0x57, 0x52, 0x3d, 0x9b, 0x06, 0x13, 0xdd, 0x86, 0x32, 0x3d, 0xe3, 0xa1, 0x3e, 0xd9, 0xad, 0x79, 0x33, 0xd9, 0xad, 0x69, 0x66, 0x33, 0x3b, 0x99, 0xe0, 0xa4, 0x7a, 0x34, 0x89, 0xd6, 0x16, 0xa4, 0x5b, 0x5b, 0x97, 0x01, 0xfa, 0xd8, 0xf3, 0x71, 0x0f, 0x85, 0xb8, 0x2f, 0x4e, 0xbd, 0x89, 0x99, 0xb3, 0x75, 0x77, 0x54, 0xea, 0xd7, 0x9a, 0x47, 0xfd, 0x7e, 0x59, 0x84, 0x66, 0x9c, 0x45, 0xdc, 0x86, 0xf6, 0x21, 0xe9, 0x27, 0xe2, 0xad, 0x48, 0x1c, 0x52, 0x09, 0x5e, 0x2a, 0xf1, 0xe8, 0x16, 0x8c, 0xd6, 0x61, 0x2a, 0x13, 0x79, 0x08, 0x9a, 0x4b, 0x5c, 0x73, 0x8c, 0x0e, 0x4f, 0x0b, 0x2e, 0xa5, 0x98, 0x1a, 0xcb, 0x61, 0xba, 0x05, 0xa3, 0xe3, 0x8e, 0xcd, 0xc5, 0xd1, 0xf3, 0x08, 0x56, 0x55, 0x7d, 0x36, 0x6d, 0x6f, 0xb2, 0xbd, 0x6c, 0x64, 0xc4, 0x10, 0x27, 0xe6, 0x6a, 0x93, 0xf9, 0xac, 0x08, 0xed, 0xb4, 0x76, 0x68, 0x5f, 0x82, 0xe6, 0xb8, 0x44, 0xd4, 0xb9, 0x7e, 0xb7, 0x60, 0xc4, 0x98, 0x54, 0x9a, 0x9f, 0x04, 0xc4, 0xa5, 0x67, 0x30, 0x7e, 0x22, 0x53, 0xa5, 0xcb, 0xa9, 0x23, 0x1b, 0x95, 0xe6, 0x27, 0xc9, 0x89, 0xf8, 0xf9, 0x7f, 0x5f, 0x86, 0x46, 0x74, 0x74, 0x50, 0x9c, 0xec, 0x5e, 0x83, 0xf2, 0x11, 0x0e, 0x55, 0x27, 0x91, 0xc8, 0xfe, 0x0d, 0x8a, 0x41, 0x11, 0xbd, 0x61, 0x28, 0xfc, 0x63, 0x1e, 0xa2, 0x37, 0x0c, 0xb5, 0xeb, 0x50, 0xf1, 0x48, 0x20, 0x3b, 0x40, 0x39, 0x98, 0x0c, 0x45, 0xbb, 0x09, 0xb5, 0x3e, 0xb6, 0x71, 0x88, 0xc5, 0x89, 0x3a, 0x07, 0x59, 0x20, 0x69, 0xb7, 0xa0, 0x4e, 0x3c, 0xde, 0x86, 0xac, 0x4d, 0xc2, 0x97, 0x58, 0x94, 0x15, 0x9a, 0x92, 0x8a, 0x22, 0x57, 0x1e, 0x2b, 0x14, 0x85, 0x9e, 0xc9, 0x3c, 0x14, 0xf6, 0x8e, 0x45, 0xfb, 0x22, 0x07, 0x97, 0xe3, 0x8c, 0xb9, 0x89, 0xe6, 0x5c, 0x6e, 0xe2, 0xcc, 0x1d, 0xa4, 0xbf, 0x56, 0x61, 0x4d, 0x9d, 0x4d, 0x9e, 0xd7, 0x18, 0xcf, 0x6b, 0x8c, 0xff, 0xed, 0x35, 0xc6, 0xa7, 0x50, 0x65, 0x17, 0x34, 0x94, 0x94, 0x8a, 0x73, 0x50, 0xd2, 0x6e, 0x42, 0x85, 0xdd, 0x36, 0x29, 0xb1, 0x45, 0xeb, 0x0a, 0x87, 0x2f, 0xea, 0x26, 0x0c, 0x6d, 0xeb, 0x67, 0x55, 0x58, 0x1a, 0xd3, 0xda, 0xf3, 0x9e, 0xd4, 0x79, 0x4f, 0xea, 0x4c, 0x3d, 0x29, 0x95, 0x0e, 0x6b, 0xf3, 0x58, 0xc3, 0xb7, 0x01, 0xe2, 0x14, 0xe4, 0x39, 0xdf, 0xf9, 0xfa, 0x55, 0x0d, 0x2e, 0xe6, 0x14, 0x46, 0xce, 0xaf, 0x29, 0x9c, 0x5f, 0x53, 0x38, 0xbf, 0xa6, 0x10, 0x9b, 0xe1, 0xdf, 0x8b, 0xd0, 0x88, 0xca, 0xe9, 0xd3, 0x2f, 0x76, 0x6d, 0x47, 0xdd, 0x19, 0x9e, 0x76, 0xaf, 0x65, 0x6b, 0xd6, 0x2c, 0xf0, 0xc8, 0xab, 0xaf, 0x37, 0xa1, 0xce, 0x2b, 0xab, 0x32, 0x78, 0xac, 0x64, 0x0b, 0xb2, 0x81, 0x21, 0x71, 0xb4, 0x37, 0xa0, 0x21, 0xae, 0x2b, 0xc9, 0x93, 0xf5, 0x6a, 0xfa, 0x64, 0xcd, 0x61, 0x46, 0x84, 0x75, 0xf6, 0x3b, 0xcd, 0x18, 0x56, 0x14, 0x97, 0x11, 0xb5, 0xf7, 0x26, 0x3b, 0xa4, 0x6c, 0xcc, 0x8d, 0x5a, 0x0b, 0x6a, 0x97, 0xf4, 0x93, 0x22, 0xb4, 0xd2, 0x5d, 0x86, 0x1d, 0xea, 0x88, 0xf8, 0x44, 0x74, 0x7b, 0x5c, 0x71, 0xe6, 0xee, 0x16, 0x8c, 0x08, 0xef, 0xf9, 0x9e, 0xaf, 0x7e, 0x5a, 0x84, 0x66, 0x74, 0xb2, 0xd7, 0xee, 0x40, 0x4b, 0x6e, 0x63, 0xf6, 0x48, 0x1f, 0x8b, 0x07, 0xbd, 0x9c, 0xfb, 0xa0, 0xbc, 0xdb, 0xb1, 0x28, 0x17, 0xdd, 0x21, 0x7d, 0x75, 0x2b, 0xb0, 0x34, 0xcf, 0xdb, 0xf8, 0x75, 0x13, 0x6a, 0xc2, 0x51, 0x2b, 0x4e, 0x7c, 0x79, 0x09, 0x4a, 0xd4, 0x5b, 0x2d, 0x4f, 0xb8, 0xf4, 0x57, 0x99, 0x78, 0xe9, 0x6f, 0x5a, 0xe2, 0x31, 0x66, 0x89, 0xb5, 0x8c, 0x25, 0x26, 0x5c, 0x62, 0x7d, 0x06, 0x97, 0xd8, 0x98, 0xee, 0x12, 0x9b, 0x33, 0xb8, 0x44, 0x98, 0xc9, 0x25, 0x2e, 0x4c, 0x76, 0x89, 0x8b, 0x13, 0x5c, 0x62, 0x6b, 0x82, 0x4b, 0x6c, 0x4f, 0x72, 0x89, 0x4b, 0x53, 0x5c, 0x62, 0x27, 0xeb, 0x12, 0x5f, 0x81, 0x36, 0x25, 0x9e, 0x30, 0x36, 0x7e, 0x12, 0x68, 0x39, 0xe8, 0x34, 0x91, 0x2b, 0x50, 0x34, 0xcb, 0x4d, 0xa2, 0x69, 0x02, 0xcd, 0x72, 0x13, 0x68, 0xc9, 0x40, 0xbf, 0x32, 0x76, 0x4d, 0x73, 0xa6, 0x13, 0xc1, 0x47, 0x79, 0x2e, 0xe0, 0x42, 0xb6, 0xb5, 0x94, 0xf7, 0xe9, 0x89, 0xda, 0x1b, 0x68, 0xd7, 0x44, 0xd8, 0x5f, 0xcb, 0xda, 0xfd, 0xa3, 0x91, 0x87, 0x79, 0xee, 0xce, 0x92, 0x81, 0xd7, 0x65, 0xd0, 0xbf, 0x98, 0x3d, 0xdc, 0x47, 0x4d, 0x73, 0x19, 0xee, 0xaf, 0x43, 0x0d, 0xd9, 0x36, 0xd5, 0x4f, 0x3d, 0xb7, 0x77, 0x5e, 0x45, 0xb6, 0xbd, 0x37, 0xd0, 0xbe, 0x0c, 0x90, 0x78, 0xa2, 0xf5, 0xac, 0x33, 0x8f, 0xb9, 0x35, 0x12, 0x98, 0xda, 0xcb, 0xd0, 0xea, 0x5b, 0xd4, 0x82, 0x1c, 0xcb, 0x45, 0x21, 0xf1, 0xf5, 0x0d, 0xa6, 0x20, 0xe9, 0xc9, 0xf4, 0x95, 0xd7, 0xcd, 0xb1, 0x2b, 0xaf, 0x2f, 0x41, 0xf9, 0xd4, 0xb1, 0xf5, 0x4b, 0x59, 0x8b, 0xfb, 0xd0, 0xb1, 0x0d, 0x0a, 0xcb, 0x96, 0x59, 0x5f, 0x78, 0xd6, 0x5b, 0xb1, 0x97, 0x9f, 0xe1, 0x56, 0xec, 0x8b, 0xf3, 0x78, 0xac, 0x1f, 0x00, 0xc4, 0x71, 0x6f, 0xce, 0x2f, 0x8d, 0xde, 0x86, 0x85, 0x81, 0x65, 0x63, 0x33, 0x3f, 0xa4, 0xc6, 0x37, 0x9e, 0xbb, 0x05, 0x03, 0x06, 0xd1, 0x28, 0xf6, 0xe2, 0x21, 0xac, 0x28, 0xba, 0xb9, 0xda, 0x77, 0x27, 0xc7, 0xaf, 0x6b, 0xd9, 0x84, 0x3a, 0xa7, 0x25, 0xac, 0x0e, 0x67, 0x7f, 0xaa, 0xc0, 0xc5, 0xbc, 0x66, 0xb4, 0x03, 0x2f, 0x1c, 0xa2, 0xc0, 0xea, 0x99, 0x28, 0xf5, 0x95, 0x90, 0x19, 0xd5, 0x7c, 0xb9, 0x68, 0x5e, 0x4b, 0x55, 0x58, 0xf3, 0xbf, 0x2a, 0xea, 0x16, 0x8c, 0xcd, 0xc3, 0x09, 0x1f, 0x1d, 0xdd, 0x87, 0x0e, 0xf2, 0x2c, 0xf3, 0x53, 0x3c, 0x8a, 0x77, 0xe0, 0x92, 0x4c, 0xd5, 0xb5, 0xd2, 0x5f, 0x59, 0x75, 0x0b, 0x46, 0x1b, 0xa5, 0xbf, 0xbb, 0xfa, 0x1e, 0xe8, 0x84, 0xb5, 0x25, 0x4c, 0x4b, 0x34, 0xa4, 0x62, 0x7a, 0xe5, 0x6c, 0x57, 0x54, 0xdd, 0xbb, 0xea, 0x16, 0x8c, 0x35, 0xa2, 0xee, 0x6a, 0xc5, 0xf4, 0x3d, 0xd1, 0xeb, 0x89, 0xe9, 0x57, 0xf2, 0xe8, 0x8f, 0xb7, 0x85, 0x62, 0xfa, 0x99, 0x86, 0xd1, 0x11, 0x6c, 0x0a, 0xfa, 0x28, 0x6e, 0x24, 0xc6, 0x5b, 0xf0, 0x00, 0xf7, 0x4a, 0x76, 0x0b, 0x45, 0xdb, 0xb1, 0x5b, 0x30, 0xd6, 0x49, 0x6e, 0x4f, 0x12, 0xc7, 0x1b, 0xb1, 0xae, 0x2e, 0x4b, 0x17, 0xe2, 0x8d, 0x6a, 0x59, 0xef, 0x98, 0xd7, 0x03, 0xee, 0x16, 0x0c, 0x21, 0x93, 0x2c, 0x2c, 0xd6, 0xf0, 0xe3, 0x58, 0xc3, 0x13, 0x2d, 0x01, 0xed, 0xfd, 0xc9, 0x1a, 0x7e, 0x29, 0xa7, 0x6d, 0xc4, 0x2f, 0x16, 0xa8, 0xb5, 0xfa, 0x2a, 0x2c, 0x24, 0x6f, 0x2e, 0xac, 0xc6, 0x1f, 0xf7, 0x95, 0xe3, 0x3b, 0x0e, 0xbf, 0x2d, 0x42, 0xf9, 0x11, 0x52, 0xdf, 0x8a, 0x98, 0xfe, 0xb1, 0x5b, 0xc6, 0xb3, 0x95, 0xcf, 0xfc, 0x8d, 0xc8, 0x5c, 0x5f, 0x70, 0x5d, 0x81, 0x86, 0x8c, 0x30, 0x39, 0xcf, 0xf7, 0x31, 0x2c, 0x7d, 0x30, 0x56, 0x6f, 0x7a, 0x8e, 0x1f, 0x93, 0xfc, 0xae, 0x08, 0xe5, 0x0f, 0x1d, 0x5b, 0x29, 0xbd, 0x4b, 0xd0, 0xa4, 0xbf, 0x81, 0x87, 0x7a, 0xf2, 0x5e, 0x49, 0x3c, 0x41, 0x93, 0x3f, 0xcf, 0xc7, 0x03, 0xeb, 0x54, 0x64, 0x79, 0x62, 0x44, 0x57, 0xa1, 0x30, 0xf4, 0xad, 0xc3, 0x61, 0x88, 0xc5, 0x67, 0x7a, 0xf1, 0x04, 0x4d, 0x65, 0x9e, 0xfa, 0xc8, 0xf3, 0x70, 0x5f, 0x1c, 0xc1, 0xe5, 0xf0, 0xcc, 0x7d, 0xcc, 0xdb, 0xaf, 0x42, 0x9b, 0xf8, 0x47, 0x12, 0xd7, 0x3c, 0xd9, 0xb9, 0xbd, 0x28, 0xbe, 0x5d, 0xdd, 0xf7, 0x49, 0x48, 0xf6, 0x8b, 0xbf, 0x28, 0x95, 0xf7, 0x76, 0x0f, 0x0e, 0x6b, 0xec, 0x63, 0xd0, 0x37, 0xff, 0x19, 0x00, 0x00, 0xff, 0xff, 0xd4, 0x0a, 0xef, 0xca, 0xe4, 0x3a, 0x00, 0x00, } ================================================ FILE: vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.proto ================================================ // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // THIS FILE IS AUTOMATICALLY GENERATED. syntax = "proto3"; package openapi.v2; import "google/protobuf/any.proto"; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "OpenAPIProto"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapi_v2"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. option objc_class_prefix = "OAS"; message AdditionalPropertiesItem { oneof oneof { Schema schema = 1; bool boolean = 2; } } message Any { google.protobuf.Any value = 1; string yaml = 2; } message ApiKeySecurity { string type = 1; string name = 2; string in = 3; string description = 4; repeated NamedAny vendor_extension = 5; } message BasicAuthenticationSecurity { string type = 1; string description = 2; repeated NamedAny vendor_extension = 3; } message BodyParameter { // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. string description = 1; // The name of the parameter. string name = 2; // Determines the location of the parameter. string in = 3; // Determines whether or not this parameter is required or optional. bool required = 4; Schema schema = 5; repeated NamedAny vendor_extension = 6; } // Contact information for the owners of the API. message Contact { // The identifying name of the contact person/organization. string name = 1; // The URL pointing to the contact information. string url = 2; // The email address of the contact person/organization. string email = 3; repeated NamedAny vendor_extension = 4; } message Default { repeated NamedAny additional_properties = 1; } // One or more JSON objects describing the schemas being consumed and produced by the API. message Definitions { repeated NamedSchema additional_properties = 1; } message Document { // The Swagger version of this document. string swagger = 1; Info info = 2; // The host (name or ip) of the API. Example: 'swagger.io' string host = 3; // The base path to the API. Example: '/api'. string base_path = 4; // The transfer protocol of the API. repeated string schemes = 5; // A list of MIME types accepted by the API. repeated string consumes = 6; // A list of MIME types the API can produce. repeated string produces = 7; Paths paths = 8; Definitions definitions = 9; ParameterDefinitions parameters = 10; ResponseDefinitions responses = 11; repeated SecurityRequirement security = 12; SecurityDefinitions security_definitions = 13; repeated Tag tags = 14; ExternalDocs external_docs = 15; repeated NamedAny vendor_extension = 16; } message Examples { repeated NamedAny additional_properties = 1; } // information about external documentation message ExternalDocs { string description = 1; string url = 2; repeated NamedAny vendor_extension = 3; } // A deterministic version of a JSON Schema object. message FileSchema { string format = 1; string title = 2; string description = 3; Any default = 4; repeated string required = 5; string type = 6; bool read_only = 7; ExternalDocs external_docs = 8; Any example = 9; repeated NamedAny vendor_extension = 10; } message FormDataParameterSubSchema { // Determines whether or not this parameter is required or optional. bool required = 1; // Determines the location of the parameter. string in = 2; // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. string description = 3; // The name of the parameter. string name = 4; // allows sending a parameter by name only or with an empty value. bool allow_empty_value = 5; string type = 6; string format = 7; PrimitivesItems items = 8; string collection_format = 9; Any default = 10; double maximum = 11; bool exclusive_maximum = 12; double minimum = 13; bool exclusive_minimum = 14; int64 max_length = 15; int64 min_length = 16; string pattern = 17; int64 max_items = 18; int64 min_items = 19; bool unique_items = 20; repeated Any enum = 21; double multiple_of = 22; repeated NamedAny vendor_extension = 23; } message Header { string type = 1; string format = 2; PrimitivesItems items = 3; string collection_format = 4; Any default = 5; double maximum = 6; bool exclusive_maximum = 7; double minimum = 8; bool exclusive_minimum = 9; int64 max_length = 10; int64 min_length = 11; string pattern = 12; int64 max_items = 13; int64 min_items = 14; bool unique_items = 15; repeated Any enum = 16; double multiple_of = 17; string description = 18; repeated NamedAny vendor_extension = 19; } message HeaderParameterSubSchema { // Determines whether or not this parameter is required or optional. bool required = 1; // Determines the location of the parameter. string in = 2; // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. string description = 3; // The name of the parameter. string name = 4; string type = 5; string format = 6; PrimitivesItems items = 7; string collection_format = 8; Any default = 9; double maximum = 10; bool exclusive_maximum = 11; double minimum = 12; bool exclusive_minimum = 13; int64 max_length = 14; int64 min_length = 15; string pattern = 16; int64 max_items = 17; int64 min_items = 18; bool unique_items = 19; repeated Any enum = 20; double multiple_of = 21; repeated NamedAny vendor_extension = 22; } message Headers { repeated NamedHeader additional_properties = 1; } // General information about the API. message Info { // A unique and precise title of the API. string title = 1; // A semantic version number of the API. string version = 2; // A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed. string description = 3; // The terms of service for the API. string terms_of_service = 4; Contact contact = 5; License license = 6; repeated NamedAny vendor_extension = 7; } message ItemsItem { repeated Schema schema = 1; } message JsonReference { string _ref = 1; string description = 2; } message License { // The name of the license type. It's encouraged to use an OSI compatible license. string name = 1; // The URL pointing to the license. string url = 2; repeated NamedAny vendor_extension = 3; } // Automatically-generated message used to represent maps of Any as ordered (name,value) pairs. message NamedAny { // Map key string name = 1; // Mapped value Any value = 2; } // Automatically-generated message used to represent maps of Header as ordered (name,value) pairs. message NamedHeader { // Map key string name = 1; // Mapped value Header value = 2; } // Automatically-generated message used to represent maps of Parameter as ordered (name,value) pairs. message NamedParameter { // Map key string name = 1; // Mapped value Parameter value = 2; } // Automatically-generated message used to represent maps of PathItem as ordered (name,value) pairs. message NamedPathItem { // Map key string name = 1; // Mapped value PathItem value = 2; } // Automatically-generated message used to represent maps of Response as ordered (name,value) pairs. message NamedResponse { // Map key string name = 1; // Mapped value Response value = 2; } // Automatically-generated message used to represent maps of ResponseValue as ordered (name,value) pairs. message NamedResponseValue { // Map key string name = 1; // Mapped value ResponseValue value = 2; } // Automatically-generated message used to represent maps of Schema as ordered (name,value) pairs. message NamedSchema { // Map key string name = 1; // Mapped value Schema value = 2; } // Automatically-generated message used to represent maps of SecurityDefinitionsItem as ordered (name,value) pairs. message NamedSecurityDefinitionsItem { // Map key string name = 1; // Mapped value SecurityDefinitionsItem value = 2; } // Automatically-generated message used to represent maps of string as ordered (name,value) pairs. message NamedString { // Map key string name = 1; // Mapped value string value = 2; } // Automatically-generated message used to represent maps of StringArray as ordered (name,value) pairs. message NamedStringArray { // Map key string name = 1; // Mapped value StringArray value = 2; } message NonBodyParameter { oneof oneof { HeaderParameterSubSchema header_parameter_sub_schema = 1; FormDataParameterSubSchema form_data_parameter_sub_schema = 2; QueryParameterSubSchema query_parameter_sub_schema = 3; PathParameterSubSchema path_parameter_sub_schema = 4; } } message Oauth2AccessCodeSecurity { string type = 1; string flow = 2; Oauth2Scopes scopes = 3; string authorization_url = 4; string token_url = 5; string description = 6; repeated NamedAny vendor_extension = 7; } message Oauth2ApplicationSecurity { string type = 1; string flow = 2; Oauth2Scopes scopes = 3; string token_url = 4; string description = 5; repeated NamedAny vendor_extension = 6; } message Oauth2ImplicitSecurity { string type = 1; string flow = 2; Oauth2Scopes scopes = 3; string authorization_url = 4; string description = 5; repeated NamedAny vendor_extension = 6; } message Oauth2PasswordSecurity { string type = 1; string flow = 2; Oauth2Scopes scopes = 3; string token_url = 4; string description = 5; repeated NamedAny vendor_extension = 6; } message Oauth2Scopes { repeated NamedString additional_properties = 1; } message Operation { repeated string tags = 1; // A brief summary of the operation. string summary = 2; // A longer description of the operation, GitHub Flavored Markdown is allowed. string description = 3; ExternalDocs external_docs = 4; // A unique identifier of the operation. string operation_id = 5; // A list of MIME types the API can produce. repeated string produces = 6; // A list of MIME types the API can consume. repeated string consumes = 7; // The parameters needed to send a valid API call. repeated ParametersItem parameters = 8; Responses responses = 9; // The transfer protocol of the API. repeated string schemes = 10; bool deprecated = 11; repeated SecurityRequirement security = 12; repeated NamedAny vendor_extension = 13; } message Parameter { oneof oneof { BodyParameter body_parameter = 1; NonBodyParameter non_body_parameter = 2; } } // One or more JSON representations for parameters message ParameterDefinitions { repeated NamedParameter additional_properties = 1; } message ParametersItem { oneof oneof { Parameter parameter = 1; JsonReference json_reference = 2; } } message PathItem { string _ref = 1; Operation get = 2; Operation put = 3; Operation post = 4; Operation delete = 5; Operation options = 6; Operation head = 7; Operation patch = 8; // The parameters needed to send a valid API call. repeated ParametersItem parameters = 9; repeated NamedAny vendor_extension = 10; } message PathParameterSubSchema { // Determines whether or not this parameter is required or optional. bool required = 1; // Determines the location of the parameter. string in = 2; // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. string description = 3; // The name of the parameter. string name = 4; string type = 5; string format = 6; PrimitivesItems items = 7; string collection_format = 8; Any default = 9; double maximum = 10; bool exclusive_maximum = 11; double minimum = 12; bool exclusive_minimum = 13; int64 max_length = 14; int64 min_length = 15; string pattern = 16; int64 max_items = 17; int64 min_items = 18; bool unique_items = 19; repeated Any enum = 20; double multiple_of = 21; repeated NamedAny vendor_extension = 22; } // Relative paths to the individual endpoints. They must be relative to the 'basePath'. message Paths { repeated NamedAny vendor_extension = 1; repeated NamedPathItem path = 2; } message PrimitivesItems { string type = 1; string format = 2; PrimitivesItems items = 3; string collection_format = 4; Any default = 5; double maximum = 6; bool exclusive_maximum = 7; double minimum = 8; bool exclusive_minimum = 9; int64 max_length = 10; int64 min_length = 11; string pattern = 12; int64 max_items = 13; int64 min_items = 14; bool unique_items = 15; repeated Any enum = 16; double multiple_of = 17; repeated NamedAny vendor_extension = 18; } message Properties { repeated NamedSchema additional_properties = 1; } message QueryParameterSubSchema { // Determines whether or not this parameter is required or optional. bool required = 1; // Determines the location of the parameter. string in = 2; // A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed. string description = 3; // The name of the parameter. string name = 4; // allows sending a parameter by name only or with an empty value. bool allow_empty_value = 5; string type = 6; string format = 7; PrimitivesItems items = 8; string collection_format = 9; Any default = 10; double maximum = 11; bool exclusive_maximum = 12; double minimum = 13; bool exclusive_minimum = 14; int64 max_length = 15; int64 min_length = 16; string pattern = 17; int64 max_items = 18; int64 min_items = 19; bool unique_items = 20; repeated Any enum = 21; double multiple_of = 22; repeated NamedAny vendor_extension = 23; } message Response { string description = 1; SchemaItem schema = 2; Headers headers = 3; Examples examples = 4; repeated NamedAny vendor_extension = 5; } // One or more JSON representations for parameters message ResponseDefinitions { repeated NamedResponse additional_properties = 1; } message ResponseValue { oneof oneof { Response response = 1; JsonReference json_reference = 2; } } // Response objects names can either be any valid HTTP status code or 'default'. message Responses { repeated NamedResponseValue response_code = 1; repeated NamedAny vendor_extension = 2; } // A deterministic version of a JSON Schema object. message Schema { string _ref = 1; string format = 2; string title = 3; string description = 4; Any default = 5; double multiple_of = 6; double maximum = 7; bool exclusive_maximum = 8; double minimum = 9; bool exclusive_minimum = 10; int64 max_length = 11; int64 min_length = 12; string pattern = 13; int64 max_items = 14; int64 min_items = 15; bool unique_items = 16; int64 max_properties = 17; int64 min_properties = 18; repeated string required = 19; repeated Any enum = 20; AdditionalPropertiesItem additional_properties = 21; TypeItem type = 22; ItemsItem items = 23; repeated Schema all_of = 24; Properties properties = 25; string discriminator = 26; bool read_only = 27; Xml xml = 28; ExternalDocs external_docs = 29; Any example = 30; repeated NamedAny vendor_extension = 31; } message SchemaItem { oneof oneof { Schema schema = 1; FileSchema file_schema = 2; } } message SecurityDefinitions { repeated NamedSecurityDefinitionsItem additional_properties = 1; } message SecurityDefinitionsItem { oneof oneof { BasicAuthenticationSecurity basic_authentication_security = 1; ApiKeySecurity api_key_security = 2; Oauth2ImplicitSecurity oauth2_implicit_security = 3; Oauth2PasswordSecurity oauth2_password_security = 4; Oauth2ApplicationSecurity oauth2_application_security = 5; Oauth2AccessCodeSecurity oauth2_access_code_security = 6; } } message SecurityRequirement { repeated NamedStringArray additional_properties = 1; } message StringArray { repeated string value = 1; } message Tag { string name = 1; string description = 2; ExternalDocs external_docs = 3; repeated NamedAny vendor_extension = 4; } message TypeItem { repeated string value = 1; } // Any property starting with x- is valid. message VendorExtension { repeated NamedAny additional_properties = 1; } message Xml { string name = 1; string namespace = 2; string prefix = 3; bool attribute = 4; bool wrapped = 5; repeated NamedAny vendor_extension = 6; } ================================================ FILE: vendor/github.com/googleapis/gnostic/OpenAPIv2/README.md ================================================ # OpenAPI v2 Protocol Buffer Models This directory contains a Protocol Buffer-language model and related code for supporting OpenAPI v2. Gnostic applications and plugins can use OpenAPIv2.proto to generate Protocol Buffer support code for their preferred languages. OpenAPIv2.go is used by Gnostic to read JSON and YAML OpenAPI descriptions into the Protocol Buffer-based datastructures generated from OpenAPIv2.proto. OpenAPIv2.proto and OpenAPIv2.go are generated by the Gnostic compiler generator, and OpenAPIv2.pb.go is generated by protoc, the Protocol Buffer compiler, and protoc-gen-go, the Protocol Buffer Go code generation plugin. ================================================ FILE: vendor/github.com/googleapis/gnostic/OpenAPIv2/openapi-2.0.json ================================================ { "title": "A JSON Schema for Swagger 2.0 API.", "id": "http://swagger.io/v2/schema.json#", "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "required": [ "swagger", "info", "paths" ], "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "swagger": { "type": "string", "enum": [ "2.0" ], "description": "The Swagger version of this document." }, "info": { "$ref": "#/definitions/info" }, "host": { "type": "string", "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$", "description": "The host (name or ip) of the API. Example: 'swagger.io'" }, "basePath": { "type": "string", "pattern": "^/", "description": "The base path to the API. Example: '/api'." }, "schemes": { "$ref": "#/definitions/schemesList" }, "consumes": { "description": "A list of MIME types accepted by the API.", "allOf": [ { "$ref": "#/definitions/mediaTypeList" } ] }, "produces": { "description": "A list of MIME types the API can produce.", "allOf": [ { "$ref": "#/definitions/mediaTypeList" } ] }, "paths": { "$ref": "#/definitions/paths" }, "definitions": { "$ref": "#/definitions/definitions" }, "parameters": { "$ref": "#/definitions/parameterDefinitions" }, "responses": { "$ref": "#/definitions/responseDefinitions" }, "security": { "$ref": "#/definitions/security" }, "securityDefinitions": { "$ref": "#/definitions/securityDefinitions" }, "tags": { "type": "array", "items": { "$ref": "#/definitions/tag" }, "uniqueItems": true }, "externalDocs": { "$ref": "#/definitions/externalDocs" } }, "definitions": { "info": { "type": "object", "description": "General information about the API.", "required": [ "version", "title" ], "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "title": { "type": "string", "description": "A unique and precise title of the API." }, "version": { "type": "string", "description": "A semantic version number of the API." }, "description": { "type": "string", "description": "A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed." }, "termsOfService": { "type": "string", "description": "The terms of service for the API." }, "contact": { "$ref": "#/definitions/contact" }, "license": { "$ref": "#/definitions/license" } } }, "contact": { "type": "object", "description": "Contact information for the owners of the API.", "additionalProperties": false, "properties": { "name": { "type": "string", "description": "The identifying name of the contact person/organization." }, "url": { "type": "string", "description": "The URL pointing to the contact information.", "format": "uri" }, "email": { "type": "string", "description": "The email address of the contact person/organization.", "format": "email" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "license": { "type": "object", "required": [ "name" ], "additionalProperties": false, "properties": { "name": { "type": "string", "description": "The name of the license type. It's encouraged to use an OSI compatible license." }, "url": { "type": "string", "description": "The URL pointing to the license.", "format": "uri" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "paths": { "type": "object", "description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.", "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" }, "^/": { "$ref": "#/definitions/pathItem" } }, "additionalProperties": false }, "definitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/schema" }, "description": "One or more JSON objects describing the schemas being consumed and produced by the API." }, "parameterDefinitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/parameter" }, "description": "One or more JSON representations for parameters" }, "responseDefinitions": { "type": "object", "additionalProperties": { "$ref": "#/definitions/response" }, "description": "One or more JSON representations for parameters" }, "externalDocs": { "type": "object", "additionalProperties": false, "description": "information about external documentation", "required": [ "url" ], "properties": { "description": { "type": "string" }, "url": { "type": "string", "format": "uri" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "examples": { "type": "object", "additionalProperties": true }, "mimeType": { "type": "string", "description": "The MIME type of the HTTP message." }, "operation": { "type": "object", "required": [ "responses" ], "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "tags": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, "summary": { "type": "string", "description": "A brief summary of the operation." }, "description": { "type": "string", "description": "A longer description of the operation, GitHub Flavored Markdown is allowed." }, "externalDocs": { "$ref": "#/definitions/externalDocs" }, "operationId": { "type": "string", "description": "A unique identifier of the operation." }, "produces": { "description": "A list of MIME types the API can produce.", "allOf": [ { "$ref": "#/definitions/mediaTypeList" } ] }, "consumes": { "description": "A list of MIME types the API can consume.", "allOf": [ { "$ref": "#/definitions/mediaTypeList" } ] }, "parameters": { "$ref": "#/definitions/parametersList" }, "responses": { "$ref": "#/definitions/responses" }, "schemes": { "$ref": "#/definitions/schemesList" }, "deprecated": { "type": "boolean", "default": false }, "security": { "$ref": "#/definitions/security" } } }, "pathItem": { "type": "object", "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "$ref": { "type": "string" }, "get": { "$ref": "#/definitions/operation" }, "put": { "$ref": "#/definitions/operation" }, "post": { "$ref": "#/definitions/operation" }, "delete": { "$ref": "#/definitions/operation" }, "options": { "$ref": "#/definitions/operation" }, "head": { "$ref": "#/definitions/operation" }, "patch": { "$ref": "#/definitions/operation" }, "parameters": { "$ref": "#/definitions/parametersList" } } }, "responses": { "type": "object", "description": "Response objects names can either be any valid HTTP status code or 'default'.", "minProperties": 1, "additionalProperties": false, "patternProperties": { "^([0-9]{3})$|^(default)$": { "$ref": "#/definitions/responseValue" }, "^x-": { "$ref": "#/definitions/vendorExtension" } }, "not": { "type": "object", "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } } }, "responseValue": { "oneOf": [ { "$ref": "#/definitions/response" }, { "$ref": "#/definitions/jsonReference" } ] }, "response": { "type": "object", "required": [ "description" ], "properties": { "description": { "type": "string" }, "schema": { "oneOf": [ { "$ref": "#/definitions/schema" }, { "$ref": "#/definitions/fileSchema" } ] }, "headers": { "$ref": "#/definitions/headers" }, "examples": { "$ref": "#/definitions/examples" } }, "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "headers": { "type": "object", "additionalProperties": { "$ref": "#/definitions/header" } }, "header": { "type": "object", "additionalProperties": false, "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "string", "number", "integer", "boolean", "array" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormat" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "vendorExtension": { "description": "Any property starting with x- is valid.", "additionalProperties": true, "additionalItems": true }, "bodyParameter": { "type": "object", "required": [ "name", "in", "schema" ], "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "in": { "type": "string", "description": "Determines the location of the parameter.", "enum": [ "body" ] }, "required": { "type": "boolean", "description": "Determines whether or not this parameter is required or optional.", "default": false }, "schema": { "$ref": "#/definitions/schema" } }, "additionalProperties": false }, "headerParameterSubSchema": { "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "required": { "type": "boolean", "description": "Determines whether or not this parameter is required or optional.", "default": false }, "in": { "type": "string", "description": "Determines the location of the parameter.", "enum": [ "header" ] }, "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "type": { "type": "string", "enum": [ "string", "number", "boolean", "integer", "array" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormat" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" } } }, "queryParameterSubSchema": { "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "required": { "type": "boolean", "description": "Determines whether or not this parameter is required or optional.", "default": false }, "in": { "type": "string", "description": "Determines the location of the parameter.", "enum": [ "query" ] }, "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "allowEmptyValue": { "type": "boolean", "default": false, "description": "allows sending a parameter by name only or with an empty value." }, "type": { "type": "string", "enum": [ "string", "number", "boolean", "integer", "array" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormatWithMulti" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" } } }, "formDataParameterSubSchema": { "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "required": { "type": "boolean", "description": "Determines whether or not this parameter is required or optional.", "default": false }, "in": { "type": "string", "description": "Determines the location of the parameter.", "enum": [ "formData" ] }, "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "allowEmptyValue": { "type": "boolean", "default": false, "description": "allows sending a parameter by name only or with an empty value." }, "type": { "type": "string", "enum": [ "string", "number", "boolean", "integer", "array", "file" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormatWithMulti" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" } } }, "pathParameterSubSchema": { "additionalProperties": false, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "required": [ "required" ], "properties": { "required": { "type": "boolean", "enum": [ true ], "description": "Determines whether or not this parameter is required or optional." }, "in": { "type": "string", "description": "Determines the location of the parameter.", "enum": [ "path" ] }, "description": { "type": "string", "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "name": { "type": "string", "description": "The name of the parameter." }, "type": { "type": "string", "enum": [ "string", "number", "boolean", "integer", "array" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormat" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" } } }, "nonBodyParameter": { "type": "object", "required": [ "name", "in", "type" ], "oneOf": [ { "$ref": "#/definitions/headerParameterSubSchema" }, { "$ref": "#/definitions/formDataParameterSubSchema" }, { "$ref": "#/definitions/queryParameterSubSchema" }, { "$ref": "#/definitions/pathParameterSubSchema" } ] }, "parameter": { "oneOf": [ { "$ref": "#/definitions/bodyParameter" }, { "$ref": "#/definitions/nonBodyParameter" } ] }, "schema": { "type": "object", "description": "A deterministic version of a JSON Schema object.", "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "properties": { "$ref": { "type": "string" }, "format": { "type": "string" }, "title": { "$ref": "http://json-schema.org/draft-04/schema#/properties/title" }, "description": { "$ref": "http://json-schema.org/draft-04/schema#/properties/description" }, "default": { "$ref": "http://json-schema.org/draft-04/schema#/properties/default" }, "multipleOf": { "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf" }, "maximum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum" }, "exclusiveMaximum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum" }, "minimum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum" }, "exclusiveMinimum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum" }, "maxLength": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" }, "minLength": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" }, "pattern": { "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern" }, "maxItems": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" }, "minItems": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" }, "uniqueItems": { "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems" }, "maxProperties": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" }, "minProperties": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" }, "required": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" }, "enum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/enum" }, "additionalProperties": { "oneOf": [ { "$ref": "#/definitions/schema" }, { "type": "boolean" } ], "default": {} }, "type": { "$ref": "http://json-schema.org/draft-04/schema#/properties/type" }, "items": { "anyOf": [ { "$ref": "#/definitions/schema" }, { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/schema" } } ], "default": {} }, "allOf": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/schema" } }, "properties": { "type": "object", "additionalProperties": { "$ref": "#/definitions/schema" }, "default": {} }, "discriminator": { "type": "string" }, "readOnly": { "type": "boolean", "default": false }, "xml": { "$ref": "#/definitions/xml" }, "externalDocs": { "$ref": "#/definitions/externalDocs" }, "example": {} }, "additionalProperties": false }, "fileSchema": { "type": "object", "description": "A deterministic version of a JSON Schema object.", "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } }, "required": [ "type" ], "properties": { "format": { "type": "string" }, "title": { "$ref": "http://json-schema.org/draft-04/schema#/properties/title" }, "description": { "$ref": "http://json-schema.org/draft-04/schema#/properties/description" }, "default": { "$ref": "http://json-schema.org/draft-04/schema#/properties/default" }, "required": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray" }, "type": { "type": "string", "enum": [ "file" ] }, "readOnly": { "type": "boolean", "default": false }, "externalDocs": { "$ref": "#/definitions/externalDocs" }, "example": {} }, "additionalProperties": false }, "primitivesItems": { "type": "object", "additionalProperties": false, "properties": { "type": { "type": "string", "enum": [ "string", "number", "integer", "boolean", "array" ] }, "format": { "type": "string" }, "items": { "$ref": "#/definitions/primitivesItems" }, "collectionFormat": { "$ref": "#/definitions/collectionFormat" }, "default": { "$ref": "#/definitions/default" }, "maximum": { "$ref": "#/definitions/maximum" }, "exclusiveMaximum": { "$ref": "#/definitions/exclusiveMaximum" }, "minimum": { "$ref": "#/definitions/minimum" }, "exclusiveMinimum": { "$ref": "#/definitions/exclusiveMinimum" }, "maxLength": { "$ref": "#/definitions/maxLength" }, "minLength": { "$ref": "#/definitions/minLength" }, "pattern": { "$ref": "#/definitions/pattern" }, "maxItems": { "$ref": "#/definitions/maxItems" }, "minItems": { "$ref": "#/definitions/minItems" }, "uniqueItems": { "$ref": "#/definitions/uniqueItems" }, "enum": { "$ref": "#/definitions/enum" }, "multipleOf": { "$ref": "#/definitions/multipleOf" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "security": { "type": "array", "items": { "$ref": "#/definitions/securityRequirement" }, "uniqueItems": true }, "securityRequirement": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" }, "uniqueItems": true } }, "xml": { "type": "object", "additionalProperties": false, "properties": { "name": { "type": "string" }, "namespace": { "type": "string" }, "prefix": { "type": "string" }, "attribute": { "type": "boolean", "default": false }, "wrapped": { "type": "boolean", "default": false } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "tag": { "type": "object", "additionalProperties": false, "required": [ "name" ], "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "externalDocs": { "$ref": "#/definitions/externalDocs" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "securityDefinitions": { "type": "object", "additionalProperties": { "oneOf": [ { "$ref": "#/definitions/basicAuthenticationSecurity" }, { "$ref": "#/definitions/apiKeySecurity" }, { "$ref": "#/definitions/oauth2ImplicitSecurity" }, { "$ref": "#/definitions/oauth2PasswordSecurity" }, { "$ref": "#/definitions/oauth2ApplicationSecurity" }, { "$ref": "#/definitions/oauth2AccessCodeSecurity" } ] } }, "basicAuthenticationSecurity": { "type": "object", "additionalProperties": false, "required": [ "type" ], "properties": { "type": { "type": "string", "enum": [ "basic" ] }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "apiKeySecurity": { "type": "object", "additionalProperties": false, "required": [ "type", "name", "in" ], "properties": { "type": { "type": "string", "enum": [ "apiKey" ] }, "name": { "type": "string" }, "in": { "type": "string", "enum": [ "header", "query" ] }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "oauth2ImplicitSecurity": { "type": "object", "additionalProperties": false, "required": [ "type", "flow", "authorizationUrl" ], "properties": { "type": { "type": "string", "enum": [ "oauth2" ] }, "flow": { "type": "string", "enum": [ "implicit" ] }, "scopes": { "$ref": "#/definitions/oauth2Scopes" }, "authorizationUrl": { "type": "string", "format": "uri" }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "oauth2PasswordSecurity": { "type": "object", "additionalProperties": false, "required": [ "type", "flow", "tokenUrl" ], "properties": { "type": { "type": "string", "enum": [ "oauth2" ] }, "flow": { "type": "string", "enum": [ "password" ] }, "scopes": { "$ref": "#/definitions/oauth2Scopes" }, "tokenUrl": { "type": "string", "format": "uri" }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "oauth2ApplicationSecurity": { "type": "object", "additionalProperties": false, "required": [ "type", "flow", "tokenUrl" ], "properties": { "type": { "type": "string", "enum": [ "oauth2" ] }, "flow": { "type": "string", "enum": [ "application" ] }, "scopes": { "$ref": "#/definitions/oauth2Scopes" }, "tokenUrl": { "type": "string", "format": "uri" }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "oauth2AccessCodeSecurity": { "type": "object", "additionalProperties": false, "required": [ "type", "flow", "authorizationUrl", "tokenUrl" ], "properties": { "type": { "type": "string", "enum": [ "oauth2" ] }, "flow": { "type": "string", "enum": [ "accessCode" ] }, "scopes": { "$ref": "#/definitions/oauth2Scopes" }, "authorizationUrl": { "type": "string", "format": "uri" }, "tokenUrl": { "type": "string", "format": "uri" }, "description": { "type": "string" } }, "patternProperties": { "^x-": { "$ref": "#/definitions/vendorExtension" } } }, "oauth2Scopes": { "type": "object", "additionalProperties": { "type": "string" } }, "mediaTypeList": { "type": "array", "items": { "$ref": "#/definitions/mimeType" }, "uniqueItems": true }, "parametersList": { "type": "array", "description": "The parameters needed to send a valid API call.", "additionalItems": false, "items": { "oneOf": [ { "$ref": "#/definitions/parameter" }, { "$ref": "#/definitions/jsonReference" } ] }, "uniqueItems": true }, "schemesList": { "type": "array", "description": "The transfer protocol of the API.", "items": { "type": "string", "enum": [ "http", "https", "ws", "wss" ] }, "uniqueItems": true }, "collectionFormat": { "type": "string", "enum": [ "csv", "ssv", "tsv", "pipes" ], "default": "csv" }, "collectionFormatWithMulti": { "type": "string", "enum": [ "csv", "ssv", "tsv", "pipes", "multi" ], "default": "csv" }, "title": { "$ref": "http://json-schema.org/draft-04/schema#/properties/title" }, "description": { "$ref": "http://json-schema.org/draft-04/schema#/properties/description" }, "default": { "$ref": "http://json-schema.org/draft-04/schema#/properties/default" }, "multipleOf": { "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf" }, "maximum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum" }, "exclusiveMaximum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum" }, "minimum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum" }, "exclusiveMinimum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum" }, "maxLength": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" }, "minLength": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" }, "pattern": { "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern" }, "maxItems": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger" }, "minItems": { "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0" }, "uniqueItems": { "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems" }, "enum": { "$ref": "http://json-schema.org/draft-04/schema#/properties/enum" }, "jsonReference": { "type": "object", "required": [ "$ref" ], "additionalProperties": false, "properties": { "$ref": { "type": "string" }, "description": { "type": "string" } } } } } ================================================ FILE: vendor/github.com/googleapis/gnostic/compiler/README.md ================================================ # Compiler support code This directory contains compiler support code used by Gnostic and Gnostic extensions. ================================================ FILE: vendor/github.com/googleapis/gnostic/compiler/context.go ================================================ // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package compiler // Context contains state of the compiler as it traverses a document. type Context struct { Parent *Context Name string ExtensionHandlers *[]ExtensionHandler } // NewContextWithExtensions returns a new object representing the compiler state func NewContextWithExtensions(name string, parent *Context, extensionHandlers *[]ExtensionHandler) *Context { return &Context{Name: name, Parent: parent, ExtensionHandlers: extensionHandlers} } // NewContext returns a new object representing the compiler state func NewContext(name string, parent *Context) *Context { if parent != nil { return &Context{Name: name, Parent: parent, ExtensionHandlers: parent.ExtensionHandlers} } return &Context{Name: name, Parent: parent, ExtensionHandlers: nil} } // Description returns a text description of the compiler state func (context *Context) Description() string { if context.Parent != nil { return context.Parent.Description() + "." + context.Name } return context.Name } ================================================ FILE: vendor/github.com/googleapis/gnostic/compiler/error.go ================================================ // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package compiler // Error represents compiler errors and their location in the document. type Error struct { Context *Context Message string } // NewError creates an Error. func NewError(context *Context, message string) *Error { return &Error{Context: context, Message: message} } // Error returns the string value of an Error. func (err *Error) Error() string { if err.Context == nil { return "ERROR " + err.Message } return "ERROR " + err.Context.Description() + " " + err.Message } // ErrorGroup is a container for groups of Error values. type ErrorGroup struct { Errors []error } // NewErrorGroupOrNil returns a new ErrorGroup for a slice of errors or nil if the slice is empty. func NewErrorGroupOrNil(errors []error) error { if len(errors) == 0 { return nil } else if len(errors) == 1 { return errors[0] } else { return &ErrorGroup{Errors: errors} } } func (group *ErrorGroup) Error() string { result := "" for i, err := range group.Errors { if i > 0 { result += "\n" } result += err.Error() } return result } ================================================ FILE: vendor/github.com/googleapis/gnostic/compiler/extension-handler.go ================================================ // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package compiler import ( "bytes" "fmt" "os/exec" "strings" "errors" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes/any" ext_plugin "github.com/googleapis/gnostic/extensions" yaml "gopkg.in/yaml.v2" ) // ExtensionHandler describes a binary that is called by the compiler to handle specification extensions. type ExtensionHandler struct { Name string } // HandleExtension calls a binary extension handler. func HandleExtension(context *Context, in interface{}, extensionName string) (bool, *any.Any, error) { handled := false var errFromPlugin error var outFromPlugin *any.Any if context != nil && context.ExtensionHandlers != nil && len(*(context.ExtensionHandlers)) != 0 { for _, customAnyProtoGenerator := range *(context.ExtensionHandlers) { outFromPlugin, errFromPlugin = customAnyProtoGenerator.handle(in, extensionName) if outFromPlugin == nil { continue } else { handled = true break } } } return handled, outFromPlugin, errFromPlugin } func (extensionHandlers *ExtensionHandler) handle(in interface{}, extensionName string) (*any.Any, error) { if extensionHandlers.Name != "" { binary, _ := yaml.Marshal(in) request := &ext_plugin.ExtensionHandlerRequest{} version := &ext_plugin.Version{} version.Major = 0 version.Minor = 1 version.Patch = 0 request.CompilerVersion = version request.Wrapper = &ext_plugin.Wrapper{} request.Wrapper.Version = "v2" request.Wrapper.Yaml = string(binary) request.Wrapper.ExtensionName = extensionName requestBytes, _ := proto.Marshal(request) cmd := exec.Command(extensionHandlers.Name) cmd.Stdin = bytes.NewReader(requestBytes) output, err := cmd.Output() if err != nil { fmt.Printf("Error: %+v\n", err) return nil, err } response := &ext_plugin.ExtensionHandlerResponse{} err = proto.Unmarshal(output, response) if err != nil { fmt.Printf("Error: %+v\n", err) fmt.Printf("%s\n", string(output)) return nil, err } if !response.Handled { return nil, nil } if len(response.Error) != 0 { message := fmt.Sprintf("Errors when parsing: %+v for field %s by vendor extension handler %s. Details %+v", in, extensionName, extensionHandlers.Name, strings.Join(response.Error, ",")) return nil, errors.New(message) } return response.Value, nil } return nil, nil } ================================================ FILE: vendor/github.com/googleapis/gnostic/compiler/helpers.go ================================================ // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package compiler import ( "fmt" "gopkg.in/yaml.v2" "regexp" "sort" "strconv" ) // compiler helper functions, usually called from generated code // UnpackMap gets a yaml.MapSlice if possible. func UnpackMap(in interface{}) (yaml.MapSlice, bool) { m, ok := in.(yaml.MapSlice) if ok { return m, true } // do we have an empty array? a, ok := in.([]interface{}) if ok && len(a) == 0 { // if so, return an empty map return yaml.MapSlice{}, true } return nil, false } // SortedKeysForMap returns the sorted keys of a yaml.MapSlice. func SortedKeysForMap(m yaml.MapSlice) []string { keys := make([]string, 0) for _, item := range m { keys = append(keys, item.Key.(string)) } sort.Strings(keys) return keys } // MapHasKey returns true if a yaml.MapSlice contains a specified key. func MapHasKey(m yaml.MapSlice, key string) bool { for _, item := range m { itemKey, ok := item.Key.(string) if ok && key == itemKey { return true } } return false } // MapValueForKey gets the value of a map value for a specified key. func MapValueForKey(m yaml.MapSlice, key string) interface{} { for _, item := range m { itemKey, ok := item.Key.(string) if ok && key == itemKey { return item.Value } } return nil } // ConvertInterfaceArrayToStringArray converts an array of interfaces to an array of strings, if possible. func ConvertInterfaceArrayToStringArray(interfaceArray []interface{}) []string { stringArray := make([]string, 0) for _, item := range interfaceArray { v, ok := item.(string) if ok { stringArray = append(stringArray, v) } } return stringArray } // MissingKeysInMap identifies which keys from a list of required keys are not in a map. func MissingKeysInMap(m yaml.MapSlice, requiredKeys []string) []string { missingKeys := make([]string, 0) for _, k := range requiredKeys { if !MapHasKey(m, k) { missingKeys = append(missingKeys, k) } } return missingKeys } // InvalidKeysInMap returns keys in a map that don't match a list of allowed keys and patterns. func InvalidKeysInMap(m yaml.MapSlice, allowedKeys []string, allowedPatterns []*regexp.Regexp) []string { invalidKeys := make([]string, 0) for _, item := range m { itemKey, ok := item.Key.(string) if ok { key := itemKey found := false // does the key match an allowed key? for _, allowedKey := range allowedKeys { if key == allowedKey { found = true break } } if !found { // does the key match an allowed pattern? for _, allowedPattern := range allowedPatterns { if allowedPattern.MatchString(key) { found = true break } } if !found { invalidKeys = append(invalidKeys, key) } } } } return invalidKeys } // DescribeMap describes a map (for debugging purposes). func DescribeMap(in interface{}, indent string) string { description := "" m, ok := in.(map[string]interface{}) if ok { keys := make([]string, 0) for k := range m { keys = append(keys, k) } sort.Strings(keys) for _, k := range keys { v := m[k] description += fmt.Sprintf("%s%s:\n", indent, k) description += DescribeMap(v, indent+" ") } return description } a, ok := in.([]interface{}) if ok { for i, v := range a { description += fmt.Sprintf("%s%d:\n", indent, i) description += DescribeMap(v, indent+" ") } return description } description += fmt.Sprintf("%s%+v\n", indent, in) return description } // PluralProperties returns the string "properties" pluralized. func PluralProperties(count int) string { if count == 1 { return "property" } return "properties" } // StringArrayContainsValue returns true if a string array contains a specified value. func StringArrayContainsValue(array []string, value string) bool { for _, item := range array { if item == value { return true } } return false } // StringArrayContainsValues returns true if a string array contains all of a list of specified values. func StringArrayContainsValues(array []string, values []string) bool { for _, value := range values { if !StringArrayContainsValue(array, value) { return false } } return true } // StringValue returns the string value of an item. func StringValue(item interface{}) (value string, ok bool) { value, ok = item.(string) if ok { return value, ok } intValue, ok := item.(int) if ok { return strconv.Itoa(intValue), true } return "", false } ================================================ FILE: vendor/github.com/googleapis/gnostic/compiler/main.go ================================================ // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package compiler provides support functions to generated compiler code. package compiler ================================================ FILE: vendor/github.com/googleapis/gnostic/compiler/reader.go ================================================ // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package compiler import ( "errors" "fmt" "gopkg.in/yaml.v2" "io/ioutil" "log" "net/http" "net/url" "path/filepath" "strings" ) var fileCache map[string][]byte var infoCache map[string]interface{} var count int64 var verboseReader = false func initializeFileCache() { if fileCache == nil { fileCache = make(map[string][]byte, 0) } } func initializeInfoCache() { if infoCache == nil { infoCache = make(map[string]interface{}, 0) } } // FetchFile gets a specified file from the local filesystem or a remote location. func FetchFile(fileurl string) ([]byte, error) { initializeFileCache() bytes, ok := fileCache[fileurl] if ok { if verboseReader { log.Printf("Cache hit %s", fileurl) } return bytes, nil } if verboseReader { log.Printf("Fetching %s", fileurl) } response, err := http.Get(fileurl) if err != nil { return nil, err } if response.StatusCode != 200 { return nil, errors.New(fmt.Sprintf("Error downloading %s: %s", fileurl, response.Status)) } defer response.Body.Close() bytes, err = ioutil.ReadAll(response.Body) if err == nil { fileCache[fileurl] = bytes } return bytes, err } // ReadBytesForFile reads the bytes of a file. func ReadBytesForFile(filename string) ([]byte, error) { // is the filename a url? fileurl, _ := url.Parse(filename) if fileurl.Scheme != "" { // yes, fetch it bytes, err := FetchFile(filename) if err != nil { return nil, err } return bytes, nil } // no, it's a local filename bytes, err := ioutil.ReadFile(filename) if err != nil { return nil, err } return bytes, nil } // ReadInfoFromBytes unmarshals a file as a yaml.MapSlice. func ReadInfoFromBytes(filename string, bytes []byte) (interface{}, error) { initializeInfoCache() cachedInfo, ok := infoCache[filename] if ok { if verboseReader { log.Printf("Cache hit info for file %s", filename) } return cachedInfo, nil } if verboseReader { log.Printf("Reading info for file %s", filename) } var info yaml.MapSlice err := yaml.Unmarshal(bytes, &info) if err != nil { return nil, err } infoCache[filename] = info return info, nil } // ReadInfoForRef reads a file and return the fragment needed to resolve a $ref. func ReadInfoForRef(basefile string, ref string) (interface{}, error) { initializeInfoCache() { info, ok := infoCache[ref] if ok { if verboseReader { log.Printf("Cache hit for ref %s#%s", basefile, ref) } return info, nil } } if verboseReader { log.Printf("Reading info for ref %s#%s", basefile, ref) } count = count + 1 basedir, _ := filepath.Split(basefile) parts := strings.Split(ref, "#") var filename string if parts[0] != "" { filename = basedir + parts[0] } else { filename = basefile } bytes, err := ReadBytesForFile(filename) if err != nil { return nil, err } info, err := ReadInfoFromBytes(filename, bytes) if err != nil { log.Printf("File error: %v\n", err) } else { if len(parts) > 1 { path := strings.Split(parts[1], "/") for i, key := range path { if i > 0 { m, ok := info.(yaml.MapSlice) if ok { found := false for _, section := range m { if section.Key == key { info = section.Value found = true } } if !found { infoCache[ref] = nil return nil, NewError(nil, fmt.Sprintf("could not resolve %s", ref)) } } } } } } infoCache[ref] = info return info, nil } ================================================ FILE: vendor/github.com/googleapis/gnostic/extensions/COMPILE-EXTENSION.sh ================================================ go get github.com/golang/protobuf/protoc-gen-go protoc \ --go_out=Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any:. *.proto ================================================ FILE: vendor/github.com/googleapis/gnostic/extensions/README.md ================================================ # Extensions This directory contains support code for building Gnostic extensions and associated examples. Extensions are used to compile vendor or specification extensions into protocol buffer structures. ================================================ FILE: vendor/github.com/googleapis/gnostic/extensions/extension.pb.go ================================================ // Code generated by protoc-gen-go. // source: extension.proto // DO NOT EDIT! /* Package openapiextension_v1 is a generated protocol buffer package. It is generated from these files: extension.proto It has these top-level messages: Version ExtensionHandlerRequest ExtensionHandlerResponse Wrapper */ package openapiextension_v1 import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import google_protobuf "github.com/golang/protobuf/ptypes/any" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package // The version number of OpenAPI compiler. type Version struct { Major int32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"` Minor int32 `protobuf:"varint,2,opt,name=minor" json:"minor,omitempty"` Patch int32 `protobuf:"varint,3,opt,name=patch" json:"patch,omitempty"` // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should // be empty for mainline stable releases. Suffix string `protobuf:"bytes,4,opt,name=suffix" json:"suffix,omitempty"` } func (m *Version) Reset() { *m = Version{} } func (m *Version) String() string { return proto.CompactTextString(m) } func (*Version) ProtoMessage() {} func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (m *Version) GetMajor() int32 { if m != nil { return m.Major } return 0 } func (m *Version) GetMinor() int32 { if m != nil { return m.Minor } return 0 } func (m *Version) GetPatch() int32 { if m != nil { return m.Patch } return 0 } func (m *Version) GetSuffix() string { if m != nil { return m.Suffix } return "" } // An encoded Request is written to the ExtensionHandler's stdin. type ExtensionHandlerRequest struct { // The OpenAPI descriptions that were explicitly listed on the command line. // The specifications will appear in the order they are specified to openapic. Wrapper *Wrapper `protobuf:"bytes,1,opt,name=wrapper" json:"wrapper,omitempty"` // The version number of openapi compiler. CompilerVersion *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion" json:"compiler_version,omitempty"` } func (m *ExtensionHandlerRequest) Reset() { *m = ExtensionHandlerRequest{} } func (m *ExtensionHandlerRequest) String() string { return proto.CompactTextString(m) } func (*ExtensionHandlerRequest) ProtoMessage() {} func (*ExtensionHandlerRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } func (m *ExtensionHandlerRequest) GetWrapper() *Wrapper { if m != nil { return m.Wrapper } return nil } func (m *ExtensionHandlerRequest) GetCompilerVersion() *Version { if m != nil { return m.CompilerVersion } return nil } // The extensions writes an encoded ExtensionHandlerResponse to stdout. type ExtensionHandlerResponse struct { // true if the extension is handled by the extension handler; false otherwise Handled bool `protobuf:"varint,1,opt,name=handled" json:"handled,omitempty"` // Error message. If non-empty, the extension handling failed. // The extension handler process should exit with status code zero // even if it reports an error in this way. // // This should be used to indicate errors which prevent the extension from // operating as intended. Errors which indicate a problem in gnostic // itself -- such as the input Document being unparseable -- should be // reported by writing a message to stderr and exiting with a non-zero // status code. Error []string `protobuf:"bytes,2,rep,name=error" json:"error,omitempty"` // text output Value *google_protobuf.Any `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` } func (m *ExtensionHandlerResponse) Reset() { *m = ExtensionHandlerResponse{} } func (m *ExtensionHandlerResponse) String() string { return proto.CompactTextString(m) } func (*ExtensionHandlerResponse) ProtoMessage() {} func (*ExtensionHandlerResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (m *ExtensionHandlerResponse) GetHandled() bool { if m != nil { return m.Handled } return false } func (m *ExtensionHandlerResponse) GetError() []string { if m != nil { return m.Error } return nil } func (m *ExtensionHandlerResponse) GetValue() *google_protobuf.Any { if m != nil { return m.Value } return nil } type Wrapper struct { // version of the OpenAPI specification in which this extension was written. Version string `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"` // Name of the extension ExtensionName string `protobuf:"bytes,2,opt,name=extension_name,json=extensionName" json:"extension_name,omitempty"` // Must be a valid yaml for the proto Yaml string `protobuf:"bytes,3,opt,name=yaml" json:"yaml,omitempty"` } func (m *Wrapper) Reset() { *m = Wrapper{} } func (m *Wrapper) String() string { return proto.CompactTextString(m) } func (*Wrapper) ProtoMessage() {} func (*Wrapper) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *Wrapper) GetVersion() string { if m != nil { return m.Version } return "" } func (m *Wrapper) GetExtensionName() string { if m != nil { return m.ExtensionName } return "" } func (m *Wrapper) GetYaml() string { if m != nil { return m.Yaml } return "" } func init() { proto.RegisterType((*Version)(nil), "openapiextension.v1.Version") proto.RegisterType((*ExtensionHandlerRequest)(nil), "openapiextension.v1.ExtensionHandlerRequest") proto.RegisterType((*ExtensionHandlerResponse)(nil), "openapiextension.v1.ExtensionHandlerResponse") proto.RegisterType((*Wrapper)(nil), "openapiextension.v1.Wrapper") } func init() { proto.RegisterFile("extension.proto", fileDescriptor0) } var fileDescriptor0 = []byte{ // 355 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x4d, 0x4b, 0xf3, 0x40, 0x1c, 0xc4, 0x49, 0xdf, 0xf2, 0x64, 0x1f, 0xb4, 0xb2, 0x16, 0x8d, 0xe2, 0xa1, 0x04, 0x84, 0x22, 0xb8, 0xa5, 0x0a, 0xde, 0x5b, 0x28, 0xea, 0xc5, 0x96, 0x3d, 0xd4, 0x9b, 0x65, 0x9b, 0xfe, 0xdb, 0x46, 0x92, 0xdd, 0x75, 0xf3, 0x62, 0xfb, 0x55, 0x3c, 0xfa, 0x49, 0x25, 0xbb, 0xd9, 0x7a, 0x50, 0x6f, 0x99, 0x1f, 0x93, 0xfc, 0x67, 0x26, 0xa8, 0x0d, 0xdb, 0x0c, 0x78, 0x1a, 0x09, 0x4e, 0xa4, 0x12, 0x99, 0xc0, 0xc7, 0x42, 0x02, 0x67, 0x32, 0xfa, 0xe6, 0xc5, 0xe0, 0xfc, 0x6c, 0x2d, 0xc4, 0x3a, 0x86, 0xbe, 0xb6, 0x2c, 0xf2, 0x55, 0x9f, 0xf1, 0x9d, 0xf1, 0x07, 0x21, 0x72, 0x67, 0xa0, 0x4a, 0x23, 0xee, 0xa0, 0x66, 0xc2, 0x5e, 0x85, 0xf2, 0x9d, 0xae, 0xd3, 0x6b, 0x52, 0x23, 0x34, 0x8d, 0xb8, 0x50, 0x7e, 0xad, 0xa2, 0xa5, 0x28, 0xa9, 0x64, 0x59, 0xb8, 0xf1, 0xeb, 0x86, 0x6a, 0x81, 0x4f, 0x50, 0x2b, 0xcd, 0x57, 0xab, 0x68, 0xeb, 0x37, 0xba, 0x4e, 0xcf, 0xa3, 0x95, 0x0a, 0x3e, 0x1c, 0x74, 0x3a, 0xb6, 0x81, 0x1e, 0x18, 0x5f, 0xc6, 0xa0, 0x28, 0xbc, 0xe5, 0x90, 0x66, 0xf8, 0x0e, 0xb9, 0xef, 0x8a, 0x49, 0x09, 0xe6, 0xee, 0xff, 0x9b, 0x0b, 0xf2, 0x4b, 0x05, 0xf2, 0x6c, 0x3c, 0xd4, 0x9a, 0xf1, 0x3d, 0x3a, 0x0a, 0x45, 0x22, 0xa3, 0x18, 0xd4, 0xbc, 0x30, 0x0d, 0x74, 0x98, 0xbf, 0x3e, 0x50, 0xb5, 0xa4, 0x6d, 0xfb, 0x56, 0x05, 0x82, 0x02, 0xf9, 0x3f, 0xb3, 0xa5, 0x52, 0xf0, 0x14, 0xb0, 0x8f, 0xdc, 0x8d, 0x46, 0x4b, 0x1d, 0xee, 0x1f, 0xb5, 0xb2, 0x1c, 0x00, 0x94, 0xd2, 0xb3, 0xd4, 0x7b, 0x1e, 0x35, 0x02, 0x5f, 0xa1, 0x66, 0xc1, 0xe2, 0x1c, 0xaa, 0x24, 0x1d, 0x62, 0x86, 0x27, 0x76, 0x78, 0x32, 0xe4, 0x3b, 0x6a, 0x2c, 0xc1, 0x0b, 0x72, 0xab, 0x52, 0xe5, 0x19, 0x5b, 0xc1, 0xd1, 0xc3, 0x59, 0x89, 0x2f, 0xd1, 0xe1, 0xbe, 0xc5, 0x9c, 0xb3, 0x04, 0xf4, 0x6f, 0xf0, 0xe8, 0xc1, 0x9e, 0x3e, 0xb1, 0x04, 0x30, 0x46, 0x8d, 0x1d, 0x4b, 0x62, 0x7d, 0xd6, 0xa3, 0xfa, 0x79, 0x74, 0x8d, 0xda, 0x42, 0xad, 0xed, 0x16, 0x21, 0x29, 0x06, 0x23, 0x3c, 0x91, 0xc0, 0x87, 0xd3, 0xc7, 0x7d, 0xdf, 0xd9, 0x60, 0xea, 0x7c, 0xd6, 0xea, 0x93, 0xe1, 0x78, 0xd1, 0xd2, 0x19, 0x6f, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x56, 0x40, 0x4d, 0x52, 0x02, 0x00, 0x00, } ================================================ FILE: vendor/github.com/googleapis/gnostic/extensions/extension.proto ================================================ // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; import "google/protobuf/any.proto"; package openapiextension.v1; // This option lets the proto compiler generate Java code inside the package // name (see below) instead of inside an outer class. It creates a simpler // developer experience by reducing one-level of name nesting and be // consistent with most programming languages that don't support outer classes. option java_multiple_files = true; // The Java outer classname should be the filename in UpperCamelCase. This // class is only used to hold proto descriptor, so developers don't need to // work with it directly. option java_outer_classname = "OpenAPIExtensionV1"; // The Java package name must be proto package name with proper prefix. option java_package = "org.openapic.v1"; // A reasonable prefix for the Objective-C symbols generated from the package. // It should at a minimum be 3 characters long, all uppercase, and convention // is to use an abbreviation of the package name. Something short, but // hopefully unique enough to not conflict with things that may come along in // the future. 'GPB' is reserved for the protocol buffer implementation itself. // option objc_class_prefix = "OAE"; // "OpenAPI Extension" // The version number of OpenAPI compiler. message Version { int32 major = 1; int32 minor = 2; int32 patch = 3; // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should // be empty for mainline stable releases. string suffix = 4; } // An encoded Request is written to the ExtensionHandler's stdin. message ExtensionHandlerRequest { // The OpenAPI descriptions that were explicitly listed on the command line. // The specifications will appear in the order they are specified to openapic. Wrapper wrapper = 1; // The version number of openapi compiler. Version compiler_version = 3; } // The extensions writes an encoded ExtensionHandlerResponse to stdout. message ExtensionHandlerResponse { // true if the extension is handled by the extension handler; false otherwise bool handled = 1; // Error message. If non-empty, the extension handling failed. // The extension handler process should exit with status code zero // even if it reports an error in this way. // // This should be used to indicate errors which prevent the extension from // operating as intended. Errors which indicate a problem in gnostic // itself -- such as the input Document being unparseable -- should be // reported by writing a message to stderr and exiting with a non-zero // status code. repeated string error = 2; // text output google.protobuf.Any value = 3; } message Wrapper { // version of the OpenAPI specification in which this extension was written. string version = 1; // Name of the extension string extension_name = 2; // Must be a valid yaml for the proto string yaml = 3; } ================================================ FILE: vendor/github.com/googleapis/gnostic/extensions/extensions.go ================================================ // Copyright 2017 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package openapiextension_v1 import ( "fmt" "io/ioutil" "os" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" ) type documentHandler func(version string, extensionName string, document string) type extensionHandler func(name string, yamlInput string) (bool, proto.Message, error) func forInputYamlFromOpenapic(handler documentHandler) { data, err := ioutil.ReadAll(os.Stdin) if err != nil { fmt.Println("File error:", err.Error()) os.Exit(1) } if len(data) == 0 { fmt.Println("No input data.") os.Exit(1) } request := &ExtensionHandlerRequest{} err = proto.Unmarshal(data, request) if err != nil { fmt.Println("Input error:", err.Error()) os.Exit(1) } handler(request.Wrapper.Version, request.Wrapper.ExtensionName, request.Wrapper.Yaml) } // ProcessExtension calles the handler for a specified extension. func ProcessExtension(handleExtension extensionHandler) { response := &ExtensionHandlerResponse{} forInputYamlFromOpenapic( func(version string, extensionName string, yamlInput string) { var newObject proto.Message var err error handled, newObject, err := handleExtension(extensionName, yamlInput) if !handled { responseBytes, _ := proto.Marshal(response) os.Stdout.Write(responseBytes) os.Exit(0) } // If we reach here, then the extension is handled response.Handled = true if err != nil { response.Error = append(response.Error, err.Error()) responseBytes, _ := proto.Marshal(response) os.Stdout.Write(responseBytes) os.Exit(0) } response.Value, err = ptypes.MarshalAny(newObject) if err != nil { response.Error = append(response.Error, err.Error()) responseBytes, _ := proto.Marshal(response) os.Stdout.Write(responseBytes) os.Exit(0) } }) responseBytes, _ := proto.Marshal(response) os.Stdout.Write(responseBytes) } ================================================ FILE: vendor/github.com/gregjones/httpcache/.travis.yml ================================================ sudo: false language: go go: - 1.6.x - 1.7.x - 1.8.x - 1.9.x - master matrix: allow_failures: - go: master fast_finish: true install: - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). script: - go get -t -v ./... - diff -u <(echo -n) <(gofmt -d .) - go tool vet . - go test -v -race ./... ================================================ FILE: vendor/github.com/gregjones/httpcache/LICENSE.txt ================================================ Copyright © 2012 Greg Jones (greg.jones@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/gregjones/httpcache/README.md ================================================ httpcache ========= [![Build Status](https://travis-ci.org/gregjones/httpcache.svg?branch=master)](https://travis-ci.org/gregjones/httpcache) [![GoDoc](https://godoc.org/github.com/gregjones/httpcache?status.svg)](https://godoc.org/github.com/gregjones/httpcache) Package httpcache provides a http.RoundTripper implementation that works as a mostly [RFC 7234](https://tools.ietf.org/html/rfc7234) compliant cache for http responses. It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client and not for a shared proxy). Cache Backends -------------- - The built-in 'memory' cache stores responses in an in-memory map. - [`github.com/gregjones/httpcache/diskcache`](https://github.com/gregjones/httpcache/tree/master/diskcache) provides a filesystem-backed cache using the [diskv](https://github.com/peterbourgon/diskv) library. - [`github.com/gregjones/httpcache/memcache`](https://github.com/gregjones/httpcache/tree/master/memcache) provides memcache implementations, for both App Engine and 'normal' memcache servers. - [`sourcegraph.com/sourcegraph/s3cache`](https://sourcegraph.com/github.com/sourcegraph/s3cache) uses Amazon S3 for storage. - [`github.com/gregjones/httpcache/leveldbcache`](https://github.com/gregjones/httpcache/tree/master/leveldbcache) provides a filesystem-backed cache using [leveldb](https://github.com/syndtr/goleveldb/leveldb). - [`github.com/die-net/lrucache`](https://github.com/die-net/lrucache) provides an in-memory cache that will evict least-recently used entries. - [`github.com/die-net/lrucache/twotier`](https://github.com/die-net/lrucache/tree/master/twotier) allows caches to be combined, for example to use lrucache above with a persistent disk-cache. - [`github.com/birkelund/boltdbcache`](https://github.com/birkelund/boltdbcache) provides a BoltDB implementation (based on the [bbolt](https://github.com/coreos/bbolt) fork). License ------- - [MIT License](LICENSE.txt) ================================================ FILE: vendor/github.com/gregjones/httpcache/diskcache/diskcache.go ================================================ // Package diskcache provides an implementation of httpcache.Cache that uses the diskv package // to supplement an in-memory map with persistent storage // package diskcache import ( "bytes" "crypto/md5" "encoding/hex" "github.com/peterbourgon/diskv" "io" ) // Cache is an implementation of httpcache.Cache that supplements the in-memory map with persistent storage type Cache struct { d *diskv.Diskv } // Get returns the response corresponding to key if present func (c *Cache) Get(key string) (resp []byte, ok bool) { key = keyToFilename(key) resp, err := c.d.Read(key) if err != nil { return []byte{}, false } return resp, true } // Set saves a response to the cache as key func (c *Cache) Set(key string, resp []byte) { key = keyToFilename(key) c.d.WriteStream(key, bytes.NewReader(resp), true) } // Delete removes the response with key from the cache func (c *Cache) Delete(key string) { key = keyToFilename(key) c.d.Erase(key) } func keyToFilename(key string) string { h := md5.New() io.WriteString(h, key) return hex.EncodeToString(h.Sum(nil)) } // New returns a new Cache that will store files in basePath func New(basePath string) *Cache { return &Cache{ d: diskv.New(diskv.Options{ BasePath: basePath, CacheSizeMax: 100 * 1024 * 1024, // 100MB }), } } // NewWithDiskv returns a new Cache using the provided Diskv as underlying // storage. func NewWithDiskv(d *diskv.Diskv) *Cache { return &Cache{d} } ================================================ FILE: vendor/github.com/gregjones/httpcache/httpcache.go ================================================ // Package httpcache provides a http.RoundTripper implementation that works as a // mostly RFC-compliant cache for http responses. // // It is only suitable for use as a 'private' cache (i.e. for a web-browser or an API-client // and not for a shared proxy). // package httpcache import ( "bufio" "bytes" "errors" "io" "io/ioutil" "net/http" "net/http/httputil" "strings" "sync" "time" ) const ( stale = iota fresh transparent // XFromCache is the header added to responses that are returned from the cache XFromCache = "X-From-Cache" ) // A Cache interface is used by the Transport to store and retrieve responses. type Cache interface { // Get returns the []byte representation of a cached response and a bool // set to true if the value isn't empty Get(key string) (responseBytes []byte, ok bool) // Set stores the []byte representation of a response against a key Set(key string, responseBytes []byte) // Delete removes the value associated with the key Delete(key string) } // cacheKey returns the cache key for req. func cacheKey(req *http.Request) string { if req.Method == http.MethodGet { return req.URL.String() } else { return req.Method + " " + req.URL.String() } } // CachedResponse returns the cached http.Response for req if present, and nil // otherwise. func CachedResponse(c Cache, req *http.Request) (resp *http.Response, err error) { cachedVal, ok := c.Get(cacheKey(req)) if !ok { return } b := bytes.NewBuffer(cachedVal) return http.ReadResponse(bufio.NewReader(b), req) } // MemoryCache is an implemtation of Cache that stores responses in an in-memory map. type MemoryCache struct { mu sync.RWMutex items map[string][]byte } // Get returns the []byte representation of the response and true if present, false if not func (c *MemoryCache) Get(key string) (resp []byte, ok bool) { c.mu.RLock() resp, ok = c.items[key] c.mu.RUnlock() return resp, ok } // Set saves response resp to the cache with key func (c *MemoryCache) Set(key string, resp []byte) { c.mu.Lock() c.items[key] = resp c.mu.Unlock() } // Delete removes key from the cache func (c *MemoryCache) Delete(key string) { c.mu.Lock() delete(c.items, key) c.mu.Unlock() } // NewMemoryCache returns a new Cache that will store items in an in-memory map func NewMemoryCache() *MemoryCache { c := &MemoryCache{items: map[string][]byte{}} return c } // Transport is an implementation of http.RoundTripper that will return values from a cache // where possible (avoiding a network request) and will additionally add validators (etag/if-modified-since) // to repeated requests allowing servers to return 304 / Not Modified type Transport struct { // The RoundTripper interface actually used to make requests // If nil, http.DefaultTransport is used Transport http.RoundTripper Cache Cache // If true, responses returned from the cache will be given an extra header, X-From-Cache MarkCachedResponses bool } // NewTransport returns a new Transport with the // provided Cache implementation and MarkCachedResponses set to true func NewTransport(c Cache) *Transport { return &Transport{Cache: c, MarkCachedResponses: true} } // Client returns an *http.Client that caches responses. func (t *Transport) Client() *http.Client { return &http.Client{Transport: t} } // varyMatches will return false unless all of the cached values for the headers listed in Vary // match the new request func varyMatches(cachedResp *http.Response, req *http.Request) bool { for _, header := range headerAllCommaSepValues(cachedResp.Header, "vary") { header = http.CanonicalHeaderKey(header) if header != "" && req.Header.Get(header) != cachedResp.Header.Get("X-Varied-"+header) { return false } } return true } // RoundTrip takes a Request and returns a Response // // If there is a fresh Response already in cache, then it will be returned without connecting to // the server. // // If there is a stale Response, then any validators it contains will be set on the new request // to give the server a chance to respond with NotModified. If this happens, then the cached Response // will be returned. func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err error) { cacheKey := cacheKey(req) cacheable := (req.Method == "GET" || req.Method == "HEAD") && req.Header.Get("range") == "" var cachedResp *http.Response if cacheable { cachedResp, err = CachedResponse(t.Cache, req) } else { // Need to invalidate an existing value t.Cache.Delete(cacheKey) } transport := t.Transport if transport == nil { transport = http.DefaultTransport } if cacheable && cachedResp != nil && err == nil { if t.MarkCachedResponses { cachedResp.Header.Set(XFromCache, "1") } if varyMatches(cachedResp, req) { // Can only use cached value if the new request doesn't Vary significantly freshness := getFreshness(cachedResp.Header, req.Header) if freshness == fresh { return cachedResp, nil } if freshness == stale { var req2 *http.Request // Add validators if caller hasn't already done so etag := cachedResp.Header.Get("etag") if etag != "" && req.Header.Get("etag") == "" { req2 = cloneRequest(req) req2.Header.Set("if-none-match", etag) } lastModified := cachedResp.Header.Get("last-modified") if lastModified != "" && req.Header.Get("last-modified") == "" { if req2 == nil { req2 = cloneRequest(req) } req2.Header.Set("if-modified-since", lastModified) } if req2 != nil { req = req2 } } } resp, err = transport.RoundTrip(req) if err == nil && req.Method == "GET" && resp.StatusCode == http.StatusNotModified { // Replace the 304 response with the one from cache, but update with some new headers endToEndHeaders := getEndToEndHeaders(resp.Header) for _, header := range endToEndHeaders { cachedResp.Header[header] = resp.Header[header] } resp = cachedResp } else if (err != nil || (cachedResp != nil && resp.StatusCode >= 500)) && req.Method == "GET" && canStaleOnError(cachedResp.Header, req.Header) { // In case of transport failure and stale-if-error activated, returns cached content // when available return cachedResp, nil } else { if err != nil || resp.StatusCode != http.StatusOK { t.Cache.Delete(cacheKey) } if err != nil { return nil, err } } } else { reqCacheControl := parseCacheControl(req.Header) if _, ok := reqCacheControl["only-if-cached"]; ok { resp = newGatewayTimeoutResponse(req) } else { resp, err = transport.RoundTrip(req) if err != nil { return nil, err } } } if cacheable && canStore(parseCacheControl(req.Header), parseCacheControl(resp.Header)) { for _, varyKey := range headerAllCommaSepValues(resp.Header, "vary") { varyKey = http.CanonicalHeaderKey(varyKey) fakeHeader := "X-Varied-" + varyKey reqValue := req.Header.Get(varyKey) if reqValue != "" { resp.Header.Set(fakeHeader, reqValue) } } switch req.Method { case "GET": // Delay caching until EOF is reached. resp.Body = &cachingReadCloser{ R: resp.Body, OnEOF: func(r io.Reader) { resp := *resp resp.Body = ioutil.NopCloser(r) respBytes, err := httputil.DumpResponse(&resp, true) if err == nil { t.Cache.Set(cacheKey, respBytes) } }, } default: respBytes, err := httputil.DumpResponse(resp, true) if err == nil { t.Cache.Set(cacheKey, respBytes) } } } else { t.Cache.Delete(cacheKey) } return resp, nil } // ErrNoDateHeader indicates that the HTTP headers contained no Date header. var ErrNoDateHeader = errors.New("no Date header") // Date parses and returns the value of the Date header. func Date(respHeaders http.Header) (date time.Time, err error) { dateHeader := respHeaders.Get("date") if dateHeader == "" { err = ErrNoDateHeader return } return time.Parse(time.RFC1123, dateHeader) } type realClock struct{} func (c *realClock) since(d time.Time) time.Duration { return time.Since(d) } type timer interface { since(d time.Time) time.Duration } var clock timer = &realClock{} // getFreshness will return one of fresh/stale/transparent based on the cache-control // values of the request and the response // // fresh indicates the response can be returned // stale indicates that the response needs validating before it is returned // transparent indicates the response should not be used to fulfil the request // // Because this is only a private cache, 'public' and 'private' in cache-control aren't // signficant. Similarly, smax-age isn't used. func getFreshness(respHeaders, reqHeaders http.Header) (freshness int) { respCacheControl := parseCacheControl(respHeaders) reqCacheControl := parseCacheControl(reqHeaders) if _, ok := reqCacheControl["no-cache"]; ok { return transparent } if _, ok := respCacheControl["no-cache"]; ok { return stale } if _, ok := reqCacheControl["only-if-cached"]; ok { return fresh } date, err := Date(respHeaders) if err != nil { return stale } currentAge := clock.since(date) var lifetime time.Duration var zeroDuration time.Duration // If a response includes both an Expires header and a max-age directive, // the max-age directive overrides the Expires header, even if the Expires header is more restrictive. if maxAge, ok := respCacheControl["max-age"]; ok { lifetime, err = time.ParseDuration(maxAge + "s") if err != nil { lifetime = zeroDuration } } else { expiresHeader := respHeaders.Get("Expires") if expiresHeader != "" { expires, err := time.Parse(time.RFC1123, expiresHeader) if err != nil { lifetime = zeroDuration } else { lifetime = expires.Sub(date) } } } if maxAge, ok := reqCacheControl["max-age"]; ok { // the client is willing to accept a response whose age is no greater than the specified time in seconds lifetime, err = time.ParseDuration(maxAge + "s") if err != nil { lifetime = zeroDuration } } if minfresh, ok := reqCacheControl["min-fresh"]; ok { // the client wants a response that will still be fresh for at least the specified number of seconds. minfreshDuration, err := time.ParseDuration(minfresh + "s") if err == nil { currentAge = time.Duration(currentAge + minfreshDuration) } } if maxstale, ok := reqCacheControl["max-stale"]; ok { // Indicates that the client is willing to accept a response that has exceeded its expiration time. // If max-stale is assigned a value, then the client is willing to accept a response that has exceeded // its expiration time by no more than the specified number of seconds. // If no value is assigned to max-stale, then the client is willing to accept a stale response of any age. // // Responses served only because of a max-stale value are supposed to have a Warning header added to them, // but that seems like a hassle, and is it actually useful? If so, then there needs to be a different // return-value available here. if maxstale == "" { return fresh } maxstaleDuration, err := time.ParseDuration(maxstale + "s") if err == nil { currentAge = time.Duration(currentAge - maxstaleDuration) } } if lifetime > currentAge { return fresh } return stale } // Returns true if either the request or the response includes the stale-if-error // cache control extension: https://tools.ietf.org/html/rfc5861 func canStaleOnError(respHeaders, reqHeaders http.Header) bool { respCacheControl := parseCacheControl(respHeaders) reqCacheControl := parseCacheControl(reqHeaders) var err error lifetime := time.Duration(-1) if staleMaxAge, ok := respCacheControl["stale-if-error"]; ok { if staleMaxAge != "" { lifetime, err = time.ParseDuration(staleMaxAge + "s") if err != nil { return false } } else { return true } } if staleMaxAge, ok := reqCacheControl["stale-if-error"]; ok { if staleMaxAge != "" { lifetime, err = time.ParseDuration(staleMaxAge + "s") if err != nil { return false } } else { return true } } if lifetime >= 0 { date, err := Date(respHeaders) if err != nil { return false } currentAge := clock.since(date) if lifetime > currentAge { return true } } return false } func getEndToEndHeaders(respHeaders http.Header) []string { // These headers are always hop-by-hop hopByHopHeaders := map[string]struct{}{ "Connection": struct{}{}, "Keep-Alive": struct{}{}, "Proxy-Authenticate": struct{}{}, "Proxy-Authorization": struct{}{}, "Te": struct{}{}, "Trailers": struct{}{}, "Transfer-Encoding": struct{}{}, "Upgrade": struct{}{}, } for _, extra := range strings.Split(respHeaders.Get("connection"), ",") { // any header listed in connection, if present, is also considered hop-by-hop if strings.Trim(extra, " ") != "" { hopByHopHeaders[http.CanonicalHeaderKey(extra)] = struct{}{} } } endToEndHeaders := []string{} for respHeader, _ := range respHeaders { if _, ok := hopByHopHeaders[respHeader]; !ok { endToEndHeaders = append(endToEndHeaders, respHeader) } } return endToEndHeaders } func canStore(reqCacheControl, respCacheControl cacheControl) (canStore bool) { if _, ok := respCacheControl["no-store"]; ok { return false } if _, ok := reqCacheControl["no-store"]; ok { return false } return true } func newGatewayTimeoutResponse(req *http.Request) *http.Response { var braw bytes.Buffer braw.WriteString("HTTP/1.1 504 Gateway Timeout\r\n\r\n") resp, err := http.ReadResponse(bufio.NewReader(&braw), req) if err != nil { panic(err) } return resp } // cloneRequest returns a clone of the provided *http.Request. // The clone is a shallow copy of the struct and its Header map. // (This function copyright goauth2 authors: https://code.google.com/p/goauth2) func cloneRequest(r *http.Request) *http.Request { // shallow copy of the struct r2 := new(http.Request) *r2 = *r // deep copy of the Header r2.Header = make(http.Header) for k, s := range r.Header { r2.Header[k] = s } return r2 } type cacheControl map[string]string func parseCacheControl(headers http.Header) cacheControl { cc := cacheControl{} ccHeader := headers.Get("Cache-Control") for _, part := range strings.Split(ccHeader, ",") { part = strings.Trim(part, " ") if part == "" { continue } if strings.ContainsRune(part, '=') { keyval := strings.Split(part, "=") cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") } else { cc[part] = "" } } return cc } // headerAllCommaSepValues returns all comma-separated values (each // with whitespace trimmed) for header name in headers. According to // Section 4.2 of the HTTP/1.1 spec // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2), // values from multiple occurrences of a header should be concatenated, if // the header's value is a comma-separated list. func headerAllCommaSepValues(headers http.Header, name string) []string { var vals []string for _, val := range headers[http.CanonicalHeaderKey(name)] { fields := strings.Split(val, ",") for i, f := range fields { fields[i] = strings.TrimSpace(f) } vals = append(vals, fields...) } return vals } // cachingReadCloser is a wrapper around ReadCloser R that calls OnEOF // handler with a full copy of the content read from R when EOF is // reached. type cachingReadCloser struct { // Underlying ReadCloser. R io.ReadCloser // OnEOF is called with a copy of the content of R when EOF is reached. OnEOF func(io.Reader) buf bytes.Buffer // buf stores a copy of the content of R. } // Read reads the next len(p) bytes from R or until R is drained. The // return value n is the number of bytes read. If R has no data to // return, err is io.EOF and OnEOF is called with a full copy of what // has been read so far. func (r *cachingReadCloser) Read(p []byte) (n int, err error) { n, err = r.R.Read(p) r.buf.Write(p[:n]) if err == io.EOF { r.OnEOF(bytes.NewReader(r.buf.Bytes())) } return n, err } func (r *cachingReadCloser) Close() error { return r.R.Close() } // NewMemoryCacheTransport returns a new Transport using the in-memory cache implementation func NewMemoryCacheTransport() *Transport { c := NewMemoryCache() t := NewTransport(c) return t } ================================================ FILE: vendor/github.com/hashicorp/golang-lru/.gitignore ================================================ # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe *.test ================================================ FILE: vendor/github.com/hashicorp/golang-lru/2q.go ================================================ package lru import ( "fmt" "sync" "github.com/hashicorp/golang-lru/simplelru" ) const ( // Default2QRecentRatio is the ratio of the 2Q cache dedicated // to recently added entries that have only been accessed once. Default2QRecentRatio = 0.25 // Default2QGhostEntries is the default ratio of ghost // entries kept to track entries recently evicted Default2QGhostEntries = 0.50 ) // TwoQueueCache is a thread-safe fixed size 2Q cache. // 2Q is an enhancement over the standard LRU cache // in that it tracks both frequently and recently used // entries separately. This avoids a burst in access to new // entries from evicting frequently used entries. It adds some // additional tracking overhead to the standard LRU cache, and is // computationally about 2x the cost, and adds some metadata over // head. The ARCCache is similar, but does not require setting any // parameters. type TwoQueueCache struct { size int recentSize int recent *simplelru.LRU frequent *simplelru.LRU recentEvict *simplelru.LRU lock sync.RWMutex } // New2Q creates a new TwoQueueCache using the default // values for the parameters. func New2Q(size int) (*TwoQueueCache, error) { return New2QParams(size, Default2QRecentRatio, Default2QGhostEntries) } // New2QParams creates a new TwoQueueCache using the provided // parameter values. func New2QParams(size int, recentRatio float64, ghostRatio float64) (*TwoQueueCache, error) { if size <= 0 { return nil, fmt.Errorf("invalid size") } if recentRatio < 0.0 || recentRatio > 1.0 { return nil, fmt.Errorf("invalid recent ratio") } if ghostRatio < 0.0 || ghostRatio > 1.0 { return nil, fmt.Errorf("invalid ghost ratio") } // Determine the sub-sizes recentSize := int(float64(size) * recentRatio) evictSize := int(float64(size) * ghostRatio) // Allocate the LRUs recent, err := simplelru.NewLRU(size, nil) if err != nil { return nil, err } frequent, err := simplelru.NewLRU(size, nil) if err != nil { return nil, err } recentEvict, err := simplelru.NewLRU(evictSize, nil) if err != nil { return nil, err } // Initialize the cache c := &TwoQueueCache{ size: size, recentSize: recentSize, recent: recent, frequent: frequent, recentEvict: recentEvict, } return c, nil } func (c *TwoQueueCache) Get(key interface{}) (interface{}, bool) { c.lock.Lock() defer c.lock.Unlock() // Check if this is a frequent value if val, ok := c.frequent.Get(key); ok { return val, ok } // If the value is contained in recent, then we // promote it to frequent if val, ok := c.recent.Peek(key); ok { c.recent.Remove(key) c.frequent.Add(key, val) return val, ok } // No hit return nil, false } func (c *TwoQueueCache) Add(key, value interface{}) { c.lock.Lock() defer c.lock.Unlock() // Check if the value is frequently used already, // and just update the value if c.frequent.Contains(key) { c.frequent.Add(key, value) return } // Check if the value is recently used, and promote // the value into the frequent list if c.recent.Contains(key) { c.recent.Remove(key) c.frequent.Add(key, value) return } // If the value was recently evicted, add it to the // frequently used list if c.recentEvict.Contains(key) { c.ensureSpace(true) c.recentEvict.Remove(key) c.frequent.Add(key, value) return } // Add to the recently seen list c.ensureSpace(false) c.recent.Add(key, value) return } // ensureSpace is used to ensure we have space in the cache func (c *TwoQueueCache) ensureSpace(recentEvict bool) { // If we have space, nothing to do recentLen := c.recent.Len() freqLen := c.frequent.Len() if recentLen+freqLen < c.size { return } // If the recent buffer is larger than // the target, evict from there if recentLen > 0 && (recentLen > c.recentSize || (recentLen == c.recentSize && !recentEvict)) { k, _, _ := c.recent.RemoveOldest() c.recentEvict.Add(k, nil) return } // Remove from the frequent list otherwise c.frequent.RemoveOldest() } func (c *TwoQueueCache) Len() int { c.lock.RLock() defer c.lock.RUnlock() return c.recent.Len() + c.frequent.Len() } func (c *TwoQueueCache) Keys() []interface{} { c.lock.RLock() defer c.lock.RUnlock() k1 := c.frequent.Keys() k2 := c.recent.Keys() return append(k1, k2...) } func (c *TwoQueueCache) Remove(key interface{}) { c.lock.Lock() defer c.lock.Unlock() if c.frequent.Remove(key) { return } if c.recent.Remove(key) { return } if c.recentEvict.Remove(key) { return } } func (c *TwoQueueCache) Purge() { c.lock.Lock() defer c.lock.Unlock() c.recent.Purge() c.frequent.Purge() c.recentEvict.Purge() } func (c *TwoQueueCache) Contains(key interface{}) bool { c.lock.RLock() defer c.lock.RUnlock() return c.frequent.Contains(key) || c.recent.Contains(key) } func (c *TwoQueueCache) Peek(key interface{}) (interface{}, bool) { c.lock.RLock() defer c.lock.RUnlock() if val, ok := c.frequent.Peek(key); ok { return val, ok } return c.recent.Peek(key) } ================================================ FILE: vendor/github.com/hashicorp/golang-lru/LICENSE ================================================ Mozilla Public License, version 2.0 1. Definitions 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an "as is" basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ================================================ FILE: vendor/github.com/hashicorp/golang-lru/README.md ================================================ golang-lru ========== This provides the `lru` package which implements a fixed-size thread safe LRU cache. It is based on the cache in Groupcache. Documentation ============= Full docs are available on [Godoc](http://godoc.org/github.com/hashicorp/golang-lru) Example ======= Using the LRU is very simple: ```go l, _ := New(128) for i := 0; i < 256; i++ { l.Add(i, nil) } if l.Len() != 128 { panic(fmt.Sprintf("bad len: %v", l.Len())) } ``` ================================================ FILE: vendor/github.com/hashicorp/golang-lru/arc.go ================================================ package lru import ( "sync" "github.com/hashicorp/golang-lru/simplelru" ) // ARCCache is a thread-safe fixed size Adaptive Replacement Cache (ARC). // ARC is an enhancement over the standard LRU cache in that tracks both // frequency and recency of use. This avoids a burst in access to new // entries from evicting the frequently used older entries. It adds some // additional tracking overhead to a standard LRU cache, computationally // it is roughly 2x the cost, and the extra memory overhead is linear // with the size of the cache. ARC has been patented by IBM, but is // similar to the TwoQueueCache (2Q) which requires setting parameters. type ARCCache struct { size int // Size is the total capacity of the cache p int // P is the dynamic preference towards T1 or T2 t1 *simplelru.LRU // T1 is the LRU for recently accessed items b1 *simplelru.LRU // B1 is the LRU for evictions from t1 t2 *simplelru.LRU // T2 is the LRU for frequently accessed items b2 *simplelru.LRU // B2 is the LRU for evictions from t2 lock sync.RWMutex } // NewARC creates an ARC of the given size func NewARC(size int) (*ARCCache, error) { // Create the sub LRUs b1, err := simplelru.NewLRU(size, nil) if err != nil { return nil, err } b2, err := simplelru.NewLRU(size, nil) if err != nil { return nil, err } t1, err := simplelru.NewLRU(size, nil) if err != nil { return nil, err } t2, err := simplelru.NewLRU(size, nil) if err != nil { return nil, err } // Initialize the ARC c := &ARCCache{ size: size, p: 0, t1: t1, b1: b1, t2: t2, b2: b2, } return c, nil } // Get looks up a key's value from the cache. func (c *ARCCache) Get(key interface{}) (interface{}, bool) { c.lock.Lock() defer c.lock.Unlock() // Ff the value is contained in T1 (recent), then // promote it to T2 (frequent) if val, ok := c.t1.Peek(key); ok { c.t1.Remove(key) c.t2.Add(key, val) return val, ok } // Check if the value is contained in T2 (frequent) if val, ok := c.t2.Get(key); ok { return val, ok } // No hit return nil, false } // Add adds a value to the cache. func (c *ARCCache) Add(key, value interface{}) { c.lock.Lock() defer c.lock.Unlock() // Check if the value is contained in T1 (recent), and potentially // promote it to frequent T2 if c.t1.Contains(key) { c.t1.Remove(key) c.t2.Add(key, value) return } // Check if the value is already in T2 (frequent) and update it if c.t2.Contains(key) { c.t2.Add(key, value) return } // Check if this value was recently evicted as part of the // recently used list if c.b1.Contains(key) { // T1 set is too small, increase P appropriately delta := 1 b1Len := c.b1.Len() b2Len := c.b2.Len() if b2Len > b1Len { delta = b2Len / b1Len } if c.p+delta >= c.size { c.p = c.size } else { c.p += delta } // Potentially need to make room in the cache if c.t1.Len()+c.t2.Len() >= c.size { c.replace(false) } // Remove from B1 c.b1.Remove(key) // Add the key to the frequently used list c.t2.Add(key, value) return } // Check if this value was recently evicted as part of the // frequently used list if c.b2.Contains(key) { // T2 set is too small, decrease P appropriately delta := 1 b1Len := c.b1.Len() b2Len := c.b2.Len() if b1Len > b2Len { delta = b1Len / b2Len } if delta >= c.p { c.p = 0 } else { c.p -= delta } // Potentially need to make room in the cache if c.t1.Len()+c.t2.Len() >= c.size { c.replace(true) } // Remove from B2 c.b2.Remove(key) // Add the key to the frequntly used list c.t2.Add(key, value) return } // Potentially need to make room in the cache if c.t1.Len()+c.t2.Len() >= c.size { c.replace(false) } // Keep the size of the ghost buffers trim if c.b1.Len() > c.size-c.p { c.b1.RemoveOldest() } if c.b2.Len() > c.p { c.b2.RemoveOldest() } // Add to the recently seen list c.t1.Add(key, value) return } // replace is used to adaptively evict from either T1 or T2 // based on the current learned value of P func (c *ARCCache) replace(b2ContainsKey bool) { t1Len := c.t1.Len() if t1Len > 0 && (t1Len > c.p || (t1Len == c.p && b2ContainsKey)) { k, _, ok := c.t1.RemoveOldest() if ok { c.b1.Add(k, nil) } } else { k, _, ok := c.t2.RemoveOldest() if ok { c.b2.Add(k, nil) } } } // Len returns the number of cached entries func (c *ARCCache) Len() int { c.lock.RLock() defer c.lock.RUnlock() return c.t1.Len() + c.t2.Len() } // Keys returns all the cached keys func (c *ARCCache) Keys() []interface{} { c.lock.RLock() defer c.lock.RUnlock() k1 := c.t1.Keys() k2 := c.t2.Keys() return append(k1, k2...) } // Remove is used to purge a key from the cache func (c *ARCCache) Remove(key interface{}) { c.lock.Lock() defer c.lock.Unlock() if c.t1.Remove(key) { return } if c.t2.Remove(key) { return } if c.b1.Remove(key) { return } if c.b2.Remove(key) { return } } // Purge is used to clear the cache func (c *ARCCache) Purge() { c.lock.Lock() defer c.lock.Unlock() c.t1.Purge() c.t2.Purge() c.b1.Purge() c.b2.Purge() } // Contains is used to check if the cache contains a key // without updating recency or frequency. func (c *ARCCache) Contains(key interface{}) bool { c.lock.RLock() defer c.lock.RUnlock() return c.t1.Contains(key) || c.t2.Contains(key) } // Peek is used to inspect the cache value of a key // without updating recency or frequency. func (c *ARCCache) Peek(key interface{}) (interface{}, bool) { c.lock.RLock() defer c.lock.RUnlock() if val, ok := c.t1.Peek(key); ok { return val, ok } return c.t2.Peek(key) } ================================================ FILE: vendor/github.com/hashicorp/golang-lru/lru.go ================================================ // This package provides a simple LRU cache. It is based on the // LRU implementation in groupcache: // https://github.com/golang/groupcache/tree/master/lru package lru import ( "sync" "github.com/hashicorp/golang-lru/simplelru" ) // Cache is a thread-safe fixed size LRU cache. type Cache struct { lru *simplelru.LRU lock sync.RWMutex } // New creates an LRU of the given size func New(size int) (*Cache, error) { return NewWithEvict(size, nil) } // NewWithEvict constructs a fixed size cache with the given eviction // callback. func NewWithEvict(size int, onEvicted func(key interface{}, value interface{})) (*Cache, error) { lru, err := simplelru.NewLRU(size, simplelru.EvictCallback(onEvicted)) if err != nil { return nil, err } c := &Cache{ lru: lru, } return c, nil } // Purge is used to completely clear the cache func (c *Cache) Purge() { c.lock.Lock() c.lru.Purge() c.lock.Unlock() } // Add adds a value to the cache. Returns true if an eviction occurred. func (c *Cache) Add(key, value interface{}) bool { c.lock.Lock() defer c.lock.Unlock() return c.lru.Add(key, value) } // Get looks up a key's value from the cache. func (c *Cache) Get(key interface{}) (interface{}, bool) { c.lock.Lock() defer c.lock.Unlock() return c.lru.Get(key) } // Check if a key is in the cache, without updating the recent-ness // or deleting it for being stale. func (c *Cache) Contains(key interface{}) bool { c.lock.RLock() defer c.lock.RUnlock() return c.lru.Contains(key) } // Returns the key value (or undefined if not found) without updating // the "recently used"-ness of the key. func (c *Cache) Peek(key interface{}) (interface{}, bool) { c.lock.RLock() defer c.lock.RUnlock() return c.lru.Peek(key) } // ContainsOrAdd checks if a key is in the cache without updating the // recent-ness or deleting it for being stale, and if not, adds the value. // Returns whether found and whether an eviction occurred. func (c *Cache) ContainsOrAdd(key, value interface{}) (ok, evict bool) { c.lock.Lock() defer c.lock.Unlock() if c.lru.Contains(key) { return true, false } else { evict := c.lru.Add(key, value) return false, evict } } // Remove removes the provided key from the cache. func (c *Cache) Remove(key interface{}) { c.lock.Lock() c.lru.Remove(key) c.lock.Unlock() } // RemoveOldest removes the oldest item from the cache. func (c *Cache) RemoveOldest() { c.lock.Lock() c.lru.RemoveOldest() c.lock.Unlock() } // Keys returns a slice of the keys in the cache, from oldest to newest. func (c *Cache) Keys() []interface{} { c.lock.RLock() defer c.lock.RUnlock() return c.lru.Keys() } // Len returns the number of items in the cache. func (c *Cache) Len() int { c.lock.RLock() defer c.lock.RUnlock() return c.lru.Len() } ================================================ FILE: vendor/github.com/hashicorp/golang-lru/simplelru/lru.go ================================================ package simplelru import ( "container/list" "errors" ) // EvictCallback is used to get a callback when a cache entry is evicted type EvictCallback func(key interface{}, value interface{}) // LRU implements a non-thread safe fixed size LRU cache type LRU struct { size int evictList *list.List items map[interface{}]*list.Element onEvict EvictCallback } // entry is used to hold a value in the evictList type entry struct { key interface{} value interface{} } // NewLRU constructs an LRU of the given size func NewLRU(size int, onEvict EvictCallback) (*LRU, error) { if size <= 0 { return nil, errors.New("Must provide a positive size") } c := &LRU{ size: size, evictList: list.New(), items: make(map[interface{}]*list.Element), onEvict: onEvict, } return c, nil } // Purge is used to completely clear the cache func (c *LRU) Purge() { for k, v := range c.items { if c.onEvict != nil { c.onEvict(k, v.Value.(*entry).value) } delete(c.items, k) } c.evictList.Init() } // Add adds a value to the cache. Returns true if an eviction occured. func (c *LRU) Add(key, value interface{}) bool { // Check for existing item if ent, ok := c.items[key]; ok { c.evictList.MoveToFront(ent) ent.Value.(*entry).value = value return false } // Add new item ent := &entry{key, value} entry := c.evictList.PushFront(ent) c.items[key] = entry evict := c.evictList.Len() > c.size // Verify size not exceeded if evict { c.removeOldest() } return evict } // Get looks up a key's value from the cache. func (c *LRU) Get(key interface{}) (value interface{}, ok bool) { if ent, ok := c.items[key]; ok { c.evictList.MoveToFront(ent) return ent.Value.(*entry).value, true } return } // Check if a key is in the cache, without updating the recent-ness // or deleting it for being stale. func (c *LRU) Contains(key interface{}) (ok bool) { _, ok = c.items[key] return ok } // Returns the key value (or undefined if not found) without updating // the "recently used"-ness of the key. func (c *LRU) Peek(key interface{}) (value interface{}, ok bool) { if ent, ok := c.items[key]; ok { return ent.Value.(*entry).value, true } return nil, ok } // Remove removes the provided key from the cache, returning if the // key was contained. func (c *LRU) Remove(key interface{}) bool { if ent, ok := c.items[key]; ok { c.removeElement(ent) return true } return false } // RemoveOldest removes the oldest item from the cache. func (c *LRU) RemoveOldest() (interface{}, interface{}, bool) { ent := c.evictList.Back() if ent != nil { c.removeElement(ent) kv := ent.Value.(*entry) return kv.key, kv.value, true } return nil, nil, false } // GetOldest returns the oldest entry func (c *LRU) GetOldest() (interface{}, interface{}, bool) { ent := c.evictList.Back() if ent != nil { kv := ent.Value.(*entry) return kv.key, kv.value, true } return nil, nil, false } // Keys returns a slice of the keys in the cache, from oldest to newest. func (c *LRU) Keys() []interface{} { keys := make([]interface{}, len(c.items)) i := 0 for ent := c.evictList.Back(); ent != nil; ent = ent.Prev() { keys[i] = ent.Value.(*entry).key i++ } return keys } // Len returns the number of items in the cache. func (c *LRU) Len() int { return c.evictList.Len() } // removeOldest removes the oldest item from the cache. func (c *LRU) removeOldest() { ent := c.evictList.Back() if ent != nil { c.removeElement(ent) } } // removeElement is used to remove a given list element from the cache func (c *LRU) removeElement(e *list.Element) { c.evictList.Remove(e) kv := e.Value.(*entry) delete(c.items, kv.key) if c.onEvict != nil { c.onEvict(kv.key, kv.value) } } ================================================ FILE: vendor/github.com/imdario/mergo/.gitignore ================================================ #### joe made this: http://goel.io/joe #### go #### # Binaries for programs and plugins *.exe *.dll *.so *.dylib # Test binary, build with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 .glide/ #### vim #### # Swap [._]*.s[a-v][a-z] [._]*.sw[a-p] [._]s[a-v][a-z] [._]sw[a-p] # Session Session.vim # Temporary .netrwhist *~ # Auto-generated tag files tags ================================================ FILE: vendor/github.com/imdario/mergo/.travis.yml ================================================ language: go install: - go get -t - go get golang.org/x/tools/cmd/cover - go get github.com/mattn/goveralls script: - $HOME/gopath/bin/goveralls -service=travis-ci -repotoken $COVERALLS_TOKEN ================================================ FILE: vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at i@dario.im. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ ================================================ FILE: vendor/github.com/imdario/mergo/LICENSE ================================================ Copyright (c) 2013 Dario Castañé. All rights reserved. Copyright (c) 2012 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/imdario/mergo/README.md ================================================ # Mergo A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements. Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the Province of Ancona in the Italian region of Marche. ## Status It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc](https://github.com/imdario/mergo#mergo-in-the-wild). [![GoDoc][3]][4] [![GoCard][5]][6] [![Build Status][1]][2] [![Coverage Status][7]][8] [![Sourcegraph][9]][10] [1]: https://travis-ci.org/imdario/mergo.png [2]: https://travis-ci.org/imdario/mergo [3]: https://godoc.org/github.com/imdario/mergo?status.svg [4]: https://godoc.org/github.com/imdario/mergo [5]: https://goreportcard.com/badge/imdario/mergo [6]: https://goreportcard.com/report/github.com/imdario/mergo [7]: https://coveralls.io/repos/github/imdario/mergo/badge.svg?branch=master [8]: https://coveralls.io/github/imdario/mergo?branch=master [9]: https://sourcegraph.com/github.com/imdario/mergo/-/badge.svg [10]: https://sourcegraph.com/github.com/imdario/mergo?badge ### Latest release [Release v0.3.4](https://github.com/imdario/mergo/releases/tag/v0.3.4). ### Important note Please keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2) Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). An optional/variadic argument has been added, so it won't break existing code. If you were using Mergo **before** April 6th 2015, please check your project works as intended after updating your local copy with ```go get -u github.com/imdario/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause (I hope it won't!) in existing projects after the change (release 0.2.0). ### Donations If Mergo is useful to you, consider buying me a coffee, a beer or making a monthly donation so I can keep building great free software. :heart_eyes: Buy Me a Coffee at ko-fi.com [![Beerpay](https://beerpay.io/imdario/mergo/badge.svg)](https://beerpay.io/imdario/mergo) [![Beerpay](https://beerpay.io/imdario/mergo/make-wish.svg)](https://beerpay.io/imdario/mergo) Donate using Liberapay ### Mergo in the wild - [moby/moby](https://github.com/moby/moby) - [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes) - [vmware/dispatch](https://github.com/vmware/dispatch) - [Shopify/themekit](https://github.com/Shopify/themekit) - [imdario/zas](https://github.com/imdario/zas) - [matcornic/hermes](https://github.com/matcornic/hermes) - [OpenBazaar/openbazaar-go](https://github.com/OpenBazaar/openbazaar-go) - [kataras/iris](https://github.com/kataras/iris) - [michaelsauter/crane](https://github.com/michaelsauter/crane) - [go-task/task](https://github.com/go-task/task) - [sensu/uchiwa](https://github.com/sensu/uchiwa) - [ory/hydra](https://github.com/ory/hydra) - [sisatech/vcli](https://github.com/sisatech/vcli) - [dairycart/dairycart](https://github.com/dairycart/dairycart) - [projectcalico/felix](https://github.com/projectcalico/felix) - [resin-os/balena](https://github.com/resin-os/balena) - [go-kivik/kivik](https://github.com/go-kivik/kivik) - [Telefonica/govice](https://github.com/Telefonica/govice) - [supergiant/supergiant](supergiant/supergiant) - [SergeyTsalkov/brooce](https://github.com/SergeyTsalkov/brooce) - [soniah/dnsmadeeasy](https://github.com/soniah/dnsmadeeasy) - [ohsu-comp-bio/funnel](https://github.com/ohsu-comp-bio/funnel) - [EagerIO/Stout](https://github.com/EagerIO/Stout) - [lynndylanhurley/defsynth-api](https://github.com/lynndylanhurley/defsynth-api) - [russross/canvasassignments](https://github.com/russross/canvasassignments) - [rdegges/cryptly-api](https://github.com/rdegges/cryptly-api) - [casualjim/exeggutor](https://github.com/casualjim/exeggutor) - [divshot/gitling](https://github.com/divshot/gitling) - [RWJMurphy/gorl](https://github.com/RWJMurphy/gorl) - [andrerocker/deploy42](https://github.com/andrerocker/deploy42) - [elwinar/rambler](https://github.com/elwinar/rambler) - [tmaiaroto/gopartman](https://github.com/tmaiaroto/gopartman) - [jfbus/impressionist](https://github.com/jfbus/impressionist) - [Jmeyering/zealot](https://github.com/Jmeyering/zealot) - [godep-migrator/rigger-host](https://github.com/godep-migrator/rigger-host) - [Dronevery/MultiwaySwitch-Go](https://github.com/Dronevery/MultiwaySwitch-Go) - [thoas/picfit](https://github.com/thoas/picfit) - [mantasmatelis/whooplist-server](https://github.com/mantasmatelis/whooplist-server) - [jnuthong/item_search](https://github.com/jnuthong/item_search) - [bukalapak/snowboard](https://github.com/bukalapak/snowboard) ## Installation go get github.com/imdario/mergo // use in your .go code import ( "github.com/imdario/mergo" ) ## Usage You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as [they are not considered zero values](https://golang.org/ref/spec#The_zero_value) either. Also maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). ```go if err := mergo.Merge(&dst, src); err != nil { // ... } ``` Also, you can merge overwriting values using the transformer `WithOverride`. ```go if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil { // ... } ``` Additionally, you can map a `map[string]interface{}` to a struct (and otherwise, from struct to map), following the same restrictions as in `Merge()`. Keys are capitalized to find each corresponding exported field. ```go if err := mergo.Map(&dst, srcMap); err != nil { // ... } ``` Warning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as `map[string]interface{}`. They will be just assigned as values. More information and examples in [godoc documentation](http://godoc.org/github.com/imdario/mergo). ### Nice example ```go package main import ( "fmt" "github.com/imdario/mergo" ) type Foo struct { A string B int64 } func main() { src := Foo{ A: "one", B: 2, } dest := Foo{ A: "two", } mergo.Merge(&dest, src) fmt.Println(dest) // Will print // {two 2} } ``` Note: if test are failing due missing package, please execute: go get gopkg.in/yaml.v2 ### Transformers Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, `time.Time` is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero `time.Time`? ```go package main import ( "fmt" "github.com/imdario/mergo" "reflect" "time" ) type timeTransfomer struct { } func (t timeTransfomer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { if typ == reflect.TypeOf(time.Time{}) { return func(dst, src reflect.Value) error { if dst.CanSet() { isZero := dst.MethodByName("IsZero") result := isZero.Call([]reflect.Value{}) if result[0].Bool() { dst.Set(src) } } return nil } } return nil } type Snapshot struct { Time time.Time // ... } func main() { src := Snapshot{time.Now()} dest := Snapshot{} mergo.Merge(&dest, src, mergo.WithTransformers(timeTransfomer{})) fmt.Println(dest) // Will print // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 } } ``` ## Contact me If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): [@im_dario](https://twitter.com/im_dario) ## About Written by [Dario Castañé](http://dario.im). ## License [BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause) license, as [Go language](http://golang.org/LICENSE). ================================================ FILE: vendor/github.com/imdario/mergo/doc.go ================================================ // Copyright 2013 Dario Castañé. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields but will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). Usage From my own work-in-progress project: type networkConfig struct { Protocol string Address string ServerType string `json: "server_type"` Port uint16 } type FssnConfig struct { Network networkConfig } var fssnDefault = FssnConfig { networkConfig { "tcp", "127.0.0.1", "http", 31560, }, } // Inside a function [...] if err := mergo.Merge(&config, fssnDefault); err != nil { log.Fatal(err) } // More code [...] */ package mergo ================================================ FILE: vendor/github.com/imdario/mergo/map.go ================================================ // Copyright 2014 Dario Castañé. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on src/pkg/reflect/deepequal.go from official // golang's stdlib. package mergo import ( "fmt" "reflect" "unicode" "unicode/utf8" ) func changeInitialCase(s string, mapper func(rune) rune) string { if s == "" { return s } r, n := utf8.DecodeRuneInString(s) return string(mapper(r)) + s[n:] } func isExported(field reflect.StructField) bool { r, _ := utf8.DecodeRuneInString(field.Name) return r >= 'A' && r <= 'Z' } // Traverses recursively both values, assigning src's fields values to dst. // The map argument tracks comparisons that have already been seen, which allows // short circuiting on recursive types. func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) { overwrite := config.Overwrite if dst.CanAddr() { addr := dst.UnsafeAddr() h := 17 * addr seen := visited[h] typ := dst.Type() for p := seen; p != nil; p = p.next { if p.ptr == addr && p.typ == typ { return nil } } // Remember, remember... visited[h] = &visit{addr, typ, seen} } zeroValue := reflect.Value{} switch dst.Kind() { case reflect.Map: dstMap := dst.Interface().(map[string]interface{}) for i, n := 0, src.NumField(); i < n; i++ { srcType := src.Type() field := srcType.Field(i) if !isExported(field) { continue } fieldName := field.Name fieldName = changeInitialCase(fieldName, unicode.ToLower) if v, ok := dstMap[fieldName]; !ok || (isEmptyValue(reflect.ValueOf(v)) || overwrite) { dstMap[fieldName] = src.Field(i).Interface() } } case reflect.Ptr: if dst.IsNil() { v := reflect.New(dst.Type().Elem()) dst.Set(v) } dst = dst.Elem() fallthrough case reflect.Struct: srcMap := src.Interface().(map[string]interface{}) for key := range srcMap { srcValue := srcMap[key] fieldName := changeInitialCase(key, unicode.ToUpper) dstElement := dst.FieldByName(fieldName) if dstElement == zeroValue { // We discard it because the field doesn't exist. continue } srcElement := reflect.ValueOf(srcValue) dstKind := dstElement.Kind() srcKind := srcElement.Kind() if srcKind == reflect.Ptr && dstKind != reflect.Ptr { srcElement = srcElement.Elem() srcKind = reflect.TypeOf(srcElement.Interface()).Kind() } else if dstKind == reflect.Ptr { // Can this work? I guess it can't. if srcKind != reflect.Ptr && srcElement.CanAddr() { srcPtr := srcElement.Addr() srcElement = reflect.ValueOf(srcPtr) srcKind = reflect.Ptr } } if !srcElement.IsValid() { continue } if srcKind == dstKind { if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { return } } else if dstKind == reflect.Interface && dstElement.Kind() == reflect.Interface { if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { return } } else if srcKind == reflect.Map { if err = deepMap(dstElement, srcElement, visited, depth+1, config); err != nil { return } } else { return fmt.Errorf("type mismatch on %s field: found %v, expected %v", fieldName, srcKind, dstKind) } } } return } // Map sets fields' values in dst from src. // src can be a map with string keys or a struct. dst must be the opposite: // if src is a map, dst must be a valid pointer to struct. If src is a struct, // dst must be map[string]interface{}. // It won't merge unexported (private) fields and will do recursively // any exported field. // If dst is a map, keys will be src fields' names in lower camel case. // Missing key in src that doesn't match a field in dst will be skipped. This // doesn't apply if dst is a map. // This is separated method from Merge because it is cleaner and it keeps sane // semantics: merging equal types, mapping different (restricted) types. func Map(dst, src interface{}, opts ...func(*Config)) error { return _map(dst, src, opts...) } // MapWithOverwrite will do the same as Map except that non-empty dst attributes will be overridden by // non-empty src attribute values. // Deprecated: Use Map(…) with WithOverride func MapWithOverwrite(dst, src interface{}, opts ...func(*Config)) error { return _map(dst, src, append(opts, WithOverride)...) } func _map(dst, src interface{}, opts ...func(*Config)) error { var ( vDst, vSrc reflect.Value err error ) config := &Config{} for _, opt := range opts { opt(config) } if vDst, vSrc, err = resolveValues(dst, src); err != nil { return err } // To be friction-less, we redirect equal-type arguments // to deepMerge. Only because arguments can be anything. if vSrc.Kind() == vDst.Kind() { return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) } switch vSrc.Kind() { case reflect.Struct: if vDst.Kind() != reflect.Map { return ErrExpectedMapAsDestination } case reflect.Map: if vDst.Kind() != reflect.Struct { return ErrExpectedStructAsDestination } default: return ErrNotSupported } return deepMap(vDst, vSrc, make(map[uintptr]*visit), 0, config) } ================================================ FILE: vendor/github.com/imdario/mergo/merge.go ================================================ // Copyright 2013 Dario Castañé. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on src/pkg/reflect/deepequal.go from official // golang's stdlib. package mergo import ( "reflect" ) func hasExportedField(dst reflect.Value) (exported bool) { for i, n := 0, dst.NumField(); i < n; i++ { field := dst.Type().Field(i) if field.Anonymous && dst.Field(i).Kind() == reflect.Struct { exported = exported || hasExportedField(dst.Field(i)) } else { exported = exported || len(field.PkgPath) == 0 } } return } type Config struct { Overwrite bool AppendSlice bool Transformers Transformers } type Transformers interface { Transformer(reflect.Type) func(dst, src reflect.Value) error } // Traverses recursively both values, assigning src's fields values to dst. // The map argument tracks comparisons that have already been seen, which allows // short circuiting on recursive types. func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) { overwrite := config.Overwrite if !src.IsValid() { return } if dst.CanAddr() { addr := dst.UnsafeAddr() h := 17 * addr seen := visited[h] typ := dst.Type() for p := seen; p != nil; p = p.next { if p.ptr == addr && p.typ == typ { return nil } } // Remember, remember... visited[h] = &visit{addr, typ, seen} } if config.Transformers != nil && !isEmptyValue(dst) { if fn := config.Transformers.Transformer(dst.Type()); fn != nil { err = fn(dst, src) return } } switch dst.Kind() { case reflect.Struct: if hasExportedField(dst) { for i, n := 0, dst.NumField(); i < n; i++ { if err = deepMerge(dst.Field(i), src.Field(i), visited, depth+1, config); err != nil { return } } } else { if dst.CanSet() && !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) { dst.Set(src) } } case reflect.Map: if dst.IsNil() && !src.IsNil() { dst.Set(reflect.MakeMap(dst.Type())) } for _, key := range src.MapKeys() { srcElement := src.MapIndex(key) if !srcElement.IsValid() { continue } dstElement := dst.MapIndex(key) switch srcElement.Kind() { case reflect.Chan, reflect.Func, reflect.Map, reflect.Interface, reflect.Slice: if srcElement.IsNil() { continue } fallthrough default: if !srcElement.CanInterface() { continue } switch reflect.TypeOf(srcElement.Interface()).Kind() { case reflect.Struct: fallthrough case reflect.Ptr: fallthrough case reflect.Map: srcMapElm := srcElement dstMapElm := dstElement if srcMapElm.CanInterface() { srcMapElm = reflect.ValueOf(srcMapElm.Interface()) if dstMapElm.IsValid() { dstMapElm = reflect.ValueOf(dstMapElm.Interface()) } } if err = deepMerge(dstMapElm, srcMapElm, visited, depth+1, config); err != nil { return } case reflect.Slice: srcSlice := reflect.ValueOf(srcElement.Interface()) var dstSlice reflect.Value if !dstElement.IsValid() || dstElement.IsNil() { dstSlice = reflect.MakeSlice(srcSlice.Type(), 0, srcSlice.Len()) } else { dstSlice = reflect.ValueOf(dstElement.Interface()) } if !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice { dstSlice = srcSlice } else if config.AppendSlice { dstSlice = reflect.AppendSlice(dstSlice, srcSlice) } dst.SetMapIndex(key, dstSlice) } } if dstElement.IsValid() && reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Map { continue } if srcElement.IsValid() && (overwrite || (!dstElement.IsValid() || isEmptyValue(dstElement))) { if dst.IsNil() { dst.Set(reflect.MakeMap(dst.Type())) } dst.SetMapIndex(key, srcElement) } } case reflect.Slice: if !dst.CanSet() { break } if !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice { dst.Set(src) } else if config.AppendSlice { dst.Set(reflect.AppendSlice(dst, src)) } case reflect.Ptr: fallthrough case reflect.Interface: if src.IsNil() { break } if src.Kind() != reflect.Interface { if dst.IsNil() || overwrite { if dst.CanSet() && (overwrite || isEmptyValue(dst)) { dst.Set(src) } } else if src.Kind() == reflect.Ptr { if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { return } } else if dst.Elem().Type() == src.Type() { if err = deepMerge(dst.Elem(), src, visited, depth+1, config); err != nil { return } } else { return ErrDifferentArgumentsTypes } break } if dst.IsNil() || overwrite { if dst.CanSet() && (overwrite || isEmptyValue(dst)) { dst.Set(src) } } else if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { return } default: if dst.CanSet() && !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) { dst.Set(src) } } return } // Merge will fill any empty for value type attributes on the dst struct using corresponding // src attributes if they themselves are not empty. dst and src must be valid same-type structs // and dst must be a pointer to struct. // It won't merge unexported (private) fields and will do recursively any exported field. func Merge(dst, src interface{}, opts ...func(*Config)) error { return merge(dst, src, opts...) } // MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overriden by // non-empty src attribute values. // Deprecated: use Merge(…) with WithOverride func MergeWithOverwrite(dst, src interface{}, opts ...func(*Config)) error { return merge(dst, src, append(opts, WithOverride)...) } // WithTransformers adds transformers to merge, allowing to customize the merging of some types. func WithTransformers(transformers Transformers) func(*Config) { return func(config *Config) { config.Transformers = transformers } } // WithOverride will make merge override non-empty dst attributes with non-empty src attributes values. func WithOverride(config *Config) { config.Overwrite = true } // WithAppendSlice will make merge append slices instead of overwriting it func WithAppendSlice(config *Config) { config.AppendSlice = true } func merge(dst, src interface{}, opts ...func(*Config)) error { var ( vDst, vSrc reflect.Value err error ) config := &Config{} for _, opt := range opts { opt(config) } if vDst, vSrc, err = resolveValues(dst, src); err != nil { return err } if vDst.Type() != vSrc.Type() { return ErrDifferentArgumentsTypes } return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) } ================================================ FILE: vendor/github.com/imdario/mergo/mergo.go ================================================ // Copyright 2013 Dario Castañé. All rights reserved. // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Based on src/pkg/reflect/deepequal.go from official // golang's stdlib. package mergo import ( "errors" "reflect" ) // Errors reported by Mergo when it finds invalid arguments. var ( ErrNilArguments = errors.New("src and dst must not be nil") ErrDifferentArgumentsTypes = errors.New("src and dst must be of same type") ErrNotSupported = errors.New("only structs and maps are supported") ErrExpectedMapAsDestination = errors.New("dst was expected to be a map") ErrExpectedStructAsDestination = errors.New("dst was expected to be a struct") ) // During deepMerge, must keep track of checks that are // in progress. The comparison algorithm assumes that all // checks in progress are true when it reencounters them. // Visited are stored in a map indexed by 17 * a1 + a2; type visit struct { ptr uintptr typ reflect.Type next *visit } // From src/pkg/encoding/json/encode.go. func isEmptyValue(v reflect.Value) bool { switch v.Kind() { case reflect.Array, reflect.Map, reflect.Slice, reflect.String: return v.Len() == 0 case reflect.Bool: return !v.Bool() case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return v.Int() == 0 case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return v.Uint() == 0 case reflect.Float32, reflect.Float64: return v.Float() == 0 case reflect.Interface, reflect.Ptr: if v.IsNil() { return true } return isEmptyValue(v.Elem()) case reflect.Func: return v.IsNil() case reflect.Invalid: return true } return false } func resolveValues(dst, src interface{}) (vDst, vSrc reflect.Value, err error) { if dst == nil || src == nil { err = ErrNilArguments return } vDst = reflect.ValueOf(dst).Elem() if vDst.Kind() != reflect.Struct && vDst.Kind() != reflect.Map { err = ErrNotSupported return } vSrc = reflect.ValueOf(src) // We check if vSrc is a pointer to dereference it. if vSrc.Kind() == reflect.Ptr { vSrc = vSrc.Elem() } return } // Traverses recursively both values, assigning src's fields values to dst. // The map argument tracks comparisons that have already been seen, which allows // short circuiting on recursive types. func deeper(dst, src reflect.Value, visited map[uintptr]*visit, depth int) (err error) { if dst.CanAddr() { addr := dst.UnsafeAddr() h := 17 * addr seen := visited[h] typ := dst.Type() for p := seen; p != nil; p = p.next { if p.ptr == addr && p.typ == typ { return nil } } // Remember, remember... visited[h] = &visit{addr, typ, seen} } return // TODO refactor } ================================================ FILE: vendor/github.com/inconshreveable/mousetrap/LICENSE ================================================ Copyright 2014 Alan Shreve Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/inconshreveable/mousetrap/README.md ================================================ # mousetrap mousetrap is a tiny library that answers a single question. On a Windows machine, was the process invoked by someone double clicking on the executable file while browsing in explorer? ### Motivation Windows developers unfamiliar with command line tools will often "double-click" the executable for a tool. Because most CLI tools print the help and then exit when invoked without arguments, this is often very frustrating for those users. mousetrap provides a way to detect these invocations so that you can provide more helpful behavior and instructions on how to run the CLI tool. To see what this looks like, both from an organizational and a technical perspective, see https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ ### The interface The library exposes a single interface: func StartedByExplorer() (bool) ================================================ FILE: vendor/github.com/inconshreveable/mousetrap/trap_others.go ================================================ // +build !windows package mousetrap // StartedByExplorer returns true if the program was invoked by the user // double-clicking on the executable from explorer.exe // // It is conservative and returns false if any of the internal calls fail. // It does not guarantee that the program was run from a terminal. It only can tell you // whether it was launched from explorer.exe // // On non-Windows platforms, it always returns false. func StartedByExplorer() bool { return false } ================================================ FILE: vendor/github.com/inconshreveable/mousetrap/trap_windows.go ================================================ // +build windows // +build !go1.4 package mousetrap import ( "fmt" "os" "syscall" "unsafe" ) const ( // defined by the Win32 API th32cs_snapprocess uintptr = 0x2 ) var ( kernel = syscall.MustLoadDLL("kernel32.dll") CreateToolhelp32Snapshot = kernel.MustFindProc("CreateToolhelp32Snapshot") Process32First = kernel.MustFindProc("Process32FirstW") Process32Next = kernel.MustFindProc("Process32NextW") ) // ProcessEntry32 structure defined by the Win32 API type processEntry32 struct { dwSize uint32 cntUsage uint32 th32ProcessID uint32 th32DefaultHeapID int th32ModuleID uint32 cntThreads uint32 th32ParentProcessID uint32 pcPriClassBase int32 dwFlags uint32 szExeFile [syscall.MAX_PATH]uint16 } func getProcessEntry(pid int) (pe *processEntry32, err error) { snapshot, _, e1 := CreateToolhelp32Snapshot.Call(th32cs_snapprocess, uintptr(0)) if snapshot == uintptr(syscall.InvalidHandle) { err = fmt.Errorf("CreateToolhelp32Snapshot: %v", e1) return } defer syscall.CloseHandle(syscall.Handle(snapshot)) var processEntry processEntry32 processEntry.dwSize = uint32(unsafe.Sizeof(processEntry)) ok, _, e1 := Process32First.Call(snapshot, uintptr(unsafe.Pointer(&processEntry))) if ok == 0 { err = fmt.Errorf("Process32First: %v", e1) return } for { if processEntry.th32ProcessID == uint32(pid) { pe = &processEntry return } ok, _, e1 = Process32Next.Call(snapshot, uintptr(unsafe.Pointer(&processEntry))) if ok == 0 { err = fmt.Errorf("Process32Next: %v", e1) return } } } func getppid() (pid int, err error) { pe, err := getProcessEntry(os.Getpid()) if err != nil { return } pid = int(pe.th32ParentProcessID) return } // StartedByExplorer returns true if the program was invoked by the user double-clicking // on the executable from explorer.exe // // It is conservative and returns false if any of the internal calls fail. // It does not guarantee that the program was run from a terminal. It only can tell you // whether it was launched from explorer.exe func StartedByExplorer() bool { ppid, err := getppid() if err != nil { return false } pe, err := getProcessEntry(ppid) if err != nil { return false } name := syscall.UTF16ToString(pe.szExeFile[:]) return name == "explorer.exe" } ================================================ FILE: vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go ================================================ // +build windows // +build go1.4 package mousetrap import ( "os" "syscall" "unsafe" ) func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) { snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0) if err != nil { return nil, err } defer syscall.CloseHandle(snapshot) var procEntry syscall.ProcessEntry32 procEntry.Size = uint32(unsafe.Sizeof(procEntry)) if err = syscall.Process32First(snapshot, &procEntry); err != nil { return nil, err } for { if procEntry.ProcessID == uint32(pid) { return &procEntry, nil } err = syscall.Process32Next(snapshot, &procEntry) if err != nil { return nil, err } } } // StartedByExplorer returns true if the program was invoked by the user double-clicking // on the executable from explorer.exe // // It is conservative and returns false if any of the internal calls fail. // It does not guarantee that the program was run from a terminal. It only can tell you // whether it was launched from explorer.exe func StartedByExplorer() bool { pe, err := getProcessEntry(os.Getppid()) if err != nil { return false } return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:]) } ================================================ FILE: vendor/github.com/modern-go/concurrent/.gitignore ================================================ /coverage.txt ================================================ FILE: vendor/github.com/modern-go/concurrent/.travis.yml ================================================ language: go go: - 1.8.x - 1.x before_install: - go get -t -v ./... script: - ./test.sh after_success: - bash <(curl -s https://codecov.io/bash) ================================================ FILE: vendor/github.com/modern-go/concurrent/LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: vendor/github.com/modern-go/concurrent/README.md ================================================ # concurrent [![Sourcegraph](https://sourcegraph.com/github.com/modern-go/concurrent/-/badge.svg)](https://sourcegraph.com/github.com/modern-go/concurrent?badge) [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/modern-go/concurrent) [![Build Status](https://travis-ci.org/modern-go/concurrent.svg?branch=master)](https://travis-ci.org/modern-go/concurrent) [![codecov](https://codecov.io/gh/modern-go/concurrent/branch/master/graph/badge.svg)](https://codecov.io/gh/modern-go/concurrent) [![rcard](https://goreportcard.com/badge/github.com/modern-go/concurrent)](https://goreportcard.com/report/github.com/modern-go/concurrent) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://raw.githubusercontent.com/modern-go/concurrent/master/LICENSE) * concurrent.Map: backport sync.Map for go below 1.9 * concurrent.Executor: goroutine with explicit ownership and cancellable # concurrent.Map because sync.Map is only available in go 1.9, we can use concurrent.Map to make code portable ```go m := concurrent.NewMap() m.Store("hello", "world") elem, found := m.Load("hello") // elem will be "world" // found will be true ``` # concurrent.Executor ```go executor := concurrent.NewUnboundedExecutor() executor.Go(func(ctx context.Context) { everyMillisecond := time.NewTicker(time.Millisecond) for { select { case <-ctx.Done(): fmt.Println("goroutine exited") return case <-everyMillisecond.C: // do something } } }) time.Sleep(time.Second) executor.StopAndWaitForever() fmt.Println("executor stopped") ``` attach goroutine to executor instance, so that we can * cancel it by stop the executor with Stop/StopAndWait/StopAndWaitForever * handle panic by callback: the default behavior will no longer crash your application ================================================ FILE: vendor/github.com/modern-go/concurrent/executor.go ================================================ package concurrent import "context" // Executor replace go keyword to start a new goroutine // the goroutine should cancel itself if the context passed in has been cancelled // the goroutine started by the executor, is owned by the executor // we can cancel all executors owned by the executor just by stop the executor itself // however Executor interface does not Stop method, the one starting and owning executor // should use the concrete type of executor, instead of this interface. type Executor interface { // Go starts a new goroutine controlled by the context Go(handler func(ctx context.Context)) } ================================================ FILE: vendor/github.com/modern-go/concurrent/go_above_19.go ================================================ //+build go1.9 package concurrent import "sync" // Map is a wrapper for sync.Map introduced in go1.9 type Map struct { sync.Map } // NewMap creates a thread safe Map func NewMap() *Map { return &Map{} } ================================================ FILE: vendor/github.com/modern-go/concurrent/go_below_19.go ================================================ //+build !go1.9 package concurrent import "sync" // Map implements a thread safe map for go version below 1.9 using mutex type Map struct { lock sync.RWMutex data map[interface{}]interface{} } // NewMap creates a thread safe map func NewMap() *Map { return &Map{ data: make(map[interface{}]interface{}, 32), } } // Load is same as sync.Map Load func (m *Map) Load(key interface{}) (elem interface{}, found bool) { m.lock.RLock() elem, found = m.data[key] m.lock.RUnlock() return } // Load is same as sync.Map Store func (m *Map) Store(key interface{}, elem interface{}) { m.lock.Lock() m.data[key] = elem m.lock.Unlock() } ================================================ FILE: vendor/github.com/modern-go/concurrent/log.go ================================================ package concurrent import ( "os" "log" "io/ioutil" ) // ErrorLogger is used to print out error, can be set to writer other than stderr var ErrorLogger = log.New(os.Stderr, "", 0) // InfoLogger is used to print informational message, default to off var InfoLogger = log.New(ioutil.Discard, "", 0) ================================================ FILE: vendor/github.com/modern-go/concurrent/test.sh ================================================ #!/usr/bin/env bash set -e echo "" > coverage.txt for d in $(go list ./... | grep -v vendor); do go test -coverprofile=profile.out -coverpkg=github.com/modern-go/concurrent $d if [ -f profile.out ]; then cat profile.out >> coverage.txt rm profile.out fi done ================================================ FILE: vendor/github.com/modern-go/concurrent/unbounded_executor.go ================================================ package concurrent import ( "context" "fmt" "runtime" "runtime/debug" "sync" "time" "reflect" ) // HandlePanic logs goroutine panic by default var HandlePanic = func(recovered interface{}, funcName string) { ErrorLogger.Println(fmt.Sprintf("%s panic: %v", funcName, recovered)) ErrorLogger.Println(string(debug.Stack())) } // UnboundedExecutor is a executor without limits on counts of alive goroutines // it tracks the goroutine started by it, and can cancel them when shutdown type UnboundedExecutor struct { ctx context.Context cancel context.CancelFunc activeGoroutinesMutex *sync.Mutex activeGoroutines map[string]int HandlePanic func(recovered interface{}, funcName string) } // GlobalUnboundedExecutor has the life cycle of the program itself // any goroutine want to be shutdown before main exit can be started from this executor // GlobalUnboundedExecutor expects the main function to call stop // it does not magically knows the main function exits var GlobalUnboundedExecutor = NewUnboundedExecutor() // NewUnboundedExecutor creates a new UnboundedExecutor, // UnboundedExecutor can not be created by &UnboundedExecutor{} // HandlePanic can be set with a callback to override global HandlePanic func NewUnboundedExecutor() *UnboundedExecutor { ctx, cancel := context.WithCancel(context.TODO()) return &UnboundedExecutor{ ctx: ctx, cancel: cancel, activeGoroutinesMutex: &sync.Mutex{}, activeGoroutines: map[string]int{}, } } // Go starts a new goroutine and tracks its lifecycle. // Panic will be recovered and logged automatically, except for StopSignal func (executor *UnboundedExecutor) Go(handler func(ctx context.Context)) { pc := reflect.ValueOf(handler).Pointer() f := runtime.FuncForPC(pc) funcName := f.Name() file, line := f.FileLine(pc) executor.activeGoroutinesMutex.Lock() defer executor.activeGoroutinesMutex.Unlock() startFrom := fmt.Sprintf("%s:%d", file, line) executor.activeGoroutines[startFrom] += 1 go func() { defer func() { recovered := recover() // if you want to quit a goroutine without trigger HandlePanic // use runtime.Goexit() to quit if recovered != nil { if executor.HandlePanic == nil { HandlePanic(recovered, funcName) } else { executor.HandlePanic(recovered, funcName) } } executor.activeGoroutinesMutex.Lock() executor.activeGoroutines[startFrom] -= 1 executor.activeGoroutinesMutex.Unlock() }() handler(executor.ctx) }() } // Stop cancel all goroutines started by this executor without wait func (executor *UnboundedExecutor) Stop() { executor.cancel() } // StopAndWaitForever cancel all goroutines started by this executor and // wait until all goroutines exited func (executor *UnboundedExecutor) StopAndWaitForever() { executor.StopAndWait(context.Background()) } // StopAndWait cancel all goroutines started by this executor and wait. // Wait can be cancelled by the context passed in. func (executor *UnboundedExecutor) StopAndWait(ctx context.Context) { executor.cancel() for { oneHundredMilliseconds := time.NewTimer(time.Millisecond * 100) select { case <-oneHundredMilliseconds.C: if executor.checkNoActiveGoroutines() { return } case <-ctx.Done(): return } } } func (executor *UnboundedExecutor) checkNoActiveGoroutines() bool { executor.activeGoroutinesMutex.Lock() defer executor.activeGoroutinesMutex.Unlock() for startFrom, count := range executor.activeGoroutines { if count > 0 { InfoLogger.Println("UnboundedExecutor is still waiting goroutines to quit", "startFrom", startFrom, "count", count) return false } } return true } ================================================ FILE: vendor/github.com/pborman/uuid/CONTRIBUTORS ================================================ Paul Borman ================================================ FILE: vendor/github.com/pborman/uuid/LICENSE ================================================ Copyright (c) 2009,2014 Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/pborman/uuid/dce.go ================================================ // Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid import ( "encoding/binary" "fmt" "os" ) // A Domain represents a Version 2 domain type Domain byte // Domain constants for DCE Security (Version 2) UUIDs. const ( Person = Domain(0) Group = Domain(1) Org = Domain(2) ) // NewDCESecurity returns a DCE Security (Version 2) UUID. // // The domain should be one of Person, Group or Org. // On a POSIX system the id should be the users UID for the Person // domain and the users GID for the Group. The meaning of id for // the domain Org or on non-POSIX systems is site defined. // // For a given domain/id pair the same token may be returned for up to // 7 minutes and 10 seconds. func NewDCESecurity(domain Domain, id uint32) UUID { uuid := NewUUID() if uuid != nil { uuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2 uuid[9] = byte(domain) binary.BigEndian.PutUint32(uuid[0:], id) } return uuid } // NewDCEPerson returns a DCE Security (Version 2) UUID in the person // domain with the id returned by os.Getuid. // // NewDCEPerson(Person, uint32(os.Getuid())) func NewDCEPerson() UUID { return NewDCESecurity(Person, uint32(os.Getuid())) } // NewDCEGroup returns a DCE Security (Version 2) UUID in the group // domain with the id returned by os.Getgid. // // NewDCEGroup(Group, uint32(os.Getgid())) func NewDCEGroup() UUID { return NewDCESecurity(Group, uint32(os.Getgid())) } // Domain returns the domain for a Version 2 UUID or false. func (uuid UUID) Domain() (Domain, bool) { if v, _ := uuid.Version(); v != 2 { return 0, false } return Domain(uuid[9]), true } // Id returns the id for a Version 2 UUID or false. func (uuid UUID) Id() (uint32, bool) { if v, _ := uuid.Version(); v != 2 { return 0, false } return binary.BigEndian.Uint32(uuid[0:4]), true } func (d Domain) String() string { switch d { case Person: return "Person" case Group: return "Group" case Org: return "Org" } return fmt.Sprintf("Domain%d", int(d)) } ================================================ FILE: vendor/github.com/pborman/uuid/doc.go ================================================ // Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The uuid package generates and inspects UUIDs. // // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security Services. package uuid ================================================ FILE: vendor/github.com/pborman/uuid/hash.go ================================================ // Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid import ( "crypto/md5" "crypto/sha1" "hash" ) // Well known Name Space IDs and UUIDs var ( NameSpace_DNS = Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8") NameSpace_URL = Parse("6ba7b811-9dad-11d1-80b4-00c04fd430c8") NameSpace_OID = Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8") NameSpace_X500 = Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8") NIL = Parse("00000000-0000-0000-0000-000000000000") ) // NewHash returns a new UUID dervied from the hash of space concatenated with // data generated by h. The hash should be at least 16 byte in length. The // first 16 bytes of the hash are used to form the UUID. The version of the // UUID will be the lower 4 bits of version. NewHash is used to implement // NewMD5 and NewSHA1. func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID { h.Reset() h.Write(space) h.Write([]byte(data)) s := h.Sum(nil) uuid := make([]byte, 16) copy(uuid, s) uuid[6] = (uuid[6] & 0x0f) | uint8((version&0xf)<<4) uuid[8] = (uuid[8] & 0x3f) | 0x80 // RFC 4122 variant return uuid } // NewMD5 returns a new MD5 (Version 3) UUID based on the // supplied name space and data. // // NewHash(md5.New(), space, data, 3) func NewMD5(space UUID, data []byte) UUID { return NewHash(md5.New(), space, data, 3) } // NewSHA1 returns a new SHA1 (Version 5) UUID based on the // supplied name space and data. // // NewHash(sha1.New(), space, data, 5) func NewSHA1(space UUID, data []byte) UUID { return NewHash(sha1.New(), space, data, 5) } ================================================ FILE: vendor/github.com/pborman/uuid/json.go ================================================ // Copyright 2014 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid import "errors" func (u UUID) MarshalJSON() ([]byte, error) { if len(u) == 0 { return []byte(`""`), nil } return []byte(`"` + u.String() + `"`), nil } func (u *UUID) UnmarshalJSON(data []byte) error { if len(data) == 0 || string(data) == `""` { return nil } if len(data) < 2 || data[0] != '"' || data[len(data)-1] != '"' { return errors.New("invalid UUID format") } data = data[1 : len(data)-1] uu := Parse(string(data)) if uu == nil { return errors.New("invalid UUID format") } *u = uu return nil } ================================================ FILE: vendor/github.com/pborman/uuid/node.go ================================================ // Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid import "net" var ( interfaces []net.Interface // cached list of interfaces ifname string // name of interface being used nodeID []byte // hardware for version 1 UUIDs ) // NodeInterface returns the name of the interface from which the NodeID was // derived. The interface "user" is returned if the NodeID was set by // SetNodeID. func NodeInterface() string { return ifname } // SetNodeInterface selects the hardware address to be used for Version 1 UUIDs. // If name is "" then the first usable interface found will be used or a random // Node ID will be generated. If a named interface cannot be found then false // is returned. // // SetNodeInterface never fails when name is "". func SetNodeInterface(name string) bool { if interfaces == nil { var err error interfaces, err = net.Interfaces() if err != nil && name != "" { return false } } for _, ifs := range interfaces { if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) { if setNodeID(ifs.HardwareAddr) { ifname = ifs.Name return true } } } // We found no interfaces with a valid hardware address. If name // does not specify a specific interface generate a random Node ID // (section 4.1.6) if name == "" { if nodeID == nil { nodeID = make([]byte, 6) } randomBits(nodeID) return true } return false } // NodeID returns a slice of a copy of the current Node ID, setting the Node ID // if not already set. func NodeID() []byte { if nodeID == nil { SetNodeInterface("") } nid := make([]byte, 6) copy(nid, nodeID) return nid } // SetNodeID sets the Node ID to be used for Version 1 UUIDs. The first 6 bytes // of id are used. If id is less than 6 bytes then false is returned and the // Node ID is not set. func SetNodeID(id []byte) bool { if setNodeID(id) { ifname = "user" return true } return false } func setNodeID(id []byte) bool { if len(id) < 6 { return false } if nodeID == nil { nodeID = make([]byte, 6) } copy(nodeID, id) return true } // NodeID returns the 6 byte node id encoded in uuid. It returns nil if uuid is // not valid. The NodeID is only well defined for version 1 and 2 UUIDs. func (uuid UUID) NodeID() []byte { if len(uuid) != 16 { return nil } node := make([]byte, 6) copy(node, uuid[10:]) return node } ================================================ FILE: vendor/github.com/pborman/uuid/time.go ================================================ // Copyright 2014 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid import ( "encoding/binary" "sync" "time" ) // A Time represents a time as the number of 100's of nanoseconds since 15 Oct // 1582. type Time int64 const ( lillian = 2299160 // Julian day of 15 Oct 1582 unix = 2440587 // Julian day of 1 Jan 1970 epoch = unix - lillian // Days between epochs g1582 = epoch * 86400 // seconds between epochs g1582ns100 = g1582 * 10000000 // 100s of a nanoseconds between epochs ) var ( mu sync.Mutex lasttime uint64 // last time we returned clock_seq uint16 // clock sequence for this run timeNow = time.Now // for testing ) // UnixTime converts t the number of seconds and nanoseconds using the Unix // epoch of 1 Jan 1970. func (t Time) UnixTime() (sec, nsec int64) { sec = int64(t - g1582ns100) nsec = (sec % 10000000) * 100 sec /= 10000000 return sec, nsec } // GetTime returns the current Time (100s of nanoseconds since 15 Oct 1582) and // clock sequence as well as adjusting the clock sequence as needed. An error // is returned if the current time cannot be determined. func GetTime() (Time, uint16, error) { defer mu.Unlock() mu.Lock() return getTime() } func getTime() (Time, uint16, error) { t := timeNow() // If we don't have a clock sequence already, set one. if clock_seq == 0 { setClockSequence(-1) } now := uint64(t.UnixNano()/100) + g1582ns100 // If time has gone backwards with this clock sequence then we // increment the clock sequence if now <= lasttime { clock_seq = ((clock_seq + 1) & 0x3fff) | 0x8000 } lasttime = now return Time(now), clock_seq, nil } // ClockSequence returns the current clock sequence, generating one if not // already set. The clock sequence is only used for Version 1 UUIDs. // // The uuid package does not use global static storage for the clock sequence or // the last time a UUID was generated. Unless SetClockSequence a new random // clock sequence is generated the first time a clock sequence is requested by // ClockSequence, GetTime, or NewUUID. (section 4.2.1.1) sequence is generated // for func ClockSequence() int { defer mu.Unlock() mu.Lock() return clockSequence() } func clockSequence() int { if clock_seq == 0 { setClockSequence(-1) } return int(clock_seq & 0x3fff) } // SetClockSeq sets the clock sequence to the lower 14 bits of seq. Setting to // -1 causes a new sequence to be generated. func SetClockSequence(seq int) { defer mu.Unlock() mu.Lock() setClockSequence(seq) } func setClockSequence(seq int) { if seq == -1 { var b [2]byte randomBits(b[:]) // clock sequence seq = int(b[0])<<8 | int(b[1]) } old_seq := clock_seq clock_seq = uint16(seq&0x3fff) | 0x8000 // Set our variant if old_seq != clock_seq { lasttime = 0 } } // Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in // uuid. It returns false if uuid is not valid. The time is only well defined // for version 1 and 2 UUIDs. func (uuid UUID) Time() (Time, bool) { if len(uuid) != 16 { return 0, false } time := int64(binary.BigEndian.Uint32(uuid[0:4])) time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32 time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48 return Time(time), true } // ClockSequence returns the clock sequence encoded in uuid. It returns false // if uuid is not valid. The clock sequence is only well defined for version 1 // and 2 UUIDs. func (uuid UUID) ClockSequence() (int, bool) { if len(uuid) != 16 { return 0, false } return int(binary.BigEndian.Uint16(uuid[8:10])) & 0x3fff, true } ================================================ FILE: vendor/github.com/pborman/uuid/util.go ================================================ // Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid import ( "io" ) // randomBits completely fills slice b with random data. func randomBits(b []byte) { if _, err := io.ReadFull(rander, b); err != nil { panic(err.Error()) // rand should never fail } } // xvalues returns the value of a byte as a hexadecimal digit or 255. var xvalues = []byte{ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255, 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, } // xtob converts the the first two hex bytes of x into a byte. func xtob(x string) (byte, bool) { b1 := xvalues[x[0]] b2 := xvalues[x[1]] return (b1 << 4) | b2, b1 != 255 && b2 != 255 } ================================================ FILE: vendor/github.com/pborman/uuid/uuid.go ================================================ // Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid import ( "bytes" "crypto/rand" "fmt" "io" "strings" ) // A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC // 4122. type UUID []byte // A Version represents a UUIDs version. type Version byte // A Variant represents a UUIDs variant. type Variant byte // Constants returned by Variant. const ( Invalid = Variant(iota) // Invalid UUID RFC4122 // The variant specified in RFC4122 Reserved // Reserved, NCS backward compatibility. Microsoft // Reserved, Microsoft Corporation backward compatibility. Future // Reserved for future definition. ) var rander = rand.Reader // random function // New returns a new random (version 4) UUID as a string. It is a convenience // function for NewRandom().String(). func New() string { return NewRandom().String() } // Parse decodes s into a UUID or returns nil. Both the UUID form of // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded. func Parse(s string) UUID { if len(s) == 36+9 { if strings.ToLower(s[:9]) != "urn:uuid:" { return nil } s = s[9:] } else if len(s) != 36 { return nil } if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' { return nil } uuid := make([]byte, 16) for i, x := range []int{ 0, 2, 4, 6, 9, 11, 14, 16, 19, 21, 24, 26, 28, 30, 32, 34} { if v, ok := xtob(s[x:]); !ok { return nil } else { uuid[i] = v } } return uuid } // Equal returns true if uuid1 and uuid2 are equal. func Equal(uuid1, uuid2 UUID) bool { return bytes.Equal(uuid1, uuid2) } // String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx // , or "" if uuid is invalid. func (uuid UUID) String() string { if uuid == nil || len(uuid) != 16 { return "" } b := []byte(uuid) return fmt.Sprintf("%08x-%04x-%04x-%04x-%012x", b[:4], b[4:6], b[6:8], b[8:10], b[10:]) } // URN returns the RFC 2141 URN form of uuid, // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, or "" if uuid is invalid. func (uuid UUID) URN() string { if uuid == nil || len(uuid) != 16 { return "" } b := []byte(uuid) return fmt.Sprintf("urn:uuid:%08x-%04x-%04x-%04x-%012x", b[:4], b[4:6], b[6:8], b[8:10], b[10:]) } // Variant returns the variant encoded in uuid. It returns Invalid if // uuid is invalid. func (uuid UUID) Variant() Variant { if len(uuid) != 16 { return Invalid } switch { case (uuid[8] & 0xc0) == 0x80: return RFC4122 case (uuid[8] & 0xe0) == 0xc0: return Microsoft case (uuid[8] & 0xe0) == 0xe0: return Future default: return Reserved } panic("unreachable") } // Version returns the verison of uuid. It returns false if uuid is not // valid. func (uuid UUID) Version() (Version, bool) { if len(uuid) != 16 { return 0, false } return Version(uuid[6] >> 4), true } func (v Version) String() string { if v > 15 { return fmt.Sprintf("BAD_VERSION_%d", v) } return fmt.Sprintf("VERSION_%d", v) } func (v Variant) String() string { switch v { case RFC4122: return "RFC4122" case Reserved: return "Reserved" case Microsoft: return "Microsoft" case Future: return "Future" case Invalid: return "Invalid" } return fmt.Sprintf("BadVariant%d", int(v)) } // SetRand sets the random number generator to r, which implents io.Reader. // If r.Read returns an error when the package requests random data then // a panic will be issued. // // Calling SetRand with nil sets the random number generator to the default // generator. func SetRand(r io.Reader) { if r == nil { rander = rand.Reader return } rander = r } ================================================ FILE: vendor/github.com/pborman/uuid/version1.go ================================================ // Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid import ( "encoding/binary" ) // NewUUID returns a Version 1 UUID based on the current NodeID and clock // sequence, and the current time. If the NodeID has not been set by SetNodeID // or SetNodeInterface then it will be set automatically. If the NodeID cannot // be set NewUUID returns nil. If clock sequence has not been set by // SetClockSequence then it will be set automatically. If GetTime fails to // return the current NewUUID returns nil. func NewUUID() UUID { if nodeID == nil { SetNodeInterface("") } now, seq, err := GetTime() if err != nil { return nil } uuid := make([]byte, 16) time_low := uint32(now & 0xffffffff) time_mid := uint16((now >> 32) & 0xffff) time_hi := uint16((now >> 48) & 0x0fff) time_hi |= 0x1000 // Version 1 binary.BigEndian.PutUint32(uuid[0:], time_low) binary.BigEndian.PutUint16(uuid[4:], time_mid) binary.BigEndian.PutUint16(uuid[6:], time_hi) binary.BigEndian.PutUint16(uuid[8:], seq) copy(uuid[10:], nodeID) return uuid } ================================================ FILE: vendor/github.com/pborman/uuid/version4.go ================================================ // Copyright 2011 Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package uuid // Random returns a Random (Version 4) UUID or panics. // // The strength of the UUIDs is based on the strength of the crypto/rand // package. // // A note about uniqueness derived from from the UUID Wikipedia entry: // // Randomly generated UUIDs have 122 random bits. One's annual risk of being // hit by a meteorite is estimated to be one chance in 17 billion, that // means the probability is about 0.00000000006 (6 × 10−11), // equivalent to the odds of creating a few tens of trillions of UUIDs in a // year and having one duplicate. func NewRandom() UUID { uuid := make([]byte, 16) randomBits([]byte(uuid)) uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4 uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10 return uuid } ================================================ FILE: vendor/github.com/peterbourgon/diskv/LICENSE ================================================ Copyright (c) 2011-2012 Peter Bourgon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: vendor/github.com/peterbourgon/diskv/README.md ================================================ # What is diskv? Diskv (disk-vee) is a simple, persistent key-value store written in the Go language. It starts with an incredibly simple API for storing arbitrary data on a filesystem by key, and builds several layers of performance-enhancing abstraction on top. The end result is a conceptually simple, but highly performant, disk-backed storage system. [![Build Status][1]][2] [1]: https://drone.io/github.com/peterbourgon/diskv/status.png [2]: https://drone.io/github.com/peterbourgon/diskv/latest # Installing Install [Go 1][3], either [from source][4] or [with a prepackaged binary][5]. Then, ```bash $ go get github.com/peterbourgon/diskv ``` [3]: http://golang.org [4]: http://golang.org/doc/install/source [5]: http://golang.org/doc/install # Usage ```go package main import ( "fmt" "github.com/peterbourgon/diskv" ) func main() { // Simplest transform function: put all the data files into the base dir. flatTransform := func(s string) []string { return []string{} } // Initialize a new diskv store, rooted at "my-data-dir", with a 1MB cache. d := diskv.New(diskv.Options{ BasePath: "my-data-dir", Transform: flatTransform, CacheSizeMax: 1024 * 1024, }) // Write three bytes to the key "alpha". key := "alpha" d.Write(key, []byte{'1', '2', '3'}) // Read the value back out of the store. value, _ := d.Read(key) fmt.Printf("%v\n", value) // Erase the key+value from the store (and the disk). d.Erase(key) } ``` More complex examples can be found in the "examples" subdirectory. # Theory ## Basic idea At its core, diskv is a map of a key (`string`) to arbitrary data (`[]byte`). The data is written to a single file on disk, with the same name as the key. The key determines where that file will be stored, via a user-provided `TransformFunc`, which takes a key and returns a slice (`[]string`) corresponding to a path list where the key file will be stored. The simplest TransformFunc, ```go func SimpleTransform (key string) []string { return []string{} } ``` will place all keys in the same, base directory. The design is inspired by [Redis diskstore][6]; a TransformFunc which emulates the default diskstore behavior is available in the content-addressable-storage example. [6]: http://groups.google.com/group/redis-db/browse_thread/thread/d444bc786689bde9?pli=1 **Note** that your TransformFunc should ensure that one valid key doesn't transform to a subset of another valid key. That is, it shouldn't be possible to construct valid keys that resolve to directory names. As a concrete example, if your TransformFunc splits on every 3 characters, then ```go d.Write("abcabc", val) // OK: written to /abc/abc/abcabc d.Write("abc", val) // Error: attempted write to /abc/abc, but it's a directory ``` This will be addressed in an upcoming version of diskv. Probably the most important design principle behind diskv is that your data is always flatly available on the disk. diskv will never do anything that would prevent you from accessing, copying, backing up, or otherwise interacting with your data via common UNIX commandline tools. ## Adding a cache An in-memory caching layer is provided by combining the BasicStore functionality with a simple map structure, and keeping it up-to-date as appropriate. Since the map structure in Go is not threadsafe, it's combined with a RWMutex to provide safe concurrent access. ## Adding order diskv is a key-value store and therefore inherently unordered. An ordering system can be injected into the store by passing something which satisfies the diskv.Index interface. (A default implementation, using Google's [btree][7] package, is provided.) Basically, diskv keeps an ordered (by a user-provided Less function) index of the keys, which can be queried. [7]: https://github.com/google/btree ## Adding compression Something which implements the diskv.Compression interface may be passed during store creation, so that all Writes and Reads are filtered through a compression/decompression pipeline. Several default implementations, using stdlib compression algorithms, are provided. Note that data is cached compressed; the cost of decompression is borne with each Read. ## Streaming diskv also now provides ReadStream and WriteStream methods, to allow very large data to be handled efficiently. # Future plans * Needs plenty of robust testing: huge datasets, etc... * More thorough benchmarking * Your suggestions for use-cases I haven't thought of ================================================ FILE: vendor/github.com/peterbourgon/diskv/compression.go ================================================ package diskv import ( "compress/flate" "compress/gzip" "compress/zlib" "io" ) // Compression is an interface that Diskv uses to implement compression of // data. Writer takes a destination io.Writer and returns a WriteCloser that // compresses all data written through it. Reader takes a source io.Reader and // returns a ReadCloser that decompresses all data read through it. You may // define these methods on your own type, or use one of the NewCompression // helpers. type Compression interface { Writer(dst io.Writer) (io.WriteCloser, error) Reader(src io.Reader) (io.ReadCloser, error) } // NewGzipCompression returns a Gzip-based Compression. func NewGzipCompression() Compression { return NewGzipCompressionLevel(flate.DefaultCompression) } // NewGzipCompressionLevel returns a Gzip-based Compression with the given level. func NewGzipCompressionLevel(level int) Compression { return &genericCompression{ wf: func(w io.Writer) (io.WriteCloser, error) { return gzip.NewWriterLevel(w, level) }, rf: func(r io.Reader) (io.ReadCloser, error) { return gzip.NewReader(r) }, } } // NewZlibCompression returns a Zlib-based Compression. func NewZlibCompression() Compression { return NewZlibCompressionLevel(flate.DefaultCompression) } // NewZlibCompressionLevel returns a Zlib-based Compression with the given level. func NewZlibCompressionLevel(level int) Compression { return NewZlibCompressionLevelDict(level, nil) } // NewZlibCompressionLevelDict returns a Zlib-based Compression with the given // level, based on the given dictionary. func NewZlibCompressionLevelDict(level int, dict []byte) Compression { return &genericCompression{ func(w io.Writer) (io.WriteCloser, error) { return zlib.NewWriterLevelDict(w, level, dict) }, func(r io.Reader) (io.ReadCloser, error) { return zlib.NewReaderDict(r, dict) }, } } type genericCompression struct { wf func(w io.Writer) (io.WriteCloser, error) rf func(r io.Reader) (io.ReadCloser, error) } func (g *genericCompression) Writer(dst io.Writer) (io.WriteCloser, error) { return g.wf(dst) } func (g *genericCompression) Reader(src io.Reader) (io.ReadCloser, error) { return g.rf(src) } ================================================ FILE: vendor/github.com/peterbourgon/diskv/diskv.go ================================================ // Diskv (disk-vee) is a simple, persistent, key-value store. // It stores all data flatly on the filesystem. package diskv import ( "bytes" "errors" "fmt" "io" "io/ioutil" "os" "path/filepath" "strings" "sync" "syscall" ) const ( defaultBasePath = "diskv" defaultFilePerm os.FileMode = 0666 defaultPathPerm os.FileMode = 0777 ) var ( defaultTransform = func(s string) []string { return []string{} } errCanceled = errors.New("canceled") errEmptyKey = errors.New("empty key") errBadKey = errors.New("bad key") errImportDirectory = errors.New("can't import a directory") ) // TransformFunction transforms a key into a slice of strings, with each // element in the slice representing a directory in the file path where the // key's entry will eventually be stored. // // For example, if TransformFunc transforms "abcdef" to ["ab", "cde", "f"], // the final location of the data file will be /ab/cde/f/abcdef type TransformFunction func(s string) []string // Options define a set of properties that dictate Diskv behavior. // All values are optional. type Options struct { BasePath string Transform TransformFunction CacheSizeMax uint64 // bytes PathPerm os.FileMode FilePerm os.FileMode // If TempDir is set, it will enable filesystem atomic writes by // writing temporary files to that location before being moved // to BasePath. // Note that TempDir MUST be on the same device/partition as // BasePath. TempDir string Index Index IndexLess LessFunction Compression Compression } // Diskv implements the Diskv interface. You shouldn't construct Diskv // structures directly; instead, use the New constructor. type Diskv struct { Options mu sync.RWMutex cache map[string][]byte cacheSize uint64 } // New returns an initialized Diskv structure, ready to use. // If the path identified by baseDir already contains data, // it will be accessible, but not yet cached. func New(o Options) *Diskv { if o.BasePath == "" { o.BasePath = defaultBasePath } if o.Transform == nil { o.Transform = defaultTransform } if o.PathPerm == 0 { o.PathPerm = defaultPathPerm } if o.FilePerm == 0 { o.FilePerm = defaultFilePerm } d := &Diskv{ Options: o, cache: map[string][]byte{}, cacheSize: 0, } if d.Index != nil && d.IndexLess != nil { d.Index.Initialize(d.IndexLess, d.Keys(nil)) } return d } // Write synchronously writes the key-value pair to disk, making it immediately // available for reads. Write relies on the filesystem to perform an eventual // sync to physical media. If you need stronger guarantees, see WriteStream. func (d *Diskv) Write(key string, val []byte) error { return d.WriteStream(key, bytes.NewBuffer(val), false) } // WriteStream writes the data represented by the io.Reader to the disk, under // the provided key. If sync is true, WriteStream performs an explicit sync on // the file as soon as it's written. // // bytes.Buffer provides io.Reader semantics for basic data types. func (d *Diskv) WriteStream(key string, r io.Reader, sync bool) error { if len(key) <= 0 { return errEmptyKey } d.mu.Lock() defer d.mu.Unlock() return d.writeStreamWithLock(key, r, sync) } // createKeyFileWithLock either creates the key file directly, or // creates a temporary file in TempDir if it is set. func (d *Diskv) createKeyFileWithLock(key string) (*os.File, error) { if d.TempDir != "" { if err := os.MkdirAll(d.TempDir, d.PathPerm); err != nil { return nil, fmt.Errorf("temp mkdir: %s", err) } f, err := ioutil.TempFile(d.TempDir, "") if err != nil { return nil, fmt.Errorf("temp file: %s", err) } if err := f.Chmod(d.FilePerm); err != nil { f.Close() // error deliberately ignored os.Remove(f.Name()) // error deliberately ignored return nil, fmt.Errorf("chmod: %s", err) } return f, nil } mode := os.O_WRONLY | os.O_CREATE | os.O_TRUNC // overwrite if exists f, err := os.OpenFile(d.completeFilename(key), mode, d.FilePerm) if err != nil { return nil, fmt.Errorf("open file: %s", err) } return f, nil } // writeStream does no input validation checking. func (d *Diskv) writeStreamWithLock(key string, r io.Reader, sync bool) error { if err := d.ensurePathWithLock(key); err != nil { return fmt.Errorf("ensure path: %s", err) } f, err := d.createKeyFileWithLock(key) if err != nil { return fmt.Errorf("create key file: %s", err) } wc := io.WriteCloser(&nopWriteCloser{f}) if d.Compression != nil { wc, err = d.Compression.Writer(f) if err != nil { f.Close() // error deliberately ignored os.Remove(f.Name()) // error deliberately ignored return fmt.Errorf("compression writer: %s", err) } } if _, err := io.Copy(wc, r); err != nil { f.Close() // error deliberately ignored os.Remove(f.Name()) // error deliberately ignored return fmt.Errorf("i/o copy: %s", err) } if err := wc.Close(); err != nil { f.Close() // error deliberately ignored os.Remove(f.Name()) // error deliberately ignored return fmt.Errorf("compression close: %s", err) } if sync { if err := f.Sync(); err != nil { f.Close() // error deliberately ignored os.Remove(f.Name()) // error deliberately ignored return fmt.Errorf("file sync: %s", err) } } if err := f.Close(); err != nil { return fmt.Errorf("file close: %s", err) } if f.Name() != d.completeFilename(key) { if err := os.Rename(f.Name(), d.completeFilename(key)); err != nil { os.Remove(f.Name()) // error deliberately ignored return fmt.Errorf("rename: %s", err) } } if d.Index != nil { d.Index.Insert(key) } d.bustCacheWithLock(key) // cache only on read return nil } // Import imports the source file into diskv under the destination key. If the // destination key already exists, it's overwritten. If move is true, the // source file is removed after a successful import. func (d *Diskv) Import(srcFilename, dstKey string, move bool) (err error) { if dstKey == "" { return errEmptyKey } if fi, err := os.Stat(srcFilename); err != nil { return err } else if fi.IsDir() { return errImportDirectory } d.mu.Lock() defer d.mu.Unlock() if err := d.ensurePathWithLock(dstKey); err != nil { return fmt.Errorf("ensure path: %s", err) } if move { if err := syscall.Rename(srcFilename, d.completeFilename(dstKey)); err == nil { d.bustCacheWithLock(dstKey) return nil } else if err != syscall.EXDEV { // If it failed due to being on a different device, fall back to copying return err } } f, err := os.Open(srcFilename) if err != nil { return err } defer f.Close() err = d.writeStreamWithLock(dstKey, f, false) if err == nil && move { err = os.Remove(srcFilename) } return err } // Read reads the key and returns the value. // If the key is available in the cache, Read won't touch the disk. // If the key is not in the cache, Read will have the side-effect of // lazily caching the value. func (d *Diskv) Read(key string) ([]byte, error) { rc, err := d.ReadStream(key, false) if err != nil { return []byte{}, err } defer rc.Close() return ioutil.ReadAll(rc) } // ReadStream reads the key and returns the value (data) as an io.ReadCloser. // If the value is cached from a previous read, and direct is false, // ReadStream will use the cached value. Otherwise, it will return a handle to // the file on disk, and cache the data on read. // // If direct is true, ReadStream will lazily delete any cached value for the // key, and return a direct handle to the file on disk. // // If compression is enabled, ReadStream taps into the io.Reader stream prior // to decompression, and caches the compressed data. func (d *Diskv) ReadStream(key string, direct bool) (io.ReadCloser, error) { d.mu.RLock() defer d.mu.RUnlock() if val, ok := d.cache[key]; ok { if !direct { buf := bytes.NewBuffer(val) if d.Compression != nil { return d.Compression.Reader(buf) } return ioutil.NopCloser(buf), nil } go func() { d.mu.Lock() defer d.mu.Unlock() d.uncacheWithLock(key, uint64(len(val))) }() } return d.readWithRLock(key) } // read ignores the cache, and returns an io.ReadCloser representing the // decompressed data for the given key, streamed from the disk. Clients should // acquire a read lock on the Diskv and check the cache themselves before // calling read. func (d *Diskv) readWithRLock(key string) (io.ReadCloser, error) { filename := d.completeFilename(key) fi, err := os.Stat(filename) if err != nil { return nil, err } if fi.IsDir() { return nil, os.ErrNotExist } f, err := os.Open(filename) if err != nil { return nil, err } var r io.Reader if d.CacheSizeMax > 0 { r = newSiphon(f, d, key) } else { r = &closingReader{f} } var rc = io.ReadCloser(ioutil.NopCloser(r)) if d.Compression != nil { rc, err = d.Compression.Reader(r) if err != nil { return nil, err } } return rc, nil } // closingReader provides a Reader that automatically closes the // embedded ReadCloser when it reaches EOF type closingReader struct { rc io.ReadCloser } func (cr closingReader) Read(p []byte) (int, error) { n, err := cr.rc.Read(p) if err == io.EOF { if closeErr := cr.rc.Close(); closeErr != nil { return n, closeErr // close must succeed for Read to succeed } } return n, err } // siphon is like a TeeReader: it copies all data read through it to an // internal buffer, and moves that buffer to the cache at EOF. type siphon struct { f *os.File d *Diskv key string buf *bytes.Buffer } // newSiphon constructs a siphoning reader that represents the passed file. // When a successful series of reads ends in an EOF, the siphon will write // the buffered data to Diskv's cache under the given key. func newSiphon(f *os.File, d *Diskv, key string) io.Reader { return &siphon{ f: f, d: d, key: key, buf: &bytes.Buffer{}, } } // Read implements the io.Reader interface for siphon. func (s *siphon) Read(p []byte) (int, error) { n, err := s.f.Read(p) if err == nil { return s.buf.Write(p[0:n]) // Write must succeed for Read to succeed } if err == io.EOF { s.d.cacheWithoutLock(s.key, s.buf.Bytes()) // cache may fail if closeErr := s.f.Close(); closeErr != nil { return n, closeErr // close must succeed for Read to succeed } return n, err } return n, err } // Erase synchronously erases the given key from the disk and the cache. func (d *Diskv) Erase(key string) error { d.mu.Lock() defer d.mu.Unlock() d.bustCacheWithLock(key) // erase from index if d.Index != nil { d.Index.Delete(key) } // erase from disk filename := d.completeFilename(key) if s, err := os.Stat(filename); err == nil { if s.IsDir() { return errBadKey } if err = os.Remove(filename); err != nil { return err } } else { // Return err as-is so caller can do os.IsNotExist(err). return err } // clean up and return d.pruneDirsWithLock(key) return nil } // EraseAll will delete all of the data from the store, both in the cache and on // the disk. Note that EraseAll doesn't distinguish diskv-related data from non- // diskv-related data. Care should be taken to always specify a diskv base // directory that is exclusively for diskv data. func (d *Diskv) EraseAll() error { d.mu.Lock() defer d.mu.Unlock() d.cache = make(map[string][]byte) d.cacheSize = 0 if d.TempDir != "" { os.RemoveAll(d.TempDir) // errors ignored } return os.RemoveAll(d.BasePath) } // Has returns true if the given key exists. func (d *Diskv) Has(key string) bool { d.mu.Lock() defer d.mu.Unlock() if _, ok := d.cache[key]; ok { return true } filename := d.completeFilename(key) s, err := os.Stat(filename) if err != nil { return false } if s.IsDir() { return false } return true } // Keys returns a channel that will yield every key accessible by the store, // in undefined order. If a cancel channel is provided, closing it will // terminate and close the keys channel. func (d *Diskv) Keys(cancel <-chan struct{}) <-chan string { return d.KeysPrefix("", cancel) } // KeysPrefix returns a channel that will yield every key accessible by the // store with the given prefix, in undefined order. If a cancel channel is // provided, closing it will terminate and close the keys channel. If the // provided prefix is the empty string, all keys will be yielded. func (d *Diskv) KeysPrefix(prefix string, cancel <-chan struct{}) <-chan string { var prepath string if prefix == "" { prepath = d.BasePath } else { prepath = d.pathFor(prefix) } c := make(chan string) go func() { filepath.Walk(prepath, walker(c, prefix, cancel)) close(c) }() return c } // walker returns a function which satisfies the filepath.WalkFunc interface. // It sends every non-directory file entry down the channel c. func walker(c chan<- string, prefix string, cancel <-chan struct{}) filepath.WalkFunc { return func(path string, info os.FileInfo, err error) error { if err != nil { return err } if info.IsDir() || !strings.HasPrefix(info.Name(), prefix) { return nil // "pass" } select { case c <- info.Name(): case <-cancel: return errCanceled } return nil } } // pathFor returns the absolute path for location on the filesystem where the // data for the given key will be stored. func (d *Diskv) pathFor(key string) string { return filepath.Join(d.BasePath, filepath.Join(d.Transform(key)...)) } // ensurePathWithLock is a helper function that generates all necessary // directories on the filesystem for the given key. func (d *Diskv) ensurePathWithLock(key string) error { return os.MkdirAll(d.pathFor(key), d.PathPerm) } // completeFilename returns the absolute path to the file for the given key. func (d *Diskv) completeFilename(key string) string { return filepath.Join(d.pathFor(key), key) } // cacheWithLock attempts to cache the given key-value pair in the store's // cache. It can fail if the value is larger than the cache's maximum size. func (d *Diskv) cacheWithLock(key string, val []byte) error { valueSize := uint64(len(val)) if err := d.ensureCacheSpaceWithLock(valueSize); err != nil { return fmt.Errorf("%s; not caching", err) } // be very strict about memory guarantees if (d.cacheSize + valueSize) > d.CacheSizeMax { panic(fmt.Sprintf("failed to make room for value (%d/%d)", valueSize, d.CacheSizeMax)) } d.cache[key] = val d.cacheSize += valueSize return nil } // cacheWithoutLock acquires the store's (write) mutex and calls cacheWithLock. func (d *Diskv) cacheWithoutLock(key string, val []byte) error { d.mu.Lock() defer d.mu.Unlock() return d.cacheWithLock(key, val) } func (d *Diskv) bustCacheWithLock(key string) { if val, ok := d.cache[key]; ok { d.uncacheWithLock(key, uint64(len(val))) } } func (d *Diskv) uncacheWithLock(key string, sz uint64) { d.cacheSize -= sz delete(d.cache, key) } // pruneDirsWithLock deletes empty directories in the path walk leading to the // key k. Typically this function is called after an Erase is made. func (d *Diskv) pruneDirsWithLock(key string) error { pathlist := d.Transform(key) for i := range pathlist { dir := filepath.Join(d.BasePath, filepath.Join(pathlist[:len(pathlist)-i]...)) // thanks to Steven Blenkinsop for this snippet switch fi, err := os.Stat(dir); true { case err != nil: return err case !fi.IsDir(): panic(fmt.Sprintf("corrupt dirstate at %s", dir)) } nlinks, err := filepath.Glob(filepath.Join(dir, "*")) if err != nil { return err } else if len(nlinks) > 0 { return nil // has subdirs -- do not prune } if err = os.Remove(dir); err != nil { return err } } return nil } // ensureCacheSpaceWithLock deletes entries from the cache in arbitrary order // until the cache has at least valueSize bytes available. func (d *Diskv) ensureCacheSpaceWithLock(valueSize uint64) error { if valueSize > d.CacheSizeMax { return fmt.Errorf("value size (%d bytes) too large for cache (%d bytes)", valueSize, d.CacheSizeMax) } safe := func() bool { return (d.cacheSize + valueSize) <= d.CacheSizeMax } for key, val := range d.cache { if safe() { break } d.uncacheWithLock(key, uint64(len(val))) } if !safe() { panic(fmt.Sprintf("%d bytes still won't fit in the cache! (max %d bytes)", valueSize, d.CacheSizeMax)) } return nil } // nopWriteCloser wraps an io.Writer and provides a no-op Close method to // satisfy the io.WriteCloser interface. type nopWriteCloser struct { io.Writer } func (wc *nopWriteCloser) Write(p []byte) (int, error) { return wc.Writer.Write(p) } func (wc *nopWriteCloser) Close() error { return nil } ================================================ FILE: vendor/github.com/peterbourgon/diskv/index.go ================================================ package diskv import ( "sync" "github.com/google/btree" ) // Index is a generic interface for things that can // provide an ordered list of keys. type Index interface { Initialize(less LessFunction, keys <-chan string) Insert(key string) Delete(key string) Keys(from string, n int) []string } // LessFunction is used to initialize an Index of keys in a specific order. type LessFunction func(string, string) bool // btreeString is a custom data type that satisfies the BTree Less interface, // making the strings it wraps sortable by the BTree package. type btreeString struct { s string l LessFunction } // Less satisfies the BTree.Less interface using the btreeString's LessFunction. func (s btreeString) Less(i btree.Item) bool { return s.l(s.s, i.(btreeString).s) } // BTreeIndex is an implementation of the Index interface using google/btree. type BTreeIndex struct { sync.RWMutex LessFunction *btree.BTree } // Initialize populates the BTree tree with data from the keys channel, // according to the passed less function. It's destructive to the BTreeIndex. func (i *BTreeIndex) Initialize(less LessFunction, keys <-chan string) { i.Lock() defer i.Unlock() i.LessFunction = less i.BTree = rebuild(less, keys) } // Insert inserts the given key (only) into the BTree tree. func (i *BTreeIndex) Insert(key string) { i.Lock() defer i.Unlock() if i.BTree == nil || i.LessFunction == nil { panic("uninitialized index") } i.BTree.ReplaceOrInsert(btreeString{s: key, l: i.LessFunction}) } // Delete removes the given key (only) from the BTree tree. func (i *BTreeIndex) Delete(key string) { i.Lock() defer i.Unlock() if i.BTree == nil || i.LessFunction == nil { panic("uninitialized index") } i.BTree.Delete(btreeString{s: key, l: i.LessFunction}) } // Keys yields a maximum of n keys in order. If the passed 'from' key is empty, // Keys will return the first n keys. If the passed 'from' key is non-empty, the // first key in the returned slice will be the key that immediately follows the // passed key, in key order. func (i *BTreeIndex) Keys(from string, n int) []string { i.RLock() defer i.RUnlock() if i.BTree == nil || i.LessFunction == nil { panic("uninitialized index") } if i.BTree.Len() <= 0 { return []string{} } btreeFrom := btreeString{s: from, l: i.LessFunction} skipFirst := true if len(from) <= 0 || !i.BTree.Has(btreeFrom) { // no such key, so fabricate an always-smallest item btreeFrom = btreeString{s: "", l: func(string, string) bool { return true }} skipFirst = false } keys := []string{} iterator := func(i btree.Item) bool { keys = append(keys, i.(btreeString).s) return len(keys) < n } i.BTree.AscendGreaterOrEqual(btreeFrom, iterator) if skipFirst && len(keys) > 0 { keys = keys[1:] } return keys } // rebuildIndex does the work of regenerating the index // with the given keys. func rebuild(less LessFunction, keys <-chan string) *btree.BTree { tree := btree.New(2) for key := range keys { tree.ReplaceOrInsert(btreeString{s: key, l: less}) } return tree } ================================================ FILE: vendor/github.com/spf13/cobra/.gitignore ================================================ # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go # Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore # swap [._]*.s[a-w][a-z] [._]s[a-w][a-z] # session Session.vim # temporary .netrwhist *~ # auto-generated tag files tags *.exe cobra.test ================================================ FILE: vendor/github.com/spf13/cobra/.mailmap ================================================ Steve Francia Bjørn Erik Pedersen Fabiano Franz ================================================ FILE: vendor/github.com/spf13/cobra/.travis.yml ================================================ language: go matrix: include: - go: 1.7.5 - go: 1.8.1 - go: tip allow_failures: - go: tip before_install: - mkdir -p bin - curl -Lso bin/shellcheck https://github.com/caarlos0/shellcheck-docker/releases/download/v0.4.3/shellcheck - chmod +x bin/shellcheck script: - PATH=$PATH:$PWD/bin go test -v ./... - go build - diff -u <(echo -n) <(gofmt -d -s .) - if [ -z $NOVET ]; then diff -u <(echo -n) <(go tool vet . 2>&1 | grep -vE 'ExampleCommand|bash_completions.*Fprint'); fi ================================================ FILE: vendor/github.com/spf13/cobra/LICENSE.txt ================================================ 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. ================================================ FILE: vendor/github.com/spf13/cobra/README.md ================================================ ![cobra logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png) Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files. Many of the most widely used Go projects are built using Cobra including: * [Kubernetes](http://kubernetes.io/) * [Hugo](http://gohugo.io) * [rkt](https://github.com/coreos/rkt) * [etcd](https://github.com/coreos/etcd) * [Moby (former Docker)](https://github.com/moby/moby) * [Docker (distribution)](https://github.com/docker/distribution) * [OpenShift](https://www.openshift.com/) * [Delve](https://github.com/derekparker/delve) * [GopherJS](http://www.gopherjs.org/) * [CockroachDB](http://www.cockroachlabs.com/) * [Bleve](http://www.blevesearch.com/) * [ProjectAtomic (enterprise)](http://www.projectatomic.io/) * [GiantSwarm's swarm](https://github.com/giantswarm/cli) * [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack) * [rclone](http://rclone.org/) [![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra) [![CircleCI status](https://circleci.com/gh/spf13/cobra.png?circle-token=:circle-token "CircleCI status")](https://circleci.com/gh/spf13/cobra) [![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra) ![cobra](https://cloud.githubusercontent.com/assets/173412/10911369/84832a8e-8212-11e5-9f82-cc96660a4794.gif) # Overview Cobra is a library providing a simple interface to create powerful modern CLI interfaces similar to git & go tools. Cobra is also an application that will generate your application scaffolding to rapidly develop a Cobra-based application. Cobra provides: * Easy subcommand-based CLIs: `app server`, `app fetch`, etc. * Fully POSIX-compliant flags (including short & long versions) * Nested subcommands * Global, local and cascading flags * Easy generation of applications & commands with `cobra init appname` & `cobra add cmdname` * Intelligent suggestions (`app srver`... did you mean `app server`?) * Automatic help generation for commands and flags * Automatic detailed help for `app help [command]` * Automatic help flag recognition of `-h`, `--help`, etc. * Automatically generated bash autocomplete for your application * Automatically generated man pages for your application * Command aliases so you can change things without breaking them * The flexibility to define your own help, usage, etc. * Optional tight integration with [viper](http://github.com/spf13/viper) for 12-factor apps Cobra has an exceptionally clean interface and simple design without needless constructors or initialization methods. Applications built with Cobra commands are designed to be as user-friendly as possible. Flags can be placed before or after the command (as long as a confusing space isn’t provided). Both short and long flags can be used. A command need not even be fully typed. Help is automatically generated and available for the application or for a specific command using either the help command or the `--help` flag. # Concepts Cobra is built on a structure of commands, arguments & flags. **Commands** represent actions, **Args** are things and **Flags** are modifiers for those actions. The best applications will read like sentences when used. Users will know how to use the application because they will natively understand how to use it. The pattern to follow is `APPNAME VERB NOUN --ADJECTIVE.` or `APPNAME COMMAND ARG --FLAG` A few good real world examples may better illustrate this point. In the following example, 'server' is a command, and 'port' is a flag: hugo server --port=1313 In this command we are telling Git to clone the url bare. git clone URL --bare ## Commands Command is the central point of the application. Each interaction that the application supports will be contained in a Command. A command can have children commands and optionally run an action. In the example above, 'server' is the command. A Command has the following structure: ```go type Command struct { Use string // The one-line usage message. Short string // The short description shown in the 'help' output. Long string // The long message shown in the 'help ' output. Run func(cmd *Command, args []string) // Run runs the command. } ``` ## Flags A Flag is a way to modify the behavior of a command. Cobra supports fully POSIX-compliant flags as well as the Go [flag package](https://golang.org/pkg/flag/). A Cobra command can define flags that persist through to children commands and flags that are only available to that command. In the example above, 'port' is the flag. Flag functionality is provided by the [pflag library](https://github.com/spf13/pflag), a fork of the flag standard library which maintains the same interface while adding POSIX compliance. ## Usage Cobra works by creating a set of commands and then organizing them into a tree. The tree defines the structure of the application. Once each command is defined with its corresponding flags, then the tree is assigned to the commander which is finally executed. # Installing Using Cobra is easy. First, use `go get` to install the latest version of the library. This command will install the `cobra` generator executible along with the library: go get -v github.com/spf13/cobra/cobra Next, include Cobra in your application: ```go import "github.com/spf13/cobra" ``` # Getting Started While you are welcome to provide your own organization, typically a Cobra based application will follow the following organizational structure. ``` ▾ appName/ ▾ cmd/ add.go your.go commands.go here.go main.go ``` In a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra. ```go package main import ( "fmt" "os" "{pathToYourApp}/cmd" ) func main() { if err := cmd.RootCmd.Execute(); err != nil { fmt.Println(err) os.Exit(1) } } ``` ## Using the Cobra Generator Cobra provides its own program that will create your application and add any commands you want. It's the easiest way to incorporate Cobra into your application. In order to use the cobra command, compile it using the following command: go get github.com/spf13/cobra/cobra This will create the cobra executable under your `$GOPATH/bin` directory. ### cobra init The `cobra init [yourApp]` command will create your initial application code for you. It is a very powerful application that will populate your program with the right structure so you can immediately enjoy all the benefits of Cobra. It will also automatically apply the license you specify to your application. Cobra init is pretty smart. You can provide it a full path, or simply a path similar to what is expected in the import. ``` cobra init github.com/spf13/newAppName ``` ### cobra add Once an application is initialized Cobra can create additional commands for you. Let's say you created an app and you wanted the following commands for it: * app serve * app config * app config create In your project directory (where your main.go file is) you would run the following: ``` cobra add serve cobra add config cobra add create -p 'configCmd' ``` *Note: Use camelCase (not snake_case/snake-case) for command names. Otherwise, you will become unexpected errors. For example, `cobra add add-user` is incorrect, but `cobra add addUser` is valid.* Once you have run these three commands you would have an app structure that would look like: ``` ▾ app/ ▾ cmd/ serve.go config.go create.go main.go ``` at this point you can run `go run main.go` and it would run your app. `go run main.go serve`, `go run main.go config`, `go run main.go config create` along with `go run main.go help serve`, etc would all work. Obviously you haven't added your own code to these yet, the commands are ready for you to give them their tasks. Have fun. ### Configuring the cobra generator The cobra generator will be easier to use if you provide a simple configuration file which will help you eliminate providing a bunch of repeated information in flags over and over. An example ~/.cobra.yaml file: ```yaml author: Steve Francia license: MIT ``` You can specify no license by setting `license` to `none` or you can specify a custom license: ```yaml license: header: This file is part of {{ .appName }}. text: | {{ .copyright }} This is my license. There are many like it, but this one is mine. My license is my best friend. It is my life. I must master it as I must master my life. ``` You can also use built-in licenses. For example, **GPLv2**, **GPLv3**, **LGPL**, **AGPL**, **MIT**, **2-Clause BSD** or **3-Clause BSD**. ## Manually implementing Cobra To manually implement cobra you need to create a bare main.go file and a RootCmd file. You will optionally provide additional commands as you see fit. ### Create the root command The root command represents your binary itself. #### Manually create rootCmd Cobra doesn't require any special constructors. Simply create your commands. Ideally you place this in app/cmd/root.go: ```go var RootCmd = &cobra.Command{ Use: "hugo", Short: "Hugo is a very fast static site generator", Long: `A Fast and Flexible Static Site Generator built with love by spf13 and friends in Go. Complete documentation is available at http://hugo.spf13.com`, Run: func(cmd *cobra.Command, args []string) { // Do Stuff Here }, } ``` You will additionally define flags and handle configuration in your init() function. for example cmd/root.go: ```go func init() { cobra.OnInitialize(initConfig) RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)") RootCmd.PersistentFlags().StringVarP(&projectBase, "projectbase", "b", "", "base project directory eg. github.com/spf13/") RootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "Author name for copyright attribution") RootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "Name of license for the project (can provide `licensetext` in config)") RootCmd.PersistentFlags().Bool("viper", true, "Use Viper for configuration") viper.BindPFlag("author", RootCmd.PersistentFlags().Lookup("author")) viper.BindPFlag("projectbase", RootCmd.PersistentFlags().Lookup("projectbase")) viper.BindPFlag("useViper", RootCmd.PersistentFlags().Lookup("viper")) viper.SetDefault("author", "NAME HERE ") viper.SetDefault("license", "apache") } ``` ### Create your main.go With the root command you need to have your main function execute it. Execute should be run on the root for clarity, though it can be called on any command. In a Cobra app, typically the main.go file is very bare. It serves, one purpose, to initialize Cobra. ```go package main import ( "fmt" "os" "{pathToYourApp}/cmd" ) func main() { if err := cmd.RootCmd.Execute(); err != nil { fmt.Println(err) os.Exit(1) } } ``` ### Create additional commands Additional commands can be defined and typically are each given their own file inside of the cmd/ directory. If you wanted to create a version command you would create cmd/version.go and populate it with the following: ```go package cmd import ( "github.com/spf13/cobra" "fmt" ) func init() { RootCmd.AddCommand(versionCmd) } var versionCmd = &cobra.Command{ Use: "version", Short: "Print the version number of Hugo", Long: `All software has versions. This is Hugo's`, Run: func(cmd *cobra.Command, args []string) { fmt.Println("Hugo Static Site Generator v0.9 -- HEAD") }, } ``` ### Attach command to its parent If you notice in the above example we attach the command to its parent. In this case the parent is the rootCmd. In this example we are attaching it to the root, but commands can be attached at any level. ```go RootCmd.AddCommand(versionCmd) ``` ### Remove a command from its parent Removing a command is not a common action in simple programs, but it allows 3rd parties to customize an existing command tree. In this example, we remove the existing `VersionCmd` command of an existing root command, and we replace it with our own version: ```go mainlib.RootCmd.RemoveCommand(mainlib.VersionCmd) mainlib.RootCmd.AddCommand(versionCmd) ``` ## Working with Flags Flags provide modifiers to control how the action command operates. ### Assign flags to a command Since the flags are defined and used in different locations, we need to define a variable outside with the correct scope to assign the flag to work with. ```go var Verbose bool var Source string ``` There are two different approaches to assign a flag. ### Persistent Flags A flag can be 'persistent' meaning that this flag will be available to the command it's assigned to as well as every command under that command. For global flags, assign a flag as a persistent flag on the root. ```go RootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output") ``` ### Local Flags A flag can also be assigned locally which will only apply to that specific command. ```go RootCmd.Flags().StringVarP(&Source, "source", "s", "", "Source directory to read from") ``` ## Example In the example below, we have defined three commands. Two are at the top level and one (cmdTimes) is a child of one of the top commands. In this case the root is not executable meaning that a subcommand is required. This is accomplished by not providing a 'Run' for the 'rootCmd'. We have only defined one flag for a single command. More documentation about flags is available at https://github.com/spf13/pflag ```go package main import ( "fmt" "strings" "github.com/spf13/cobra" ) func main() { var echoTimes int var cmdPrint = &cobra.Command{ Use: "print [string to print]", Short: "Print anything to the screen", Long: `print is for printing anything back to the screen. For many years people have printed back to the screen. `, Run: func(cmd *cobra.Command, args []string) { fmt.Println("Print: " + strings.Join(args, " ")) }, } var cmdEcho = &cobra.Command{ Use: "echo [string to echo]", Short: "Echo anything to the screen", Long: `echo is for echoing anything back. Echo works a lot like print, except it has a child command. `, Run: func(cmd *cobra.Command, args []string) { fmt.Println("Print: " + strings.Join(args, " ")) }, } var cmdTimes = &cobra.Command{ Use: "times [# times] [string to echo]", Short: "Echo anything to the screen more times", Long: `echo things multiple times back to the user by providing a count and a string.`, Run: func(cmd *cobra.Command, args []string) { for i := 0; i < echoTimes; i++ { fmt.Println("Echo: " + strings.Join(args, " ")) } }, } cmdTimes.Flags().IntVarP(&echoTimes, "times", "t", 1, "times to echo the input") var rootCmd = &cobra.Command{Use: "app"} rootCmd.AddCommand(cmdPrint, cmdEcho) cmdEcho.AddCommand(cmdTimes) rootCmd.Execute() } ``` For a more complete example of a larger application, please checkout [Hugo](http://gohugo.io/). ## The Help Command Cobra automatically adds a help command to your application when you have subcommands. This will be called when a user runs 'app help'. Additionally, help will also support all other commands as input. Say, for instance, you have a command called 'create' without any additional configuration; Cobra will work when 'app help create' is called. Every command will automatically have the '--help' flag added. ### Example The following output is automatically generated by Cobra. Nothing beyond the command and flag definitions are needed. > hugo help hugo is the main command, used to build your Hugo site. Hugo is a Fast and Flexible Static Site Generator built with love by spf13 and friends in Go. Complete documentation is available at http://gohugo.io/. Usage: hugo [flags] hugo [command] Available Commands: server Hugo runs its own webserver to render the files version Print the version number of Hugo config Print the site configuration check Check content in the source directory benchmark Benchmark hugo by building a site a number of times. convert Convert your content to different formats new Create new content for your site list Listing out various types of content undraft Undraft changes the content's draft status from 'True' to 'False' genautocomplete Generate shell autocompletion script for Hugo gendoc Generate Markdown documentation for the Hugo CLI. genman Generate man page for Hugo import Import your site from others. Flags: -b, --baseURL="": hostname (and path) to the root, e.g. http://spf13.com/ -D, --buildDrafts[=false]: include content marked as draft -F, --buildFuture[=false]: include content with publishdate in the future --cacheDir="": filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ --canonifyURLs[=false]: if true, all relative URLs will be canonicalized using baseURL --config="": config file (default is path/config.yaml|json|toml) -d, --destination="": filesystem path to write files to --disableRSS[=false]: Do not build RSS files --disableSitemap[=false]: Do not build Sitemap file --editor="": edit new content with this editor, if provided --ignoreCache[=false]: Ignores the cache directory for reading but still writes to it --log[=false]: Enable Logging --logFile="": Log File path (if set, logging enabled automatically) --noTimes[=false]: Don't sync modification time of files --pluralizeListTitles[=true]: Pluralize titles in lists using inflect --preserveTaxonomyNames[=false]: Preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu") -s, --source="": filesystem path to read files relative from --stepAnalysis[=false]: display memory and timing of different steps of the program -t, --theme="": theme to use (located in /themes/THEMENAME/) --uglyURLs[=false]: if true, use /filename.html instead of /filename/ -v, --verbose[=false]: verbose output --verboseLog[=false]: verbose logging -w, --watch[=false]: watch filesystem for changes and recreate as needed Use "hugo [command] --help" for more information about a command. Help is just a command like any other. There is no special logic or behavior around it. In fact, you can provide your own if you want. ### Defining your own help You can provide your own Help command or your own template for the default command to use. The default help command is ```go func (c *Command) initHelp() { if c.helpCommand == nil { c.helpCommand = &Command{ Use: "help [command]", Short: "Help about any command", Long: `Help provides help for any command in the application. Simply type ` + c.Name() + ` help [path to command] for full details.`, Run: c.HelpFunc(), } } c.AddCommand(c.helpCommand) } ``` You can provide your own command, function or template through the following methods: ```go command.SetHelpCommand(cmd *Command) command.SetHelpFunc(f func(*Command, []string)) command.SetHelpTemplate(s string) ``` The latter two will also apply to any children commands. ## Usage When the user provides an invalid flag or invalid command, Cobra responds by showing the user the 'usage'. ### Example You may recognize this from the help above. That's because the default help embeds the usage as part of its output. Usage: hugo [flags] hugo [command] Available Commands: server Hugo runs its own webserver to render the files version Print the version number of Hugo config Print the site configuration check Check content in the source directory benchmark Benchmark hugo by building a site a number of times. convert Convert your content to different formats new Create new content for your site list Listing out various types of content undraft Undraft changes the content's draft status from 'True' to 'False' genautocomplete Generate shell autocompletion script for Hugo gendoc Generate Markdown documentation for the Hugo CLI. genman Generate man page for Hugo import Import your site from others. Flags: -b, --baseURL="": hostname (and path) to the root, e.g. http://spf13.com/ -D, --buildDrafts[=false]: include content marked as draft -F, --buildFuture[=false]: include content with publishdate in the future --cacheDir="": filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/ --canonifyURLs[=false]: if true, all relative URLs will be canonicalized using baseURL --config="": config file (default is path/config.yaml|json|toml) -d, --destination="": filesystem path to write files to --disableRSS[=false]: Do not build RSS files --disableSitemap[=false]: Do not build Sitemap file --editor="": edit new content with this editor, if provided --ignoreCache[=false]: Ignores the cache directory for reading but still writes to it --log[=false]: Enable Logging --logFile="": Log File path (if set, logging enabled automatically) --noTimes[=false]: Don't sync modification time of files --pluralizeListTitles[=true]: Pluralize titles in lists using inflect --preserveTaxonomyNames[=false]: Preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu") -s, --source="": filesystem path to read files relative from --stepAnalysis[=false]: display memory and timing of different steps of the program -t, --theme="": theme to use (located in /themes/THEMENAME/) --uglyURLs[=false]: if true, use /filename.html instead of /filename/ -v, --verbose[=false]: verbose output --verboseLog[=false]: verbose logging -w, --watch[=false]: watch filesystem for changes and recreate as needed ### Defining your own usage You can provide your own usage function or template for Cobra to use. The default usage function is: ```go return func(c *Command) error { err := tmpl(c.Out(), c.UsageTemplate(), c) return err } ``` Like help, the function and template are overridable through public methods: ```go command.SetUsageFunc(f func(*Command) error) command.SetUsageTemplate(s string) ``` ## PreRun or PostRun Hooks It is possible to run functions before or after the main `Run` function of your command. The `PersistentPreRun` and `PreRun` functions will be executed before `Run`. `PersistentPostRun` and `PostRun` will be executed after `Run`. The `Persistent*Run` functions will be inherited by children if they do not declare their own. These functions are run in the following order: - `PersistentPreRun` - `PreRun` - `Run` - `PostRun` - `PersistentPostRun` An example of two commands which use all of these features is below. When the subcommand is executed, it will run the root command's `PersistentPreRun` but not the root command's `PersistentPostRun`: ```go package main import ( "fmt" "github.com/spf13/cobra" ) func main() { var rootCmd = &cobra.Command{ Use: "root [sub]", Short: "My root command", PersistentPreRun: func(cmd *cobra.Command, args []string) { fmt.Printf("Inside rootCmd PersistentPreRun with args: %v\n", args) }, PreRun: func(cmd *cobra.Command, args []string) { fmt.Printf("Inside rootCmd PreRun with args: %v\n", args) }, Run: func(cmd *cobra.Command, args []string) { fmt.Printf("Inside rootCmd Run with args: %v\n", args) }, PostRun: func(cmd *cobra.Command, args []string) { fmt.Printf("Inside rootCmd PostRun with args: %v\n", args) }, PersistentPostRun: func(cmd *cobra.Command, args []string) { fmt.Printf("Inside rootCmd PersistentPostRun with args: %v\n", args) }, } var subCmd = &cobra.Command{ Use: "sub [no options!]", Short: "My subcommand", PreRun: func(cmd *cobra.Command, args []string) { fmt.Printf("Inside subCmd PreRun with args: %v\n", args) }, Run: func(cmd *cobra.Command, args []string) { fmt.Printf("Inside subCmd Run with args: %v\n", args) }, PostRun: func(cmd *cobra.Command, args []string) { fmt.Printf("Inside subCmd PostRun with args: %v\n", args) }, PersistentPostRun: func(cmd *cobra.Command, args []string) { fmt.Printf("Inside subCmd PersistentPostRun with args: %v\n", args) }, } rootCmd.AddCommand(subCmd) rootCmd.SetArgs([]string{""}) _ = rootCmd.Execute() fmt.Print("\n") rootCmd.SetArgs([]string{"sub", "arg1", "arg2"}) _ = rootCmd.Execute() } ``` ## Alternative Error Handling Cobra also has functions where the return signature is an error. This allows for errors to bubble up to the top, providing a way to handle the errors in one location. The current list of functions that return an error is: * PersistentPreRunE * PreRunE * RunE * PostRunE * PersistentPostRunE If you would like to silence the default `error` and `usage` output in favor of your own, you can set `SilenceUsage` and `SilenceErrors` to `true` on the command. A child command respects these flags if they are set on the parent command. **Example Usage using RunE:** ```go package main import ( "errors" "log" "github.com/spf13/cobra" ) func main() { var rootCmd = &cobra.Command{ Use: "hugo", Short: "Hugo is a very fast static site generator", Long: `A Fast and Flexible Static Site Generator built with love by spf13 and friends in Go. Complete documentation is available at http://hugo.spf13.com`, RunE: func(cmd *cobra.Command, args []string) error { // Do Stuff Here return errors.New("some random error") }, } if err := rootCmd.Execute(); err != nil { log.Fatal(err) } } ``` ## Suggestions when "unknown command" happens Cobra will print automatic suggestions when "unknown command" errors happen. This allows Cobra to behave similarly to the `git` command when a typo happens. For example: ``` $ hugo srever Error: unknown command "srever" for "hugo" Did you mean this? server Run 'hugo --help' for usage. ``` Suggestions are automatic based on every subcommand registered and use an implementation of [Levenshtein distance](http://en.wikipedia.org/wiki/Levenshtein_distance). Every registered command that matches a minimum distance of 2 (ignoring case) will be displayed as a suggestion. If you need to disable suggestions or tweak the string distance in your command, use: ```go command.DisableSuggestions = true ``` or ```go command.SuggestionsMinimumDistance = 1 ``` You can also explicitly set names for which a given command will be suggested using the `SuggestFor` attribute. This allows suggestions for strings that are not close in terms of string distance, but makes sense in your set of commands and for some which you don't want aliases. Example: ``` $ kubectl remove Error: unknown command "remove" for "kubectl" Did you mean this? delete Run 'kubectl help' for usage. ``` ## Generating Markdown-formatted documentation for your command Cobra can generate a Markdown-formatted document based on the subcommands, flags, etc. A simple example of how to do this for your command can be found in [Markdown Docs](doc/md_docs.md). ## Generating man pages for your command Cobra can generate a man page based on the subcommands, flags, etc. A simple example of how to do this for your command can be found in [Man Docs](doc/man_docs.md). ## Generating bash completions for your command Cobra can generate a bash-completion file. If you add more information to your command, these completions can be amazingly powerful and flexible. Read more about it in [Bash Completions](bash_completions.md). ## Debugging Cobra provides a ‘DebugFlags’ method on a command which, when called, will print out everything Cobra knows about the flags for each command. ### Example ```go command.DebugFlags() ``` ## Extensions Libraries for extending Cobra: * [cmdns](https://github.com/gosuri/cmdns): Enables name spacing a command's immediate children. It provides an alternative way to structure subcommands, similar to `heroku apps:create` and `ovrclk clusters:launch`. ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request ## Contributors Names in no particular order: * [spf13](https://github.com/spf13), [eparis](https://github.com/eparis), [bep](https://github.com/bep), and many more! ## License Cobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt) ================================================ FILE: vendor/github.com/spf13/cobra/bash_completions.go ================================================ package cobra import ( "fmt" "io" "os" "sort" "strings" "github.com/spf13/pflag" ) // Annotations for Bash completion. const ( BashCompFilenameExt = "cobra_annotation_bash_completion_filename_extensions" BashCompCustom = "cobra_annotation_bash_completion_custom" BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required_flag" BashCompSubdirsInDir = "cobra_annotation_bash_completion_subdirs_in_dir" ) func preamble(out io.Writer, name string) error { _, err := fmt.Fprintf(out, "# bash completion for %-36s -*- shell-script -*-\n", name) if err != nil { return err } preamStr := ` __debug() { if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then echo "$*" >> "${BASH_COMP_DEBUG_FILE}" fi } # Homebrew on Macs have version 1.3 of bash-completion which doesn't include # _init_completion. This is a very minimal version of that function. __my_init_completion() { COMPREPLY=() _get_comp_words_by_ref "$@" cur prev words cword } __index_of_word() { local w word=$1 shift index=0 for w in "$@"; do [[ $w = "$word" ]] && return index=$((index+1)) done index=-1 } __contains_word() { local w word=$1; shift for w in "$@"; do [[ $w = "$word" ]] && return done return 1 } __handle_reply() { __debug "${FUNCNAME[0]}" case $cur in -*) if [[ $(type -t compopt) = "builtin" ]]; then compopt -o nospace fi local allflags if [ ${#must_have_one_flag[@]} -ne 0 ]; then allflags=("${must_have_one_flag[@]}") else allflags=("${flags[*]} ${two_word_flags[*]}") fi COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") ) if [[ $(type -t compopt) = "builtin" ]]; then [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace fi # complete after --flag=abc if [[ $cur == *=* ]]; then if [[ $(type -t compopt) = "builtin" ]]; then compopt +o nospace fi local index flag flag="${cur%%=*}" __index_of_word "${flag}" "${flags_with_completion[@]}" COMPREPLY=() if [[ ${index} -ge 0 ]]; then PREFIX="" cur="${cur#*=}" ${flags_completion[${index}]} if [ -n "${ZSH_VERSION}" ]; then # zfs completion needs --flag= prefix eval "COMPREPLY=( \"\${COMPREPLY[@]/#/${flag}=}\" )" fi fi fi return 0; ;; esac # check if we are handling a flag with special work handling local index __index_of_word "${prev}" "${flags_with_completion[@]}" if [[ ${index} -ge 0 ]]; then ${flags_completion[${index}]} return fi # we are parsing a flag and don't have a special handler, no completion if [[ ${cur} != "${words[cword]}" ]]; then return fi local completions completions=("${commands[@]}") if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then completions=("${must_have_one_noun[@]}") fi if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then completions+=("${must_have_one_flag[@]}") fi COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") ) if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then COMPREPLY=( $(compgen -W "${noun_aliases[*]}" -- "$cur") ) fi if [[ ${#COMPREPLY[@]} -eq 0 ]]; then declare -F __custom_func >/dev/null && __custom_func fi __ltrim_colon_completions "$cur" } # The arguments should be in the form "ext1|ext2|extn" __handle_filename_extension_flag() { local ext="$1" _filedir "@(${ext})" } __handle_subdirs_in_dir_flag() { local dir="$1" pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 } __handle_flag() { __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" # if a command required a flag, and we found it, unset must_have_one_flag() local flagname=${words[c]} local flagvalue # if the word contained an = if [[ ${words[c]} == *"="* ]]; then flagvalue=${flagname#*=} # take in as flagvalue after the = flagname=${flagname%%=*} # strip everything after the = flagname="${flagname}=" # but put the = back fi __debug "${FUNCNAME[0]}: looking for ${flagname}" if __contains_word "${flagname}" "${must_have_one_flag[@]}"; then must_have_one_flag=() fi # if you set a flag which only applies to this command, don't show subcommands if __contains_word "${flagname}" "${local_nonpersistent_flags[@]}"; then commands=() fi # keep flag value with flagname as flaghash if [ -n "${flagvalue}" ] ; then flaghash[${flagname}]=${flagvalue} elif [ -n "${words[ $((c+1)) ]}" ] ; then flaghash[${flagname}]=${words[ $((c+1)) ]} else flaghash[${flagname}]="true" # pad "true" for bool flag fi # skip the argument to a two word flag if __contains_word "${words[c]}" "${two_word_flags[@]}"; then c=$((c+1)) # if we are looking for a flags value, don't show commands if [[ $c -eq $cword ]]; then commands=() fi fi c=$((c+1)) } __handle_noun() { __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" if __contains_word "${words[c]}" "${must_have_one_noun[@]}"; then must_have_one_noun=() elif __contains_word "${words[c]}" "${noun_aliases[@]}"; then must_have_one_noun=() fi nouns+=("${words[c]}") c=$((c+1)) } __handle_command() { __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" local next_command if [[ -n ${last_command} ]]; then next_command="_${last_command}_${words[c]//:/__}" else if [[ $c -eq 0 ]]; then next_command="_$(basename "${words[c]//:/__}")" else next_command="_${words[c]//:/__}" fi fi c=$((c+1)) __debug "${FUNCNAME[0]}: looking for ${next_command}" declare -F "$next_command" >/dev/null && $next_command } __handle_word() { if [[ $c -ge $cword ]]; then __handle_reply return fi __debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" if [[ "${words[c]}" == -* ]]; then __handle_flag elif __contains_word "${words[c]}" "${commands[@]}"; then __handle_command elif [[ $c -eq 0 ]] && __contains_word "$(basename "${words[c]}")" "${commands[@]}"; then __handle_command else __handle_noun fi __handle_word } ` _, err = fmt.Fprint(out, preamStr) return err } func postscript(w io.Writer, name string) error { name = strings.Replace(name, ":", "__", -1) _, err := fmt.Fprintf(w, "__start_%s()\n", name) if err != nil { return err } _, err = fmt.Fprintf(w, `{ local cur prev words cword declare -A flaghash 2>/dev/null || : if declare -F _init_completion >/dev/null 2>&1; then _init_completion -s || return else __my_init_completion -n "=" || return fi local c=0 local flags=() local two_word_flags=() local local_nonpersistent_flags=() local flags_with_completion=() local flags_completion=() local commands=("%s") local must_have_one_flag=() local must_have_one_noun=() local last_command local nouns=() __handle_word } `, name) if err != nil { return err } _, err = fmt.Fprintf(w, `if [[ $(type -t compopt) = "builtin" ]]; then complete -o default -F __start_%s %s else complete -o default -o nospace -F __start_%s %s fi `, name, name, name, name) if err != nil { return err } _, err = fmt.Fprintf(w, "# ex: ts=4 sw=4 et filetype=sh\n") return err } func writeCommands(cmd *Command, w io.Writer) error { if _, err := fmt.Fprintf(w, " commands=()\n"); err != nil { return err } for _, c := range cmd.Commands() { if !c.IsAvailableCommand() || c == cmd.helpCommand { continue } if _, err := fmt.Fprintf(w, " commands+=(%q)\n", c.Name()); err != nil { return err } } _, err := fmt.Fprintf(w, "\n") return err } func writeFlagHandler(name string, annotations map[string][]string, w io.Writer) error { for key, value := range annotations { switch key { case BashCompFilenameExt: _, err := fmt.Fprintf(w, " flags_with_completion+=(%q)\n", name) if err != nil { return err } if len(value) > 0 { ext := "__handle_filename_extension_flag " + strings.Join(value, "|") _, err = fmt.Fprintf(w, " flags_completion+=(%q)\n", ext) } else { ext := "_filedir" _, err = fmt.Fprintf(w, " flags_completion+=(%q)\n", ext) } if err != nil { return err } case BashCompCustom: _, err := fmt.Fprintf(w, " flags_with_completion+=(%q)\n", name) if err != nil { return err } if len(value) > 0 { handlers := strings.Join(value, "; ") _, err = fmt.Fprintf(w, " flags_completion+=(%q)\n", handlers) } else { _, err = fmt.Fprintf(w, " flags_completion+=(:)\n") } if err != nil { return err } case BashCompSubdirsInDir: _, err := fmt.Fprintf(w, " flags_with_completion+=(%q)\n", name) if len(value) == 1 { ext := "__handle_subdirs_in_dir_flag " + value[0] _, err = fmt.Fprintf(w, " flags_completion+=(%q)\n", ext) } else { ext := "_filedir -d" _, err = fmt.Fprintf(w, " flags_completion+=(%q)\n", ext) } if err != nil { return err } } } return nil } func writeShortFlag(flag *pflag.Flag, w io.Writer) error { b := (len(flag.NoOptDefVal) > 0) name := flag.Shorthand format := " " if !b { format += "two_word_" } format += "flags+=(\"-%s\")\n" if _, err := fmt.Fprintf(w, format, name); err != nil { return err } return writeFlagHandler("-"+name, flag.Annotations, w) } func writeFlag(flag *pflag.Flag, w io.Writer) error { b := (len(flag.NoOptDefVal) > 0) name := flag.Name format := " flags+=(\"--%s" if !b { format += "=" } format += "\")\n" if _, err := fmt.Fprintf(w, format, name); err != nil { return err } return writeFlagHandler("--"+name, flag.Annotations, w) } func writeLocalNonPersistentFlag(flag *pflag.Flag, w io.Writer) error { b := (len(flag.NoOptDefVal) > 0) name := flag.Name format := " local_nonpersistent_flags+=(\"--%s" if !b { format += "=" } format += "\")\n" _, err := fmt.Fprintf(w, format, name) return err } func writeFlags(cmd *Command, w io.Writer) error { _, err := fmt.Fprintf(w, ` flags=() two_word_flags=() local_nonpersistent_flags=() flags_with_completion=() flags_completion=() `) if err != nil { return err } localNonPersistentFlags := cmd.LocalNonPersistentFlags() var visitErr error cmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) { if nonCompletableFlag(flag) { return } if err := writeFlag(flag, w); err != nil { visitErr = err return } if len(flag.Shorthand) > 0 { if err := writeShortFlag(flag, w); err != nil { visitErr = err return } } if localNonPersistentFlags.Lookup(flag.Name) != nil { if err := writeLocalNonPersistentFlag(flag, w); err != nil { visitErr = err return } } }) if visitErr != nil { return visitErr } cmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) { if nonCompletableFlag(flag) { return } if err := writeFlag(flag, w); err != nil { visitErr = err return } if len(flag.Shorthand) > 0 { if err := writeShortFlag(flag, w); err != nil { visitErr = err return } } }) if visitErr != nil { return visitErr } _, err = fmt.Fprintf(w, "\n") return err } func writeRequiredFlag(cmd *Command, w io.Writer) error { if _, err := fmt.Fprintf(w, " must_have_one_flag=()\n"); err != nil { return err } flags := cmd.NonInheritedFlags() var visitErr error flags.VisitAll(func(flag *pflag.Flag) { if nonCompletableFlag(flag) { return } for key := range flag.Annotations { switch key { case BashCompOneRequiredFlag: format := " must_have_one_flag+=(\"--%s" b := (flag.Value.Type() == "bool") if !b { format += "=" } format += "\")\n" if _, err := fmt.Fprintf(w, format, flag.Name); err != nil { visitErr = err return } if len(flag.Shorthand) > 0 { if _, err := fmt.Fprintf(w, " must_have_one_flag+=(\"-%s\")\n", flag.Shorthand); err != nil { visitErr = err return } } } } }) return visitErr } func writeRequiredNouns(cmd *Command, w io.Writer) error { if _, err := fmt.Fprintf(w, " must_have_one_noun=()\n"); err != nil { return err } sort.Sort(sort.StringSlice(cmd.ValidArgs)) for _, value := range cmd.ValidArgs { if _, err := fmt.Fprintf(w, " must_have_one_noun+=(%q)\n", value); err != nil { return err } } return nil } func writeArgAliases(cmd *Command, w io.Writer) error { if _, err := fmt.Fprintf(w, " noun_aliases=()\n"); err != nil { return err } sort.Sort(sort.StringSlice(cmd.ArgAliases)) for _, value := range cmd.ArgAliases { if _, err := fmt.Fprintf(w, " noun_aliases+=(%q)\n", value); err != nil { return err } } return nil } func gen(cmd *Command, w io.Writer) error { for _, c := range cmd.Commands() { if !c.IsAvailableCommand() || c == cmd.helpCommand { continue } if err := gen(c, w); err != nil { return err } } commandName := cmd.CommandPath() commandName = strings.Replace(commandName, " ", "_", -1) commandName = strings.Replace(commandName, ":", "__", -1) if _, err := fmt.Fprintf(w, "_%s()\n{\n", commandName); err != nil { return err } if _, err := fmt.Fprintf(w, " last_command=%q\n", commandName); err != nil { return err } if err := writeCommands(cmd, w); err != nil { return err } if err := writeFlags(cmd, w); err != nil { return err } if err := writeRequiredFlag(cmd, w); err != nil { return err } if err := writeRequiredNouns(cmd, w); err != nil { return err } if err := writeArgAliases(cmd, w); err != nil { return err } if _, err := fmt.Fprintf(w, "}\n\n"); err != nil { return err } return nil } // GenBashCompletion generates bash completion file and writes to the passed writer. func (cmd *Command) GenBashCompletion(w io.Writer) error { if err := preamble(w, cmd.Name()); err != nil { return err } if len(cmd.BashCompletionFunction) > 0 { if _, err := fmt.Fprintf(w, "%s\n", cmd.BashCompletionFunction); err != nil { return err } } if err := gen(cmd, w); err != nil { return err } return postscript(w, cmd.Name()) } func nonCompletableFlag(flag *pflag.Flag) bool { return flag.Hidden || len(flag.Deprecated) > 0 } // GenBashCompletionFile generates bash completion file. func (cmd *Command) GenBashCompletionFile(filename string) error { outFile, err := os.Create(filename) if err != nil { return err } defer outFile.Close() return cmd.GenBashCompletion(outFile) } // MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag, if it exists. func (cmd *Command) MarkFlagRequired(name string) error { return MarkFlagRequired(cmd.Flags(), name) } // MarkPersistentFlagRequired adds the BashCompOneRequiredFlag annotation to the named persistent flag, if it exists. func (cmd *Command) MarkPersistentFlagRequired(name string) error { return MarkFlagRequired(cmd.PersistentFlags(), name) } // MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag in the flag set, if it exists. func MarkFlagRequired(flags *pflag.FlagSet, name string) error { return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"}) } // MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists. // Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. func (cmd *Command) MarkFlagFilename(name string, extensions ...string) error { return MarkFlagFilename(cmd.Flags(), name, extensions...) } // MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists. // Generated bash autocompletion will call the bash function f for the flag. func (cmd *Command) MarkFlagCustom(name string, f string) error { return MarkFlagCustom(cmd.Flags(), name, f) } // MarkPersistentFlagFilename adds the BashCompFilenameExt annotation to the named persistent flag, if it exists. // Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. func (cmd *Command) MarkPersistentFlagFilename(name string, extensions ...string) error { return MarkFlagFilename(cmd.PersistentFlags(), name, extensions...) } // MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag in the flag set, if it exists. // Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided. func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error { return flags.SetAnnotation(name, BashCompFilenameExt, extensions) } // MarkFlagCustom adds the BashCompCustom annotation to the named flag in the flag set, if it exists. // Generated bash autocompletion will call the bash function f for the flag. func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error { return flags.SetAnnotation(name, BashCompCustom, []string{f}) } ================================================ FILE: vendor/github.com/spf13/cobra/bash_completions.md ================================================ # Generating Bash Completions For Your Own cobra.Command Generating bash completions from a cobra command is incredibly easy. An actual program which does so for the kubernetes kubectl binary is as follows: ```go package main import ( "io/ioutil" "os" "github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd" ) func main() { kubectl := cmd.NewFactory(nil).NewKubectlCommand(os.Stdin, ioutil.Discard, ioutil.Discard) kubectl.GenBashCompletionFile("out.sh") } ``` `out.sh` will get you completions of subcommands and flags. Copy it to `/etc/bash_completion.d/` as described [here](https://debian-administration.org/article/316/An_introduction_to_bash_completion_part_1) and reset your terminal to use autocompletion. If you make additional annotations to your code, you can get even more intelligent and flexible behavior. ## Creating your own custom functions Some more actual code that works in kubernetes: ```bash const ( bash_completion_func = `__kubectl_parse_get() { local kubectl_output out if kubectl_output=$(kubectl get --no-headers "$1" 2>/dev/null); then out=($(echo "${kubectl_output}" | awk '{print $1}')) COMPREPLY=( $( compgen -W "${out[*]}" -- "$cur" ) ) fi } __kubectl_get_resource() { if [[ ${#nouns[@]} -eq 0 ]]; then return 1 fi __kubectl_parse_get ${nouns[${#nouns[@]} -1]} if [[ $? -eq 0 ]]; then return 0 fi } __custom_func() { case ${last_command} in kubectl_get | kubectl_describe | kubectl_delete | kubectl_stop) __kubectl_get_resource return ;; *) ;; esac } `) ``` And then I set that in my command definition: ```go cmds := &cobra.Command{ Use: "kubectl", Short: "kubectl controls the Kubernetes cluster manager", Long: `kubectl controls the Kubernetes cluster manager. Find more information at https://github.com/GoogleCloudPlatform/kubernetes.`, Run: runHelp, BashCompletionFunction: bash_completion_func, } ``` The `BashCompletionFunction` option is really only valid/useful on the root command. Doing the above will cause `__custom_func()` to be called when the built in processor was unable to find a solution. In the case of kubernetes a valid command might look something like `kubectl get pod [mypod]`. If you type `kubectl get pod [tab][tab]` the `__customc_func()` will run because the cobra.Command only understood "kubectl" and "get." `__custom_func()` will see that the cobra.Command is "kubectl_get" and will thus call another helper `__kubectl_get_resource()`. `__kubectl_get_resource` will look at the 'nouns' collected. In our example the only noun will be `pod`. So it will call `__kubectl_parse_get pod`. `__kubectl_parse_get` will actually call out to kubernetes and get any pods. It will then set `COMPREPLY` to valid pods! ## Have the completions code complete your 'nouns' In the above example "pod" was assumed to already be typed. But if you want `kubectl get [tab][tab]` to show a list of valid "nouns" you have to set them. Simplified code from `kubectl get` looks like: ```go validArgs []string = { "pod", "node", "service", "replicationcontroller" } cmd := &cobra.Command{ Use: "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)", Short: "Display one or many resources", Long: get_long, Example: get_example, Run: func(cmd *cobra.Command, args []string) { err := RunGet(f, out, cmd, args) util.CheckErr(err) }, ValidArgs: validArgs, } ``` Notice we put the "ValidArgs" on the "get" subcommand. Doing so will give results like ```bash # kubectl get [tab][tab] node pod replicationcontroller service ``` ## Plural form and shortcuts for nouns If your nouns have a number of aliases, you can define them alongside `ValidArgs` using `ArgAliases`: ```go argAliases []string = { "pods", "nodes", "services", "svc", "replicationcontrollers", "rc" } cmd := &cobra.Command{ ... ValidArgs: validArgs, ArgAliases: argAliases } ``` The aliases are not shown to the user on tab completion, but they are accepted as valid nouns by the completion algorithm if entered manually, e.g. in: ```bash # kubectl get rc [tab][tab] backend frontend database ``` Note that without declaring `rc` as an alias, the completion algorithm would show the list of nouns in this example again instead of the replication controllers. ## Mark flags as required Most of the time completions will only show subcommands. But if a flag is required to make a subcommand work, you probably want it to show up when the user types [tab][tab]. Marking a flag as 'Required' is incredibly easy. ```go cmd.MarkFlagRequired("pod") cmd.MarkFlagRequired("container") ``` and you'll get something like ```bash # kubectl exec [tab][tab][tab] -c --container= -p --pod= ``` # Specify valid filename extensions for flags that take a filename In this example we use --filename= and expect to get a json or yaml file as the argument. To make this easier we annotate the --filename flag with valid filename extensions. ```go annotations := []string{"json", "yaml", "yml"} annotation := make(map[string][]string) annotation[cobra.BashCompFilenameExt] = annotations flag := &pflag.Flag{ Name: "filename", Shorthand: "f", Usage: usage, Value: value, DefValue: value.String(), Annotations: annotation, } cmd.Flags().AddFlag(flag) ``` Now when you run a command with this filename flag you'll get something like ```bash # kubectl create -f test/ example/ rpmbuild/ hello.yml test.json ``` So while there are many other files in the CWD it only shows me subdirs and those with valid extensions. # Specifiy custom flag completion Similar to the filename completion and filtering using cobra.BashCompFilenameExt, you can specifiy a custom flag completion function with cobra.BashCompCustom: ```go annotation := make(map[string][]string) annotation[cobra.BashCompFilenameExt] = []string{"__kubectl_get_namespaces"} flag := &pflag.Flag{ Name: "namespace", Usage: usage, Annotations: annotation, } cmd.Flags().AddFlag(flag) ``` In addition add the `__handle_namespace_flag` implementation in the `BashCompletionFunction` value, e.g.: ```bash __kubectl_get_namespaces() { local template template="{{ range .items }}{{ .metadata.name }} {{ end }}" local kubectl_out if kubectl_out=$(kubectl get -o template --template="${template}" namespace 2>/dev/null); then COMPREPLY=( $( compgen -W "${kubectl_out}[*]" -- "$cur" ) ) fi } ``` ================================================ FILE: vendor/github.com/spf13/cobra/cobra.go ================================================ // Copyright © 2013 Steve Francia . // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Commands similar to git, go tools and other modern CLI tools // inspired by go, go-Commander, gh and subcommand package cobra import ( "fmt" "io" "reflect" "strconv" "strings" "text/template" "unicode" ) var templateFuncs = template.FuncMap{ "trim": strings.TrimSpace, "trimRightSpace": trimRightSpace, "trimTrailingWhitespaces": trimRightSpace, "appendIfNotPresent": appendIfNotPresent, "rpad": rpad, "gt": Gt, "eq": Eq, } var initializers []func() // EnablePrefixMatching allows to set automatic prefix matching. Automatic prefix matching can be a dangerous thing // to automatically enable in CLI tools. // Set this to true to enable it. var EnablePrefixMatching = false // EnableCommandSorting controls sorting of the slice of commands, which is turned on by default. // To disable sorting, set it to false. var EnableCommandSorting = true // AddTemplateFunc adds a template function that's available to Usage and Help // template generation. func AddTemplateFunc(name string, tmplFunc interface{}) { templateFuncs[name] = tmplFunc } // AddTemplateFuncs adds multiple template functions that are available to Usage and // Help template generation. func AddTemplateFuncs(tmplFuncs template.FuncMap) { for k, v := range tmplFuncs { templateFuncs[k] = v } } // OnInitialize takes a series of func() arguments and appends them to a slice of func(). func OnInitialize(y ...func()) { initializers = append(initializers, y...) } // FIXME Gt is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. // Gt takes two types and checks whether the first type is greater than the second. In case of types Arrays, Chans, // Maps and Slices, Gt will compare their lengths. Ints are compared directly while strings are first parsed as // ints and then compared. func Gt(a interface{}, b interface{}) bool { var left, right int64 av := reflect.ValueOf(a) switch av.Kind() { case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: left = int64(av.Len()) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: left = av.Int() case reflect.String: left, _ = strconv.ParseInt(av.String(), 10, 64) } bv := reflect.ValueOf(b) switch bv.Kind() { case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: right = int64(bv.Len()) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: right = bv.Int() case reflect.String: right, _ = strconv.ParseInt(bv.String(), 10, 64) } return left > right } // FIXME Eq is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. // Eq takes two types and checks whether they are equal. Supported types are int and string. Unsupported types will panic. func Eq(a interface{}, b interface{}) bool { av := reflect.ValueOf(a) bv := reflect.ValueOf(b) switch av.Kind() { case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice: panic("Eq called on unsupported type") case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return av.Int() == bv.Int() case reflect.String: return av.String() == bv.String() } return false } func trimRightSpace(s string) string { return strings.TrimRightFunc(s, unicode.IsSpace) } // FIXME appendIfNotPresent is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra. // appendIfNotPresent will append stringToAppend to the end of s, but only if it's not yet present in s. func appendIfNotPresent(s, stringToAppend string) string { if strings.Contains(s, stringToAppend) { return s } return s + " " + stringToAppend } // rpad adds padding to the right of a string. func rpad(s string, padding int) string { template := fmt.Sprintf("%%-%ds", padding) return fmt.Sprintf(template, s) } // tmpl executes the given template text on data, writing the result to w. func tmpl(w io.Writer, text string, data interface{}) error { t := template.New("top") t.Funcs(templateFuncs) template.Must(t.Parse(text)) return t.Execute(w, data) } // ld compares two strings and returns the levenshtein distance between them. func ld(s, t string, ignoreCase bool) int { if ignoreCase { s = strings.ToLower(s) t = strings.ToLower(t) } d := make([][]int, len(s)+1) for i := range d { d[i] = make([]int, len(t)+1) } for i := range d { d[i][0] = i } for j := range d[0] { d[0][j] = j } for j := 1; j <= len(t); j++ { for i := 1; i <= len(s); i++ { if s[i-1] == t[j-1] { d[i][j] = d[i-1][j-1] } else { min := d[i-1][j] if d[i][j-1] < min { min = d[i][j-1] } if d[i-1][j-1] < min { min = d[i-1][j-1] } d[i][j] = min + 1 } } } return d[len(s)][len(t)] } ================================================ FILE: vendor/github.com/spf13/cobra/command.go ================================================ // Copyright © 2013 Steve Francia . // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. // In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. package cobra import ( "bytes" "fmt" "io" "os" "path/filepath" "sort" "strings" flag "github.com/spf13/pflag" ) // Command is just that, a command for your application. // E.g. 'go run ...' - 'run' is the command. Cobra requires // you to define the usage and description as part of your command // definition to ensure usability. type Command struct { // Use is the one-line usage message. Use string // Aliases is an array of aliases that can be used instead of the first word in Use. Aliases []string // SuggestFor is an array of command names for which this command will be suggested - // similar to aliases but only suggests. SuggestFor []string // Short is the short description shown in the 'help' output. Short string // Long is the long message shown in the 'help ' output. Long string // Example is examples of how to use the command. Example string // ValidArgs is list of all valid non-flag arguments that are accepted in bash completions ValidArgs []string // ArgAliases is List of aliases for ValidArgs. // These are not suggested to the user in the bash completion, // but accepted if entered manually. ArgAliases []string // BashCompletionFunction is custom functions used by the bash autocompletion generator. BashCompletionFunction string // Deprecated defines, if this command is deprecated and should print this string when used. Deprecated string // Hidden defines, if this command is hidden and should NOT show up in the list of available commands. Hidden bool // Annotations are key/value pairs that can be used by applications to identify or // group commands. Annotations map[string]string // The *Run functions are executed in the following order: // * PersistentPreRun() // * PreRun() // * Run() // * PostRun() // * PersistentPostRun() // All functions get the same args, the arguments after the command name. // // PersistentPreRun: children of this command will inherit and execute. PersistentPreRun func(cmd *Command, args []string) // PersistentPreRunE: PersistentPreRun but returns an error. PersistentPreRunE func(cmd *Command, args []string) error // PreRun: children of this command will not inherit. PreRun func(cmd *Command, args []string) // PreRunE: PreRun but returns an error. PreRunE func(cmd *Command, args []string) error // Run: Typically the actual work function. Most commands will only implement this. Run func(cmd *Command, args []string) // RunE: Run but returns an error. RunE func(cmd *Command, args []string) error // PostRun: run after the Run command. PostRun func(cmd *Command, args []string) // PostRunE: PostRun but returns an error. PostRunE func(cmd *Command, args []string) error // PersistentPostRun: children of this command will inherit and execute after PostRun. PersistentPostRun func(cmd *Command, args []string) // PersistentPostRunE: PersistentPostRun but returns an error. PersistentPostRunE func(cmd *Command, args []string) error // SilenceErrors is an option to quiet errors down stream. SilenceErrors bool // SilenceUsage is an option to silence usage when an error occurs. SilenceUsage bool // DisableFlagParsing disables the flag parsing. // If this is true all flags will be passed to the command as arguments. DisableFlagParsing bool // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...") // will be printed by generating docs for this command. DisableAutoGenTag bool // DisableSuggestions disables the suggestions based on Levenshtein distance // that go along with 'unknown command' messages. DisableSuggestions bool // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions. // Must be > 0. SuggestionsMinimumDistance int // name is the command name, usually the executable's name. name string // commands is the list of commands supported by this program. commands []*Command // parent is a parent command for this command. parent *Command // Max lengths of commands' string lengths for use in padding. commandsMaxUseLen int commandsMaxCommandPathLen int commandsMaxNameLen int // commandsAreSorted defines, if command slice are sorted or not. commandsAreSorted bool // args is actual args parsed from flags. args []string // flagErrorBuf contains all error messages from pflag. flagErrorBuf *bytes.Buffer // flags is full set of flags. flags *flag.FlagSet // pflags contains persistent flags. pflags *flag.FlagSet // lflags contains local flags. lflags *flag.FlagSet // iflags contains inherited flags. iflags *flag.FlagSet // parentsPflags is all persistent flags of cmd's parents. parentsPflags *flag.FlagSet // globNormFunc is the global normalization function // that we can use on every pflag set and children commands globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName // output is an output writer defined by user. output io.Writer // usageFunc is usage func defined by user. usageFunc func(*Command) error // usageTemplate is usage template defined by user. usageTemplate string // flagErrorFunc is func defined by user and it's called when the parsing of // flags returns an error. flagErrorFunc func(*Command, error) error // helpTemplate is help template defined by user. helpTemplate string // helpFunc is help func defined by user. helpFunc func(*Command, []string) // helpCommand is command with usage 'help'. If it's not defined by user, // cobra uses default help command. helpCommand *Command } // SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden // particularly useful when testing. func (c *Command) SetArgs(a []string) { c.args = a } // SetOutput sets the destination for usage and error messages. // If output is nil, os.Stderr is used. func (c *Command) SetOutput(output io.Writer) { c.output = output } // SetUsageFunc sets usage function. Usage can be defined by application. func (c *Command) SetUsageFunc(f func(*Command) error) { c.usageFunc = f } // SetUsageTemplate sets usage template. Can be defined by Application. func (c *Command) SetUsageTemplate(s string) { c.usageTemplate = s } // SetFlagErrorFunc sets a function to generate an error when flag parsing // fails. func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) { c.flagErrorFunc = f } // SetHelpFunc sets help function. Can be defined by Application. func (c *Command) SetHelpFunc(f func(*Command, []string)) { c.helpFunc = f } // SetHelpCommand sets help command. func (c *Command) SetHelpCommand(cmd *Command) { c.helpCommand = cmd } // SetHelpTemplate sets help template to be used. Application can use it to set custom template. func (c *Command) SetHelpTemplate(s string) { c.helpTemplate = s } // SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. // The user should not have a cyclic dependency on commands. func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) { c.Flags().SetNormalizeFunc(n) c.PersistentFlags().SetNormalizeFunc(n) c.globNormFunc = n for _, command := range c.commands { command.SetGlobalNormalizationFunc(n) } } // OutOrStdout returns output to stdout. func (c *Command) OutOrStdout() io.Writer { return c.getOut(os.Stdout) } // OutOrStderr returns output to stderr func (c *Command) OutOrStderr() io.Writer { return c.getOut(os.Stderr) } func (c *Command) getOut(def io.Writer) io.Writer { if c.output != nil { return c.output } if c.HasParent() { return c.parent.getOut(def) } return def } // UsageFunc returns either the function set by SetUsageFunc for this command // or a parent, or it returns a default usage function. func (c *Command) UsageFunc() (f func(*Command) error) { if c.usageFunc != nil { return c.usageFunc } if c.HasParent() { return c.Parent().UsageFunc() } return func(c *Command) error { c.mergePersistentFlags() err := tmpl(c.OutOrStderr(), c.UsageTemplate(), c) if err != nil { c.Println(err) } return err } } // Usage puts out the usage for the command. // Used when a user provides invalid input. // Can be defined by user by overriding UsageFunc. func (c *Command) Usage() error { return c.UsageFunc()(c) } // HelpFunc returns either the function set by SetHelpFunc for this command // or a parent, or it returns a function with default help behavior. func (c *Command) HelpFunc() func(*Command, []string) { if c.helpFunc != nil { return c.helpFunc } if c.HasParent() { return c.Parent().HelpFunc() } return func(c *Command, a []string) { c.mergePersistentFlags() err := tmpl(c.OutOrStdout(), c.HelpTemplate(), c) if err != nil { c.Println(err) } } } // Help puts out the help for the command. // Used when a user calls help [command]. // Can be defined by user by overriding HelpFunc. func (c *Command) Help() error { c.HelpFunc()(c, []string{}) return nil } // UsageString return usage string. func (c *Command) UsageString() string { tmpOutput := c.output bb := new(bytes.Buffer) c.SetOutput(bb) c.Usage() c.output = tmpOutput return bb.String() } // FlagErrorFunc returns either the function set by SetFlagErrorFunc for this // command or a parent, or it returns a function which returns the original // error. func (c *Command) FlagErrorFunc() (f func(*Command, error) error) { if c.flagErrorFunc != nil { return c.flagErrorFunc } if c.HasParent() { return c.parent.FlagErrorFunc() } return func(c *Command, err error) error { return err } } var minUsagePadding = 25 // UsagePadding return padding for the usage. func (c *Command) UsagePadding() int { if c.parent == nil || minUsagePadding > c.parent.commandsMaxUseLen { return minUsagePadding } return c.parent.commandsMaxUseLen } var minCommandPathPadding = 11 // CommandPathPadding return padding for the command path. func (c *Command) CommandPathPadding() int { if c.parent == nil || minCommandPathPadding > c.parent.commandsMaxCommandPathLen { return minCommandPathPadding } return c.parent.commandsMaxCommandPathLen } var minNamePadding = 11 // NamePadding returns padding for the name. func (c *Command) NamePadding() int { if c.parent == nil || minNamePadding > c.parent.commandsMaxNameLen { return minNamePadding } return c.parent.commandsMaxNameLen } // UsageTemplate returns usage template for the command. func (c *Command) UsageTemplate() string { if c.usageTemplate != "" { return c.usageTemplate } if c.HasParent() { return c.parent.UsageTemplate() } return `Usage:{{if .Runnable}} {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}} {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}} Aliases: {{.NameAndAliases}}{{end}}{{if .HasExample}} Examples: {{.Example}}{{end}}{{if .HasAvailableSubCommands}} Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}} {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}} Flags: {{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}} Global Flags: {{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}} Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}} {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}} Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}} ` } // HelpTemplate return help template for the command. func (c *Command) HelpTemplate() string { if c.helpTemplate != "" { return c.helpTemplate } if c.HasParent() { return c.parent.HelpTemplate() } return `{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}} {{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}` } func hasNoOptDefVal(name string, fs *flag.FlagSet) bool { flag := fs.Lookup(name) if flag == nil { return false } return flag.NoOptDefVal != "" } func shortHasNoOptDefVal(name string, fs *flag.FlagSet) bool { if len(name) == 0 { return false } flag := fs.ShorthandLookup(name[:1]) if flag == nil { return false } return flag.NoOptDefVal != "" } func stripFlags(args []string, c *Command) []string { if len(args) == 0 { return args } c.mergePersistentFlags() commands := []string{} flags := c.Flags() Loop: for len(args) > 0 { s := args[0] args = args[1:] switch { case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags): // If '--flag arg' then // delete arg from args. fallthrough // (do the same as below) case strings.HasPrefix(s, "-") && !strings.Contains(s, "=") && len(s) == 2 && !shortHasNoOptDefVal(s[1:], flags): // If '-f arg' then // delete 'arg' from args or break the loop if len(args) <= 1. if len(args) <= 1 { break Loop } else { args = args[1:] continue } case s != "" && !strings.HasPrefix(s, "-"): commands = append(commands, s) } } return commands } // argsMinusFirstX removes only the first x from args. Otherwise, commands that look like // openshift admin policy add-role-to-user admin my-user, lose the admin argument (arg[4]). func argsMinusFirstX(args []string, x string) []string { for i, y := range args { if x == y { ret := []string{} ret = append(ret, args[:i]...) ret = append(ret, args[i+1:]...) return ret } } return args } // Find the target command given the args and command tree // Meant to be run on the highest node. Only searches down. func (c *Command) Find(args []string) (*Command, []string, error) { if c == nil { return nil, nil, fmt.Errorf("Called find() on a nil Command") } var innerfind func(*Command, []string) (*Command, []string) innerfind = func(c *Command, innerArgs []string) (*Command, []string) { argsWOflags := stripFlags(innerArgs, c) if len(argsWOflags) == 0 { return c, innerArgs } nextSubCmd := argsWOflags[0] matches := make([]*Command, 0) for _, cmd := range c.commands { if cmd.Name() == nextSubCmd || cmd.HasAlias(nextSubCmd) { // exact name or alias match return innerfind(cmd, argsMinusFirstX(innerArgs, nextSubCmd)) } if EnablePrefixMatching { if strings.HasPrefix(cmd.Name(), nextSubCmd) { // prefix match matches = append(matches, cmd) } for _, x := range cmd.Aliases { if strings.HasPrefix(x, nextSubCmd) { matches = append(matches, cmd) } } } } // only accept a single prefix match - multiple matches would be ambiguous if len(matches) == 1 { return innerfind(matches[0], argsMinusFirstX(innerArgs, argsWOflags[0])) } return c, innerArgs } commandFound, a := innerfind(c, args) argsWOflags := stripFlags(a, commandFound) // no subcommand, always take args if !commandFound.HasSubCommands() { return commandFound, a, nil } // root command with subcommands, do subcommand checking if commandFound == c && len(argsWOflags) > 0 { suggestionsString := "" if !c.DisableSuggestions { if c.SuggestionsMinimumDistance <= 0 { c.SuggestionsMinimumDistance = 2 } if suggestions := c.SuggestionsFor(argsWOflags[0]); len(suggestions) > 0 { suggestionsString += "\n\nDid you mean this?\n" for _, s := range suggestions { suggestionsString += fmt.Sprintf("\t%v\n", s) } } } return commandFound, a, fmt.Errorf("unknown command %q for %q%s", argsWOflags[0], commandFound.CommandPath(), suggestionsString) } return commandFound, a, nil } // SuggestionsFor provides suggestions for the typedName. func (c *Command) SuggestionsFor(typedName string) []string { suggestions := []string{} for _, cmd := range c.commands { if cmd.IsAvailableCommand() { levenshteinDistance := ld(typedName, cmd.Name(), true) suggestByLevenshtein := levenshteinDistance <= c.SuggestionsMinimumDistance suggestByPrefix := strings.HasPrefix(strings.ToLower(cmd.Name()), strings.ToLower(typedName)) if suggestByLevenshtein || suggestByPrefix { suggestions = append(suggestions, cmd.Name()) } for _, explicitSuggestion := range cmd.SuggestFor { if strings.EqualFold(typedName, explicitSuggestion) { suggestions = append(suggestions, cmd.Name()) } } } } return suggestions } // VisitParents visits all parents of the command and invokes fn on each parent. func (c *Command) VisitParents(fn func(*Command)) { if c.HasParent() { fn(c.Parent()) c.Parent().VisitParents(fn) } } // Root finds root command. func (c *Command) Root() *Command { if c.HasParent() { return c.Parent().Root() } return c } // ArgsLenAtDash will return the length of f.Args at the moment when a -- was // found during arg parsing. This allows your program to know which args were // before the -- and which came after. (Description from // https://godoc.org/github.com/spf13/pflag#FlagSet.ArgsLenAtDash). func (c *Command) ArgsLenAtDash() int { return c.Flags().ArgsLenAtDash() } func (c *Command) execute(a []string) (err error) { if c == nil { return fmt.Errorf("Called Execute() on a nil Command") } if len(c.Deprecated) > 0 { c.Printf("Command %q is deprecated, %s\n", c.Name(), c.Deprecated) } // initialize help flag as the last point possible to allow for user // overriding c.InitDefaultHelpFlag() err = c.ParseFlags(a) if err != nil { return c.FlagErrorFunc()(c, err) } // If help is called, regardless of other flags, return we want help. // Also say we need help if the command isn't runnable. helpVal, err := c.Flags().GetBool("help") if err != nil { // should be impossible to get here as we always declare a help // flag in InitDefaultHelpFlag() c.Println("\"help\" flag declared as non-bool. Please correct your code") return err } if helpVal || !c.Runnable() { return flag.ErrHelp } c.preRun() argWoFlags := c.Flags().Args() if c.DisableFlagParsing { argWoFlags = a } for p := c; p != nil; p = p.Parent() { if p.PersistentPreRunE != nil { if err := p.PersistentPreRunE(c, argWoFlags); err != nil { return err } break } else if p.PersistentPreRun != nil { p.PersistentPreRun(c, argWoFlags) break } } if c.PreRunE != nil { if err := c.PreRunE(c, argWoFlags); err != nil { return err } } else if c.PreRun != nil { c.PreRun(c, argWoFlags) } if c.RunE != nil { if err := c.RunE(c, argWoFlags); err != nil { return err } } else { c.Run(c, argWoFlags) } if c.PostRunE != nil { if err := c.PostRunE(c, argWoFlags); err != nil { return err } } else if c.PostRun != nil { c.PostRun(c, argWoFlags) } for p := c; p != nil; p = p.Parent() { if p.PersistentPostRunE != nil { if err := p.PersistentPostRunE(c, argWoFlags); err != nil { return err } break } else if p.PersistentPostRun != nil { p.PersistentPostRun(c, argWoFlags) break } } return nil } func (c *Command) preRun() { for _, x := range initializers { x() } } // Execute Call execute to use the args (os.Args[1:] by default) // and run through the command tree finding appropriate matches // for commands and then corresponding flags. func (c *Command) Execute() error { _, err := c.ExecuteC() return err } // ExecuteC executes the command. func (c *Command) ExecuteC() (cmd *Command, err error) { // Regardless of what command execute is called on, run on Root only if c.HasParent() { return c.Root().ExecuteC() } // windows hook if preExecHookFn != nil { preExecHookFn(c) } // initialize help as the last point possible to allow for user // overriding c.initHelpCmd() var args []string // Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155 if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" { args = os.Args[1:] } else { args = c.args } cmd, flags, err := c.Find(args) if err != nil { // If found parse to a subcommand and then failed, talk about the subcommand if cmd != nil { c = cmd } if !c.SilenceErrors { c.Println("Error:", err.Error()) c.Printf("Run '%v --help' for usage.\n", c.CommandPath()) } return c, err } err = cmd.execute(flags) if err != nil { // Always show help if requested, even if SilenceErrors is in // effect if err == flag.ErrHelp { cmd.HelpFunc()(cmd, args) return cmd, nil } // If root command has SilentErrors flagged, // all subcommands should respect it if !cmd.SilenceErrors && !c.SilenceErrors { c.Println("Error:", err.Error()) } // If root command has SilentUsage flagged, // all subcommands should respect it if !cmd.SilenceUsage && !c.SilenceUsage { c.Println(cmd.UsageString()) } return cmd, err } return cmd, nil } // InitDefaultHelpFlag adds default help flag to c. // It is called automatically by executing the c or by calling help and usage. // If c already has help flag, it will do nothing. func (c *Command) InitDefaultHelpFlag() { c.mergePersistentFlags() if c.Flags().Lookup("help") == nil { usage := "help for " if c.Name() == "" { usage += "this command" } else { usage += c.Name() } c.Flags().BoolP("help", "h", false, usage) } } func (c *Command) initHelpCmd() { if c.helpCommand == nil { if !c.HasSubCommands() { return } c.helpCommand = &Command{ Use: "help [command]", Short: "Help about any command", Long: `Help provides help for any command in the application. Simply type ` + c.Name() + ` help [path to command] for full details.`, PersistentPreRun: func(cmd *Command, args []string) {}, PersistentPostRun: func(cmd *Command, args []string) {}, Run: func(c *Command, args []string) { cmd, _, e := c.Root().Find(args) if cmd == nil || e != nil { c.Printf("Unknown help topic %#q\n", args) c.Root().Usage() } else { cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown cmd.Help() } }, } } c.RemoveCommand(c.helpCommand) c.AddCommand(c.helpCommand) } // ResetCommands used for testing. func (c *Command) ResetCommands() { c.commands = nil c.helpCommand = nil c.parentsPflags = nil } // Sorts commands by their names. type commandSorterByName []*Command func (c commandSorterByName) Len() int { return len(c) } func (c commandSorterByName) Swap(i, j int) { c[i], c[j] = c[j], c[i] } func (c commandSorterByName) Less(i, j int) bool { return c[i].Name() < c[j].Name() } // Commands returns a sorted slice of child commands. func (c *Command) Commands() []*Command { // do not sort commands if it already sorted or sorting was disabled if EnableCommandSorting && !c.commandsAreSorted { sort.Sort(commandSorterByName(c.commands)) c.commandsAreSorted = true } return c.commands } // AddCommand adds one or more commands to this parent command. func (c *Command) AddCommand(cmds ...*Command) { for i, x := range cmds { if cmds[i] == c { panic("Command can't be a child of itself") } cmds[i].parent = c // update max lengths usageLen := len(x.Use) if usageLen > c.commandsMaxUseLen { c.commandsMaxUseLen = usageLen } commandPathLen := len(x.CommandPath()) if commandPathLen > c.commandsMaxCommandPathLen { c.commandsMaxCommandPathLen = commandPathLen } nameLen := len(x.Name()) if nameLen > c.commandsMaxNameLen { c.commandsMaxNameLen = nameLen } // If global normalization function exists, update all children if c.globNormFunc != nil { x.SetGlobalNormalizationFunc(c.globNormFunc) } c.commands = append(c.commands, x) c.commandsAreSorted = false } } // RemoveCommand removes one or more commands from a parent command. func (c *Command) RemoveCommand(cmds ...*Command) { commands := []*Command{} main: for _, command := range c.commands { for _, cmd := range cmds { if command == cmd { command.parent = nil continue main } } commands = append(commands, command) } c.commands = commands // recompute all lengths c.commandsMaxUseLen = 0 c.commandsMaxCommandPathLen = 0 c.commandsMaxNameLen = 0 for _, command := range c.commands { usageLen := len(command.Use) if usageLen > c.commandsMaxUseLen { c.commandsMaxUseLen = usageLen } commandPathLen := len(command.CommandPath()) if commandPathLen > c.commandsMaxCommandPathLen { c.commandsMaxCommandPathLen = commandPathLen } nameLen := len(command.Name()) if nameLen > c.commandsMaxNameLen { c.commandsMaxNameLen = nameLen } } } // Print is a convenience method to Print to the defined output, fallback to Stderr if not set. func (c *Command) Print(i ...interface{}) { fmt.Fprint(c.OutOrStderr(), i...) } // Println is a convenience method to Println to the defined output, fallback to Stderr if not set. func (c *Command) Println(i ...interface{}) { c.Print(fmt.Sprintln(i...)) } // Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set. func (c *Command) Printf(format string, i ...interface{}) { c.Print(fmt.Sprintf(format, i...)) } // CommandPath returns the full path to this command. func (c *Command) CommandPath() string { if c.HasParent() { return c.Parent().CommandPath() + " " + c.Name() } return c.Name() } // UseLine puts out the full usage for a given command (including parents). func (c *Command) UseLine() string { var useline string if c.HasParent() { useline = c.parent.CommandPath() + " " + c.Use } else { useline = c.Use } if c.HasAvailableFlags() && !strings.Contains(useline, "[flags]") { useline += " [flags]" } return useline } // DebugFlags used to determine which flags have been assigned to which commands // and which persist. func (c *Command) DebugFlags() { c.Println("DebugFlags called on", c.Name()) var debugflags func(*Command) debugflags = func(x *Command) { if x.HasFlags() || x.HasPersistentFlags() { c.Println(x.Name()) } if x.HasFlags() { x.flags.VisitAll(func(f *flag.Flag) { if x.HasPersistentFlags() && x.persistentFlag(f.Name) != nil { c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [LP]") } else { c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [L]") } }) } if x.HasPersistentFlags() { x.pflags.VisitAll(func(f *flag.Flag) { if x.HasFlags() { if x.flags.Lookup(f.Name) == nil { c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]") } } else { c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]") } }) } c.Println(x.flagErrorBuf) if x.HasSubCommands() { for _, y := range x.commands { debugflags(y) } } } debugflags(c) } // Name returns the command's name: the first word in the use line. func (c *Command) Name() string { if c.name == "" { name := c.Use i := strings.Index(name, " ") if i >= 0 { name = name[:i] } c.name = name } return c.name } // HasAlias determines if a given string is an alias of the command. func (c *Command) HasAlias(s string) bool { for _, a := range c.Aliases { if a == s { return true } } return false } // NameAndAliases returns string containing name and all aliases func (c *Command) NameAndAliases() string { return strings.Join(append([]string{c.Name()}, c.Aliases...), ", ") } // HasExample determines if the command has example. func (c *Command) HasExample() bool { return len(c.Example) > 0 } // Runnable determines if the command is itself runnable. func (c *Command) Runnable() bool { return c.Run != nil || c.RunE != nil } // HasSubCommands determines if the command has children commands. func (c *Command) HasSubCommands() bool { return len(c.commands) > 0 } // IsAvailableCommand determines if a command is available as a non-help command // (this includes all non deprecated/hidden commands). func (c *Command) IsAvailableCommand() bool { if len(c.Deprecated) != 0 || c.Hidden { return false } if c.HasParent() && c.Parent().helpCommand == c { return false } if c.Runnable() || c.HasAvailableSubCommands() { return true } return false } // IsAdditionalHelpTopicCommand determines if a command is an additional // help topic command; additional help topic command is determined by the // fact that it is NOT runnable/hidden/deprecated, and has no sub commands that // are runnable/hidden/deprecated. // Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. func (c *Command) IsAdditionalHelpTopicCommand() bool { // if a command is runnable, deprecated, or hidden it is not a 'help' command if c.Runnable() || len(c.Deprecated) != 0 || c.Hidden { return false } // if any non-help sub commands are found, the command is not a 'help' command for _, sub := range c.commands { if !sub.IsAdditionalHelpTopicCommand() { return false } } // the command either has no sub commands, or no non-help sub commands return true } // HasHelpSubCommands determines if a command has any available 'help' sub commands // that need to be shown in the usage/help default template under 'additional help // topics'. func (c *Command) HasHelpSubCommands() bool { // return true on the first found available 'help' sub command for _, sub := range c.commands { if sub.IsAdditionalHelpTopicCommand() { return true } } // the command either has no sub commands, or no available 'help' sub commands return false } // HasAvailableSubCommands determines if a command has available sub commands that // need to be shown in the usage/help default template under 'available commands'. func (c *Command) HasAvailableSubCommands() bool { // return true on the first found available (non deprecated/help/hidden) // sub command for _, sub := range c.commands { if sub.IsAvailableCommand() { return true } } // the command either has no sub comamnds, or no available (non deprecated/help/hidden) // sub commands return false } // HasParent determines if the command is a child command. func (c *Command) HasParent() bool { return c.parent != nil } // GlobalNormalizationFunc returns the global normalization function or nil if doesn't exists. func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName { return c.globNormFunc } // Flags returns the complete FlagSet that applies // to this command (local and persistent declared here and by all parents). func (c *Command) Flags() *flag.FlagSet { if c.flags == nil { c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } c.flags.SetOutput(c.flagErrorBuf) } return c.flags } // LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands. func (c *Command) LocalNonPersistentFlags() *flag.FlagSet { persistentFlags := c.PersistentFlags() out := flag.NewFlagSet(c.Name(), flag.ContinueOnError) c.LocalFlags().VisitAll(func(f *flag.Flag) { if persistentFlags.Lookup(f.Name) == nil { out.AddFlag(f) } }) return out } // LocalFlags returns the local FlagSet specifically set in the current command. func (c *Command) LocalFlags() *flag.FlagSet { c.mergePersistentFlags() if c.lflags == nil { c.lflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } c.lflags.SetOutput(c.flagErrorBuf) } c.lflags.SortFlags = c.Flags().SortFlags addToLocal := func(f *flag.Flag) { if c.lflags.Lookup(f.Name) == nil && c.parentsPflags.Lookup(f.Name) == nil { c.lflags.AddFlag(f) } } c.Flags().VisitAll(addToLocal) c.PersistentFlags().VisitAll(addToLocal) return c.lflags } // InheritedFlags returns all flags which were inherited from parents commands. func (c *Command) InheritedFlags() *flag.FlagSet { c.mergePersistentFlags() if c.iflags == nil { c.iflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } c.iflags.SetOutput(c.flagErrorBuf) } local := c.LocalFlags() c.parentsPflags.VisitAll(func(f *flag.Flag) { if c.iflags.Lookup(f.Name) == nil && local.Lookup(f.Name) == nil { c.iflags.AddFlag(f) } }) return c.iflags } // NonInheritedFlags returns all flags which were not inherited from parent commands. func (c *Command) NonInheritedFlags() *flag.FlagSet { return c.LocalFlags() } // PersistentFlags returns the persistent FlagSet specifically set in the current command. func (c *Command) PersistentFlags() *flag.FlagSet { if c.pflags == nil { c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) if c.flagErrorBuf == nil { c.flagErrorBuf = new(bytes.Buffer) } c.pflags.SetOutput(c.flagErrorBuf) } return c.pflags } // ResetFlags is used in testing. func (c *Command) ResetFlags() { c.flagErrorBuf = new(bytes.Buffer) c.flagErrorBuf.Reset() c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) c.flags.SetOutput(c.flagErrorBuf) c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) c.pflags.SetOutput(c.flagErrorBuf) } // HasFlags checks if the command contains any flags (local plus persistent from the entire structure). func (c *Command) HasFlags() bool { return c.Flags().HasFlags() } // HasPersistentFlags checks if the command contains persistent flags. func (c *Command) HasPersistentFlags() bool { return c.PersistentFlags().HasFlags() } // HasLocalFlags checks if the command has flags specifically declared locally. func (c *Command) HasLocalFlags() bool { return c.LocalFlags().HasFlags() } // HasInheritedFlags checks if the command has flags inherited from its parent command. func (c *Command) HasInheritedFlags() bool { return c.InheritedFlags().HasFlags() } // HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire // structure) which are not hidden or deprecated. func (c *Command) HasAvailableFlags() bool { return c.Flags().HasAvailableFlags() } // HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated. func (c *Command) HasAvailablePersistentFlags() bool { return c.PersistentFlags().HasAvailableFlags() } // HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden // or deprecated. func (c *Command) HasAvailableLocalFlags() bool { return c.LocalFlags().HasAvailableFlags() } // HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are // not hidden or deprecated. func (c *Command) HasAvailableInheritedFlags() bool { return c.InheritedFlags().HasAvailableFlags() } // Flag climbs up the command tree looking for matching flag. func (c *Command) Flag(name string) (flag *flag.Flag) { flag = c.Flags().Lookup(name) if flag == nil { flag = c.persistentFlag(name) } return } // Recursively find matching persistent flag. func (c *Command) persistentFlag(name string) (flag *flag.Flag) { if c.HasPersistentFlags() { flag = c.PersistentFlags().Lookup(name) } if flag == nil { c.updateParentsPflags() flag = c.parentsPflags.Lookup(name) } return } // ParseFlags parses persistent flag tree and local flags. func (c *Command) ParseFlags(args []string) (err error) { if c.DisableFlagParsing { return nil } c.mergePersistentFlags() err = c.Flags().Parse(args) return } // Parent returns a commands parent command. func (c *Command) Parent() *Command { return c.parent } // mergePersistentFlags merges c.PersistentFlags() to c.Flags() // and adds missing persistent flags of all parents. func (c *Command) mergePersistentFlags() { c.updateParentsPflags() c.Flags().AddFlagSet(c.PersistentFlags()) c.Flags().AddFlagSet(c.parentsPflags) } // updateParentsPflags updates c.parentsPflags by adding // new persistent flags of all parents. // If c.parentsPflags == nil, it makes new. func (c *Command) updateParentsPflags() { if c.parentsPflags == nil { c.parentsPflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError) c.parentsPflags.SetOutput(c.flagErrorBuf) c.parentsPflags.SortFlags = false } c.Root().PersistentFlags().AddFlagSet(flag.CommandLine) c.VisitParents(func(parent *Command) { c.parentsPflags.AddFlagSet(parent.PersistentFlags()) }) } ================================================ FILE: vendor/github.com/spf13/cobra/command_notwin.go ================================================ // +build !windows package cobra var preExecHookFn func(*Command) ================================================ FILE: vendor/github.com/spf13/cobra/command_win.go ================================================ // +build windows package cobra import ( "os" "time" "github.com/inconshreveable/mousetrap" ) var preExecHookFn = preExecHook // enables an information splash screen on Windows if the CLI is started from explorer.exe. var MousetrapHelpText string = `This is a command line tool You need to open cmd.exe and run it from there. ` func preExecHook(c *Command) { if mousetrap.StartedByExplorer() { c.Print(MousetrapHelpText) time.Sleep(5 * time.Second) os.Exit(1) } } ================================================ FILE: vendor/github.com/spf13/pflag/.gitignore ================================================ .idea/* ================================================ FILE: vendor/github.com/spf13/pflag/.travis.yml ================================================ sudo: false language: go go: - 1.7.3 - 1.8.1 - tip matrix: allow_failures: - go: tip install: - go get github.com/golang/lint/golint - export PATH=$GOPATH/bin:$PATH - go install ./... script: - verify/all.sh -v - go test ./... ================================================ FILE: vendor/github.com/spf13/pflag/LICENSE ================================================ Copyright (c) 2012 Alex Ogier. All rights reserved. Copyright (c) 2012 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/github.com/spf13/pflag/README.md ================================================ [![Build Status](https://travis-ci.org/spf13/pflag.svg?branch=master)](https://travis-ci.org/spf13/pflag) [![Go Report Card](https://goreportcard.com/badge/github.com/spf13/pflag)](https://goreportcard.com/report/github.com/spf13/pflag) [![GoDoc](https://godoc.org/github.com/spf13/pflag?status.svg)](https://godoc.org/github.com/spf13/pflag) ## Description pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags. pflag is compatible with the [GNU extensions to the POSIX recommendations for command-line options][1]. For a more precise description, see the "Command-line flag syntax" section below. [1]: http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html pflag is available under the same style of BSD license as the Go language, which can be found in the LICENSE file. ## Installation pflag is available using the standard `go get` command. Install by running: go get github.com/spf13/pflag Run tests by running: go test github.com/spf13/pflag ## Usage pflag is a drop-in replacement of Go's native flag package. If you import pflag under the name "flag" then all code should continue to function with no changes. ``` go import flag "github.com/spf13/pflag" ``` There is one exception to this: if you directly instantiate the Flag struct there is one more field "Shorthand" that you will need to set. Most code never instantiates this struct directly, and instead uses functions such as String(), BoolVar(), and Var(), and is therefore unaffected. Define flags using flag.String(), Bool(), Int(), etc. This declares an integer flag, -flagname, stored in the pointer ip, with type *int. ``` go var ip *int = flag.Int("flagname", 1234, "help message for flagname") ``` If you like, you can bind the flag to a variable using the Var() functions. ``` go var flagvar int func init() { flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") } ``` Or you can create custom flags that satisfy the Value interface (with pointer receivers) and couple them to flag parsing by ``` go flag.Var(&flagVal, "name", "help message for flagname") ``` For such flags, the default value is just the initial value of the variable. After all flags are defined, call ``` go flag.Parse() ``` to parse the command line into the defined flags. Flags may then be used directly. If you're using the flags themselves, they are all pointers; if you bind to variables, they're values. ``` go fmt.Println("ip has value ", *ip) fmt.Println("flagvar has value ", flagvar) ``` There are helpers function to get values later if you have the FlagSet but it was difficult to keep up with all of the flag pointers in your code. If you have a pflag.FlagSet with a flag called 'flagname' of type int you can use GetInt() to get the int value. But notice that 'flagname' must exist and it must be an int. GetString("flagname") will fail. ``` go i, err := flagset.GetInt("flagname") ``` After parsing, the arguments after the flag are available as the slice flag.Args() or individually as flag.Arg(i). The arguments are indexed from 0 through flag.NArg()-1. The pflag package also defines some new functions that are not in flag, that give one-letter shorthands for flags. You can use these by appending 'P' to the name of any function that defines a flag. ``` go var ip = flag.IntP("flagname", "f", 1234, "help message") var flagvar bool func init() { flag.BoolVarP(&flagvar, "boolname", "b", true, "help message") } flag.VarP(&flagVal, "varname", "v", "help message") ``` Shorthand letters can be used with single dashes on the command line. Boolean shorthand flags can be combined with other shorthand flags. The default set of command-line flags is controlled by top-level functions. The FlagSet type allows one to define independent sets of flags, such as to implement subcommands in a command-line interface. The methods of FlagSet are analogous to the top-level functions for the command-line flag set. ## Setting no option default values for flags After you create a flag it is possible to set the pflag.NoOptDefVal for the given flag. Doing this changes the meaning of the flag slightly. If a flag has a NoOptDefVal and the flag is set on the command line without an option the flag will be set to the NoOptDefVal. For example given: ``` go var ip = flag.IntP("flagname", "f", 1234, "help message") flag.Lookup("flagname").NoOptDefVal = "4321" ``` Would result in something like | Parsed Arguments | Resulting Value | | ------------- | ------------- | | --flagname=1357 | ip=1357 | | --flagname | ip=4321 | | [nothing] | ip=1234 | ## Command line flag syntax ``` --flag // boolean flags, or flags with no option default values --flag x // only on flags without a default value --flag=x ``` Unlike the flag package, a single dash before an option means something different than a double dash. Single dashes signify a series of shorthand letters for flags. All but the last shorthand letter must be boolean flags or a flag with a default value ``` // boolean or flags where the 'no option default value' is set -f -f=true -abc but -b true is INVALID // non-boolean and flags without a 'no option default value' -n 1234 -n=1234 -n1234 // mixed -abcs "hello" -absd="hello" -abcs1234 ``` Flag parsing stops after the terminator "--". Unlike the flag package, flags can be interspersed with arguments anywhere on the command line before this terminator. Integer flags accept 1234, 0664, 0x1234 and may be negative. Boolean flags (in their long form) accept 1, 0, t, f, true, false, TRUE, FALSE, True, False. Duration flags accept any input valid for time.ParseDuration. ## Mutating or "Normalizing" Flag names It is possible to set a custom flag name 'normalization function.' It allows flag names to be mutated both when created in the code and when used on the command line to some 'normalized' form. The 'normalized' form is used for comparison. Two examples of using the custom normalization func follow. **Example #1**: You want -, _, and . in flags to compare the same. aka --my-flag == --my_flag == --my.flag ``` go func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { from := []string{"-", "_"} to := "." for _, sep := range from { name = strings.Replace(name, sep, to, -1) } return pflag.NormalizedName(name) } myFlagSet.SetNormalizeFunc(wordSepNormalizeFunc) ``` **Example #2**: You want to alias two flags. aka --old-flag-name == --new-flag-name ``` go func aliasNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { switch name { case "old-flag-name": name = "new-flag-name" break } return pflag.NormalizedName(name) } myFlagSet.SetNormalizeFunc(aliasNormalizeFunc) ``` ## Deprecating a flag or its shorthand It is possible to deprecate a flag, or just its shorthand. Deprecating a flag/shorthand hides it from help text and prints a usage message when the deprecated flag/shorthand is used. **Example #1**: You want to deprecate a flag named "badflag" as well as inform the users what flag they should use instead. ```go // deprecate a flag by specifying its name and a usage message flags.MarkDeprecated("badflag", "please use --good-flag instead") ``` This hides "badflag" from help text, and prints `Flag --badflag has been deprecated, please use --good-flag instead` when "badflag" is used. **Example #2**: You want to keep a flag name "noshorthandflag" but deprecate its shortname "n". ```go // deprecate a flag shorthand by specifying its flag name and a usage message flags.MarkShorthandDeprecated("noshorthandflag", "please use --noshorthandflag only") ``` This hides the shortname "n" from help text, and prints `Flag shorthand -n has been deprecated, please use --noshorthandflag only` when the shorthand "n" is used. Note that usage message is essential here, and it should not be empty. ## Hidden flags It is possible to mark a flag as hidden, meaning it will still function as normal, however will not show up in usage/help text. **Example**: You have a flag named "secretFlag" that you need for internal use only and don't want it showing up in help text, or for its usage text to be available. ```go // hide a flag by specifying its name flags.MarkHidden("secretFlag") ``` ## Disable sorting of flags `pflag` allows you to disable sorting of flags for help and usage message. **Example**: ```go flags.BoolP("verbose", "v", false, "verbose output") flags.String("coolflag", "yeaah", "it's really cool flag") flags.Int("usefulflag", 777, "sometimes it's very useful") flags.SortFlags = false flags.PrintDefaults() ``` **Output**: ``` -v, --verbose verbose output --coolflag string it's really cool flag (default "yeaah") --usefulflag int sometimes it's very useful (default 777) ``` ## Supporting Go flags when using pflag In order to support flags defined using Go's `flag` package, they must be added to the `pflag` flagset. This is usually necessary to support flags defined by third-party dependencies (e.g. `golang/glog`). **Example**: You want to add the Go flags to the `CommandLine` flagset ```go import ( goflag "flag" flag "github.com/spf13/pflag" ) var ip *int = flag.Int("flagname", 1234, "help message for flagname") func main() { flag.CommandLine.AddGoFlagSet(goflag.CommandLine) flag.Parse() } ``` ## More info You can see the full reference documentation of the pflag package [at godoc.org][3], or through go's standard documentation system by running `godoc -http=:6060` and browsing to [http://localhost:6060/pkg/github.com/spf13/pflag][2] after installation. [2]: http://localhost:6060/pkg/github.com/spf13/pflag [3]: http://godoc.org/github.com/spf13/pflag ================================================ FILE: vendor/github.com/spf13/pflag/bool.go ================================================ package pflag import "strconv" // optional interface to indicate boolean flags that can be // supplied without "=value" text type boolFlag interface { Value IsBoolFlag() bool } // -- bool Value type boolValue bool func newBoolValue(val bool, p *bool) *boolValue { *p = val return (*boolValue)(p) } func (b *boolValue) Set(s string) error { v, err := strconv.ParseBool(s) *b = boolValue(v) return err } func (b *boolValue) Type() string { return "bool" } func (b *boolValue) String() string { return strconv.FormatBool(bool(*b)) } func (b *boolValue) IsBoolFlag() bool { return true } func boolConv(sval string) (interface{}, error) { return strconv.ParseBool(sval) } // GetBool return the bool value of a flag with the given name func (f *FlagSet) GetBool(name string) (bool, error) { val, err := f.getFlagType(name, "bool", boolConv) if err != nil { return false, err } return val.(bool), nil } // BoolVar defines a bool flag with specified name, default value, and usage string. // The argument p points to a bool variable in which to store the value of the flag. func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) { f.BoolVarP(p, name, "", value, usage) } // BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage string) { flag := f.VarPF(newBoolValue(value, p), name, shorthand, usage) flag.NoOptDefVal = "true" } // BoolVar defines a bool flag with specified name, default value, and usage string. // The argument p points to a bool variable in which to store the value of the flag. func BoolVar(p *bool, name string, value bool, usage string) { BoolVarP(p, name, "", value, usage) } // BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash. func BoolVarP(p *bool, name, shorthand string, value bool, usage string) { flag := CommandLine.VarPF(newBoolValue(value, p), name, shorthand, usage) flag.NoOptDefVal = "true" } // Bool defines a bool flag with specified name, default value, and usage string. // The return value is the address of a bool variable that stores the value of the flag. func (f *FlagSet) Bool(name string, value bool, usage string) *bool { return f.BoolP(name, "", value, usage) } // BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool { p := new(bool) f.BoolVarP(p, name, shorthand, value, usage) return p } // Bool defines a bool flag with specified name, default value, and usage string. // The return value is the address of a bool variable that stores the value of the flag. func Bool(name string, value bool, usage string) *bool { return BoolP(name, "", value, usage) } // BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash. func BoolP(name, shorthand string, value bool, usage string) *bool { b := CommandLine.BoolP(name, shorthand, value, usage) return b } ================================================ FILE: vendor/github.com/spf13/pflag/bool_slice.go ================================================ package pflag import ( "io" "strconv" "strings" ) // -- boolSlice Value type boolSliceValue struct { value *[]bool changed bool } func newBoolSliceValue(val []bool, p *[]bool) *boolSliceValue { bsv := new(boolSliceValue) bsv.value = p *bsv.value = val return bsv } // Set converts, and assigns, the comma-separated boolean argument string representation as the []bool value of this flag. // If Set is called on a flag that already has a []bool assigned, the newly converted values will be appended. func (s *boolSliceValue) Set(val string) error { // remove all quote characters rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "") // read flag arguments with CSV parser boolStrSlice, err := readAsCSV(rmQuote.Replace(val)) if err != nil && err != io.EOF { return err } // parse boolean values into slice out := make([]bool, 0, len(boolStrSlice)) for _, boolStr := range boolStrSlice { b, err := strconv.ParseBool(strings.TrimSpace(boolStr)) if err != nil { return err } out = append(out, b) } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } // Type returns a string that uniquely represents this flag's type. func (s *boolSliceValue) Type() string { return "boolSlice" } // String defines a "native" format for this boolean slice flag value. func (s *boolSliceValue) String() string { boolStrSlice := make([]string, len(*s.value)) for i, b := range *s.value { boolStrSlice[i] = strconv.FormatBool(b) } out, _ := writeAsCSV(boolStrSlice) return "[" + out + "]" } func boolSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []bool{}, nil } ss := strings.Split(val, ",") out := make([]bool, len(ss)) for i, t := range ss { var err error out[i], err = strconv.ParseBool(t) if err != nil { return nil, err } } return out, nil } // GetBoolSlice returns the []bool value of a flag with the given name. func (f *FlagSet) GetBoolSlice(name string) ([]bool, error) { val, err := f.getFlagType(name, "boolSlice", boolSliceConv) if err != nil { return []bool{}, err } return val.([]bool), nil } // BoolSliceVar defines a boolSlice flag with specified name, default value, and usage string. // The argument p points to a []bool variable in which to store the value of the flag. func (f *FlagSet) BoolSliceVar(p *[]bool, name string, value []bool, usage string) { f.VarP(newBoolSliceValue(value, p), name, "", usage) } // BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) { f.VarP(newBoolSliceValue(value, p), name, shorthand, usage) } // BoolSliceVar defines a []bool flag with specified name, default value, and usage string. // The argument p points to a []bool variable in which to store the value of the flag. func BoolSliceVar(p *[]bool, name string, value []bool, usage string) { CommandLine.VarP(newBoolSliceValue(value, p), name, "", usage) } // BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash. func BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) { CommandLine.VarP(newBoolSliceValue(value, p), name, shorthand, usage) } // BoolSlice defines a []bool flag with specified name, default value, and usage string. // The return value is the address of a []bool variable that stores the value of the flag. func (f *FlagSet) BoolSlice(name string, value []bool, usage string) *[]bool { p := []bool{} f.BoolSliceVarP(&p, name, "", value, usage) return &p } // BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool { p := []bool{} f.BoolSliceVarP(&p, name, shorthand, value, usage) return &p } // BoolSlice defines a []bool flag with specified name, default value, and usage string. // The return value is the address of a []bool variable that stores the value of the flag. func BoolSlice(name string, value []bool, usage string) *[]bool { return CommandLine.BoolSliceP(name, "", value, usage) } // BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash. func BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool { return CommandLine.BoolSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/count.go ================================================ package pflag import "strconv" // -- count Value type countValue int func newCountValue(val int, p *int) *countValue { *p = val return (*countValue)(p) } func (i *countValue) Set(s string) error { v, err := strconv.ParseInt(s, 0, 64) // -1 means that no specific value was passed, so increment if v == -1 { *i = countValue(*i + 1) } else { *i = countValue(v) } return err } func (i *countValue) Type() string { return "count" } func (i *countValue) String() string { return strconv.Itoa(int(*i)) } func countConv(sval string) (interface{}, error) { i, err := strconv.Atoi(sval) if err != nil { return nil, err } return i, nil } // GetCount return the int value of a flag with the given name func (f *FlagSet) GetCount(name string) (int, error) { val, err := f.getFlagType(name, "count", countConv) if err != nil { return 0, err } return val.(int), nil } // CountVar defines a count flag with specified name, default value, and usage string. // The argument p points to an int variable in which to store the value of the flag. // A count flag will add 1 to its value evey time it is found on the command line func (f *FlagSet) CountVar(p *int, name string, usage string) { f.CountVarP(p, name, "", usage) } // CountVarP is like CountVar only take a shorthand for the flag name. func (f *FlagSet) CountVarP(p *int, name, shorthand string, usage string) { flag := f.VarPF(newCountValue(0, p), name, shorthand, usage) flag.NoOptDefVal = "-1" } // CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set func CountVar(p *int, name string, usage string) { CommandLine.CountVar(p, name, usage) } // CountVarP is like CountVar only take a shorthand for the flag name. func CountVarP(p *int, name, shorthand string, usage string) { CommandLine.CountVarP(p, name, shorthand, usage) } // Count defines a count flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. // A count flag will add 1 to its value evey time it is found on the command line func (f *FlagSet) Count(name string, usage string) *int { p := new(int) f.CountVarP(p, name, "", usage) return p } // CountP is like Count only takes a shorthand for the flag name. func (f *FlagSet) CountP(name, shorthand string, usage string) *int { p := new(int) f.CountVarP(p, name, shorthand, usage) return p } // Count defines a count flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. // A count flag will add 1 to its value evey time it is found on the command line func Count(name string, usage string) *int { return CommandLine.CountP(name, "", usage) } // CountP is like Count only takes a shorthand for the flag name. func CountP(name, shorthand string, usage string) *int { return CommandLine.CountP(name, shorthand, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/duration.go ================================================ package pflag import ( "time" ) // -- time.Duration Value type durationValue time.Duration func newDurationValue(val time.Duration, p *time.Duration) *durationValue { *p = val return (*durationValue)(p) } func (d *durationValue) Set(s string) error { v, err := time.ParseDuration(s) *d = durationValue(v) return err } func (d *durationValue) Type() string { return "duration" } func (d *durationValue) String() string { return (*time.Duration)(d).String() } func durationConv(sval string) (interface{}, error) { return time.ParseDuration(sval) } // GetDuration return the duration value of a flag with the given name func (f *FlagSet) GetDuration(name string) (time.Duration, error) { val, err := f.getFlagType(name, "duration", durationConv) if err != nil { return 0, err } return val.(time.Duration), nil } // DurationVar defines a time.Duration flag with specified name, default value, and usage string. // The argument p points to a time.Duration variable in which to store the value of the flag. func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) { f.VarP(newDurationValue(value, p), name, "", usage) } // DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) { f.VarP(newDurationValue(value, p), name, shorthand, usage) } // DurationVar defines a time.Duration flag with specified name, default value, and usage string. // The argument p points to a time.Duration variable in which to store the value of the flag. func DurationVar(p *time.Duration, name string, value time.Duration, usage string) { CommandLine.VarP(newDurationValue(value, p), name, "", usage) } // DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash. func DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) { CommandLine.VarP(newDurationValue(value, p), name, shorthand, usage) } // Duration defines a time.Duration flag with specified name, default value, and usage string. // The return value is the address of a time.Duration variable that stores the value of the flag. func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration { p := new(time.Duration) f.DurationVarP(p, name, "", value, usage) return p } // DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration { p := new(time.Duration) f.DurationVarP(p, name, shorthand, value, usage) return p } // Duration defines a time.Duration flag with specified name, default value, and usage string. // The return value is the address of a time.Duration variable that stores the value of the flag. func Duration(name string, value time.Duration, usage string) *time.Duration { return CommandLine.DurationP(name, "", value, usage) } // DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash. func DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration { return CommandLine.DurationP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/flag.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags. pflag is compatible with the GNU extensions to the POSIX recommendations for command-line options. See http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html Usage: pflag is a drop-in replacement of Go's native flag package. If you import pflag under the name "flag" then all code should continue to function with no changes. import flag "github.com/spf13/pflag" There is one exception to this: if you directly instantiate the Flag struct there is one more field "Shorthand" that you will need to set. Most code never instantiates this struct directly, and instead uses functions such as String(), BoolVar(), and Var(), and is therefore unaffected. Define flags using flag.String(), Bool(), Int(), etc. This declares an integer flag, -flagname, stored in the pointer ip, with type *int. var ip = flag.Int("flagname", 1234, "help message for flagname") If you like, you can bind the flag to a variable using the Var() functions. var flagvar int func init() { flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") } Or you can create custom flags that satisfy the Value interface (with pointer receivers) and couple them to flag parsing by flag.Var(&flagVal, "name", "help message for flagname") For such flags, the default value is just the initial value of the variable. After all flags are defined, call flag.Parse() to parse the command line into the defined flags. Flags may then be used directly. If you're using the flags themselves, they are all pointers; if you bind to variables, they're values. fmt.Println("ip has value ", *ip) fmt.Println("flagvar has value ", flagvar) After parsing, the arguments after the flag are available as the slice flag.Args() or individually as flag.Arg(i). The arguments are indexed from 0 through flag.NArg()-1. The pflag package also defines some new functions that are not in flag, that give one-letter shorthands for flags. You can use these by appending 'P' to the name of any function that defines a flag. var ip = flag.IntP("flagname", "f", 1234, "help message") var flagvar bool func init() { flag.BoolVarP("boolname", "b", true, "help message") } flag.VarP(&flagVar, "varname", "v", 1234, "help message") Shorthand letters can be used with single dashes on the command line. Boolean shorthand flags can be combined with other shorthand flags. Command line flag syntax: --flag // boolean flags only --flag=x Unlike the flag package, a single dash before an option means something different than a double dash. Single dashes signify a series of shorthand letters for flags. All but the last shorthand letter must be boolean flags. // boolean flags -f -abc // non-boolean flags -n 1234 -Ifile // mixed -abcs "hello" -abcn1234 Flag parsing stops after the terminator "--". Unlike the flag package, flags can be interspersed with arguments anywhere on the command line before this terminator. Integer flags accept 1234, 0664, 0x1234 and may be negative. Boolean flags (in their long form) accept 1, 0, t, f, true, false, TRUE, FALSE, True, False. Duration flags accept any input valid for time.ParseDuration. The default set of command-line flags is controlled by top-level functions. The FlagSet type allows one to define independent sets of flags, such as to implement subcommands in a command-line interface. The methods of FlagSet are analogous to the top-level functions for the command-line flag set. */ package pflag import ( "bytes" "errors" "fmt" "io" "os" "sort" "strings" ) // ErrHelp is the error returned if the flag -help is invoked but no such flag is defined. var ErrHelp = errors.New("pflag: help requested") // ErrorHandling defines how to handle flag parsing errors. type ErrorHandling int const ( // ContinueOnError will return an err from Parse() if an error is found ContinueOnError ErrorHandling = iota // ExitOnError will call os.Exit(2) if an error is found when parsing ExitOnError // PanicOnError will panic() if an error is found when parsing flags PanicOnError ) // NormalizedName is a flag name that has been normalized according to rules // for the FlagSet (e.g. making '-' and '_' equivalent). type NormalizedName string // A FlagSet represents a set of defined flags. type FlagSet struct { // Usage is the function called when an error occurs while parsing flags. // The field is a function (not a method) that may be changed to point to // a custom error handler. Usage func() // SortFlags is used to indicate, if user wants to have sorted flags in // help/usage messages. SortFlags bool name string parsed bool actual map[NormalizedName]*Flag orderedActual []*Flag sortedActual []*Flag formal map[NormalizedName]*Flag orderedFormal []*Flag sortedFormal []*Flag shorthands map[byte]*Flag args []string // arguments after flags argsLenAtDash int // len(args) when a '--' was located when parsing, or -1 if no -- errorHandling ErrorHandling output io.Writer // nil means stderr; use out() accessor interspersed bool // allow interspersed option/non-option args normalizeNameFunc func(f *FlagSet, name string) NormalizedName } // A Flag represents the state of a flag. type Flag struct { Name string // name as it appears on command line Shorthand string // one-letter abbreviated flag Usage string // help message Value Value // value as set DefValue string // default value (as text); for usage message Changed bool // If the user set the value (or if left to default) NoOptDefVal string // default value (as text); if the flag is on the command line without any options Deprecated string // If this flag is deprecated, this string is the new or now thing to use Hidden bool // used by cobra.Command to allow flags to be hidden from help/usage text ShorthandDeprecated string // If the shorthand of this flag is deprecated, this string is the new or now thing to use Annotations map[string][]string // used by cobra.Command bash autocomple code } // Value is the interface to the dynamic value stored in a flag. // (The default value is represented as a string.) type Value interface { String() string Set(string) error Type() string } // sortFlags returns the flags as a slice in lexicographical sorted order. func sortFlags(flags map[NormalizedName]*Flag) []*Flag { list := make(sort.StringSlice, len(flags)) i := 0 for k := range flags { list[i] = string(k) i++ } list.Sort() result := make([]*Flag, len(list)) for i, name := range list { result[i] = flags[NormalizedName(name)] } return result } // SetNormalizeFunc allows you to add a function which can translate flag names. // Flags added to the FlagSet will be translated and then when anything tries to // look up the flag that will also be translated. So it would be possible to create // a flag named "getURL" and have it translated to "geturl". A user could then pass // "--getUrl" which may also be translated to "geturl" and everything will work. func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) { f.normalizeNameFunc = n f.sortedFormal = f.sortedFormal[:0] for k, v := range f.orderedFormal { delete(f.formal, NormalizedName(v.Name)) nname := f.normalizeFlagName(v.Name) v.Name = string(nname) f.formal[nname] = v f.orderedFormal[k] = v } } // GetNormalizeFunc returns the previously set NormalizeFunc of a function which // does no translation, if not set previously. func (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) NormalizedName { if f.normalizeNameFunc != nil { return f.normalizeNameFunc } return func(f *FlagSet, name string) NormalizedName { return NormalizedName(name) } } func (f *FlagSet) normalizeFlagName(name string) NormalizedName { n := f.GetNormalizeFunc() return n(f, name) } func (f *FlagSet) out() io.Writer { if f.output == nil { return os.Stderr } return f.output } // SetOutput sets the destination for usage and error messages. // If output is nil, os.Stderr is used. func (f *FlagSet) SetOutput(output io.Writer) { f.output = output } // VisitAll visits the flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits all flags, even those not set. func (f *FlagSet) VisitAll(fn func(*Flag)) { if len(f.formal) == 0 { return } var flags []*Flag if f.SortFlags { if len(f.formal) != len(f.sortedFormal) { f.sortedFormal = sortFlags(f.formal) } flags = f.sortedFormal } else { flags = f.orderedFormal } for _, flag := range flags { fn(flag) } } // HasFlags returns a bool to indicate if the FlagSet has any flags definied. func (f *FlagSet) HasFlags() bool { return len(f.formal) > 0 } // HasAvailableFlags returns a bool to indicate if the FlagSet has any flags // definied that are not hidden or deprecated. func (f *FlagSet) HasAvailableFlags() bool { for _, flag := range f.formal { if !flag.Hidden && len(flag.Deprecated) == 0 { return true } } return false } // VisitAll visits the command-line flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits all flags, even those not set. func VisitAll(fn func(*Flag)) { CommandLine.VisitAll(fn) } // Visit visits the flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits only those flags that have been set. func (f *FlagSet) Visit(fn func(*Flag)) { if len(f.actual) == 0 { return } var flags []*Flag if f.SortFlags { if len(f.actual) != len(f.sortedActual) { f.sortedActual = sortFlags(f.actual) } flags = f.sortedActual } else { flags = f.orderedActual } for _, flag := range flags { fn(flag) } } // Visit visits the command-line flags in lexicographical order or // in primordial order if f.SortFlags is false, calling fn for each. // It visits only those flags that have been set. func Visit(fn func(*Flag)) { CommandLine.Visit(fn) } // Lookup returns the Flag structure of the named flag, returning nil if none exists. func (f *FlagSet) Lookup(name string) *Flag { return f.lookup(f.normalizeFlagName(name)) } // ShorthandLookup returns the Flag structure of the short handed flag, // returning nil if none exists. // It panics, if len(name) > 1. func (f *FlagSet) ShorthandLookup(name string) *Flag { if name == "" { return nil } if len(name) > 1 { msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name) fmt.Fprintf(f.out(), msg) panic(msg) } c := name[0] return f.shorthands[c] } // lookup returns the Flag structure of the named flag, returning nil if none exists. func (f *FlagSet) lookup(name NormalizedName) *Flag { return f.formal[name] } // func to return a given type for a given flag name func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) { flag := f.Lookup(name) if flag == nil { err := fmt.Errorf("flag accessed but not defined: %s", name) return nil, err } if flag.Value.Type() != ftype { err := fmt.Errorf("trying to get %s value of flag of type %s", ftype, flag.Value.Type()) return nil, err } sval := flag.Value.String() result, err := convFunc(sval) if err != nil { return nil, err } return result, nil } // ArgsLenAtDash will return the length of f.Args at the moment when a -- was // found during arg parsing. This allows your program to know which args were // before the -- and which came after. func (f *FlagSet) ArgsLenAtDash() int { return f.argsLenAtDash } // MarkDeprecated indicated that a flag is deprecated in your program. It will // continue to function but will not show up in help or usage messages. Using // this flag will also print the given usageMessage. func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error { flag := f.Lookup(name) if flag == nil { return fmt.Errorf("flag %q does not exist", name) } if usageMessage == "" { return fmt.Errorf("deprecated message for flag %q must be set", name) } flag.Deprecated = usageMessage return nil } // MarkShorthandDeprecated will mark the shorthand of a flag deprecated in your // program. It will continue to function but will not show up in help or usage // messages. Using this flag will also print the given usageMessage. func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) error { flag := f.Lookup(name) if flag == nil { return fmt.Errorf("flag %q does not exist", name) } if usageMessage == "" { return fmt.Errorf("deprecated message for flag %q must be set", name) } flag.ShorthandDeprecated = usageMessage return nil } // MarkHidden sets a flag to 'hidden' in your program. It will continue to // function but will not show up in help or usage messages. func (f *FlagSet) MarkHidden(name string) error { flag := f.Lookup(name) if flag == nil { return fmt.Errorf("flag %q does not exist", name) } flag.Hidden = true return nil } // Lookup returns the Flag structure of the named command-line flag, // returning nil if none exists. func Lookup(name string) *Flag { return CommandLine.Lookup(name) } // ShorthandLookup returns the Flag structure of the short handed flag, // returning nil if none exists. func ShorthandLookup(name string) *Flag { return CommandLine.ShorthandLookup(name) } // Set sets the value of the named flag. func (f *FlagSet) Set(name, value string) error { normalName := f.normalizeFlagName(name) flag, ok := f.formal[normalName] if !ok { return fmt.Errorf("no such flag -%v", name) } err := flag.Value.Set(value) if err != nil { var flagName string if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { flagName = fmt.Sprintf("-%s, --%s", flag.Shorthand, flag.Name) } else { flagName = fmt.Sprintf("--%s", flag.Name) } return fmt.Errorf("invalid argument %q for %q flag: %v", value, flagName, err) } if f.actual == nil { f.actual = make(map[NormalizedName]*Flag) } f.actual[normalName] = flag f.orderedActual = append(f.orderedActual, flag) flag.Changed = true if flag.Deprecated != "" { fmt.Fprintf(f.out(), "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated) } return nil } // SetAnnotation allows one to set arbitrary annotations on a flag in the FlagSet. // This is sometimes used by spf13/cobra programs which want to generate additional // bash completion information. func (f *FlagSet) SetAnnotation(name, key string, values []string) error { normalName := f.normalizeFlagName(name) flag, ok := f.formal[normalName] if !ok { return fmt.Errorf("no such flag -%v", name) } if flag.Annotations == nil { flag.Annotations = map[string][]string{} } flag.Annotations[key] = values return nil } // Changed returns true if the flag was explicitly set during Parse() and false // otherwise func (f *FlagSet) Changed(name string) bool { flag := f.Lookup(name) // If a flag doesn't exist, it wasn't changed.... if flag == nil { return false } return flag.Changed } // Set sets the value of the named command-line flag. func Set(name, value string) error { return CommandLine.Set(name, value) } // PrintDefaults prints, to standard error unless configured // otherwise, the default values of all defined flags in the set. func (f *FlagSet) PrintDefaults() { usages := f.FlagUsages() fmt.Fprint(f.out(), usages) } // defaultIsZeroValue returns true if the default value for this flag represents // a zero value. func (f *Flag) defaultIsZeroValue() bool { switch f.Value.(type) { case boolFlag: return f.DefValue == "false" case *durationValue: // Beginning in Go 1.7, duration zero values are "0s" return f.DefValue == "0" || f.DefValue == "0s" case *intValue, *int8Value, *int32Value, *int64Value, *uintValue, *uint8Value, *uint16Value, *uint32Value, *uint64Value, *countValue, *float32Value, *float64Value: return f.DefValue == "0" case *stringValue: return f.DefValue == "" case *ipValue, *ipMaskValue, *ipNetValue: return f.DefValue == "" case *intSliceValue, *stringSliceValue, *stringArrayValue: return f.DefValue == "[]" default: switch f.Value.String() { case "false": return true case "": return true case "": return true case "0": return true } return false } } // UnquoteUsage extracts a back-quoted name from the usage // string for a flag and returns it and the un-quoted usage. // Given "a `name` to show" it returns ("name", "a name to show"). // If there are no back quotes, the name is an educated guess of the // type of the flag's value, or the empty string if the flag is boolean. func UnquoteUsage(flag *Flag) (name string, usage string) { // Look for a back-quoted name, but avoid the strings package. usage = flag.Usage for i := 0; i < len(usage); i++ { if usage[i] == '`' { for j := i + 1; j < len(usage); j++ { if usage[j] == '`' { name = usage[i+1 : j] usage = usage[:i] + name + usage[j+1:] return name, usage } } break // Only one back quote; use type name. } } name = flag.Value.Type() switch name { case "bool": name = "" case "float64": name = "float" case "int64": name = "int" case "uint64": name = "uint" } return } // Splits the string `s` on whitespace into an initial substring up to // `i` runes in length and the remainder. Will go `slop` over `i` if // that encompasses the entire string (which allows the caller to // avoid short orphan words on the final line). func wrapN(i, slop int, s string) (string, string) { if i+slop > len(s) { return s, "" } w := strings.LastIndexAny(s[:i], " \t") if w <= 0 { return s, "" } return s[:w], s[w+1:] } // Wraps the string `s` to a maximum width `w` with leading indent // `i`. The first line is not indented (this is assumed to be done by // caller). Pass `w` == 0 to do no wrapping func wrap(i, w int, s string) string { if w == 0 { return s } // space between indent i and end of line width w into which // we should wrap the text. wrap := w - i var r, l string // Not enough space for sensible wrapping. Wrap as a block on // the next line instead. if wrap < 24 { i = 16 wrap = w - i r += "\n" + strings.Repeat(" ", i) } // If still not enough space then don't even try to wrap. if wrap < 24 { return s } // Try to avoid short orphan words on the final line, by // allowing wrapN to go a bit over if that would fit in the // remainder of the line. slop := 5 wrap = wrap - slop // Handle first line, which is indented by the caller (or the // special case above) l, s = wrapN(wrap, slop, s) r = r + l // Now wrap the rest for s != "" { var t string t, s = wrapN(wrap, slop, s) r = r + "\n" + strings.Repeat(" ", i) + t } return r } // FlagUsagesWrapped returns a string containing the usage information // for all flags in the FlagSet. Wrapped to `cols` columns (0 for no // wrapping) func (f *FlagSet) FlagUsagesWrapped(cols int) string { buf := new(bytes.Buffer) lines := make([]string, 0, len(f.formal)) maxlen := 0 f.VisitAll(func(flag *Flag) { if flag.Deprecated != "" || flag.Hidden { return } line := "" if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { line = fmt.Sprintf(" -%s, --%s", flag.Shorthand, flag.Name) } else { line = fmt.Sprintf(" --%s", flag.Name) } varname, usage := UnquoteUsage(flag) if varname != "" { line += " " + varname } if flag.NoOptDefVal != "" { switch flag.Value.Type() { case "string": line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal) case "bool": if flag.NoOptDefVal != "true" { line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) } default: line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) } } // This special character will be replaced with spacing once the // correct alignment is calculated line += "\x00" if len(line) > maxlen { maxlen = len(line) } line += usage if !flag.defaultIsZeroValue() { if flag.Value.Type() == "string" { line += fmt.Sprintf(" (default %q)", flag.DefValue) } else { line += fmt.Sprintf(" (default %s)", flag.DefValue) } } lines = append(lines, line) }) for _, line := range lines { sidx := strings.Index(line, "\x00") spacing := strings.Repeat(" ", maxlen-sidx) // maxlen + 2 comes from + 1 for the \x00 and + 1 for the (deliberate) off-by-one in maxlen-sidx fmt.Fprintln(buf, line[:sidx], spacing, wrap(maxlen+2, cols, line[sidx+1:])) } return buf.String() } // FlagUsages returns a string containing the usage information for all flags in // the FlagSet func (f *FlagSet) FlagUsages() string { return f.FlagUsagesWrapped(0) } // PrintDefaults prints to standard error the default values of all defined command-line flags. func PrintDefaults() { CommandLine.PrintDefaults() } // defaultUsage is the default function to print a usage message. func defaultUsage(f *FlagSet) { fmt.Fprintf(f.out(), "Usage of %s:\n", f.name) f.PrintDefaults() } // NOTE: Usage is not just defaultUsage(CommandLine) // because it serves (via godoc flag Usage) as the example // for how to write your own usage function. // Usage prints to standard error a usage message documenting all defined command-line flags. // The function is a variable that may be changed to point to a custom function. // By default it prints a simple header and calls PrintDefaults; for details about the // format of the output and how to control it, see the documentation for PrintDefaults. var Usage = func() { fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0]) PrintDefaults() } // NFlag returns the number of flags that have been set. func (f *FlagSet) NFlag() int { return len(f.actual) } // NFlag returns the number of command-line flags that have been set. func NFlag() int { return len(CommandLine.actual) } // Arg returns the i'th argument. Arg(0) is the first remaining argument // after flags have been processed. func (f *FlagSet) Arg(i int) string { if i < 0 || i >= len(f.args) { return "" } return f.args[i] } // Arg returns the i'th command-line argument. Arg(0) is the first remaining argument // after flags have been processed. func Arg(i int) string { return CommandLine.Arg(i) } // NArg is the number of arguments remaining after flags have been processed. func (f *FlagSet) NArg() int { return len(f.args) } // NArg is the number of arguments remaining after flags have been processed. func NArg() int { return len(CommandLine.args) } // Args returns the non-flag arguments. func (f *FlagSet) Args() []string { return f.args } // Args returns the non-flag command-line arguments. func Args() []string { return CommandLine.args } // Var defines a flag with the specified name and usage string. The type and // value of the flag are represented by the first argument, of type Value, which // typically holds a user-defined implementation of Value. For instance, the // caller could create a flag that turns a comma-separated string into a slice // of strings by giving the slice the methods of Value; in particular, Set would // decompose the comma-separated string into the slice. func (f *FlagSet) Var(value Value, name string, usage string) { f.VarP(value, name, "", usage) } // VarPF is like VarP, but returns the flag created func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag { // Remember the default value as a string; it won't change. flag := &Flag{ Name: name, Shorthand: shorthand, Usage: usage, Value: value, DefValue: value.String(), } f.AddFlag(flag) return flag } // VarP is like Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) VarP(value Value, name, shorthand, usage string) { f.VarPF(value, name, shorthand, usage) } // AddFlag will add the flag to the FlagSet func (f *FlagSet) AddFlag(flag *Flag) { normalizedFlagName := f.normalizeFlagName(flag.Name) _, alreadyThere := f.formal[normalizedFlagName] if alreadyThere { msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name) fmt.Fprintln(f.out(), msg) panic(msg) // Happens only if flags are declared with identical names } if f.formal == nil { f.formal = make(map[NormalizedName]*Flag) } flag.Name = string(normalizedFlagName) f.formal[normalizedFlagName] = flag f.orderedFormal = append(f.orderedFormal, flag) if flag.Shorthand == "" { return } if len(flag.Shorthand) > 1 { msg := fmt.Sprintf("%q shorthand is more than one ASCII character", flag.Shorthand) fmt.Fprintf(f.out(), msg) panic(msg) } if f.shorthands == nil { f.shorthands = make(map[byte]*Flag) } c := flag.Shorthand[0] used, alreadyThere := f.shorthands[c] if alreadyThere { msg := fmt.Sprintf("unable to redefine %q shorthand in %q flagset: it's already used for %q flag", c, f.name, used.Name) fmt.Fprintf(f.out(), msg) panic(msg) } f.shorthands[c] = flag } // AddFlagSet adds one FlagSet to another. If a flag is already present in f // the flag from newSet will be ignored. func (f *FlagSet) AddFlagSet(newSet *FlagSet) { if newSet == nil { return } newSet.VisitAll(func(flag *Flag) { if f.Lookup(flag.Name) == nil { f.AddFlag(flag) } }) } // Var defines a flag with the specified name and usage string. The type and // value of the flag are represented by the first argument, of type Value, which // typically holds a user-defined implementation of Value. For instance, the // caller could create a flag that turns a comma-separated string into a slice // of strings by giving the slice the methods of Value; in particular, Set would // decompose the comma-separated string into the slice. func Var(value Value, name string, usage string) { CommandLine.VarP(value, name, "", usage) } // VarP is like Var, but accepts a shorthand letter that can be used after a single dash. func VarP(value Value, name, shorthand, usage string) { CommandLine.VarP(value, name, shorthand, usage) } // failf prints to standard error a formatted error and usage message and // returns the error. func (f *FlagSet) failf(format string, a ...interface{}) error { err := fmt.Errorf(format, a...) fmt.Fprintln(f.out(), err) f.usage() return err } // usage calls the Usage method for the flag set, or the usage function if // the flag set is CommandLine. func (f *FlagSet) usage() { if f == CommandLine { Usage() } else if f.Usage == nil { defaultUsage(f) } else { f.Usage() } } func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) { a = args name := s[2:] if len(name) == 0 || name[0] == '-' || name[0] == '=' { err = f.failf("bad flag syntax: %s", s) return } split := strings.SplitN(name, "=", 2) name = split[0] flag, exists := f.formal[f.normalizeFlagName(name)] if !exists { if name == "help" { // special case for nice help message. f.usage() return a, ErrHelp } err = f.failf("unknown flag: --%s", name) return } var value string if len(split) == 2 { // '--flag=arg' value = split[1] } else if flag.NoOptDefVal != "" { // '--flag' (arg was optional) value = flag.NoOptDefVal } else if len(a) > 0 { // '--flag arg' value = a[0] a = a[1:] } else { // '--flag' (arg was required) err = f.failf("flag needs an argument: %s", s) return } err = fn(flag, value) return } func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) { if strings.HasPrefix(shorthands, "test.") { return } outArgs = args outShorts = shorthands[1:] c := shorthands[0] flag, exists := f.shorthands[c] if !exists { if c == 'h' { // special case for nice help message. f.usage() err = ErrHelp return } err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands) return } var value string if len(shorthands) > 2 && shorthands[1] == '=' { // '-f=arg' value = shorthands[2:] outShorts = "" } else if flag.NoOptDefVal != "" { // '-f' (arg was optional) value = flag.NoOptDefVal } else if len(shorthands) > 1 { // '-farg' value = shorthands[1:] outShorts = "" } else if len(args) > 0 { // '-f arg' value = args[0] outArgs = args[1:] } else { // '-f' (arg was required) err = f.failf("flag needs an argument: %q in -%s", c, shorthands) return } if flag.ShorthandDeprecated != "" { fmt.Fprintf(f.out(), "Flag shorthand -%s has been deprecated, %s\n", flag.Shorthand, flag.ShorthandDeprecated) } err = fn(flag, value) return } func (f *FlagSet) parseShortArg(s string, args []string, fn parseFunc) (a []string, err error) { a = args shorthands := s[1:] // "shorthands" can be a series of shorthand letters of flags (e.g. "-vvv"). for len(shorthands) > 0 { shorthands, a, err = f.parseSingleShortArg(shorthands, args, fn) if err != nil { return } } return } func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) { for len(args) > 0 { s := args[0] args = args[1:] if len(s) == 0 || s[0] != '-' || len(s) == 1 { if !f.interspersed { f.args = append(f.args, s) f.args = append(f.args, args...) return nil } f.args = append(f.args, s) continue } if s[1] == '-' { if len(s) == 2 { // "--" terminates the flags f.argsLenAtDash = len(f.args) f.args = append(f.args, args...) break } args, err = f.parseLongArg(s, args, fn) } else { args, err = f.parseShortArg(s, args, fn) } if err != nil { return } } return } // Parse parses flag definitions from the argument list, which should not // include the command name. Must be called after all flags in the FlagSet // are defined and before flags are accessed by the program. // The return value will be ErrHelp if -help was set but not defined. func (f *FlagSet) Parse(arguments []string) error { f.parsed = true if len(arguments) < 0 { return nil } f.args = make([]string, 0, len(arguments)) set := func(flag *Flag, value string) error { return f.Set(flag.Name, value) } err := f.parseArgs(arguments, set) if err != nil { switch f.errorHandling { case ContinueOnError: return err case ExitOnError: os.Exit(2) case PanicOnError: panic(err) } } return nil } type parseFunc func(flag *Flag, value string) error // ParseAll parses flag definitions from the argument list, which should not // include the command name. The arguments for fn are flag and value. Must be // called after all flags in the FlagSet are defined and before flags are // accessed by the program. The return value will be ErrHelp if -help was set // but not defined. func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string) error) error { f.parsed = true f.args = make([]string, 0, len(arguments)) err := f.parseArgs(arguments, fn) if err != nil { switch f.errorHandling { case ContinueOnError: return err case ExitOnError: os.Exit(2) case PanicOnError: panic(err) } } return nil } // Parsed reports whether f.Parse has been called. func (f *FlagSet) Parsed() bool { return f.parsed } // Parse parses the command-line flags from os.Args[1:]. Must be called // after all flags are defined and before flags are accessed by the program. func Parse() { // Ignore errors; CommandLine is set for ExitOnError. CommandLine.Parse(os.Args[1:]) } // ParseAll parses the command-line flags from os.Args[1:] and called fn for each. // The arguments for fn are flag and value. Must be called after all flags are // defined and before flags are accessed by the program. func ParseAll(fn func(flag *Flag, value string) error) { // Ignore errors; CommandLine is set for ExitOnError. CommandLine.ParseAll(os.Args[1:], fn) } // SetInterspersed sets whether to support interspersed option/non-option arguments. func SetInterspersed(interspersed bool) { CommandLine.SetInterspersed(interspersed) } // Parsed returns true if the command-line flags have been parsed. func Parsed() bool { return CommandLine.Parsed() } // CommandLine is the default set of command-line flags, parsed from os.Args. var CommandLine = NewFlagSet(os.Args[0], ExitOnError) // NewFlagSet returns a new, empty flag set with the specified name, // error handling property and SortFlags set to true. func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet { f := &FlagSet{ name: name, errorHandling: errorHandling, argsLenAtDash: -1, interspersed: true, SortFlags: true, } return f } // SetInterspersed sets whether to support interspersed option/non-option arguments. func (f *FlagSet) SetInterspersed(interspersed bool) { f.interspersed = interspersed } // Init sets the name and error handling property for a flag set. // By default, the zero FlagSet uses an empty name and the // ContinueOnError error handling policy. func (f *FlagSet) Init(name string, errorHandling ErrorHandling) { f.name = name f.errorHandling = errorHandling f.argsLenAtDash = -1 } ================================================ FILE: vendor/github.com/spf13/pflag/float32.go ================================================ package pflag import "strconv" // -- float32 Value type float32Value float32 func newFloat32Value(val float32, p *float32) *float32Value { *p = val return (*float32Value)(p) } func (f *float32Value) Set(s string) error { v, err := strconv.ParseFloat(s, 32) *f = float32Value(v) return err } func (f *float32Value) Type() string { return "float32" } func (f *float32Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 32) } func float32Conv(sval string) (interface{}, error) { v, err := strconv.ParseFloat(sval, 32) if err != nil { return 0, err } return float32(v), nil } // GetFloat32 return the float32 value of a flag with the given name func (f *FlagSet) GetFloat32(name string) (float32, error) { val, err := f.getFlagType(name, "float32", float32Conv) if err != nil { return 0, err } return val.(float32), nil } // Float32Var defines a float32 flag with specified name, default value, and usage string. // The argument p points to a float32 variable in which to store the value of the flag. func (f *FlagSet) Float32Var(p *float32, name string, value float32, usage string) { f.VarP(newFloat32Value(value, p), name, "", usage) } // Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value float32, usage string) { f.VarP(newFloat32Value(value, p), name, shorthand, usage) } // Float32Var defines a float32 flag with specified name, default value, and usage string. // The argument p points to a float32 variable in which to store the value of the flag. func Float32Var(p *float32, name string, value float32, usage string) { CommandLine.VarP(newFloat32Value(value, p), name, "", usage) } // Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash. func Float32VarP(p *float32, name, shorthand string, value float32, usage string) { CommandLine.VarP(newFloat32Value(value, p), name, shorthand, usage) } // Float32 defines a float32 flag with specified name, default value, and usage string. // The return value is the address of a float32 variable that stores the value of the flag. func (f *FlagSet) Float32(name string, value float32, usage string) *float32 { p := new(float32) f.Float32VarP(p, name, "", value, usage) return p } // Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float32P(name, shorthand string, value float32, usage string) *float32 { p := new(float32) f.Float32VarP(p, name, shorthand, value, usage) return p } // Float32 defines a float32 flag with specified name, default value, and usage string. // The return value is the address of a float32 variable that stores the value of the flag. func Float32(name string, value float32, usage string) *float32 { return CommandLine.Float32P(name, "", value, usage) } // Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash. func Float32P(name, shorthand string, value float32, usage string) *float32 { return CommandLine.Float32P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/float64.go ================================================ package pflag import "strconv" // -- float64 Value type float64Value float64 func newFloat64Value(val float64, p *float64) *float64Value { *p = val return (*float64Value)(p) } func (f *float64Value) Set(s string) error { v, err := strconv.ParseFloat(s, 64) *f = float64Value(v) return err } func (f *float64Value) Type() string { return "float64" } func (f *float64Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 64) } func float64Conv(sval string) (interface{}, error) { return strconv.ParseFloat(sval, 64) } // GetFloat64 return the float64 value of a flag with the given name func (f *FlagSet) GetFloat64(name string) (float64, error) { val, err := f.getFlagType(name, "float64", float64Conv) if err != nil { return 0, err } return val.(float64), nil } // Float64Var defines a float64 flag with specified name, default value, and usage string. // The argument p points to a float64 variable in which to store the value of the flag. func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage string) { f.VarP(newFloat64Value(value, p), name, "", usage) } // Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float64VarP(p *float64, name, shorthand string, value float64, usage string) { f.VarP(newFloat64Value(value, p), name, shorthand, usage) } // Float64Var defines a float64 flag with specified name, default value, and usage string. // The argument p points to a float64 variable in which to store the value of the flag. func Float64Var(p *float64, name string, value float64, usage string) { CommandLine.VarP(newFloat64Value(value, p), name, "", usage) } // Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash. func Float64VarP(p *float64, name, shorthand string, value float64, usage string) { CommandLine.VarP(newFloat64Value(value, p), name, shorthand, usage) } // Float64 defines a float64 flag with specified name, default value, and usage string. // The return value is the address of a float64 variable that stores the value of the flag. func (f *FlagSet) Float64(name string, value float64, usage string) *float64 { p := new(float64) f.Float64VarP(p, name, "", value, usage) return p } // Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Float64P(name, shorthand string, value float64, usage string) *float64 { p := new(float64) f.Float64VarP(p, name, shorthand, value, usage) return p } // Float64 defines a float64 flag with specified name, default value, and usage string. // The return value is the address of a float64 variable that stores the value of the flag. func Float64(name string, value float64, usage string) *float64 { return CommandLine.Float64P(name, "", value, usage) } // Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash. func Float64P(name, shorthand string, value float64, usage string) *float64 { return CommandLine.Float64P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/golangflag.go ================================================ // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package pflag import ( goflag "flag" "reflect" "strings" ) // flagValueWrapper implements pflag.Value around a flag.Value. The main // difference here is the addition of the Type method that returns a string // name of the type. As this is generally unknown, we approximate that with // reflection. type flagValueWrapper struct { inner goflag.Value flagType string } // We are just copying the boolFlag interface out of goflag as that is what // they use to decide if a flag should get "true" when no arg is given. type goBoolFlag interface { goflag.Value IsBoolFlag() bool } func wrapFlagValue(v goflag.Value) Value { // If the flag.Value happens to also be a pflag.Value, just use it directly. if pv, ok := v.(Value); ok { return pv } pv := &flagValueWrapper{ inner: v, } t := reflect.TypeOf(v) if t.Kind() == reflect.Interface || t.Kind() == reflect.Ptr { t = t.Elem() } pv.flagType = strings.TrimSuffix(t.Name(), "Value") return pv } func (v *flagValueWrapper) String() string { return v.inner.String() } func (v *flagValueWrapper) Set(s string) error { return v.inner.Set(s) } func (v *flagValueWrapper) Type() string { return v.flagType } // PFlagFromGoFlag will return a *pflag.Flag given a *flag.Flag // If the *flag.Flag.Name was a single character (ex: `v`) it will be accessiblei // with both `-v` and `--v` in flags. If the golang flag was more than a single // character (ex: `verbose`) it will only be accessible via `--verbose` func PFlagFromGoFlag(goflag *goflag.Flag) *Flag { // Remember the default value as a string; it won't change. flag := &Flag{ Name: goflag.Name, Usage: goflag.Usage, Value: wrapFlagValue(goflag.Value), // Looks like golang flags don't set DefValue correctly :-( //DefValue: goflag.DefValue, DefValue: goflag.Value.String(), } // Ex: if the golang flag was -v, allow both -v and --v to work if len(flag.Name) == 1 { flag.Shorthand = flag.Name } if fv, ok := goflag.Value.(goBoolFlag); ok && fv.IsBoolFlag() { flag.NoOptDefVal = "true" } return flag } // AddGoFlag will add the given *flag.Flag to the pflag.FlagSet func (f *FlagSet) AddGoFlag(goflag *goflag.Flag) { if f.Lookup(goflag.Name) != nil { return } newflag := PFlagFromGoFlag(goflag) f.AddFlag(newflag) } // AddGoFlagSet will add the given *flag.FlagSet to the pflag.FlagSet func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) { if newSet == nil { return } newSet.VisitAll(func(goflag *goflag.Flag) { f.AddGoFlag(goflag) }) } ================================================ FILE: vendor/github.com/spf13/pflag/int.go ================================================ package pflag import "strconv" // -- int Value type intValue int func newIntValue(val int, p *int) *intValue { *p = val return (*intValue)(p) } func (i *intValue) Set(s string) error { v, err := strconv.ParseInt(s, 0, 64) *i = intValue(v) return err } func (i *intValue) Type() string { return "int" } func (i *intValue) String() string { return strconv.Itoa(int(*i)) } func intConv(sval string) (interface{}, error) { return strconv.Atoi(sval) } // GetInt return the int value of a flag with the given name func (f *FlagSet) GetInt(name string) (int, error) { val, err := f.getFlagType(name, "int", intConv) if err != nil { return 0, err } return val.(int), nil } // IntVar defines an int flag with specified name, default value, and usage string. // The argument p points to an int variable in which to store the value of the flag. func (f *FlagSet) IntVar(p *int, name string, value int, usage string) { f.VarP(newIntValue(value, p), name, "", usage) } // IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usage string) { f.VarP(newIntValue(value, p), name, shorthand, usage) } // IntVar defines an int flag with specified name, default value, and usage string. // The argument p points to an int variable in which to store the value of the flag. func IntVar(p *int, name string, value int, usage string) { CommandLine.VarP(newIntValue(value, p), name, "", usage) } // IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash. func IntVarP(p *int, name, shorthand string, value int, usage string) { CommandLine.VarP(newIntValue(value, p), name, shorthand, usage) } // Int defines an int flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. func (f *FlagSet) Int(name string, value int, usage string) *int { p := new(int) f.IntVarP(p, name, "", value, usage) return p } // IntP is like Int, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IntP(name, shorthand string, value int, usage string) *int { p := new(int) f.IntVarP(p, name, shorthand, value, usage) return p } // Int defines an int flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. func Int(name string, value int, usage string) *int { return CommandLine.IntP(name, "", value, usage) } // IntP is like Int, but accepts a shorthand letter that can be used after a single dash. func IntP(name, shorthand string, value int, usage string) *int { return CommandLine.IntP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int32.go ================================================ package pflag import "strconv" // -- int32 Value type int32Value int32 func newInt32Value(val int32, p *int32) *int32Value { *p = val return (*int32Value)(p) } func (i *int32Value) Set(s string) error { v, err := strconv.ParseInt(s, 0, 32) *i = int32Value(v) return err } func (i *int32Value) Type() string { return "int32" } func (i *int32Value) String() string { return strconv.FormatInt(int64(*i), 10) } func int32Conv(sval string) (interface{}, error) { v, err := strconv.ParseInt(sval, 0, 32) if err != nil { return 0, err } return int32(v), nil } // GetInt32 return the int32 value of a flag with the given name func (f *FlagSet) GetInt32(name string) (int32, error) { val, err := f.getFlagType(name, "int32", int32Conv) if err != nil { return 0, err } return val.(int32), nil } // Int32Var defines an int32 flag with specified name, default value, and usage string. // The argument p points to an int32 variable in which to store the value of the flag. func (f *FlagSet) Int32Var(p *int32, name string, value int32, usage string) { f.VarP(newInt32Value(value, p), name, "", usage) } // Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int32VarP(p *int32, name, shorthand string, value int32, usage string) { f.VarP(newInt32Value(value, p), name, shorthand, usage) } // Int32Var defines an int32 flag with specified name, default value, and usage string. // The argument p points to an int32 variable in which to store the value of the flag. func Int32Var(p *int32, name string, value int32, usage string) { CommandLine.VarP(newInt32Value(value, p), name, "", usage) } // Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash. func Int32VarP(p *int32, name, shorthand string, value int32, usage string) { CommandLine.VarP(newInt32Value(value, p), name, shorthand, usage) } // Int32 defines an int32 flag with specified name, default value, and usage string. // The return value is the address of an int32 variable that stores the value of the flag. func (f *FlagSet) Int32(name string, value int32, usage string) *int32 { p := new(int32) f.Int32VarP(p, name, "", value, usage) return p } // Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int32P(name, shorthand string, value int32, usage string) *int32 { p := new(int32) f.Int32VarP(p, name, shorthand, value, usage) return p } // Int32 defines an int32 flag with specified name, default value, and usage string. // The return value is the address of an int32 variable that stores the value of the flag. func Int32(name string, value int32, usage string) *int32 { return CommandLine.Int32P(name, "", value, usage) } // Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash. func Int32P(name, shorthand string, value int32, usage string) *int32 { return CommandLine.Int32P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int64.go ================================================ package pflag import "strconv" // -- int64 Value type int64Value int64 func newInt64Value(val int64, p *int64) *int64Value { *p = val return (*int64Value)(p) } func (i *int64Value) Set(s string) error { v, err := strconv.ParseInt(s, 0, 64) *i = int64Value(v) return err } func (i *int64Value) Type() string { return "int64" } func (i *int64Value) String() string { return strconv.FormatInt(int64(*i), 10) } func int64Conv(sval string) (interface{}, error) { return strconv.ParseInt(sval, 0, 64) } // GetInt64 return the int64 value of a flag with the given name func (f *FlagSet) GetInt64(name string) (int64, error) { val, err := f.getFlagType(name, "int64", int64Conv) if err != nil { return 0, err } return val.(int64), nil } // Int64Var defines an int64 flag with specified name, default value, and usage string. // The argument p points to an int64 variable in which to store the value of the flag. func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string) { f.VarP(newInt64Value(value, p), name, "", usage) } // Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int64VarP(p *int64, name, shorthand string, value int64, usage string) { f.VarP(newInt64Value(value, p), name, shorthand, usage) } // Int64Var defines an int64 flag with specified name, default value, and usage string. // The argument p points to an int64 variable in which to store the value of the flag. func Int64Var(p *int64, name string, value int64, usage string) { CommandLine.VarP(newInt64Value(value, p), name, "", usage) } // Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash. func Int64VarP(p *int64, name, shorthand string, value int64, usage string) { CommandLine.VarP(newInt64Value(value, p), name, shorthand, usage) } // Int64 defines an int64 flag with specified name, default value, and usage string. // The return value is the address of an int64 variable that stores the value of the flag. func (f *FlagSet) Int64(name string, value int64, usage string) *int64 { p := new(int64) f.Int64VarP(p, name, "", value, usage) return p } // Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int64P(name, shorthand string, value int64, usage string) *int64 { p := new(int64) f.Int64VarP(p, name, shorthand, value, usage) return p } // Int64 defines an int64 flag with specified name, default value, and usage string. // The return value is the address of an int64 variable that stores the value of the flag. func Int64(name string, value int64, usage string) *int64 { return CommandLine.Int64P(name, "", value, usage) } // Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash. func Int64P(name, shorthand string, value int64, usage string) *int64 { return CommandLine.Int64P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int8.go ================================================ package pflag import "strconv" // -- int8 Value type int8Value int8 func newInt8Value(val int8, p *int8) *int8Value { *p = val return (*int8Value)(p) } func (i *int8Value) Set(s string) error { v, err := strconv.ParseInt(s, 0, 8) *i = int8Value(v) return err } func (i *int8Value) Type() string { return "int8" } func (i *int8Value) String() string { return strconv.FormatInt(int64(*i), 10) } func int8Conv(sval string) (interface{}, error) { v, err := strconv.ParseInt(sval, 0, 8) if err != nil { return 0, err } return int8(v), nil } // GetInt8 return the int8 value of a flag with the given name func (f *FlagSet) GetInt8(name string) (int8, error) { val, err := f.getFlagType(name, "int8", int8Conv) if err != nil { return 0, err } return val.(int8), nil } // Int8Var defines an int8 flag with specified name, default value, and usage string. // The argument p points to an int8 variable in which to store the value of the flag. func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) { f.VarP(newInt8Value(value, p), name, "", usage) } // Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, usage string) { f.VarP(newInt8Value(value, p), name, shorthand, usage) } // Int8Var defines an int8 flag with specified name, default value, and usage string. // The argument p points to an int8 variable in which to store the value of the flag. func Int8Var(p *int8, name string, value int8, usage string) { CommandLine.VarP(newInt8Value(value, p), name, "", usage) } // Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash. func Int8VarP(p *int8, name, shorthand string, value int8, usage string) { CommandLine.VarP(newInt8Value(value, p), name, shorthand, usage) } // Int8 defines an int8 flag with specified name, default value, and usage string. // The return value is the address of an int8 variable that stores the value of the flag. func (f *FlagSet) Int8(name string, value int8, usage string) *int8 { p := new(int8) f.Int8VarP(p, name, "", value, usage) return p } // Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Int8P(name, shorthand string, value int8, usage string) *int8 { p := new(int8) f.Int8VarP(p, name, shorthand, value, usage) return p } // Int8 defines an int8 flag with specified name, default value, and usage string. // The return value is the address of an int8 variable that stores the value of the flag. func Int8(name string, value int8, usage string) *int8 { return CommandLine.Int8P(name, "", value, usage) } // Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash. func Int8P(name, shorthand string, value int8, usage string) *int8 { return CommandLine.Int8P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/int_slice.go ================================================ package pflag import ( "fmt" "strconv" "strings" ) // -- intSlice Value type intSliceValue struct { value *[]int changed bool } func newIntSliceValue(val []int, p *[]int) *intSliceValue { isv := new(intSliceValue) isv.value = p *isv.value = val return isv } func (s *intSliceValue) Set(val string) error { ss := strings.Split(val, ",") out := make([]int, len(ss)) for i, d := range ss { var err error out[i], err = strconv.Atoi(d) if err != nil { return err } } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } func (s *intSliceValue) Type() string { return "intSlice" } func (s *intSliceValue) String() string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = fmt.Sprintf("%d", d) } return "[" + strings.Join(out, ",") + "]" } func intSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []int{}, nil } ss := strings.Split(val, ",") out := make([]int, len(ss)) for i, d := range ss { var err error out[i], err = strconv.Atoi(d) if err != nil { return nil, err } } return out, nil } // GetIntSlice return the []int value of a flag with the given name func (f *FlagSet) GetIntSlice(name string) ([]int, error) { val, err := f.getFlagType(name, "intSlice", intSliceConv) if err != nil { return []int{}, err } return val.([]int), nil } // IntSliceVar defines a intSlice flag with specified name, default value, and usage string. // The argument p points to a []int variable in which to store the value of the flag. func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string) { f.VarP(newIntSliceValue(value, p), name, "", usage) } // IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) { f.VarP(newIntSliceValue(value, p), name, shorthand, usage) } // IntSliceVar defines a int[] flag with specified name, default value, and usage string. // The argument p points to a int[] variable in which to store the value of the flag. func IntSliceVar(p *[]int, name string, value []int, usage string) { CommandLine.VarP(newIntSliceValue(value, p), name, "", usage) } // IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) { CommandLine.VarP(newIntSliceValue(value, p), name, shorthand, usage) } // IntSlice defines a []int flag with specified name, default value, and usage string. // The return value is the address of a []int variable that stores the value of the flag. func (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int { p := []int{} f.IntSliceVarP(&p, name, "", value, usage) return &p } // IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage string) *[]int { p := []int{} f.IntSliceVarP(&p, name, shorthand, value, usage) return &p } // IntSlice defines a []int flag with specified name, default value, and usage string. // The return value is the address of a []int variable that stores the value of the flag. func IntSlice(name string, value []int, usage string) *[]int { return CommandLine.IntSliceP(name, "", value, usage) } // IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash. func IntSliceP(name, shorthand string, value []int, usage string) *[]int { return CommandLine.IntSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/ip.go ================================================ package pflag import ( "fmt" "net" "strings" ) // -- net.IP value type ipValue net.IP func newIPValue(val net.IP, p *net.IP) *ipValue { *p = val return (*ipValue)(p) } func (i *ipValue) String() string { return net.IP(*i).String() } func (i *ipValue) Set(s string) error { ip := net.ParseIP(strings.TrimSpace(s)) if ip == nil { return fmt.Errorf("failed to parse IP: %q", s) } *i = ipValue(ip) return nil } func (i *ipValue) Type() string { return "ip" } func ipConv(sval string) (interface{}, error) { ip := net.ParseIP(sval) if ip != nil { return ip, nil } return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval) } // GetIP return the net.IP value of a flag with the given name func (f *FlagSet) GetIP(name string) (net.IP, error) { val, err := f.getFlagType(name, "ip", ipConv) if err != nil { return nil, err } return val.(net.IP), nil } // IPVar defines an net.IP flag with specified name, default value, and usage string. // The argument p points to an net.IP variable in which to store the value of the flag. func (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage string) { f.VarP(newIPValue(value, p), name, "", usage) } // IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) { f.VarP(newIPValue(value, p), name, shorthand, usage) } // IPVar defines an net.IP flag with specified name, default value, and usage string. // The argument p points to an net.IP variable in which to store the value of the flag. func IPVar(p *net.IP, name string, value net.IP, usage string) { CommandLine.VarP(newIPValue(value, p), name, "", usage) } // IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash. func IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) { CommandLine.VarP(newIPValue(value, p), name, shorthand, usage) } // IP defines an net.IP flag with specified name, default value, and usage string. // The return value is the address of an net.IP variable that stores the value of the flag. func (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP { p := new(net.IP) f.IPVarP(p, name, "", value, usage) return p } // IPP is like IP, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPP(name, shorthand string, value net.IP, usage string) *net.IP { p := new(net.IP) f.IPVarP(p, name, shorthand, value, usage) return p } // IP defines an net.IP flag with specified name, default value, and usage string. // The return value is the address of an net.IP variable that stores the value of the flag. func IP(name string, value net.IP, usage string) *net.IP { return CommandLine.IPP(name, "", value, usage) } // IPP is like IP, but accepts a shorthand letter that can be used after a single dash. func IPP(name, shorthand string, value net.IP, usage string) *net.IP { return CommandLine.IPP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/ip_slice.go ================================================ package pflag import ( "fmt" "io" "net" "strings" ) // -- ipSlice Value type ipSliceValue struct { value *[]net.IP changed bool } func newIPSliceValue(val []net.IP, p *[]net.IP) *ipSliceValue { ipsv := new(ipSliceValue) ipsv.value = p *ipsv.value = val return ipsv } // Set converts, and assigns, the comma-separated IP argument string representation as the []net.IP value of this flag. // If Set is called on a flag that already has a []net.IP assigned, the newly converted values will be appended. func (s *ipSliceValue) Set(val string) error { // remove all quote characters rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "") // read flag arguments with CSV parser ipStrSlice, err := readAsCSV(rmQuote.Replace(val)) if err != nil && err != io.EOF { return err } // parse ip values into slice out := make([]net.IP, 0, len(ipStrSlice)) for _, ipStr := range ipStrSlice { ip := net.ParseIP(strings.TrimSpace(ipStr)) if ip == nil { return fmt.Errorf("invalid string being converted to IP address: %s", ipStr) } out = append(out, ip) } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } // Type returns a string that uniquely represents this flag's type. func (s *ipSliceValue) Type() string { return "ipSlice" } // String defines a "native" format for this net.IP slice flag value. func (s *ipSliceValue) String() string { ipStrSlice := make([]string, len(*s.value)) for i, ip := range *s.value { ipStrSlice[i] = ip.String() } out, _ := writeAsCSV(ipStrSlice) return "[" + out + "]" } func ipSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Emtpy string would cause a slice with one (empty) entry if len(val) == 0 { return []net.IP{}, nil } ss := strings.Split(val, ",") out := make([]net.IP, len(ss)) for i, sval := range ss { ip := net.ParseIP(strings.TrimSpace(sval)) if ip == nil { return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval) } out[i] = ip } return out, nil } // GetIPSlice returns the []net.IP value of a flag with the given name func (f *FlagSet) GetIPSlice(name string) ([]net.IP, error) { val, err := f.getFlagType(name, "ipSlice", ipSliceConv) if err != nil { return []net.IP{}, err } return val.([]net.IP), nil } // IPSliceVar defines a ipSlice flag with specified name, default value, and usage string. // The argument p points to a []net.IP variable in which to store the value of the flag. func (f *FlagSet) IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) { f.VarP(newIPSliceValue(value, p), name, "", usage) } // IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) { f.VarP(newIPSliceValue(value, p), name, shorthand, usage) } // IPSliceVar defines a []net.IP flag with specified name, default value, and usage string. // The argument p points to a []net.IP variable in which to store the value of the flag. func IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) { CommandLine.VarP(newIPSliceValue(value, p), name, "", usage) } // IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash. func IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) { CommandLine.VarP(newIPSliceValue(value, p), name, shorthand, usage) } // IPSlice defines a []net.IP flag with specified name, default value, and usage string. // The return value is the address of a []net.IP variable that stores the value of that flag. func (f *FlagSet) IPSlice(name string, value []net.IP, usage string) *[]net.IP { p := []net.IP{} f.IPSliceVarP(&p, name, "", value, usage) return &p } // IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP { p := []net.IP{} f.IPSliceVarP(&p, name, shorthand, value, usage) return &p } // IPSlice defines a []net.IP flag with specified name, default value, and usage string. // The return value is the address of a []net.IP variable that stores the value of the flag. func IPSlice(name string, value []net.IP, usage string) *[]net.IP { return CommandLine.IPSliceP(name, "", value, usage) } // IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash. func IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP { return CommandLine.IPSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/ipmask.go ================================================ package pflag import ( "fmt" "net" "strconv" ) // -- net.IPMask value type ipMaskValue net.IPMask func newIPMaskValue(val net.IPMask, p *net.IPMask) *ipMaskValue { *p = val return (*ipMaskValue)(p) } func (i *ipMaskValue) String() string { return net.IPMask(*i).String() } func (i *ipMaskValue) Set(s string) error { ip := ParseIPv4Mask(s) if ip == nil { return fmt.Errorf("failed to parse IP mask: %q", s) } *i = ipMaskValue(ip) return nil } func (i *ipMaskValue) Type() string { return "ipMask" } // ParseIPv4Mask written in IP form (e.g. 255.255.255.0). // This function should really belong to the net package. func ParseIPv4Mask(s string) net.IPMask { mask := net.ParseIP(s) if mask == nil { if len(s) != 8 { return nil } // net.IPMask.String() actually outputs things like ffffff00 // so write a horrible parser for that as well :-( m := []int{} for i := 0; i < 4; i++ { b := "0x" + s[2*i:2*i+2] d, err := strconv.ParseInt(b, 0, 0) if err != nil { return nil } m = append(m, int(d)) } s := fmt.Sprintf("%d.%d.%d.%d", m[0], m[1], m[2], m[3]) mask = net.ParseIP(s) if mask == nil { return nil } } return net.IPv4Mask(mask[12], mask[13], mask[14], mask[15]) } func parseIPv4Mask(sval string) (interface{}, error) { mask := ParseIPv4Mask(sval) if mask == nil { return nil, fmt.Errorf("unable to parse %s as net.IPMask", sval) } return mask, nil } // GetIPv4Mask return the net.IPv4Mask value of a flag with the given name func (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) { val, err := f.getFlagType(name, "ipMask", parseIPv4Mask) if err != nil { return nil, err } return val.(net.IPMask), nil } // IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string. // The argument p points to an net.IPMask variable in which to store the value of the flag. func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) { f.VarP(newIPMaskValue(value, p), name, "", usage) } // IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) { f.VarP(newIPMaskValue(value, p), name, shorthand, usage) } // IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string. // The argument p points to an net.IPMask variable in which to store the value of the flag. func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) { CommandLine.VarP(newIPMaskValue(value, p), name, "", usage) } // IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash. func IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) { CommandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage) } // IPMask defines an net.IPMask flag with specified name, default value, and usage string. // The return value is the address of an net.IPMask variable that stores the value of the flag. func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMask { p := new(net.IPMask) f.IPMaskVarP(p, name, "", value, usage) return p } // IPMaskP is like IPMask, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask { p := new(net.IPMask) f.IPMaskVarP(p, name, shorthand, value, usage) return p } // IPMask defines an net.IPMask flag with specified name, default value, and usage string. // The return value is the address of an net.IPMask variable that stores the value of the flag. func IPMask(name string, value net.IPMask, usage string) *net.IPMask { return CommandLine.IPMaskP(name, "", value, usage) } // IPMaskP is like IP, but accepts a shorthand letter that can be used after a single dash. func IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask { return CommandLine.IPMaskP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/ipnet.go ================================================ package pflag import ( "fmt" "net" "strings" ) // IPNet adapts net.IPNet for use as a flag. type ipNetValue net.IPNet func (ipnet ipNetValue) String() string { n := net.IPNet(ipnet) return n.String() } func (ipnet *ipNetValue) Set(value string) error { _, n, err := net.ParseCIDR(strings.TrimSpace(value)) if err != nil { return err } *ipnet = ipNetValue(*n) return nil } func (*ipNetValue) Type() string { return "ipNet" } func newIPNetValue(val net.IPNet, p *net.IPNet) *ipNetValue { *p = val return (*ipNetValue)(p) } func ipNetConv(sval string) (interface{}, error) { _, n, err := net.ParseCIDR(strings.TrimSpace(sval)) if err == nil { return *n, nil } return nil, fmt.Errorf("invalid string being converted to IPNet: %s", sval) } // GetIPNet return the net.IPNet value of a flag with the given name func (f *FlagSet) GetIPNet(name string) (net.IPNet, error) { val, err := f.getFlagType(name, "ipNet", ipNetConv) if err != nil { return net.IPNet{}, err } return val.(net.IPNet), nil } // IPNetVar defines an net.IPNet flag with specified name, default value, and usage string. // The argument p points to an net.IPNet variable in which to store the value of the flag. func (f *FlagSet) IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) { f.VarP(newIPNetValue(value, p), name, "", usage) } // IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) { f.VarP(newIPNetValue(value, p), name, shorthand, usage) } // IPNetVar defines an net.IPNet flag with specified name, default value, and usage string. // The argument p points to an net.IPNet variable in which to store the value of the flag. func IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) { CommandLine.VarP(newIPNetValue(value, p), name, "", usage) } // IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash. func IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) { CommandLine.VarP(newIPNetValue(value, p), name, shorthand, usage) } // IPNet defines an net.IPNet flag with specified name, default value, and usage string. // The return value is the address of an net.IPNet variable that stores the value of the flag. func (f *FlagSet) IPNet(name string, value net.IPNet, usage string) *net.IPNet { p := new(net.IPNet) f.IPNetVarP(p, name, "", value, usage) return p } // IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet { p := new(net.IPNet) f.IPNetVarP(p, name, shorthand, value, usage) return p } // IPNet defines an net.IPNet flag with specified name, default value, and usage string. // The return value is the address of an net.IPNet variable that stores the value of the flag. func IPNet(name string, value net.IPNet, usage string) *net.IPNet { return CommandLine.IPNetP(name, "", value, usage) } // IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash. func IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet { return CommandLine.IPNetP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/string.go ================================================ package pflag // -- string Value type stringValue string func newStringValue(val string, p *string) *stringValue { *p = val return (*stringValue)(p) } func (s *stringValue) Set(val string) error { *s = stringValue(val) return nil } func (s *stringValue) Type() string { return "string" } func (s *stringValue) String() string { return string(*s) } func stringConv(sval string) (interface{}, error) { return sval, nil } // GetString return the string value of a flag with the given name func (f *FlagSet) GetString(name string) (string, error) { val, err := f.getFlagType(name, "string", stringConv) if err != nil { return "", err } return val.(string), nil } // StringVar defines a string flag with specified name, default value, and usage string. // The argument p points to a string variable in which to store the value of the flag. func (f *FlagSet) StringVar(p *string, name string, value string, usage string) { f.VarP(newStringValue(value, p), name, "", usage) } // StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringVarP(p *string, name, shorthand string, value string, usage string) { f.VarP(newStringValue(value, p), name, shorthand, usage) } // StringVar defines a string flag with specified name, default value, and usage string. // The argument p points to a string variable in which to store the value of the flag. func StringVar(p *string, name string, value string, usage string) { CommandLine.VarP(newStringValue(value, p), name, "", usage) } // StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash. func StringVarP(p *string, name, shorthand string, value string, usage string) { CommandLine.VarP(newStringValue(value, p), name, shorthand, usage) } // String defines a string flag with specified name, default value, and usage string. // The return value is the address of a string variable that stores the value of the flag. func (f *FlagSet) String(name string, value string, usage string) *string { p := new(string) f.StringVarP(p, name, "", value, usage) return p } // StringP is like String, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string { p := new(string) f.StringVarP(p, name, shorthand, value, usage) return p } // String defines a string flag with specified name, default value, and usage string. // The return value is the address of a string variable that stores the value of the flag. func String(name string, value string, usage string) *string { return CommandLine.StringP(name, "", value, usage) } // StringP is like String, but accepts a shorthand letter that can be used after a single dash. func StringP(name, shorthand string, value string, usage string) *string { return CommandLine.StringP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/string_array.go ================================================ package pflag // -- stringArray Value type stringArrayValue struct { value *[]string changed bool } func newStringArrayValue(val []string, p *[]string) *stringArrayValue { ssv := new(stringArrayValue) ssv.value = p *ssv.value = val return ssv } func (s *stringArrayValue) Set(val string) error { if !s.changed { *s.value = []string{val} s.changed = true } else { *s.value = append(*s.value, val) } return nil } func (s *stringArrayValue) Type() string { return "stringArray" } func (s *stringArrayValue) String() string { str, _ := writeAsCSV(*s.value) return "[" + str + "]" } func stringArrayConv(sval string) (interface{}, error) { sval = sval[1 : len(sval)-1] // An empty string would cause a array with one (empty) string if len(sval) == 0 { return []string{}, nil } return readAsCSV(sval) } // GetStringArray return the []string value of a flag with the given name func (f *FlagSet) GetStringArray(name string) ([]string, error) { val, err := f.getFlagType(name, "stringArray", stringArrayConv) if err != nil { return []string{}, err } return val.([]string), nil } // StringArrayVar defines a string flag with specified name, default value, and usage string. // The argument p points to a []string variable in which to store the values of the multiple flags. // The value of each argument will not try to be separated by comma func (f *FlagSet) StringArrayVar(p *[]string, name string, value []string, usage string) { f.VarP(newStringArrayValue(value, p), name, "", usage) } // StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) { f.VarP(newStringArrayValue(value, p), name, shorthand, usage) } // StringArrayVar defines a string flag with specified name, default value, and usage string. // The argument p points to a []string variable in which to store the value of the flag. // The value of each argument will not try to be separated by comma func StringArrayVar(p *[]string, name string, value []string, usage string) { CommandLine.VarP(newStringArrayValue(value, p), name, "", usage) } // StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash. func StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) { CommandLine.VarP(newStringArrayValue(value, p), name, shorthand, usage) } // StringArray defines a string flag with specified name, default value, and usage string. // The return value is the address of a []string variable that stores the value of the flag. // The value of each argument will not try to be separated by comma func (f *FlagSet) StringArray(name string, value []string, usage string) *[]string { p := []string{} f.StringArrayVarP(&p, name, "", value, usage) return &p } // StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringArrayP(name, shorthand string, value []string, usage string) *[]string { p := []string{} f.StringArrayVarP(&p, name, shorthand, value, usage) return &p } // StringArray defines a string flag with specified name, default value, and usage string. // The return value is the address of a []string variable that stores the value of the flag. // The value of each argument will not try to be separated by comma func StringArray(name string, value []string, usage string) *[]string { return CommandLine.StringArrayP(name, "", value, usage) } // StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash. func StringArrayP(name, shorthand string, value []string, usage string) *[]string { return CommandLine.StringArrayP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/string_slice.go ================================================ package pflag import ( "bytes" "encoding/csv" "strings" ) // -- stringSlice Value type stringSliceValue struct { value *[]string changed bool } func newStringSliceValue(val []string, p *[]string) *stringSliceValue { ssv := new(stringSliceValue) ssv.value = p *ssv.value = val return ssv } func readAsCSV(val string) ([]string, error) { if val == "" { return []string{}, nil } stringReader := strings.NewReader(val) csvReader := csv.NewReader(stringReader) return csvReader.Read() } func writeAsCSV(vals []string) (string, error) { b := &bytes.Buffer{} w := csv.NewWriter(b) err := w.Write(vals) if err != nil { return "", err } w.Flush() return strings.TrimSuffix(b.String(), "\n"), nil } func (s *stringSliceValue) Set(val string) error { v, err := readAsCSV(val) if err != nil { return err } if !s.changed { *s.value = v } else { *s.value = append(*s.value, v...) } s.changed = true return nil } func (s *stringSliceValue) Type() string { return "stringSlice" } func (s *stringSliceValue) String() string { str, _ := writeAsCSV(*s.value) return "[" + str + "]" } func stringSliceConv(sval string) (interface{}, error) { sval = sval[1 : len(sval)-1] // An empty string would cause a slice with one (empty) string if len(sval) == 0 { return []string{}, nil } return readAsCSV(sval) } // GetStringSlice return the []string value of a flag with the given name func (f *FlagSet) GetStringSlice(name string) ([]string, error) { val, err := f.getFlagType(name, "stringSlice", stringSliceConv) if err != nil { return []string{}, err } return val.([]string), nil } // StringSliceVar defines a string flag with specified name, default value, and usage string. // The argument p points to a []string variable in which to store the value of the flag. func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) { f.VarP(newStringSliceValue(value, p), name, "", usage) } // StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) { f.VarP(newStringSliceValue(value, p), name, shorthand, usage) } // StringSliceVar defines a string flag with specified name, default value, and usage string. // The argument p points to a []string variable in which to store the value of the flag. func StringSliceVar(p *[]string, name string, value []string, usage string) { CommandLine.VarP(newStringSliceValue(value, p), name, "", usage) } // StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash. func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) { CommandLine.VarP(newStringSliceValue(value, p), name, shorthand, usage) } // StringSlice defines a string flag with specified name, default value, and usage string. // The return value is the address of a []string variable that stores the value of the flag. func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string { p := []string{} f.StringSliceVarP(&p, name, "", value, usage) return &p } // StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage string) *[]string { p := []string{} f.StringSliceVarP(&p, name, shorthand, value, usage) return &p } // StringSlice defines a string flag with specified name, default value, and usage string. // The return value is the address of a []string variable that stores the value of the flag. func StringSlice(name string, value []string, usage string) *[]string { return CommandLine.StringSliceP(name, "", value, usage) } // StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash. func StringSliceP(name, shorthand string, value []string, usage string) *[]string { return CommandLine.StringSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint.go ================================================ package pflag import "strconv" // -- uint Value type uintValue uint func newUintValue(val uint, p *uint) *uintValue { *p = val return (*uintValue)(p) } func (i *uintValue) Set(s string) error { v, err := strconv.ParseUint(s, 0, 64) *i = uintValue(v) return err } func (i *uintValue) Type() string { return "uint" } func (i *uintValue) String() string { return strconv.FormatUint(uint64(*i), 10) } func uintConv(sval string) (interface{}, error) { v, err := strconv.ParseUint(sval, 0, 0) if err != nil { return 0, err } return uint(v), nil } // GetUint return the uint value of a flag with the given name func (f *FlagSet) GetUint(name string) (uint, error) { val, err := f.getFlagType(name, "uint", uintConv) if err != nil { return 0, err } return val.(uint), nil } // UintVar defines a uint flag with specified name, default value, and usage string. // The argument p points to a uint variable in which to store the value of the flag. func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) { f.VarP(newUintValue(value, p), name, "", usage) } // UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage string) { f.VarP(newUintValue(value, p), name, shorthand, usage) } // UintVar defines a uint flag with specified name, default value, and usage string. // The argument p points to a uint variable in which to store the value of the flag. func UintVar(p *uint, name string, value uint, usage string) { CommandLine.VarP(newUintValue(value, p), name, "", usage) } // UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash. func UintVarP(p *uint, name, shorthand string, value uint, usage string) { CommandLine.VarP(newUintValue(value, p), name, shorthand, usage) } // Uint defines a uint flag with specified name, default value, and usage string. // The return value is the address of a uint variable that stores the value of the flag. func (f *FlagSet) Uint(name string, value uint, usage string) *uint { p := new(uint) f.UintVarP(p, name, "", value, usage) return p } // UintP is like Uint, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint { p := new(uint) f.UintVarP(p, name, shorthand, value, usage) return p } // Uint defines a uint flag with specified name, default value, and usage string. // The return value is the address of a uint variable that stores the value of the flag. func Uint(name string, value uint, usage string) *uint { return CommandLine.UintP(name, "", value, usage) } // UintP is like Uint, but accepts a shorthand letter that can be used after a single dash. func UintP(name, shorthand string, value uint, usage string) *uint { return CommandLine.UintP(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint16.go ================================================ package pflag import "strconv" // -- uint16 value type uint16Value uint16 func newUint16Value(val uint16, p *uint16) *uint16Value { *p = val return (*uint16Value)(p) } func (i *uint16Value) Set(s string) error { v, err := strconv.ParseUint(s, 0, 16) *i = uint16Value(v) return err } func (i *uint16Value) Type() string { return "uint16" } func (i *uint16Value) String() string { return strconv.FormatUint(uint64(*i), 10) } func uint16Conv(sval string) (interface{}, error) { v, err := strconv.ParseUint(sval, 0, 16) if err != nil { return 0, err } return uint16(v), nil } // GetUint16 return the uint16 value of a flag with the given name func (f *FlagSet) GetUint16(name string) (uint16, error) { val, err := f.getFlagType(name, "uint16", uint16Conv) if err != nil { return 0, err } return val.(uint16), nil } // Uint16Var defines a uint flag with specified name, default value, and usage string. // The argument p points to a uint variable in which to store the value of the flag. func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string) { f.VarP(newUint16Value(value, p), name, "", usage) } // Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) { f.VarP(newUint16Value(value, p), name, shorthand, usage) } // Uint16Var defines a uint flag with specified name, default value, and usage string. // The argument p points to a uint variable in which to store the value of the flag. func Uint16Var(p *uint16, name string, value uint16, usage string) { CommandLine.VarP(newUint16Value(value, p), name, "", usage) } // Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash. func Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) { CommandLine.VarP(newUint16Value(value, p), name, shorthand, usage) } // Uint16 defines a uint flag with specified name, default value, and usage string. // The return value is the address of a uint variable that stores the value of the flag. func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 { p := new(uint16) f.Uint16VarP(p, name, "", value, usage) return p } // Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage string) *uint16 { p := new(uint16) f.Uint16VarP(p, name, shorthand, value, usage) return p } // Uint16 defines a uint flag with specified name, default value, and usage string. // The return value is the address of a uint variable that stores the value of the flag. func Uint16(name string, value uint16, usage string) *uint16 { return CommandLine.Uint16P(name, "", value, usage) } // Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash. func Uint16P(name, shorthand string, value uint16, usage string) *uint16 { return CommandLine.Uint16P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint32.go ================================================ package pflag import "strconv" // -- uint32 value type uint32Value uint32 func newUint32Value(val uint32, p *uint32) *uint32Value { *p = val return (*uint32Value)(p) } func (i *uint32Value) Set(s string) error { v, err := strconv.ParseUint(s, 0, 32) *i = uint32Value(v) return err } func (i *uint32Value) Type() string { return "uint32" } func (i *uint32Value) String() string { return strconv.FormatUint(uint64(*i), 10) } func uint32Conv(sval string) (interface{}, error) { v, err := strconv.ParseUint(sval, 0, 32) if err != nil { return 0, err } return uint32(v), nil } // GetUint32 return the uint32 value of a flag with the given name func (f *FlagSet) GetUint32(name string) (uint32, error) { val, err := f.getFlagType(name, "uint32", uint32Conv) if err != nil { return 0, err } return val.(uint32), nil } // Uint32Var defines a uint32 flag with specified name, default value, and usage string. // The argument p points to a uint32 variable in which to store the value of the flag. func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string) { f.VarP(newUint32Value(value, p), name, "", usage) } // Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) { f.VarP(newUint32Value(value, p), name, shorthand, usage) } // Uint32Var defines a uint32 flag with specified name, default value, and usage string. // The argument p points to a uint32 variable in which to store the value of the flag. func Uint32Var(p *uint32, name string, value uint32, usage string) { CommandLine.VarP(newUint32Value(value, p), name, "", usage) } // Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash. func Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) { CommandLine.VarP(newUint32Value(value, p), name, shorthand, usage) } // Uint32 defines a uint32 flag with specified name, default value, and usage string. // The return value is the address of a uint32 variable that stores the value of the flag. func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 { p := new(uint32) f.Uint32VarP(p, name, "", value, usage) return p } // Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage string) *uint32 { p := new(uint32) f.Uint32VarP(p, name, shorthand, value, usage) return p } // Uint32 defines a uint32 flag with specified name, default value, and usage string. // The return value is the address of a uint32 variable that stores the value of the flag. func Uint32(name string, value uint32, usage string) *uint32 { return CommandLine.Uint32P(name, "", value, usage) } // Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash. func Uint32P(name, shorthand string, value uint32, usage string) *uint32 { return CommandLine.Uint32P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint64.go ================================================ package pflag import "strconv" // -- uint64 Value type uint64Value uint64 func newUint64Value(val uint64, p *uint64) *uint64Value { *p = val return (*uint64Value)(p) } func (i *uint64Value) Set(s string) error { v, err := strconv.ParseUint(s, 0, 64) *i = uint64Value(v) return err } func (i *uint64Value) Type() string { return "uint64" } func (i *uint64Value) String() string { return strconv.FormatUint(uint64(*i), 10) } func uint64Conv(sval string) (interface{}, error) { v, err := strconv.ParseUint(sval, 0, 64) if err != nil { return 0, err } return uint64(v), nil } // GetUint64 return the uint64 value of a flag with the given name func (f *FlagSet) GetUint64(name string) (uint64, error) { val, err := f.getFlagType(name, "uint64", uint64Conv) if err != nil { return 0, err } return val.(uint64), nil } // Uint64Var defines a uint64 flag with specified name, default value, and usage string. // The argument p points to a uint64 variable in which to store the value of the flag. func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) { f.VarP(newUint64Value(value, p), name, "", usage) } // Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) { f.VarP(newUint64Value(value, p), name, shorthand, usage) } // Uint64Var defines a uint64 flag with specified name, default value, and usage string. // The argument p points to a uint64 variable in which to store the value of the flag. func Uint64Var(p *uint64, name string, value uint64, usage string) { CommandLine.VarP(newUint64Value(value, p), name, "", usage) } // Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash. func Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) { CommandLine.VarP(newUint64Value(value, p), name, shorthand, usage) } // Uint64 defines a uint64 flag with specified name, default value, and usage string. // The return value is the address of a uint64 variable that stores the value of the flag. func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 { p := new(uint64) f.Uint64VarP(p, name, "", value, usage) return p } // Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage string) *uint64 { p := new(uint64) f.Uint64VarP(p, name, shorthand, value, usage) return p } // Uint64 defines a uint64 flag with specified name, default value, and usage string. // The return value is the address of a uint64 variable that stores the value of the flag. func Uint64(name string, value uint64, usage string) *uint64 { return CommandLine.Uint64P(name, "", value, usage) } // Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash. func Uint64P(name, shorthand string, value uint64, usage string) *uint64 { return CommandLine.Uint64P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint8.go ================================================ package pflag import "strconv" // -- uint8 Value type uint8Value uint8 func newUint8Value(val uint8, p *uint8) *uint8Value { *p = val return (*uint8Value)(p) } func (i *uint8Value) Set(s string) error { v, err := strconv.ParseUint(s, 0, 8) *i = uint8Value(v) return err } func (i *uint8Value) Type() string { return "uint8" } func (i *uint8Value) String() string { return strconv.FormatUint(uint64(*i), 10) } func uint8Conv(sval string) (interface{}, error) { v, err := strconv.ParseUint(sval, 0, 8) if err != nil { return 0, err } return uint8(v), nil } // GetUint8 return the uint8 value of a flag with the given name func (f *FlagSet) GetUint8(name string) (uint8, error) { val, err := f.getFlagType(name, "uint8", uint8Conv) if err != nil { return 0, err } return val.(uint8), nil } // Uint8Var defines a uint8 flag with specified name, default value, and usage string. // The argument p points to a uint8 variable in which to store the value of the flag. func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) { f.VarP(newUint8Value(value, p), name, "", usage) } // Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) { f.VarP(newUint8Value(value, p), name, shorthand, usage) } // Uint8Var defines a uint8 flag with specified name, default value, and usage string. // The argument p points to a uint8 variable in which to store the value of the flag. func Uint8Var(p *uint8, name string, value uint8, usage string) { CommandLine.VarP(newUint8Value(value, p), name, "", usage) } // Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash. func Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) { CommandLine.VarP(newUint8Value(value, p), name, shorthand, usage) } // Uint8 defines a uint8 flag with specified name, default value, and usage string. // The return value is the address of a uint8 variable that stores the value of the flag. func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 { p := new(uint8) f.Uint8VarP(p, name, "", value, usage) return p } // Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage string) *uint8 { p := new(uint8) f.Uint8VarP(p, name, shorthand, value, usage) return p } // Uint8 defines a uint8 flag with specified name, default value, and usage string. // The return value is the address of a uint8 variable that stores the value of the flag. func Uint8(name string, value uint8, usage string) *uint8 { return CommandLine.Uint8P(name, "", value, usage) } // Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash. func Uint8P(name, shorthand string, value uint8, usage string) *uint8 { return CommandLine.Uint8P(name, shorthand, value, usage) } ================================================ FILE: vendor/github.com/spf13/pflag/uint_slice.go ================================================ package pflag import ( "fmt" "strconv" "strings" ) // -- uintSlice Value type uintSliceValue struct { value *[]uint changed bool } func newUintSliceValue(val []uint, p *[]uint) *uintSliceValue { uisv := new(uintSliceValue) uisv.value = p *uisv.value = val return uisv } func (s *uintSliceValue) Set(val string) error { ss := strings.Split(val, ",") out := make([]uint, len(ss)) for i, d := range ss { u, err := strconv.ParseUint(d, 10, 0) if err != nil { return err } out[i] = uint(u) } if !s.changed { *s.value = out } else { *s.value = append(*s.value, out...) } s.changed = true return nil } func (s *uintSliceValue) Type() string { return "uintSlice" } func (s *uintSliceValue) String() string { out := make([]string, len(*s.value)) for i, d := range *s.value { out[i] = fmt.Sprintf("%d", d) } return "[" + strings.Join(out, ",") + "]" } func uintSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []uint{}, nil } ss := strings.Split(val, ",") out := make([]uint, len(ss)) for i, d := range ss { u, err := strconv.ParseUint(d, 10, 0) if err != nil { return nil, err } out[i] = uint(u) } return out, nil } // GetUintSlice returns the []uint value of a flag with the given name. func (f *FlagSet) GetUintSlice(name string) ([]uint, error) { val, err := f.getFlagType(name, "uintSlice", uintSliceConv) if err != nil { return []uint{}, err } return val.([]uint), nil } // UintSliceVar defines a uintSlice flag with specified name, default value, and usage string. // The argument p points to a []uint variable in which to store the value of the flag. func (f *FlagSet) UintSliceVar(p *[]uint, name string, value []uint, usage string) { f.VarP(newUintSliceValue(value, p), name, "", usage) } // UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) { f.VarP(newUintSliceValue(value, p), name, shorthand, usage) } // UintSliceVar defines a uint[] flag with specified name, default value, and usage string. // The argument p points to a uint[] variable in which to store the value of the flag. func UintSliceVar(p *[]uint, name string, value []uint, usage string) { CommandLine.VarP(newUintSliceValue(value, p), name, "", usage) } // UintSliceVarP is like the UintSliceVar, but accepts a shorthand letter that can be used after a single dash. func UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) { CommandLine.VarP(newUintSliceValue(value, p), name, shorthand, usage) } // UintSlice defines a []uint flag with specified name, default value, and usage string. // The return value is the address of a []uint variable that stores the value of the flag. func (f *FlagSet) UintSlice(name string, value []uint, usage string) *[]uint { p := []uint{} f.UintSliceVarP(&p, name, "", value, usage) return &p } // UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash. func (f *FlagSet) UintSliceP(name, shorthand string, value []uint, usage string) *[]uint { p := []uint{} f.UintSliceVarP(&p, name, shorthand, value, usage) return &p } // UintSlice defines a []uint flag with specified name, default value, and usage string. // The return value is the address of a []uint variable that stores the value of the flag. func UintSlice(name string, value []uint, usage string) *[]uint { return CommandLine.UintSliceP(name, "", value, usage) } // UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash. func UintSliceP(name, shorthand string, value []uint, usage string) *[]uint { return CommandLine.UintSliceP(name, shorthand, value, usage) } ================================================ FILE: vendor/golang.org/x/crypto/AUTHORS ================================================ # This source code refers to The Go Authors for copyright purposes. # The master list of authors is in the main Go distribution, # visible at https://tip.golang.org/AUTHORS. ================================================ FILE: vendor/golang.org/x/crypto/CONTRIBUTORS ================================================ # This source code was written by the Go contributors. # The master list of contributors is in the main Go distribution, # visible at https://tip.golang.org/CONTRIBUTORS. ================================================ FILE: vendor/golang.org/x/crypto/LICENSE ================================================ Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/crypto/PATENTS ================================================ Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. ================================================ FILE: vendor/golang.org/x/crypto/curve25519/const_amd64.h ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This code was translated into a form compatible with 6a from the public // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html #define REDMASK51 0x0007FFFFFFFFFFFF ================================================ FILE: vendor/golang.org/x/crypto/curve25519/const_amd64.s ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This code was translated into a form compatible with 6a from the public // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html // +build amd64,!gccgo,!appengine // These constants cannot be encoded in non-MOVQ immediates. // We access them directly from memory instead. DATA ·_121666_213(SB)/8, $996687872 GLOBL ·_121666_213(SB), 8, $8 DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA GLOBL ·_2P0(SB), 8, $8 DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE GLOBL ·_2P1234(SB), 8, $8 ================================================ FILE: vendor/golang.org/x/crypto/curve25519/cswap_amd64.s ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build amd64,!gccgo,!appengine // func cswap(inout *[4][5]uint64, v uint64) TEXT ·cswap(SB),7,$0 MOVQ inout+0(FP),DI MOVQ v+8(FP),SI SUBQ $1, SI NOTQ SI MOVQ SI, X15 PSHUFD $0x44, X15, X15 MOVOU 0(DI), X0 MOVOU 16(DI), X2 MOVOU 32(DI), X4 MOVOU 48(DI), X6 MOVOU 64(DI), X8 MOVOU 80(DI), X1 MOVOU 96(DI), X3 MOVOU 112(DI), X5 MOVOU 128(DI), X7 MOVOU 144(DI), X9 MOVO X1, X10 MOVO X3, X11 MOVO X5, X12 MOVO X7, X13 MOVO X9, X14 PXOR X0, X10 PXOR X2, X11 PXOR X4, X12 PXOR X6, X13 PXOR X8, X14 PAND X15, X10 PAND X15, X11 PAND X15, X12 PAND X15, X13 PAND X15, X14 PXOR X10, X0 PXOR X10, X1 PXOR X11, X2 PXOR X11, X3 PXOR X12, X4 PXOR X12, X5 PXOR X13, X6 PXOR X13, X7 PXOR X14, X8 PXOR X14, X9 MOVOU X0, 0(DI) MOVOU X2, 16(DI) MOVOU X4, 32(DI) MOVOU X6, 48(DI) MOVOU X8, 64(DI) MOVOU X1, 80(DI) MOVOU X3, 96(DI) MOVOU X5, 112(DI) MOVOU X7, 128(DI) MOVOU X9, 144(DI) RET ================================================ FILE: vendor/golang.org/x/crypto/curve25519/curve25519.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // We have an implementation in amd64 assembly so this code is only run on // non-amd64 platforms. The amd64 assembly does not support gccgo. // +build !amd64 gccgo appengine package curve25519 import ( "encoding/binary" ) // This code is a port of the public domain, "ref10" implementation of // curve25519 from SUPERCOP 20130419 by D. J. Bernstein. // fieldElement represents an element of the field GF(2^255 - 19). An element // t, entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 // t[3]+2^102 t[4]+...+2^230 t[9]. Bounds on each t[i] vary depending on // context. type fieldElement [10]int32 func feZero(fe *fieldElement) { for i := range fe { fe[i] = 0 } } func feOne(fe *fieldElement) { feZero(fe) fe[0] = 1 } func feAdd(dst, a, b *fieldElement) { for i := range dst { dst[i] = a[i] + b[i] } } func feSub(dst, a, b *fieldElement) { for i := range dst { dst[i] = a[i] - b[i] } } func feCopy(dst, src *fieldElement) { for i := range dst { dst[i] = src[i] } } // feCSwap replaces (f,g) with (g,f) if b == 1; replaces (f,g) with (f,g) if b == 0. // // Preconditions: b in {0,1}. func feCSwap(f, g *fieldElement, b int32) { b = -b for i := range f { t := b & (f[i] ^ g[i]) f[i] ^= t g[i] ^= t } } // load3 reads a 24-bit, little-endian value from in. func load3(in []byte) int64 { var r int64 r = int64(in[0]) r |= int64(in[1]) << 8 r |= int64(in[2]) << 16 return r } // load4 reads a 32-bit, little-endian value from in. func load4(in []byte) int64 { return int64(binary.LittleEndian.Uint32(in)) } func feFromBytes(dst *fieldElement, src *[32]byte) { h0 := load4(src[:]) h1 := load3(src[4:]) << 6 h2 := load3(src[7:]) << 5 h3 := load3(src[10:]) << 3 h4 := load3(src[13:]) << 2 h5 := load4(src[16:]) h6 := load3(src[20:]) << 7 h7 := load3(src[23:]) << 5 h8 := load3(src[26:]) << 4 h9 := (load3(src[29:]) & 0x7fffff) << 2 var carry [10]int64 carry[9] = (h9 + 1<<24) >> 25 h0 += carry[9] * 19 h9 -= carry[9] << 25 carry[1] = (h1 + 1<<24) >> 25 h2 += carry[1] h1 -= carry[1] << 25 carry[3] = (h3 + 1<<24) >> 25 h4 += carry[3] h3 -= carry[3] << 25 carry[5] = (h5 + 1<<24) >> 25 h6 += carry[5] h5 -= carry[5] << 25 carry[7] = (h7 + 1<<24) >> 25 h8 += carry[7] h7 -= carry[7] << 25 carry[0] = (h0 + 1<<25) >> 26 h1 += carry[0] h0 -= carry[0] << 26 carry[2] = (h2 + 1<<25) >> 26 h3 += carry[2] h2 -= carry[2] << 26 carry[4] = (h4 + 1<<25) >> 26 h5 += carry[4] h4 -= carry[4] << 26 carry[6] = (h6 + 1<<25) >> 26 h7 += carry[6] h6 -= carry[6] << 26 carry[8] = (h8 + 1<<25) >> 26 h9 += carry[8] h8 -= carry[8] << 26 dst[0] = int32(h0) dst[1] = int32(h1) dst[2] = int32(h2) dst[3] = int32(h3) dst[4] = int32(h4) dst[5] = int32(h5) dst[6] = int32(h6) dst[7] = int32(h7) dst[8] = int32(h8) dst[9] = int32(h9) } // feToBytes marshals h to s. // Preconditions: // |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. // // Write p=2^255-19; q=floor(h/p). // Basic claim: q = floor(2^(-255)(h + 19 2^(-25)h9 + 2^(-1))). // // Proof: // Have |h|<=p so |q|<=1 so |19^2 2^(-255) q|<1/4. // Also have |h-2^230 h9|<2^230 so |19 2^(-255)(h-2^230 h9)|<1/4. // // Write y=2^(-1)-19^2 2^(-255)q-19 2^(-255)(h-2^230 h9). // Then 0> 25 q = (h[0] + q) >> 26 q = (h[1] + q) >> 25 q = (h[2] + q) >> 26 q = (h[3] + q) >> 25 q = (h[4] + q) >> 26 q = (h[5] + q) >> 25 q = (h[6] + q) >> 26 q = (h[7] + q) >> 25 q = (h[8] + q) >> 26 q = (h[9] + q) >> 25 // Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. h[0] += 19 * q // Goal: Output h-2^255 q, which is between 0 and 2^255-20. carry[0] = h[0] >> 26 h[1] += carry[0] h[0] -= carry[0] << 26 carry[1] = h[1] >> 25 h[2] += carry[1] h[1] -= carry[1] << 25 carry[2] = h[2] >> 26 h[3] += carry[2] h[2] -= carry[2] << 26 carry[3] = h[3] >> 25 h[4] += carry[3] h[3] -= carry[3] << 25 carry[4] = h[4] >> 26 h[5] += carry[4] h[4] -= carry[4] << 26 carry[5] = h[5] >> 25 h[6] += carry[5] h[5] -= carry[5] << 25 carry[6] = h[6] >> 26 h[7] += carry[6] h[6] -= carry[6] << 26 carry[7] = h[7] >> 25 h[8] += carry[7] h[7] -= carry[7] << 25 carry[8] = h[8] >> 26 h[9] += carry[8] h[8] -= carry[8] << 26 carry[9] = h[9] >> 25 h[9] -= carry[9] << 25 // h10 = carry9 // Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20. // Have h[0]+...+2^230 h[9] between 0 and 2^255-1; // evidently 2^255 h10-2^255 q = 0. // Goal: Output h[0]+...+2^230 h[9]. s[0] = byte(h[0] >> 0) s[1] = byte(h[0] >> 8) s[2] = byte(h[0] >> 16) s[3] = byte((h[0] >> 24) | (h[1] << 2)) s[4] = byte(h[1] >> 6) s[5] = byte(h[1] >> 14) s[6] = byte((h[1] >> 22) | (h[2] << 3)) s[7] = byte(h[2] >> 5) s[8] = byte(h[2] >> 13) s[9] = byte((h[2] >> 21) | (h[3] << 5)) s[10] = byte(h[3] >> 3) s[11] = byte(h[3] >> 11) s[12] = byte((h[3] >> 19) | (h[4] << 6)) s[13] = byte(h[4] >> 2) s[14] = byte(h[4] >> 10) s[15] = byte(h[4] >> 18) s[16] = byte(h[5] >> 0) s[17] = byte(h[5] >> 8) s[18] = byte(h[5] >> 16) s[19] = byte((h[5] >> 24) | (h[6] << 1)) s[20] = byte(h[6] >> 7) s[21] = byte(h[6] >> 15) s[22] = byte((h[6] >> 23) | (h[7] << 3)) s[23] = byte(h[7] >> 5) s[24] = byte(h[7] >> 13) s[25] = byte((h[7] >> 21) | (h[8] << 4)) s[26] = byte(h[8] >> 4) s[27] = byte(h[8] >> 12) s[28] = byte((h[8] >> 20) | (h[9] << 6)) s[29] = byte(h[9] >> 2) s[30] = byte(h[9] >> 10) s[31] = byte(h[9] >> 18) } // feMul calculates h = f * g // Can overlap h with f or g. // // Preconditions: // |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. // |g| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. // // Postconditions: // |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. // // Notes on implementation strategy: // // Using schoolbook multiplication. // Karatsuba would save a little in some cost models. // // Most multiplications by 2 and 19 are 32-bit precomputations; // cheaper than 64-bit postcomputations. // // There is one remaining multiplication by 19 in the carry chain; // one *19 precomputation can be merged into this, // but the resulting data flow is considerably less clean. // // There are 12 carries below. // 10 of them are 2-way parallelizable and vectorizable. // Can get away with 11 carries, but then data flow is much deeper. // // With tighter constraints on inputs can squeeze carries into int32. func feMul(h, f, g *fieldElement) { f0 := f[0] f1 := f[1] f2 := f[2] f3 := f[3] f4 := f[4] f5 := f[5] f6 := f[6] f7 := f[7] f8 := f[8] f9 := f[9] g0 := g[0] g1 := g[1] g2 := g[2] g3 := g[3] g4 := g[4] g5 := g[5] g6 := g[6] g7 := g[7] g8 := g[8] g9 := g[9] g1_19 := 19 * g1 // 1.4*2^29 g2_19 := 19 * g2 // 1.4*2^30; still ok g3_19 := 19 * g3 g4_19 := 19 * g4 g5_19 := 19 * g5 g6_19 := 19 * g6 g7_19 := 19 * g7 g8_19 := 19 * g8 g9_19 := 19 * g9 f1_2 := 2 * f1 f3_2 := 2 * f3 f5_2 := 2 * f5 f7_2 := 2 * f7 f9_2 := 2 * f9 f0g0 := int64(f0) * int64(g0) f0g1 := int64(f0) * int64(g1) f0g2 := int64(f0) * int64(g2) f0g3 := int64(f0) * int64(g3) f0g4 := int64(f0) * int64(g4) f0g5 := int64(f0) * int64(g5) f0g6 := int64(f0) * int64(g6) f0g7 := int64(f0) * int64(g7) f0g8 := int64(f0) * int64(g8) f0g9 := int64(f0) * int64(g9) f1g0 := int64(f1) * int64(g0) f1g1_2 := int64(f1_2) * int64(g1) f1g2 := int64(f1) * int64(g2) f1g3_2 := int64(f1_2) * int64(g3) f1g4 := int64(f1) * int64(g4) f1g5_2 := int64(f1_2) * int64(g5) f1g6 := int64(f1) * int64(g6) f1g7_2 := int64(f1_2) * int64(g7) f1g8 := int64(f1) * int64(g8) f1g9_38 := int64(f1_2) * int64(g9_19) f2g0 := int64(f2) * int64(g0) f2g1 := int64(f2) * int64(g1) f2g2 := int64(f2) * int64(g2) f2g3 := int64(f2) * int64(g3) f2g4 := int64(f2) * int64(g4) f2g5 := int64(f2) * int64(g5) f2g6 := int64(f2) * int64(g6) f2g7 := int64(f2) * int64(g7) f2g8_19 := int64(f2) * int64(g8_19) f2g9_19 := int64(f2) * int64(g9_19) f3g0 := int64(f3) * int64(g0) f3g1_2 := int64(f3_2) * int64(g1) f3g2 := int64(f3) * int64(g2) f3g3_2 := int64(f3_2) * int64(g3) f3g4 := int64(f3) * int64(g4) f3g5_2 := int64(f3_2) * int64(g5) f3g6 := int64(f3) * int64(g6) f3g7_38 := int64(f3_2) * int64(g7_19) f3g8_19 := int64(f3) * int64(g8_19) f3g9_38 := int64(f3_2) * int64(g9_19) f4g0 := int64(f4) * int64(g0) f4g1 := int64(f4) * int64(g1) f4g2 := int64(f4) * int64(g2) f4g3 := int64(f4) * int64(g3) f4g4 := int64(f4) * int64(g4) f4g5 := int64(f4) * int64(g5) f4g6_19 := int64(f4) * int64(g6_19) f4g7_19 := int64(f4) * int64(g7_19) f4g8_19 := int64(f4) * int64(g8_19) f4g9_19 := int64(f4) * int64(g9_19) f5g0 := int64(f5) * int64(g0) f5g1_2 := int64(f5_2) * int64(g1) f5g2 := int64(f5) * int64(g2) f5g3_2 := int64(f5_2) * int64(g3) f5g4 := int64(f5) * int64(g4) f5g5_38 := int64(f5_2) * int64(g5_19) f5g6_19 := int64(f5) * int64(g6_19) f5g7_38 := int64(f5_2) * int64(g7_19) f5g8_19 := int64(f5) * int64(g8_19) f5g9_38 := int64(f5_2) * int64(g9_19) f6g0 := int64(f6) * int64(g0) f6g1 := int64(f6) * int64(g1) f6g2 := int64(f6) * int64(g2) f6g3 := int64(f6) * int64(g3) f6g4_19 := int64(f6) * int64(g4_19) f6g5_19 := int64(f6) * int64(g5_19) f6g6_19 := int64(f6) * int64(g6_19) f6g7_19 := int64(f6) * int64(g7_19) f6g8_19 := int64(f6) * int64(g8_19) f6g9_19 := int64(f6) * int64(g9_19) f7g0 := int64(f7) * int64(g0) f7g1_2 := int64(f7_2) * int64(g1) f7g2 := int64(f7) * int64(g2) f7g3_38 := int64(f7_2) * int64(g3_19) f7g4_19 := int64(f7) * int64(g4_19) f7g5_38 := int64(f7_2) * int64(g5_19) f7g6_19 := int64(f7) * int64(g6_19) f7g7_38 := int64(f7_2) * int64(g7_19) f7g8_19 := int64(f7) * int64(g8_19) f7g9_38 := int64(f7_2) * int64(g9_19) f8g0 := int64(f8) * int64(g0) f8g1 := int64(f8) * int64(g1) f8g2_19 := int64(f8) * int64(g2_19) f8g3_19 := int64(f8) * int64(g3_19) f8g4_19 := int64(f8) * int64(g4_19) f8g5_19 := int64(f8) * int64(g5_19) f8g6_19 := int64(f8) * int64(g6_19) f8g7_19 := int64(f8) * int64(g7_19) f8g8_19 := int64(f8) * int64(g8_19) f8g9_19 := int64(f8) * int64(g9_19) f9g0 := int64(f9) * int64(g0) f9g1_38 := int64(f9_2) * int64(g1_19) f9g2_19 := int64(f9) * int64(g2_19) f9g3_38 := int64(f9_2) * int64(g3_19) f9g4_19 := int64(f9) * int64(g4_19) f9g5_38 := int64(f9_2) * int64(g5_19) f9g6_19 := int64(f9) * int64(g6_19) f9g7_38 := int64(f9_2) * int64(g7_19) f9g8_19 := int64(f9) * int64(g8_19) f9g9_38 := int64(f9_2) * int64(g9_19) h0 := f0g0 + f1g9_38 + f2g8_19 + f3g7_38 + f4g6_19 + f5g5_38 + f6g4_19 + f7g3_38 + f8g2_19 + f9g1_38 h1 := f0g1 + f1g0 + f2g9_19 + f3g8_19 + f4g7_19 + f5g6_19 + f6g5_19 + f7g4_19 + f8g3_19 + f9g2_19 h2 := f0g2 + f1g1_2 + f2g0 + f3g9_38 + f4g8_19 + f5g7_38 + f6g6_19 + f7g5_38 + f8g4_19 + f9g3_38 h3 := f0g3 + f1g2 + f2g1 + f3g0 + f4g9_19 + f5g8_19 + f6g7_19 + f7g6_19 + f8g5_19 + f9g4_19 h4 := f0g4 + f1g3_2 + f2g2 + f3g1_2 + f4g0 + f5g9_38 + f6g8_19 + f7g7_38 + f8g6_19 + f9g5_38 h5 := f0g5 + f1g4 + f2g3 + f3g2 + f4g1 + f5g0 + f6g9_19 + f7g8_19 + f8g7_19 + f9g6_19 h6 := f0g6 + f1g5_2 + f2g4 + f3g3_2 + f4g2 + f5g1_2 + f6g0 + f7g9_38 + f8g8_19 + f9g7_38 h7 := f0g7 + f1g6 + f2g5 + f3g4 + f4g3 + f5g2 + f6g1 + f7g0 + f8g9_19 + f9g8_19 h8 := f0g8 + f1g7_2 + f2g6 + f3g5_2 + f4g4 + f5g3_2 + f6g2 + f7g1_2 + f8g0 + f9g9_38 h9 := f0g9 + f1g8 + f2g7 + f3g6 + f4g5 + f5g4 + f6g3 + f7g2 + f8g1 + f9g0 var carry [10]int64 // |h0| <= (1.1*1.1*2^52*(1+19+19+19+19)+1.1*1.1*2^50*(38+38+38+38+38)) // i.e. |h0| <= 1.2*2^59; narrower ranges for h2, h4, h6, h8 // |h1| <= (1.1*1.1*2^51*(1+1+19+19+19+19+19+19+19+19)) // i.e. |h1| <= 1.5*2^58; narrower ranges for h3, h5, h7, h9 carry[0] = (h0 + (1 << 25)) >> 26 h1 += carry[0] h0 -= carry[0] << 26 carry[4] = (h4 + (1 << 25)) >> 26 h5 += carry[4] h4 -= carry[4] << 26 // |h0| <= 2^25 // |h4| <= 2^25 // |h1| <= 1.51*2^58 // |h5| <= 1.51*2^58 carry[1] = (h1 + (1 << 24)) >> 25 h2 += carry[1] h1 -= carry[1] << 25 carry[5] = (h5 + (1 << 24)) >> 25 h6 += carry[5] h5 -= carry[5] << 25 // |h1| <= 2^24; from now on fits into int32 // |h5| <= 2^24; from now on fits into int32 // |h2| <= 1.21*2^59 // |h6| <= 1.21*2^59 carry[2] = (h2 + (1 << 25)) >> 26 h3 += carry[2] h2 -= carry[2] << 26 carry[6] = (h6 + (1 << 25)) >> 26 h7 += carry[6] h6 -= carry[6] << 26 // |h2| <= 2^25; from now on fits into int32 unchanged // |h6| <= 2^25; from now on fits into int32 unchanged // |h3| <= 1.51*2^58 // |h7| <= 1.51*2^58 carry[3] = (h3 + (1 << 24)) >> 25 h4 += carry[3] h3 -= carry[3] << 25 carry[7] = (h7 + (1 << 24)) >> 25 h8 += carry[7] h7 -= carry[7] << 25 // |h3| <= 2^24; from now on fits into int32 unchanged // |h7| <= 2^24; from now on fits into int32 unchanged // |h4| <= 1.52*2^33 // |h8| <= 1.52*2^33 carry[4] = (h4 + (1 << 25)) >> 26 h5 += carry[4] h4 -= carry[4] << 26 carry[8] = (h8 + (1 << 25)) >> 26 h9 += carry[8] h8 -= carry[8] << 26 // |h4| <= 2^25; from now on fits into int32 unchanged // |h8| <= 2^25; from now on fits into int32 unchanged // |h5| <= 1.01*2^24 // |h9| <= 1.51*2^58 carry[9] = (h9 + (1 << 24)) >> 25 h0 += carry[9] * 19 h9 -= carry[9] << 25 // |h9| <= 2^24; from now on fits into int32 unchanged // |h0| <= 1.8*2^37 carry[0] = (h0 + (1 << 25)) >> 26 h1 += carry[0] h0 -= carry[0] << 26 // |h0| <= 2^25; from now on fits into int32 unchanged // |h1| <= 1.01*2^24 h[0] = int32(h0) h[1] = int32(h1) h[2] = int32(h2) h[3] = int32(h3) h[4] = int32(h4) h[5] = int32(h5) h[6] = int32(h6) h[7] = int32(h7) h[8] = int32(h8) h[9] = int32(h9) } // feSquare calculates h = f*f. Can overlap h with f. // // Preconditions: // |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. // // Postconditions: // |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. func feSquare(h, f *fieldElement) { f0 := f[0] f1 := f[1] f2 := f[2] f3 := f[3] f4 := f[4] f5 := f[5] f6 := f[6] f7 := f[7] f8 := f[8] f9 := f[9] f0_2 := 2 * f0 f1_2 := 2 * f1 f2_2 := 2 * f2 f3_2 := 2 * f3 f4_2 := 2 * f4 f5_2 := 2 * f5 f6_2 := 2 * f6 f7_2 := 2 * f7 f5_38 := 38 * f5 // 1.31*2^30 f6_19 := 19 * f6 // 1.31*2^30 f7_38 := 38 * f7 // 1.31*2^30 f8_19 := 19 * f8 // 1.31*2^30 f9_38 := 38 * f9 // 1.31*2^30 f0f0 := int64(f0) * int64(f0) f0f1_2 := int64(f0_2) * int64(f1) f0f2_2 := int64(f0_2) * int64(f2) f0f3_2 := int64(f0_2) * int64(f3) f0f4_2 := int64(f0_2) * int64(f4) f0f5_2 := int64(f0_2) * int64(f5) f0f6_2 := int64(f0_2) * int64(f6) f0f7_2 := int64(f0_2) * int64(f7) f0f8_2 := int64(f0_2) * int64(f8) f0f9_2 := int64(f0_2) * int64(f9) f1f1_2 := int64(f1_2) * int64(f1) f1f2_2 := int64(f1_2) * int64(f2) f1f3_4 := int64(f1_2) * int64(f3_2) f1f4_2 := int64(f1_2) * int64(f4) f1f5_4 := int64(f1_2) * int64(f5_2) f1f6_2 := int64(f1_2) * int64(f6) f1f7_4 := int64(f1_2) * int64(f7_2) f1f8_2 := int64(f1_2) * int64(f8) f1f9_76 := int64(f1_2) * int64(f9_38) f2f2 := int64(f2) * int64(f2) f2f3_2 := int64(f2_2) * int64(f3) f2f4_2 := int64(f2_2) * int64(f4) f2f5_2 := int64(f2_2) * int64(f5) f2f6_2 := int64(f2_2) * int64(f6) f2f7_2 := int64(f2_2) * int64(f7) f2f8_38 := int64(f2_2) * int64(f8_19) f2f9_38 := int64(f2) * int64(f9_38) f3f3_2 := int64(f3_2) * int64(f3) f3f4_2 := int64(f3_2) * int64(f4) f3f5_4 := int64(f3_2) * int64(f5_2) f3f6_2 := int64(f3_2) * int64(f6) f3f7_76 := int64(f3_2) * int64(f7_38) f3f8_38 := int64(f3_2) * int64(f8_19) f3f9_76 := int64(f3_2) * int64(f9_38) f4f4 := int64(f4) * int64(f4) f4f5_2 := int64(f4_2) * int64(f5) f4f6_38 := int64(f4_2) * int64(f6_19) f4f7_38 := int64(f4) * int64(f7_38) f4f8_38 := int64(f4_2) * int64(f8_19) f4f9_38 := int64(f4) * int64(f9_38) f5f5_38 := int64(f5) * int64(f5_38) f5f6_38 := int64(f5_2) * int64(f6_19) f5f7_76 := int64(f5_2) * int64(f7_38) f5f8_38 := int64(f5_2) * int64(f8_19) f5f9_76 := int64(f5_2) * int64(f9_38) f6f6_19 := int64(f6) * int64(f6_19) f6f7_38 := int64(f6) * int64(f7_38) f6f8_38 := int64(f6_2) * int64(f8_19) f6f9_38 := int64(f6) * int64(f9_38) f7f7_38 := int64(f7) * int64(f7_38) f7f8_38 := int64(f7_2) * int64(f8_19) f7f9_76 := int64(f7_2) * int64(f9_38) f8f8_19 := int64(f8) * int64(f8_19) f8f9_38 := int64(f8) * int64(f9_38) f9f9_38 := int64(f9) * int64(f9_38) h0 := f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38 h1 := f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38 h2 := f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19 h3 := f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38 h4 := f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38 h5 := f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38 h6 := f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19 h7 := f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38 h8 := f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38 h9 := f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2 var carry [10]int64 carry[0] = (h0 + (1 << 25)) >> 26 h1 += carry[0] h0 -= carry[0] << 26 carry[4] = (h4 + (1 << 25)) >> 26 h5 += carry[4] h4 -= carry[4] << 26 carry[1] = (h1 + (1 << 24)) >> 25 h2 += carry[1] h1 -= carry[1] << 25 carry[5] = (h5 + (1 << 24)) >> 25 h6 += carry[5] h5 -= carry[5] << 25 carry[2] = (h2 + (1 << 25)) >> 26 h3 += carry[2] h2 -= carry[2] << 26 carry[6] = (h6 + (1 << 25)) >> 26 h7 += carry[6] h6 -= carry[6] << 26 carry[3] = (h3 + (1 << 24)) >> 25 h4 += carry[3] h3 -= carry[3] << 25 carry[7] = (h7 + (1 << 24)) >> 25 h8 += carry[7] h7 -= carry[7] << 25 carry[4] = (h4 + (1 << 25)) >> 26 h5 += carry[4] h4 -= carry[4] << 26 carry[8] = (h8 + (1 << 25)) >> 26 h9 += carry[8] h8 -= carry[8] << 26 carry[9] = (h9 + (1 << 24)) >> 25 h0 += carry[9] * 19 h9 -= carry[9] << 25 carry[0] = (h0 + (1 << 25)) >> 26 h1 += carry[0] h0 -= carry[0] << 26 h[0] = int32(h0) h[1] = int32(h1) h[2] = int32(h2) h[3] = int32(h3) h[4] = int32(h4) h[5] = int32(h5) h[6] = int32(h6) h[7] = int32(h7) h[8] = int32(h8) h[9] = int32(h9) } // feMul121666 calculates h = f * 121666. Can overlap h with f. // // Preconditions: // |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. // // Postconditions: // |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. func feMul121666(h, f *fieldElement) { h0 := int64(f[0]) * 121666 h1 := int64(f[1]) * 121666 h2 := int64(f[2]) * 121666 h3 := int64(f[3]) * 121666 h4 := int64(f[4]) * 121666 h5 := int64(f[5]) * 121666 h6 := int64(f[6]) * 121666 h7 := int64(f[7]) * 121666 h8 := int64(f[8]) * 121666 h9 := int64(f[9]) * 121666 var carry [10]int64 carry[9] = (h9 + (1 << 24)) >> 25 h0 += carry[9] * 19 h9 -= carry[9] << 25 carry[1] = (h1 + (1 << 24)) >> 25 h2 += carry[1] h1 -= carry[1] << 25 carry[3] = (h3 + (1 << 24)) >> 25 h4 += carry[3] h3 -= carry[3] << 25 carry[5] = (h5 + (1 << 24)) >> 25 h6 += carry[5] h5 -= carry[5] << 25 carry[7] = (h7 + (1 << 24)) >> 25 h8 += carry[7] h7 -= carry[7] << 25 carry[0] = (h0 + (1 << 25)) >> 26 h1 += carry[0] h0 -= carry[0] << 26 carry[2] = (h2 + (1 << 25)) >> 26 h3 += carry[2] h2 -= carry[2] << 26 carry[4] = (h4 + (1 << 25)) >> 26 h5 += carry[4] h4 -= carry[4] << 26 carry[6] = (h6 + (1 << 25)) >> 26 h7 += carry[6] h6 -= carry[6] << 26 carry[8] = (h8 + (1 << 25)) >> 26 h9 += carry[8] h8 -= carry[8] << 26 h[0] = int32(h0) h[1] = int32(h1) h[2] = int32(h2) h[3] = int32(h3) h[4] = int32(h4) h[5] = int32(h5) h[6] = int32(h6) h[7] = int32(h7) h[8] = int32(h8) h[9] = int32(h9) } // feInvert sets out = z^-1. func feInvert(out, z *fieldElement) { var t0, t1, t2, t3 fieldElement var i int feSquare(&t0, z) for i = 1; i < 1; i++ { feSquare(&t0, &t0) } feSquare(&t1, &t0) for i = 1; i < 2; i++ { feSquare(&t1, &t1) } feMul(&t1, z, &t1) feMul(&t0, &t0, &t1) feSquare(&t2, &t0) for i = 1; i < 1; i++ { feSquare(&t2, &t2) } feMul(&t1, &t1, &t2) feSquare(&t2, &t1) for i = 1; i < 5; i++ { feSquare(&t2, &t2) } feMul(&t1, &t2, &t1) feSquare(&t2, &t1) for i = 1; i < 10; i++ { feSquare(&t2, &t2) } feMul(&t2, &t2, &t1) feSquare(&t3, &t2) for i = 1; i < 20; i++ { feSquare(&t3, &t3) } feMul(&t2, &t3, &t2) feSquare(&t2, &t2) for i = 1; i < 10; i++ { feSquare(&t2, &t2) } feMul(&t1, &t2, &t1) feSquare(&t2, &t1) for i = 1; i < 50; i++ { feSquare(&t2, &t2) } feMul(&t2, &t2, &t1) feSquare(&t3, &t2) for i = 1; i < 100; i++ { feSquare(&t3, &t3) } feMul(&t2, &t3, &t2) feSquare(&t2, &t2) for i = 1; i < 50; i++ { feSquare(&t2, &t2) } feMul(&t1, &t2, &t1) feSquare(&t1, &t1) for i = 1; i < 5; i++ { feSquare(&t1, &t1) } feMul(out, &t1, &t0) } func scalarMult(out, in, base *[32]byte) { var e [32]byte copy(e[:], in[:]) e[0] &= 248 e[31] &= 127 e[31] |= 64 var x1, x2, z2, x3, z3, tmp0, tmp1 fieldElement feFromBytes(&x1, base) feOne(&x2) feCopy(&x3, &x1) feOne(&z3) swap := int32(0) for pos := 254; pos >= 0; pos-- { b := e[pos/8] >> uint(pos&7) b &= 1 swap ^= int32(b) feCSwap(&x2, &x3, swap) feCSwap(&z2, &z3, swap) swap = int32(b) feSub(&tmp0, &x3, &z3) feSub(&tmp1, &x2, &z2) feAdd(&x2, &x2, &z2) feAdd(&z2, &x3, &z3) feMul(&z3, &tmp0, &x2) feMul(&z2, &z2, &tmp1) feSquare(&tmp0, &tmp1) feSquare(&tmp1, &x2) feAdd(&x3, &z3, &z2) feSub(&z2, &z3, &z2) feMul(&x2, &tmp1, &tmp0) feSub(&tmp1, &tmp1, &tmp0) feSquare(&z2, &z2) feMul121666(&z3, &tmp1) feSquare(&x3, &x3) feAdd(&tmp0, &tmp0, &z3) feMul(&z3, &x1, &z2) feMul(&z2, &tmp1, &tmp0) } feCSwap(&x2, &x3, swap) feCSwap(&z2, &z3, swap) feInvert(&z2, &z2) feMul(&x2, &x2, &z2) feToBytes(out, &x2) } ================================================ FILE: vendor/golang.org/x/crypto/curve25519/doc.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package curve25519 provides an implementation of scalar multiplication on // the elliptic curve known as curve25519. See https://cr.yp.to/ecdh.html package curve25519 // import "golang.org/x/crypto/curve25519" // basePoint is the x coordinate of the generator of the curve. var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} // ScalarMult sets dst to the product in*base where dst and base are the x // coordinates of group points and all values are in little-endian form. func ScalarMult(dst, in, base *[32]byte) { scalarMult(dst, in, base) } // ScalarBaseMult sets dst to the product in*base where dst and base are the x // coordinates of group points, base is the standard generator and all values // are in little-endian form. func ScalarBaseMult(dst, in *[32]byte) { ScalarMult(dst, in, &basePoint) } ================================================ FILE: vendor/golang.org/x/crypto/curve25519/freeze_amd64.s ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This code was translated into a form compatible with 6a from the public // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html // +build amd64,!gccgo,!appengine #include "const_amd64.h" // func freeze(inout *[5]uint64) TEXT ·freeze(SB),7,$0-8 MOVQ inout+0(FP), DI MOVQ 0(DI),SI MOVQ 8(DI),DX MOVQ 16(DI),CX MOVQ 24(DI),R8 MOVQ 32(DI),R9 MOVQ $REDMASK51,AX MOVQ AX,R10 SUBQ $18,R10 MOVQ $3,R11 REDUCELOOP: MOVQ SI,R12 SHRQ $51,R12 ANDQ AX,SI ADDQ R12,DX MOVQ DX,R12 SHRQ $51,R12 ANDQ AX,DX ADDQ R12,CX MOVQ CX,R12 SHRQ $51,R12 ANDQ AX,CX ADDQ R12,R8 MOVQ R8,R12 SHRQ $51,R12 ANDQ AX,R8 ADDQ R12,R9 MOVQ R9,R12 SHRQ $51,R12 ANDQ AX,R9 IMUL3Q $19,R12,R12 ADDQ R12,SI SUBQ $1,R11 JA REDUCELOOP MOVQ $1,R12 CMPQ R10,SI CMOVQLT R11,R12 CMPQ AX,DX CMOVQNE R11,R12 CMPQ AX,CX CMOVQNE R11,R12 CMPQ AX,R8 CMOVQNE R11,R12 CMPQ AX,R9 CMOVQNE R11,R12 NEGQ R12 ANDQ R12,AX ANDQ R12,R10 SUBQ R10,SI SUBQ AX,DX SUBQ AX,CX SUBQ AX,R8 SUBQ AX,R9 MOVQ SI,0(DI) MOVQ DX,8(DI) MOVQ CX,16(DI) MOVQ R8,24(DI) MOVQ R9,32(DI) RET ================================================ FILE: vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This code was translated into a form compatible with 6a from the public // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html // +build amd64,!gccgo,!appengine #include "const_amd64.h" // func ladderstep(inout *[5][5]uint64) TEXT ·ladderstep(SB),0,$296-8 MOVQ inout+0(FP),DI MOVQ 40(DI),SI MOVQ 48(DI),DX MOVQ 56(DI),CX MOVQ 64(DI),R8 MOVQ 72(DI),R9 MOVQ SI,AX MOVQ DX,R10 MOVQ CX,R11 MOVQ R8,R12 MOVQ R9,R13 ADDQ ·_2P0(SB),AX ADDQ ·_2P1234(SB),R10 ADDQ ·_2P1234(SB),R11 ADDQ ·_2P1234(SB),R12 ADDQ ·_2P1234(SB),R13 ADDQ 80(DI),SI ADDQ 88(DI),DX ADDQ 96(DI),CX ADDQ 104(DI),R8 ADDQ 112(DI),R9 SUBQ 80(DI),AX SUBQ 88(DI),R10 SUBQ 96(DI),R11 SUBQ 104(DI),R12 SUBQ 112(DI),R13 MOVQ SI,0(SP) MOVQ DX,8(SP) MOVQ CX,16(SP) MOVQ R8,24(SP) MOVQ R9,32(SP) MOVQ AX,40(SP) MOVQ R10,48(SP) MOVQ R11,56(SP) MOVQ R12,64(SP) MOVQ R13,72(SP) MOVQ 40(SP),AX MULQ 40(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 40(SP),AX SHLQ $1,AX MULQ 48(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 40(SP),AX SHLQ $1,AX MULQ 56(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 40(SP),AX SHLQ $1,AX MULQ 64(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 40(SP),AX SHLQ $1,AX MULQ 72(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 48(SP),AX MULQ 48(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 48(SP),AX SHLQ $1,AX MULQ 56(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 48(SP),AX SHLQ $1,AX MULQ 64(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 48(SP),DX IMUL3Q $38,DX,AX MULQ 72(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 56(SP),AX MULQ 56(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 56(SP),DX IMUL3Q $38,DX,AX MULQ 64(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 56(SP),DX IMUL3Q $38,DX,AX MULQ 72(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 64(SP),DX IMUL3Q $19,DX,AX MULQ 64(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 64(SP),DX IMUL3Q $38,DX,AX MULQ 72(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 72(SP),DX IMUL3Q $19,DX,AX MULQ 72(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ $REDMASK51,DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX ANDQ DX,SI MOVQ CX,R8 SHRQ $51,CX ADDQ R10,CX ANDQ DX,R8 MOVQ CX,R9 SHRQ $51,CX ADDQ R12,CX ANDQ DX,R9 MOVQ CX,AX SHRQ $51,CX ADDQ R14,CX ANDQ DX,AX MOVQ CX,R10 SHRQ $51,CX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,80(SP) MOVQ R8,88(SP) MOVQ R9,96(SP) MOVQ AX,104(SP) MOVQ R10,112(SP) MOVQ 0(SP),AX MULQ 0(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 0(SP),AX SHLQ $1,AX MULQ 8(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 0(SP),AX SHLQ $1,AX MULQ 16(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 0(SP),AX SHLQ $1,AX MULQ 24(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 0(SP),AX SHLQ $1,AX MULQ 32(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 8(SP),AX MULQ 8(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 8(SP),AX SHLQ $1,AX MULQ 16(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 8(SP),AX SHLQ $1,AX MULQ 24(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 8(SP),DX IMUL3Q $38,DX,AX MULQ 32(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 16(SP),AX MULQ 16(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 16(SP),DX IMUL3Q $38,DX,AX MULQ 24(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 16(SP),DX IMUL3Q $38,DX,AX MULQ 32(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 24(SP),DX IMUL3Q $19,DX,AX MULQ 24(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 24(SP),DX IMUL3Q $38,DX,AX MULQ 32(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 32(SP),DX IMUL3Q $19,DX,AX MULQ 32(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ $REDMASK51,DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX ANDQ DX,SI MOVQ CX,R8 SHRQ $51,CX ADDQ R10,CX ANDQ DX,R8 MOVQ CX,R9 SHRQ $51,CX ADDQ R12,CX ANDQ DX,R9 MOVQ CX,AX SHRQ $51,CX ADDQ R14,CX ANDQ DX,AX MOVQ CX,R10 SHRQ $51,CX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,120(SP) MOVQ R8,128(SP) MOVQ R9,136(SP) MOVQ AX,144(SP) MOVQ R10,152(SP) MOVQ SI,SI MOVQ R8,DX MOVQ R9,CX MOVQ AX,R8 MOVQ R10,R9 ADDQ ·_2P0(SB),SI ADDQ ·_2P1234(SB),DX ADDQ ·_2P1234(SB),CX ADDQ ·_2P1234(SB),R8 ADDQ ·_2P1234(SB),R9 SUBQ 80(SP),SI SUBQ 88(SP),DX SUBQ 96(SP),CX SUBQ 104(SP),R8 SUBQ 112(SP),R9 MOVQ SI,160(SP) MOVQ DX,168(SP) MOVQ CX,176(SP) MOVQ R8,184(SP) MOVQ R9,192(SP) MOVQ 120(DI),SI MOVQ 128(DI),DX MOVQ 136(DI),CX MOVQ 144(DI),R8 MOVQ 152(DI),R9 MOVQ SI,AX MOVQ DX,R10 MOVQ CX,R11 MOVQ R8,R12 MOVQ R9,R13 ADDQ ·_2P0(SB),AX ADDQ ·_2P1234(SB),R10 ADDQ ·_2P1234(SB),R11 ADDQ ·_2P1234(SB),R12 ADDQ ·_2P1234(SB),R13 ADDQ 160(DI),SI ADDQ 168(DI),DX ADDQ 176(DI),CX ADDQ 184(DI),R8 ADDQ 192(DI),R9 SUBQ 160(DI),AX SUBQ 168(DI),R10 SUBQ 176(DI),R11 SUBQ 184(DI),R12 SUBQ 192(DI),R13 MOVQ SI,200(SP) MOVQ DX,208(SP) MOVQ CX,216(SP) MOVQ R8,224(SP) MOVQ R9,232(SP) MOVQ AX,240(SP) MOVQ R10,248(SP) MOVQ R11,256(SP) MOVQ R12,264(SP) MOVQ R13,272(SP) MOVQ 224(SP),SI IMUL3Q $19,SI,AX MOVQ AX,280(SP) MULQ 56(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 232(SP),DX IMUL3Q $19,DX,AX MOVQ AX,288(SP) MULQ 48(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 200(SP),AX MULQ 40(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 200(SP),AX MULQ 48(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 200(SP),AX MULQ 56(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 200(SP),AX MULQ 64(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 200(SP),AX MULQ 72(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 208(SP),AX MULQ 40(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 208(SP),AX MULQ 48(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 208(SP),AX MULQ 56(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 208(SP),AX MULQ 64(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 208(SP),DX IMUL3Q $19,DX,AX MULQ 72(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 216(SP),AX MULQ 40(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 216(SP),AX MULQ 48(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 216(SP),AX MULQ 56(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 216(SP),DX IMUL3Q $19,DX,AX MULQ 64(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 216(SP),DX IMUL3Q $19,DX,AX MULQ 72(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 224(SP),AX MULQ 40(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 224(SP),AX MULQ 48(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 280(SP),AX MULQ 64(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 280(SP),AX MULQ 72(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 232(SP),AX MULQ 40(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 288(SP),AX MULQ 56(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 288(SP),AX MULQ 64(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 288(SP),AX MULQ 72(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ $REDMASK51,DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX MOVQ CX,R8 SHRQ $51,CX ANDQ DX,SI ADDQ R10,CX MOVQ CX,R9 SHRQ $51,CX ANDQ DX,R8 ADDQ R12,CX MOVQ CX,AX SHRQ $51,CX ANDQ DX,R9 ADDQ R14,CX MOVQ CX,R10 SHRQ $51,CX ANDQ DX,AX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,40(SP) MOVQ R8,48(SP) MOVQ R9,56(SP) MOVQ AX,64(SP) MOVQ R10,72(SP) MOVQ 264(SP),SI IMUL3Q $19,SI,AX MOVQ AX,200(SP) MULQ 16(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 272(SP),DX IMUL3Q $19,DX,AX MOVQ AX,208(SP) MULQ 8(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 240(SP),AX MULQ 0(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 240(SP),AX MULQ 8(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 240(SP),AX MULQ 16(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 240(SP),AX MULQ 24(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 240(SP),AX MULQ 32(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 248(SP),AX MULQ 0(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 248(SP),AX MULQ 8(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 248(SP),AX MULQ 16(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 248(SP),AX MULQ 24(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 248(SP),DX IMUL3Q $19,DX,AX MULQ 32(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 256(SP),AX MULQ 0(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 256(SP),AX MULQ 8(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 256(SP),AX MULQ 16(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 256(SP),DX IMUL3Q $19,DX,AX MULQ 24(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 256(SP),DX IMUL3Q $19,DX,AX MULQ 32(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 264(SP),AX MULQ 0(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 264(SP),AX MULQ 8(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 200(SP),AX MULQ 24(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 200(SP),AX MULQ 32(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 272(SP),AX MULQ 0(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 208(SP),AX MULQ 16(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 208(SP),AX MULQ 24(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 208(SP),AX MULQ 32(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ $REDMASK51,DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX MOVQ CX,R8 SHRQ $51,CX ANDQ DX,SI ADDQ R10,CX MOVQ CX,R9 SHRQ $51,CX ANDQ DX,R8 ADDQ R12,CX MOVQ CX,AX SHRQ $51,CX ANDQ DX,R9 ADDQ R14,CX MOVQ CX,R10 SHRQ $51,CX ANDQ DX,AX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,DX MOVQ R8,CX MOVQ R9,R11 MOVQ AX,R12 MOVQ R10,R13 ADDQ ·_2P0(SB),DX ADDQ ·_2P1234(SB),CX ADDQ ·_2P1234(SB),R11 ADDQ ·_2P1234(SB),R12 ADDQ ·_2P1234(SB),R13 ADDQ 40(SP),SI ADDQ 48(SP),R8 ADDQ 56(SP),R9 ADDQ 64(SP),AX ADDQ 72(SP),R10 SUBQ 40(SP),DX SUBQ 48(SP),CX SUBQ 56(SP),R11 SUBQ 64(SP),R12 SUBQ 72(SP),R13 MOVQ SI,120(DI) MOVQ R8,128(DI) MOVQ R9,136(DI) MOVQ AX,144(DI) MOVQ R10,152(DI) MOVQ DX,160(DI) MOVQ CX,168(DI) MOVQ R11,176(DI) MOVQ R12,184(DI) MOVQ R13,192(DI) MOVQ 120(DI),AX MULQ 120(DI) MOVQ AX,SI MOVQ DX,CX MOVQ 120(DI),AX SHLQ $1,AX MULQ 128(DI) MOVQ AX,R8 MOVQ DX,R9 MOVQ 120(DI),AX SHLQ $1,AX MULQ 136(DI) MOVQ AX,R10 MOVQ DX,R11 MOVQ 120(DI),AX SHLQ $1,AX MULQ 144(DI) MOVQ AX,R12 MOVQ DX,R13 MOVQ 120(DI),AX SHLQ $1,AX MULQ 152(DI) MOVQ AX,R14 MOVQ DX,R15 MOVQ 128(DI),AX MULQ 128(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 128(DI),AX SHLQ $1,AX MULQ 136(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ 128(DI),AX SHLQ $1,AX MULQ 144(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 128(DI),DX IMUL3Q $38,DX,AX MULQ 152(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 136(DI),AX MULQ 136(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 136(DI),DX IMUL3Q $38,DX,AX MULQ 144(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 136(DI),DX IMUL3Q $38,DX,AX MULQ 152(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 144(DI),DX IMUL3Q $19,DX,AX MULQ 144(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 144(DI),DX IMUL3Q $38,DX,AX MULQ 152(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 152(DI),DX IMUL3Q $19,DX,AX MULQ 152(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ $REDMASK51,DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX ANDQ DX,SI MOVQ CX,R8 SHRQ $51,CX ADDQ R10,CX ANDQ DX,R8 MOVQ CX,R9 SHRQ $51,CX ADDQ R12,CX ANDQ DX,R9 MOVQ CX,AX SHRQ $51,CX ADDQ R14,CX ANDQ DX,AX MOVQ CX,R10 SHRQ $51,CX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,120(DI) MOVQ R8,128(DI) MOVQ R9,136(DI) MOVQ AX,144(DI) MOVQ R10,152(DI) MOVQ 160(DI),AX MULQ 160(DI) MOVQ AX,SI MOVQ DX,CX MOVQ 160(DI),AX SHLQ $1,AX MULQ 168(DI) MOVQ AX,R8 MOVQ DX,R9 MOVQ 160(DI),AX SHLQ $1,AX MULQ 176(DI) MOVQ AX,R10 MOVQ DX,R11 MOVQ 160(DI),AX SHLQ $1,AX MULQ 184(DI) MOVQ AX,R12 MOVQ DX,R13 MOVQ 160(DI),AX SHLQ $1,AX MULQ 192(DI) MOVQ AX,R14 MOVQ DX,R15 MOVQ 168(DI),AX MULQ 168(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 168(DI),AX SHLQ $1,AX MULQ 176(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ 168(DI),AX SHLQ $1,AX MULQ 184(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 168(DI),DX IMUL3Q $38,DX,AX MULQ 192(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 176(DI),AX MULQ 176(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 176(DI),DX IMUL3Q $38,DX,AX MULQ 184(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 176(DI),DX IMUL3Q $38,DX,AX MULQ 192(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 184(DI),DX IMUL3Q $19,DX,AX MULQ 184(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 184(DI),DX IMUL3Q $38,DX,AX MULQ 192(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 192(DI),DX IMUL3Q $19,DX,AX MULQ 192(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ $REDMASK51,DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX ANDQ DX,SI MOVQ CX,R8 SHRQ $51,CX ADDQ R10,CX ANDQ DX,R8 MOVQ CX,R9 SHRQ $51,CX ADDQ R12,CX ANDQ DX,R9 MOVQ CX,AX SHRQ $51,CX ADDQ R14,CX ANDQ DX,AX MOVQ CX,R10 SHRQ $51,CX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,160(DI) MOVQ R8,168(DI) MOVQ R9,176(DI) MOVQ AX,184(DI) MOVQ R10,192(DI) MOVQ 184(DI),SI IMUL3Q $19,SI,AX MOVQ AX,0(SP) MULQ 16(DI) MOVQ AX,SI MOVQ DX,CX MOVQ 192(DI),DX IMUL3Q $19,DX,AX MOVQ AX,8(SP) MULQ 8(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 160(DI),AX MULQ 0(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 160(DI),AX MULQ 8(DI) MOVQ AX,R8 MOVQ DX,R9 MOVQ 160(DI),AX MULQ 16(DI) MOVQ AX,R10 MOVQ DX,R11 MOVQ 160(DI),AX MULQ 24(DI) MOVQ AX,R12 MOVQ DX,R13 MOVQ 160(DI),AX MULQ 32(DI) MOVQ AX,R14 MOVQ DX,R15 MOVQ 168(DI),AX MULQ 0(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 168(DI),AX MULQ 8(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 168(DI),AX MULQ 16(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ 168(DI),AX MULQ 24(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 168(DI),DX IMUL3Q $19,DX,AX MULQ 32(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 176(DI),AX MULQ 0(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 176(DI),AX MULQ 8(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ 176(DI),AX MULQ 16(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 176(DI),DX IMUL3Q $19,DX,AX MULQ 24(DI) ADDQ AX,SI ADCQ DX,CX MOVQ 176(DI),DX IMUL3Q $19,DX,AX MULQ 32(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 184(DI),AX MULQ 0(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ 184(DI),AX MULQ 8(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 0(SP),AX MULQ 24(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 0(SP),AX MULQ 32(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 192(DI),AX MULQ 0(DI) ADDQ AX,R14 ADCQ DX,R15 MOVQ 8(SP),AX MULQ 16(DI) ADDQ AX,R8 ADCQ DX,R9 MOVQ 8(SP),AX MULQ 24(DI) ADDQ AX,R10 ADCQ DX,R11 MOVQ 8(SP),AX MULQ 32(DI) ADDQ AX,R12 ADCQ DX,R13 MOVQ $REDMASK51,DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX MOVQ CX,R8 SHRQ $51,CX ANDQ DX,SI ADDQ R10,CX MOVQ CX,R9 SHRQ $51,CX ANDQ DX,R8 ADDQ R12,CX MOVQ CX,AX SHRQ $51,CX ANDQ DX,R9 ADDQ R14,CX MOVQ CX,R10 SHRQ $51,CX ANDQ DX,AX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,160(DI) MOVQ R8,168(DI) MOVQ R9,176(DI) MOVQ AX,184(DI) MOVQ R10,192(DI) MOVQ 144(SP),SI IMUL3Q $19,SI,AX MOVQ AX,0(SP) MULQ 96(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 152(SP),DX IMUL3Q $19,DX,AX MOVQ AX,8(SP) MULQ 88(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 120(SP),AX MULQ 80(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 120(SP),AX MULQ 88(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 120(SP),AX MULQ 96(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 120(SP),AX MULQ 104(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 120(SP),AX MULQ 112(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 128(SP),AX MULQ 80(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 128(SP),AX MULQ 88(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 128(SP),AX MULQ 96(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 128(SP),AX MULQ 104(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 128(SP),DX IMUL3Q $19,DX,AX MULQ 112(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 136(SP),AX MULQ 80(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 136(SP),AX MULQ 88(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 136(SP),AX MULQ 96(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 136(SP),DX IMUL3Q $19,DX,AX MULQ 104(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 136(SP),DX IMUL3Q $19,DX,AX MULQ 112(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 144(SP),AX MULQ 80(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 144(SP),AX MULQ 88(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 0(SP),AX MULQ 104(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 0(SP),AX MULQ 112(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 152(SP),AX MULQ 80(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 8(SP),AX MULQ 96(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 8(SP),AX MULQ 104(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 8(SP),AX MULQ 112(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ $REDMASK51,DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX MOVQ CX,R8 SHRQ $51,CX ANDQ DX,SI ADDQ R10,CX MOVQ CX,R9 SHRQ $51,CX ANDQ DX,R8 ADDQ R12,CX MOVQ CX,AX SHRQ $51,CX ANDQ DX,R9 ADDQ R14,CX MOVQ CX,R10 SHRQ $51,CX ANDQ DX,AX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,40(DI) MOVQ R8,48(DI) MOVQ R9,56(DI) MOVQ AX,64(DI) MOVQ R10,72(DI) MOVQ 160(SP),AX MULQ ·_121666_213(SB) SHRQ $13,AX MOVQ AX,SI MOVQ DX,CX MOVQ 168(SP),AX MULQ ·_121666_213(SB) SHRQ $13,AX ADDQ AX,CX MOVQ DX,R8 MOVQ 176(SP),AX MULQ ·_121666_213(SB) SHRQ $13,AX ADDQ AX,R8 MOVQ DX,R9 MOVQ 184(SP),AX MULQ ·_121666_213(SB) SHRQ $13,AX ADDQ AX,R9 MOVQ DX,R10 MOVQ 192(SP),AX MULQ ·_121666_213(SB) SHRQ $13,AX ADDQ AX,R10 IMUL3Q $19,DX,DX ADDQ DX,SI ADDQ 80(SP),SI ADDQ 88(SP),CX ADDQ 96(SP),R8 ADDQ 104(SP),R9 ADDQ 112(SP),R10 MOVQ SI,80(DI) MOVQ CX,88(DI) MOVQ R8,96(DI) MOVQ R9,104(DI) MOVQ R10,112(DI) MOVQ 104(DI),SI IMUL3Q $19,SI,AX MOVQ AX,0(SP) MULQ 176(SP) MOVQ AX,SI MOVQ DX,CX MOVQ 112(DI),DX IMUL3Q $19,DX,AX MOVQ AX,8(SP) MULQ 168(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 80(DI),AX MULQ 160(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 80(DI),AX MULQ 168(SP) MOVQ AX,R8 MOVQ DX,R9 MOVQ 80(DI),AX MULQ 176(SP) MOVQ AX,R10 MOVQ DX,R11 MOVQ 80(DI),AX MULQ 184(SP) MOVQ AX,R12 MOVQ DX,R13 MOVQ 80(DI),AX MULQ 192(SP) MOVQ AX,R14 MOVQ DX,R15 MOVQ 88(DI),AX MULQ 160(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 88(DI),AX MULQ 168(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 88(DI),AX MULQ 176(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 88(DI),AX MULQ 184(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 88(DI),DX IMUL3Q $19,DX,AX MULQ 192(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 96(DI),AX MULQ 160(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 96(DI),AX MULQ 168(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 96(DI),AX MULQ 176(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 96(DI),DX IMUL3Q $19,DX,AX MULQ 184(SP) ADDQ AX,SI ADCQ DX,CX MOVQ 96(DI),DX IMUL3Q $19,DX,AX MULQ 192(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 104(DI),AX MULQ 160(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ 104(DI),AX MULQ 168(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 0(SP),AX MULQ 184(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 0(SP),AX MULQ 192(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 112(DI),AX MULQ 160(SP) ADDQ AX,R14 ADCQ DX,R15 MOVQ 8(SP),AX MULQ 176(SP) ADDQ AX,R8 ADCQ DX,R9 MOVQ 8(SP),AX MULQ 184(SP) ADDQ AX,R10 ADCQ DX,R11 MOVQ 8(SP),AX MULQ 192(SP) ADDQ AX,R12 ADCQ DX,R13 MOVQ $REDMASK51,DX SHLQ $13,CX:SI ANDQ DX,SI SHLQ $13,R9:R8 ANDQ DX,R8 ADDQ CX,R8 SHLQ $13,R11:R10 ANDQ DX,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ DX,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ DX,R14 ADDQ R13,R14 IMUL3Q $19,R15,CX ADDQ CX,SI MOVQ SI,CX SHRQ $51,CX ADDQ R8,CX MOVQ CX,R8 SHRQ $51,CX ANDQ DX,SI ADDQ R10,CX MOVQ CX,R9 SHRQ $51,CX ANDQ DX,R8 ADDQ R12,CX MOVQ CX,AX SHRQ $51,CX ANDQ DX,R9 ADDQ R14,CX MOVQ CX,R10 SHRQ $51,CX ANDQ DX,AX IMUL3Q $19,CX,CX ADDQ CX,SI ANDQ DX,R10 MOVQ SI,80(DI) MOVQ R8,88(DI) MOVQ R9,96(DI) MOVQ AX,104(DI) MOVQ R10,112(DI) RET ================================================ FILE: vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build amd64,!gccgo,!appengine package curve25519 // These functions are implemented in the .s files. The names of the functions // in the rest of the file are also taken from the SUPERCOP sources to help // people following along. //go:noescape func cswap(inout *[5]uint64, v uint64) //go:noescape func ladderstep(inout *[5][5]uint64) //go:noescape func freeze(inout *[5]uint64) //go:noescape func mul(dest, a, b *[5]uint64) //go:noescape func square(out, in *[5]uint64) // mladder uses a Montgomery ladder to calculate (xr/zr) *= s. func mladder(xr, zr *[5]uint64, s *[32]byte) { var work [5][5]uint64 work[0] = *xr setint(&work[1], 1) setint(&work[2], 0) work[3] = *xr setint(&work[4], 1) j := uint(6) var prevbit byte for i := 31; i >= 0; i-- { for j < 8 { bit := ((*s)[i] >> j) & 1 swap := bit ^ prevbit prevbit = bit cswap(&work[1], uint64(swap)) ladderstep(&work) j-- } j = 7 } *xr = work[1] *zr = work[2] } func scalarMult(out, in, base *[32]byte) { var e [32]byte copy(e[:], (*in)[:]) e[0] &= 248 e[31] &= 127 e[31] |= 64 var t, z [5]uint64 unpack(&t, base) mladder(&t, &z, &e) invert(&z, &z) mul(&t, &t, &z) pack(out, &t) } func setint(r *[5]uint64, v uint64) { r[0] = v r[1] = 0 r[2] = 0 r[3] = 0 r[4] = 0 } // unpack sets r = x where r consists of 5, 51-bit limbs in little-endian // order. func unpack(r *[5]uint64, x *[32]byte) { r[0] = uint64(x[0]) | uint64(x[1])<<8 | uint64(x[2])<<16 | uint64(x[3])<<24 | uint64(x[4])<<32 | uint64(x[5])<<40 | uint64(x[6]&7)<<48 r[1] = uint64(x[6])>>3 | uint64(x[7])<<5 | uint64(x[8])<<13 | uint64(x[9])<<21 | uint64(x[10])<<29 | uint64(x[11])<<37 | uint64(x[12]&63)<<45 r[2] = uint64(x[12])>>6 | uint64(x[13])<<2 | uint64(x[14])<<10 | uint64(x[15])<<18 | uint64(x[16])<<26 | uint64(x[17])<<34 | uint64(x[18])<<42 | uint64(x[19]&1)<<50 r[3] = uint64(x[19])>>1 | uint64(x[20])<<7 | uint64(x[21])<<15 | uint64(x[22])<<23 | uint64(x[23])<<31 | uint64(x[24])<<39 | uint64(x[25]&15)<<47 r[4] = uint64(x[25])>>4 | uint64(x[26])<<4 | uint64(x[27])<<12 | uint64(x[28])<<20 | uint64(x[29])<<28 | uint64(x[30])<<36 | uint64(x[31]&127)<<44 } // pack sets out = x where out is the usual, little-endian form of the 5, // 51-bit limbs in x. func pack(out *[32]byte, x *[5]uint64) { t := *x freeze(&t) out[0] = byte(t[0]) out[1] = byte(t[0] >> 8) out[2] = byte(t[0] >> 16) out[3] = byte(t[0] >> 24) out[4] = byte(t[0] >> 32) out[5] = byte(t[0] >> 40) out[6] = byte(t[0] >> 48) out[6] ^= byte(t[1]<<3) & 0xf8 out[7] = byte(t[1] >> 5) out[8] = byte(t[1] >> 13) out[9] = byte(t[1] >> 21) out[10] = byte(t[1] >> 29) out[11] = byte(t[1] >> 37) out[12] = byte(t[1] >> 45) out[12] ^= byte(t[2]<<6) & 0xc0 out[13] = byte(t[2] >> 2) out[14] = byte(t[2] >> 10) out[15] = byte(t[2] >> 18) out[16] = byte(t[2] >> 26) out[17] = byte(t[2] >> 34) out[18] = byte(t[2] >> 42) out[19] = byte(t[2] >> 50) out[19] ^= byte(t[3]<<1) & 0xfe out[20] = byte(t[3] >> 7) out[21] = byte(t[3] >> 15) out[22] = byte(t[3] >> 23) out[23] = byte(t[3] >> 31) out[24] = byte(t[3] >> 39) out[25] = byte(t[3] >> 47) out[25] ^= byte(t[4]<<4) & 0xf0 out[26] = byte(t[4] >> 4) out[27] = byte(t[4] >> 12) out[28] = byte(t[4] >> 20) out[29] = byte(t[4] >> 28) out[30] = byte(t[4] >> 36) out[31] = byte(t[4] >> 44) } // invert calculates r = x^-1 mod p using Fermat's little theorem. func invert(r *[5]uint64, x *[5]uint64) { var z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t [5]uint64 square(&z2, x) /* 2 */ square(&t, &z2) /* 4 */ square(&t, &t) /* 8 */ mul(&z9, &t, x) /* 9 */ mul(&z11, &z9, &z2) /* 11 */ square(&t, &z11) /* 22 */ mul(&z2_5_0, &t, &z9) /* 2^5 - 2^0 = 31 */ square(&t, &z2_5_0) /* 2^6 - 2^1 */ for i := 1; i < 5; i++ { /* 2^20 - 2^10 */ square(&t, &t) } mul(&z2_10_0, &t, &z2_5_0) /* 2^10 - 2^0 */ square(&t, &z2_10_0) /* 2^11 - 2^1 */ for i := 1; i < 10; i++ { /* 2^20 - 2^10 */ square(&t, &t) } mul(&z2_20_0, &t, &z2_10_0) /* 2^20 - 2^0 */ square(&t, &z2_20_0) /* 2^21 - 2^1 */ for i := 1; i < 20; i++ { /* 2^40 - 2^20 */ square(&t, &t) } mul(&t, &t, &z2_20_0) /* 2^40 - 2^0 */ square(&t, &t) /* 2^41 - 2^1 */ for i := 1; i < 10; i++ { /* 2^50 - 2^10 */ square(&t, &t) } mul(&z2_50_0, &t, &z2_10_0) /* 2^50 - 2^0 */ square(&t, &z2_50_0) /* 2^51 - 2^1 */ for i := 1; i < 50; i++ { /* 2^100 - 2^50 */ square(&t, &t) } mul(&z2_100_0, &t, &z2_50_0) /* 2^100 - 2^0 */ square(&t, &z2_100_0) /* 2^101 - 2^1 */ for i := 1; i < 100; i++ { /* 2^200 - 2^100 */ square(&t, &t) } mul(&t, &t, &z2_100_0) /* 2^200 - 2^0 */ square(&t, &t) /* 2^201 - 2^1 */ for i := 1; i < 50; i++ { /* 2^250 - 2^50 */ square(&t, &t) } mul(&t, &t, &z2_50_0) /* 2^250 - 2^0 */ square(&t, &t) /* 2^251 - 2^1 */ square(&t, &t) /* 2^252 - 2^2 */ square(&t, &t) /* 2^253 - 2^3 */ square(&t, &t) /* 2^254 - 2^4 */ square(&t, &t) /* 2^255 - 2^5 */ mul(r, &t, &z11) /* 2^255 - 21 */ } ================================================ FILE: vendor/golang.org/x/crypto/curve25519/mul_amd64.s ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This code was translated into a form compatible with 6a from the public // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html // +build amd64,!gccgo,!appengine #include "const_amd64.h" // func mul(dest, a, b *[5]uint64) TEXT ·mul(SB),0,$16-24 MOVQ dest+0(FP), DI MOVQ a+8(FP), SI MOVQ b+16(FP), DX MOVQ DX,CX MOVQ 24(SI),DX IMUL3Q $19,DX,AX MOVQ AX,0(SP) MULQ 16(CX) MOVQ AX,R8 MOVQ DX,R9 MOVQ 32(SI),DX IMUL3Q $19,DX,AX MOVQ AX,8(SP) MULQ 8(CX) ADDQ AX,R8 ADCQ DX,R9 MOVQ 0(SI),AX MULQ 0(CX) ADDQ AX,R8 ADCQ DX,R9 MOVQ 0(SI),AX MULQ 8(CX) MOVQ AX,R10 MOVQ DX,R11 MOVQ 0(SI),AX MULQ 16(CX) MOVQ AX,R12 MOVQ DX,R13 MOVQ 0(SI),AX MULQ 24(CX) MOVQ AX,R14 MOVQ DX,R15 MOVQ 0(SI),AX MULQ 32(CX) MOVQ AX,BX MOVQ DX,BP MOVQ 8(SI),AX MULQ 0(CX) ADDQ AX,R10 ADCQ DX,R11 MOVQ 8(SI),AX MULQ 8(CX) ADDQ AX,R12 ADCQ DX,R13 MOVQ 8(SI),AX MULQ 16(CX) ADDQ AX,R14 ADCQ DX,R15 MOVQ 8(SI),AX MULQ 24(CX) ADDQ AX,BX ADCQ DX,BP MOVQ 8(SI),DX IMUL3Q $19,DX,AX MULQ 32(CX) ADDQ AX,R8 ADCQ DX,R9 MOVQ 16(SI),AX MULQ 0(CX) ADDQ AX,R12 ADCQ DX,R13 MOVQ 16(SI),AX MULQ 8(CX) ADDQ AX,R14 ADCQ DX,R15 MOVQ 16(SI),AX MULQ 16(CX) ADDQ AX,BX ADCQ DX,BP MOVQ 16(SI),DX IMUL3Q $19,DX,AX MULQ 24(CX) ADDQ AX,R8 ADCQ DX,R9 MOVQ 16(SI),DX IMUL3Q $19,DX,AX MULQ 32(CX) ADDQ AX,R10 ADCQ DX,R11 MOVQ 24(SI),AX MULQ 0(CX) ADDQ AX,R14 ADCQ DX,R15 MOVQ 24(SI),AX MULQ 8(CX) ADDQ AX,BX ADCQ DX,BP MOVQ 0(SP),AX MULQ 24(CX) ADDQ AX,R10 ADCQ DX,R11 MOVQ 0(SP),AX MULQ 32(CX) ADDQ AX,R12 ADCQ DX,R13 MOVQ 32(SI),AX MULQ 0(CX) ADDQ AX,BX ADCQ DX,BP MOVQ 8(SP),AX MULQ 16(CX) ADDQ AX,R10 ADCQ DX,R11 MOVQ 8(SP),AX MULQ 24(CX) ADDQ AX,R12 ADCQ DX,R13 MOVQ 8(SP),AX MULQ 32(CX) ADDQ AX,R14 ADCQ DX,R15 MOVQ $REDMASK51,SI SHLQ $13,R9:R8 ANDQ SI,R8 SHLQ $13,R11:R10 ANDQ SI,R10 ADDQ R9,R10 SHLQ $13,R13:R12 ANDQ SI,R12 ADDQ R11,R12 SHLQ $13,R15:R14 ANDQ SI,R14 ADDQ R13,R14 SHLQ $13,BP:BX ANDQ SI,BX ADDQ R15,BX IMUL3Q $19,BP,DX ADDQ DX,R8 MOVQ R8,DX SHRQ $51,DX ADDQ R10,DX MOVQ DX,CX SHRQ $51,DX ANDQ SI,R8 ADDQ R12,DX MOVQ DX,R9 SHRQ $51,DX ANDQ SI,CX ADDQ R14,DX MOVQ DX,AX SHRQ $51,DX ANDQ SI,R9 ADDQ BX,DX MOVQ DX,R10 SHRQ $51,DX ANDQ SI,AX IMUL3Q $19,DX,DX ADDQ DX,R8 ANDQ SI,R10 MOVQ R8,0(DI) MOVQ CX,8(DI) MOVQ R9,16(DI) MOVQ AX,24(DI) MOVQ R10,32(DI) RET ================================================ FILE: vendor/golang.org/x/crypto/curve25519/square_amd64.s ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This code was translated into a form compatible with 6a from the public // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html // +build amd64,!gccgo,!appengine #include "const_amd64.h" // func square(out, in *[5]uint64) TEXT ·square(SB),7,$0-16 MOVQ out+0(FP), DI MOVQ in+8(FP), SI MOVQ 0(SI),AX MULQ 0(SI) MOVQ AX,CX MOVQ DX,R8 MOVQ 0(SI),AX SHLQ $1,AX MULQ 8(SI) MOVQ AX,R9 MOVQ DX,R10 MOVQ 0(SI),AX SHLQ $1,AX MULQ 16(SI) MOVQ AX,R11 MOVQ DX,R12 MOVQ 0(SI),AX SHLQ $1,AX MULQ 24(SI) MOVQ AX,R13 MOVQ DX,R14 MOVQ 0(SI),AX SHLQ $1,AX MULQ 32(SI) MOVQ AX,R15 MOVQ DX,BX MOVQ 8(SI),AX MULQ 8(SI) ADDQ AX,R11 ADCQ DX,R12 MOVQ 8(SI),AX SHLQ $1,AX MULQ 16(SI) ADDQ AX,R13 ADCQ DX,R14 MOVQ 8(SI),AX SHLQ $1,AX MULQ 24(SI) ADDQ AX,R15 ADCQ DX,BX MOVQ 8(SI),DX IMUL3Q $38,DX,AX MULQ 32(SI) ADDQ AX,CX ADCQ DX,R8 MOVQ 16(SI),AX MULQ 16(SI) ADDQ AX,R15 ADCQ DX,BX MOVQ 16(SI),DX IMUL3Q $38,DX,AX MULQ 24(SI) ADDQ AX,CX ADCQ DX,R8 MOVQ 16(SI),DX IMUL3Q $38,DX,AX MULQ 32(SI) ADDQ AX,R9 ADCQ DX,R10 MOVQ 24(SI),DX IMUL3Q $19,DX,AX MULQ 24(SI) ADDQ AX,R9 ADCQ DX,R10 MOVQ 24(SI),DX IMUL3Q $38,DX,AX MULQ 32(SI) ADDQ AX,R11 ADCQ DX,R12 MOVQ 32(SI),DX IMUL3Q $19,DX,AX MULQ 32(SI) ADDQ AX,R13 ADCQ DX,R14 MOVQ $REDMASK51,SI SHLQ $13,R8:CX ANDQ SI,CX SHLQ $13,R10:R9 ANDQ SI,R9 ADDQ R8,R9 SHLQ $13,R12:R11 ANDQ SI,R11 ADDQ R10,R11 SHLQ $13,R14:R13 ANDQ SI,R13 ADDQ R12,R13 SHLQ $13,BX:R15 ANDQ SI,R15 ADDQ R14,R15 IMUL3Q $19,BX,DX ADDQ DX,CX MOVQ CX,DX SHRQ $51,DX ADDQ R9,DX ANDQ SI,CX MOVQ DX,R8 SHRQ $51,DX ADDQ R11,DX ANDQ SI,R8 MOVQ DX,R9 SHRQ $51,DX ADDQ R13,DX ANDQ SI,R9 MOVQ DX,AX SHRQ $51,DX ADDQ R15,DX ANDQ SI,AX MOVQ DX,R10 SHRQ $51,DX IMUL3Q $19,DX,DX ADDQ DX,CX ANDQ SI,R10 MOVQ CX,0(DI) MOVQ R8,8(DI) MOVQ R9,16(DI) MOVQ AX,24(DI) MOVQ R10,32(DI) RET ================================================ FILE: vendor/golang.org/x/crypto/ed25519/ed25519.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package ed25519 implements the Ed25519 signature algorithm. See // https://ed25519.cr.yp.to/. // // These functions are also compatible with the “Ed25519” function defined in // RFC 8032. However, unlike RFC 8032's formulation, this package's private key // representation includes a public key suffix to make multiple signing // operations with the same key more efficient. This package refers to the RFC // 8032 private key as the “seed”. package ed25519 // This code is a port of the public domain, “ref10” implementation of ed25519 // from SUPERCOP. import ( "bytes" "crypto" cryptorand "crypto/rand" "crypto/sha512" "errors" "io" "strconv" "golang.org/x/crypto/ed25519/internal/edwards25519" ) const ( // PublicKeySize is the size, in bytes, of public keys as used in this package. PublicKeySize = 32 // PrivateKeySize is the size, in bytes, of private keys as used in this package. PrivateKeySize = 64 // SignatureSize is the size, in bytes, of signatures generated and verified by this package. SignatureSize = 64 // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032. SeedSize = 32 ) // PublicKey is the type of Ed25519 public keys. type PublicKey []byte // PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer. type PrivateKey []byte // Public returns the PublicKey corresponding to priv. func (priv PrivateKey) Public() crypto.PublicKey { publicKey := make([]byte, PublicKeySize) copy(publicKey, priv[32:]) return PublicKey(publicKey) } // Seed returns the private key seed corresponding to priv. It is provided for // interoperability with RFC 8032. RFC 8032's private keys correspond to seeds // in this package. func (priv PrivateKey) Seed() []byte { seed := make([]byte, SeedSize) copy(seed, priv[:32]) return seed } // Sign signs the given message with priv. // Ed25519 performs two passes over messages to be signed and therefore cannot // handle pre-hashed messages. Thus opts.HashFunc() must return zero to // indicate the message hasn't been hashed. This can be achieved by passing // crypto.Hash(0) as the value for opts. func (priv PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) { if opts.HashFunc() != crypto.Hash(0) { return nil, errors.New("ed25519: cannot sign hashed message") } return Sign(priv, message), nil } // GenerateKey generates a public/private key pair using entropy from rand. // If rand is nil, crypto/rand.Reader will be used. func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) { if rand == nil { rand = cryptorand.Reader } seed := make([]byte, SeedSize) if _, err := io.ReadFull(rand, seed); err != nil { return nil, nil, err } privateKey := NewKeyFromSeed(seed) publicKey := make([]byte, PublicKeySize) copy(publicKey, privateKey[32:]) return publicKey, privateKey, nil } // NewKeyFromSeed calculates a private key from a seed. It will panic if // len(seed) is not SeedSize. This function is provided for interoperability // with RFC 8032. RFC 8032's private keys correspond to seeds in this // package. func NewKeyFromSeed(seed []byte) PrivateKey { if l := len(seed); l != SeedSize { panic("ed25519: bad seed length: " + strconv.Itoa(l)) } digest := sha512.Sum512(seed) digest[0] &= 248 digest[31] &= 127 digest[31] |= 64 var A edwards25519.ExtendedGroupElement var hBytes [32]byte copy(hBytes[:], digest[:]) edwards25519.GeScalarMultBase(&A, &hBytes) var publicKeyBytes [32]byte A.ToBytes(&publicKeyBytes) privateKey := make([]byte, PrivateKeySize) copy(privateKey, seed) copy(privateKey[32:], publicKeyBytes[:]) return privateKey } // Sign signs the message with privateKey and returns a signature. It will // panic if len(privateKey) is not PrivateKeySize. func Sign(privateKey PrivateKey, message []byte) []byte { if l := len(privateKey); l != PrivateKeySize { panic("ed25519: bad private key length: " + strconv.Itoa(l)) } h := sha512.New() h.Write(privateKey[:32]) var digest1, messageDigest, hramDigest [64]byte var expandedSecretKey [32]byte h.Sum(digest1[:0]) copy(expandedSecretKey[:], digest1[:]) expandedSecretKey[0] &= 248 expandedSecretKey[31] &= 63 expandedSecretKey[31] |= 64 h.Reset() h.Write(digest1[32:]) h.Write(message) h.Sum(messageDigest[:0]) var messageDigestReduced [32]byte edwards25519.ScReduce(&messageDigestReduced, &messageDigest) var R edwards25519.ExtendedGroupElement edwards25519.GeScalarMultBase(&R, &messageDigestReduced) var encodedR [32]byte R.ToBytes(&encodedR) h.Reset() h.Write(encodedR[:]) h.Write(privateKey[32:]) h.Write(message) h.Sum(hramDigest[:0]) var hramDigestReduced [32]byte edwards25519.ScReduce(&hramDigestReduced, &hramDigest) var s [32]byte edwards25519.ScMulAdd(&s, &hramDigestReduced, &expandedSecretKey, &messageDigestReduced) signature := make([]byte, SignatureSize) copy(signature[:], encodedR[:]) copy(signature[32:], s[:]) return signature } // Verify reports whether sig is a valid signature of message by publicKey. It // will panic if len(publicKey) is not PublicKeySize. func Verify(publicKey PublicKey, message, sig []byte) bool { if l := len(publicKey); l != PublicKeySize { panic("ed25519: bad public key length: " + strconv.Itoa(l)) } if len(sig) != SignatureSize || sig[63]&224 != 0 { return false } var A edwards25519.ExtendedGroupElement var publicKeyBytes [32]byte copy(publicKeyBytes[:], publicKey) if !A.FromBytes(&publicKeyBytes) { return false } edwards25519.FeNeg(&A.X, &A.X) edwards25519.FeNeg(&A.T, &A.T) h := sha512.New() h.Write(sig[:32]) h.Write(publicKey[:]) h.Write(message) var digest [64]byte h.Sum(digest[:0]) var hReduced [32]byte edwards25519.ScReduce(&hReduced, &digest) var R edwards25519.ProjectiveGroupElement var s [32]byte copy(s[:], sig[32:]) // https://tools.ietf.org/html/rfc8032#section-5.1.7 requires that s be in // the range [0, order) in order to prevent signature malleability. if !edwards25519.ScMinimal(&s) { return false } edwards25519.GeDoubleScalarMultVartime(&R, &hReduced, &A, &s) var checkR [32]byte R.ToBytes(&checkR) return bytes.Equal(sig[:32], checkR[:]) } ================================================ FILE: vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package edwards25519 // These values are from the public domain, “ref10” implementation of ed25519 // from SUPERCOP. // d is a constant in the Edwards curve equation. var d = FieldElement{ -10913610, 13857413, -15372611, 6949391, 114729, -8787816, -6275908, -3247719, -18696448, -12055116, } // d2 is 2*d. var d2 = FieldElement{ -21827239, -5839606, -30745221, 13898782, 229458, 15978800, -12551817, -6495438, 29715968, 9444199, } // SqrtM1 is the square-root of -1 in the field. var SqrtM1 = FieldElement{ -32595792, -7943725, 9377950, 3500415, 12389472, -272473, -25146209, -2005654, 326686, 11406482, } // A is a constant in the Montgomery-form of curve25519. var A = FieldElement{ 486662, 0, 0, 0, 0, 0, 0, 0, 0, 0, } // bi contains precomputed multiples of the base-point. See the Ed25519 paper // for a discussion about how these values are used. var bi = [8]PreComputedGroupElement{ { FieldElement{25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605}, FieldElement{-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378}, FieldElement{-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546}, }, { FieldElement{15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024}, FieldElement{16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574}, FieldElement{30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357}, }, { FieldElement{10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380}, FieldElement{4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306}, FieldElement{19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942}, }, { FieldElement{5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766}, FieldElement{-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701}, FieldElement{28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300}, }, { FieldElement{-22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877}, FieldElement{-6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951}, FieldElement{4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784}, }, { FieldElement{-25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436}, FieldElement{25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918}, FieldElement{23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877}, }, { FieldElement{-33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800}, FieldElement{-25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305}, FieldElement{-13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300}, }, { FieldElement{-3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876}, FieldElement{-24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619}, FieldElement{-3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683}, }, } // base contains precomputed multiples of the base-point. See the Ed25519 paper // for a discussion about how these values are used. var base = [32][8]PreComputedGroupElement{ { { FieldElement{25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605}, FieldElement{-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378}, FieldElement{-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546}, }, { FieldElement{-12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303}, FieldElement{-21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081}, FieldElement{26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697}, }, { FieldElement{15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024}, FieldElement{16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574}, FieldElement{30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357}, }, { FieldElement{-17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540}, FieldElement{23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397}, FieldElement{7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325}, }, { FieldElement{10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380}, FieldElement{4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306}, FieldElement{19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942}, }, { FieldElement{-15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777}, FieldElement{-8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737}, FieldElement{-18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652}, }, { FieldElement{5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766}, FieldElement{-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701}, FieldElement{28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300}, }, { FieldElement{14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726}, FieldElement{-7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955}, FieldElement{27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425}, }, }, { { FieldElement{-13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171}, FieldElement{27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510}, FieldElement{17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660}, }, { FieldElement{-10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639}, FieldElement{29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963}, FieldElement{5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950}, }, { FieldElement{-27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568}, FieldElement{12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335}, FieldElement{25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628}, }, { FieldElement{-26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007}, FieldElement{-2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772}, FieldElement{-22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653}, }, { FieldElement{2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567}, FieldElement{13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686}, FieldElement{21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372}, }, { FieldElement{-13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887}, FieldElement{-23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954}, FieldElement{-29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953}, }, { FieldElement{24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833}, FieldElement{-16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532}, FieldElement{-22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876}, }, { FieldElement{2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268}, FieldElement{33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214}, FieldElement{1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038}, }, }, { { FieldElement{6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800}, FieldElement{4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645}, FieldElement{-4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664}, }, { FieldElement{1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933}, FieldElement{-25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182}, FieldElement{-17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222}, }, { FieldElement{-18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991}, FieldElement{20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880}, FieldElement{9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092}, }, { FieldElement{-16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295}, FieldElement{19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788}, FieldElement{8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553}, }, { FieldElement{-15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026}, FieldElement{11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347}, FieldElement{-18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033}, }, { FieldElement{-23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395}, FieldElement{-27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278}, FieldElement{1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890}, }, { FieldElement{32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995}, FieldElement{-30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596}, FieldElement{-11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891}, }, { FieldElement{31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060}, FieldElement{11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608}, FieldElement{-20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606}, }, }, { { FieldElement{7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389}, FieldElement{-19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016}, FieldElement{-11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341}, }, { FieldElement{-22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505}, FieldElement{14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553}, FieldElement{-28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655}, }, { FieldElement{15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220}, FieldElement{12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631}, FieldElement{-4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099}, }, { FieldElement{26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556}, FieldElement{14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749}, FieldElement{236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930}, }, { FieldElement{1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391}, FieldElement{5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253}, FieldElement{20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066}, }, { FieldElement{24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958}, FieldElement{-11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082}, FieldElement{-28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383}, }, { FieldElement{-30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521}, FieldElement{-11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807}, FieldElement{23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948}, }, { FieldElement{9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134}, FieldElement{-32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455}, FieldElement{27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629}, }, }, { { FieldElement{-8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069}, FieldElement{-32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746}, FieldElement{24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919}, }, { FieldElement{11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837}, FieldElement{8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906}, FieldElement{-28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771}, }, { FieldElement{-25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817}, FieldElement{10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098}, FieldElement{10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409}, }, { FieldElement{-12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504}, FieldElement{-26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727}, FieldElement{28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420}, }, { FieldElement{-32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003}, FieldElement{-1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605}, FieldElement{-30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384}, }, { FieldElement{-26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701}, FieldElement{-23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683}, FieldElement{29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708}, }, { FieldElement{-3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563}, FieldElement{-19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260}, FieldElement{-5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387}, }, { FieldElement{-19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672}, FieldElement{23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686}, FieldElement{-24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665}, }, }, { { FieldElement{11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182}, FieldElement{-31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277}, FieldElement{14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628}, }, { FieldElement{-4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474}, FieldElement{-26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539}, FieldElement{-25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822}, }, { FieldElement{-10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970}, FieldElement{19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756}, FieldElement{-24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508}, }, { FieldElement{-26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683}, FieldElement{-10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655}, FieldElement{-20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158}, }, { FieldElement{-4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125}, FieldElement{-15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839}, FieldElement{-20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664}, }, { FieldElement{27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294}, FieldElement{-18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899}, FieldElement{-11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070}, }, { FieldElement{3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294}, FieldElement{-15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949}, FieldElement{-21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083}, }, { FieldElement{31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420}, FieldElement{-5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940}, FieldElement{29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396}, }, }, { { FieldElement{-12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567}, FieldElement{20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127}, FieldElement{-16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294}, }, { FieldElement{-12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887}, FieldElement{22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964}, FieldElement{16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195}, }, { FieldElement{9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244}, FieldElement{24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999}, FieldElement{-1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762}, }, { FieldElement{-18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274}, FieldElement{-33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236}, FieldElement{-16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605}, }, { FieldElement{-13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761}, FieldElement{-22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884}, FieldElement{-6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482}, }, { FieldElement{-24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638}, FieldElement{-11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490}, FieldElement{-32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170}, }, { FieldElement{5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736}, FieldElement{10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124}, FieldElement{-17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392}, }, { FieldElement{8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029}, FieldElement{6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048}, FieldElement{28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958}, }, }, { { FieldElement{24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593}, FieldElement{26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071}, FieldElement{-11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692}, }, { FieldElement{11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687}, FieldElement{-160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441}, FieldElement{-20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001}, }, { FieldElement{-938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460}, FieldElement{-19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007}, FieldElement{-21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762}, }, { FieldElement{15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005}, FieldElement{-9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674}, FieldElement{4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035}, }, { FieldElement{7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590}, FieldElement{-2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957}, FieldElement{-30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812}, }, { FieldElement{33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740}, FieldElement{-18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122}, FieldElement{-27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158}, }, { FieldElement{8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885}, FieldElement{26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140}, FieldElement{19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857}, }, { FieldElement{801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155}, FieldElement{19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260}, FieldElement{19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483}, }, }, { { FieldElement{-3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677}, FieldElement{32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815}, FieldElement{22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751}, }, { FieldElement{-16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203}, FieldElement{-11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208}, FieldElement{1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230}, }, { FieldElement{16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850}, FieldElement{-21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389}, FieldElement{-9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968}, }, { FieldElement{-11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689}, FieldElement{14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880}, FieldElement{5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304}, }, { FieldElement{30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632}, FieldElement{-3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412}, FieldElement{20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566}, }, { FieldElement{-20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038}, FieldElement{-26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232}, FieldElement{-1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943}, }, { FieldElement{17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856}, FieldElement{23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738}, FieldElement{15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971}, }, { FieldElement{-27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718}, FieldElement{-13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697}, FieldElement{-11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883}, }, }, { { FieldElement{5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912}, FieldElement{-26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358}, FieldElement{3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849}, }, { FieldElement{29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307}, FieldElement{-14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977}, FieldElement{-6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335}, }, { FieldElement{-29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644}, FieldElement{-22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616}, FieldElement{-27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735}, }, { FieldElement{-21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099}, FieldElement{29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341}, FieldElement{-936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336}, }, { FieldElement{-23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646}, FieldElement{31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425}, FieldElement{-17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388}, }, { FieldElement{-31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743}, FieldElement{-16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822}, FieldElement{-8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462}, }, { FieldElement{18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985}, FieldElement{9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702}, FieldElement{-22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797}, }, { FieldElement{21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293}, FieldElement{27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100}, FieldElement{19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688}, }, }, { { FieldElement{12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186}, FieldElement{2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610}, FieldElement{-2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707}, }, { FieldElement{7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220}, FieldElement{915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025}, FieldElement{32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044}, }, { FieldElement{32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992}, FieldElement{-4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027}, FieldElement{21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197}, }, { FieldElement{8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901}, FieldElement{31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952}, FieldElement{19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878}, }, { FieldElement{-28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390}, FieldElement{32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730}, FieldElement{2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730}, }, { FieldElement{-19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180}, FieldElement{-30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272}, FieldElement{-15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715}, }, { FieldElement{-22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970}, FieldElement{-31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772}, FieldElement{-17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865}, }, { FieldElement{15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750}, FieldElement{20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373}, FieldElement{32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348}, }, }, { { FieldElement{9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144}, FieldElement{-22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195}, FieldElement{5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086}, }, { FieldElement{-13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684}, FieldElement{-8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518}, FieldElement{-2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233}, }, { FieldElement{-5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793}, FieldElement{-2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794}, FieldElement{580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435}, }, { FieldElement{23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921}, FieldElement{13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518}, FieldElement{2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563}, }, { FieldElement{14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278}, FieldElement{-27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024}, FieldElement{4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030}, }, { FieldElement{10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783}, FieldElement{27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717}, FieldElement{6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844}, }, { FieldElement{14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333}, FieldElement{16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048}, FieldElement{22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760}, }, { FieldElement{-4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760}, FieldElement{-15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757}, FieldElement{-2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112}, }, }, { { FieldElement{-19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468}, FieldElement{3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184}, FieldElement{10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289}, }, { FieldElement{15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066}, FieldElement{24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882}, FieldElement{13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226}, }, { FieldElement{16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101}, FieldElement{29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279}, FieldElement{-6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811}, }, { FieldElement{27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709}, FieldElement{20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714}, FieldElement{-2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121}, }, { FieldElement{9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464}, FieldElement{12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847}, FieldElement{13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400}, }, { FieldElement{4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414}, FieldElement{-15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158}, FieldElement{17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045}, }, { FieldElement{-461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415}, FieldElement{-5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459}, FieldElement{-31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079}, }, { FieldElement{21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412}, FieldElement{-20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743}, FieldElement{-14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836}, }, }, { { FieldElement{12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022}, FieldElement{18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429}, FieldElement{-6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065}, }, { FieldElement{30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861}, FieldElement{10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000}, FieldElement{-33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101}, }, { FieldElement{32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815}, FieldElement{29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642}, FieldElement{10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966}, }, { FieldElement{25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574}, FieldElement{-21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742}, FieldElement{-18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689}, }, { FieldElement{12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020}, FieldElement{-10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772}, FieldElement{3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982}, }, { FieldElement{-14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953}, FieldElement{-16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218}, FieldElement{-17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265}, }, { FieldElement{29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073}, FieldElement{-3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325}, FieldElement{-11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798}, }, { FieldElement{-4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870}, FieldElement{-7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863}, FieldElement{-13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927}, }, }, { { FieldElement{-2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267}, FieldElement{-9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663}, FieldElement{22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862}, }, { FieldElement{-25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673}, FieldElement{15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943}, FieldElement{15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020}, }, { FieldElement{-4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238}, FieldElement{11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064}, FieldElement{14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795}, }, { FieldElement{15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052}, FieldElement{-10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904}, FieldElement{29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531}, }, { FieldElement{-13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979}, FieldElement{-5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841}, FieldElement{10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431}, }, { FieldElement{10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324}, FieldElement{-31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940}, FieldElement{10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320}, }, { FieldElement{-15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184}, FieldElement{14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114}, FieldElement{30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878}, }, { FieldElement{12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784}, FieldElement{-2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091}, FieldElement{-16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585}, }, }, { { FieldElement{-8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208}, FieldElement{10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864}, FieldElement{17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661}, }, { FieldElement{7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233}, FieldElement{26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212}, FieldElement{-12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525}, }, { FieldElement{-24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068}, FieldElement{9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397}, FieldElement{-8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988}, }, { FieldElement{5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889}, FieldElement{32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038}, FieldElement{14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697}, }, { FieldElement{20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875}, FieldElement{-25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905}, FieldElement{-25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656}, }, { FieldElement{11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818}, FieldElement{27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714}, FieldElement{10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203}, }, { FieldElement{20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931}, FieldElement{-30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024}, FieldElement{-23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084}, }, { FieldElement{-1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204}, FieldElement{20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817}, FieldElement{27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667}, }, }, { { FieldElement{11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504}, FieldElement{-12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768}, FieldElement{-19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255}, }, { FieldElement{6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790}, FieldElement{1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438}, FieldElement{-22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333}, }, { FieldElement{17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971}, FieldElement{31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905}, FieldElement{29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409}, }, { FieldElement{12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409}, FieldElement{6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499}, FieldElement{-8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363}, }, { FieldElement{28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664}, FieldElement{-11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324}, FieldElement{-21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940}, }, { FieldElement{13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990}, FieldElement{-17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914}, FieldElement{-25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290}, }, { FieldElement{24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257}, FieldElement{-6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433}, FieldElement{-16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236}, }, { FieldElement{-12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045}, FieldElement{11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093}, FieldElement{-1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347}, }, }, { { FieldElement{-28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191}, FieldElement{-15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507}, FieldElement{-12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906}, }, { FieldElement{3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018}, FieldElement{-16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109}, FieldElement{-23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926}, }, { FieldElement{-24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528}, FieldElement{8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625}, FieldElement{-32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286}, }, { FieldElement{2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033}, FieldElement{27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866}, FieldElement{21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896}, }, { FieldElement{30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075}, FieldElement{26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347}, FieldElement{-22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437}, }, { FieldElement{-5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165}, FieldElement{-18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588}, FieldElement{-32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193}, }, { FieldElement{-19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017}, FieldElement{-28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883}, FieldElement{21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961}, }, { FieldElement{8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043}, FieldElement{29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663}, FieldElement{-20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362}, }, }, { { FieldElement{-33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860}, FieldElement{2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466}, FieldElement{-24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063}, }, { FieldElement{-26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997}, FieldElement{-1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295}, FieldElement{-13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369}, }, { FieldElement{9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385}, FieldElement{18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109}, FieldElement{2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906}, }, { FieldElement{4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424}, FieldElement{-19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185}, FieldElement{7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962}, }, { FieldElement{-7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325}, FieldElement{10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593}, FieldElement{696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404}, }, { FieldElement{-11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644}, FieldElement{17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801}, FieldElement{26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804}, }, { FieldElement{-31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884}, FieldElement{-586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577}, FieldElement{-9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849}, }, { FieldElement{32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473}, FieldElement{-8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644}, FieldElement{-2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319}, }, }, { { FieldElement{-11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599}, FieldElement{-9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768}, FieldElement{-27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084}, }, { FieldElement{-27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328}, FieldElement{-15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369}, FieldElement{20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920}, }, { FieldElement{12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815}, FieldElement{-32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025}, FieldElement{-21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397}, }, { FieldElement{-20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448}, FieldElement{6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981}, FieldElement{30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165}, }, { FieldElement{32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501}, FieldElement{17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073}, FieldElement{-1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861}, }, { FieldElement{14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845}, FieldElement{-1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211}, FieldElement{18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870}, }, { FieldElement{10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096}, FieldElement{33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803}, FieldElement{-32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168}, }, { FieldElement{30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965}, FieldElement{-14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505}, FieldElement{18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598}, }, }, { { FieldElement{5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782}, FieldElement{5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900}, FieldElement{-31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479}, }, { FieldElement{-12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208}, FieldElement{8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232}, FieldElement{17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719}, }, { FieldElement{16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271}, FieldElement{-4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326}, FieldElement{-8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132}, }, { FieldElement{14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300}, FieldElement{8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570}, FieldElement{15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670}, }, { FieldElement{-2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994}, FieldElement{-12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913}, FieldElement{31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317}, }, { FieldElement{-25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730}, FieldElement{842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096}, FieldElement{-4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078}, }, { FieldElement{-15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411}, FieldElement{-19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905}, FieldElement{-9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654}, }, { FieldElement{-28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870}, FieldElement{-23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498}, FieldElement{12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579}, }, }, { { FieldElement{14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677}, FieldElement{10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647}, FieldElement{-2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743}, }, { FieldElement{-25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468}, FieldElement{21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375}, FieldElement{-25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155}, }, { FieldElement{6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725}, FieldElement{-12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612}, FieldElement{-10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943}, }, { FieldElement{-30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944}, FieldElement{30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928}, FieldElement{9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406}, }, { FieldElement{22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139}, FieldElement{-8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963}, FieldElement{-31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693}, }, { FieldElement{1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734}, FieldElement{-448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680}, FieldElement{-24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410}, }, { FieldElement{-9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931}, FieldElement{-16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654}, FieldElement{22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710}, }, { FieldElement{29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180}, FieldElement{-26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684}, FieldElement{-10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895}, }, }, { { FieldElement{22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501}, FieldElement{-11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413}, FieldElement{6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880}, }, { FieldElement{-8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874}, FieldElement{22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962}, FieldElement{-7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899}, }, { FieldElement{21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152}, FieldElement{9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063}, FieldElement{7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080}, }, { FieldElement{-9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146}, FieldElement{-17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183}, FieldElement{-19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133}, }, { FieldElement{-32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421}, FieldElement{-3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622}, FieldElement{-4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197}, }, { FieldElement{2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663}, FieldElement{31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753}, FieldElement{4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755}, }, { FieldElement{-9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862}, FieldElement{-26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118}, FieldElement{26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171}, }, { FieldElement{15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380}, FieldElement{16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824}, FieldElement{28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270}, }, }, { { FieldElement{-817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438}, FieldElement{-31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584}, FieldElement{-594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562}, }, { FieldElement{30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471}, FieldElement{18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610}, FieldElement{19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269}, }, { FieldElement{-30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650}, FieldElement{14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369}, FieldElement{19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461}, }, { FieldElement{30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462}, FieldElement{-5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793}, FieldElement{-2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218}, }, { FieldElement{-24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226}, FieldElement{18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019}, FieldElement{-15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037}, }, { FieldElement{31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171}, FieldElement{-17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132}, FieldElement{-28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841}, }, { FieldElement{21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181}, FieldElement{-33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210}, FieldElement{-1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040}, }, { FieldElement{3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935}, FieldElement{24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105}, FieldElement{-28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814}, }, }, { { FieldElement{793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852}, FieldElement{5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581}, FieldElement{-4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646}, }, { FieldElement{10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844}, FieldElement{10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025}, FieldElement{27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453}, }, { FieldElement{-23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068}, FieldElement{4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192}, FieldElement{-17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921}, }, { FieldElement{-9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259}, FieldElement{-12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426}, FieldElement{-5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072}, }, { FieldElement{-17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305}, FieldElement{13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832}, FieldElement{28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943}, }, { FieldElement{-16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011}, FieldElement{24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447}, FieldElement{17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494}, }, { FieldElement{-28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245}, FieldElement{-20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859}, FieldElement{28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915}, }, { FieldElement{16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707}, FieldElement{10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848}, FieldElement{-11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224}, }, }, { { FieldElement{-25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391}, FieldElement{15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215}, FieldElement{-23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101}, }, { FieldElement{23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713}, FieldElement{21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849}, FieldElement{-7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930}, }, { FieldElement{-29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940}, FieldElement{-21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031}, FieldElement{-17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404}, }, { FieldElement{-25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243}, FieldElement{-23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116}, FieldElement{-24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525}, }, { FieldElement{-23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509}, FieldElement{-10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883}, FieldElement{15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865}, }, { FieldElement{-3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660}, FieldElement{4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273}, FieldElement{-28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138}, }, { FieldElement{-25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560}, FieldElement{-10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135}, FieldElement{2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941}, }, { FieldElement{-4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739}, FieldElement{18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756}, FieldElement{-30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819}, }, }, { { FieldElement{-6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347}, FieldElement{-27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028}, FieldElement{21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075}, }, { FieldElement{16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799}, FieldElement{-2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609}, FieldElement{-25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817}, }, { FieldElement{-23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989}, FieldElement{-30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523}, FieldElement{4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278}, }, { FieldElement{31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045}, FieldElement{19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377}, FieldElement{24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480}, }, { FieldElement{17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016}, FieldElement{510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426}, FieldElement{18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525}, }, { FieldElement{13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396}, FieldElement{9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080}, FieldElement{12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892}, }, { FieldElement{15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275}, FieldElement{11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074}, FieldElement{20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140}, }, { FieldElement{-16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717}, FieldElement{-1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101}, FieldElement{24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127}, }, }, { { FieldElement{-12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632}, FieldElement{-26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415}, FieldElement{-31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160}, }, { FieldElement{31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876}, FieldElement{22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625}, FieldElement{-15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478}, }, { FieldElement{27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164}, FieldElement{26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595}, FieldElement{-7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248}, }, { FieldElement{-16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858}, FieldElement{15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193}, FieldElement{8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184}, }, { FieldElement{-18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942}, FieldElement{-1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635}, FieldElement{21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948}, }, { FieldElement{11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935}, FieldElement{-25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415}, FieldElement{-15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416}, }, { FieldElement{-7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018}, FieldElement{4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778}, FieldElement{366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659}, }, { FieldElement{-24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385}, FieldElement{18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503}, FieldElement{476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329}, }, }, { { FieldElement{20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056}, FieldElement{-13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838}, FieldElement{24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948}, }, { FieldElement{-3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691}, FieldElement{-15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118}, FieldElement{-23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517}, }, { FieldElement{-20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269}, FieldElement{-6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904}, FieldElement{-23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589}, }, { FieldElement{-28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193}, FieldElement{-7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910}, FieldElement{-30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930}, }, { FieldElement{-7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667}, FieldElement{25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481}, FieldElement{-9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876}, }, { FieldElement{22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640}, FieldElement{-8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278}, FieldElement{-21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112}, }, { FieldElement{26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272}, FieldElement{17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012}, FieldElement{-10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221}, }, { FieldElement{30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046}, FieldElement{13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345}, FieldElement{-19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310}, }, }, { { FieldElement{19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937}, FieldElement{31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636}, FieldElement{-9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008}, }, { FieldElement{-2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429}, FieldElement{-15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576}, FieldElement{31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066}, }, { FieldElement{-9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490}, FieldElement{-12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104}, FieldElement{33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053}, }, { FieldElement{31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275}, FieldElement{-20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511}, FieldElement{22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095}, }, { FieldElement{-28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439}, FieldElement{23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939}, FieldElement{-23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424}, }, { FieldElement{2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310}, FieldElement{3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608}, FieldElement{-32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079}, }, { FieldElement{-23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101}, FieldElement{21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418}, FieldElement{18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576}, }, { FieldElement{30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356}, FieldElement{9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996}, FieldElement{-26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099}, }, }, { { FieldElement{-26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728}, FieldElement{-13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658}, FieldElement{-10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242}, }, { FieldElement{-21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001}, FieldElement{-4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766}, FieldElement{18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373}, }, { FieldElement{26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458}, FieldElement{-17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628}, FieldElement{-13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657}, }, { FieldElement{-23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062}, FieldElement{25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616}, FieldElement{31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014}, }, { FieldElement{24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383}, FieldElement{-25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814}, FieldElement{-20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718}, }, { FieldElement{30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417}, FieldElement{2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222}, FieldElement{33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444}, }, { FieldElement{-20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597}, FieldElement{23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970}, FieldElement{1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799}, }, { FieldElement{-5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647}, FieldElement{13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511}, FieldElement{-29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032}, }, }, { { FieldElement{9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834}, FieldElement{-23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461}, FieldElement{29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062}, }, { FieldElement{-25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516}, FieldElement{-20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547}, FieldElement{-24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240}, }, { FieldElement{-17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038}, FieldElement{-33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741}, FieldElement{16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103}, }, { FieldElement{-19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747}, FieldElement{-1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323}, FieldElement{31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016}, }, { FieldElement{-14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373}, FieldElement{15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228}, FieldElement{-2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141}, }, { FieldElement{16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399}, FieldElement{11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831}, FieldElement{-185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376}, }, { FieldElement{-32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313}, FieldElement{-18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958}, FieldElement{-6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577}, }, { FieldElement{-22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743}, FieldElement{29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684}, FieldElement{-20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476}, }, }, } ================================================ FILE: vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package edwards25519 import "encoding/binary" // This code is a port of the public domain, “ref10” implementation of ed25519 // from SUPERCOP. // FieldElement represents an element of the field GF(2^255 - 19). An element // t, entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 // t[3]+2^102 t[4]+...+2^230 t[9]. Bounds on each t[i] vary depending on // context. type FieldElement [10]int32 var zero FieldElement func FeZero(fe *FieldElement) { copy(fe[:], zero[:]) } func FeOne(fe *FieldElement) { FeZero(fe) fe[0] = 1 } func FeAdd(dst, a, b *FieldElement) { dst[0] = a[0] + b[0] dst[1] = a[1] + b[1] dst[2] = a[2] + b[2] dst[3] = a[3] + b[3] dst[4] = a[4] + b[4] dst[5] = a[5] + b[5] dst[6] = a[6] + b[6] dst[7] = a[7] + b[7] dst[8] = a[8] + b[8] dst[9] = a[9] + b[9] } func FeSub(dst, a, b *FieldElement) { dst[0] = a[0] - b[0] dst[1] = a[1] - b[1] dst[2] = a[2] - b[2] dst[3] = a[3] - b[3] dst[4] = a[4] - b[4] dst[5] = a[5] - b[5] dst[6] = a[6] - b[6] dst[7] = a[7] - b[7] dst[8] = a[8] - b[8] dst[9] = a[9] - b[9] } func FeCopy(dst, src *FieldElement) { copy(dst[:], src[:]) } // Replace (f,g) with (g,g) if b == 1; // replace (f,g) with (f,g) if b == 0. // // Preconditions: b in {0,1}. func FeCMove(f, g *FieldElement, b int32) { b = -b f[0] ^= b & (f[0] ^ g[0]) f[1] ^= b & (f[1] ^ g[1]) f[2] ^= b & (f[2] ^ g[2]) f[3] ^= b & (f[3] ^ g[3]) f[4] ^= b & (f[4] ^ g[4]) f[5] ^= b & (f[5] ^ g[5]) f[6] ^= b & (f[6] ^ g[6]) f[7] ^= b & (f[7] ^ g[7]) f[8] ^= b & (f[8] ^ g[8]) f[9] ^= b & (f[9] ^ g[9]) } func load3(in []byte) int64 { var r int64 r = int64(in[0]) r |= int64(in[1]) << 8 r |= int64(in[2]) << 16 return r } func load4(in []byte) int64 { var r int64 r = int64(in[0]) r |= int64(in[1]) << 8 r |= int64(in[2]) << 16 r |= int64(in[3]) << 24 return r } func FeFromBytes(dst *FieldElement, src *[32]byte) { h0 := load4(src[:]) h1 := load3(src[4:]) << 6 h2 := load3(src[7:]) << 5 h3 := load3(src[10:]) << 3 h4 := load3(src[13:]) << 2 h5 := load4(src[16:]) h6 := load3(src[20:]) << 7 h7 := load3(src[23:]) << 5 h8 := load3(src[26:]) << 4 h9 := (load3(src[29:]) & 8388607) << 2 FeCombine(dst, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) } // FeToBytes marshals h to s. // Preconditions: // |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. // // Write p=2^255-19; q=floor(h/p). // Basic claim: q = floor(2^(-255)(h + 19 2^(-25)h9 + 2^(-1))). // // Proof: // Have |h|<=p so |q|<=1 so |19^2 2^(-255) q|<1/4. // Also have |h-2^230 h9|<2^230 so |19 2^(-255)(h-2^230 h9)|<1/4. // // Write y=2^(-1)-19^2 2^(-255)q-19 2^(-255)(h-2^230 h9). // Then 0> 25 q = (h[0] + q) >> 26 q = (h[1] + q) >> 25 q = (h[2] + q) >> 26 q = (h[3] + q) >> 25 q = (h[4] + q) >> 26 q = (h[5] + q) >> 25 q = (h[6] + q) >> 26 q = (h[7] + q) >> 25 q = (h[8] + q) >> 26 q = (h[9] + q) >> 25 // Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. h[0] += 19 * q // Goal: Output h-2^255 q, which is between 0 and 2^255-20. carry[0] = h[0] >> 26 h[1] += carry[0] h[0] -= carry[0] << 26 carry[1] = h[1] >> 25 h[2] += carry[1] h[1] -= carry[1] << 25 carry[2] = h[2] >> 26 h[3] += carry[2] h[2] -= carry[2] << 26 carry[3] = h[3] >> 25 h[4] += carry[3] h[3] -= carry[3] << 25 carry[4] = h[4] >> 26 h[5] += carry[4] h[4] -= carry[4] << 26 carry[5] = h[5] >> 25 h[6] += carry[5] h[5] -= carry[5] << 25 carry[6] = h[6] >> 26 h[7] += carry[6] h[6] -= carry[6] << 26 carry[7] = h[7] >> 25 h[8] += carry[7] h[7] -= carry[7] << 25 carry[8] = h[8] >> 26 h[9] += carry[8] h[8] -= carry[8] << 26 carry[9] = h[9] >> 25 h[9] -= carry[9] << 25 // h10 = carry9 // Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20. // Have h[0]+...+2^230 h[9] between 0 and 2^255-1; // evidently 2^255 h10-2^255 q = 0. // Goal: Output h[0]+...+2^230 h[9]. s[0] = byte(h[0] >> 0) s[1] = byte(h[0] >> 8) s[2] = byte(h[0] >> 16) s[3] = byte((h[0] >> 24) | (h[1] << 2)) s[4] = byte(h[1] >> 6) s[5] = byte(h[1] >> 14) s[6] = byte((h[1] >> 22) | (h[2] << 3)) s[7] = byte(h[2] >> 5) s[8] = byte(h[2] >> 13) s[9] = byte((h[2] >> 21) | (h[3] << 5)) s[10] = byte(h[3] >> 3) s[11] = byte(h[3] >> 11) s[12] = byte((h[3] >> 19) | (h[4] << 6)) s[13] = byte(h[4] >> 2) s[14] = byte(h[4] >> 10) s[15] = byte(h[4] >> 18) s[16] = byte(h[5] >> 0) s[17] = byte(h[5] >> 8) s[18] = byte(h[5] >> 16) s[19] = byte((h[5] >> 24) | (h[6] << 1)) s[20] = byte(h[6] >> 7) s[21] = byte(h[6] >> 15) s[22] = byte((h[6] >> 23) | (h[7] << 3)) s[23] = byte(h[7] >> 5) s[24] = byte(h[7] >> 13) s[25] = byte((h[7] >> 21) | (h[8] << 4)) s[26] = byte(h[8] >> 4) s[27] = byte(h[8] >> 12) s[28] = byte((h[8] >> 20) | (h[9] << 6)) s[29] = byte(h[9] >> 2) s[30] = byte(h[9] >> 10) s[31] = byte(h[9] >> 18) } func FeIsNegative(f *FieldElement) byte { var s [32]byte FeToBytes(&s, f) return s[0] & 1 } func FeIsNonZero(f *FieldElement) int32 { var s [32]byte FeToBytes(&s, f) var x uint8 for _, b := range s { x |= b } x |= x >> 4 x |= x >> 2 x |= x >> 1 return int32(x & 1) } // FeNeg sets h = -f // // Preconditions: // |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. // // Postconditions: // |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. func FeNeg(h, f *FieldElement) { h[0] = -f[0] h[1] = -f[1] h[2] = -f[2] h[3] = -f[3] h[4] = -f[4] h[5] = -f[5] h[6] = -f[6] h[7] = -f[7] h[8] = -f[8] h[9] = -f[9] } func FeCombine(h *FieldElement, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) { var c0, c1, c2, c3, c4, c5, c6, c7, c8, c9 int64 /* |h0| <= (1.1*1.1*2^52*(1+19+19+19+19)+1.1*1.1*2^50*(38+38+38+38+38)) i.e. |h0| <= 1.2*2^59; narrower ranges for h2, h4, h6, h8 |h1| <= (1.1*1.1*2^51*(1+1+19+19+19+19+19+19+19+19)) i.e. |h1| <= 1.5*2^58; narrower ranges for h3, h5, h7, h9 */ c0 = (h0 + (1 << 25)) >> 26 h1 += c0 h0 -= c0 << 26 c4 = (h4 + (1 << 25)) >> 26 h5 += c4 h4 -= c4 << 26 /* |h0| <= 2^25 */ /* |h4| <= 2^25 */ /* |h1| <= 1.51*2^58 */ /* |h5| <= 1.51*2^58 */ c1 = (h1 + (1 << 24)) >> 25 h2 += c1 h1 -= c1 << 25 c5 = (h5 + (1 << 24)) >> 25 h6 += c5 h5 -= c5 << 25 /* |h1| <= 2^24; from now on fits into int32 */ /* |h5| <= 2^24; from now on fits into int32 */ /* |h2| <= 1.21*2^59 */ /* |h6| <= 1.21*2^59 */ c2 = (h2 + (1 << 25)) >> 26 h3 += c2 h2 -= c2 << 26 c6 = (h6 + (1 << 25)) >> 26 h7 += c6 h6 -= c6 << 26 /* |h2| <= 2^25; from now on fits into int32 unchanged */ /* |h6| <= 2^25; from now on fits into int32 unchanged */ /* |h3| <= 1.51*2^58 */ /* |h7| <= 1.51*2^58 */ c3 = (h3 + (1 << 24)) >> 25 h4 += c3 h3 -= c3 << 25 c7 = (h7 + (1 << 24)) >> 25 h8 += c7 h7 -= c7 << 25 /* |h3| <= 2^24; from now on fits into int32 unchanged */ /* |h7| <= 2^24; from now on fits into int32 unchanged */ /* |h4| <= 1.52*2^33 */ /* |h8| <= 1.52*2^33 */ c4 = (h4 + (1 << 25)) >> 26 h5 += c4 h4 -= c4 << 26 c8 = (h8 + (1 << 25)) >> 26 h9 += c8 h8 -= c8 << 26 /* |h4| <= 2^25; from now on fits into int32 unchanged */ /* |h8| <= 2^25; from now on fits into int32 unchanged */ /* |h5| <= 1.01*2^24 */ /* |h9| <= 1.51*2^58 */ c9 = (h9 + (1 << 24)) >> 25 h0 += c9 * 19 h9 -= c9 << 25 /* |h9| <= 2^24; from now on fits into int32 unchanged */ /* |h0| <= 1.8*2^37 */ c0 = (h0 + (1 << 25)) >> 26 h1 += c0 h0 -= c0 << 26 /* |h0| <= 2^25; from now on fits into int32 unchanged */ /* |h1| <= 1.01*2^24 */ h[0] = int32(h0) h[1] = int32(h1) h[2] = int32(h2) h[3] = int32(h3) h[4] = int32(h4) h[5] = int32(h5) h[6] = int32(h6) h[7] = int32(h7) h[8] = int32(h8) h[9] = int32(h9) } // FeMul calculates h = f * g // Can overlap h with f or g. // // Preconditions: // |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. // |g| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. // // Postconditions: // |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. // // Notes on implementation strategy: // // Using schoolbook multiplication. // Karatsuba would save a little in some cost models. // // Most multiplications by 2 and 19 are 32-bit precomputations; // cheaper than 64-bit postcomputations. // // There is one remaining multiplication by 19 in the carry chain; // one *19 precomputation can be merged into this, // but the resulting data flow is considerably less clean. // // There are 12 carries below. // 10 of them are 2-way parallelizable and vectorizable. // Can get away with 11 carries, but then data flow is much deeper. // // With tighter constraints on inputs, can squeeze carries into int32. func FeMul(h, f, g *FieldElement) { f0 := int64(f[0]) f1 := int64(f[1]) f2 := int64(f[2]) f3 := int64(f[3]) f4 := int64(f[4]) f5 := int64(f[5]) f6 := int64(f[6]) f7 := int64(f[7]) f8 := int64(f[8]) f9 := int64(f[9]) f1_2 := int64(2 * f[1]) f3_2 := int64(2 * f[3]) f5_2 := int64(2 * f[5]) f7_2 := int64(2 * f[7]) f9_2 := int64(2 * f[9]) g0 := int64(g[0]) g1 := int64(g[1]) g2 := int64(g[2]) g3 := int64(g[3]) g4 := int64(g[4]) g5 := int64(g[5]) g6 := int64(g[6]) g7 := int64(g[7]) g8 := int64(g[8]) g9 := int64(g[9]) g1_19 := int64(19 * g[1]) /* 1.4*2^29 */ g2_19 := int64(19 * g[2]) /* 1.4*2^30; still ok */ g3_19 := int64(19 * g[3]) g4_19 := int64(19 * g[4]) g5_19 := int64(19 * g[5]) g6_19 := int64(19 * g[6]) g7_19 := int64(19 * g[7]) g8_19 := int64(19 * g[8]) g9_19 := int64(19 * g[9]) h0 := f0*g0 + f1_2*g9_19 + f2*g8_19 + f3_2*g7_19 + f4*g6_19 + f5_2*g5_19 + f6*g4_19 + f7_2*g3_19 + f8*g2_19 + f9_2*g1_19 h1 := f0*g1 + f1*g0 + f2*g9_19 + f3*g8_19 + f4*g7_19 + f5*g6_19 + f6*g5_19 + f7*g4_19 + f8*g3_19 + f9*g2_19 h2 := f0*g2 + f1_2*g1 + f2*g0 + f3_2*g9_19 + f4*g8_19 + f5_2*g7_19 + f6*g6_19 + f7_2*g5_19 + f8*g4_19 + f9_2*g3_19 h3 := f0*g3 + f1*g2 + f2*g1 + f3*g0 + f4*g9_19 + f5*g8_19 + f6*g7_19 + f7*g6_19 + f8*g5_19 + f9*g4_19 h4 := f0*g4 + f1_2*g3 + f2*g2 + f3_2*g1 + f4*g0 + f5_2*g9_19 + f6*g8_19 + f7_2*g7_19 + f8*g6_19 + f9_2*g5_19 h5 := f0*g5 + f1*g4 + f2*g3 + f3*g2 + f4*g1 + f5*g0 + f6*g9_19 + f7*g8_19 + f8*g7_19 + f9*g6_19 h6 := f0*g6 + f1_2*g5 + f2*g4 + f3_2*g3 + f4*g2 + f5_2*g1 + f6*g0 + f7_2*g9_19 + f8*g8_19 + f9_2*g7_19 h7 := f0*g7 + f1*g6 + f2*g5 + f3*g4 + f4*g3 + f5*g2 + f6*g1 + f7*g0 + f8*g9_19 + f9*g8_19 h8 := f0*g8 + f1_2*g7 + f2*g6 + f3_2*g5 + f4*g4 + f5_2*g3 + f6*g2 + f7_2*g1 + f8*g0 + f9_2*g9_19 h9 := f0*g9 + f1*g8 + f2*g7 + f3*g6 + f4*g5 + f5*g4 + f6*g3 + f7*g2 + f8*g1 + f9*g0 FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) } func feSquare(f *FieldElement) (h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 int64) { f0 := int64(f[0]) f1 := int64(f[1]) f2 := int64(f[2]) f3 := int64(f[3]) f4 := int64(f[4]) f5 := int64(f[5]) f6 := int64(f[6]) f7 := int64(f[7]) f8 := int64(f[8]) f9 := int64(f[9]) f0_2 := int64(2 * f[0]) f1_2 := int64(2 * f[1]) f2_2 := int64(2 * f[2]) f3_2 := int64(2 * f[3]) f4_2 := int64(2 * f[4]) f5_2 := int64(2 * f[5]) f6_2 := int64(2 * f[6]) f7_2 := int64(2 * f[7]) f5_38 := 38 * f5 // 1.31*2^30 f6_19 := 19 * f6 // 1.31*2^30 f7_38 := 38 * f7 // 1.31*2^30 f8_19 := 19 * f8 // 1.31*2^30 f9_38 := 38 * f9 // 1.31*2^30 h0 = f0*f0 + f1_2*f9_38 + f2_2*f8_19 + f3_2*f7_38 + f4_2*f6_19 + f5*f5_38 h1 = f0_2*f1 + f2*f9_38 + f3_2*f8_19 + f4*f7_38 + f5_2*f6_19 h2 = f0_2*f2 + f1_2*f1 + f3_2*f9_38 + f4_2*f8_19 + f5_2*f7_38 + f6*f6_19 h3 = f0_2*f3 + f1_2*f2 + f4*f9_38 + f5_2*f8_19 + f6*f7_38 h4 = f0_2*f4 + f1_2*f3_2 + f2*f2 + f5_2*f9_38 + f6_2*f8_19 + f7*f7_38 h5 = f0_2*f5 + f1_2*f4 + f2_2*f3 + f6*f9_38 + f7_2*f8_19 h6 = f0_2*f6 + f1_2*f5_2 + f2_2*f4 + f3_2*f3 + f7_2*f9_38 + f8*f8_19 h7 = f0_2*f7 + f1_2*f6 + f2_2*f5 + f3_2*f4 + f8*f9_38 h8 = f0_2*f8 + f1_2*f7_2 + f2_2*f6 + f3_2*f5_2 + f4*f4 + f9*f9_38 h9 = f0_2*f9 + f1_2*f8 + f2_2*f7 + f3_2*f6 + f4_2*f5 return } // FeSquare calculates h = f*f. Can overlap h with f. // // Preconditions: // |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. // // Postconditions: // |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. func FeSquare(h, f *FieldElement) { h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 := feSquare(f) FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) } // FeSquare2 sets h = 2 * f * f // // Can overlap h with f. // // Preconditions: // |f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc. // // Postconditions: // |h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc. // See fe_mul.c for discussion of implementation strategy. func FeSquare2(h, f *FieldElement) { h0, h1, h2, h3, h4, h5, h6, h7, h8, h9 := feSquare(f) h0 += h0 h1 += h1 h2 += h2 h3 += h3 h4 += h4 h5 += h5 h6 += h6 h7 += h7 h8 += h8 h9 += h9 FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9) } func FeInvert(out, z *FieldElement) { var t0, t1, t2, t3 FieldElement var i int FeSquare(&t0, z) // 2^1 FeSquare(&t1, &t0) // 2^2 for i = 1; i < 2; i++ { // 2^3 FeSquare(&t1, &t1) } FeMul(&t1, z, &t1) // 2^3 + 2^0 FeMul(&t0, &t0, &t1) // 2^3 + 2^1 + 2^0 FeSquare(&t2, &t0) // 2^4 + 2^2 + 2^1 FeMul(&t1, &t1, &t2) // 2^4 + 2^3 + 2^2 + 2^1 + 2^0 FeSquare(&t2, &t1) // 5,4,3,2,1 for i = 1; i < 5; i++ { // 9,8,7,6,5 FeSquare(&t2, &t2) } FeMul(&t1, &t2, &t1) // 9,8,7,6,5,4,3,2,1,0 FeSquare(&t2, &t1) // 10..1 for i = 1; i < 10; i++ { // 19..10 FeSquare(&t2, &t2) } FeMul(&t2, &t2, &t1) // 19..0 FeSquare(&t3, &t2) // 20..1 for i = 1; i < 20; i++ { // 39..20 FeSquare(&t3, &t3) } FeMul(&t2, &t3, &t2) // 39..0 FeSquare(&t2, &t2) // 40..1 for i = 1; i < 10; i++ { // 49..10 FeSquare(&t2, &t2) } FeMul(&t1, &t2, &t1) // 49..0 FeSquare(&t2, &t1) // 50..1 for i = 1; i < 50; i++ { // 99..50 FeSquare(&t2, &t2) } FeMul(&t2, &t2, &t1) // 99..0 FeSquare(&t3, &t2) // 100..1 for i = 1; i < 100; i++ { // 199..100 FeSquare(&t3, &t3) } FeMul(&t2, &t3, &t2) // 199..0 FeSquare(&t2, &t2) // 200..1 for i = 1; i < 50; i++ { // 249..50 FeSquare(&t2, &t2) } FeMul(&t1, &t2, &t1) // 249..0 FeSquare(&t1, &t1) // 250..1 for i = 1; i < 5; i++ { // 254..5 FeSquare(&t1, &t1) } FeMul(out, &t1, &t0) // 254..5,3,1,0 } func fePow22523(out, z *FieldElement) { var t0, t1, t2 FieldElement var i int FeSquare(&t0, z) for i = 1; i < 1; i++ { FeSquare(&t0, &t0) } FeSquare(&t1, &t0) for i = 1; i < 2; i++ { FeSquare(&t1, &t1) } FeMul(&t1, z, &t1) FeMul(&t0, &t0, &t1) FeSquare(&t0, &t0) for i = 1; i < 1; i++ { FeSquare(&t0, &t0) } FeMul(&t0, &t1, &t0) FeSquare(&t1, &t0) for i = 1; i < 5; i++ { FeSquare(&t1, &t1) } FeMul(&t0, &t1, &t0) FeSquare(&t1, &t0) for i = 1; i < 10; i++ { FeSquare(&t1, &t1) } FeMul(&t1, &t1, &t0) FeSquare(&t2, &t1) for i = 1; i < 20; i++ { FeSquare(&t2, &t2) } FeMul(&t1, &t2, &t1) FeSquare(&t1, &t1) for i = 1; i < 10; i++ { FeSquare(&t1, &t1) } FeMul(&t0, &t1, &t0) FeSquare(&t1, &t0) for i = 1; i < 50; i++ { FeSquare(&t1, &t1) } FeMul(&t1, &t1, &t0) FeSquare(&t2, &t1) for i = 1; i < 100; i++ { FeSquare(&t2, &t2) } FeMul(&t1, &t2, &t1) FeSquare(&t1, &t1) for i = 1; i < 50; i++ { FeSquare(&t1, &t1) } FeMul(&t0, &t1, &t0) FeSquare(&t0, &t0) for i = 1; i < 2; i++ { FeSquare(&t0, &t0) } FeMul(out, &t0, z) } // Group elements are members of the elliptic curve -x^2 + y^2 = 1 + d * x^2 * // y^2 where d = -121665/121666. // // Several representations are used: // ProjectiveGroupElement: (X:Y:Z) satisfying x=X/Z, y=Y/Z // ExtendedGroupElement: (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT // CompletedGroupElement: ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T // PreComputedGroupElement: (y+x,y-x,2dxy) type ProjectiveGroupElement struct { X, Y, Z FieldElement } type ExtendedGroupElement struct { X, Y, Z, T FieldElement } type CompletedGroupElement struct { X, Y, Z, T FieldElement } type PreComputedGroupElement struct { yPlusX, yMinusX, xy2d FieldElement } type CachedGroupElement struct { yPlusX, yMinusX, Z, T2d FieldElement } func (p *ProjectiveGroupElement) Zero() { FeZero(&p.X) FeOne(&p.Y) FeOne(&p.Z) } func (p *ProjectiveGroupElement) Double(r *CompletedGroupElement) { var t0 FieldElement FeSquare(&r.X, &p.X) FeSquare(&r.Z, &p.Y) FeSquare2(&r.T, &p.Z) FeAdd(&r.Y, &p.X, &p.Y) FeSquare(&t0, &r.Y) FeAdd(&r.Y, &r.Z, &r.X) FeSub(&r.Z, &r.Z, &r.X) FeSub(&r.X, &t0, &r.Y) FeSub(&r.T, &r.T, &r.Z) } func (p *ProjectiveGroupElement) ToBytes(s *[32]byte) { var recip, x, y FieldElement FeInvert(&recip, &p.Z) FeMul(&x, &p.X, &recip) FeMul(&y, &p.Y, &recip) FeToBytes(s, &y) s[31] ^= FeIsNegative(&x) << 7 } func (p *ExtendedGroupElement) Zero() { FeZero(&p.X) FeOne(&p.Y) FeOne(&p.Z) FeZero(&p.T) } func (p *ExtendedGroupElement) Double(r *CompletedGroupElement) { var q ProjectiveGroupElement p.ToProjective(&q) q.Double(r) } func (p *ExtendedGroupElement) ToCached(r *CachedGroupElement) { FeAdd(&r.yPlusX, &p.Y, &p.X) FeSub(&r.yMinusX, &p.Y, &p.X) FeCopy(&r.Z, &p.Z) FeMul(&r.T2d, &p.T, &d2) } func (p *ExtendedGroupElement) ToProjective(r *ProjectiveGroupElement) { FeCopy(&r.X, &p.X) FeCopy(&r.Y, &p.Y) FeCopy(&r.Z, &p.Z) } func (p *ExtendedGroupElement) ToBytes(s *[32]byte) { var recip, x, y FieldElement FeInvert(&recip, &p.Z) FeMul(&x, &p.X, &recip) FeMul(&y, &p.Y, &recip) FeToBytes(s, &y) s[31] ^= FeIsNegative(&x) << 7 } func (p *ExtendedGroupElement) FromBytes(s *[32]byte) bool { var u, v, v3, vxx, check FieldElement FeFromBytes(&p.Y, s) FeOne(&p.Z) FeSquare(&u, &p.Y) FeMul(&v, &u, &d) FeSub(&u, &u, &p.Z) // y = y^2-1 FeAdd(&v, &v, &p.Z) // v = dy^2+1 FeSquare(&v3, &v) FeMul(&v3, &v3, &v) // v3 = v^3 FeSquare(&p.X, &v3) FeMul(&p.X, &p.X, &v) FeMul(&p.X, &p.X, &u) // x = uv^7 fePow22523(&p.X, &p.X) // x = (uv^7)^((q-5)/8) FeMul(&p.X, &p.X, &v3) FeMul(&p.X, &p.X, &u) // x = uv^3(uv^7)^((q-5)/8) var tmpX, tmp2 [32]byte FeSquare(&vxx, &p.X) FeMul(&vxx, &vxx, &v) FeSub(&check, &vxx, &u) // vx^2-u if FeIsNonZero(&check) == 1 { FeAdd(&check, &vxx, &u) // vx^2+u if FeIsNonZero(&check) == 1 { return false } FeMul(&p.X, &p.X, &SqrtM1) FeToBytes(&tmpX, &p.X) for i, v := range tmpX { tmp2[31-i] = v } } if FeIsNegative(&p.X) != (s[31] >> 7) { FeNeg(&p.X, &p.X) } FeMul(&p.T, &p.X, &p.Y) return true } func (p *CompletedGroupElement) ToProjective(r *ProjectiveGroupElement) { FeMul(&r.X, &p.X, &p.T) FeMul(&r.Y, &p.Y, &p.Z) FeMul(&r.Z, &p.Z, &p.T) } func (p *CompletedGroupElement) ToExtended(r *ExtendedGroupElement) { FeMul(&r.X, &p.X, &p.T) FeMul(&r.Y, &p.Y, &p.Z) FeMul(&r.Z, &p.Z, &p.T) FeMul(&r.T, &p.X, &p.Y) } func (p *PreComputedGroupElement) Zero() { FeOne(&p.yPlusX) FeOne(&p.yMinusX) FeZero(&p.xy2d) } func geAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) { var t0 FieldElement FeAdd(&r.X, &p.Y, &p.X) FeSub(&r.Y, &p.Y, &p.X) FeMul(&r.Z, &r.X, &q.yPlusX) FeMul(&r.Y, &r.Y, &q.yMinusX) FeMul(&r.T, &q.T2d, &p.T) FeMul(&r.X, &p.Z, &q.Z) FeAdd(&t0, &r.X, &r.X) FeSub(&r.X, &r.Z, &r.Y) FeAdd(&r.Y, &r.Z, &r.Y) FeAdd(&r.Z, &t0, &r.T) FeSub(&r.T, &t0, &r.T) } func geSub(r *CompletedGroupElement, p *ExtendedGroupElement, q *CachedGroupElement) { var t0 FieldElement FeAdd(&r.X, &p.Y, &p.X) FeSub(&r.Y, &p.Y, &p.X) FeMul(&r.Z, &r.X, &q.yMinusX) FeMul(&r.Y, &r.Y, &q.yPlusX) FeMul(&r.T, &q.T2d, &p.T) FeMul(&r.X, &p.Z, &q.Z) FeAdd(&t0, &r.X, &r.X) FeSub(&r.X, &r.Z, &r.Y) FeAdd(&r.Y, &r.Z, &r.Y) FeSub(&r.Z, &t0, &r.T) FeAdd(&r.T, &t0, &r.T) } func geMixedAdd(r *CompletedGroupElement, p *ExtendedGroupElement, q *PreComputedGroupElement) { var t0 FieldElement FeAdd(&r.X, &p.Y, &p.X) FeSub(&r.Y, &p.Y, &p.X) FeMul(&r.Z, &r.X, &q.yPlusX) FeMul(&r.Y, &r.Y, &q.yMinusX) FeMul(&r.T, &q.xy2d, &p.T) FeAdd(&t0, &p.Z, &p.Z) FeSub(&r.X, &r.Z, &r.Y) FeAdd(&r.Y, &r.Z, &r.Y) FeAdd(&r.Z, &t0, &r.T) FeSub(&r.T, &t0, &r.T) } func geMixedSub(r *CompletedGroupElement, p *ExtendedGroupElement, q *PreComputedGroupElement) { var t0 FieldElement FeAdd(&r.X, &p.Y, &p.X) FeSub(&r.Y, &p.Y, &p.X) FeMul(&r.Z, &r.X, &q.yMinusX) FeMul(&r.Y, &r.Y, &q.yPlusX) FeMul(&r.T, &q.xy2d, &p.T) FeAdd(&t0, &p.Z, &p.Z) FeSub(&r.X, &r.Z, &r.Y) FeAdd(&r.Y, &r.Z, &r.Y) FeSub(&r.Z, &t0, &r.T) FeAdd(&r.T, &t0, &r.T) } func slide(r *[256]int8, a *[32]byte) { for i := range r { r[i] = int8(1 & (a[i>>3] >> uint(i&7))) } for i := range r { if r[i] != 0 { for b := 1; b <= 6 && i+b < 256; b++ { if r[i+b] != 0 { if r[i]+(r[i+b]<= -15 { r[i] -= r[i+b] << uint(b) for k := i + b; k < 256; k++ { if r[k] == 0 { r[k] = 1 break } r[k] = 0 } } else { break } } } } } } // GeDoubleScalarMultVartime sets r = a*A + b*B // where a = a[0]+256*a[1]+...+256^31 a[31]. // and b = b[0]+256*b[1]+...+256^31 b[31]. // B is the Ed25519 base point (x,4/5) with x positive. func GeDoubleScalarMultVartime(r *ProjectiveGroupElement, a *[32]byte, A *ExtendedGroupElement, b *[32]byte) { var aSlide, bSlide [256]int8 var Ai [8]CachedGroupElement // A,3A,5A,7A,9A,11A,13A,15A var t CompletedGroupElement var u, A2 ExtendedGroupElement var i int slide(&aSlide, a) slide(&bSlide, b) A.ToCached(&Ai[0]) A.Double(&t) t.ToExtended(&A2) for i := 0; i < 7; i++ { geAdd(&t, &A2, &Ai[i]) t.ToExtended(&u) u.ToCached(&Ai[i+1]) } r.Zero() for i = 255; i >= 0; i-- { if aSlide[i] != 0 || bSlide[i] != 0 { break } } for ; i >= 0; i-- { r.Double(&t) if aSlide[i] > 0 { t.ToExtended(&u) geAdd(&t, &u, &Ai[aSlide[i]/2]) } else if aSlide[i] < 0 { t.ToExtended(&u) geSub(&t, &u, &Ai[(-aSlide[i])/2]) } if bSlide[i] > 0 { t.ToExtended(&u) geMixedAdd(&t, &u, &bi[bSlide[i]/2]) } else if bSlide[i] < 0 { t.ToExtended(&u) geMixedSub(&t, &u, &bi[(-bSlide[i])/2]) } t.ToProjective(r) } } // equal returns 1 if b == c and 0 otherwise, assuming that b and c are // non-negative. func equal(b, c int32) int32 { x := uint32(b ^ c) x-- return int32(x >> 31) } // negative returns 1 if b < 0 and 0 otherwise. func negative(b int32) int32 { return (b >> 31) & 1 } func PreComputedGroupElementCMove(t, u *PreComputedGroupElement, b int32) { FeCMove(&t.yPlusX, &u.yPlusX, b) FeCMove(&t.yMinusX, &u.yMinusX, b) FeCMove(&t.xy2d, &u.xy2d, b) } func selectPoint(t *PreComputedGroupElement, pos int32, b int32) { var minusT PreComputedGroupElement bNegative := negative(b) bAbs := b - (((-bNegative) & b) << 1) t.Zero() for i := int32(0); i < 8; i++ { PreComputedGroupElementCMove(t, &base[pos][i], equal(bAbs, i+1)) } FeCopy(&minusT.yPlusX, &t.yMinusX) FeCopy(&minusT.yMinusX, &t.yPlusX) FeNeg(&minusT.xy2d, &t.xy2d) PreComputedGroupElementCMove(t, &minusT, bNegative) } // GeScalarMultBase computes h = a*B, where // a = a[0]+256*a[1]+...+256^31 a[31] // B is the Ed25519 base point (x,4/5) with x positive. // // Preconditions: // a[31] <= 127 func GeScalarMultBase(h *ExtendedGroupElement, a *[32]byte) { var e [64]int8 for i, v := range a { e[2*i] = int8(v & 15) e[2*i+1] = int8((v >> 4) & 15) } // each e[i] is between 0 and 15 and e[63] is between 0 and 7. carry := int8(0) for i := 0; i < 63; i++ { e[i] += carry carry = (e[i] + 8) >> 4 e[i] -= carry << 4 } e[63] += carry // each e[i] is between -8 and 8. h.Zero() var t PreComputedGroupElement var r CompletedGroupElement for i := int32(1); i < 64; i += 2 { selectPoint(&t, i/2, int32(e[i])) geMixedAdd(&r, h, &t) r.ToExtended(h) } var s ProjectiveGroupElement h.Double(&r) r.ToProjective(&s) s.Double(&r) r.ToProjective(&s) s.Double(&r) r.ToProjective(&s) s.Double(&r) r.ToExtended(h) for i := int32(0); i < 64; i += 2 { selectPoint(&t, i/2, int32(e[i])) geMixedAdd(&r, h, &t) r.ToExtended(h) } } // The scalars are GF(2^252 + 27742317777372353535851937790883648493). // Input: // a[0]+256*a[1]+...+256^31*a[31] = a // b[0]+256*b[1]+...+256^31*b[31] = b // c[0]+256*c[1]+...+256^31*c[31] = c // // Output: // s[0]+256*s[1]+...+256^31*s[31] = (ab+c) mod l // where l = 2^252 + 27742317777372353535851937790883648493. func ScMulAdd(s, a, b, c *[32]byte) { a0 := 2097151 & load3(a[:]) a1 := 2097151 & (load4(a[2:]) >> 5) a2 := 2097151 & (load3(a[5:]) >> 2) a3 := 2097151 & (load4(a[7:]) >> 7) a4 := 2097151 & (load4(a[10:]) >> 4) a5 := 2097151 & (load3(a[13:]) >> 1) a6 := 2097151 & (load4(a[15:]) >> 6) a7 := 2097151 & (load3(a[18:]) >> 3) a8 := 2097151 & load3(a[21:]) a9 := 2097151 & (load4(a[23:]) >> 5) a10 := 2097151 & (load3(a[26:]) >> 2) a11 := (load4(a[28:]) >> 7) b0 := 2097151 & load3(b[:]) b1 := 2097151 & (load4(b[2:]) >> 5) b2 := 2097151 & (load3(b[5:]) >> 2) b3 := 2097151 & (load4(b[7:]) >> 7) b4 := 2097151 & (load4(b[10:]) >> 4) b5 := 2097151 & (load3(b[13:]) >> 1) b6 := 2097151 & (load4(b[15:]) >> 6) b7 := 2097151 & (load3(b[18:]) >> 3) b8 := 2097151 & load3(b[21:]) b9 := 2097151 & (load4(b[23:]) >> 5) b10 := 2097151 & (load3(b[26:]) >> 2) b11 := (load4(b[28:]) >> 7) c0 := 2097151 & load3(c[:]) c1 := 2097151 & (load4(c[2:]) >> 5) c2 := 2097151 & (load3(c[5:]) >> 2) c3 := 2097151 & (load4(c[7:]) >> 7) c4 := 2097151 & (load4(c[10:]) >> 4) c5 := 2097151 & (load3(c[13:]) >> 1) c6 := 2097151 & (load4(c[15:]) >> 6) c7 := 2097151 & (load3(c[18:]) >> 3) c8 := 2097151 & load3(c[21:]) c9 := 2097151 & (load4(c[23:]) >> 5) c10 := 2097151 & (load3(c[26:]) >> 2) c11 := (load4(c[28:]) >> 7) var carry [23]int64 s0 := c0 + a0*b0 s1 := c1 + a0*b1 + a1*b0 s2 := c2 + a0*b2 + a1*b1 + a2*b0 s3 := c3 + a0*b3 + a1*b2 + a2*b1 + a3*b0 s4 := c4 + a0*b4 + a1*b3 + a2*b2 + a3*b1 + a4*b0 s5 := c5 + a0*b5 + a1*b4 + a2*b3 + a3*b2 + a4*b1 + a5*b0 s6 := c6 + a0*b6 + a1*b5 + a2*b4 + a3*b3 + a4*b2 + a5*b1 + a6*b0 s7 := c7 + a0*b7 + a1*b6 + a2*b5 + a3*b4 + a4*b3 + a5*b2 + a6*b1 + a7*b0 s8 := c8 + a0*b8 + a1*b7 + a2*b6 + a3*b5 + a4*b4 + a5*b3 + a6*b2 + a7*b1 + a8*b0 s9 := c9 + a0*b9 + a1*b8 + a2*b7 + a3*b6 + a4*b5 + a5*b4 + a6*b3 + a7*b2 + a8*b1 + a9*b0 s10 := c10 + a0*b10 + a1*b9 + a2*b8 + a3*b7 + a4*b6 + a5*b5 + a6*b4 + a7*b3 + a8*b2 + a9*b1 + a10*b0 s11 := c11 + a0*b11 + a1*b10 + a2*b9 + a3*b8 + a4*b7 + a5*b6 + a6*b5 + a7*b4 + a8*b3 + a9*b2 + a10*b1 + a11*b0 s12 := a1*b11 + a2*b10 + a3*b9 + a4*b8 + a5*b7 + a6*b6 + a7*b5 + a8*b4 + a9*b3 + a10*b2 + a11*b1 s13 := a2*b11 + a3*b10 + a4*b9 + a5*b8 + a6*b7 + a7*b6 + a8*b5 + a9*b4 + a10*b3 + a11*b2 s14 := a3*b11 + a4*b10 + a5*b9 + a6*b8 + a7*b7 + a8*b6 + a9*b5 + a10*b4 + a11*b3 s15 := a4*b11 + a5*b10 + a6*b9 + a7*b8 + a8*b7 + a9*b6 + a10*b5 + a11*b4 s16 := a5*b11 + a6*b10 + a7*b9 + a8*b8 + a9*b7 + a10*b6 + a11*b5 s17 := a6*b11 + a7*b10 + a8*b9 + a9*b8 + a10*b7 + a11*b6 s18 := a7*b11 + a8*b10 + a9*b9 + a10*b8 + a11*b7 s19 := a8*b11 + a9*b10 + a10*b9 + a11*b8 s20 := a9*b11 + a10*b10 + a11*b9 s21 := a10*b11 + a11*b10 s22 := a11 * b11 s23 := int64(0) carry[0] = (s0 + (1 << 20)) >> 21 s1 += carry[0] s0 -= carry[0] << 21 carry[2] = (s2 + (1 << 20)) >> 21 s3 += carry[2] s2 -= carry[2] << 21 carry[4] = (s4 + (1 << 20)) >> 21 s5 += carry[4] s4 -= carry[4] << 21 carry[6] = (s6 + (1 << 20)) >> 21 s7 += carry[6] s6 -= carry[6] << 21 carry[8] = (s8 + (1 << 20)) >> 21 s9 += carry[8] s8 -= carry[8] << 21 carry[10] = (s10 + (1 << 20)) >> 21 s11 += carry[10] s10 -= carry[10] << 21 carry[12] = (s12 + (1 << 20)) >> 21 s13 += carry[12] s12 -= carry[12] << 21 carry[14] = (s14 + (1 << 20)) >> 21 s15 += carry[14] s14 -= carry[14] << 21 carry[16] = (s16 + (1 << 20)) >> 21 s17 += carry[16] s16 -= carry[16] << 21 carry[18] = (s18 + (1 << 20)) >> 21 s19 += carry[18] s18 -= carry[18] << 21 carry[20] = (s20 + (1 << 20)) >> 21 s21 += carry[20] s20 -= carry[20] << 21 carry[22] = (s22 + (1 << 20)) >> 21 s23 += carry[22] s22 -= carry[22] << 21 carry[1] = (s1 + (1 << 20)) >> 21 s2 += carry[1] s1 -= carry[1] << 21 carry[3] = (s3 + (1 << 20)) >> 21 s4 += carry[3] s3 -= carry[3] << 21 carry[5] = (s5 + (1 << 20)) >> 21 s6 += carry[5] s5 -= carry[5] << 21 carry[7] = (s7 + (1 << 20)) >> 21 s8 += carry[7] s7 -= carry[7] << 21 carry[9] = (s9 + (1 << 20)) >> 21 s10 += carry[9] s9 -= carry[9] << 21 carry[11] = (s11 + (1 << 20)) >> 21 s12 += carry[11] s11 -= carry[11] << 21 carry[13] = (s13 + (1 << 20)) >> 21 s14 += carry[13] s13 -= carry[13] << 21 carry[15] = (s15 + (1 << 20)) >> 21 s16 += carry[15] s15 -= carry[15] << 21 carry[17] = (s17 + (1 << 20)) >> 21 s18 += carry[17] s17 -= carry[17] << 21 carry[19] = (s19 + (1 << 20)) >> 21 s20 += carry[19] s19 -= carry[19] << 21 carry[21] = (s21 + (1 << 20)) >> 21 s22 += carry[21] s21 -= carry[21] << 21 s11 += s23 * 666643 s12 += s23 * 470296 s13 += s23 * 654183 s14 -= s23 * 997805 s15 += s23 * 136657 s16 -= s23 * 683901 s23 = 0 s10 += s22 * 666643 s11 += s22 * 470296 s12 += s22 * 654183 s13 -= s22 * 997805 s14 += s22 * 136657 s15 -= s22 * 683901 s22 = 0 s9 += s21 * 666643 s10 += s21 * 470296 s11 += s21 * 654183 s12 -= s21 * 997805 s13 += s21 * 136657 s14 -= s21 * 683901 s21 = 0 s8 += s20 * 666643 s9 += s20 * 470296 s10 += s20 * 654183 s11 -= s20 * 997805 s12 += s20 * 136657 s13 -= s20 * 683901 s20 = 0 s7 += s19 * 666643 s8 += s19 * 470296 s9 += s19 * 654183 s10 -= s19 * 997805 s11 += s19 * 136657 s12 -= s19 * 683901 s19 = 0 s6 += s18 * 666643 s7 += s18 * 470296 s8 += s18 * 654183 s9 -= s18 * 997805 s10 += s18 * 136657 s11 -= s18 * 683901 s18 = 0 carry[6] = (s6 + (1 << 20)) >> 21 s7 += carry[6] s6 -= carry[6] << 21 carry[8] = (s8 + (1 << 20)) >> 21 s9 += carry[8] s8 -= carry[8] << 21 carry[10] = (s10 + (1 << 20)) >> 21 s11 += carry[10] s10 -= carry[10] << 21 carry[12] = (s12 + (1 << 20)) >> 21 s13 += carry[12] s12 -= carry[12] << 21 carry[14] = (s14 + (1 << 20)) >> 21 s15 += carry[14] s14 -= carry[14] << 21 carry[16] = (s16 + (1 << 20)) >> 21 s17 += carry[16] s16 -= carry[16] << 21 carry[7] = (s7 + (1 << 20)) >> 21 s8 += carry[7] s7 -= carry[7] << 21 carry[9] = (s9 + (1 << 20)) >> 21 s10 += carry[9] s9 -= carry[9] << 21 carry[11] = (s11 + (1 << 20)) >> 21 s12 += carry[11] s11 -= carry[11] << 21 carry[13] = (s13 + (1 << 20)) >> 21 s14 += carry[13] s13 -= carry[13] << 21 carry[15] = (s15 + (1 << 20)) >> 21 s16 += carry[15] s15 -= carry[15] << 21 s5 += s17 * 666643 s6 += s17 * 470296 s7 += s17 * 654183 s8 -= s17 * 997805 s9 += s17 * 136657 s10 -= s17 * 683901 s17 = 0 s4 += s16 * 666643 s5 += s16 * 470296 s6 += s16 * 654183 s7 -= s16 * 997805 s8 += s16 * 136657 s9 -= s16 * 683901 s16 = 0 s3 += s15 * 666643 s4 += s15 * 470296 s5 += s15 * 654183 s6 -= s15 * 997805 s7 += s15 * 136657 s8 -= s15 * 683901 s15 = 0 s2 += s14 * 666643 s3 += s14 * 470296 s4 += s14 * 654183 s5 -= s14 * 997805 s6 += s14 * 136657 s7 -= s14 * 683901 s14 = 0 s1 += s13 * 666643 s2 += s13 * 470296 s3 += s13 * 654183 s4 -= s13 * 997805 s5 += s13 * 136657 s6 -= s13 * 683901 s13 = 0 s0 += s12 * 666643 s1 += s12 * 470296 s2 += s12 * 654183 s3 -= s12 * 997805 s4 += s12 * 136657 s5 -= s12 * 683901 s12 = 0 carry[0] = (s0 + (1 << 20)) >> 21 s1 += carry[0] s0 -= carry[0] << 21 carry[2] = (s2 + (1 << 20)) >> 21 s3 += carry[2] s2 -= carry[2] << 21 carry[4] = (s4 + (1 << 20)) >> 21 s5 += carry[4] s4 -= carry[4] << 21 carry[6] = (s6 + (1 << 20)) >> 21 s7 += carry[6] s6 -= carry[6] << 21 carry[8] = (s8 + (1 << 20)) >> 21 s9 += carry[8] s8 -= carry[8] << 21 carry[10] = (s10 + (1 << 20)) >> 21 s11 += carry[10] s10 -= carry[10] << 21 carry[1] = (s1 + (1 << 20)) >> 21 s2 += carry[1] s1 -= carry[1] << 21 carry[3] = (s3 + (1 << 20)) >> 21 s4 += carry[3] s3 -= carry[3] << 21 carry[5] = (s5 + (1 << 20)) >> 21 s6 += carry[5] s5 -= carry[5] << 21 carry[7] = (s7 + (1 << 20)) >> 21 s8 += carry[7] s7 -= carry[7] << 21 carry[9] = (s9 + (1 << 20)) >> 21 s10 += carry[9] s9 -= carry[9] << 21 carry[11] = (s11 + (1 << 20)) >> 21 s12 += carry[11] s11 -= carry[11] << 21 s0 += s12 * 666643 s1 += s12 * 470296 s2 += s12 * 654183 s3 -= s12 * 997805 s4 += s12 * 136657 s5 -= s12 * 683901 s12 = 0 carry[0] = s0 >> 21 s1 += carry[0] s0 -= carry[0] << 21 carry[1] = s1 >> 21 s2 += carry[1] s1 -= carry[1] << 21 carry[2] = s2 >> 21 s3 += carry[2] s2 -= carry[2] << 21 carry[3] = s3 >> 21 s4 += carry[3] s3 -= carry[3] << 21 carry[4] = s4 >> 21 s5 += carry[4] s4 -= carry[4] << 21 carry[5] = s5 >> 21 s6 += carry[5] s5 -= carry[5] << 21 carry[6] = s6 >> 21 s7 += carry[6] s6 -= carry[6] << 21 carry[7] = s7 >> 21 s8 += carry[7] s7 -= carry[7] << 21 carry[8] = s8 >> 21 s9 += carry[8] s8 -= carry[8] << 21 carry[9] = s9 >> 21 s10 += carry[9] s9 -= carry[9] << 21 carry[10] = s10 >> 21 s11 += carry[10] s10 -= carry[10] << 21 carry[11] = s11 >> 21 s12 += carry[11] s11 -= carry[11] << 21 s0 += s12 * 666643 s1 += s12 * 470296 s2 += s12 * 654183 s3 -= s12 * 997805 s4 += s12 * 136657 s5 -= s12 * 683901 s12 = 0 carry[0] = s0 >> 21 s1 += carry[0] s0 -= carry[0] << 21 carry[1] = s1 >> 21 s2 += carry[1] s1 -= carry[1] << 21 carry[2] = s2 >> 21 s3 += carry[2] s2 -= carry[2] << 21 carry[3] = s3 >> 21 s4 += carry[3] s3 -= carry[3] << 21 carry[4] = s4 >> 21 s5 += carry[4] s4 -= carry[4] << 21 carry[5] = s5 >> 21 s6 += carry[5] s5 -= carry[5] << 21 carry[6] = s6 >> 21 s7 += carry[6] s6 -= carry[6] << 21 carry[7] = s7 >> 21 s8 += carry[7] s7 -= carry[7] << 21 carry[8] = s8 >> 21 s9 += carry[8] s8 -= carry[8] << 21 carry[9] = s9 >> 21 s10 += carry[9] s9 -= carry[9] << 21 carry[10] = s10 >> 21 s11 += carry[10] s10 -= carry[10] << 21 s[0] = byte(s0 >> 0) s[1] = byte(s0 >> 8) s[2] = byte((s0 >> 16) | (s1 << 5)) s[3] = byte(s1 >> 3) s[4] = byte(s1 >> 11) s[5] = byte((s1 >> 19) | (s2 << 2)) s[6] = byte(s2 >> 6) s[7] = byte((s2 >> 14) | (s3 << 7)) s[8] = byte(s3 >> 1) s[9] = byte(s3 >> 9) s[10] = byte((s3 >> 17) | (s4 << 4)) s[11] = byte(s4 >> 4) s[12] = byte(s4 >> 12) s[13] = byte((s4 >> 20) | (s5 << 1)) s[14] = byte(s5 >> 7) s[15] = byte((s5 >> 15) | (s6 << 6)) s[16] = byte(s6 >> 2) s[17] = byte(s6 >> 10) s[18] = byte((s6 >> 18) | (s7 << 3)) s[19] = byte(s7 >> 5) s[20] = byte(s7 >> 13) s[21] = byte(s8 >> 0) s[22] = byte(s8 >> 8) s[23] = byte((s8 >> 16) | (s9 << 5)) s[24] = byte(s9 >> 3) s[25] = byte(s9 >> 11) s[26] = byte((s9 >> 19) | (s10 << 2)) s[27] = byte(s10 >> 6) s[28] = byte((s10 >> 14) | (s11 << 7)) s[29] = byte(s11 >> 1) s[30] = byte(s11 >> 9) s[31] = byte(s11 >> 17) } // Input: // s[0]+256*s[1]+...+256^63*s[63] = s // // Output: // s[0]+256*s[1]+...+256^31*s[31] = s mod l // where l = 2^252 + 27742317777372353535851937790883648493. func ScReduce(out *[32]byte, s *[64]byte) { s0 := 2097151 & load3(s[:]) s1 := 2097151 & (load4(s[2:]) >> 5) s2 := 2097151 & (load3(s[5:]) >> 2) s3 := 2097151 & (load4(s[7:]) >> 7) s4 := 2097151 & (load4(s[10:]) >> 4) s5 := 2097151 & (load3(s[13:]) >> 1) s6 := 2097151 & (load4(s[15:]) >> 6) s7 := 2097151 & (load3(s[18:]) >> 3) s8 := 2097151 & load3(s[21:]) s9 := 2097151 & (load4(s[23:]) >> 5) s10 := 2097151 & (load3(s[26:]) >> 2) s11 := 2097151 & (load4(s[28:]) >> 7) s12 := 2097151 & (load4(s[31:]) >> 4) s13 := 2097151 & (load3(s[34:]) >> 1) s14 := 2097151 & (load4(s[36:]) >> 6) s15 := 2097151 & (load3(s[39:]) >> 3) s16 := 2097151 & load3(s[42:]) s17 := 2097151 & (load4(s[44:]) >> 5) s18 := 2097151 & (load3(s[47:]) >> 2) s19 := 2097151 & (load4(s[49:]) >> 7) s20 := 2097151 & (load4(s[52:]) >> 4) s21 := 2097151 & (load3(s[55:]) >> 1) s22 := 2097151 & (load4(s[57:]) >> 6) s23 := (load4(s[60:]) >> 3) s11 += s23 * 666643 s12 += s23 * 470296 s13 += s23 * 654183 s14 -= s23 * 997805 s15 += s23 * 136657 s16 -= s23 * 683901 s23 = 0 s10 += s22 * 666643 s11 += s22 * 470296 s12 += s22 * 654183 s13 -= s22 * 997805 s14 += s22 * 136657 s15 -= s22 * 683901 s22 = 0 s9 += s21 * 666643 s10 += s21 * 470296 s11 += s21 * 654183 s12 -= s21 * 997805 s13 += s21 * 136657 s14 -= s21 * 683901 s21 = 0 s8 += s20 * 666643 s9 += s20 * 470296 s10 += s20 * 654183 s11 -= s20 * 997805 s12 += s20 * 136657 s13 -= s20 * 683901 s20 = 0 s7 += s19 * 666643 s8 += s19 * 470296 s9 += s19 * 654183 s10 -= s19 * 997805 s11 += s19 * 136657 s12 -= s19 * 683901 s19 = 0 s6 += s18 * 666643 s7 += s18 * 470296 s8 += s18 * 654183 s9 -= s18 * 997805 s10 += s18 * 136657 s11 -= s18 * 683901 s18 = 0 var carry [17]int64 carry[6] = (s6 + (1 << 20)) >> 21 s7 += carry[6] s6 -= carry[6] << 21 carry[8] = (s8 + (1 << 20)) >> 21 s9 += carry[8] s8 -= carry[8] << 21 carry[10] = (s10 + (1 << 20)) >> 21 s11 += carry[10] s10 -= carry[10] << 21 carry[12] = (s12 + (1 << 20)) >> 21 s13 += carry[12] s12 -= carry[12] << 21 carry[14] = (s14 + (1 << 20)) >> 21 s15 += carry[14] s14 -= carry[14] << 21 carry[16] = (s16 + (1 << 20)) >> 21 s17 += carry[16] s16 -= carry[16] << 21 carry[7] = (s7 + (1 << 20)) >> 21 s8 += carry[7] s7 -= carry[7] << 21 carry[9] = (s9 + (1 << 20)) >> 21 s10 += carry[9] s9 -= carry[9] << 21 carry[11] = (s11 + (1 << 20)) >> 21 s12 += carry[11] s11 -= carry[11] << 21 carry[13] = (s13 + (1 << 20)) >> 21 s14 += carry[13] s13 -= carry[13] << 21 carry[15] = (s15 + (1 << 20)) >> 21 s16 += carry[15] s15 -= carry[15] << 21 s5 += s17 * 666643 s6 += s17 * 470296 s7 += s17 * 654183 s8 -= s17 * 997805 s9 += s17 * 136657 s10 -= s17 * 683901 s17 = 0 s4 += s16 * 666643 s5 += s16 * 470296 s6 += s16 * 654183 s7 -= s16 * 997805 s8 += s16 * 136657 s9 -= s16 * 683901 s16 = 0 s3 += s15 * 666643 s4 += s15 * 470296 s5 += s15 * 654183 s6 -= s15 * 997805 s7 += s15 * 136657 s8 -= s15 * 683901 s15 = 0 s2 += s14 * 666643 s3 += s14 * 470296 s4 += s14 * 654183 s5 -= s14 * 997805 s6 += s14 * 136657 s7 -= s14 * 683901 s14 = 0 s1 += s13 * 666643 s2 += s13 * 470296 s3 += s13 * 654183 s4 -= s13 * 997805 s5 += s13 * 136657 s6 -= s13 * 683901 s13 = 0 s0 += s12 * 666643 s1 += s12 * 470296 s2 += s12 * 654183 s3 -= s12 * 997805 s4 += s12 * 136657 s5 -= s12 * 683901 s12 = 0 carry[0] = (s0 + (1 << 20)) >> 21 s1 += carry[0] s0 -= carry[0] << 21 carry[2] = (s2 + (1 << 20)) >> 21 s3 += carry[2] s2 -= carry[2] << 21 carry[4] = (s4 + (1 << 20)) >> 21 s5 += carry[4] s4 -= carry[4] << 21 carry[6] = (s6 + (1 << 20)) >> 21 s7 += carry[6] s6 -= carry[6] << 21 carry[8] = (s8 + (1 << 20)) >> 21 s9 += carry[8] s8 -= carry[8] << 21 carry[10] = (s10 + (1 << 20)) >> 21 s11 += carry[10] s10 -= carry[10] << 21 carry[1] = (s1 + (1 << 20)) >> 21 s2 += carry[1] s1 -= carry[1] << 21 carry[3] = (s3 + (1 << 20)) >> 21 s4 += carry[3] s3 -= carry[3] << 21 carry[5] = (s5 + (1 << 20)) >> 21 s6 += carry[5] s5 -= carry[5] << 21 carry[7] = (s7 + (1 << 20)) >> 21 s8 += carry[7] s7 -= carry[7] << 21 carry[9] = (s9 + (1 << 20)) >> 21 s10 += carry[9] s9 -= carry[9] << 21 carry[11] = (s11 + (1 << 20)) >> 21 s12 += carry[11] s11 -= carry[11] << 21 s0 += s12 * 666643 s1 += s12 * 470296 s2 += s12 * 654183 s3 -= s12 * 997805 s4 += s12 * 136657 s5 -= s12 * 683901 s12 = 0 carry[0] = s0 >> 21 s1 += carry[0] s0 -= carry[0] << 21 carry[1] = s1 >> 21 s2 += carry[1] s1 -= carry[1] << 21 carry[2] = s2 >> 21 s3 += carry[2] s2 -= carry[2] << 21 carry[3] = s3 >> 21 s4 += carry[3] s3 -= carry[3] << 21 carry[4] = s4 >> 21 s5 += carry[4] s4 -= carry[4] << 21 carry[5] = s5 >> 21 s6 += carry[5] s5 -= carry[5] << 21 carry[6] = s6 >> 21 s7 += carry[6] s6 -= carry[6] << 21 carry[7] = s7 >> 21 s8 += carry[7] s7 -= carry[7] << 21 carry[8] = s8 >> 21 s9 += carry[8] s8 -= carry[8] << 21 carry[9] = s9 >> 21 s10 += carry[9] s9 -= carry[9] << 21 carry[10] = s10 >> 21 s11 += carry[10] s10 -= carry[10] << 21 carry[11] = s11 >> 21 s12 += carry[11] s11 -= carry[11] << 21 s0 += s12 * 666643 s1 += s12 * 470296 s2 += s12 * 654183 s3 -= s12 * 997805 s4 += s12 * 136657 s5 -= s12 * 683901 s12 = 0 carry[0] = s0 >> 21 s1 += carry[0] s0 -= carry[0] << 21 carry[1] = s1 >> 21 s2 += carry[1] s1 -= carry[1] << 21 carry[2] = s2 >> 21 s3 += carry[2] s2 -= carry[2] << 21 carry[3] = s3 >> 21 s4 += carry[3] s3 -= carry[3] << 21 carry[4] = s4 >> 21 s5 += carry[4] s4 -= carry[4] << 21 carry[5] = s5 >> 21 s6 += carry[5] s5 -= carry[5] << 21 carry[6] = s6 >> 21 s7 += carry[6] s6 -= carry[6] << 21 carry[7] = s7 >> 21 s8 += carry[7] s7 -= carry[7] << 21 carry[8] = s8 >> 21 s9 += carry[8] s8 -= carry[8] << 21 carry[9] = s9 >> 21 s10 += carry[9] s9 -= carry[9] << 21 carry[10] = s10 >> 21 s11 += carry[10] s10 -= carry[10] << 21 out[0] = byte(s0 >> 0) out[1] = byte(s0 >> 8) out[2] = byte((s0 >> 16) | (s1 << 5)) out[3] = byte(s1 >> 3) out[4] = byte(s1 >> 11) out[5] = byte((s1 >> 19) | (s2 << 2)) out[6] = byte(s2 >> 6) out[7] = byte((s2 >> 14) | (s3 << 7)) out[8] = byte(s3 >> 1) out[9] = byte(s3 >> 9) out[10] = byte((s3 >> 17) | (s4 << 4)) out[11] = byte(s4 >> 4) out[12] = byte(s4 >> 12) out[13] = byte((s4 >> 20) | (s5 << 1)) out[14] = byte(s5 >> 7) out[15] = byte((s5 >> 15) | (s6 << 6)) out[16] = byte(s6 >> 2) out[17] = byte(s6 >> 10) out[18] = byte((s6 >> 18) | (s7 << 3)) out[19] = byte(s7 >> 5) out[20] = byte(s7 >> 13) out[21] = byte(s8 >> 0) out[22] = byte(s8 >> 8) out[23] = byte((s8 >> 16) | (s9 << 5)) out[24] = byte(s9 >> 3) out[25] = byte(s9 >> 11) out[26] = byte((s9 >> 19) | (s10 << 2)) out[27] = byte(s10 >> 6) out[28] = byte((s10 >> 14) | (s11 << 7)) out[29] = byte(s11 >> 1) out[30] = byte(s11 >> 9) out[31] = byte(s11 >> 17) } // order is the order of Curve25519 in little-endian form. var order = [4]uint64{0x5812631a5cf5d3ed, 0x14def9dea2f79cd6, 0, 0x1000000000000000} // ScMinimal returns true if the given scalar is less than the order of the // curve. func ScMinimal(scalar *[32]byte) bool { for i := 3; ; i-- { v := binary.LittleEndian.Uint64(scalar[i*8:]) if v > order[i] { return false } else if v < order[i] { break } else if i == 0 { return false } } return true } ================================================ FILE: vendor/golang.org/x/crypto/internal/chacha20/asm_arm64.s ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build go1.11 // +build !gccgo,!appengine #include "textflag.h" #define NUM_ROUNDS 10 // func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) TEXT ·xorKeyStreamVX(SB), NOSPLIT, $0 MOVD dst+0(FP), R1 MOVD src+24(FP), R2 MOVD src_len+32(FP), R3 MOVD key+48(FP), R4 MOVD nonce+56(FP), R6 MOVD counter+64(FP), R7 MOVD $·constants(SB), R10 MOVD $·incRotMatrix(SB), R11 MOVW (R7), R20 AND $~255, R3, R13 ADD R2, R13, R12 // R12 for block end AND $255, R3, R13 loop: MOVD $NUM_ROUNDS, R21 VLD1 (R11), [V30.S4, V31.S4] // load contants // VLD4R (R10), [V0.S4, V1.S4, V2.S4, V3.S4] WORD $0x4D60E940 // load keys // VLD4R 16(R4), [V4.S4, V5.S4, V6.S4, V7.S4] WORD $0x4DFFE884 // VLD4R 16(R4), [V8.S4, V9.S4, V10.S4, V11.S4] WORD $0x4DFFE888 SUB $32, R4 // load counter + nonce // VLD1R (R7), [V12.S4] WORD $0x4D40C8EC // VLD3R (R6), [V13.S4, V14.S4, V15.S4] WORD $0x4D40E8CD // update counter VADD V30.S4, V12.S4, V12.S4 chacha: // V0..V3 += V4..V7 // V12..V15 <<<= ((V12..V15 XOR V0..V3), 16) VADD V0.S4, V4.S4, V0.S4 VADD V1.S4, V5.S4, V1.S4 VADD V2.S4, V6.S4, V2.S4 VADD V3.S4, V7.S4, V3.S4 VEOR V12.B16, V0.B16, V12.B16 VEOR V13.B16, V1.B16, V13.B16 VEOR V14.B16, V2.B16, V14.B16 VEOR V15.B16, V3.B16, V15.B16 VREV32 V12.H8, V12.H8 VREV32 V13.H8, V13.H8 VREV32 V14.H8, V14.H8 VREV32 V15.H8, V15.H8 // V8..V11 += V12..V15 // V4..V7 <<<= ((V4..V7 XOR V8..V11), 12) VADD V8.S4, V12.S4, V8.S4 VADD V9.S4, V13.S4, V9.S4 VADD V10.S4, V14.S4, V10.S4 VADD V11.S4, V15.S4, V11.S4 VEOR V8.B16, V4.B16, V16.B16 VEOR V9.B16, V5.B16, V17.B16 VEOR V10.B16, V6.B16, V18.B16 VEOR V11.B16, V7.B16, V19.B16 VSHL $12, V16.S4, V4.S4 VSHL $12, V17.S4, V5.S4 VSHL $12, V18.S4, V6.S4 VSHL $12, V19.S4, V7.S4 VSRI $20, V16.S4, V4.S4 VSRI $20, V17.S4, V5.S4 VSRI $20, V18.S4, V6.S4 VSRI $20, V19.S4, V7.S4 // V0..V3 += V4..V7 // V12..V15 <<<= ((V12..V15 XOR V0..V3), 8) VADD V0.S4, V4.S4, V0.S4 VADD V1.S4, V5.S4, V1.S4 VADD V2.S4, V6.S4, V2.S4 VADD V3.S4, V7.S4, V3.S4 VEOR V12.B16, V0.B16, V12.B16 VEOR V13.B16, V1.B16, V13.B16 VEOR V14.B16, V2.B16, V14.B16 VEOR V15.B16, V3.B16, V15.B16 VTBL V31.B16, [V12.B16], V12.B16 VTBL V31.B16, [V13.B16], V13.B16 VTBL V31.B16, [V14.B16], V14.B16 VTBL V31.B16, [V15.B16], V15.B16 // V8..V11 += V12..V15 // V4..V7 <<<= ((V4..V7 XOR V8..V11), 7) VADD V12.S4, V8.S4, V8.S4 VADD V13.S4, V9.S4, V9.S4 VADD V14.S4, V10.S4, V10.S4 VADD V15.S4, V11.S4, V11.S4 VEOR V8.B16, V4.B16, V16.B16 VEOR V9.B16, V5.B16, V17.B16 VEOR V10.B16, V6.B16, V18.B16 VEOR V11.B16, V7.B16, V19.B16 VSHL $7, V16.S4, V4.S4 VSHL $7, V17.S4, V5.S4 VSHL $7, V18.S4, V6.S4 VSHL $7, V19.S4, V7.S4 VSRI $25, V16.S4, V4.S4 VSRI $25, V17.S4, V5.S4 VSRI $25, V18.S4, V6.S4 VSRI $25, V19.S4, V7.S4 // V0..V3 += V5..V7, V4 // V15,V12-V14 <<<= ((V15,V12-V14 XOR V0..V3), 16) VADD V0.S4, V5.S4, V0.S4 VADD V1.S4, V6.S4, V1.S4 VADD V2.S4, V7.S4, V2.S4 VADD V3.S4, V4.S4, V3.S4 VEOR V15.B16, V0.B16, V15.B16 VEOR V12.B16, V1.B16, V12.B16 VEOR V13.B16, V2.B16, V13.B16 VEOR V14.B16, V3.B16, V14.B16 VREV32 V12.H8, V12.H8 VREV32 V13.H8, V13.H8 VREV32 V14.H8, V14.H8 VREV32 V15.H8, V15.H8 // V10 += V15; V5 <<<= ((V10 XOR V5), 12) // ... VADD V15.S4, V10.S4, V10.S4 VADD V12.S4, V11.S4, V11.S4 VADD V13.S4, V8.S4, V8.S4 VADD V14.S4, V9.S4, V9.S4 VEOR V10.B16, V5.B16, V16.B16 VEOR V11.B16, V6.B16, V17.B16 VEOR V8.B16, V7.B16, V18.B16 VEOR V9.B16, V4.B16, V19.B16 VSHL $12, V16.S4, V5.S4 VSHL $12, V17.S4, V6.S4 VSHL $12, V18.S4, V7.S4 VSHL $12, V19.S4, V4.S4 VSRI $20, V16.S4, V5.S4 VSRI $20, V17.S4, V6.S4 VSRI $20, V18.S4, V7.S4 VSRI $20, V19.S4, V4.S4 // V0 += V5; V15 <<<= ((V0 XOR V15), 8) // ... VADD V5.S4, V0.S4, V0.S4 VADD V6.S4, V1.S4, V1.S4 VADD V7.S4, V2.S4, V2.S4 VADD V4.S4, V3.S4, V3.S4 VEOR V0.B16, V15.B16, V15.B16 VEOR V1.B16, V12.B16, V12.B16 VEOR V2.B16, V13.B16, V13.B16 VEOR V3.B16, V14.B16, V14.B16 VTBL V31.B16, [V12.B16], V12.B16 VTBL V31.B16, [V13.B16], V13.B16 VTBL V31.B16, [V14.B16], V14.B16 VTBL V31.B16, [V15.B16], V15.B16 // V10 += V15; V5 <<<= ((V10 XOR V5), 7) // ... VADD V15.S4, V10.S4, V10.S4 VADD V12.S4, V11.S4, V11.S4 VADD V13.S4, V8.S4, V8.S4 VADD V14.S4, V9.S4, V9.S4 VEOR V10.B16, V5.B16, V16.B16 VEOR V11.B16, V6.B16, V17.B16 VEOR V8.B16, V7.B16, V18.B16 VEOR V9.B16, V4.B16, V19.B16 VSHL $7, V16.S4, V5.S4 VSHL $7, V17.S4, V6.S4 VSHL $7, V18.S4, V7.S4 VSHL $7, V19.S4, V4.S4 VSRI $25, V16.S4, V5.S4 VSRI $25, V17.S4, V6.S4 VSRI $25, V18.S4, V7.S4 VSRI $25, V19.S4, V4.S4 SUB $1, R21 CBNZ R21, chacha // VLD4R (R10), [V16.S4, V17.S4, V18.S4, V19.S4] WORD $0x4D60E950 // VLD4R 16(R4), [V20.S4, V21.S4, V22.S4, V23.S4] WORD $0x4DFFE894 VADD V30.S4, V12.S4, V12.S4 VADD V16.S4, V0.S4, V0.S4 VADD V17.S4, V1.S4, V1.S4 VADD V18.S4, V2.S4, V2.S4 VADD V19.S4, V3.S4, V3.S4 // VLD4R 16(R4), [V24.S4, V25.S4, V26.S4, V27.S4] WORD $0x4DFFE898 // restore R4 SUB $32, R4 // load counter + nonce // VLD1R (R7), [V28.S4] WORD $0x4D40C8FC // VLD3R (R6), [V29.S4, V30.S4, V31.S4] WORD $0x4D40E8DD VADD V20.S4, V4.S4, V4.S4 VADD V21.S4, V5.S4, V5.S4 VADD V22.S4, V6.S4, V6.S4 VADD V23.S4, V7.S4, V7.S4 VADD V24.S4, V8.S4, V8.S4 VADD V25.S4, V9.S4, V9.S4 VADD V26.S4, V10.S4, V10.S4 VADD V27.S4, V11.S4, V11.S4 VADD V28.S4, V12.S4, V12.S4 VADD V29.S4, V13.S4, V13.S4 VADD V30.S4, V14.S4, V14.S4 VADD V31.S4, V15.S4, V15.S4 VZIP1 V1.S4, V0.S4, V16.S4 VZIP2 V1.S4, V0.S4, V17.S4 VZIP1 V3.S4, V2.S4, V18.S4 VZIP2 V3.S4, V2.S4, V19.S4 VZIP1 V5.S4, V4.S4, V20.S4 VZIP2 V5.S4, V4.S4, V21.S4 VZIP1 V7.S4, V6.S4, V22.S4 VZIP2 V7.S4, V6.S4, V23.S4 VZIP1 V9.S4, V8.S4, V24.S4 VZIP2 V9.S4, V8.S4, V25.S4 VZIP1 V11.S4, V10.S4, V26.S4 VZIP2 V11.S4, V10.S4, V27.S4 VZIP1 V13.S4, V12.S4, V28.S4 VZIP2 V13.S4, V12.S4, V29.S4 VZIP1 V15.S4, V14.S4, V30.S4 VZIP2 V15.S4, V14.S4, V31.S4 VZIP1 V18.D2, V16.D2, V0.D2 VZIP2 V18.D2, V16.D2, V4.D2 VZIP1 V19.D2, V17.D2, V8.D2 VZIP2 V19.D2, V17.D2, V12.D2 VLD1.P 64(R2), [V16.B16, V17.B16, V18.B16, V19.B16] VZIP1 V22.D2, V20.D2, V1.D2 VZIP2 V22.D2, V20.D2, V5.D2 VZIP1 V23.D2, V21.D2, V9.D2 VZIP2 V23.D2, V21.D2, V13.D2 VLD1.P 64(R2), [V20.B16, V21.B16, V22.B16, V23.B16] VZIP1 V26.D2, V24.D2, V2.D2 VZIP2 V26.D2, V24.D2, V6.D2 VZIP1 V27.D2, V25.D2, V10.D2 VZIP2 V27.D2, V25.D2, V14.D2 VLD1.P 64(R2), [V24.B16, V25.B16, V26.B16, V27.B16] VZIP1 V30.D2, V28.D2, V3.D2 VZIP2 V30.D2, V28.D2, V7.D2 VZIP1 V31.D2, V29.D2, V11.D2 VZIP2 V31.D2, V29.D2, V15.D2 VLD1.P 64(R2), [V28.B16, V29.B16, V30.B16, V31.B16] VEOR V0.B16, V16.B16, V16.B16 VEOR V1.B16, V17.B16, V17.B16 VEOR V2.B16, V18.B16, V18.B16 VEOR V3.B16, V19.B16, V19.B16 VST1.P [V16.B16, V17.B16, V18.B16, V19.B16], 64(R1) VEOR V4.B16, V20.B16, V20.B16 VEOR V5.B16, V21.B16, V21.B16 VEOR V6.B16, V22.B16, V22.B16 VEOR V7.B16, V23.B16, V23.B16 VST1.P [V20.B16, V21.B16, V22.B16, V23.B16], 64(R1) VEOR V8.B16, V24.B16, V24.B16 VEOR V9.B16, V25.B16, V25.B16 VEOR V10.B16, V26.B16, V26.B16 VEOR V11.B16, V27.B16, V27.B16 VST1.P [V24.B16, V25.B16, V26.B16, V27.B16], 64(R1) VEOR V12.B16, V28.B16, V28.B16 VEOR V13.B16, V29.B16, V29.B16 VEOR V14.B16, V30.B16, V30.B16 VEOR V15.B16, V31.B16, V31.B16 VST1.P [V28.B16, V29.B16, V30.B16, V31.B16], 64(R1) ADD $4, R20 MOVW R20, (R7) // update counter CMP R2, R12 BGT loop RET DATA ·constants+0x00(SB)/4, $0x61707865 DATA ·constants+0x04(SB)/4, $0x3320646e DATA ·constants+0x08(SB)/4, $0x79622d32 DATA ·constants+0x0c(SB)/4, $0x6b206574 GLOBL ·constants(SB), NOPTR|RODATA, $32 DATA ·incRotMatrix+0x00(SB)/4, $0x00000000 DATA ·incRotMatrix+0x04(SB)/4, $0x00000001 DATA ·incRotMatrix+0x08(SB)/4, $0x00000002 DATA ·incRotMatrix+0x0c(SB)/4, $0x00000003 DATA ·incRotMatrix+0x10(SB)/4, $0x02010003 DATA ·incRotMatrix+0x14(SB)/4, $0x06050407 DATA ·incRotMatrix+0x18(SB)/4, $0x0A09080B DATA ·incRotMatrix+0x1c(SB)/4, $0x0E0D0C0F GLOBL ·incRotMatrix(SB), NOPTR|RODATA, $32 ================================================ FILE: vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build go1.11 // +build !gccgo package chacha20 const ( haveAsm = true bufSize = 256 ) //go:noescape func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) func (c *Cipher) xorKeyStreamAsm(dst, src []byte) { if len(src) >= bufSize { xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) } if len(src)%bufSize != 0 { i := len(src) - len(src)%bufSize c.buf = [bufSize]byte{} copy(c.buf[:], src[i:]) xorKeyStreamVX(c.buf[:], c.buf[:], &c.key, &c.nonce, &c.counter) c.len = bufSize - copy(dst[i:], c.buf[:len(src)%bufSize]) } } ================================================ FILE: vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package ChaCha20 implements the core ChaCha20 function as specified // in https://tools.ietf.org/html/rfc7539#section-2.3. package chacha20 import ( "crypto/cipher" "encoding/binary" "golang.org/x/crypto/internal/subtle" ) // assert that *Cipher implements cipher.Stream var _ cipher.Stream = (*Cipher)(nil) // Cipher is a stateful instance of ChaCha20 using a particular key // and nonce. A *Cipher implements the cipher.Stream interface. type Cipher struct { key [8]uint32 counter uint32 // incremented after each block nonce [3]uint32 buf [bufSize]byte // buffer for unused keystream bytes len int // number of unused keystream bytes at end of buf } // New creates a new ChaCha20 stream cipher with the given key and nonce. // The initial counter value is set to 0. func New(key [8]uint32, nonce [3]uint32) *Cipher { return &Cipher{key: key, nonce: nonce} } // ChaCha20 constants spelling "expand 32-byte k" const ( j0 uint32 = 0x61707865 j1 uint32 = 0x3320646e j2 uint32 = 0x79622d32 j3 uint32 = 0x6b206574 ) func quarterRound(a, b, c, d uint32) (uint32, uint32, uint32, uint32) { a += b d ^= a d = (d << 16) | (d >> 16) c += d b ^= c b = (b << 12) | (b >> 20) a += b d ^= a d = (d << 8) | (d >> 24) c += d b ^= c b = (b << 7) | (b >> 25) return a, b, c, d } // XORKeyStream XORs each byte in the given slice with a byte from the // cipher's key stream. Dst and src must overlap entirely or not at all. // // If len(dst) < len(src), XORKeyStream will panic. It is acceptable // to pass a dst bigger than src, and in that case, XORKeyStream will // only update dst[:len(src)] and will not touch the rest of dst. // // Multiple calls to XORKeyStream behave as if the concatenation of // the src buffers was passed in a single run. That is, Cipher // maintains state and does not reset at each XORKeyStream call. func (s *Cipher) XORKeyStream(dst, src []byte) { if len(dst) < len(src) { panic("chacha20: output smaller than input") } if subtle.InexactOverlap(dst[:len(src)], src) { panic("chacha20: invalid buffer overlap") } // xor src with buffered keystream first if s.len != 0 { buf := s.buf[len(s.buf)-s.len:] if len(src) < len(buf) { buf = buf[:len(src)] } td, ts := dst[:len(buf)], src[:len(buf)] // BCE hint for i, b := range buf { td[i] = ts[i] ^ b } s.len -= len(buf) if s.len != 0 { return } s.buf = [len(s.buf)]byte{} // zero the empty buffer src = src[len(buf):] dst = dst[len(buf):] } if len(src) == 0 { return } if haveAsm { if uint64(len(src))+uint64(s.counter)*64 > (1<<38)-64 { panic("chacha20: counter overflow") } s.xorKeyStreamAsm(dst, src) return } // set up a 64-byte buffer to pad out the final block if needed // (hoisted out of the main loop to avoid spills) rem := len(src) % 64 // length of final block fin := len(src) - rem // index of final block if rem > 0 { copy(s.buf[len(s.buf)-64:], src[fin:]) } // pre-calculate most of the first round s1, s5, s9, s13 := quarterRound(j1, s.key[1], s.key[5], s.nonce[0]) s2, s6, s10, s14 := quarterRound(j2, s.key[2], s.key[6], s.nonce[1]) s3, s7, s11, s15 := quarterRound(j3, s.key[3], s.key[7], s.nonce[2]) n := len(src) src, dst = src[:n:n], dst[:n:n] // BCE hint for i := 0; i < n; i += 64 { // calculate the remainder of the first round s0, s4, s8, s12 := quarterRound(j0, s.key[0], s.key[4], s.counter) // execute the second round x0, x5, x10, x15 := quarterRound(s0, s5, s10, s15) x1, x6, x11, x12 := quarterRound(s1, s6, s11, s12) x2, x7, x8, x13 := quarterRound(s2, s7, s8, s13) x3, x4, x9, x14 := quarterRound(s3, s4, s9, s14) // execute the remaining 18 rounds for i := 0; i < 9; i++ { x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) } x0 += j0 x1 += j1 x2 += j2 x3 += j3 x4 += s.key[0] x5 += s.key[1] x6 += s.key[2] x7 += s.key[3] x8 += s.key[4] x9 += s.key[5] x10 += s.key[6] x11 += s.key[7] x12 += s.counter x13 += s.nonce[0] x14 += s.nonce[1] x15 += s.nonce[2] // increment the counter s.counter += 1 if s.counter == 0 { panic("chacha20: counter overflow") } // pad to 64 bytes if needed in, out := src[i:], dst[i:] if i == fin { // src[fin:] has already been copied into s.buf before // the main loop in, out = s.buf[len(s.buf)-64:], s.buf[len(s.buf)-64:] } in, out = in[:64], out[:64] // BCE hint // XOR the key stream with the source and write out the result xor(out[0:], in[0:], x0) xor(out[4:], in[4:], x1) xor(out[8:], in[8:], x2) xor(out[12:], in[12:], x3) xor(out[16:], in[16:], x4) xor(out[20:], in[20:], x5) xor(out[24:], in[24:], x6) xor(out[28:], in[28:], x7) xor(out[32:], in[32:], x8) xor(out[36:], in[36:], x9) xor(out[40:], in[40:], x10) xor(out[44:], in[44:], x11) xor(out[48:], in[48:], x12) xor(out[52:], in[52:], x13) xor(out[56:], in[56:], x14) xor(out[60:], in[60:], x15) } // copy any trailing bytes out of the buffer and into dst if rem != 0 { s.len = 64 - rem copy(dst[fin:], s.buf[len(s.buf)-64:]) } } // Advance discards bytes in the key stream until the next 64 byte block // boundary is reached and updates the counter accordingly. If the key // stream is already at a block boundary no bytes will be discarded and // the counter will be unchanged. func (s *Cipher) Advance() { s.len -= s.len % 64 if s.len == 0 { s.buf = [len(s.buf)]byte{} } } // XORKeyStream crypts bytes from in to out using the given key and counters. // In and out must overlap entirely or not at all. Counter contains the raw // ChaCha20 counter bytes (i.e. block counter followed by nonce). func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { s := Cipher{ key: [8]uint32{ binary.LittleEndian.Uint32(key[0:4]), binary.LittleEndian.Uint32(key[4:8]), binary.LittleEndian.Uint32(key[8:12]), binary.LittleEndian.Uint32(key[12:16]), binary.LittleEndian.Uint32(key[16:20]), binary.LittleEndian.Uint32(key[20:24]), binary.LittleEndian.Uint32(key[24:28]), binary.LittleEndian.Uint32(key[28:32]), }, nonce: [3]uint32{ binary.LittleEndian.Uint32(counter[4:8]), binary.LittleEndian.Uint32(counter[8:12]), binary.LittleEndian.Uint32(counter[12:16]), }, counter: binary.LittleEndian.Uint32(counter[0:4]), } s.XORKeyStream(out, in) } // HChaCha20 uses the ChaCha20 core to generate a derived key from a key and a // nonce. It should only be used as part of the XChaCha20 construction. func HChaCha20(key *[8]uint32, nonce *[4]uint32) [8]uint32 { x0, x1, x2, x3 := j0, j1, j2, j3 x4, x5, x6, x7 := key[0], key[1], key[2], key[3] x8, x9, x10, x11 := key[4], key[5], key[6], key[7] x12, x13, x14, x15 := nonce[0], nonce[1], nonce[2], nonce[3] for i := 0; i < 10; i++ { x0, x4, x8, x12 = quarterRound(x0, x4, x8, x12) x1, x5, x9, x13 = quarterRound(x1, x5, x9, x13) x2, x6, x10, x14 = quarterRound(x2, x6, x10, x14) x3, x7, x11, x15 = quarterRound(x3, x7, x11, x15) x0, x5, x10, x15 = quarterRound(x0, x5, x10, x15) x1, x6, x11, x12 = quarterRound(x1, x6, x11, x12) x2, x7, x8, x13 = quarterRound(x2, x7, x8, x13) x3, x4, x9, x14 = quarterRound(x3, x4, x9, x14) } var out [8]uint32 out[0], out[1], out[2], out[3] = x0, x1, x2, x3 out[4], out[5], out[6], out[7] = x12, x13, x14, x15 return out } ================================================ FILE: vendor/golang.org/x/crypto/internal/chacha20/chacha_noasm.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !arm64,!s390x arm64,!go1.11 gccgo appengine package chacha20 const ( bufSize = 64 haveAsm = false ) func (*Cipher) xorKeyStreamAsm(dst, src []byte) { panic("not implemented") } ================================================ FILE: vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build s390x,!gccgo,!appengine package chacha20 import ( "golang.org/x/sys/cpu" ) var haveAsm = cpu.S390X.HasVX const bufSize = 256 // xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only // be called when the vector facility is available. // Implementation in asm_s390x.s. //go:noescape func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32, buf *[256]byte, len *int) func (c *Cipher) xorKeyStreamAsm(dst, src []byte) { xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter, &c.buf, &c.len) } // EXRL targets, DO NOT CALL! func mvcSrcToBuf() func mvcBufToDst() ================================================ FILE: vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.s ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build s390x,!gccgo,!appengine #include "go_asm.h" #include "textflag.h" // This is an implementation of the ChaCha20 encryption algorithm as // specified in RFC 7539. It uses vector instructions to compute // 4 keystream blocks in parallel (256 bytes) which are then XORed // with the bytes in the input slice. GLOBL ·constants<>(SB), RODATA|NOPTR, $32 // BSWAP: swap bytes in each 4-byte element DATA ·constants<>+0x00(SB)/4, $0x03020100 DATA ·constants<>+0x04(SB)/4, $0x07060504 DATA ·constants<>+0x08(SB)/4, $0x0b0a0908 DATA ·constants<>+0x0c(SB)/4, $0x0f0e0d0c // J0: [j0, j1, j2, j3] DATA ·constants<>+0x10(SB)/4, $0x61707865 DATA ·constants<>+0x14(SB)/4, $0x3320646e DATA ·constants<>+0x18(SB)/4, $0x79622d32 DATA ·constants<>+0x1c(SB)/4, $0x6b206574 // EXRL targets: TEXT ·mvcSrcToBuf(SB), NOFRAME|NOSPLIT, $0 MVC $1, (R1), (R8) RET TEXT ·mvcBufToDst(SB), NOFRAME|NOSPLIT, $0 MVC $1, (R8), (R9) RET #define BSWAP V5 #define J0 V6 #define KEY0 V7 #define KEY1 V8 #define NONCE V9 #define CTR V10 #define M0 V11 #define M1 V12 #define M2 V13 #define M3 V14 #define INC V15 #define X0 V16 #define X1 V17 #define X2 V18 #define X3 V19 #define X4 V20 #define X5 V21 #define X6 V22 #define X7 V23 #define X8 V24 #define X9 V25 #define X10 V26 #define X11 V27 #define X12 V28 #define X13 V29 #define X14 V30 #define X15 V31 #define NUM_ROUNDS 20 #define ROUND4(a0, a1, a2, a3, b0, b1, b2, b3, c0, c1, c2, c3, d0, d1, d2, d3) \ VAF a1, a0, a0 \ VAF b1, b0, b0 \ VAF c1, c0, c0 \ VAF d1, d0, d0 \ VX a0, a2, a2 \ VX b0, b2, b2 \ VX c0, c2, c2 \ VX d0, d2, d2 \ VERLLF $16, a2, a2 \ VERLLF $16, b2, b2 \ VERLLF $16, c2, c2 \ VERLLF $16, d2, d2 \ VAF a2, a3, a3 \ VAF b2, b3, b3 \ VAF c2, c3, c3 \ VAF d2, d3, d3 \ VX a3, a1, a1 \ VX b3, b1, b1 \ VX c3, c1, c1 \ VX d3, d1, d1 \ VERLLF $12, a1, a1 \ VERLLF $12, b1, b1 \ VERLLF $12, c1, c1 \ VERLLF $12, d1, d1 \ VAF a1, a0, a0 \ VAF b1, b0, b0 \ VAF c1, c0, c0 \ VAF d1, d0, d0 \ VX a0, a2, a2 \ VX b0, b2, b2 \ VX c0, c2, c2 \ VX d0, d2, d2 \ VERLLF $8, a2, a2 \ VERLLF $8, b2, b2 \ VERLLF $8, c2, c2 \ VERLLF $8, d2, d2 \ VAF a2, a3, a3 \ VAF b2, b3, b3 \ VAF c2, c3, c3 \ VAF d2, d3, d3 \ VX a3, a1, a1 \ VX b3, b1, b1 \ VX c3, c1, c1 \ VX d3, d1, d1 \ VERLLF $7, a1, a1 \ VERLLF $7, b1, b1 \ VERLLF $7, c1, c1 \ VERLLF $7, d1, d1 #define PERMUTE(mask, v0, v1, v2, v3) \ VPERM v0, v0, mask, v0 \ VPERM v1, v1, mask, v1 \ VPERM v2, v2, mask, v2 \ VPERM v3, v3, mask, v3 #define ADDV(x, v0, v1, v2, v3) \ VAF x, v0, v0 \ VAF x, v1, v1 \ VAF x, v2, v2 \ VAF x, v3, v3 #define XORV(off, dst, src, v0, v1, v2, v3) \ VLM off(src), M0, M3 \ PERMUTE(BSWAP, v0, v1, v2, v3) \ VX v0, M0, M0 \ VX v1, M1, M1 \ VX v2, M2, M2 \ VX v3, M3, M3 \ VSTM M0, M3, off(dst) #define SHUFFLE(a, b, c, d, t, u, v, w) \ VMRHF a, c, t \ // t = {a[0], c[0], a[1], c[1]} VMRHF b, d, u \ // u = {b[0], d[0], b[1], d[1]} VMRLF a, c, v \ // v = {a[2], c[2], a[3], c[3]} VMRLF b, d, w \ // w = {b[2], d[2], b[3], d[3]} VMRHF t, u, a \ // a = {a[0], b[0], c[0], d[0]} VMRLF t, u, b \ // b = {a[1], b[1], c[1], d[1]} VMRHF v, w, c \ // c = {a[2], b[2], c[2], d[2]} VMRLF v, w, d // d = {a[3], b[3], c[3], d[3]} // func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32, buf *[256]byte, len *int) TEXT ·xorKeyStreamVX(SB), NOSPLIT, $0 MOVD $·constants<>(SB), R1 MOVD dst+0(FP), R2 // R2=&dst[0] LMG src+24(FP), R3, R4 // R3=&src[0] R4=len(src) MOVD key+48(FP), R5 // R5=key MOVD nonce+56(FP), R6 // R6=nonce MOVD counter+64(FP), R7 // R7=counter MOVD buf+72(FP), R8 // R8=buf MOVD len+80(FP), R9 // R9=len // load BSWAP and J0 VLM (R1), BSWAP, J0 // set up tail buffer ADD $-1, R4, R12 MOVBZ R12, R12 CMPUBEQ R12, $255, aligned MOVD R4, R1 AND $~255, R1 MOVD $(R3)(R1*1), R1 EXRL $·mvcSrcToBuf(SB), R12 MOVD $255, R0 SUB R12, R0 MOVD R0, (R9) // update len aligned: // setup MOVD $95, R0 VLM (R5), KEY0, KEY1 VLL R0, (R6), NONCE VZERO M0 VLEIB $7, $32, M0 VSRLB M0, NONCE, NONCE // initialize counter values VLREPF (R7), CTR VZERO INC VLEIF $1, $1, INC VLEIF $2, $2, INC VLEIF $3, $3, INC VAF INC, CTR, CTR VREPIF $4, INC chacha: VREPF $0, J0, X0 VREPF $1, J0, X1 VREPF $2, J0, X2 VREPF $3, J0, X3 VREPF $0, KEY0, X4 VREPF $1, KEY0, X5 VREPF $2, KEY0, X6 VREPF $3, KEY0, X7 VREPF $0, KEY1, X8 VREPF $1, KEY1, X9 VREPF $2, KEY1, X10 VREPF $3, KEY1, X11 VLR CTR, X12 VREPF $1, NONCE, X13 VREPF $2, NONCE, X14 VREPF $3, NONCE, X15 MOVD $(NUM_ROUNDS/2), R1 loop: ROUND4(X0, X4, X12, X8, X1, X5, X13, X9, X2, X6, X14, X10, X3, X7, X15, X11) ROUND4(X0, X5, X15, X10, X1, X6, X12, X11, X2, X7, X13, X8, X3, X4, X14, X9) ADD $-1, R1 BNE loop // decrement length ADD $-256, R4 BLT tail continue: // rearrange vectors SHUFFLE(X0, X1, X2, X3, M0, M1, M2, M3) ADDV(J0, X0, X1, X2, X3) SHUFFLE(X4, X5, X6, X7, M0, M1, M2, M3) ADDV(KEY0, X4, X5, X6, X7) SHUFFLE(X8, X9, X10, X11, M0, M1, M2, M3) ADDV(KEY1, X8, X9, X10, X11) VAF CTR, X12, X12 SHUFFLE(X12, X13, X14, X15, M0, M1, M2, M3) ADDV(NONCE, X12, X13, X14, X15) // increment counters VAF INC, CTR, CTR // xor keystream with plaintext XORV(0*64, R2, R3, X0, X4, X8, X12) XORV(1*64, R2, R3, X1, X5, X9, X13) XORV(2*64, R2, R3, X2, X6, X10, X14) XORV(3*64, R2, R3, X3, X7, X11, X15) // increment pointers MOVD $256(R2), R2 MOVD $256(R3), R3 CMPBNE R4, $0, chacha CMPUBEQ R12, $255, return EXRL $·mvcBufToDst(SB), R12 // len was updated during setup return: VSTEF $0, CTR, (R7) RET tail: MOVD R2, R9 MOVD R8, R2 MOVD R8, R3 MOVD $0, R4 JMP continue ================================================ FILE: vendor/golang.org/x/crypto/internal/chacha20/xor.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found src the LICENSE file. package chacha20 import ( "runtime" ) // Platforms that have fast unaligned 32-bit little endian accesses. const unaligned = runtime.GOARCH == "386" || runtime.GOARCH == "amd64" || runtime.GOARCH == "arm64" || runtime.GOARCH == "ppc64le" || runtime.GOARCH == "s390x" // xor reads a little endian uint32 from src, XORs it with u and // places the result in little endian byte order in dst. func xor(dst, src []byte, u uint32) { _, _ = src[3], dst[3] // eliminate bounds checks if unaligned { // The compiler should optimize this code into // 32-bit unaligned little endian loads and stores. // TODO: delete once the compiler does a reliably // good job with the generic code below. // See issue #25111 for more details. v := uint32(src[0]) v |= uint32(src[1]) << 8 v |= uint32(src[2]) << 16 v |= uint32(src[3]) << 24 v ^= u dst[0] = byte(v) dst[1] = byte(v >> 8) dst[2] = byte(v >> 16) dst[3] = byte(v >> 24) } else { dst[0] = src[0] ^ byte(u) dst[1] = src[1] ^ byte(u>>8) dst[2] = src[2] ^ byte(u>>16) dst[3] = src[3] ^ byte(u>>24) } } ================================================ FILE: vendor/golang.org/x/crypto/internal/subtle/aliasing.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !appengine // Package subtle implements functions that are often useful in cryptographic // code but require careful thought to use correctly. package subtle // import "golang.org/x/crypto/internal/subtle" import "unsafe" // AnyOverlap reports whether x and y share memory at any (not necessarily // corresponding) index. The memory beyond the slice length is ignored. func AnyOverlap(x, y []byte) bool { return len(x) > 0 && len(y) > 0 && uintptr(unsafe.Pointer(&x[0])) <= uintptr(unsafe.Pointer(&y[len(y)-1])) && uintptr(unsafe.Pointer(&y[0])) <= uintptr(unsafe.Pointer(&x[len(x)-1])) } // InexactOverlap reports whether x and y share memory at any non-corresponding // index. The memory beyond the slice length is ignored. Note that x and y can // have different lengths and still not have any inexact overlap. // // InexactOverlap can be used to implement the requirements of the crypto/cipher // AEAD, Block, BlockMode and Stream interfaces. func InexactOverlap(x, y []byte) bool { if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] { return false } return AnyOverlap(x, y) } ================================================ FILE: vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build appengine // Package subtle implements functions that are often useful in cryptographic // code but require careful thought to use correctly. package subtle // import "golang.org/x/crypto/internal/subtle" // This is the Google App Engine standard variant based on reflect // because the unsafe package and cgo are disallowed. import "reflect" // AnyOverlap reports whether x and y share memory at any (not necessarily // corresponding) index. The memory beyond the slice length is ignored. func AnyOverlap(x, y []byte) bool { return len(x) > 0 && len(y) > 0 && reflect.ValueOf(&x[0]).Pointer() <= reflect.ValueOf(&y[len(y)-1]).Pointer() && reflect.ValueOf(&y[0]).Pointer() <= reflect.ValueOf(&x[len(x)-1]).Pointer() } // InexactOverlap reports whether x and y share memory at any non-corresponding // index. The memory beyond the slice length is ignored. Note that x and y can // have different lengths and still not have any inexact overlap. // // InexactOverlap can be used to implement the requirements of the crypto/cipher // AEAD, Block, BlockMode and Stream interfaces. func InexactOverlap(x, y []byte) bool { if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] { return false } return AnyOverlap(x, y) } ================================================ FILE: vendor/golang.org/x/crypto/poly1305/mac_noasm.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !amd64 gccgo appengine package poly1305 type mac struct{ macGeneric } func newMAC(key *[32]byte) mac { return mac{newMACGeneric(key)} } ================================================ FILE: vendor/golang.org/x/crypto/poly1305/poly1305.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package poly1305 implements Poly1305 one-time message authentication code as // specified in https://cr.yp.to/mac/poly1305-20050329.pdf. // // Poly1305 is a fast, one-time authentication function. It is infeasible for an // attacker to generate an authenticator for a message without the key. However, a // key must only be used for a single message. Authenticating two different // messages with the same key allows an attacker to forge authenticators for other // messages with the same key. // // Poly1305 was originally coupled with AES in order to make Poly1305-AES. AES was // used with a fixed key in order to generate one-time keys from an nonce. // However, in this package AES isn't used and the one-time key is specified // directly. package poly1305 // import "golang.org/x/crypto/poly1305" import "crypto/subtle" // TagSize is the size, in bytes, of a poly1305 authenticator. const TagSize = 16 // Verify returns true if mac is a valid authenticator for m with the given // key. func Verify(mac *[16]byte, m []byte, key *[32]byte) bool { var tmp [16]byte Sum(&tmp, m, key) return subtle.ConstantTimeCompare(tmp[:], mac[:]) == 1 } // New returns a new MAC computing an authentication // tag of all data written to it with the given key. // This allows writing the message progressively instead // of passing it as a single slice. Common users should use // the Sum function instead. // // The key must be unique for each message, as authenticating // two different messages with the same key allows an attacker // to forge messages at will. func New(key *[32]byte) *MAC { return &MAC{ mac: newMAC(key), finalized: false, } } // MAC is an io.Writer computing an authentication tag // of the data written to it. // // MAC cannot be used like common hash.Hash implementations, // because using a poly1305 key twice breaks its security. // Therefore writing data to a running MAC after calling // Sum causes it to panic. type MAC struct { mac // platform-dependent implementation finalized bool } // Size returns the number of bytes Sum will return. func (h *MAC) Size() int { return TagSize } // Write adds more data to the running message authentication code. // It never returns an error. // // It must not be called after the first call of Sum. func (h *MAC) Write(p []byte) (n int, err error) { if h.finalized { panic("poly1305: write to MAC after Sum") } return h.mac.Write(p) } // Sum computes the authenticator of all data written to the // message authentication code. func (h *MAC) Sum(b []byte) []byte { var mac [TagSize]byte h.mac.Sum(&mac) h.finalized = true return append(b, mac[:]...) } ================================================ FILE: vendor/golang.org/x/crypto/poly1305/sum_amd64.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build amd64,!gccgo,!appengine package poly1305 //go:noescape func initialize(state *[7]uint64, key *[32]byte) //go:noescape func update(state *[7]uint64, msg []byte) //go:noescape func finalize(tag *[TagSize]byte, state *[7]uint64) // Sum generates an authenticator for m using a one-time key and puts the // 16-byte result into out. Authenticating two different messages with the same // key allows an attacker to forge messages at will. func Sum(out *[16]byte, m []byte, key *[32]byte) { h := newMAC(key) h.Write(m) h.Sum(out) } func newMAC(key *[32]byte) (h mac) { initialize(&h.state, key) return } type mac struct { state [7]uint64 // := uint64{ h0, h1, h2, r0, r1, pad0, pad1 } buffer [TagSize]byte offset int } func (h *mac) Write(p []byte) (n int, err error) { n = len(p) if h.offset > 0 { remaining := TagSize - h.offset if n < remaining { h.offset += copy(h.buffer[h.offset:], p) return n, nil } copy(h.buffer[h.offset:], p[:remaining]) p = p[remaining:] h.offset = 0 update(&h.state, h.buffer[:]) } if nn := len(p) - (len(p) % TagSize); nn > 0 { update(&h.state, p[:nn]) p = p[nn:] } if len(p) > 0 { h.offset += copy(h.buffer[h.offset:], p) } return n, nil } func (h *mac) Sum(out *[16]byte) { state := h.state if h.offset > 0 { update(&state, h.buffer[:h.offset]) } finalize(out, &state) } ================================================ FILE: vendor/golang.org/x/crypto/poly1305/sum_amd64.s ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build amd64,!gccgo,!appengine #include "textflag.h" #define POLY1305_ADD(msg, h0, h1, h2) \ ADDQ 0(msg), h0; \ ADCQ 8(msg), h1; \ ADCQ $1, h2; \ LEAQ 16(msg), msg #define POLY1305_MUL(h0, h1, h2, r0, r1, t0, t1, t2, t3) \ MOVQ r0, AX; \ MULQ h0; \ MOVQ AX, t0; \ MOVQ DX, t1; \ MOVQ r0, AX; \ MULQ h1; \ ADDQ AX, t1; \ ADCQ $0, DX; \ MOVQ r0, t2; \ IMULQ h2, t2; \ ADDQ DX, t2; \ \ MOVQ r1, AX; \ MULQ h0; \ ADDQ AX, t1; \ ADCQ $0, DX; \ MOVQ DX, h0; \ MOVQ r1, t3; \ IMULQ h2, t3; \ MOVQ r1, AX; \ MULQ h1; \ ADDQ AX, t2; \ ADCQ DX, t3; \ ADDQ h0, t2; \ ADCQ $0, t3; \ \ MOVQ t0, h0; \ MOVQ t1, h1; \ MOVQ t2, h2; \ ANDQ $3, h2; \ MOVQ t2, t0; \ ANDQ $0xFFFFFFFFFFFFFFFC, t0; \ ADDQ t0, h0; \ ADCQ t3, h1; \ ADCQ $0, h2; \ SHRQ $2, t3, t2; \ SHRQ $2, t3; \ ADDQ t2, h0; \ ADCQ t3, h1; \ ADCQ $0, h2 DATA ·poly1305Mask<>+0x00(SB)/8, $0x0FFFFFFC0FFFFFFF DATA ·poly1305Mask<>+0x08(SB)/8, $0x0FFFFFFC0FFFFFFC GLOBL ·poly1305Mask<>(SB), RODATA, $16 // func update(state *[7]uint64, msg []byte) TEXT ·update(SB), $0-32 MOVQ state+0(FP), DI MOVQ msg_base+8(FP), SI MOVQ msg_len+16(FP), R15 MOVQ 0(DI), R8 // h0 MOVQ 8(DI), R9 // h1 MOVQ 16(DI), R10 // h2 MOVQ 24(DI), R11 // r0 MOVQ 32(DI), R12 // r1 CMPQ R15, $16 JB bytes_between_0_and_15 loop: POLY1305_ADD(SI, R8, R9, R10) multiply: POLY1305_MUL(R8, R9, R10, R11, R12, BX, CX, R13, R14) SUBQ $16, R15 CMPQ R15, $16 JAE loop bytes_between_0_and_15: TESTQ R15, R15 JZ done MOVQ $1, BX XORQ CX, CX XORQ R13, R13 ADDQ R15, SI flush_buffer: SHLQ $8, BX, CX SHLQ $8, BX MOVB -1(SI), R13 XORQ R13, BX DECQ SI DECQ R15 JNZ flush_buffer ADDQ BX, R8 ADCQ CX, R9 ADCQ $0, R10 MOVQ $16, R15 JMP multiply done: MOVQ R8, 0(DI) MOVQ R9, 8(DI) MOVQ R10, 16(DI) RET // func initialize(state *[7]uint64, key *[32]byte) TEXT ·initialize(SB), $0-16 MOVQ state+0(FP), DI MOVQ key+8(FP), SI // state[0...7] is initialized with zero MOVOU 0(SI), X0 MOVOU 16(SI), X1 MOVOU ·poly1305Mask<>(SB), X2 PAND X2, X0 MOVOU X0, 24(DI) MOVOU X1, 40(DI) RET // func finalize(tag *[TagSize]byte, state *[7]uint64) TEXT ·finalize(SB), $0-16 MOVQ tag+0(FP), DI MOVQ state+8(FP), SI MOVQ 0(SI), AX MOVQ 8(SI), BX MOVQ 16(SI), CX MOVQ AX, R8 MOVQ BX, R9 SUBQ $0xFFFFFFFFFFFFFFFB, AX SBBQ $0xFFFFFFFFFFFFFFFF, BX SBBQ $3, CX CMOVQCS R8, AX CMOVQCS R9, BX ADDQ 40(SI), AX ADCQ 48(SI), BX MOVQ AX, 0(DI) MOVQ BX, 8(DI) RET ================================================ FILE: vendor/golang.org/x/crypto/poly1305/sum_arm.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build arm,!gccgo,!appengine,!nacl package poly1305 // This function is implemented in sum_arm.s //go:noescape func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]byte) // Sum generates an authenticator for m using a one-time key and puts the // 16-byte result into out. Authenticating two different messages with the same // key allows an attacker to forge messages at will. func Sum(out *[16]byte, m []byte, key *[32]byte) { var mPtr *byte if len(m) > 0 { mPtr = &m[0] } poly1305_auth_armv6(out, mPtr, uint32(len(m)), key) } ================================================ FILE: vendor/golang.org/x/crypto/poly1305/sum_arm.s ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build arm,!gccgo,!appengine,!nacl #include "textflag.h" // This code was translated into a form compatible with 5a from the public // domain source by Andrew Moon: github.com/floodyberry/poly1305-opt/blob/master/app/extensions/poly1305. DATA ·poly1305_init_constants_armv6<>+0x00(SB)/4, $0x3ffffff DATA ·poly1305_init_constants_armv6<>+0x04(SB)/4, $0x3ffff03 DATA ·poly1305_init_constants_armv6<>+0x08(SB)/4, $0x3ffc0ff DATA ·poly1305_init_constants_armv6<>+0x0c(SB)/4, $0x3f03fff DATA ·poly1305_init_constants_armv6<>+0x10(SB)/4, $0x00fffff GLOBL ·poly1305_init_constants_armv6<>(SB), 8, $20 // Warning: the linker may use R11 to synthesize certain instructions. Please // take care and verify that no synthetic instructions use it. TEXT poly1305_init_ext_armv6<>(SB), NOSPLIT, $0 // Needs 16 bytes of stack and 64 bytes of space pointed to by R0. (It // might look like it's only 60 bytes of space but the final four bytes // will be written by another function.) We need to skip over four // bytes of stack because that's saving the value of 'g'. ADD $4, R13, R8 MOVM.IB [R4-R7], (R8) MOVM.IA.W (R1), [R2-R5] MOVW $·poly1305_init_constants_armv6<>(SB), R7 MOVW R2, R8 MOVW R2>>26, R9 MOVW R3>>20, g MOVW R4>>14, R11 MOVW R5>>8, R12 ORR R3<<6, R9, R9 ORR R4<<12, g, g ORR R5<<18, R11, R11 MOVM.IA (R7), [R2-R6] AND R8, R2, R2 AND R9, R3, R3 AND g, R4, R4 AND R11, R5, R5 AND R12, R6, R6 MOVM.IA.W [R2-R6], (R0) EOR R2, R2, R2 EOR R3, R3, R3 EOR R4, R4, R4 EOR R5, R5, R5 EOR R6, R6, R6 MOVM.IA.W [R2-R6], (R0) MOVM.IA.W (R1), [R2-R5] MOVM.IA [R2-R6], (R0) ADD $20, R13, R0 MOVM.DA (R0), [R4-R7] RET #define MOVW_UNALIGNED(Rsrc, Rdst, Rtmp, offset) \ MOVBU (offset+0)(Rsrc), Rtmp; \ MOVBU Rtmp, (offset+0)(Rdst); \ MOVBU (offset+1)(Rsrc), Rtmp; \ MOVBU Rtmp, (offset+1)(Rdst); \ MOVBU (offset+2)(Rsrc), Rtmp; \ MOVBU Rtmp, (offset+2)(Rdst); \ MOVBU (offset+3)(Rsrc), Rtmp; \ MOVBU Rtmp, (offset+3)(Rdst) TEXT poly1305_blocks_armv6<>(SB), NOSPLIT, $0 // Needs 24 bytes of stack for saved registers and then 88 bytes of // scratch space after that. We assume that 24 bytes at (R13) have // already been used: four bytes for the link register saved in the // prelude of poly1305_auth_armv6, four bytes for saving the value of g // in that function and 16 bytes of scratch space used around // poly1305_finish_ext_armv6_skip1. ADD $24, R13, R12 MOVM.IB [R4-R8, R14], (R12) MOVW R0, 88(R13) MOVW R1, 92(R13) MOVW R2, 96(R13) MOVW R1, R14 MOVW R2, R12 MOVW 56(R0), R8 WORD $0xe1180008 // TST R8, R8 not working see issue 5921 EOR R6, R6, R6 MOVW.EQ $(1<<24), R6 MOVW R6, 84(R13) ADD $116, R13, g MOVM.IA (R0), [R0-R9] MOVM.IA [R0-R4], (g) CMP $16, R12 BLO poly1305_blocks_armv6_done poly1305_blocks_armv6_mainloop: WORD $0xe31e0003 // TST R14, #3 not working see issue 5921 BEQ poly1305_blocks_armv6_mainloop_aligned ADD $100, R13, g MOVW_UNALIGNED(R14, g, R0, 0) MOVW_UNALIGNED(R14, g, R0, 4) MOVW_UNALIGNED(R14, g, R0, 8) MOVW_UNALIGNED(R14, g, R0, 12) MOVM.IA (g), [R0-R3] ADD $16, R14 B poly1305_blocks_armv6_mainloop_loaded poly1305_blocks_armv6_mainloop_aligned: MOVM.IA.W (R14), [R0-R3] poly1305_blocks_armv6_mainloop_loaded: MOVW R0>>26, g MOVW R1>>20, R11 MOVW R2>>14, R12 MOVW R14, 92(R13) MOVW R3>>8, R4 ORR R1<<6, g, g ORR R2<<12, R11, R11 ORR R3<<18, R12, R12 BIC $0xfc000000, R0, R0 BIC $0xfc000000, g, g MOVW 84(R13), R3 BIC $0xfc000000, R11, R11 BIC $0xfc000000, R12, R12 ADD R0, R5, R5 ADD g, R6, R6 ORR R3, R4, R4 ADD R11, R7, R7 ADD $116, R13, R14 ADD R12, R8, R8 ADD R4, R9, R9 MOVM.IA (R14), [R0-R4] MULLU R4, R5, (R11, g) MULLU R3, R5, (R14, R12) MULALU R3, R6, (R11, g) MULALU R2, R6, (R14, R12) MULALU R2, R7, (R11, g) MULALU R1, R7, (R14, R12) ADD R4<<2, R4, R4 ADD R3<<2, R3, R3 MULALU R1, R8, (R11, g) MULALU R0, R8, (R14, R12) MULALU R0, R9, (R11, g) MULALU R4, R9, (R14, R12) MOVW g, 76(R13) MOVW R11, 80(R13) MOVW R12, 68(R13) MOVW R14, 72(R13) MULLU R2, R5, (R11, g) MULLU R1, R5, (R14, R12) MULALU R1, R6, (R11, g) MULALU R0, R6, (R14, R12) MULALU R0, R7, (R11, g) MULALU R4, R7, (R14, R12) ADD R2<<2, R2, R2 ADD R1<<2, R1, R1 MULALU R4, R8, (R11, g) MULALU R3, R8, (R14, R12) MULALU R3, R9, (R11, g) MULALU R2, R9, (R14, R12) MOVW g, 60(R13) MOVW R11, 64(R13) MOVW R12, 52(R13) MOVW R14, 56(R13) MULLU R0, R5, (R11, g) MULALU R4, R6, (R11, g) MULALU R3, R7, (R11, g) MULALU R2, R8, (R11, g) MULALU R1, R9, (R11, g) ADD $52, R13, R0 MOVM.IA (R0), [R0-R7] MOVW g>>26, R12 MOVW R4>>26, R14 ORR R11<<6, R12, R12 ORR R5<<6, R14, R14 BIC $0xfc000000, g, g BIC $0xfc000000, R4, R4 ADD.S R12, R0, R0 ADC $0, R1, R1 ADD.S R14, R6, R6 ADC $0, R7, R7 MOVW R0>>26, R12 MOVW R6>>26, R14 ORR R1<<6, R12, R12 ORR R7<<6, R14, R14 BIC $0xfc000000, R0, R0 BIC $0xfc000000, R6, R6 ADD R14<<2, R14, R14 ADD.S R12, R2, R2 ADC $0, R3, R3 ADD R14, g, g MOVW R2>>26, R12 MOVW g>>26, R14 ORR R3<<6, R12, R12 BIC $0xfc000000, g, R5 BIC $0xfc000000, R2, R7 ADD R12, R4, R4 ADD R14, R0, R0 MOVW R4>>26, R12 BIC $0xfc000000, R4, R8 ADD R12, R6, R9 MOVW 96(R13), R12 MOVW 92(R13), R14 MOVW R0, R6 CMP $32, R12 SUB $16, R12, R12 MOVW R12, 96(R13) BHS poly1305_blocks_armv6_mainloop poly1305_blocks_armv6_done: MOVW 88(R13), R12 MOVW R5, 20(R12) MOVW R6, 24(R12) MOVW R7, 28(R12) MOVW R8, 32(R12) MOVW R9, 36(R12) ADD $48, R13, R0 MOVM.DA (R0), [R4-R8, R14] RET #define MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp) \ MOVBU.P 1(Rsrc), Rtmp; \ MOVBU.P Rtmp, 1(Rdst); \ MOVBU.P 1(Rsrc), Rtmp; \ MOVBU.P Rtmp, 1(Rdst) #define MOVWP_UNALIGNED(Rsrc, Rdst, Rtmp) \ MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp); \ MOVHUP_UNALIGNED(Rsrc, Rdst, Rtmp) // func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]key) TEXT ·poly1305_auth_armv6(SB), $196-16 // The value 196, just above, is the sum of 64 (the size of the context // structure) and 132 (the amount of stack needed). // // At this point, the stack pointer (R13) has been moved down. It // points to the saved link register and there's 196 bytes of free // space above it. // // The stack for this function looks like: // // +--------------------- // | // | 64 bytes of context structure // | // +--------------------- // | // | 112 bytes for poly1305_blocks_armv6 // | // +--------------------- // | 16 bytes of final block, constructed at // | poly1305_finish_ext_armv6_skip8 // +--------------------- // | four bytes of saved 'g' // +--------------------- // | lr, saved by prelude <- R13 points here // +--------------------- MOVW g, 4(R13) MOVW out+0(FP), R4 MOVW m+4(FP), R5 MOVW mlen+8(FP), R6 MOVW key+12(FP), R7 ADD $136, R13, R0 // 136 = 4 + 4 + 16 + 112 MOVW R7, R1 // poly1305_init_ext_armv6 will write to the stack from R13+4, but // that's ok because none of the other values have been written yet. BL poly1305_init_ext_armv6<>(SB) BIC.S $15, R6, R2 BEQ poly1305_auth_armv6_noblocks ADD $136, R13, R0 MOVW R5, R1 ADD R2, R5, R5 SUB R2, R6, R6 BL poly1305_blocks_armv6<>(SB) poly1305_auth_armv6_noblocks: ADD $136, R13, R0 MOVW R5, R1 MOVW R6, R2 MOVW R4, R3 MOVW R0, R5 MOVW R1, R6 MOVW R2, R7 MOVW R3, R8 AND.S R2, R2, R2 BEQ poly1305_finish_ext_armv6_noremaining EOR R0, R0 ADD $8, R13, R9 // 8 = offset to 16 byte scratch space MOVW R0, (R9) MOVW R0, 4(R9) MOVW R0, 8(R9) MOVW R0, 12(R9) WORD $0xe3110003 // TST R1, #3 not working see issue 5921 BEQ poly1305_finish_ext_armv6_aligned WORD $0xe3120008 // TST R2, #8 not working see issue 5921 BEQ poly1305_finish_ext_armv6_skip8 MOVWP_UNALIGNED(R1, R9, g) MOVWP_UNALIGNED(R1, R9, g) poly1305_finish_ext_armv6_skip8: WORD $0xe3120004 // TST $4, R2 not working see issue 5921 BEQ poly1305_finish_ext_armv6_skip4 MOVWP_UNALIGNED(R1, R9, g) poly1305_finish_ext_armv6_skip4: WORD $0xe3120002 // TST $2, R2 not working see issue 5921 BEQ poly1305_finish_ext_armv6_skip2 MOVHUP_UNALIGNED(R1, R9, g) B poly1305_finish_ext_armv6_skip2 poly1305_finish_ext_armv6_aligned: WORD $0xe3120008 // TST R2, #8 not working see issue 5921 BEQ poly1305_finish_ext_armv6_skip8_aligned MOVM.IA.W (R1), [g-R11] MOVM.IA.W [g-R11], (R9) poly1305_finish_ext_armv6_skip8_aligned: WORD $0xe3120004 // TST $4, R2 not working see issue 5921 BEQ poly1305_finish_ext_armv6_skip4_aligned MOVW.P 4(R1), g MOVW.P g, 4(R9) poly1305_finish_ext_armv6_skip4_aligned: WORD $0xe3120002 // TST $2, R2 not working see issue 5921 BEQ poly1305_finish_ext_armv6_skip2 MOVHU.P 2(R1), g MOVH.P g, 2(R9) poly1305_finish_ext_armv6_skip2: WORD $0xe3120001 // TST $1, R2 not working see issue 5921 BEQ poly1305_finish_ext_armv6_skip1 MOVBU.P 1(R1), g MOVBU.P g, 1(R9) poly1305_finish_ext_armv6_skip1: MOVW $1, R11 MOVBU R11, 0(R9) MOVW R11, 56(R5) MOVW R5, R0 ADD $8, R13, R1 MOVW $16, R2 BL poly1305_blocks_armv6<>(SB) poly1305_finish_ext_armv6_noremaining: MOVW 20(R5), R0 MOVW 24(R5), R1 MOVW 28(R5), R2 MOVW 32(R5), R3 MOVW 36(R5), R4 MOVW R4>>26, R12 BIC $0xfc000000, R4, R4 ADD R12<<2, R12, R12 ADD R12, R0, R0 MOVW R0>>26, R12 BIC $0xfc000000, R0, R0 ADD R12, R1, R1 MOVW R1>>26, R12 BIC $0xfc000000, R1, R1 ADD R12, R2, R2 MOVW R2>>26, R12 BIC $0xfc000000, R2, R2 ADD R12, R3, R3 MOVW R3>>26, R12 BIC $0xfc000000, R3, R3 ADD R12, R4, R4 ADD $5, R0, R6 MOVW R6>>26, R12 BIC $0xfc000000, R6, R6 ADD R12, R1, R7 MOVW R7>>26, R12 BIC $0xfc000000, R7, R7 ADD R12, R2, g MOVW g>>26, R12 BIC $0xfc000000, g, g ADD R12, R3, R11 MOVW $-(1<<26), R12 ADD R11>>26, R12, R12 BIC $0xfc000000, R11, R11 ADD R12, R4, R9 MOVW R9>>31, R12 SUB $1, R12 AND R12, R6, R6 AND R12, R7, R7 AND R12, g, g AND R12, R11, R11 AND R12, R9, R9 MVN R12, R12 AND R12, R0, R0 AND R12, R1, R1 AND R12, R2, R2 AND R12, R3, R3 AND R12, R4, R4 ORR R6, R0, R0 ORR R7, R1, R1 ORR g, R2, R2 ORR R11, R3, R3 ORR R9, R4, R4 ORR R1<<26, R0, R0 MOVW R1>>6, R1 ORR R2<<20, R1, R1 MOVW R2>>12, R2 ORR R3<<14, R2, R2 MOVW R3>>18, R3 ORR R4<<8, R3, R3 MOVW 40(R5), R6 MOVW 44(R5), R7 MOVW 48(R5), g MOVW 52(R5), R11 ADD.S R6, R0, R0 ADC.S R7, R1, R1 ADC.S g, R2, R2 ADC.S R11, R3, R3 MOVM.IA [R0-R3], (R8) MOVW R5, R12 EOR R0, R0, R0 EOR R1, R1, R1 EOR R2, R2, R2 EOR R3, R3, R3 EOR R4, R4, R4 EOR R5, R5, R5 EOR R6, R6, R6 EOR R7, R7, R7 MOVM.IA.W [R0-R7], (R12) MOVM.IA [R0-R7], (R12) MOVW 4(R13), g RET ================================================ FILE: vendor/golang.org/x/crypto/poly1305/sum_generic.go ================================================ // Copyright 2018 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 poly1305 import "encoding/binary" const ( msgBlock = uint32(1 << 24) finalBlock = uint32(0) ) // sumGeneric generates an authenticator for msg using a one-time key and // puts the 16-byte result into out. This is the generic implementation of // Sum and should be called if no assembly implementation is available. func sumGeneric(out *[TagSize]byte, msg []byte, key *[32]byte) { h := newMACGeneric(key) h.Write(msg) h.Sum(out) } func newMACGeneric(key *[32]byte) (h macGeneric) { h.r[0] = binary.LittleEndian.Uint32(key[0:]) & 0x3ffffff h.r[1] = (binary.LittleEndian.Uint32(key[3:]) >> 2) & 0x3ffff03 h.r[2] = (binary.LittleEndian.Uint32(key[6:]) >> 4) & 0x3ffc0ff h.r[3] = (binary.LittleEndian.Uint32(key[9:]) >> 6) & 0x3f03fff h.r[4] = (binary.LittleEndian.Uint32(key[12:]) >> 8) & 0x00fffff h.s[0] = binary.LittleEndian.Uint32(key[16:]) h.s[1] = binary.LittleEndian.Uint32(key[20:]) h.s[2] = binary.LittleEndian.Uint32(key[24:]) h.s[3] = binary.LittleEndian.Uint32(key[28:]) return } type macGeneric struct { h, r [5]uint32 s [4]uint32 buffer [TagSize]byte offset int } func (h *macGeneric) Write(p []byte) (n int, err error) { n = len(p) if h.offset > 0 { remaining := TagSize - h.offset if n < remaining { h.offset += copy(h.buffer[h.offset:], p) return n, nil } copy(h.buffer[h.offset:], p[:remaining]) p = p[remaining:] h.offset = 0 updateGeneric(h.buffer[:], msgBlock, &(h.h), &(h.r)) } if nn := len(p) - (len(p) % TagSize); nn > 0 { updateGeneric(p, msgBlock, &(h.h), &(h.r)) p = p[nn:] } if len(p) > 0 { h.offset += copy(h.buffer[h.offset:], p) } return n, nil } func (h *macGeneric) Sum(out *[16]byte) { H, R := h.h, h.r if h.offset > 0 { var buffer [TagSize]byte copy(buffer[:], h.buffer[:h.offset]) buffer[h.offset] = 1 // invariant: h.offset < TagSize updateGeneric(buffer[:], finalBlock, &H, &R) } finalizeGeneric(out, &H, &(h.s)) } func updateGeneric(msg []byte, flag uint32, h, r *[5]uint32) { h0, h1, h2, h3, h4 := h[0], h[1], h[2], h[3], h[4] r0, r1, r2, r3, r4 := uint64(r[0]), uint64(r[1]), uint64(r[2]), uint64(r[3]), uint64(r[4]) R1, R2, R3, R4 := r1*5, r2*5, r3*5, r4*5 for len(msg) >= TagSize { // h += msg h0 += binary.LittleEndian.Uint32(msg[0:]) & 0x3ffffff h1 += (binary.LittleEndian.Uint32(msg[3:]) >> 2) & 0x3ffffff h2 += (binary.LittleEndian.Uint32(msg[6:]) >> 4) & 0x3ffffff h3 += (binary.LittleEndian.Uint32(msg[9:]) >> 6) & 0x3ffffff h4 += (binary.LittleEndian.Uint32(msg[12:]) >> 8) | flag // h *= r d0 := (uint64(h0) * r0) + (uint64(h1) * R4) + (uint64(h2) * R3) + (uint64(h3) * R2) + (uint64(h4) * R1) d1 := (d0 >> 26) + (uint64(h0) * r1) + (uint64(h1) * r0) + (uint64(h2) * R4) + (uint64(h3) * R3) + (uint64(h4) * R2) d2 := (d1 >> 26) + (uint64(h0) * r2) + (uint64(h1) * r1) + (uint64(h2) * r0) + (uint64(h3) * R4) + (uint64(h4) * R3) d3 := (d2 >> 26) + (uint64(h0) * r3) + (uint64(h1) * r2) + (uint64(h2) * r1) + (uint64(h3) * r0) + (uint64(h4) * R4) d4 := (d3 >> 26) + (uint64(h0) * r4) + (uint64(h1) * r3) + (uint64(h2) * r2) + (uint64(h3) * r1) + (uint64(h4) * r0) // h %= p h0 = uint32(d0) & 0x3ffffff h1 = uint32(d1) & 0x3ffffff h2 = uint32(d2) & 0x3ffffff h3 = uint32(d3) & 0x3ffffff h4 = uint32(d4) & 0x3ffffff h0 += uint32(d4>>26) * 5 h1 += h0 >> 26 h0 = h0 & 0x3ffffff msg = msg[TagSize:] } h[0], h[1], h[2], h[3], h[4] = h0, h1, h2, h3, h4 } func finalizeGeneric(out *[TagSize]byte, h *[5]uint32, s *[4]uint32) { h0, h1, h2, h3, h4 := h[0], h[1], h[2], h[3], h[4] // h %= p reduction h2 += h1 >> 26 h1 &= 0x3ffffff h3 += h2 >> 26 h2 &= 0x3ffffff h4 += h3 >> 26 h3 &= 0x3ffffff h0 += 5 * (h4 >> 26) h4 &= 0x3ffffff h1 += h0 >> 26 h0 &= 0x3ffffff // h - p t0 := h0 + 5 t1 := h1 + (t0 >> 26) t2 := h2 + (t1 >> 26) t3 := h3 + (t2 >> 26) t4 := h4 + (t3 >> 26) - (1 << 26) t0 &= 0x3ffffff t1 &= 0x3ffffff t2 &= 0x3ffffff t3 &= 0x3ffffff // select h if h < p else h - p t_mask := (t4 >> 31) - 1 h_mask := ^t_mask h0 = (h0 & h_mask) | (t0 & t_mask) h1 = (h1 & h_mask) | (t1 & t_mask) h2 = (h2 & h_mask) | (t2 & t_mask) h3 = (h3 & h_mask) | (t3 & t_mask) h4 = (h4 & h_mask) | (t4 & t_mask) // h %= 2^128 h0 |= h1 << 26 h1 = ((h1 >> 6) | (h2 << 20)) h2 = ((h2 >> 12) | (h3 << 14)) h3 = ((h3 >> 18) | (h4 << 8)) // s: the s part of the key // tag = (h + s) % (2^128) t := uint64(h0) + uint64(s[0]) h0 = uint32(t) t = uint64(h1) + uint64(s[1]) + (t >> 32) h1 = uint32(t) t = uint64(h2) + uint64(s[2]) + (t >> 32) h2 = uint32(t) t = uint64(h3) + uint64(s[3]) + (t >> 32) h3 = uint32(t) binary.LittleEndian.PutUint32(out[0:], h0) binary.LittleEndian.PutUint32(out[4:], h1) binary.LittleEndian.PutUint32(out[8:], h2) binary.LittleEndian.PutUint32(out[12:], h3) } ================================================ FILE: vendor/golang.org/x/crypto/poly1305/sum_noasm.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build s390x,!go1.11 !arm,!amd64,!s390x gccgo appengine nacl package poly1305 // Sum generates an authenticator for msg using a one-time key and puts the // 16-byte result into out. Authenticating two different messages with the same // key allows an attacker to forge messages at will. func Sum(out *[TagSize]byte, msg []byte, key *[32]byte) { h := newMAC(key) h.Write(msg) h.Sum(out) } ================================================ FILE: vendor/golang.org/x/crypto/poly1305/sum_s390x.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build s390x,go1.11,!gccgo,!appengine package poly1305 import ( "golang.org/x/sys/cpu" ) // poly1305vx is an assembly implementation of Poly1305 that uses vector // instructions. It must only be called if the vector facility (vx) is // available. //go:noescape func poly1305vx(out *[16]byte, m *byte, mlen uint64, key *[32]byte) // poly1305vmsl is an assembly implementation of Poly1305 that uses vector // instructions, including VMSL. It must only be called if the vector facility (vx) is // available and if VMSL is supported. //go:noescape func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]byte) // Sum generates an authenticator for m using a one-time key and puts the // 16-byte result into out. Authenticating two different messages with the same // key allows an attacker to forge messages at will. func Sum(out *[16]byte, m []byte, key *[32]byte) { if cpu.S390X.HasVX { var mPtr *byte if len(m) > 0 { mPtr = &m[0] } if cpu.S390X.HasVXE && len(m) > 256 { poly1305vmsl(out, mPtr, uint64(len(m)), key) } else { poly1305vx(out, mPtr, uint64(len(m)), key) } } else { sumGeneric(out, m, key) } } ================================================ FILE: vendor/golang.org/x/crypto/poly1305/sum_s390x.s ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build s390x,go1.11,!gccgo,!appengine #include "textflag.h" // Implementation of Poly1305 using the vector facility (vx). // constants #define MOD26 V0 #define EX0 V1 #define EX1 V2 #define EX2 V3 // temporaries #define T_0 V4 #define T_1 V5 #define T_2 V6 #define T_3 V7 #define T_4 V8 // key (r) #define R_0 V9 #define R_1 V10 #define R_2 V11 #define R_3 V12 #define R_4 V13 #define R5_1 V14 #define R5_2 V15 #define R5_3 V16 #define R5_4 V17 #define RSAVE_0 R5 #define RSAVE_1 R6 #define RSAVE_2 R7 #define RSAVE_3 R8 #define RSAVE_4 R9 #define R5SAVE_1 V28 #define R5SAVE_2 V29 #define R5SAVE_3 V30 #define R5SAVE_4 V31 // message block #define F_0 V18 #define F_1 V19 #define F_2 V20 #define F_3 V21 #define F_4 V22 // accumulator #define H_0 V23 #define H_1 V24 #define H_2 V25 #define H_3 V26 #define H_4 V27 GLOBL ·keyMask<>(SB), RODATA, $16 DATA ·keyMask<>+0(SB)/8, $0xffffff0ffcffff0f DATA ·keyMask<>+8(SB)/8, $0xfcffff0ffcffff0f GLOBL ·bswapMask<>(SB), RODATA, $16 DATA ·bswapMask<>+0(SB)/8, $0x0f0e0d0c0b0a0908 DATA ·bswapMask<>+8(SB)/8, $0x0706050403020100 GLOBL ·constants<>(SB), RODATA, $64 // MOD26 DATA ·constants<>+0(SB)/8, $0x3ffffff DATA ·constants<>+8(SB)/8, $0x3ffffff // EX0 DATA ·constants<>+16(SB)/8, $0x0006050403020100 DATA ·constants<>+24(SB)/8, $0x1016151413121110 // EX1 DATA ·constants<>+32(SB)/8, $0x060c0b0a09080706 DATA ·constants<>+40(SB)/8, $0x161c1b1a19181716 // EX2 DATA ·constants<>+48(SB)/8, $0x0d0d0d0d0d0f0e0d DATA ·constants<>+56(SB)/8, $0x1d1d1d1d1d1f1e1d // h = (f*g) % (2**130-5) [partial reduction] #define MULTIPLY(f0, f1, f2, f3, f4, g0, g1, g2, g3, g4, g51, g52, g53, g54, h0, h1, h2, h3, h4) \ VMLOF f0, g0, h0 \ VMLOF f0, g1, h1 \ VMLOF f0, g2, h2 \ VMLOF f0, g3, h3 \ VMLOF f0, g4, h4 \ VMLOF f1, g54, T_0 \ VMLOF f1, g0, T_1 \ VMLOF f1, g1, T_2 \ VMLOF f1, g2, T_3 \ VMLOF f1, g3, T_4 \ VMALOF f2, g53, h0, h0 \ VMALOF f2, g54, h1, h1 \ VMALOF f2, g0, h2, h2 \ VMALOF f2, g1, h3, h3 \ VMALOF f2, g2, h4, h4 \ VMALOF f3, g52, T_0, T_0 \ VMALOF f3, g53, T_1, T_1 \ VMALOF f3, g54, T_2, T_2 \ VMALOF f3, g0, T_3, T_3 \ VMALOF f3, g1, T_4, T_4 \ VMALOF f4, g51, h0, h0 \ VMALOF f4, g52, h1, h1 \ VMALOF f4, g53, h2, h2 \ VMALOF f4, g54, h3, h3 \ VMALOF f4, g0, h4, h4 \ VAG T_0, h0, h0 \ VAG T_1, h1, h1 \ VAG T_2, h2, h2 \ VAG T_3, h3, h3 \ VAG T_4, h4, h4 // carry h0->h1 h3->h4, h1->h2 h4->h0, h0->h1 h2->h3, h3->h4 #define REDUCE(h0, h1, h2, h3, h4) \ VESRLG $26, h0, T_0 \ VESRLG $26, h3, T_1 \ VN MOD26, h0, h0 \ VN MOD26, h3, h3 \ VAG T_0, h1, h1 \ VAG T_1, h4, h4 \ VESRLG $26, h1, T_2 \ VESRLG $26, h4, T_3 \ VN MOD26, h1, h1 \ VN MOD26, h4, h4 \ VESLG $2, T_3, T_4 \ VAG T_3, T_4, T_4 \ VAG T_2, h2, h2 \ VAG T_4, h0, h0 \ VESRLG $26, h2, T_0 \ VESRLG $26, h0, T_1 \ VN MOD26, h2, h2 \ VN MOD26, h0, h0 \ VAG T_0, h3, h3 \ VAG T_1, h1, h1 \ VESRLG $26, h3, T_2 \ VN MOD26, h3, h3 \ VAG T_2, h4, h4 // expand in0 into d[0] and in1 into d[1] #define EXPAND(in0, in1, d0, d1, d2, d3, d4) \ VGBM $0x0707, d1 \ // d1=tmp VPERM in0, in1, EX2, d4 \ VPERM in0, in1, EX0, d0 \ VPERM in0, in1, EX1, d2 \ VN d1, d4, d4 \ VESRLG $26, d0, d1 \ VESRLG $30, d2, d3 \ VESRLG $4, d2, d2 \ VN MOD26, d0, d0 \ VN MOD26, d1, d1 \ VN MOD26, d2, d2 \ VN MOD26, d3, d3 // pack h4:h0 into h1:h0 (no carry) #define PACK(h0, h1, h2, h3, h4) \ VESLG $26, h1, h1 \ VESLG $26, h3, h3 \ VO h0, h1, h0 \ VO h2, h3, h2 \ VESLG $4, h2, h2 \ VLEIB $7, $48, h1 \ VSLB h1, h2, h2 \ VO h0, h2, h0 \ VLEIB $7, $104, h1 \ VSLB h1, h4, h3 \ VO h3, h0, h0 \ VLEIB $7, $24, h1 \ VSRLB h1, h4, h1 // if h > 2**130-5 then h -= 2**130-5 #define MOD(h0, h1, t0, t1, t2) \ VZERO t0 \ VLEIG $1, $5, t0 \ VACCQ h0, t0, t1 \ VAQ h0, t0, t0 \ VONE t2 \ VLEIG $1, $-4, t2 \ VAQ t2, t1, t1 \ VACCQ h1, t1, t1 \ VONE t2 \ VAQ t2, t1, t1 \ VN h0, t1, t2 \ VNC t0, t1, t1 \ VO t1, t2, h0 // func poly1305vx(out *[16]byte, m *byte, mlen uint64, key *[32]key) TEXT ·poly1305vx(SB), $0-32 // This code processes up to 2 blocks (32 bytes) per iteration // using the algorithm described in: // NEON crypto, Daniel J. Bernstein & Peter Schwabe // https://cryptojedi.org/papers/neoncrypto-20120320.pdf LMG out+0(FP), R1, R4 // R1=out, R2=m, R3=mlen, R4=key // load MOD26, EX0, EX1 and EX2 MOVD $·constants<>(SB), R5 VLM (R5), MOD26, EX2 // setup r VL (R4), T_0 MOVD $·keyMask<>(SB), R6 VL (R6), T_1 VN T_0, T_1, T_0 EXPAND(T_0, T_0, R_0, R_1, R_2, R_3, R_4) // setup r*5 VLEIG $0, $5, T_0 VLEIG $1, $5, T_0 // store r (for final block) VMLOF T_0, R_1, R5SAVE_1 VMLOF T_0, R_2, R5SAVE_2 VMLOF T_0, R_3, R5SAVE_3 VMLOF T_0, R_4, R5SAVE_4 VLGVG $0, R_0, RSAVE_0 VLGVG $0, R_1, RSAVE_1 VLGVG $0, R_2, RSAVE_2 VLGVG $0, R_3, RSAVE_3 VLGVG $0, R_4, RSAVE_4 // skip r**2 calculation CMPBLE R3, $16, skip // calculate r**2 MULTIPLY(R_0, R_1, R_2, R_3, R_4, R_0, R_1, R_2, R_3, R_4, R5SAVE_1, R5SAVE_2, R5SAVE_3, R5SAVE_4, H_0, H_1, H_2, H_3, H_4) REDUCE(H_0, H_1, H_2, H_3, H_4) VLEIG $0, $5, T_0 VLEIG $1, $5, T_0 VMLOF T_0, H_1, R5_1 VMLOF T_0, H_2, R5_2 VMLOF T_0, H_3, R5_3 VMLOF T_0, H_4, R5_4 VLR H_0, R_0 VLR H_1, R_1 VLR H_2, R_2 VLR H_3, R_3 VLR H_4, R_4 // initialize h VZERO H_0 VZERO H_1 VZERO H_2 VZERO H_3 VZERO H_4 loop: CMPBLE R3, $32, b2 VLM (R2), T_0, T_1 SUB $32, R3 MOVD $32(R2), R2 EXPAND(T_0, T_1, F_0, F_1, F_2, F_3, F_4) VLEIB $4, $1, F_4 VLEIB $12, $1, F_4 multiply: VAG H_0, F_0, F_0 VAG H_1, F_1, F_1 VAG H_2, F_2, F_2 VAG H_3, F_3, F_3 VAG H_4, F_4, F_4 MULTIPLY(F_0, F_1, F_2, F_3, F_4, R_0, R_1, R_2, R_3, R_4, R5_1, R5_2, R5_3, R5_4, H_0, H_1, H_2, H_3, H_4) REDUCE(H_0, H_1, H_2, H_3, H_4) CMPBNE R3, $0, loop finish: // sum vectors VZERO T_0 VSUMQG H_0, T_0, H_0 VSUMQG H_1, T_0, H_1 VSUMQG H_2, T_0, H_2 VSUMQG H_3, T_0, H_3 VSUMQG H_4, T_0, H_4 // h may be >= 2*(2**130-5) so we need to reduce it again REDUCE(H_0, H_1, H_2, H_3, H_4) // carry h1->h4 VESRLG $26, H_1, T_1 VN MOD26, H_1, H_1 VAQ T_1, H_2, H_2 VESRLG $26, H_2, T_2 VN MOD26, H_2, H_2 VAQ T_2, H_3, H_3 VESRLG $26, H_3, T_3 VN MOD26, H_3, H_3 VAQ T_3, H_4, H_4 // h is now < 2*(2**130-5) // pack h into h1 (hi) and h0 (lo) PACK(H_0, H_1, H_2, H_3, H_4) // if h > 2**130-5 then h -= 2**130-5 MOD(H_0, H_1, T_0, T_1, T_2) // h += s MOVD $·bswapMask<>(SB), R5 VL (R5), T_1 VL 16(R4), T_0 VPERM T_0, T_0, T_1, T_0 // reverse bytes (to big) VAQ T_0, H_0, H_0 VPERM H_0, H_0, T_1, H_0 // reverse bytes (to little) VST H_0, (R1) RET b2: CMPBLE R3, $16, b1 // 2 blocks remaining SUB $17, R3 VL (R2), T_0 VLL R3, 16(R2), T_1 ADD $1, R3 MOVBZ $1, R0 CMPBEQ R3, $16, 2(PC) VLVGB R3, R0, T_1 EXPAND(T_0, T_1, F_0, F_1, F_2, F_3, F_4) CMPBNE R3, $16, 2(PC) VLEIB $12, $1, F_4 VLEIB $4, $1, F_4 // setup [r²,r] VLVGG $1, RSAVE_0, R_0 VLVGG $1, RSAVE_1, R_1 VLVGG $1, RSAVE_2, R_2 VLVGG $1, RSAVE_3, R_3 VLVGG $1, RSAVE_4, R_4 VPDI $0, R5_1, R5SAVE_1, R5_1 VPDI $0, R5_2, R5SAVE_2, R5_2 VPDI $0, R5_3, R5SAVE_3, R5_3 VPDI $0, R5_4, R5SAVE_4, R5_4 MOVD $0, R3 BR multiply skip: VZERO H_0 VZERO H_1 VZERO H_2 VZERO H_3 VZERO H_4 CMPBEQ R3, $0, finish b1: // 1 block remaining SUB $1, R3 VLL R3, (R2), T_0 ADD $1, R3 MOVBZ $1, R0 CMPBEQ R3, $16, 2(PC) VLVGB R3, R0, T_0 VZERO T_1 EXPAND(T_0, T_1, F_0, F_1, F_2, F_3, F_4) CMPBNE R3, $16, 2(PC) VLEIB $4, $1, F_4 VLEIG $1, $1, R_0 VZERO R_1 VZERO R_2 VZERO R_3 VZERO R_4 VZERO R5_1 VZERO R5_2 VZERO R5_3 VZERO R5_4 // setup [r, 1] VLVGG $0, RSAVE_0, R_0 VLVGG $0, RSAVE_1, R_1 VLVGG $0, RSAVE_2, R_2 VLVGG $0, RSAVE_3, R_3 VLVGG $0, RSAVE_4, R_4 VPDI $0, R5SAVE_1, R5_1, R5_1 VPDI $0, R5SAVE_2, R5_2, R5_2 VPDI $0, R5SAVE_3, R5_3, R5_3 VPDI $0, R5SAVE_4, R5_4, R5_4 MOVD $0, R3 BR multiply ================================================ FILE: vendor/golang.org/x/crypto/poly1305/sum_vmsl_s390x.s ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build s390x,go1.11,!gccgo,!appengine #include "textflag.h" // Implementation of Poly1305 using the vector facility (vx) and the VMSL instruction. // constants #define EX0 V1 #define EX1 V2 #define EX2 V3 // temporaries #define T_0 V4 #define T_1 V5 #define T_2 V6 #define T_3 V7 #define T_4 V8 #define T_5 V9 #define T_6 V10 #define T_7 V11 #define T_8 V12 #define T_9 V13 #define T_10 V14 // r**2 & r**4 #define R_0 V15 #define R_1 V16 #define R_2 V17 #define R5_1 V18 #define R5_2 V19 // key (r) #define RSAVE_0 R7 #define RSAVE_1 R8 #define RSAVE_2 R9 #define R5SAVE_1 R10 #define R5SAVE_2 R11 // message block #define M0 V20 #define M1 V21 #define M2 V22 #define M3 V23 #define M4 V24 #define M5 V25 // accumulator #define H0_0 V26 #define H1_0 V27 #define H2_0 V28 #define H0_1 V29 #define H1_1 V30 #define H2_1 V31 GLOBL ·keyMask<>(SB), RODATA, $16 DATA ·keyMask<>+0(SB)/8, $0xffffff0ffcffff0f DATA ·keyMask<>+8(SB)/8, $0xfcffff0ffcffff0f GLOBL ·bswapMask<>(SB), RODATA, $16 DATA ·bswapMask<>+0(SB)/8, $0x0f0e0d0c0b0a0908 DATA ·bswapMask<>+8(SB)/8, $0x0706050403020100 GLOBL ·constants<>(SB), RODATA, $48 // EX0 DATA ·constants<>+0(SB)/8, $0x18191a1b1c1d1e1f DATA ·constants<>+8(SB)/8, $0x0000050403020100 // EX1 DATA ·constants<>+16(SB)/8, $0x18191a1b1c1d1e1f DATA ·constants<>+24(SB)/8, $0x00000a0908070605 // EX2 DATA ·constants<>+32(SB)/8, $0x18191a1b1c1d1e1f DATA ·constants<>+40(SB)/8, $0x0000000f0e0d0c0b GLOBL ·c<>(SB), RODATA, $48 // EX0 DATA ·c<>+0(SB)/8, $0x0000050403020100 DATA ·c<>+8(SB)/8, $0x0000151413121110 // EX1 DATA ·c<>+16(SB)/8, $0x00000a0908070605 DATA ·c<>+24(SB)/8, $0x00001a1918171615 // EX2 DATA ·c<>+32(SB)/8, $0x0000000f0e0d0c0b DATA ·c<>+40(SB)/8, $0x0000001f1e1d1c1b GLOBL ·reduce<>(SB), RODATA, $32 // 44 bit DATA ·reduce<>+0(SB)/8, $0x0 DATA ·reduce<>+8(SB)/8, $0xfffffffffff // 42 bit DATA ·reduce<>+16(SB)/8, $0x0 DATA ·reduce<>+24(SB)/8, $0x3ffffffffff // h = (f*g) % (2**130-5) [partial reduction] // uses T_0...T_9 temporary registers // input: m02_0, m02_1, m02_2, m13_0, m13_1, m13_2, r_0, r_1, r_2, r5_1, r5_2, m4_0, m4_1, m4_2, m5_0, m5_1, m5_2 // temp: t0, t1, t2, t3, t4, t5, t6, t7, t8, t9 // output: m02_0, m02_1, m02_2, m13_0, m13_1, m13_2 #define MULTIPLY(m02_0, m02_1, m02_2, m13_0, m13_1, m13_2, r_0, r_1, r_2, r5_1, r5_2, m4_0, m4_1, m4_2, m5_0, m5_1, m5_2, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) \ \ // Eliminate the dependency for the last 2 VMSLs VMSLG m02_0, r_2, m4_2, m4_2 \ VMSLG m13_0, r_2, m5_2, m5_2 \ // 8 VMSLs pipelined VMSLG m02_0, r_0, m4_0, m4_0 \ VMSLG m02_1, r5_2, V0, T_0 \ VMSLG m02_0, r_1, m4_1, m4_1 \ VMSLG m02_1, r_0, V0, T_1 \ VMSLG m02_1, r_1, V0, T_2 \ VMSLG m02_2, r5_1, V0, T_3 \ VMSLG m02_2, r5_2, V0, T_4 \ VMSLG m13_0, r_0, m5_0, m5_0 \ VMSLG m13_1, r5_2, V0, T_5 \ VMSLG m13_0, r_1, m5_1, m5_1 \ VMSLG m13_1, r_0, V0, T_6 \ VMSLG m13_1, r_1, V0, T_7 \ VMSLG m13_2, r5_1, V0, T_8 \ VMSLG m13_2, r5_2, V0, T_9 \ VMSLG m02_2, r_0, m4_2, m4_2 \ VMSLG m13_2, r_0, m5_2, m5_2 \ VAQ m4_0, T_0, m02_0 \ VAQ m4_1, T_1, m02_1 \ VAQ m5_0, T_5, m13_0 \ VAQ m5_1, T_6, m13_1 \ VAQ m02_0, T_3, m02_0 \ VAQ m02_1, T_4, m02_1 \ VAQ m13_0, T_8, m13_0 \ VAQ m13_1, T_9, m13_1 \ VAQ m4_2, T_2, m02_2 \ VAQ m5_2, T_7, m13_2 \ // SQUARE uses three limbs of r and r_2*5 to output square of r // uses T_1, T_5 and T_7 temporary registers // input: r_0, r_1, r_2, r5_2 // temp: TEMP0, TEMP1, TEMP2 // output: p0, p1, p2 #define SQUARE(r_0, r_1, r_2, r5_2, p0, p1, p2, TEMP0, TEMP1, TEMP2) \ VMSLG r_0, r_0, p0, p0 \ VMSLG r_1, r5_2, V0, TEMP0 \ VMSLG r_2, r5_2, p1, p1 \ VMSLG r_0, r_1, V0, TEMP1 \ VMSLG r_1, r_1, p2, p2 \ VMSLG r_0, r_2, V0, TEMP2 \ VAQ TEMP0, p0, p0 \ VAQ TEMP1, p1, p1 \ VAQ TEMP2, p2, p2 \ VAQ TEMP0, p0, p0 \ VAQ TEMP1, p1, p1 \ VAQ TEMP2, p2, p2 \ // carry h0->h1->h2->h0 || h3->h4->h5->h3 // uses T_2, T_4, T_5, T_7, T_8, T_9 // t6, t7, t8, t9, t10, t11 // input: h0, h1, h2, h3, h4, h5 // temp: t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11 // output: h0, h1, h2, h3, h4, h5 #define REDUCE(h0, h1, h2, h3, h4, h5, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) \ VLM (R12), t6, t7 \ // 44 and 42 bit clear mask VLEIB $7, $0x28, t10 \ // 5 byte shift mask VREPIB $4, t8 \ // 4 bit shift mask VREPIB $2, t11 \ // 2 bit shift mask VSRLB t10, h0, t0 \ // h0 byte shift VSRLB t10, h1, t1 \ // h1 byte shift VSRLB t10, h2, t2 \ // h2 byte shift VSRLB t10, h3, t3 \ // h3 byte shift VSRLB t10, h4, t4 \ // h4 byte shift VSRLB t10, h5, t5 \ // h5 byte shift VSRL t8, t0, t0 \ // h0 bit shift VSRL t8, t1, t1 \ // h2 bit shift VSRL t11, t2, t2 \ // h2 bit shift VSRL t8, t3, t3 \ // h3 bit shift VSRL t8, t4, t4 \ // h4 bit shift VESLG $2, t2, t9 \ // h2 carry x5 VSRL t11, t5, t5 \ // h5 bit shift VN t6, h0, h0 \ // h0 clear carry VAQ t2, t9, t2 \ // h2 carry x5 VESLG $2, t5, t9 \ // h5 carry x5 VN t6, h1, h1 \ // h1 clear carry VN t7, h2, h2 \ // h2 clear carry VAQ t5, t9, t5 \ // h5 carry x5 VN t6, h3, h3 \ // h3 clear carry VN t6, h4, h4 \ // h4 clear carry VN t7, h5, h5 \ // h5 clear carry VAQ t0, h1, h1 \ // h0->h1 VAQ t3, h4, h4 \ // h3->h4 VAQ t1, h2, h2 \ // h1->h2 VAQ t4, h5, h5 \ // h4->h5 VAQ t2, h0, h0 \ // h2->h0 VAQ t5, h3, h3 \ // h5->h3 VREPG $1, t6, t6 \ // 44 and 42 bit masks across both halves VREPG $1, t7, t7 \ VSLDB $8, h0, h0, h0 \ // set up [h0/1/2, h3/4/5] VSLDB $8, h1, h1, h1 \ VSLDB $8, h2, h2, h2 \ VO h0, h3, h3 \ VO h1, h4, h4 \ VO h2, h5, h5 \ VESRLG $44, h3, t0 \ // 44 bit shift right VESRLG $44, h4, t1 \ VESRLG $42, h5, t2 \ VN t6, h3, h3 \ // clear carry bits VN t6, h4, h4 \ VN t7, h5, h5 \ VESLG $2, t2, t9 \ // multiply carry by 5 VAQ t9, t2, t2 \ VAQ t0, h4, h4 \ VAQ t1, h5, h5 \ VAQ t2, h3, h3 \ // carry h0->h1->h2->h0 // input: h0, h1, h2 // temp: t0, t1, t2, t3, t4, t5, t6, t7, t8 // output: h0, h1, h2 #define REDUCE2(h0, h1, h2, t0, t1, t2, t3, t4, t5, t6, t7, t8) \ VLEIB $7, $0x28, t3 \ // 5 byte shift mask VREPIB $4, t4 \ // 4 bit shift mask VREPIB $2, t7 \ // 2 bit shift mask VGBM $0x003F, t5 \ // mask to clear carry bits VSRLB t3, h0, t0 \ VSRLB t3, h1, t1 \ VSRLB t3, h2, t2 \ VESRLG $4, t5, t5 \ // 44 bit clear mask VSRL t4, t0, t0 \ VSRL t4, t1, t1 \ VSRL t7, t2, t2 \ VESRLG $2, t5, t6 \ // 42 bit clear mask VESLG $2, t2, t8 \ VAQ t8, t2, t2 \ VN t5, h0, h0 \ VN t5, h1, h1 \ VN t6, h2, h2 \ VAQ t0, h1, h1 \ VAQ t1, h2, h2 \ VAQ t2, h0, h0 \ VSRLB t3, h0, t0 \ VSRLB t3, h1, t1 \ VSRLB t3, h2, t2 \ VSRL t4, t0, t0 \ VSRL t4, t1, t1 \ VSRL t7, t2, t2 \ VN t5, h0, h0 \ VN t5, h1, h1 \ VESLG $2, t2, t8 \ VN t6, h2, h2 \ VAQ t0, h1, h1 \ VAQ t8, t2, t2 \ VAQ t1, h2, h2 \ VAQ t2, h0, h0 \ // expands two message blocks into the lower halfs of the d registers // moves the contents of the d registers into upper halfs // input: in1, in2, d0, d1, d2, d3, d4, d5 // temp: TEMP0, TEMP1, TEMP2, TEMP3 // output: d0, d1, d2, d3, d4, d5 #define EXPACC(in1, in2, d0, d1, d2, d3, d4, d5, TEMP0, TEMP1, TEMP2, TEMP3) \ VGBM $0xff3f, TEMP0 \ VGBM $0xff1f, TEMP1 \ VESLG $4, d1, TEMP2 \ VESLG $4, d4, TEMP3 \ VESRLG $4, TEMP0, TEMP0 \ VPERM in1, d0, EX0, d0 \ VPERM in2, d3, EX0, d3 \ VPERM in1, d2, EX2, d2 \ VPERM in2, d5, EX2, d5 \ VPERM in1, TEMP2, EX1, d1 \ VPERM in2, TEMP3, EX1, d4 \ VN TEMP0, d0, d0 \ VN TEMP0, d3, d3 \ VESRLG $4, d1, d1 \ VESRLG $4, d4, d4 \ VN TEMP1, d2, d2 \ VN TEMP1, d5, d5 \ VN TEMP0, d1, d1 \ VN TEMP0, d4, d4 \ // expands one message block into the lower halfs of the d registers // moves the contents of the d registers into upper halfs // input: in, d0, d1, d2 // temp: TEMP0, TEMP1, TEMP2 // output: d0, d1, d2 #define EXPACC2(in, d0, d1, d2, TEMP0, TEMP1, TEMP2) \ VGBM $0xff3f, TEMP0 \ VESLG $4, d1, TEMP2 \ VGBM $0xff1f, TEMP1 \ VPERM in, d0, EX0, d0 \ VESRLG $4, TEMP0, TEMP0 \ VPERM in, d2, EX2, d2 \ VPERM in, TEMP2, EX1, d1 \ VN TEMP0, d0, d0 \ VN TEMP1, d2, d2 \ VESRLG $4, d1, d1 \ VN TEMP0, d1, d1 \ // pack h2:h0 into h1:h0 (no carry) // input: h0, h1, h2 // output: h0, h1, h2 #define PACK(h0, h1, h2) \ VMRLG h1, h2, h2 \ // copy h1 to upper half h2 VESLG $44, h1, h1 \ // shift limb 1 44 bits, leaving 20 VO h0, h1, h0 \ // combine h0 with 20 bits from limb 1 VESRLG $20, h2, h1 \ // put top 24 bits of limb 1 into h1 VLEIG $1, $0, h1 \ // clear h2 stuff from lower half of h1 VO h0, h1, h0 \ // h0 now has 88 bits (limb 0 and 1) VLEIG $0, $0, h2 \ // clear upper half of h2 VESRLG $40, h2, h1 \ // h1 now has upper two bits of result VLEIB $7, $88, h1 \ // for byte shift (11 bytes) VSLB h1, h2, h2 \ // shift h2 11 bytes to the left VO h0, h2, h0 \ // combine h0 with 20 bits from limb 1 VLEIG $0, $0, h1 \ // clear upper half of h1 // if h > 2**130-5 then h -= 2**130-5 // input: h0, h1 // temp: t0, t1, t2 // output: h0 #define MOD(h0, h1, t0, t1, t2) \ VZERO t0 \ VLEIG $1, $5, t0 \ VACCQ h0, t0, t1 \ VAQ h0, t0, t0 \ VONE t2 \ VLEIG $1, $-4, t2 \ VAQ t2, t1, t1 \ VACCQ h1, t1, t1 \ VONE t2 \ VAQ t2, t1, t1 \ VN h0, t1, t2 \ VNC t0, t1, t1 \ VO t1, t2, h0 \ // func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]key) TEXT ·poly1305vmsl(SB), $0-32 // This code processes 6 + up to 4 blocks (32 bytes) per iteration // using the algorithm described in: // NEON crypto, Daniel J. Bernstein & Peter Schwabe // https://cryptojedi.org/papers/neoncrypto-20120320.pdf // And as moddified for VMSL as described in // Accelerating Poly1305 Cryptographic Message Authentication on the z14 // O'Farrell et al, CASCON 2017, p48-55 // https://ibm.ent.box.com/s/jf9gedj0e9d2vjctfyh186shaztavnht LMG out+0(FP), R1, R4 // R1=out, R2=m, R3=mlen, R4=key VZERO V0 // c // load EX0, EX1 and EX2 MOVD $·constants<>(SB), R5 VLM (R5), EX0, EX2 // c // setup r VL (R4), T_0 MOVD $·keyMask<>(SB), R6 VL (R6), T_1 VN T_0, T_1, T_0 VZERO T_2 // limbs for r VZERO T_3 VZERO T_4 EXPACC2(T_0, T_2, T_3, T_4, T_1, T_5, T_7) // T_2, T_3, T_4: [0, r] // setup r*20 VLEIG $0, $0, T_0 VLEIG $1, $20, T_0 // T_0: [0, 20] VZERO T_5 VZERO T_6 VMSLG T_0, T_3, T_5, T_5 VMSLG T_0, T_4, T_6, T_6 // store r for final block in GR VLGVG $1, T_2, RSAVE_0 // c VLGVG $1, T_3, RSAVE_1 // c VLGVG $1, T_4, RSAVE_2 // c VLGVG $1, T_5, R5SAVE_1 // c VLGVG $1, T_6, R5SAVE_2 // c // initialize h VZERO H0_0 VZERO H1_0 VZERO H2_0 VZERO H0_1 VZERO H1_1 VZERO H2_1 // initialize pointer for reduce constants MOVD $·reduce<>(SB), R12 // calculate r**2 and 20*(r**2) VZERO R_0 VZERO R_1 VZERO R_2 SQUARE(T_2, T_3, T_4, T_6, R_0, R_1, R_2, T_1, T_5, T_7) REDUCE2(R_0, R_1, R_2, M0, M1, M2, M3, M4, R5_1, R5_2, M5, T_1) VZERO R5_1 VZERO R5_2 VMSLG T_0, R_1, R5_1, R5_1 VMSLG T_0, R_2, R5_2, R5_2 // skip r**4 calculation if 3 blocks or less CMPBLE R3, $48, b4 // calculate r**4 and 20*(r**4) VZERO T_8 VZERO T_9 VZERO T_10 SQUARE(R_0, R_1, R_2, R5_2, T_8, T_9, T_10, T_1, T_5, T_7) REDUCE2(T_8, T_9, T_10, M0, M1, M2, M3, M4, T_2, T_3, M5, T_1) VZERO T_2 VZERO T_3 VMSLG T_0, T_9, T_2, T_2 VMSLG T_0, T_10, T_3, T_3 // put r**2 to the right and r**4 to the left of R_0, R_1, R_2 VSLDB $8, T_8, T_8, T_8 VSLDB $8, T_9, T_9, T_9 VSLDB $8, T_10, T_10, T_10 VSLDB $8, T_2, T_2, T_2 VSLDB $8, T_3, T_3, T_3 VO T_8, R_0, R_0 VO T_9, R_1, R_1 VO T_10, R_2, R_2 VO T_2, R5_1, R5_1 VO T_3, R5_2, R5_2 CMPBLE R3, $80, load // less than or equal to 5 blocks in message // 6(or 5+1) blocks SUB $81, R3 VLM (R2), M0, M4 VLL R3, 80(R2), M5 ADD $1, R3 MOVBZ $1, R0 CMPBGE R3, $16, 2(PC) VLVGB R3, R0, M5 MOVD $96(R2), R2 EXPACC(M0, M1, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) EXPACC(M2, M3, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) VLEIB $2, $1, H2_0 VLEIB $2, $1, H2_1 VLEIB $10, $1, H2_0 VLEIB $10, $1, H2_1 VZERO M0 VZERO M1 VZERO M2 VZERO M3 VZERO T_4 VZERO T_10 EXPACC(M4, M5, M0, M1, M2, M3, T_4, T_10, T_0, T_1, T_2, T_3) VLR T_4, M4 VLEIB $10, $1, M2 CMPBLT R3, $16, 2(PC) VLEIB $10, $1, T_10 MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M2, M3, M4, T_4, T_5, T_2, T_7, T_8, T_9) VMRHG V0, H0_1, H0_0 VMRHG V0, H1_1, H1_0 VMRHG V0, H2_1, H2_0 VMRLG V0, H0_1, H0_1 VMRLG V0, H1_1, H1_1 VMRLG V0, H2_1, H2_1 SUB $16, R3 CMPBLE R3, $0, square load: // load EX0, EX1 and EX2 MOVD $·c<>(SB), R5 VLM (R5), EX0, EX2 loop: CMPBLE R3, $64, add // b4 // last 4 or less blocks left // next 4 full blocks VLM (R2), M2, M5 SUB $64, R3 MOVD $64(R2), R2 REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, T_0, T_1, T_3, T_4, T_5, T_2, T_7, T_8, T_9) // expacc in-lined to create [m2, m3] limbs VGBM $0x3f3f, T_0 // 44 bit clear mask VGBM $0x1f1f, T_1 // 40 bit clear mask VPERM M2, M3, EX0, T_3 VESRLG $4, T_0, T_0 // 44 bit clear mask ready VPERM M2, M3, EX1, T_4 VPERM M2, M3, EX2, T_5 VN T_0, T_3, T_3 VESRLG $4, T_4, T_4 VN T_1, T_5, T_5 VN T_0, T_4, T_4 VMRHG H0_1, T_3, H0_0 VMRHG H1_1, T_4, H1_0 VMRHG H2_1, T_5, H2_0 VMRLG H0_1, T_3, H0_1 VMRLG H1_1, T_4, H1_1 VMRLG H2_1, T_5, H2_1 VLEIB $10, $1, H2_0 VLEIB $10, $1, H2_1 VPERM M4, M5, EX0, T_3 VPERM M4, M5, EX1, T_4 VPERM M4, M5, EX2, T_5 VN T_0, T_3, T_3 VESRLG $4, T_4, T_4 VN T_1, T_5, T_5 VN T_0, T_4, T_4 VMRHG V0, T_3, M0 VMRHG V0, T_4, M1 VMRHG V0, T_5, M2 VMRLG V0, T_3, M3 VMRLG V0, T_4, M4 VMRLG V0, T_5, M5 VLEIB $10, $1, M2 VLEIB $10, $1, M5 MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) CMPBNE R3, $0, loop REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) VMRHG V0, H0_1, H0_0 VMRHG V0, H1_1, H1_0 VMRHG V0, H2_1, H2_0 VMRLG V0, H0_1, H0_1 VMRLG V0, H1_1, H1_1 VMRLG V0, H2_1, H2_1 // load EX0, EX1, EX2 MOVD $·constants<>(SB), R5 VLM (R5), EX0, EX2 // sum vectors VAQ H0_0, H0_1, H0_0 VAQ H1_0, H1_1, H1_0 VAQ H2_0, H2_1, H2_0 // h may be >= 2*(2**130-5) so we need to reduce it again // M0...M4 are used as temps here REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) next: // carry h1->h2 VLEIB $7, $0x28, T_1 VREPIB $4, T_2 VGBM $0x003F, T_3 VESRLG $4, T_3 // byte shift VSRLB T_1, H1_0, T_4 // bit shift VSRL T_2, T_4, T_4 // clear h1 carry bits VN T_3, H1_0, H1_0 // add carry VAQ T_4, H2_0, H2_0 // h is now < 2*(2**130-5) // pack h into h1 (hi) and h0 (lo) PACK(H0_0, H1_0, H2_0) // if h > 2**130-5 then h -= 2**130-5 MOD(H0_0, H1_0, T_0, T_1, T_2) // h += s MOVD $·bswapMask<>(SB), R5 VL (R5), T_1 VL 16(R4), T_0 VPERM T_0, T_0, T_1, T_0 // reverse bytes (to big) VAQ T_0, H0_0, H0_0 VPERM H0_0, H0_0, T_1, H0_0 // reverse bytes (to little) VST H0_0, (R1) RET add: // load EX0, EX1, EX2 MOVD $·constants<>(SB), R5 VLM (R5), EX0, EX2 REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) VMRHG V0, H0_1, H0_0 VMRHG V0, H1_1, H1_0 VMRHG V0, H2_1, H2_0 VMRLG V0, H0_1, H0_1 VMRLG V0, H1_1, H1_1 VMRLG V0, H2_1, H2_1 CMPBLE R3, $64, b4 b4: CMPBLE R3, $48, b3 // 3 blocks or less // 4(3+1) blocks remaining SUB $49, R3 VLM (R2), M0, M2 VLL R3, 48(R2), M3 ADD $1, R3 MOVBZ $1, R0 CMPBEQ R3, $16, 2(PC) VLVGB R3, R0, M3 MOVD $64(R2), R2 EXPACC(M0, M1, H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_0, T_1, T_2, T_3) VLEIB $10, $1, H2_0 VLEIB $10, $1, H2_1 VZERO M0 VZERO M1 VZERO M4 VZERO M5 VZERO T_4 VZERO T_10 EXPACC(M2, M3, M0, M1, M4, M5, T_4, T_10, T_0, T_1, T_2, T_3) VLR T_4, M2 VLEIB $10, $1, M4 CMPBNE R3, $16, 2(PC) VLEIB $10, $1, T_10 MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M4, M5, M2, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M3, M4, M5, T_4, T_5, T_2, T_7, T_8, T_9) VMRHG V0, H0_1, H0_0 VMRHG V0, H1_1, H1_0 VMRHG V0, H2_1, H2_0 VMRLG V0, H0_1, H0_1 VMRLG V0, H1_1, H1_1 VMRLG V0, H2_1, H2_1 SUB $16, R3 CMPBLE R3, $0, square // this condition must always hold true! b3: CMPBLE R3, $32, b2 // 3 blocks remaining // setup [r²,r] VSLDB $8, R_0, R_0, R_0 VSLDB $8, R_1, R_1, R_1 VSLDB $8, R_2, R_2, R_2 VSLDB $8, R5_1, R5_1, R5_1 VSLDB $8, R5_2, R5_2, R5_2 VLVGG $1, RSAVE_0, R_0 VLVGG $1, RSAVE_1, R_1 VLVGG $1, RSAVE_2, R_2 VLVGG $1, R5SAVE_1, R5_1 VLVGG $1, R5SAVE_2, R5_2 // setup [h0, h1] VSLDB $8, H0_0, H0_0, H0_0 VSLDB $8, H1_0, H1_0, H1_0 VSLDB $8, H2_0, H2_0, H2_0 VO H0_1, H0_0, H0_0 VO H1_1, H1_0, H1_0 VO H2_1, H2_0, H2_0 VZERO H0_1 VZERO H1_1 VZERO H2_1 VZERO M0 VZERO M1 VZERO M2 VZERO M3 VZERO M4 VZERO M5 // H*[r**2, r] MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, H0_1, H1_1, T_10, M5) SUB $33, R3 VLM (R2), M0, M1 VLL R3, 32(R2), M2 ADD $1, R3 MOVBZ $1, R0 CMPBEQ R3, $16, 2(PC) VLVGB R3, R0, M2 // H += m0 VZERO T_1 VZERO T_2 VZERO T_3 EXPACC2(M0, T_1, T_2, T_3, T_4, T_5, T_6) VLEIB $10, $1, T_3 VAG H0_0, T_1, H0_0 VAG H1_0, T_2, H1_0 VAG H2_0, T_3, H2_0 VZERO M0 VZERO M3 VZERO M4 VZERO M5 VZERO T_10 // (H+m0)*r MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M3, M4, M5, V0, T_10, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE2(H0_0, H1_0, H2_0, M0, M3, M4, M5, T_10, H0_1, H1_1, H2_1, T_9) // H += m1 VZERO V0 VZERO T_1 VZERO T_2 VZERO T_3 EXPACC2(M1, T_1, T_2, T_3, T_4, T_5, T_6) VLEIB $10, $1, T_3 VAQ H0_0, T_1, H0_0 VAQ H1_0, T_2, H1_0 VAQ H2_0, T_3, H2_0 REDUCE2(H0_0, H1_0, H2_0, M0, M3, M4, M5, T_9, H0_1, H1_1, H2_1, T_10) // [H, m2] * [r**2, r] EXPACC2(M2, H0_0, H1_0, H2_0, T_1, T_2, T_3) CMPBNE R3, $16, 2(PC) VLEIB $10, $1, H2_0 VZERO M0 VZERO M1 VZERO M2 VZERO M3 VZERO M4 VZERO M5 MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, H0_1, H1_1, M5, T_10) SUB $16, R3 CMPBLE R3, $0, next // this condition must always hold true! b2: CMPBLE R3, $16, b1 // 2 blocks remaining // setup [r²,r] VSLDB $8, R_0, R_0, R_0 VSLDB $8, R_1, R_1, R_1 VSLDB $8, R_2, R_2, R_2 VSLDB $8, R5_1, R5_1, R5_1 VSLDB $8, R5_2, R5_2, R5_2 VLVGG $1, RSAVE_0, R_0 VLVGG $1, RSAVE_1, R_1 VLVGG $1, RSAVE_2, R_2 VLVGG $1, R5SAVE_1, R5_1 VLVGG $1, R5SAVE_2, R5_2 // setup [h0, h1] VSLDB $8, H0_0, H0_0, H0_0 VSLDB $8, H1_0, H1_0, H1_0 VSLDB $8, H2_0, H2_0, H2_0 VO H0_1, H0_0, H0_0 VO H1_1, H1_0, H1_0 VO H2_1, H2_0, H2_0 VZERO H0_1 VZERO H1_1 VZERO H2_1 VZERO M0 VZERO M1 VZERO M2 VZERO M3 VZERO M4 VZERO M5 // H*[r**2, r] MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, T_10, M0, M1, M2, M3, M4, T_4, T_5, T_2, T_7, T_8, T_9) VMRHG V0, H0_1, H0_0 VMRHG V0, H1_1, H1_0 VMRHG V0, H2_1, H2_0 VMRLG V0, H0_1, H0_1 VMRLG V0, H1_1, H1_1 VMRLG V0, H2_1, H2_1 // move h to the left and 0s at the right VSLDB $8, H0_0, H0_0, H0_0 VSLDB $8, H1_0, H1_0, H1_0 VSLDB $8, H2_0, H2_0, H2_0 // get message blocks and append 1 to start SUB $17, R3 VL (R2), M0 VLL R3, 16(R2), M1 ADD $1, R3 MOVBZ $1, R0 CMPBEQ R3, $16, 2(PC) VLVGB R3, R0, M1 VZERO T_6 VZERO T_7 VZERO T_8 EXPACC2(M0, T_6, T_7, T_8, T_1, T_2, T_3) EXPACC2(M1, T_6, T_7, T_8, T_1, T_2, T_3) VLEIB $2, $1, T_8 CMPBNE R3, $16, 2(PC) VLEIB $10, $1, T_8 // add [m0, m1] to h VAG H0_0, T_6, H0_0 VAG H1_0, T_7, H1_0 VAG H2_0, T_8, H2_0 VZERO M2 VZERO M3 VZERO M4 VZERO M5 VZERO T_10 VZERO M0 // at this point R_0 .. R5_2 look like [r**2, r] MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M2, M3, M4, M5, T_10, M0, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE2(H0_0, H1_0, H2_0, M2, M3, M4, M5, T_9, H0_1, H1_1, H2_1, T_10) SUB $16, R3, R3 CMPBLE R3, $0, next b1: CMPBLE R3, $0, next // 1 block remaining // setup [r²,r] VSLDB $8, R_0, R_0, R_0 VSLDB $8, R_1, R_1, R_1 VSLDB $8, R_2, R_2, R_2 VSLDB $8, R5_1, R5_1, R5_1 VSLDB $8, R5_2, R5_2, R5_2 VLVGG $1, RSAVE_0, R_0 VLVGG $1, RSAVE_1, R_1 VLVGG $1, RSAVE_2, R_2 VLVGG $1, R5SAVE_1, R5_1 VLVGG $1, R5SAVE_2, R5_2 // setup [h0, h1] VSLDB $8, H0_0, H0_0, H0_0 VSLDB $8, H1_0, H1_0, H1_0 VSLDB $8, H2_0, H2_0, H2_0 VO H0_1, H0_0, H0_0 VO H1_1, H1_0, H1_0 VO H2_1, H2_0, H2_0 VZERO H0_1 VZERO H1_1 VZERO H2_1 VZERO M0 VZERO M1 VZERO M2 VZERO M3 VZERO M4 VZERO M5 // H*[r**2, r] MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) // set up [0, m0] limbs SUB $1, R3 VLL R3, (R2), M0 ADD $1, R3 MOVBZ $1, R0 CMPBEQ R3, $16, 2(PC) VLVGB R3, R0, M0 VZERO T_1 VZERO T_2 VZERO T_3 EXPACC2(M0, T_1, T_2, T_3, T_4, T_5, T_6)// limbs: [0, m] CMPBNE R3, $16, 2(PC) VLEIB $10, $1, T_3 // h+m0 VAQ H0_0, T_1, H0_0 VAQ H1_0, T_2, H1_0 VAQ H2_0, T_3, H2_0 VZERO M0 VZERO M1 VZERO M2 VZERO M3 VZERO M4 VZERO M5 MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) BR next square: // setup [r²,r] VSLDB $8, R_0, R_0, R_0 VSLDB $8, R_1, R_1, R_1 VSLDB $8, R_2, R_2, R_2 VSLDB $8, R5_1, R5_1, R5_1 VSLDB $8, R5_2, R5_2, R5_2 VLVGG $1, RSAVE_0, R_0 VLVGG $1, RSAVE_1, R_1 VLVGG $1, RSAVE_2, R_2 VLVGG $1, R5SAVE_1, R5_1 VLVGG $1, R5SAVE_2, R5_2 // setup [h0, h1] VSLDB $8, H0_0, H0_0, H0_0 VSLDB $8, H1_0, H1_0, H1_0 VSLDB $8, H2_0, H2_0, H2_0 VO H0_1, H0_0, H0_0 VO H1_1, H1_0, H1_0 VO H2_1, H2_0, H2_0 VZERO H0_1 VZERO H1_1 VZERO H2_1 VZERO M0 VZERO M1 VZERO M2 VZERO M3 VZERO M4 VZERO M5 // (h0*r**2) + (h1*r) MULTIPLY(H0_0, H1_0, H2_0, H0_1, H1_1, H2_1, R_0, R_1, R_2, R5_1, R5_2, M0, M1, M2, M3, M4, M5, T_0, T_1, T_2, T_3, T_4, T_5, T_6, T_7, T_8, T_9) REDUCE2(H0_0, H1_0, H2_0, M0, M1, M2, M3, M4, T_9, T_10, H0_1, M5) BR next ================================================ FILE: vendor/golang.org/x/crypto/ssh/agent/client.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package agent implements the ssh-agent protocol, and provides both // a client and a server. The client can talk to a standard ssh-agent // that uses UNIX sockets, and one could implement an alternative // ssh-agent process using the sample server. // // References: // [PROTOCOL.agent]: https://tools.ietf.org/html/draft-miller-ssh-agent-00 package agent // import "golang.org/x/crypto/ssh/agent" import ( "bytes" "crypto/dsa" "crypto/ecdsa" "crypto/elliptic" "crypto/rsa" "encoding/base64" "encoding/binary" "errors" "fmt" "io" "math/big" "sync" "crypto" "golang.org/x/crypto/ed25519" "golang.org/x/crypto/ssh" ) // SignatureFlags represent additional flags that can be passed to the signature // requests an defined in [PROTOCOL.agent] section 4.5.1. type SignatureFlags uint32 // SignatureFlag values as defined in [PROTOCOL.agent] section 5.3. const ( SignatureFlagReserved SignatureFlags = 1 << iota SignatureFlagRsaSha256 SignatureFlagRsaSha512 ) // Agent represents the capabilities of an ssh-agent. type Agent interface { // List returns the identities known to the agent. List() ([]*Key, error) // Sign has the agent sign the data using a protocol 2 key as defined // in [PROTOCOL.agent] section 2.6.2. Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error) // Add adds a private key to the agent. Add(key AddedKey) error // Remove removes all identities with the given public key. Remove(key ssh.PublicKey) error // RemoveAll removes all identities. RemoveAll() error // Lock locks the agent. Sign and Remove will fail, and List will empty an empty list. Lock(passphrase []byte) error // Unlock undoes the effect of Lock Unlock(passphrase []byte) error // Signers returns signers for all the known keys. Signers() ([]ssh.Signer, error) } type ExtendedAgent interface { Agent // SignWithFlags signs like Sign, but allows for additional flags to be sent/received SignWithFlags(key ssh.PublicKey, data []byte, flags SignatureFlags) (*ssh.Signature, error) // Extension processes a custom extension request. Standard-compliant agents are not // required to support any extensions, but this method allows agents to implement // vendor-specific methods or add experimental features. See [PROTOCOL.agent] section 4.7. // If agent extensions are unsupported entirely this method MUST return an // ErrExtensionUnsupported error. Similarly, if just the specific extensionType in // the request is unsupported by the agent then ErrExtensionUnsupported MUST be // returned. // // In the case of success, since [PROTOCOL.agent] section 4.7 specifies that the contents // of the response are unspecified (including the type of the message), the complete // response will be returned as a []byte slice, including the "type" byte of the message. Extension(extensionType string, contents []byte) ([]byte, error) } // ConstraintExtension describes an optional constraint defined by users. type ConstraintExtension struct { // ExtensionName consist of a UTF-8 string suffixed by the // implementation domain following the naming scheme defined // in Section 4.2 of [RFC4251], e.g. "foo@example.com". ExtensionName string // ExtensionDetails contains the actual content of the extended // constraint. ExtensionDetails []byte } // AddedKey describes an SSH key to be added to an Agent. type AddedKey struct { // PrivateKey must be a *rsa.PrivateKey, *dsa.PrivateKey or // *ecdsa.PrivateKey, which will be inserted into the agent. PrivateKey interface{} // Certificate, if not nil, is communicated to the agent and will be // stored with the key. Certificate *ssh.Certificate // Comment is an optional, free-form string. Comment string // LifetimeSecs, if not zero, is the number of seconds that the // agent will store the key for. LifetimeSecs uint32 // ConfirmBeforeUse, if true, requests that the agent confirm with the // user before each use of this key. ConfirmBeforeUse bool // ConstraintExtensions are the experimental or private-use constraints // defined by users. ConstraintExtensions []ConstraintExtension } // See [PROTOCOL.agent], section 3. const ( agentRequestV1Identities = 1 agentRemoveAllV1Identities = 9 // 3.2 Requests from client to agent for protocol 2 key operations agentAddIdentity = 17 agentRemoveIdentity = 18 agentRemoveAllIdentities = 19 agentAddIDConstrained = 25 // 3.3 Key-type independent requests from client to agent agentAddSmartcardKey = 20 agentRemoveSmartcardKey = 21 agentLock = 22 agentUnlock = 23 agentAddSmartcardKeyConstrained = 26 // 3.7 Key constraint identifiers agentConstrainLifetime = 1 agentConstrainConfirm = 2 agentConstrainExtension = 3 ) // maxAgentResponseBytes is the maximum agent reply size that is accepted. This // is a sanity check, not a limit in the spec. const maxAgentResponseBytes = 16 << 20 // Agent messages: // These structures mirror the wire format of the corresponding ssh agent // messages found in [PROTOCOL.agent]. // 3.4 Generic replies from agent to client const agentFailure = 5 type failureAgentMsg struct{} const agentSuccess = 6 type successAgentMsg struct{} // See [PROTOCOL.agent], section 2.5.2. const agentRequestIdentities = 11 type requestIdentitiesAgentMsg struct{} // See [PROTOCOL.agent], section 2.5.2. const agentIdentitiesAnswer = 12 type identitiesAnswerAgentMsg struct { NumKeys uint32 `sshtype:"12"` Keys []byte `ssh:"rest"` } // See [PROTOCOL.agent], section 2.6.2. const agentSignRequest = 13 type signRequestAgentMsg struct { KeyBlob []byte `sshtype:"13"` Data []byte Flags uint32 } // See [PROTOCOL.agent], section 2.6.2. // 3.6 Replies from agent to client for protocol 2 key operations const agentSignResponse = 14 type signResponseAgentMsg struct { SigBlob []byte `sshtype:"14"` } type publicKey struct { Format string Rest []byte `ssh:"rest"` } // 3.7 Key constraint identifiers type constrainLifetimeAgentMsg struct { LifetimeSecs uint32 `sshtype:"1"` } type constrainExtensionAgentMsg struct { ExtensionName string `sshtype:"3"` ExtensionDetails []byte // Rest is a field used for parsing, not part of message Rest []byte `ssh:"rest"` } // See [PROTOCOL.agent], section 4.7 const agentExtension = 27 const agentExtensionFailure = 28 // ErrExtensionUnsupported indicates that an extension defined in // [PROTOCOL.agent] section 4.7 is unsupported by the agent. Specifically this // error indicates that the agent returned a standard SSH_AGENT_FAILURE message // as the result of a SSH_AGENTC_EXTENSION request. Note that the protocol // specification (and therefore this error) does not distinguish between a // specific extension being unsupported and extensions being unsupported entirely. var ErrExtensionUnsupported = errors.New("agent: extension unsupported") type extensionAgentMsg struct { ExtensionType string `sshtype:"27"` Contents []byte } // Key represents a protocol 2 public key as defined in // [PROTOCOL.agent], section 2.5.2. type Key struct { Format string Blob []byte Comment string } func clientErr(err error) error { return fmt.Errorf("agent: client error: %v", err) } // String returns the storage form of an agent key with the format, base64 // encoded serialized key, and the comment if it is not empty. func (k *Key) String() string { s := string(k.Format) + " " + base64.StdEncoding.EncodeToString(k.Blob) if k.Comment != "" { s += " " + k.Comment } return s } // Type returns the public key type. func (k *Key) Type() string { return k.Format } // Marshal returns key blob to satisfy the ssh.PublicKey interface. func (k *Key) Marshal() []byte { return k.Blob } // Verify satisfies the ssh.PublicKey interface. func (k *Key) Verify(data []byte, sig *ssh.Signature) error { pubKey, err := ssh.ParsePublicKey(k.Blob) if err != nil { return fmt.Errorf("agent: bad public key: %v", err) } return pubKey.Verify(data, sig) } type wireKey struct { Format string Rest []byte `ssh:"rest"` } func parseKey(in []byte) (out *Key, rest []byte, err error) { var record struct { Blob []byte Comment string Rest []byte `ssh:"rest"` } if err := ssh.Unmarshal(in, &record); err != nil { return nil, nil, err } var wk wireKey if err := ssh.Unmarshal(record.Blob, &wk); err != nil { return nil, nil, err } return &Key{ Format: wk.Format, Blob: record.Blob, Comment: record.Comment, }, record.Rest, nil } // client is a client for an ssh-agent process. type client struct { // conn is typically a *net.UnixConn conn io.ReadWriter // mu is used to prevent concurrent access to the agent mu sync.Mutex } // NewClient returns an Agent that talks to an ssh-agent process over // the given connection. func NewClient(rw io.ReadWriter) ExtendedAgent { return &client{conn: rw} } // call sends an RPC to the agent. On success, the reply is // unmarshaled into reply and replyType is set to the first byte of // the reply, which contains the type of the message. func (c *client) call(req []byte) (reply interface{}, err error) { buf, err := c.callRaw(req) if err != nil { return nil, err } reply, err = unmarshal(buf) if err != nil { return nil, clientErr(err) } return reply, nil } // callRaw sends an RPC to the agent. On success, the raw // bytes of the response are returned; no unmarshalling is // performed on the response. func (c *client) callRaw(req []byte) (reply []byte, err error) { c.mu.Lock() defer c.mu.Unlock() msg := make([]byte, 4+len(req)) binary.BigEndian.PutUint32(msg, uint32(len(req))) copy(msg[4:], req) if _, err = c.conn.Write(msg); err != nil { return nil, clientErr(err) } var respSizeBuf [4]byte if _, err = io.ReadFull(c.conn, respSizeBuf[:]); err != nil { return nil, clientErr(err) } respSize := binary.BigEndian.Uint32(respSizeBuf[:]) if respSize > maxAgentResponseBytes { return nil, clientErr(errors.New("response too large")) } buf := make([]byte, respSize) if _, err = io.ReadFull(c.conn, buf); err != nil { return nil, clientErr(err) } return buf, nil } func (c *client) simpleCall(req []byte) error { resp, err := c.call(req) if err != nil { return err } if _, ok := resp.(*successAgentMsg); ok { return nil } return errors.New("agent: failure") } func (c *client) RemoveAll() error { return c.simpleCall([]byte{agentRemoveAllIdentities}) } func (c *client) Remove(key ssh.PublicKey) error { req := ssh.Marshal(&agentRemoveIdentityMsg{ KeyBlob: key.Marshal(), }) return c.simpleCall(req) } func (c *client) Lock(passphrase []byte) error { req := ssh.Marshal(&agentLockMsg{ Passphrase: passphrase, }) return c.simpleCall(req) } func (c *client) Unlock(passphrase []byte) error { req := ssh.Marshal(&agentUnlockMsg{ Passphrase: passphrase, }) return c.simpleCall(req) } // List returns the identities known to the agent. func (c *client) List() ([]*Key, error) { // see [PROTOCOL.agent] section 2.5.2. req := []byte{agentRequestIdentities} msg, err := c.call(req) if err != nil { return nil, err } switch msg := msg.(type) { case *identitiesAnswerAgentMsg: if msg.NumKeys > maxAgentResponseBytes/8 { return nil, errors.New("agent: too many keys in agent reply") } keys := make([]*Key, msg.NumKeys) data := msg.Keys for i := uint32(0); i < msg.NumKeys; i++ { var key *Key var err error if key, data, err = parseKey(data); err != nil { return nil, err } keys[i] = key } return keys, nil case *failureAgentMsg: return nil, errors.New("agent: failed to list keys") } panic("unreachable") } // Sign has the agent sign the data using a protocol 2 key as defined // in [PROTOCOL.agent] section 2.6.2. func (c *client) Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error) { return c.SignWithFlags(key, data, 0) } func (c *client) SignWithFlags(key ssh.PublicKey, data []byte, flags SignatureFlags) (*ssh.Signature, error) { req := ssh.Marshal(signRequestAgentMsg{ KeyBlob: key.Marshal(), Data: data, Flags: uint32(flags), }) msg, err := c.call(req) if err != nil { return nil, err } switch msg := msg.(type) { case *signResponseAgentMsg: var sig ssh.Signature if err := ssh.Unmarshal(msg.SigBlob, &sig); err != nil { return nil, err } return &sig, nil case *failureAgentMsg: return nil, errors.New("agent: failed to sign challenge") } panic("unreachable") } // unmarshal parses an agent message in packet, returning the parsed // form and the message type of packet. func unmarshal(packet []byte) (interface{}, error) { if len(packet) < 1 { return nil, errors.New("agent: empty packet") } var msg interface{} switch packet[0] { case agentFailure: return new(failureAgentMsg), nil case agentSuccess: return new(successAgentMsg), nil case agentIdentitiesAnswer: msg = new(identitiesAnswerAgentMsg) case agentSignResponse: msg = new(signResponseAgentMsg) case agentV1IdentitiesAnswer: msg = new(agentV1IdentityMsg) default: return nil, fmt.Errorf("agent: unknown type tag %d", packet[0]) } if err := ssh.Unmarshal(packet, msg); err != nil { return nil, err } return msg, nil } type rsaKeyMsg struct { Type string `sshtype:"17|25"` N *big.Int E *big.Int D *big.Int Iqmp *big.Int // IQMP = Inverse Q Mod P P *big.Int Q *big.Int Comments string Constraints []byte `ssh:"rest"` } type dsaKeyMsg struct { Type string `sshtype:"17|25"` P *big.Int Q *big.Int G *big.Int Y *big.Int X *big.Int Comments string Constraints []byte `ssh:"rest"` } type ecdsaKeyMsg struct { Type string `sshtype:"17|25"` Curve string KeyBytes []byte D *big.Int Comments string Constraints []byte `ssh:"rest"` } type ed25519KeyMsg struct { Type string `sshtype:"17|25"` Pub []byte Priv []byte Comments string Constraints []byte `ssh:"rest"` } // Insert adds a private key to the agent. func (c *client) insertKey(s interface{}, comment string, constraints []byte) error { var req []byte switch k := s.(type) { case *rsa.PrivateKey: if len(k.Primes) != 2 { return fmt.Errorf("agent: unsupported RSA key with %d primes", len(k.Primes)) } k.Precompute() req = ssh.Marshal(rsaKeyMsg{ Type: ssh.KeyAlgoRSA, N: k.N, E: big.NewInt(int64(k.E)), D: k.D, Iqmp: k.Precomputed.Qinv, P: k.Primes[0], Q: k.Primes[1], Comments: comment, Constraints: constraints, }) case *dsa.PrivateKey: req = ssh.Marshal(dsaKeyMsg{ Type: ssh.KeyAlgoDSA, P: k.P, Q: k.Q, G: k.G, Y: k.Y, X: k.X, Comments: comment, Constraints: constraints, }) case *ecdsa.PrivateKey: nistID := fmt.Sprintf("nistp%d", k.Params().BitSize) req = ssh.Marshal(ecdsaKeyMsg{ Type: "ecdsa-sha2-" + nistID, Curve: nistID, KeyBytes: elliptic.Marshal(k.Curve, k.X, k.Y), D: k.D, Comments: comment, Constraints: constraints, }) case *ed25519.PrivateKey: req = ssh.Marshal(ed25519KeyMsg{ Type: ssh.KeyAlgoED25519, Pub: []byte(*k)[32:], Priv: []byte(*k), Comments: comment, Constraints: constraints, }) default: return fmt.Errorf("agent: unsupported key type %T", s) } // if constraints are present then the message type needs to be changed. if len(constraints) != 0 { req[0] = agentAddIDConstrained } resp, err := c.call(req) if err != nil { return err } if _, ok := resp.(*successAgentMsg); ok { return nil } return errors.New("agent: failure") } type rsaCertMsg struct { Type string `sshtype:"17|25"` CertBytes []byte D *big.Int Iqmp *big.Int // IQMP = Inverse Q Mod P P *big.Int Q *big.Int Comments string Constraints []byte `ssh:"rest"` } type dsaCertMsg struct { Type string `sshtype:"17|25"` CertBytes []byte X *big.Int Comments string Constraints []byte `ssh:"rest"` } type ecdsaCertMsg struct { Type string `sshtype:"17|25"` CertBytes []byte D *big.Int Comments string Constraints []byte `ssh:"rest"` } type ed25519CertMsg struct { Type string `sshtype:"17|25"` CertBytes []byte Pub []byte Priv []byte Comments string Constraints []byte `ssh:"rest"` } // Add adds a private key to the agent. If a certificate is given, // that certificate is added instead as public key. func (c *client) Add(key AddedKey) error { var constraints []byte if secs := key.LifetimeSecs; secs != 0 { constraints = append(constraints, ssh.Marshal(constrainLifetimeAgentMsg{secs})...) } if key.ConfirmBeforeUse { constraints = append(constraints, agentConstrainConfirm) } cert := key.Certificate if cert == nil { return c.insertKey(key.PrivateKey, key.Comment, constraints) } return c.insertCert(key.PrivateKey, cert, key.Comment, constraints) } func (c *client) insertCert(s interface{}, cert *ssh.Certificate, comment string, constraints []byte) error { var req []byte switch k := s.(type) { case *rsa.PrivateKey: if len(k.Primes) != 2 { return fmt.Errorf("agent: unsupported RSA key with %d primes", len(k.Primes)) } k.Precompute() req = ssh.Marshal(rsaCertMsg{ Type: cert.Type(), CertBytes: cert.Marshal(), D: k.D, Iqmp: k.Precomputed.Qinv, P: k.Primes[0], Q: k.Primes[1], Comments: comment, Constraints: constraints, }) case *dsa.PrivateKey: req = ssh.Marshal(dsaCertMsg{ Type: cert.Type(), CertBytes: cert.Marshal(), X: k.X, Comments: comment, Constraints: constraints, }) case *ecdsa.PrivateKey: req = ssh.Marshal(ecdsaCertMsg{ Type: cert.Type(), CertBytes: cert.Marshal(), D: k.D, Comments: comment, Constraints: constraints, }) case *ed25519.PrivateKey: req = ssh.Marshal(ed25519CertMsg{ Type: cert.Type(), CertBytes: cert.Marshal(), Pub: []byte(*k)[32:], Priv: []byte(*k), Comments: comment, Constraints: constraints, }) default: return fmt.Errorf("agent: unsupported key type %T", s) } // if constraints are present then the message type needs to be changed. if len(constraints) != 0 { req[0] = agentAddIDConstrained } signer, err := ssh.NewSignerFromKey(s) if err != nil { return err } if bytes.Compare(cert.Key.Marshal(), signer.PublicKey().Marshal()) != 0 { return errors.New("agent: signer and cert have different public key") } resp, err := c.call(req) if err != nil { return err } if _, ok := resp.(*successAgentMsg); ok { return nil } return errors.New("agent: failure") } // Signers provides a callback for client authentication. func (c *client) Signers() ([]ssh.Signer, error) { keys, err := c.List() if err != nil { return nil, err } var result []ssh.Signer for _, k := range keys { result = append(result, &agentKeyringSigner{c, k}) } return result, nil } type agentKeyringSigner struct { agent *client pub ssh.PublicKey } func (s *agentKeyringSigner) PublicKey() ssh.PublicKey { return s.pub } func (s *agentKeyringSigner) Sign(rand io.Reader, data []byte) (*ssh.Signature, error) { // The agent has its own entropy source, so the rand argument is ignored. return s.agent.Sign(s.pub, data) } func (s *agentKeyringSigner) SignWithOpts(rand io.Reader, data []byte, opts crypto.SignerOpts) (*ssh.Signature, error) { var flags SignatureFlags if opts != nil { switch opts.HashFunc() { case crypto.SHA256: flags = SignatureFlagRsaSha256 case crypto.SHA512: flags = SignatureFlagRsaSha512 } } return s.agent.SignWithFlags(s.pub, data, flags) } // Calls an extension method. It is up to the agent implementation as to whether or not // any particular extension is supported and may always return an error. Because the // type of the response is up to the implementation, this returns the bytes of the // response and does not attempt any type of unmarshalling. func (c *client) Extension(extensionType string, contents []byte) ([]byte, error) { req := ssh.Marshal(extensionAgentMsg{ ExtensionType: extensionType, Contents: contents, }) buf, err := c.callRaw(req) if err != nil { return nil, err } if len(buf) == 0 { return nil, errors.New("agent: failure; empty response") } // [PROTOCOL.agent] section 4.7 indicates that an SSH_AGENT_FAILURE message // represents an agent that does not support the extension if buf[0] == agentFailure { return nil, ErrExtensionUnsupported } if buf[0] == agentExtensionFailure { return nil, errors.New("agent: generic extension failure") } return buf, nil } ================================================ FILE: vendor/golang.org/x/crypto/ssh/agent/forward.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package agent import ( "errors" "io" "net" "sync" "golang.org/x/crypto/ssh" ) // RequestAgentForwarding sets up agent forwarding for the session. // ForwardToAgent or ForwardToRemote should be called to route // the authentication requests. func RequestAgentForwarding(session *ssh.Session) error { ok, err := session.SendRequest("auth-agent-req@openssh.com", true, nil) if err != nil { return err } if !ok { return errors.New("forwarding request denied") } return nil } // ForwardToAgent routes authentication requests to the given keyring. func ForwardToAgent(client *ssh.Client, keyring Agent) error { channels := client.HandleChannelOpen(channelType) if channels == nil { return errors.New("agent: already have handler for " + channelType) } go func() { for ch := range channels { channel, reqs, err := ch.Accept() if err != nil { continue } go ssh.DiscardRequests(reqs) go func() { ServeAgent(keyring, channel) channel.Close() }() } }() return nil } const channelType = "auth-agent@openssh.com" // ForwardToRemote routes authentication requests to the ssh-agent // process serving on the given unix socket. func ForwardToRemote(client *ssh.Client, addr string) error { channels := client.HandleChannelOpen(channelType) if channels == nil { return errors.New("agent: already have handler for " + channelType) } conn, err := net.Dial("unix", addr) if err != nil { return err } conn.Close() go func() { for ch := range channels { channel, reqs, err := ch.Accept() if err != nil { continue } go ssh.DiscardRequests(reqs) go forwardUnixSocket(channel, addr) } }() return nil } func forwardUnixSocket(channel ssh.Channel, addr string) { conn, err := net.Dial("unix", addr) if err != nil { return } var wg sync.WaitGroup wg.Add(2) go func() { io.Copy(conn, channel) conn.(*net.UnixConn).CloseWrite() wg.Done() }() go func() { io.Copy(channel, conn) channel.CloseWrite() wg.Done() }() wg.Wait() conn.Close() channel.Close() } ================================================ FILE: vendor/golang.org/x/crypto/ssh/agent/keyring.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package agent import ( "bytes" "crypto/rand" "crypto/subtle" "errors" "fmt" "sync" "time" "golang.org/x/crypto/ssh" ) type privKey struct { signer ssh.Signer comment string expire *time.Time } type keyring struct { mu sync.Mutex keys []privKey locked bool passphrase []byte } var errLocked = errors.New("agent: locked") // NewKeyring returns an Agent that holds keys in memory. It is safe // for concurrent use by multiple goroutines. func NewKeyring() Agent { return &keyring{} } // RemoveAll removes all identities. func (r *keyring) RemoveAll() error { r.mu.Lock() defer r.mu.Unlock() if r.locked { return errLocked } r.keys = nil return nil } // removeLocked does the actual key removal. The caller must already be holding the // keyring mutex. func (r *keyring) removeLocked(want []byte) error { found := false for i := 0; i < len(r.keys); { if bytes.Equal(r.keys[i].signer.PublicKey().Marshal(), want) { found = true r.keys[i] = r.keys[len(r.keys)-1] r.keys = r.keys[:len(r.keys)-1] continue } else { i++ } } if !found { return errors.New("agent: key not found") } return nil } // Remove removes all identities with the given public key. func (r *keyring) Remove(key ssh.PublicKey) error { r.mu.Lock() defer r.mu.Unlock() if r.locked { return errLocked } return r.removeLocked(key.Marshal()) } // Lock locks the agent. Sign and Remove will fail, and List will return an empty list. func (r *keyring) Lock(passphrase []byte) error { r.mu.Lock() defer r.mu.Unlock() if r.locked { return errLocked } r.locked = true r.passphrase = passphrase return nil } // Unlock undoes the effect of Lock func (r *keyring) Unlock(passphrase []byte) error { r.mu.Lock() defer r.mu.Unlock() if !r.locked { return errors.New("agent: not locked") } if 1 != subtle.ConstantTimeCompare(passphrase, r.passphrase) { return fmt.Errorf("agent: incorrect passphrase") } r.locked = false r.passphrase = nil return nil } // expireKeysLocked removes expired keys from the keyring. If a key was added // with a lifetimesecs contraint and seconds >= lifetimesecs seconds have // ellapsed, it is removed. The caller *must* be holding the keyring mutex. func (r *keyring) expireKeysLocked() { for _, k := range r.keys { if k.expire != nil && time.Now().After(*k.expire) { r.removeLocked(k.signer.PublicKey().Marshal()) } } } // List returns the identities known to the agent. func (r *keyring) List() ([]*Key, error) { r.mu.Lock() defer r.mu.Unlock() if r.locked { // section 2.7: locked agents return empty. return nil, nil } r.expireKeysLocked() var ids []*Key for _, k := range r.keys { pub := k.signer.PublicKey() ids = append(ids, &Key{ Format: pub.Type(), Blob: pub.Marshal(), Comment: k.comment}) } return ids, nil } // Insert adds a private key to the keyring. If a certificate // is given, that certificate is added as public key. Note that // any constraints given are ignored. func (r *keyring) Add(key AddedKey) error { r.mu.Lock() defer r.mu.Unlock() if r.locked { return errLocked } signer, err := ssh.NewSignerFromKey(key.PrivateKey) if err != nil { return err } if cert := key.Certificate; cert != nil { signer, err = ssh.NewCertSigner(cert, signer) if err != nil { return err } } p := privKey{ signer: signer, comment: key.Comment, } if key.LifetimeSecs > 0 { t := time.Now().Add(time.Duration(key.LifetimeSecs) * time.Second) p.expire = &t } r.keys = append(r.keys, p) return nil } // Sign returns a signature for the data. func (r *keyring) Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error) { return r.SignWithFlags(key, data, 0) } func (r *keyring) SignWithFlags(key ssh.PublicKey, data []byte, flags SignatureFlags) (*ssh.Signature, error) { r.mu.Lock() defer r.mu.Unlock() if r.locked { return nil, errLocked } r.expireKeysLocked() wanted := key.Marshal() for _, k := range r.keys { if bytes.Equal(k.signer.PublicKey().Marshal(), wanted) { if flags == 0 { return k.signer.Sign(rand.Reader, data) } else { if algorithmSigner, ok := k.signer.(ssh.AlgorithmSigner); !ok { return nil, fmt.Errorf("agent: signature does not support non-default signature algorithm: %T", k.signer) } else { var algorithm string switch flags { case SignatureFlagRsaSha256: algorithm = ssh.SigAlgoRSASHA2256 case SignatureFlagRsaSha512: algorithm = ssh.SigAlgoRSASHA2512 default: return nil, fmt.Errorf("agent: unsupported signature flags: %d", flags) } return algorithmSigner.SignWithAlgorithm(rand.Reader, data, algorithm) } } } } return nil, errors.New("not found") } // Signers returns signers for all the known keys. func (r *keyring) Signers() ([]ssh.Signer, error) { r.mu.Lock() defer r.mu.Unlock() if r.locked { return nil, errLocked } r.expireKeysLocked() s := make([]ssh.Signer, 0, len(r.keys)) for _, k := range r.keys { s = append(s, k.signer) } return s, nil } // The keyring does not support any extensions func (r *keyring) Extension(extensionType string, contents []byte) ([]byte, error) { return nil, ErrExtensionUnsupported } ================================================ FILE: vendor/golang.org/x/crypto/ssh/agent/server.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package agent import ( "crypto/dsa" "crypto/ecdsa" "crypto/elliptic" "crypto/rsa" "encoding/binary" "errors" "fmt" "io" "log" "math/big" "golang.org/x/crypto/ed25519" "golang.org/x/crypto/ssh" ) // Server wraps an Agent and uses it to implement the agent side of // the SSH-agent, wire protocol. type server struct { agent Agent } func (s *server) processRequestBytes(reqData []byte) []byte { rep, err := s.processRequest(reqData) if err != nil { if err != errLocked { // TODO(hanwen): provide better logging interface? log.Printf("agent %d: %v", reqData[0], err) } return []byte{agentFailure} } if err == nil && rep == nil { return []byte{agentSuccess} } return ssh.Marshal(rep) } func marshalKey(k *Key) []byte { var record struct { Blob []byte Comment string } record.Blob = k.Marshal() record.Comment = k.Comment return ssh.Marshal(&record) } // See [PROTOCOL.agent], section 2.5.1. const agentV1IdentitiesAnswer = 2 type agentV1IdentityMsg struct { Numkeys uint32 `sshtype:"2"` } type agentRemoveIdentityMsg struct { KeyBlob []byte `sshtype:"18"` } type agentLockMsg struct { Passphrase []byte `sshtype:"22"` } type agentUnlockMsg struct { Passphrase []byte `sshtype:"23"` } func (s *server) processRequest(data []byte) (interface{}, error) { switch data[0] { case agentRequestV1Identities: return &agentV1IdentityMsg{0}, nil case agentRemoveAllV1Identities: return nil, nil case agentRemoveIdentity: var req agentRemoveIdentityMsg if err := ssh.Unmarshal(data, &req); err != nil { return nil, err } var wk wireKey if err := ssh.Unmarshal(req.KeyBlob, &wk); err != nil { return nil, err } return nil, s.agent.Remove(&Key{Format: wk.Format, Blob: req.KeyBlob}) case agentRemoveAllIdentities: return nil, s.agent.RemoveAll() case agentLock: var req agentLockMsg if err := ssh.Unmarshal(data, &req); err != nil { return nil, err } return nil, s.agent.Lock(req.Passphrase) case agentUnlock: var req agentUnlockMsg if err := ssh.Unmarshal(data, &req); err != nil { return nil, err } return nil, s.agent.Unlock(req.Passphrase) case agentSignRequest: var req signRequestAgentMsg if err := ssh.Unmarshal(data, &req); err != nil { return nil, err } var wk wireKey if err := ssh.Unmarshal(req.KeyBlob, &wk); err != nil { return nil, err } k := &Key{ Format: wk.Format, Blob: req.KeyBlob, } var sig *ssh.Signature var err error if extendedAgent, ok := s.agent.(ExtendedAgent); ok { sig, err = extendedAgent.SignWithFlags(k, req.Data, SignatureFlags(req.Flags)) } else { sig, err = s.agent.Sign(k, req.Data) } if err != nil { return nil, err } return &signResponseAgentMsg{SigBlob: ssh.Marshal(sig)}, nil case agentRequestIdentities: keys, err := s.agent.List() if err != nil { return nil, err } rep := identitiesAnswerAgentMsg{ NumKeys: uint32(len(keys)), } for _, k := range keys { rep.Keys = append(rep.Keys, marshalKey(k)...) } return rep, nil case agentAddIDConstrained, agentAddIdentity: return nil, s.insertIdentity(data) case agentExtension: // Return a stub object where the whole contents of the response gets marshaled. var responseStub struct { Rest []byte `ssh:"rest"` } if extendedAgent, ok := s.agent.(ExtendedAgent); !ok { // If this agent doesn't implement extensions, [PROTOCOL.agent] section 4.7 // requires that we return a standard SSH_AGENT_FAILURE message. responseStub.Rest = []byte{agentFailure} } else { var req extensionAgentMsg if err := ssh.Unmarshal(data, &req); err != nil { return nil, err } res, err := extendedAgent.Extension(req.ExtensionType, req.Contents) if err != nil { // If agent extensions are unsupported, return a standard SSH_AGENT_FAILURE // message as required by [PROTOCOL.agent] section 4.7. if err == ErrExtensionUnsupported { responseStub.Rest = []byte{agentFailure} } else { // As the result of any other error processing an extension request, // [PROTOCOL.agent] section 4.7 requires that we return a // SSH_AGENT_EXTENSION_FAILURE code. responseStub.Rest = []byte{agentExtensionFailure} } } else { if len(res) == 0 { return nil, nil } responseStub.Rest = res } } return responseStub, nil } return nil, fmt.Errorf("unknown opcode %d", data[0]) } func parseConstraints(constraints []byte) (lifetimeSecs uint32, confirmBeforeUse bool, extensions []ConstraintExtension, err error) { for len(constraints) != 0 { switch constraints[0] { case agentConstrainLifetime: lifetimeSecs = binary.BigEndian.Uint32(constraints[1:5]) constraints = constraints[5:] case agentConstrainConfirm: confirmBeforeUse = true constraints = constraints[1:] case agentConstrainExtension: var msg constrainExtensionAgentMsg if err = ssh.Unmarshal(constraints, &msg); err != nil { return 0, false, nil, err } extensions = append(extensions, ConstraintExtension{ ExtensionName: msg.ExtensionName, ExtensionDetails: msg.ExtensionDetails, }) constraints = msg.Rest default: return 0, false, nil, fmt.Errorf("unknown constraint type: %d", constraints[0]) } } return } func setConstraints(key *AddedKey, constraintBytes []byte) error { lifetimeSecs, confirmBeforeUse, constraintExtensions, err := parseConstraints(constraintBytes) if err != nil { return err } key.LifetimeSecs = lifetimeSecs key.ConfirmBeforeUse = confirmBeforeUse key.ConstraintExtensions = constraintExtensions return nil } func parseRSAKey(req []byte) (*AddedKey, error) { var k rsaKeyMsg if err := ssh.Unmarshal(req, &k); err != nil { return nil, err } if k.E.BitLen() > 30 { return nil, errors.New("agent: RSA public exponent too large") } priv := &rsa.PrivateKey{ PublicKey: rsa.PublicKey{ E: int(k.E.Int64()), N: k.N, }, D: k.D, Primes: []*big.Int{k.P, k.Q}, } priv.Precompute() addedKey := &AddedKey{PrivateKey: priv, Comment: k.Comments} if err := setConstraints(addedKey, k.Constraints); err != nil { return nil, err } return addedKey, nil } func parseEd25519Key(req []byte) (*AddedKey, error) { var k ed25519KeyMsg if err := ssh.Unmarshal(req, &k); err != nil { return nil, err } priv := ed25519.PrivateKey(k.Priv) addedKey := &AddedKey{PrivateKey: &priv, Comment: k.Comments} if err := setConstraints(addedKey, k.Constraints); err != nil { return nil, err } return addedKey, nil } func parseDSAKey(req []byte) (*AddedKey, error) { var k dsaKeyMsg if err := ssh.Unmarshal(req, &k); err != nil { return nil, err } priv := &dsa.PrivateKey{ PublicKey: dsa.PublicKey{ Parameters: dsa.Parameters{ P: k.P, Q: k.Q, G: k.G, }, Y: k.Y, }, X: k.X, } addedKey := &AddedKey{PrivateKey: priv, Comment: k.Comments} if err := setConstraints(addedKey, k.Constraints); err != nil { return nil, err } return addedKey, nil } func unmarshalECDSA(curveName string, keyBytes []byte, privScalar *big.Int) (priv *ecdsa.PrivateKey, err error) { priv = &ecdsa.PrivateKey{ D: privScalar, } switch curveName { case "nistp256": priv.Curve = elliptic.P256() case "nistp384": priv.Curve = elliptic.P384() case "nistp521": priv.Curve = elliptic.P521() default: return nil, fmt.Errorf("agent: unknown curve %q", curveName) } priv.X, priv.Y = elliptic.Unmarshal(priv.Curve, keyBytes) if priv.X == nil || priv.Y == nil { return nil, errors.New("agent: point not on curve") } return priv, nil } func parseEd25519Cert(req []byte) (*AddedKey, error) { var k ed25519CertMsg if err := ssh.Unmarshal(req, &k); err != nil { return nil, err } pubKey, err := ssh.ParsePublicKey(k.CertBytes) if err != nil { return nil, err } priv := ed25519.PrivateKey(k.Priv) cert, ok := pubKey.(*ssh.Certificate) if !ok { return nil, errors.New("agent: bad ED25519 certificate") } addedKey := &AddedKey{PrivateKey: &priv, Certificate: cert, Comment: k.Comments} if err := setConstraints(addedKey, k.Constraints); err != nil { return nil, err } return addedKey, nil } func parseECDSAKey(req []byte) (*AddedKey, error) { var k ecdsaKeyMsg if err := ssh.Unmarshal(req, &k); err != nil { return nil, err } priv, err := unmarshalECDSA(k.Curve, k.KeyBytes, k.D) if err != nil { return nil, err } addedKey := &AddedKey{PrivateKey: priv, Comment: k.Comments} if err := setConstraints(addedKey, k.Constraints); err != nil { return nil, err } return addedKey, nil } func parseRSACert(req []byte) (*AddedKey, error) { var k rsaCertMsg if err := ssh.Unmarshal(req, &k); err != nil { return nil, err } pubKey, err := ssh.ParsePublicKey(k.CertBytes) if err != nil { return nil, err } cert, ok := pubKey.(*ssh.Certificate) if !ok { return nil, errors.New("agent: bad RSA certificate") } // An RSA publickey as marshaled by rsaPublicKey.Marshal() in keys.go var rsaPub struct { Name string E *big.Int N *big.Int } if err := ssh.Unmarshal(cert.Key.Marshal(), &rsaPub); err != nil { return nil, fmt.Errorf("agent: Unmarshal failed to parse public key: %v", err) } if rsaPub.E.BitLen() > 30 { return nil, errors.New("agent: RSA public exponent too large") } priv := rsa.PrivateKey{ PublicKey: rsa.PublicKey{ E: int(rsaPub.E.Int64()), N: rsaPub.N, }, D: k.D, Primes: []*big.Int{k.Q, k.P}, } priv.Precompute() addedKey := &AddedKey{PrivateKey: &priv, Certificate: cert, Comment: k.Comments} if err := setConstraints(addedKey, k.Constraints); err != nil { return nil, err } return addedKey, nil } func parseDSACert(req []byte) (*AddedKey, error) { var k dsaCertMsg if err := ssh.Unmarshal(req, &k); err != nil { return nil, err } pubKey, err := ssh.ParsePublicKey(k.CertBytes) if err != nil { return nil, err } cert, ok := pubKey.(*ssh.Certificate) if !ok { return nil, errors.New("agent: bad DSA certificate") } // A DSA publickey as marshaled by dsaPublicKey.Marshal() in keys.go var w struct { Name string P, Q, G, Y *big.Int } if err := ssh.Unmarshal(cert.Key.Marshal(), &w); err != nil { return nil, fmt.Errorf("agent: Unmarshal failed to parse public key: %v", err) } priv := &dsa.PrivateKey{ PublicKey: dsa.PublicKey{ Parameters: dsa.Parameters{ P: w.P, Q: w.Q, G: w.G, }, Y: w.Y, }, X: k.X, } addedKey := &AddedKey{PrivateKey: priv, Certificate: cert, Comment: k.Comments} if err := setConstraints(addedKey, k.Constraints); err != nil { return nil, err } return addedKey, nil } func parseECDSACert(req []byte) (*AddedKey, error) { var k ecdsaCertMsg if err := ssh.Unmarshal(req, &k); err != nil { return nil, err } pubKey, err := ssh.ParsePublicKey(k.CertBytes) if err != nil { return nil, err } cert, ok := pubKey.(*ssh.Certificate) if !ok { return nil, errors.New("agent: bad ECDSA certificate") } // An ECDSA publickey as marshaled by ecdsaPublicKey.Marshal() in keys.go var ecdsaPub struct { Name string ID string Key []byte } if err := ssh.Unmarshal(cert.Key.Marshal(), &ecdsaPub); err != nil { return nil, err } priv, err := unmarshalECDSA(ecdsaPub.ID, ecdsaPub.Key, k.D) if err != nil { return nil, err } addedKey := &AddedKey{PrivateKey: priv, Certificate: cert, Comment: k.Comments} if err := setConstraints(addedKey, k.Constraints); err != nil { return nil, err } return addedKey, nil } func (s *server) insertIdentity(req []byte) error { var record struct { Type string `sshtype:"17|25"` Rest []byte `ssh:"rest"` } if err := ssh.Unmarshal(req, &record); err != nil { return err } var addedKey *AddedKey var err error switch record.Type { case ssh.KeyAlgoRSA: addedKey, err = parseRSAKey(req) case ssh.KeyAlgoDSA: addedKey, err = parseDSAKey(req) case ssh.KeyAlgoECDSA256, ssh.KeyAlgoECDSA384, ssh.KeyAlgoECDSA521: addedKey, err = parseECDSAKey(req) case ssh.KeyAlgoED25519: addedKey, err = parseEd25519Key(req) case ssh.CertAlgoRSAv01: addedKey, err = parseRSACert(req) case ssh.CertAlgoDSAv01: addedKey, err = parseDSACert(req) case ssh.CertAlgoECDSA256v01, ssh.CertAlgoECDSA384v01, ssh.CertAlgoECDSA521v01: addedKey, err = parseECDSACert(req) case ssh.CertAlgoED25519v01: addedKey, err = parseEd25519Cert(req) default: return fmt.Errorf("agent: not implemented: %q", record.Type) } if err != nil { return err } return s.agent.Add(*addedKey) } // ServeAgent serves the agent protocol on the given connection. It // returns when an I/O error occurs. func ServeAgent(agent Agent, c io.ReadWriter) error { s := &server{agent} var length [4]byte for { if _, err := io.ReadFull(c, length[:]); err != nil { return err } l := binary.BigEndian.Uint32(length[:]) if l == 0 { return fmt.Errorf("agent: request size is 0") } if l > maxAgentResponseBytes { // We also cap requests. return fmt.Errorf("agent: request too large: %d", l) } req := make([]byte, l) if _, err := io.ReadFull(c, req); err != nil { return err } repData := s.processRequestBytes(req) if len(repData) > maxAgentResponseBytes { return fmt.Errorf("agent: reply too large: %d bytes", len(repData)) } binary.BigEndian.PutUint32(length[:], uint32(len(repData))) if _, err := c.Write(length[:]); err != nil { return err } if _, err := c.Write(repData); err != nil { return err } } } ================================================ FILE: vendor/golang.org/x/crypto/ssh/buffer.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "io" "sync" ) // buffer provides a linked list buffer for data exchange // between producer and consumer. Theoretically the buffer is // of unlimited capacity as it does no allocation of its own. type buffer struct { // protects concurrent access to head, tail and closed *sync.Cond head *element // the buffer that will be read first tail *element // the buffer that will be read last closed bool } // An element represents a single link in a linked list. type element struct { buf []byte next *element } // newBuffer returns an empty buffer that is not closed. func newBuffer() *buffer { e := new(element) b := &buffer{ Cond: newCond(), head: e, tail: e, } return b } // write makes buf available for Read to receive. // buf must not be modified after the call to write. func (b *buffer) write(buf []byte) { b.Cond.L.Lock() e := &element{buf: buf} b.tail.next = e b.tail = e b.Cond.Signal() b.Cond.L.Unlock() } // eof closes the buffer. Reads from the buffer once all // the data has been consumed will receive io.EOF. func (b *buffer) eof() { b.Cond.L.Lock() b.closed = true b.Cond.Signal() b.Cond.L.Unlock() } // Read reads data from the internal buffer in buf. Reads will block // if no data is available, or until the buffer is closed. func (b *buffer) Read(buf []byte) (n int, err error) { b.Cond.L.Lock() defer b.Cond.L.Unlock() for len(buf) > 0 { // if there is data in b.head, copy it if len(b.head.buf) > 0 { r := copy(buf, b.head.buf) buf, b.head.buf = buf[r:], b.head.buf[r:] n += r continue } // if there is a next buffer, make it the head if len(b.head.buf) == 0 && b.head != b.tail { b.head = b.head.next continue } // if at least one byte has been copied, return if n > 0 { break } // if nothing was read, and there is nothing outstanding // check to see if the buffer is closed. if b.closed { err = io.EOF break } // out of buffers, wait for producer b.Cond.Wait() } return } ================================================ FILE: vendor/golang.org/x/crypto/ssh/certs.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "bytes" "errors" "fmt" "io" "net" "sort" "time" ) // These constants from [PROTOCOL.certkeys] represent the algorithm names // for certificate types supported by this package. const ( CertAlgoRSAv01 = "ssh-rsa-cert-v01@openssh.com" CertAlgoDSAv01 = "ssh-dss-cert-v01@openssh.com" CertAlgoECDSA256v01 = "ecdsa-sha2-nistp256-cert-v01@openssh.com" CertAlgoECDSA384v01 = "ecdsa-sha2-nistp384-cert-v01@openssh.com" CertAlgoECDSA521v01 = "ecdsa-sha2-nistp521-cert-v01@openssh.com" CertAlgoED25519v01 = "ssh-ed25519-cert-v01@openssh.com" ) // Certificate types distinguish between host and user // certificates. The values can be set in the CertType field of // Certificate. const ( UserCert = 1 HostCert = 2 ) // Signature represents a cryptographic signature. type Signature struct { Format string Blob []byte } // CertTimeInfinity can be used for OpenSSHCertV01.ValidBefore to indicate that // a certificate does not expire. const CertTimeInfinity = 1<<64 - 1 // An Certificate represents an OpenSSH certificate as defined in // [PROTOCOL.certkeys]?rev=1.8. The Certificate type implements the // PublicKey interface, so it can be unmarshaled using // ParsePublicKey. type Certificate struct { Nonce []byte Key PublicKey Serial uint64 CertType uint32 KeyId string ValidPrincipals []string ValidAfter uint64 ValidBefore uint64 Permissions Reserved []byte SignatureKey PublicKey Signature *Signature } // genericCertData holds the key-independent part of the certificate data. // Overall, certificates contain an nonce, public key fields and // key-independent fields. type genericCertData struct { Serial uint64 CertType uint32 KeyId string ValidPrincipals []byte ValidAfter uint64 ValidBefore uint64 CriticalOptions []byte Extensions []byte Reserved []byte SignatureKey []byte Signature []byte } func marshalStringList(namelist []string) []byte { var to []byte for _, name := range namelist { s := struct{ N string }{name} to = append(to, Marshal(&s)...) } return to } type optionsTuple struct { Key string Value []byte } type optionsTupleValue struct { Value string } // serialize a map of critical options or extensions // issue #10569 - per [PROTOCOL.certkeys] and SSH implementation, // we need two length prefixes for a non-empty string value func marshalTuples(tups map[string]string) []byte { keys := make([]string, 0, len(tups)) for key := range tups { keys = append(keys, key) } sort.Strings(keys) var ret []byte for _, key := range keys { s := optionsTuple{Key: key} if value := tups[key]; len(value) > 0 { s.Value = Marshal(&optionsTupleValue{value}) } ret = append(ret, Marshal(&s)...) } return ret } // issue #10569 - per [PROTOCOL.certkeys] and SSH implementation, // we need two length prefixes for a non-empty option value func parseTuples(in []byte) (map[string]string, error) { tups := map[string]string{} var lastKey string var haveLastKey bool for len(in) > 0 { var key, val, extra []byte var ok bool if key, in, ok = parseString(in); !ok { return nil, errShortRead } keyStr := string(key) // according to [PROTOCOL.certkeys], the names must be in // lexical order. if haveLastKey && keyStr <= lastKey { return nil, fmt.Errorf("ssh: certificate options are not in lexical order") } lastKey, haveLastKey = keyStr, true // the next field is a data field, which if non-empty has a string embedded if val, in, ok = parseString(in); !ok { return nil, errShortRead } if len(val) > 0 { val, extra, ok = parseString(val) if !ok { return nil, errShortRead } if len(extra) > 0 { return nil, fmt.Errorf("ssh: unexpected trailing data after certificate option value") } tups[keyStr] = string(val) } else { tups[keyStr] = "" } } return tups, nil } func parseCert(in []byte, privAlgo string) (*Certificate, error) { nonce, rest, ok := parseString(in) if !ok { return nil, errShortRead } key, rest, err := parsePubKey(rest, privAlgo) if err != nil { return nil, err } var g genericCertData if err := Unmarshal(rest, &g); err != nil { return nil, err } c := &Certificate{ Nonce: nonce, Key: key, Serial: g.Serial, CertType: g.CertType, KeyId: g.KeyId, ValidAfter: g.ValidAfter, ValidBefore: g.ValidBefore, } for principals := g.ValidPrincipals; len(principals) > 0; { principal, rest, ok := parseString(principals) if !ok { return nil, errShortRead } c.ValidPrincipals = append(c.ValidPrincipals, string(principal)) principals = rest } c.CriticalOptions, err = parseTuples(g.CriticalOptions) if err != nil { return nil, err } c.Extensions, err = parseTuples(g.Extensions) if err != nil { return nil, err } c.Reserved = g.Reserved k, err := ParsePublicKey(g.SignatureKey) if err != nil { return nil, err } c.SignatureKey = k c.Signature, rest, ok = parseSignatureBody(g.Signature) if !ok || len(rest) > 0 { return nil, errors.New("ssh: signature parse error") } return c, nil } type openSSHCertSigner struct { pub *Certificate signer Signer } type algorithmOpenSSHCertSigner struct { *openSSHCertSigner algorithmSigner AlgorithmSigner } // NewCertSigner returns a Signer that signs with the given Certificate, whose // private key is held by signer. It returns an error if the public key in cert // doesn't match the key used by signer. func NewCertSigner(cert *Certificate, signer Signer) (Signer, error) { if bytes.Compare(cert.Key.Marshal(), signer.PublicKey().Marshal()) != 0 { return nil, errors.New("ssh: signer and cert have different public key") } if algorithmSigner, ok := signer.(AlgorithmSigner); ok { return &algorithmOpenSSHCertSigner{ &openSSHCertSigner{cert, signer}, algorithmSigner}, nil } else { return &openSSHCertSigner{cert, signer}, nil } } func (s *openSSHCertSigner) Sign(rand io.Reader, data []byte) (*Signature, error) { return s.signer.Sign(rand, data) } func (s *openSSHCertSigner) PublicKey() PublicKey { return s.pub } func (s *algorithmOpenSSHCertSigner) SignWithAlgorithm(rand io.Reader, data []byte, algorithm string) (*Signature, error) { return s.algorithmSigner.SignWithAlgorithm(rand, data, algorithm) } const sourceAddressCriticalOption = "source-address" // CertChecker does the work of verifying a certificate. Its methods // can be plugged into ClientConfig.HostKeyCallback and // ServerConfig.PublicKeyCallback. For the CertChecker to work, // minimally, the IsAuthority callback should be set. type CertChecker struct { // SupportedCriticalOptions lists the CriticalOptions that the // server application layer understands. These are only used // for user certificates. SupportedCriticalOptions []string // IsUserAuthority should return true if the key is recognized as an // authority for the given user certificate. This allows for // certificates to be signed by other certificates. This must be set // if this CertChecker will be checking user certificates. IsUserAuthority func(auth PublicKey) bool // IsHostAuthority should report whether the key is recognized as // an authority for this host. This allows for certificates to be // signed by other keys, and for those other keys to only be valid // signers for particular hostnames. This must be set if this // CertChecker will be checking host certificates. IsHostAuthority func(auth PublicKey, address string) bool // Clock is used for verifying time stamps. If nil, time.Now // is used. Clock func() time.Time // UserKeyFallback is called when CertChecker.Authenticate encounters a // public key that is not a certificate. It must implement validation // of user keys or else, if nil, all such keys are rejected. UserKeyFallback func(conn ConnMetadata, key PublicKey) (*Permissions, error) // HostKeyFallback is called when CertChecker.CheckHostKey encounters a // public key that is not a certificate. It must implement host key // validation or else, if nil, all such keys are rejected. HostKeyFallback HostKeyCallback // IsRevoked is called for each certificate so that revocation checking // can be implemented. It should return true if the given certificate // is revoked and false otherwise. If nil, no certificates are // considered to have been revoked. IsRevoked func(cert *Certificate) bool } // CheckHostKey checks a host key certificate. This method can be // plugged into ClientConfig.HostKeyCallback. func (c *CertChecker) CheckHostKey(addr string, remote net.Addr, key PublicKey) error { cert, ok := key.(*Certificate) if !ok { if c.HostKeyFallback != nil { return c.HostKeyFallback(addr, remote, key) } return errors.New("ssh: non-certificate host key") } if cert.CertType != HostCert { return fmt.Errorf("ssh: certificate presented as a host key has type %d", cert.CertType) } if !c.IsHostAuthority(cert.SignatureKey, addr) { return fmt.Errorf("ssh: no authorities for hostname: %v", addr) } hostname, _, err := net.SplitHostPort(addr) if err != nil { return err } // Pass hostname only as principal for host certificates (consistent with OpenSSH) return c.CheckCert(hostname, cert) } // Authenticate checks a user certificate. Authenticate can be used as // a value for ServerConfig.PublicKeyCallback. func (c *CertChecker) Authenticate(conn ConnMetadata, pubKey PublicKey) (*Permissions, error) { cert, ok := pubKey.(*Certificate) if !ok { if c.UserKeyFallback != nil { return c.UserKeyFallback(conn, pubKey) } return nil, errors.New("ssh: normal key pairs not accepted") } if cert.CertType != UserCert { return nil, fmt.Errorf("ssh: cert has type %d", cert.CertType) } if !c.IsUserAuthority(cert.SignatureKey) { return nil, fmt.Errorf("ssh: certificate signed by unrecognized authority") } if err := c.CheckCert(conn.User(), cert); err != nil { return nil, err } return &cert.Permissions, nil } // CheckCert checks CriticalOptions, ValidPrincipals, revocation, timestamp and // the signature of the certificate. func (c *CertChecker) CheckCert(principal string, cert *Certificate) error { if c.IsRevoked != nil && c.IsRevoked(cert) { return fmt.Errorf("ssh: certificate serial %d revoked", cert.Serial) } for opt := range cert.CriticalOptions { // sourceAddressCriticalOption will be enforced by // serverAuthenticate if opt == sourceAddressCriticalOption { continue } found := false for _, supp := range c.SupportedCriticalOptions { if supp == opt { found = true break } } if !found { return fmt.Errorf("ssh: unsupported critical option %q in certificate", opt) } } if len(cert.ValidPrincipals) > 0 { // By default, certs are valid for all users/hosts. found := false for _, p := range cert.ValidPrincipals { if p == principal { found = true break } } if !found { return fmt.Errorf("ssh: principal %q not in the set of valid principals for given certificate: %q", principal, cert.ValidPrincipals) } } clock := c.Clock if clock == nil { clock = time.Now } unixNow := clock().Unix() if after := int64(cert.ValidAfter); after < 0 || unixNow < int64(cert.ValidAfter) { return fmt.Errorf("ssh: cert is not yet valid") } if before := int64(cert.ValidBefore); cert.ValidBefore != uint64(CertTimeInfinity) && (unixNow >= before || before < 0) { return fmt.Errorf("ssh: cert has expired") } if err := cert.SignatureKey.Verify(cert.bytesForSigning(), cert.Signature); err != nil { return fmt.Errorf("ssh: certificate signature does not verify") } return nil } // SignCert sets c.SignatureKey to the authority's public key and stores a // Signature, by authority, in the certificate. func (c *Certificate) SignCert(rand io.Reader, authority Signer) error { c.Nonce = make([]byte, 32) if _, err := io.ReadFull(rand, c.Nonce); err != nil { return err } c.SignatureKey = authority.PublicKey() sig, err := authority.Sign(rand, c.bytesForSigning()) if err != nil { return err } c.Signature = sig return nil } var certAlgoNames = map[string]string{ KeyAlgoRSA: CertAlgoRSAv01, KeyAlgoDSA: CertAlgoDSAv01, KeyAlgoECDSA256: CertAlgoECDSA256v01, KeyAlgoECDSA384: CertAlgoECDSA384v01, KeyAlgoECDSA521: CertAlgoECDSA521v01, KeyAlgoED25519: CertAlgoED25519v01, } // certToPrivAlgo returns the underlying algorithm for a certificate algorithm. // Panics if a non-certificate algorithm is passed. func certToPrivAlgo(algo string) string { for privAlgo, pubAlgo := range certAlgoNames { if pubAlgo == algo { return privAlgo } } panic("unknown cert algorithm") } func (cert *Certificate) bytesForSigning() []byte { c2 := *cert c2.Signature = nil out := c2.Marshal() // Drop trailing signature length. return out[:len(out)-4] } // Marshal serializes c into OpenSSH's wire format. It is part of the // PublicKey interface. func (c *Certificate) Marshal() []byte { generic := genericCertData{ Serial: c.Serial, CertType: c.CertType, KeyId: c.KeyId, ValidPrincipals: marshalStringList(c.ValidPrincipals), ValidAfter: uint64(c.ValidAfter), ValidBefore: uint64(c.ValidBefore), CriticalOptions: marshalTuples(c.CriticalOptions), Extensions: marshalTuples(c.Extensions), Reserved: c.Reserved, SignatureKey: c.SignatureKey.Marshal(), } if c.Signature != nil { generic.Signature = Marshal(c.Signature) } genericBytes := Marshal(&generic) keyBytes := c.Key.Marshal() _, keyBytes, _ = parseString(keyBytes) prefix := Marshal(&struct { Name string Nonce []byte Key []byte `ssh:"rest"` }{c.Type(), c.Nonce, keyBytes}) result := make([]byte, 0, len(prefix)+len(genericBytes)) result = append(result, prefix...) result = append(result, genericBytes...) return result } // Type returns the key name. It is part of the PublicKey interface. func (c *Certificate) Type() string { algo, ok := certAlgoNames[c.Key.Type()] if !ok { panic("unknown cert key type " + c.Key.Type()) } return algo } // Verify verifies a signature against the certificate's public // key. It is part of the PublicKey interface. func (c *Certificate) Verify(data []byte, sig *Signature) error { return c.Key.Verify(data, sig) } func parseSignatureBody(in []byte) (out *Signature, rest []byte, ok bool) { format, in, ok := parseString(in) if !ok { return } out = &Signature{ Format: string(format), } if out.Blob, in, ok = parseString(in); !ok { return } return out, in, ok } func parseSignature(in []byte) (out *Signature, rest []byte, ok bool) { sigBytes, rest, ok := parseString(in) if !ok { return } out, trailing, ok := parseSignatureBody(sigBytes) if !ok || len(trailing) > 0 { return nil, nil, false } return } ================================================ FILE: vendor/golang.org/x/crypto/ssh/channel.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "encoding/binary" "errors" "fmt" "io" "log" "sync" ) const ( minPacketLength = 9 // channelMaxPacket contains the maximum number of bytes that will be // sent in a single packet. As per RFC 4253, section 6.1, 32k is also // the minimum. channelMaxPacket = 1 << 15 // We follow OpenSSH here. channelWindowSize = 64 * channelMaxPacket ) // NewChannel represents an incoming request to a channel. It must either be // accepted for use by calling Accept, or rejected by calling Reject. type NewChannel interface { // Accept accepts the channel creation request. It returns the Channel // and a Go channel containing SSH requests. The Go channel must be // serviced otherwise the Channel will hang. Accept() (Channel, <-chan *Request, error) // Reject rejects the channel creation request. After calling // this, no other methods on the Channel may be called. Reject(reason RejectionReason, message string) error // ChannelType returns the type of the channel, as supplied by the // client. ChannelType() string // ExtraData returns the arbitrary payload for this channel, as supplied // by the client. This data is specific to the channel type. ExtraData() []byte } // A Channel is an ordered, reliable, flow-controlled, duplex stream // that is multiplexed over an SSH connection. type Channel interface { // Read reads up to len(data) bytes from the channel. Read(data []byte) (int, error) // Write writes len(data) bytes to the channel. Write(data []byte) (int, error) // Close signals end of channel use. No data may be sent after this // call. Close() error // CloseWrite signals the end of sending in-band // data. Requests may still be sent, and the other side may // still send data CloseWrite() error // SendRequest sends a channel request. If wantReply is true, // it will wait for a reply and return the result as a // boolean, otherwise the return value will be false. Channel // requests are out-of-band messages so they may be sent even // if the data stream is closed or blocked by flow control. // If the channel is closed before a reply is returned, io.EOF // is returned. SendRequest(name string, wantReply bool, payload []byte) (bool, error) // Stderr returns an io.ReadWriter that writes to this channel // with the extended data type set to stderr. Stderr may // safely be read and written from a different goroutine than // Read and Write respectively. Stderr() io.ReadWriter } // Request is a request sent outside of the normal stream of // data. Requests can either be specific to an SSH channel, or they // can be global. type Request struct { Type string WantReply bool Payload []byte ch *channel mux *mux } // Reply sends a response to a request. It must be called for all requests // where WantReply is true and is a no-op otherwise. The payload argument is // ignored for replies to channel-specific requests. func (r *Request) Reply(ok bool, payload []byte) error { if !r.WantReply { return nil } if r.ch == nil { return r.mux.ackRequest(ok, payload) } return r.ch.ackRequest(ok) } // RejectionReason is an enumeration used when rejecting channel creation // requests. See RFC 4254, section 5.1. type RejectionReason uint32 const ( Prohibited RejectionReason = iota + 1 ConnectionFailed UnknownChannelType ResourceShortage ) // String converts the rejection reason to human readable form. func (r RejectionReason) String() string { switch r { case Prohibited: return "administratively prohibited" case ConnectionFailed: return "connect failed" case UnknownChannelType: return "unknown channel type" case ResourceShortage: return "resource shortage" } return fmt.Sprintf("unknown reason %d", int(r)) } func min(a uint32, b int) uint32 { if a < uint32(b) { return a } return uint32(b) } type channelDirection uint8 const ( channelInbound channelDirection = iota channelOutbound ) // channel is an implementation of the Channel interface that works // with the mux class. type channel struct { // R/O after creation chanType string extraData []byte localId, remoteId uint32 // maxIncomingPayload and maxRemotePayload are the maximum // payload sizes of normal and extended data packets for // receiving and sending, respectively. The wire packet will // be 9 or 13 bytes larger (excluding encryption overhead). maxIncomingPayload uint32 maxRemotePayload uint32 mux *mux // decided is set to true if an accept or reject message has been sent // (for outbound channels) or received (for inbound channels). decided bool // direction contains either channelOutbound, for channels created // locally, or channelInbound, for channels created by the peer. direction channelDirection // Pending internal channel messages. msg chan interface{} // Since requests have no ID, there can be only one request // with WantReply=true outstanding. This lock is held by a // goroutine that has such an outgoing request pending. sentRequestMu sync.Mutex incomingRequests chan *Request sentEOF bool // thread-safe data remoteWin window pending *buffer extPending *buffer // windowMu protects myWindow, the flow-control window. windowMu sync.Mutex myWindow uint32 // writeMu serializes calls to mux.conn.writePacket() and // protects sentClose and packetPool. This mutex must be // different from windowMu, as writePacket can block if there // is a key exchange pending. writeMu sync.Mutex sentClose bool // packetPool has a buffer for each extended channel ID to // save allocations during writes. packetPool map[uint32][]byte } // writePacket sends a packet. If the packet is a channel close, it updates // sentClose. This method takes the lock c.writeMu. func (ch *channel) writePacket(packet []byte) error { ch.writeMu.Lock() if ch.sentClose { ch.writeMu.Unlock() return io.EOF } ch.sentClose = (packet[0] == msgChannelClose) err := ch.mux.conn.writePacket(packet) ch.writeMu.Unlock() return err } func (ch *channel) sendMessage(msg interface{}) error { if debugMux { log.Printf("send(%d): %#v", ch.mux.chanList.offset, msg) } p := Marshal(msg) binary.BigEndian.PutUint32(p[1:], ch.remoteId) return ch.writePacket(p) } // WriteExtended writes data to a specific extended stream. These streams are // used, for example, for stderr. func (ch *channel) WriteExtended(data []byte, extendedCode uint32) (n int, err error) { if ch.sentEOF { return 0, io.EOF } // 1 byte message type, 4 bytes remoteId, 4 bytes data length opCode := byte(msgChannelData) headerLength := uint32(9) if extendedCode > 0 { headerLength += 4 opCode = msgChannelExtendedData } ch.writeMu.Lock() packet := ch.packetPool[extendedCode] // We don't remove the buffer from packetPool, so // WriteExtended calls from different goroutines will be // flagged as errors by the race detector. ch.writeMu.Unlock() for len(data) > 0 { space := min(ch.maxRemotePayload, len(data)) if space, err = ch.remoteWin.reserve(space); err != nil { return n, err } if want := headerLength + space; uint32(cap(packet)) < want { packet = make([]byte, want) } else { packet = packet[:want] } todo := data[:space] packet[0] = opCode binary.BigEndian.PutUint32(packet[1:], ch.remoteId) if extendedCode > 0 { binary.BigEndian.PutUint32(packet[5:], uint32(extendedCode)) } binary.BigEndian.PutUint32(packet[headerLength-4:], uint32(len(todo))) copy(packet[headerLength:], todo) if err = ch.writePacket(packet); err != nil { return n, err } n += len(todo) data = data[len(todo):] } ch.writeMu.Lock() ch.packetPool[extendedCode] = packet ch.writeMu.Unlock() return n, err } func (ch *channel) handleData(packet []byte) error { headerLen := 9 isExtendedData := packet[0] == msgChannelExtendedData if isExtendedData { headerLen = 13 } if len(packet) < headerLen { // malformed data packet return parseError(packet[0]) } var extended uint32 if isExtendedData { extended = binary.BigEndian.Uint32(packet[5:]) } length := binary.BigEndian.Uint32(packet[headerLen-4 : headerLen]) if length == 0 { return nil } if length > ch.maxIncomingPayload { // TODO(hanwen): should send Disconnect? return errors.New("ssh: incoming packet exceeds maximum payload size") } data := packet[headerLen:] if length != uint32(len(data)) { return errors.New("ssh: wrong packet length") } ch.windowMu.Lock() if ch.myWindow < length { ch.windowMu.Unlock() // TODO(hanwen): should send Disconnect with reason? return errors.New("ssh: remote side wrote too much") } ch.myWindow -= length ch.windowMu.Unlock() if extended == 1 { ch.extPending.write(data) } else if extended > 0 { // discard other extended data. } else { ch.pending.write(data) } return nil } func (c *channel) adjustWindow(n uint32) error { c.windowMu.Lock() // Since myWindow is managed on our side, and can never exceed // the initial window setting, we don't worry about overflow. c.myWindow += uint32(n) c.windowMu.Unlock() return c.sendMessage(windowAdjustMsg{ AdditionalBytes: uint32(n), }) } func (c *channel) ReadExtended(data []byte, extended uint32) (n int, err error) { switch extended { case 1: n, err = c.extPending.Read(data) case 0: n, err = c.pending.Read(data) default: return 0, fmt.Errorf("ssh: extended code %d unimplemented", extended) } if n > 0 { err = c.adjustWindow(uint32(n)) // sendWindowAdjust can return io.EOF if the remote // peer has closed the connection, however we want to // defer forwarding io.EOF to the caller of Read until // the buffer has been drained. if n > 0 && err == io.EOF { err = nil } } return n, err } func (c *channel) close() { c.pending.eof() c.extPending.eof() close(c.msg) close(c.incomingRequests) c.writeMu.Lock() // This is not necessary for a normal channel teardown, but if // there was another error, it is. c.sentClose = true c.writeMu.Unlock() // Unblock writers. c.remoteWin.close() } // responseMessageReceived is called when a success or failure message is // received on a channel to check that such a message is reasonable for the // given channel. func (ch *channel) responseMessageReceived() error { if ch.direction == channelInbound { return errors.New("ssh: channel response message received on inbound channel") } if ch.decided { return errors.New("ssh: duplicate response received for channel") } ch.decided = true return nil } func (ch *channel) handlePacket(packet []byte) error { switch packet[0] { case msgChannelData, msgChannelExtendedData: return ch.handleData(packet) case msgChannelClose: ch.sendMessage(channelCloseMsg{PeersID: ch.remoteId}) ch.mux.chanList.remove(ch.localId) ch.close() return nil case msgChannelEOF: // RFC 4254 is mute on how EOF affects dataExt messages but // it is logical to signal EOF at the same time. ch.extPending.eof() ch.pending.eof() return nil } decoded, err := decode(packet) if err != nil { return err } switch msg := decoded.(type) { case *channelOpenFailureMsg: if err := ch.responseMessageReceived(); err != nil { return err } ch.mux.chanList.remove(msg.PeersID) ch.msg <- msg case *channelOpenConfirmMsg: if err := ch.responseMessageReceived(); err != nil { return err } if msg.MaxPacketSize < minPacketLength || msg.MaxPacketSize > 1<<31 { return fmt.Errorf("ssh: invalid MaxPacketSize %d from peer", msg.MaxPacketSize) } ch.remoteId = msg.MyID ch.maxRemotePayload = msg.MaxPacketSize ch.remoteWin.add(msg.MyWindow) ch.msg <- msg case *windowAdjustMsg: if !ch.remoteWin.add(msg.AdditionalBytes) { return fmt.Errorf("ssh: invalid window update for %d bytes", msg.AdditionalBytes) } case *channelRequestMsg: req := Request{ Type: msg.Request, WantReply: msg.WantReply, Payload: msg.RequestSpecificData, ch: ch, } ch.incomingRequests <- &req default: ch.msg <- msg } return nil } func (m *mux) newChannel(chanType string, direction channelDirection, extraData []byte) *channel { ch := &channel{ remoteWin: window{Cond: newCond()}, myWindow: channelWindowSize, pending: newBuffer(), extPending: newBuffer(), direction: direction, incomingRequests: make(chan *Request, chanSize), msg: make(chan interface{}, chanSize), chanType: chanType, extraData: extraData, mux: m, packetPool: make(map[uint32][]byte), } ch.localId = m.chanList.add(ch) return ch } var errUndecided = errors.New("ssh: must Accept or Reject channel") var errDecidedAlready = errors.New("ssh: can call Accept or Reject only once") type extChannel struct { code uint32 ch *channel } func (e *extChannel) Write(data []byte) (n int, err error) { return e.ch.WriteExtended(data, e.code) } func (e *extChannel) Read(data []byte) (n int, err error) { return e.ch.ReadExtended(data, e.code) } func (ch *channel) Accept() (Channel, <-chan *Request, error) { if ch.decided { return nil, nil, errDecidedAlready } ch.maxIncomingPayload = channelMaxPacket confirm := channelOpenConfirmMsg{ PeersID: ch.remoteId, MyID: ch.localId, MyWindow: ch.myWindow, MaxPacketSize: ch.maxIncomingPayload, } ch.decided = true if err := ch.sendMessage(confirm); err != nil { return nil, nil, err } return ch, ch.incomingRequests, nil } func (ch *channel) Reject(reason RejectionReason, message string) error { if ch.decided { return errDecidedAlready } reject := channelOpenFailureMsg{ PeersID: ch.remoteId, Reason: reason, Message: message, Language: "en", } ch.decided = true return ch.sendMessage(reject) } func (ch *channel) Read(data []byte) (int, error) { if !ch.decided { return 0, errUndecided } return ch.ReadExtended(data, 0) } func (ch *channel) Write(data []byte) (int, error) { if !ch.decided { return 0, errUndecided } return ch.WriteExtended(data, 0) } func (ch *channel) CloseWrite() error { if !ch.decided { return errUndecided } ch.sentEOF = true return ch.sendMessage(channelEOFMsg{ PeersID: ch.remoteId}) } func (ch *channel) Close() error { if !ch.decided { return errUndecided } return ch.sendMessage(channelCloseMsg{ PeersID: ch.remoteId}) } // Extended returns an io.ReadWriter that sends and receives data on the given, // SSH extended stream. Such streams are used, for example, for stderr. func (ch *channel) Extended(code uint32) io.ReadWriter { if !ch.decided { return nil } return &extChannel{code, ch} } func (ch *channel) Stderr() io.ReadWriter { return ch.Extended(1) } func (ch *channel) SendRequest(name string, wantReply bool, payload []byte) (bool, error) { if !ch.decided { return false, errUndecided } if wantReply { ch.sentRequestMu.Lock() defer ch.sentRequestMu.Unlock() } msg := channelRequestMsg{ PeersID: ch.remoteId, Request: name, WantReply: wantReply, RequestSpecificData: payload, } if err := ch.sendMessage(msg); err != nil { return false, err } if wantReply { m, ok := (<-ch.msg) if !ok { return false, io.EOF } switch m.(type) { case *channelRequestFailureMsg: return false, nil case *channelRequestSuccessMsg: return true, nil default: return false, fmt.Errorf("ssh: unexpected response to channel request: %#v", m) } } return false, nil } // ackRequest either sends an ack or nack to the channel request. func (ch *channel) ackRequest(ok bool) error { if !ch.decided { return errUndecided } var msg interface{} if !ok { msg = channelRequestFailureMsg{ PeersID: ch.remoteId, } } else { msg = channelRequestSuccessMsg{ PeersID: ch.remoteId, } } return ch.sendMessage(msg) } func (ch *channel) ChannelType() string { return ch.chanType } func (ch *channel) ExtraData() []byte { return ch.extraData } ================================================ FILE: vendor/golang.org/x/crypto/ssh/cipher.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "crypto/aes" "crypto/cipher" "crypto/des" "crypto/rc4" "crypto/subtle" "encoding/binary" "errors" "fmt" "hash" "io" "io/ioutil" "math/bits" "golang.org/x/crypto/internal/chacha20" "golang.org/x/crypto/poly1305" ) const ( packetSizeMultiple = 16 // TODO(huin) this should be determined by the cipher. // RFC 4253 section 6.1 defines a minimum packet size of 32768 that implementations // MUST be able to process (plus a few more kilobytes for padding and mac). The RFC // indicates implementations SHOULD be able to handle larger packet sizes, but then // waffles on about reasonable limits. // // OpenSSH caps their maxPacket at 256kB so we choose to do // the same. maxPacket is also used to ensure that uint32 // length fields do not overflow, so it should remain well // below 4G. maxPacket = 256 * 1024 ) // noneCipher implements cipher.Stream and provides no encryption. It is used // by the transport before the first key-exchange. type noneCipher struct{} func (c noneCipher) XORKeyStream(dst, src []byte) { copy(dst, src) } func newAESCTR(key, iv []byte) (cipher.Stream, error) { c, err := aes.NewCipher(key) if err != nil { return nil, err } return cipher.NewCTR(c, iv), nil } func newRC4(key, iv []byte) (cipher.Stream, error) { return rc4.NewCipher(key) } type cipherMode struct { keySize int ivSize int create func(key, iv []byte, macKey []byte, algs directionAlgorithms) (packetCipher, error) } func streamCipherMode(skip int, createFunc func(key, iv []byte) (cipher.Stream, error)) func(key, iv []byte, macKey []byte, algs directionAlgorithms) (packetCipher, error) { return func(key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) { stream, err := createFunc(key, iv) if err != nil { return nil, err } var streamDump []byte if skip > 0 { streamDump = make([]byte, 512) } for remainingToDump := skip; remainingToDump > 0; { dumpThisTime := remainingToDump if dumpThisTime > len(streamDump) { dumpThisTime = len(streamDump) } stream.XORKeyStream(streamDump[:dumpThisTime], streamDump[:dumpThisTime]) remainingToDump -= dumpThisTime } mac := macModes[algs.MAC].new(macKey) return &streamPacketCipher{ mac: mac, etm: macModes[algs.MAC].etm, macResult: make([]byte, mac.Size()), cipher: stream, }, nil } } // cipherModes documents properties of supported ciphers. Ciphers not included // are not supported and will not be negotiated, even if explicitly requested in // ClientConfig.Crypto.Ciphers. var cipherModes = map[string]*cipherMode{ // Ciphers from RFC4344, which introduced many CTR-based ciphers. Algorithms // are defined in the order specified in the RFC. "aes128-ctr": {16, aes.BlockSize, streamCipherMode(0, newAESCTR)}, "aes192-ctr": {24, aes.BlockSize, streamCipherMode(0, newAESCTR)}, "aes256-ctr": {32, aes.BlockSize, streamCipherMode(0, newAESCTR)}, // Ciphers from RFC4345, which introduces security-improved arcfour ciphers. // They are defined in the order specified in the RFC. "arcfour128": {16, 0, streamCipherMode(1536, newRC4)}, "arcfour256": {32, 0, streamCipherMode(1536, newRC4)}, // Cipher defined in RFC 4253, which describes SSH Transport Layer Protocol. // Note that this cipher is not safe, as stated in RFC 4253: "Arcfour (and // RC4) has problems with weak keys, and should be used with caution." // RFC4345 introduces improved versions of Arcfour. "arcfour": {16, 0, streamCipherMode(0, newRC4)}, // AEAD ciphers gcmCipherID: {16, 12, newGCMCipher}, chacha20Poly1305ID: {64, 0, newChaCha20Cipher}, // CBC mode is insecure and so is not included in the default config. // (See http://www.isg.rhul.ac.uk/~kp/SandPfinal.pdf). If absolutely // needed, it's possible to specify a custom Config to enable it. // You should expect that an active attacker can recover plaintext if // you do. aes128cbcID: {16, aes.BlockSize, newAESCBCCipher}, // 3des-cbc is insecure and is not included in the default // config. tripledescbcID: {24, des.BlockSize, newTripleDESCBCCipher}, } // prefixLen is the length of the packet prefix that contains the packet length // and number of padding bytes. const prefixLen = 5 // streamPacketCipher is a packetCipher using a stream cipher. type streamPacketCipher struct { mac hash.Hash cipher cipher.Stream etm bool // The following members are to avoid per-packet allocations. prefix [prefixLen]byte seqNumBytes [4]byte padding [2 * packetSizeMultiple]byte packetData []byte macResult []byte } // readPacket reads and decrypt a single packet from the reader argument. func (s *streamPacketCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) { if _, err := io.ReadFull(r, s.prefix[:]); err != nil { return nil, err } var encryptedPaddingLength [1]byte if s.mac != nil && s.etm { copy(encryptedPaddingLength[:], s.prefix[4:5]) s.cipher.XORKeyStream(s.prefix[4:5], s.prefix[4:5]) } else { s.cipher.XORKeyStream(s.prefix[:], s.prefix[:]) } length := binary.BigEndian.Uint32(s.prefix[0:4]) paddingLength := uint32(s.prefix[4]) var macSize uint32 if s.mac != nil { s.mac.Reset() binary.BigEndian.PutUint32(s.seqNumBytes[:], seqNum) s.mac.Write(s.seqNumBytes[:]) if s.etm { s.mac.Write(s.prefix[:4]) s.mac.Write(encryptedPaddingLength[:]) } else { s.mac.Write(s.prefix[:]) } macSize = uint32(s.mac.Size()) } if length <= paddingLength+1 { return nil, errors.New("ssh: invalid packet length, packet too small") } if length > maxPacket { return nil, errors.New("ssh: invalid packet length, packet too large") } // the maxPacket check above ensures that length-1+macSize // does not overflow. if uint32(cap(s.packetData)) < length-1+macSize { s.packetData = make([]byte, length-1+macSize) } else { s.packetData = s.packetData[:length-1+macSize] } if _, err := io.ReadFull(r, s.packetData); err != nil { return nil, err } mac := s.packetData[length-1:] data := s.packetData[:length-1] if s.mac != nil && s.etm { s.mac.Write(data) } s.cipher.XORKeyStream(data, data) if s.mac != nil { if !s.etm { s.mac.Write(data) } s.macResult = s.mac.Sum(s.macResult[:0]) if subtle.ConstantTimeCompare(s.macResult, mac) != 1 { return nil, errors.New("ssh: MAC failure") } } return s.packetData[:length-paddingLength-1], nil } // writePacket encrypts and sends a packet of data to the writer argument func (s *streamPacketCipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, packet []byte) error { if len(packet) > maxPacket { return errors.New("ssh: packet too large") } aadlen := 0 if s.mac != nil && s.etm { // packet length is not encrypted for EtM modes aadlen = 4 } paddingLength := packetSizeMultiple - (prefixLen+len(packet)-aadlen)%packetSizeMultiple if paddingLength < 4 { paddingLength += packetSizeMultiple } length := len(packet) + 1 + paddingLength binary.BigEndian.PutUint32(s.prefix[:], uint32(length)) s.prefix[4] = byte(paddingLength) padding := s.padding[:paddingLength] if _, err := io.ReadFull(rand, padding); err != nil { return err } if s.mac != nil { s.mac.Reset() binary.BigEndian.PutUint32(s.seqNumBytes[:], seqNum) s.mac.Write(s.seqNumBytes[:]) if s.etm { // For EtM algorithms, the packet length must stay unencrypted, // but the following data (padding length) must be encrypted s.cipher.XORKeyStream(s.prefix[4:5], s.prefix[4:5]) } s.mac.Write(s.prefix[:]) if !s.etm { // For non-EtM algorithms, the algorithm is applied on unencrypted data s.mac.Write(packet) s.mac.Write(padding) } } if !(s.mac != nil && s.etm) { // For EtM algorithms, the padding length has already been encrypted // and the packet length must remain unencrypted s.cipher.XORKeyStream(s.prefix[:], s.prefix[:]) } s.cipher.XORKeyStream(packet, packet) s.cipher.XORKeyStream(padding, padding) if s.mac != nil && s.etm { // For EtM algorithms, packet and padding must be encrypted s.mac.Write(packet) s.mac.Write(padding) } if _, err := w.Write(s.prefix[:]); err != nil { return err } if _, err := w.Write(packet); err != nil { return err } if _, err := w.Write(padding); err != nil { return err } if s.mac != nil { s.macResult = s.mac.Sum(s.macResult[:0]) if _, err := w.Write(s.macResult); err != nil { return err } } return nil } type gcmCipher struct { aead cipher.AEAD prefix [4]byte iv []byte buf []byte } func newGCMCipher(key, iv, unusedMacKey []byte, unusedAlgs directionAlgorithms) (packetCipher, error) { c, err := aes.NewCipher(key) if err != nil { return nil, err } aead, err := cipher.NewGCM(c) if err != nil { return nil, err } return &gcmCipher{ aead: aead, iv: iv, }, nil } const gcmTagSize = 16 func (c *gcmCipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, packet []byte) error { // Pad out to multiple of 16 bytes. This is different from the // stream cipher because that encrypts the length too. padding := byte(packetSizeMultiple - (1+len(packet))%packetSizeMultiple) if padding < 4 { padding += packetSizeMultiple } length := uint32(len(packet) + int(padding) + 1) binary.BigEndian.PutUint32(c.prefix[:], length) if _, err := w.Write(c.prefix[:]); err != nil { return err } if cap(c.buf) < int(length) { c.buf = make([]byte, length) } else { c.buf = c.buf[:length] } c.buf[0] = padding copy(c.buf[1:], packet) if _, err := io.ReadFull(rand, c.buf[1+len(packet):]); err != nil { return err } c.buf = c.aead.Seal(c.buf[:0], c.iv, c.buf, c.prefix[:]) if _, err := w.Write(c.buf); err != nil { return err } c.incIV() return nil } func (c *gcmCipher) incIV() { for i := 4 + 7; i >= 4; i-- { c.iv[i]++ if c.iv[i] != 0 { break } } } func (c *gcmCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) { if _, err := io.ReadFull(r, c.prefix[:]); err != nil { return nil, err } length := binary.BigEndian.Uint32(c.prefix[:]) if length > maxPacket { return nil, errors.New("ssh: max packet length exceeded") } if cap(c.buf) < int(length+gcmTagSize) { c.buf = make([]byte, length+gcmTagSize) } else { c.buf = c.buf[:length+gcmTagSize] } if _, err := io.ReadFull(r, c.buf); err != nil { return nil, err } plain, err := c.aead.Open(c.buf[:0], c.iv, c.buf, c.prefix[:]) if err != nil { return nil, err } c.incIV() padding := plain[0] if padding < 4 { // padding is a byte, so it automatically satisfies // the maximum size, which is 255. return nil, fmt.Errorf("ssh: illegal padding %d", padding) } if int(padding+1) >= len(plain) { return nil, fmt.Errorf("ssh: padding %d too large", padding) } plain = plain[1 : length-uint32(padding)] return plain, nil } // cbcCipher implements aes128-cbc cipher defined in RFC 4253 section 6.1 type cbcCipher struct { mac hash.Hash macSize uint32 decrypter cipher.BlockMode encrypter cipher.BlockMode // The following members are to avoid per-packet allocations. seqNumBytes [4]byte packetData []byte macResult []byte // Amount of data we should still read to hide which // verification error triggered. oracleCamouflage uint32 } func newCBCCipher(c cipher.Block, key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) { cbc := &cbcCipher{ mac: macModes[algs.MAC].new(macKey), decrypter: cipher.NewCBCDecrypter(c, iv), encrypter: cipher.NewCBCEncrypter(c, iv), packetData: make([]byte, 1024), } if cbc.mac != nil { cbc.macSize = uint32(cbc.mac.Size()) } return cbc, nil } func newAESCBCCipher(key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) { c, err := aes.NewCipher(key) if err != nil { return nil, err } cbc, err := newCBCCipher(c, key, iv, macKey, algs) if err != nil { return nil, err } return cbc, nil } func newTripleDESCBCCipher(key, iv, macKey []byte, algs directionAlgorithms) (packetCipher, error) { c, err := des.NewTripleDESCipher(key) if err != nil { return nil, err } cbc, err := newCBCCipher(c, key, iv, macKey, algs) if err != nil { return nil, err } return cbc, nil } func maxUInt32(a, b int) uint32 { if a > b { return uint32(a) } return uint32(b) } const ( cbcMinPacketSizeMultiple = 8 cbcMinPacketSize = 16 cbcMinPaddingSize = 4 ) // cbcError represents a verification error that may leak information. type cbcError string func (e cbcError) Error() string { return string(e) } func (c *cbcCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) { p, err := c.readPacketLeaky(seqNum, r) if err != nil { if _, ok := err.(cbcError); ok { // Verification error: read a fixed amount of // data, to make distinguishing between // failing MAC and failing length check more // difficult. io.CopyN(ioutil.Discard, r, int64(c.oracleCamouflage)) } } return p, err } func (c *cbcCipher) readPacketLeaky(seqNum uint32, r io.Reader) ([]byte, error) { blockSize := c.decrypter.BlockSize() // Read the header, which will include some of the subsequent data in the // case of block ciphers - this is copied back to the payload later. // How many bytes of payload/padding will be read with this first read. firstBlockLength := uint32((prefixLen + blockSize - 1) / blockSize * blockSize) firstBlock := c.packetData[:firstBlockLength] if _, err := io.ReadFull(r, firstBlock); err != nil { return nil, err } c.oracleCamouflage = maxPacket + 4 + c.macSize - firstBlockLength c.decrypter.CryptBlocks(firstBlock, firstBlock) length := binary.BigEndian.Uint32(firstBlock[:4]) if length > maxPacket { return nil, cbcError("ssh: packet too large") } if length+4 < maxUInt32(cbcMinPacketSize, blockSize) { // The minimum size of a packet is 16 (or the cipher block size, whichever // is larger) bytes. return nil, cbcError("ssh: packet too small") } // The length of the packet (including the length field but not the MAC) must // be a multiple of the block size or 8, whichever is larger. if (length+4)%maxUInt32(cbcMinPacketSizeMultiple, blockSize) != 0 { return nil, cbcError("ssh: invalid packet length multiple") } paddingLength := uint32(firstBlock[4]) if paddingLength < cbcMinPaddingSize || length <= paddingLength+1 { return nil, cbcError("ssh: invalid packet length") } // Positions within the c.packetData buffer: macStart := 4 + length paddingStart := macStart - paddingLength // Entire packet size, starting before length, ending at end of mac. entirePacketSize := macStart + c.macSize // Ensure c.packetData is large enough for the entire packet data. if uint32(cap(c.packetData)) < entirePacketSize { // Still need to upsize and copy, but this should be rare at runtime, only // on upsizing the packetData buffer. c.packetData = make([]byte, entirePacketSize) copy(c.packetData, firstBlock) } else { c.packetData = c.packetData[:entirePacketSize] } n, err := io.ReadFull(r, c.packetData[firstBlockLength:]) if err != nil { return nil, err } c.oracleCamouflage -= uint32(n) remainingCrypted := c.packetData[firstBlockLength:macStart] c.decrypter.CryptBlocks(remainingCrypted, remainingCrypted) mac := c.packetData[macStart:] if c.mac != nil { c.mac.Reset() binary.BigEndian.PutUint32(c.seqNumBytes[:], seqNum) c.mac.Write(c.seqNumBytes[:]) c.mac.Write(c.packetData[:macStart]) c.macResult = c.mac.Sum(c.macResult[:0]) if subtle.ConstantTimeCompare(c.macResult, mac) != 1 { return nil, cbcError("ssh: MAC failure") } } return c.packetData[prefixLen:paddingStart], nil } func (c *cbcCipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, packet []byte) error { effectiveBlockSize := maxUInt32(cbcMinPacketSizeMultiple, c.encrypter.BlockSize()) // Length of encrypted portion of the packet (header, payload, padding). // Enforce minimum padding and packet size. encLength := maxUInt32(prefixLen+len(packet)+cbcMinPaddingSize, cbcMinPaddingSize) // Enforce block size. encLength = (encLength + effectiveBlockSize - 1) / effectiveBlockSize * effectiveBlockSize length := encLength - 4 paddingLength := int(length) - (1 + len(packet)) // Overall buffer contains: header, payload, padding, mac. // Space for the MAC is reserved in the capacity but not the slice length. bufferSize := encLength + c.macSize if uint32(cap(c.packetData)) < bufferSize { c.packetData = make([]byte, encLength, bufferSize) } else { c.packetData = c.packetData[:encLength] } p := c.packetData // Packet header. binary.BigEndian.PutUint32(p, length) p = p[4:] p[0] = byte(paddingLength) // Payload. p = p[1:] copy(p, packet) // Padding. p = p[len(packet):] if _, err := io.ReadFull(rand, p); err != nil { return err } if c.mac != nil { c.mac.Reset() binary.BigEndian.PutUint32(c.seqNumBytes[:], seqNum) c.mac.Write(c.seqNumBytes[:]) c.mac.Write(c.packetData) // The MAC is now appended into the capacity reserved for it earlier. c.packetData = c.mac.Sum(c.packetData) } c.encrypter.CryptBlocks(c.packetData[:encLength], c.packetData[:encLength]) if _, err := w.Write(c.packetData); err != nil { return err } return nil } const chacha20Poly1305ID = "chacha20-poly1305@openssh.com" // chacha20Poly1305Cipher implements the chacha20-poly1305@openssh.com // AEAD, which is described here: // // https://tools.ietf.org/html/draft-josefsson-ssh-chacha20-poly1305-openssh-00 // // the methods here also implement padding, which RFC4253 Section 6 // also requires of stream ciphers. type chacha20Poly1305Cipher struct { lengthKey [8]uint32 contentKey [8]uint32 buf []byte } func newChaCha20Cipher(key, unusedIV, unusedMACKey []byte, unusedAlgs directionAlgorithms) (packetCipher, error) { if len(key) != 64 { panic(len(key)) } c := &chacha20Poly1305Cipher{ buf: make([]byte, 256), } for i := range c.contentKey { c.contentKey[i] = binary.LittleEndian.Uint32(key[i*4 : (i+1)*4]) } for i := range c.lengthKey { c.lengthKey[i] = binary.LittleEndian.Uint32(key[(i+8)*4 : (i+9)*4]) } return c, nil } func (c *chacha20Poly1305Cipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) { nonce := [3]uint32{0, 0, bits.ReverseBytes32(seqNum)} s := chacha20.New(c.contentKey, nonce) var polyKey [32]byte s.XORKeyStream(polyKey[:], polyKey[:]) s.Advance() // skip next 32 bytes encryptedLength := c.buf[:4] if _, err := io.ReadFull(r, encryptedLength); err != nil { return nil, err } var lenBytes [4]byte chacha20.New(c.lengthKey, nonce).XORKeyStream(lenBytes[:], encryptedLength) length := binary.BigEndian.Uint32(lenBytes[:]) if length > maxPacket { return nil, errors.New("ssh: invalid packet length, packet too large") } contentEnd := 4 + length packetEnd := contentEnd + poly1305.TagSize if uint32(cap(c.buf)) < packetEnd { c.buf = make([]byte, packetEnd) copy(c.buf[:], encryptedLength) } else { c.buf = c.buf[:packetEnd] } if _, err := io.ReadFull(r, c.buf[4:packetEnd]); err != nil { return nil, err } var mac [poly1305.TagSize]byte copy(mac[:], c.buf[contentEnd:packetEnd]) if !poly1305.Verify(&mac, c.buf[:contentEnd], &polyKey) { return nil, errors.New("ssh: MAC failure") } plain := c.buf[4:contentEnd] s.XORKeyStream(plain, plain) padding := plain[0] if padding < 4 { // padding is a byte, so it automatically satisfies // the maximum size, which is 255. return nil, fmt.Errorf("ssh: illegal padding %d", padding) } if int(padding)+1 >= len(plain) { return nil, fmt.Errorf("ssh: padding %d too large", padding) } plain = plain[1 : len(plain)-int(padding)] return plain, nil } func (c *chacha20Poly1305Cipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, payload []byte) error { nonce := [3]uint32{0, 0, bits.ReverseBytes32(seqNum)} s := chacha20.New(c.contentKey, nonce) var polyKey [32]byte s.XORKeyStream(polyKey[:], polyKey[:]) s.Advance() // skip next 32 bytes // There is no blocksize, so fall back to multiple of 8 byte // padding, as described in RFC 4253, Sec 6. const packetSizeMultiple = 8 padding := packetSizeMultiple - (1+len(payload))%packetSizeMultiple if padding < 4 { padding += packetSizeMultiple } // size (4 bytes), padding (1), payload, padding, tag. totalLength := 4 + 1 + len(payload) + padding + poly1305.TagSize if cap(c.buf) < totalLength { c.buf = make([]byte, totalLength) } else { c.buf = c.buf[:totalLength] } binary.BigEndian.PutUint32(c.buf, uint32(1+len(payload)+padding)) chacha20.New(c.lengthKey, nonce).XORKeyStream(c.buf, c.buf[:4]) c.buf[4] = byte(padding) copy(c.buf[5:], payload) packetEnd := 5 + len(payload) + padding if _, err := io.ReadFull(rand, c.buf[5+len(payload):packetEnd]); err != nil { return err } s.XORKeyStream(c.buf[4:], c.buf[4:packetEnd]) var mac [poly1305.TagSize]byte poly1305.Sum(&mac, c.buf[:packetEnd], &polyKey) copy(c.buf[packetEnd:], mac[:]) if _, err := w.Write(c.buf); err != nil { return err } return nil } ================================================ FILE: vendor/golang.org/x/crypto/ssh/client.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "bytes" "errors" "fmt" "net" "os" "sync" "time" ) // Client implements a traditional SSH client that supports shells, // subprocesses, TCP port/streamlocal forwarding and tunneled dialing. type Client struct { Conn handleForwardsOnce sync.Once // guards calling (*Client).handleForwards forwards forwardList // forwarded tcpip connections from the remote side mu sync.Mutex channelHandlers map[string]chan NewChannel } // HandleChannelOpen returns a channel on which NewChannel requests // for the given type are sent. If the type already is being handled, // nil is returned. The channel is closed when the connection is closed. func (c *Client) HandleChannelOpen(channelType string) <-chan NewChannel { c.mu.Lock() defer c.mu.Unlock() if c.channelHandlers == nil { // The SSH channel has been closed. c := make(chan NewChannel) close(c) return c } ch := c.channelHandlers[channelType] if ch != nil { return nil } ch = make(chan NewChannel, chanSize) c.channelHandlers[channelType] = ch return ch } // NewClient creates a Client on top of the given connection. func NewClient(c Conn, chans <-chan NewChannel, reqs <-chan *Request) *Client { conn := &Client{ Conn: c, channelHandlers: make(map[string]chan NewChannel, 1), } go conn.handleGlobalRequests(reqs) go conn.handleChannelOpens(chans) go func() { conn.Wait() conn.forwards.closeAll() }() return conn } // NewClientConn establishes an authenticated SSH connection using c // as the underlying transport. The Request and NewChannel channels // must be serviced or the connection will hang. func NewClientConn(c net.Conn, addr string, config *ClientConfig) (Conn, <-chan NewChannel, <-chan *Request, error) { fullConf := *config fullConf.SetDefaults() if fullConf.HostKeyCallback == nil { c.Close() return nil, nil, nil, errors.New("ssh: must specify HostKeyCallback") } conn := &connection{ sshConn: sshConn{conn: c}, } if err := conn.clientHandshake(addr, &fullConf); err != nil { c.Close() return nil, nil, nil, fmt.Errorf("ssh: handshake failed: %v", err) } conn.mux = newMux(conn.transport) return conn, conn.mux.incomingChannels, conn.mux.incomingRequests, nil } // clientHandshake performs the client side key exchange. See RFC 4253 Section // 7. func (c *connection) clientHandshake(dialAddress string, config *ClientConfig) error { if config.ClientVersion != "" { c.clientVersion = []byte(config.ClientVersion) } else { c.clientVersion = []byte(packageVersion) } var err error c.serverVersion, err = exchangeVersions(c.sshConn.conn, c.clientVersion) if err != nil { return err } c.transport = newClientTransport( newTransport(c.sshConn.conn, config.Rand, true /* is client */), c.clientVersion, c.serverVersion, config, dialAddress, c.sshConn.RemoteAddr()) if err := c.transport.waitSession(); err != nil { return err } c.sessionID = c.transport.getSessionID() return c.clientAuthenticate(config) } // verifyHostKeySignature verifies the host key obtained in the key // exchange. func verifyHostKeySignature(hostKey PublicKey, result *kexResult) error { sig, rest, ok := parseSignatureBody(result.Signature) if len(rest) > 0 || !ok { return errors.New("ssh: signature parse error") } return hostKey.Verify(result.H, sig) } // NewSession opens a new Session for this client. (A session is a remote // execution of a program.) func (c *Client) NewSession() (*Session, error) { ch, in, err := c.OpenChannel("session", nil) if err != nil { return nil, err } return newSession(ch, in) } func (c *Client) handleGlobalRequests(incoming <-chan *Request) { for r := range incoming { // This handles keepalive messages and matches // the behaviour of OpenSSH. r.Reply(false, nil) } } // handleChannelOpens channel open messages from the remote side. func (c *Client) handleChannelOpens(in <-chan NewChannel) { for ch := range in { c.mu.Lock() handler := c.channelHandlers[ch.ChannelType()] c.mu.Unlock() if handler != nil { handler <- ch } else { ch.Reject(UnknownChannelType, fmt.Sprintf("unknown channel type: %v", ch.ChannelType())) } } c.mu.Lock() for _, ch := range c.channelHandlers { close(ch) } c.channelHandlers = nil c.mu.Unlock() } // Dial starts a client connection to the given SSH server. It is a // convenience function that connects to the given network address, // initiates the SSH handshake, and then sets up a Client. For access // to incoming channels and requests, use net.Dial with NewClientConn // instead. func Dial(network, addr string, config *ClientConfig) (*Client, error) { conn, err := net.DialTimeout(network, addr, config.Timeout) if err != nil { return nil, err } c, chans, reqs, err := NewClientConn(conn, addr, config) if err != nil { return nil, err } return NewClient(c, chans, reqs), nil } // HostKeyCallback is the function type used for verifying server // keys. A HostKeyCallback must return nil if the host key is OK, or // an error to reject it. It receives the hostname as passed to Dial // or NewClientConn. The remote address is the RemoteAddr of the // net.Conn underlying the SSH connection. type HostKeyCallback func(hostname string, remote net.Addr, key PublicKey) error // BannerCallback is the function type used for treat the banner sent by // the server. A BannerCallback receives the message sent by the remote server. type BannerCallback func(message string) error // A ClientConfig structure is used to configure a Client. It must not be // modified after having been passed to an SSH function. type ClientConfig struct { // Config contains configuration that is shared between clients and // servers. Config // User contains the username to authenticate as. User string // Auth contains possible authentication methods to use with the // server. Only the first instance of a particular RFC 4252 method will // be used during authentication. Auth []AuthMethod // HostKeyCallback is called during the cryptographic // handshake to validate the server's host key. The client // configuration must supply this callback for the connection // to succeed. The functions InsecureIgnoreHostKey or // FixedHostKey can be used for simplistic host key checks. HostKeyCallback HostKeyCallback // BannerCallback is called during the SSH dance to display a custom // server's message. The client configuration can supply this callback to // handle it as wished. The function BannerDisplayStderr can be used for // simplistic display on Stderr. BannerCallback BannerCallback // ClientVersion contains the version identification string that will // be used for the connection. If empty, a reasonable default is used. ClientVersion string // HostKeyAlgorithms lists the key types that the client will // accept from the server as host key, in order of // preference. If empty, a reasonable default is used. Any // string returned from PublicKey.Type method may be used, or // any of the CertAlgoXxxx and KeyAlgoXxxx constants. HostKeyAlgorithms []string // Timeout is the maximum amount of time for the TCP connection to establish. // // A Timeout of zero means no timeout. Timeout time.Duration } // InsecureIgnoreHostKey returns a function that can be used for // ClientConfig.HostKeyCallback to accept any host key. It should // not be used for production code. func InsecureIgnoreHostKey() HostKeyCallback { return func(hostname string, remote net.Addr, key PublicKey) error { return nil } } type fixedHostKey struct { key PublicKey } func (f *fixedHostKey) check(hostname string, remote net.Addr, key PublicKey) error { if f.key == nil { return fmt.Errorf("ssh: required host key was nil") } if !bytes.Equal(key.Marshal(), f.key.Marshal()) { return fmt.Errorf("ssh: host key mismatch") } return nil } // FixedHostKey returns a function for use in // ClientConfig.HostKeyCallback to accept only a specific host key. func FixedHostKey(key PublicKey) HostKeyCallback { hk := &fixedHostKey{key} return hk.check } // BannerDisplayStderr returns a function that can be used for // ClientConfig.BannerCallback to display banners on os.Stderr. func BannerDisplayStderr() BannerCallback { return func(banner string) error { _, err := os.Stderr.WriteString(banner) return err } } ================================================ FILE: vendor/golang.org/x/crypto/ssh/client_auth.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "bytes" "errors" "fmt" "io" ) type authResult int const ( authFailure authResult = iota authPartialSuccess authSuccess ) // clientAuthenticate authenticates with the remote server. See RFC 4252. func (c *connection) clientAuthenticate(config *ClientConfig) error { // initiate user auth session if err := c.transport.writePacket(Marshal(&serviceRequestMsg{serviceUserAuth})); err != nil { return err } packet, err := c.transport.readPacket() if err != nil { return err } var serviceAccept serviceAcceptMsg if err := Unmarshal(packet, &serviceAccept); err != nil { return err } // during the authentication phase the client first attempts the "none" method // then any untried methods suggested by the server. tried := make(map[string]bool) var lastMethods []string sessionID := c.transport.getSessionID() for auth := AuthMethod(new(noneAuth)); auth != nil; { ok, methods, err := auth.auth(sessionID, config.User, c.transport, config.Rand) if err != nil { return err } if ok == authSuccess { // success return nil } else if ok == authFailure { tried[auth.method()] = true } if methods == nil { methods = lastMethods } lastMethods = methods auth = nil findNext: for _, a := range config.Auth { candidateMethod := a.method() if tried[candidateMethod] { continue } for _, meth := range methods { if meth == candidateMethod { auth = a break findNext } } } } return fmt.Errorf("ssh: unable to authenticate, attempted methods %v, no supported methods remain", keys(tried)) } func keys(m map[string]bool) []string { s := make([]string, 0, len(m)) for key := range m { s = append(s, key) } return s } // An AuthMethod represents an instance of an RFC 4252 authentication method. type AuthMethod interface { // auth authenticates user over transport t. // Returns true if authentication is successful. // If authentication is not successful, a []string of alternative // method names is returned. If the slice is nil, it will be ignored // and the previous set of possible methods will be reused. auth(session []byte, user string, p packetConn, rand io.Reader) (authResult, []string, error) // method returns the RFC 4252 method name. method() string } // "none" authentication, RFC 4252 section 5.2. type noneAuth int func (n *noneAuth) auth(session []byte, user string, c packetConn, rand io.Reader) (authResult, []string, error) { if err := c.writePacket(Marshal(&userAuthRequestMsg{ User: user, Service: serviceSSH, Method: "none", })); err != nil { return authFailure, nil, err } return handleAuthResponse(c) } func (n *noneAuth) method() string { return "none" } // passwordCallback is an AuthMethod that fetches the password through // a function call, e.g. by prompting the user. type passwordCallback func() (password string, err error) func (cb passwordCallback) auth(session []byte, user string, c packetConn, rand io.Reader) (authResult, []string, error) { type passwordAuthMsg struct { User string `sshtype:"50"` Service string Method string Reply bool Password string } pw, err := cb() // REVIEW NOTE: is there a need to support skipping a password attempt? // The program may only find out that the user doesn't have a password // when prompting. if err != nil { return authFailure, nil, err } if err := c.writePacket(Marshal(&passwordAuthMsg{ User: user, Service: serviceSSH, Method: cb.method(), Reply: false, Password: pw, })); err != nil { return authFailure, nil, err } return handleAuthResponse(c) } func (cb passwordCallback) method() string { return "password" } // Password returns an AuthMethod using the given password. func Password(secret string) AuthMethod { return passwordCallback(func() (string, error) { return secret, nil }) } // PasswordCallback returns an AuthMethod that uses a callback for // fetching a password. func PasswordCallback(prompt func() (secret string, err error)) AuthMethod { return passwordCallback(prompt) } type publickeyAuthMsg struct { User string `sshtype:"50"` Service string Method string // HasSig indicates to the receiver packet that the auth request is signed and // should be used for authentication of the request. HasSig bool Algoname string PubKey []byte // Sig is tagged with "rest" so Marshal will exclude it during // validateKey Sig []byte `ssh:"rest"` } // publicKeyCallback is an AuthMethod that uses a set of key // pairs for authentication. type publicKeyCallback func() ([]Signer, error) func (cb publicKeyCallback) method() string { return "publickey" } func (cb publicKeyCallback) auth(session []byte, user string, c packetConn, rand io.Reader) (authResult, []string, error) { // Authentication is performed by sending an enquiry to test if a key is // acceptable to the remote. If the key is acceptable, the client will // attempt to authenticate with the valid key. If not the client will repeat // the process with the remaining keys. signers, err := cb() if err != nil { return authFailure, nil, err } var methods []string for _, signer := range signers { ok, err := validateKey(signer.PublicKey(), user, c) if err != nil { return authFailure, nil, err } if !ok { continue } pub := signer.PublicKey() pubKey := pub.Marshal() sign, err := signer.Sign(rand, buildDataSignedForAuth(session, userAuthRequestMsg{ User: user, Service: serviceSSH, Method: cb.method(), }, []byte(pub.Type()), pubKey)) if err != nil { return authFailure, nil, err } // manually wrap the serialized signature in a string s := Marshal(sign) sig := make([]byte, stringLength(len(s))) marshalString(sig, s) msg := publickeyAuthMsg{ User: user, Service: serviceSSH, Method: cb.method(), HasSig: true, Algoname: pub.Type(), PubKey: pubKey, Sig: sig, } p := Marshal(&msg) if err := c.writePacket(p); err != nil { return authFailure, nil, err } var success authResult success, methods, err = handleAuthResponse(c) if err != nil { return authFailure, nil, err } // If authentication succeeds or the list of available methods does not // contain the "publickey" method, do not attempt to authenticate with any // other keys. According to RFC 4252 Section 7, the latter can occur when // additional authentication methods are required. if success == authSuccess || !containsMethod(methods, cb.method()) { return success, methods, err } } return authFailure, methods, nil } func containsMethod(methods []string, method string) bool { for _, m := range methods { if m == method { return true } } return false } // validateKey validates the key provided is acceptable to the server. func validateKey(key PublicKey, user string, c packetConn) (bool, error) { pubKey := key.Marshal() msg := publickeyAuthMsg{ User: user, Service: serviceSSH, Method: "publickey", HasSig: false, Algoname: key.Type(), PubKey: pubKey, } if err := c.writePacket(Marshal(&msg)); err != nil { return false, err } return confirmKeyAck(key, c) } func confirmKeyAck(key PublicKey, c packetConn) (bool, error) { pubKey := key.Marshal() algoname := key.Type() for { packet, err := c.readPacket() if err != nil { return false, err } switch packet[0] { case msgUserAuthBanner: if err := handleBannerResponse(c, packet); err != nil { return false, err } case msgUserAuthPubKeyOk: var msg userAuthPubKeyOkMsg if err := Unmarshal(packet, &msg); err != nil { return false, err } if msg.Algo != algoname || !bytes.Equal(msg.PubKey, pubKey) { return false, nil } return true, nil case msgUserAuthFailure: return false, nil default: return false, unexpectedMessageError(msgUserAuthSuccess, packet[0]) } } } // PublicKeys returns an AuthMethod that uses the given key // pairs. func PublicKeys(signers ...Signer) AuthMethod { return publicKeyCallback(func() ([]Signer, error) { return signers, nil }) } // PublicKeysCallback returns an AuthMethod that runs the given // function to obtain a list of key pairs. func PublicKeysCallback(getSigners func() (signers []Signer, err error)) AuthMethod { return publicKeyCallback(getSigners) } // handleAuthResponse returns whether the preceding authentication request succeeded // along with a list of remaining authentication methods to try next and // an error if an unexpected response was received. func handleAuthResponse(c packetConn) (authResult, []string, error) { for { packet, err := c.readPacket() if err != nil { return authFailure, nil, err } switch packet[0] { case msgUserAuthBanner: if err := handleBannerResponse(c, packet); err != nil { return authFailure, nil, err } case msgUserAuthFailure: var msg userAuthFailureMsg if err := Unmarshal(packet, &msg); err != nil { return authFailure, nil, err } if msg.PartialSuccess { return authPartialSuccess, msg.Methods, nil } return authFailure, msg.Methods, nil case msgUserAuthSuccess: return authSuccess, nil, nil default: return authFailure, nil, unexpectedMessageError(msgUserAuthSuccess, packet[0]) } } } func handleBannerResponse(c packetConn, packet []byte) error { var msg userAuthBannerMsg if err := Unmarshal(packet, &msg); err != nil { return err } transport, ok := c.(*handshakeTransport) if !ok { return nil } if transport.bannerCallback != nil { return transport.bannerCallback(msg.Message) } return nil } // KeyboardInteractiveChallenge should print questions, optionally // disabling echoing (e.g. for passwords), and return all the answers. // Challenge may be called multiple times in a single session. After // successful authentication, the server may send a challenge with no // questions, for which the user and instruction messages should be // printed. RFC 4256 section 3.3 details how the UI should behave for // both CLI and GUI environments. type KeyboardInteractiveChallenge func(user, instruction string, questions []string, echos []bool) (answers []string, err error) // KeyboardInteractive returns an AuthMethod using a prompt/response // sequence controlled by the server. func KeyboardInteractive(challenge KeyboardInteractiveChallenge) AuthMethod { return challenge } func (cb KeyboardInteractiveChallenge) method() string { return "keyboard-interactive" } func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packetConn, rand io.Reader) (authResult, []string, error) { type initiateMsg struct { User string `sshtype:"50"` Service string Method string Language string Submethods string } if err := c.writePacket(Marshal(&initiateMsg{ User: user, Service: serviceSSH, Method: "keyboard-interactive", })); err != nil { return authFailure, nil, err } for { packet, err := c.readPacket() if err != nil { return authFailure, nil, err } // like handleAuthResponse, but with less options. switch packet[0] { case msgUserAuthBanner: if err := handleBannerResponse(c, packet); err != nil { return authFailure, nil, err } continue case msgUserAuthInfoRequest: // OK case msgUserAuthFailure: var msg userAuthFailureMsg if err := Unmarshal(packet, &msg); err != nil { return authFailure, nil, err } if msg.PartialSuccess { return authPartialSuccess, msg.Methods, nil } return authFailure, msg.Methods, nil case msgUserAuthSuccess: return authSuccess, nil, nil default: return authFailure, nil, unexpectedMessageError(msgUserAuthInfoRequest, packet[0]) } var msg userAuthInfoRequestMsg if err := Unmarshal(packet, &msg); err != nil { return authFailure, nil, err } // Manually unpack the prompt/echo pairs. rest := msg.Prompts var prompts []string var echos []bool for i := 0; i < int(msg.NumPrompts); i++ { prompt, r, ok := parseString(rest) if !ok || len(r) == 0 { return authFailure, nil, errors.New("ssh: prompt format error") } prompts = append(prompts, string(prompt)) echos = append(echos, r[0] != 0) rest = r[1:] } if len(rest) != 0 { return authFailure, nil, errors.New("ssh: extra data following keyboard-interactive pairs") } answers, err := cb(msg.User, msg.Instruction, prompts, echos) if err != nil { return authFailure, nil, err } if len(answers) != len(prompts) { return authFailure, nil, errors.New("ssh: not enough answers from keyboard-interactive callback") } responseLength := 1 + 4 for _, a := range answers { responseLength += stringLength(len(a)) } serialized := make([]byte, responseLength) p := serialized p[0] = msgUserAuthInfoResponse p = p[1:] p = marshalUint32(p, uint32(len(answers))) for _, a := range answers { p = marshalString(p, []byte(a)) } if err := c.writePacket(serialized); err != nil { return authFailure, nil, err } } } type retryableAuthMethod struct { authMethod AuthMethod maxTries int } func (r *retryableAuthMethod) auth(session []byte, user string, c packetConn, rand io.Reader) (ok authResult, methods []string, err error) { for i := 0; r.maxTries <= 0 || i < r.maxTries; i++ { ok, methods, err = r.authMethod.auth(session, user, c, rand) if ok != authFailure || err != nil { // either success, partial success or error terminate return ok, methods, err } } return ok, methods, err } func (r *retryableAuthMethod) method() string { return r.authMethod.method() } // RetryableAuthMethod is a decorator for other auth methods enabling them to // be retried up to maxTries before considering that AuthMethod itself failed. // If maxTries is <= 0, will retry indefinitely // // This is useful for interactive clients using challenge/response type // authentication (e.g. Keyboard-Interactive, Password, etc) where the user // could mistype their response resulting in the server issuing a // SSH_MSG_USERAUTH_FAILURE (rfc4252 #8 [password] and rfc4256 #3.4 // [keyboard-interactive]); Without this decorator, the non-retryable // AuthMethod would be removed from future consideration, and never tried again // (and so the user would never be able to retry their entry). func RetryableAuthMethod(auth AuthMethod, maxTries int) AuthMethod { return &retryableAuthMethod{authMethod: auth, maxTries: maxTries} } ================================================ FILE: vendor/golang.org/x/crypto/ssh/common.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "crypto" "crypto/rand" "fmt" "io" "math" "sync" _ "crypto/sha1" _ "crypto/sha256" _ "crypto/sha512" ) // These are string constants in the SSH protocol. const ( compressionNone = "none" serviceUserAuth = "ssh-userauth" serviceSSH = "ssh-connection" ) // supportedCiphers lists ciphers we support but might not recommend. var supportedCiphers = []string{ "aes128-ctr", "aes192-ctr", "aes256-ctr", "aes128-gcm@openssh.com", chacha20Poly1305ID, "arcfour256", "arcfour128", "arcfour", aes128cbcID, tripledescbcID, } // preferredCiphers specifies the default preference for ciphers. var preferredCiphers = []string{ "aes128-gcm@openssh.com", chacha20Poly1305ID, "aes128-ctr", "aes192-ctr", "aes256-ctr", } // supportedKexAlgos specifies the supported key-exchange algorithms in // preference order. var supportedKexAlgos = []string{ kexAlgoCurve25519SHA256, // P384 and P521 are not constant-time yet, but since we don't // reuse ephemeral keys, using them for ECDH should be OK. kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521, kexAlgoDH14SHA1, kexAlgoDH1SHA1, } // supportedHostKeyAlgos specifies the supported host-key algorithms (i.e. methods // of authenticating servers) in preference order. var supportedHostKeyAlgos = []string{ CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, KeyAlgoRSA, KeyAlgoDSA, KeyAlgoED25519, } // supportedMACs specifies a default set of MAC algorithms in preference order. // This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed // because they have reached the end of their useful life. var supportedMACs = []string{ "hmac-sha2-256-etm@openssh.com", "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96", } var supportedCompressions = []string{compressionNone} // hashFuncs keeps the mapping of supported algorithms to their respective // hashes needed for signature verification. var hashFuncs = map[string]crypto.Hash{ KeyAlgoRSA: crypto.SHA1, KeyAlgoDSA: crypto.SHA1, KeyAlgoECDSA256: crypto.SHA256, KeyAlgoECDSA384: crypto.SHA384, KeyAlgoECDSA521: crypto.SHA512, CertAlgoRSAv01: crypto.SHA1, CertAlgoDSAv01: crypto.SHA1, CertAlgoECDSA256v01: crypto.SHA256, CertAlgoECDSA384v01: crypto.SHA384, CertAlgoECDSA521v01: crypto.SHA512, } // unexpectedMessageError results when the SSH message that we received didn't // match what we wanted. func unexpectedMessageError(expected, got uint8) error { return fmt.Errorf("ssh: unexpected message type %d (expected %d)", got, expected) } // parseError results from a malformed SSH message. func parseError(tag uint8) error { return fmt.Errorf("ssh: parse error in message type %d", tag) } func findCommon(what string, client []string, server []string) (common string, err error) { for _, c := range client { for _, s := range server { if c == s { return c, nil } } } return "", fmt.Errorf("ssh: no common algorithm for %s; client offered: %v, server offered: %v", what, client, server) } type directionAlgorithms struct { Cipher string MAC string Compression string } // rekeyBytes returns a rekeying intervals in bytes. func (a *directionAlgorithms) rekeyBytes() int64 { // According to RFC4344 block ciphers should rekey after // 2^(BLOCKSIZE/4) blocks. For all AES flavors BLOCKSIZE is // 128. switch a.Cipher { case "aes128-ctr", "aes192-ctr", "aes256-ctr", gcmCipherID, aes128cbcID: return 16 * (1 << 32) } // For others, stick with RFC4253 recommendation to rekey after 1 Gb of data. return 1 << 30 } type algorithms struct { kex string hostKey string w directionAlgorithms r directionAlgorithms } func findAgreedAlgorithms(clientKexInit, serverKexInit *kexInitMsg) (algs *algorithms, err error) { result := &algorithms{} result.kex, err = findCommon("key exchange", clientKexInit.KexAlgos, serverKexInit.KexAlgos) if err != nil { return } result.hostKey, err = findCommon("host key", clientKexInit.ServerHostKeyAlgos, serverKexInit.ServerHostKeyAlgos) if err != nil { return } result.w.Cipher, err = findCommon("client to server cipher", clientKexInit.CiphersClientServer, serverKexInit.CiphersClientServer) if err != nil { return } result.r.Cipher, err = findCommon("server to client cipher", clientKexInit.CiphersServerClient, serverKexInit.CiphersServerClient) if err != nil { return } result.w.MAC, err = findCommon("client to server MAC", clientKexInit.MACsClientServer, serverKexInit.MACsClientServer) if err != nil { return } result.r.MAC, err = findCommon("server to client MAC", clientKexInit.MACsServerClient, serverKexInit.MACsServerClient) if err != nil { return } result.w.Compression, err = findCommon("client to server compression", clientKexInit.CompressionClientServer, serverKexInit.CompressionClientServer) if err != nil { return } result.r.Compression, err = findCommon("server to client compression", clientKexInit.CompressionServerClient, serverKexInit.CompressionServerClient) if err != nil { return } return result, nil } // If rekeythreshold is too small, we can't make any progress sending // stuff. const minRekeyThreshold uint64 = 256 // Config contains configuration data common to both ServerConfig and // ClientConfig. type Config struct { // Rand provides the source of entropy for cryptographic // primitives. If Rand is nil, the cryptographic random reader // in package crypto/rand will be used. Rand io.Reader // The maximum number of bytes sent or received after which a // new key is negotiated. It must be at least 256. If // unspecified, a size suitable for the chosen cipher is used. RekeyThreshold uint64 // The allowed key exchanges algorithms. If unspecified then a // default set of algorithms is used. KeyExchanges []string // The allowed cipher algorithms. If unspecified then a sensible // default is used. Ciphers []string // The allowed MAC algorithms. If unspecified then a sensible default // is used. MACs []string } // SetDefaults sets sensible values for unset fields in config. This is // exported for testing: Configs passed to SSH functions are copied and have // default values set automatically. func (c *Config) SetDefaults() { if c.Rand == nil { c.Rand = rand.Reader } if c.Ciphers == nil { c.Ciphers = preferredCiphers } var ciphers []string for _, c := range c.Ciphers { if cipherModes[c] != nil { // reject the cipher if we have no cipherModes definition ciphers = append(ciphers, c) } } c.Ciphers = ciphers if c.KeyExchanges == nil { c.KeyExchanges = supportedKexAlgos } if c.MACs == nil { c.MACs = supportedMACs } if c.RekeyThreshold == 0 { // cipher specific default } else if c.RekeyThreshold < minRekeyThreshold { c.RekeyThreshold = minRekeyThreshold } else if c.RekeyThreshold >= math.MaxInt64 { // Avoid weirdness if somebody uses -1 as a threshold. c.RekeyThreshold = math.MaxInt64 } } // buildDataSignedForAuth returns the data that is signed in order to prove // possession of a private key. See RFC 4252, section 7. func buildDataSignedForAuth(sessionID []byte, req userAuthRequestMsg, algo, pubKey []byte) []byte { data := struct { Session []byte Type byte User string Service string Method string Sign bool Algo []byte PubKey []byte }{ sessionID, msgUserAuthRequest, req.User, req.Service, req.Method, true, algo, pubKey, } return Marshal(data) } func appendU16(buf []byte, n uint16) []byte { return append(buf, byte(n>>8), byte(n)) } func appendU32(buf []byte, n uint32) []byte { return append(buf, byte(n>>24), byte(n>>16), byte(n>>8), byte(n)) } func appendU64(buf []byte, n uint64) []byte { return append(buf, byte(n>>56), byte(n>>48), byte(n>>40), byte(n>>32), byte(n>>24), byte(n>>16), byte(n>>8), byte(n)) } func appendInt(buf []byte, n int) []byte { return appendU32(buf, uint32(n)) } func appendString(buf []byte, s string) []byte { buf = appendU32(buf, uint32(len(s))) buf = append(buf, s...) return buf } func appendBool(buf []byte, b bool) []byte { if b { return append(buf, 1) } return append(buf, 0) } // newCond is a helper to hide the fact that there is no usable zero // value for sync.Cond. func newCond() *sync.Cond { return sync.NewCond(new(sync.Mutex)) } // window represents the buffer available to clients // wishing to write to a channel. type window struct { *sync.Cond win uint32 // RFC 4254 5.2 says the window size can grow to 2^32-1 writeWaiters int closed bool } // add adds win to the amount of window available // for consumers. func (w *window) add(win uint32) bool { // a zero sized window adjust is a noop. if win == 0 { return true } w.L.Lock() if w.win+win < win { w.L.Unlock() return false } w.win += win // It is unusual that multiple goroutines would be attempting to reserve // window space, but not guaranteed. Use broadcast to notify all waiters // that additional window is available. w.Broadcast() w.L.Unlock() return true } // close sets the window to closed, so all reservations fail // immediately. func (w *window) close() { w.L.Lock() w.closed = true w.Broadcast() w.L.Unlock() } // reserve reserves win from the available window capacity. // If no capacity remains, reserve will block. reserve may // return less than requested. func (w *window) reserve(win uint32) (uint32, error) { var err error w.L.Lock() w.writeWaiters++ w.Broadcast() for w.win == 0 && !w.closed { w.Wait() } w.writeWaiters-- if w.win < win { win = w.win } w.win -= win if w.closed { err = io.EOF } w.L.Unlock() return win, err } // waitWriterBlocked waits until some goroutine is blocked for further // writes. It is used in tests only. func (w *window) waitWriterBlocked() { w.Cond.L.Lock() for w.writeWaiters == 0 { w.Cond.Wait() } w.Cond.L.Unlock() } ================================================ FILE: vendor/golang.org/x/crypto/ssh/connection.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "fmt" "net" ) // OpenChannelError is returned if the other side rejects an // OpenChannel request. type OpenChannelError struct { Reason RejectionReason Message string } func (e *OpenChannelError) Error() string { return fmt.Sprintf("ssh: rejected: %s (%s)", e.Reason, e.Message) } // ConnMetadata holds metadata for the connection. type ConnMetadata interface { // User returns the user ID for this connection. User() string // SessionID returns the session hash, also denoted by H. SessionID() []byte // ClientVersion returns the client's version string as hashed // into the session ID. ClientVersion() []byte // ServerVersion returns the server's version string as hashed // into the session ID. ServerVersion() []byte // RemoteAddr returns the remote address for this connection. RemoteAddr() net.Addr // LocalAddr returns the local address for this connection. LocalAddr() net.Addr } // Conn represents an SSH connection for both server and client roles. // Conn is the basis for implementing an application layer, such // as ClientConn, which implements the traditional shell access for // clients. type Conn interface { ConnMetadata // SendRequest sends a global request, and returns the // reply. If wantReply is true, it returns the response status // and payload. See also RFC4254, section 4. SendRequest(name string, wantReply bool, payload []byte) (bool, []byte, error) // OpenChannel tries to open an channel. If the request is // rejected, it returns *OpenChannelError. On success it returns // the SSH Channel and a Go channel for incoming, out-of-band // requests. The Go channel must be serviced, or the // connection will hang. OpenChannel(name string, data []byte) (Channel, <-chan *Request, error) // Close closes the underlying network connection Close() error // Wait blocks until the connection has shut down, and returns the // error causing the shutdown. Wait() error // TODO(hanwen): consider exposing: // RequestKeyChange // Disconnect } // DiscardRequests consumes and rejects all requests from the // passed-in channel. func DiscardRequests(in <-chan *Request) { for req := range in { if req.WantReply { req.Reply(false, nil) } } } // A connection represents an incoming connection. type connection struct { transport *handshakeTransport sshConn // The connection protocol. *mux } func (c *connection) Close() error { return c.sshConn.conn.Close() } // sshconn provides net.Conn metadata, but disallows direct reads and // writes. type sshConn struct { conn net.Conn user string sessionID []byte clientVersion []byte serverVersion []byte } func dup(src []byte) []byte { dst := make([]byte, len(src)) copy(dst, src) return dst } func (c *sshConn) User() string { return c.user } func (c *sshConn) RemoteAddr() net.Addr { return c.conn.RemoteAddr() } func (c *sshConn) Close() error { return c.conn.Close() } func (c *sshConn) LocalAddr() net.Addr { return c.conn.LocalAddr() } func (c *sshConn) SessionID() []byte { return dup(c.sessionID) } func (c *sshConn) ClientVersion() []byte { return dup(c.clientVersion) } func (c *sshConn) ServerVersion() []byte { return dup(c.serverVersion) } ================================================ FILE: vendor/golang.org/x/crypto/ssh/doc.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package ssh implements an SSH client and server. SSH is a transport security protocol, an authentication protocol and a family of application protocols. The most typical application level protocol is a remote shell and this is specifically implemented. However, the multiplexed nature of SSH is exposed to users that wish to support others. References: [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 This package does not fall under the stability promise of the Go language itself, so its API may be changed when pressing needs arise. */ package ssh // import "golang.org/x/crypto/ssh" ================================================ FILE: vendor/golang.org/x/crypto/ssh/handshake.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "crypto/rand" "errors" "fmt" "io" "log" "net" "sync" ) // debugHandshake, if set, prints messages sent and received. Key // exchange messages are printed as if DH were used, so the debug // messages are wrong when using ECDH. const debugHandshake = false // chanSize sets the amount of buffering SSH connections. This is // primarily for testing: setting chanSize=0 uncovers deadlocks more // quickly. const chanSize = 16 // keyingTransport is a packet based transport that supports key // changes. It need not be thread-safe. It should pass through // msgNewKeys in both directions. type keyingTransport interface { packetConn // prepareKeyChange sets up a key change. The key change for a // direction will be effected if a msgNewKeys message is sent // or received. prepareKeyChange(*algorithms, *kexResult) error } // handshakeTransport implements rekeying on top of a keyingTransport // and offers a thread-safe writePacket() interface. type handshakeTransport struct { conn keyingTransport config *Config serverVersion []byte clientVersion []byte // hostKeys is non-empty if we are the server. In that case, // it contains all host keys that can be used to sign the // connection. hostKeys []Signer // hostKeyAlgorithms is non-empty if we are the client. In that case, // we accept these key types from the server as host key. hostKeyAlgorithms []string // On read error, incoming is closed, and readError is set. incoming chan []byte readError error mu sync.Mutex writeError error sentInitPacket []byte sentInitMsg *kexInitMsg pendingPackets [][]byte // Used when a key exchange is in progress. // If the read loop wants to schedule a kex, it pings this // channel, and the write loop will send out a kex // message. requestKex chan struct{} // If the other side requests or confirms a kex, its kexInit // packet is sent here for the write loop to find it. startKex chan *pendingKex // data for host key checking hostKeyCallback HostKeyCallback dialAddress string remoteAddr net.Addr // bannerCallback is non-empty if we are the client and it has been set in // ClientConfig. In that case it is called during the user authentication // dance to handle a custom server's message. bannerCallback BannerCallback // Algorithms agreed in the last key exchange. algorithms *algorithms readPacketsLeft uint32 readBytesLeft int64 writePacketsLeft uint32 writeBytesLeft int64 // The session ID or nil if first kex did not complete yet. sessionID []byte } type pendingKex struct { otherInit []byte done chan error } func newHandshakeTransport(conn keyingTransport, config *Config, clientVersion, serverVersion []byte) *handshakeTransport { t := &handshakeTransport{ conn: conn, serverVersion: serverVersion, clientVersion: clientVersion, incoming: make(chan []byte, chanSize), requestKex: make(chan struct{}, 1), startKex: make(chan *pendingKex, 1), config: config, } t.resetReadThresholds() t.resetWriteThresholds() // We always start with a mandatory key exchange. t.requestKex <- struct{}{} return t } func newClientTransport(conn keyingTransport, clientVersion, serverVersion []byte, config *ClientConfig, dialAddr string, addr net.Addr) *handshakeTransport { t := newHandshakeTransport(conn, &config.Config, clientVersion, serverVersion) t.dialAddress = dialAddr t.remoteAddr = addr t.hostKeyCallback = config.HostKeyCallback t.bannerCallback = config.BannerCallback if config.HostKeyAlgorithms != nil { t.hostKeyAlgorithms = config.HostKeyAlgorithms } else { t.hostKeyAlgorithms = supportedHostKeyAlgos } go t.readLoop() go t.kexLoop() return t } func newServerTransport(conn keyingTransport, clientVersion, serverVersion []byte, config *ServerConfig) *handshakeTransport { t := newHandshakeTransport(conn, &config.Config, clientVersion, serverVersion) t.hostKeys = config.hostKeys go t.readLoop() go t.kexLoop() return t } func (t *handshakeTransport) getSessionID() []byte { return t.sessionID } // waitSession waits for the session to be established. This should be // the first thing to call after instantiating handshakeTransport. func (t *handshakeTransport) waitSession() error { p, err := t.readPacket() if err != nil { return err } if p[0] != msgNewKeys { return fmt.Errorf("ssh: first packet should be msgNewKeys") } return nil } func (t *handshakeTransport) id() string { if len(t.hostKeys) > 0 { return "server" } return "client" } func (t *handshakeTransport) printPacket(p []byte, write bool) { action := "got" if write { action = "sent" } if p[0] == msgChannelData || p[0] == msgChannelExtendedData { log.Printf("%s %s data (packet %d bytes)", t.id(), action, len(p)) } else { msg, err := decode(p) log.Printf("%s %s %T %v (%v)", t.id(), action, msg, msg, err) } } func (t *handshakeTransport) readPacket() ([]byte, error) { p, ok := <-t.incoming if !ok { return nil, t.readError } return p, nil } func (t *handshakeTransport) readLoop() { first := true for { p, err := t.readOnePacket(first) first = false if err != nil { t.readError = err close(t.incoming) break } if p[0] == msgIgnore || p[0] == msgDebug { continue } t.incoming <- p } // Stop writers too. t.recordWriteError(t.readError) // Unblock the writer should it wait for this. close(t.startKex) // Don't close t.requestKex; it's also written to from writePacket. } func (t *handshakeTransport) pushPacket(p []byte) error { if debugHandshake { t.printPacket(p, true) } return t.conn.writePacket(p) } func (t *handshakeTransport) getWriteError() error { t.mu.Lock() defer t.mu.Unlock() return t.writeError } func (t *handshakeTransport) recordWriteError(err error) { t.mu.Lock() defer t.mu.Unlock() if t.writeError == nil && err != nil { t.writeError = err } } func (t *handshakeTransport) requestKeyExchange() { select { case t.requestKex <- struct{}{}: default: // something already requested a kex, so do nothing. } } func (t *handshakeTransport) resetWriteThresholds() { t.writePacketsLeft = packetRekeyThreshold if t.config.RekeyThreshold > 0 { t.writeBytesLeft = int64(t.config.RekeyThreshold) } else if t.algorithms != nil { t.writeBytesLeft = t.algorithms.w.rekeyBytes() } else { t.writeBytesLeft = 1 << 30 } } func (t *handshakeTransport) kexLoop() { write: for t.getWriteError() == nil { var request *pendingKex var sent bool for request == nil || !sent { var ok bool select { case request, ok = <-t.startKex: if !ok { break write } case <-t.requestKex: break } if !sent { if err := t.sendKexInit(); err != nil { t.recordWriteError(err) break } sent = true } } if err := t.getWriteError(); err != nil { if request != nil { request.done <- err } break } // We're not servicing t.requestKex, but that is OK: // we never block on sending to t.requestKex. // We're not servicing t.startKex, but the remote end // has just sent us a kexInitMsg, so it can't send // another key change request, until we close the done // channel on the pendingKex request. err := t.enterKeyExchange(request.otherInit) t.mu.Lock() t.writeError = err t.sentInitPacket = nil t.sentInitMsg = nil t.resetWriteThresholds() // we have completed the key exchange. Since the // reader is still blocked, it is safe to clear out // the requestKex channel. This avoids the situation // where: 1) we consumed our own request for the // initial kex, and 2) the kex from the remote side // caused another send on the requestKex channel, clear: for { select { case <-t.requestKex: // default: break clear } } request.done <- t.writeError // kex finished. Push packets that we received while // the kex was in progress. Don't look at t.startKex // and don't increment writtenSinceKex: if we trigger // another kex while we are still busy with the last // one, things will become very confusing. for _, p := range t.pendingPackets { t.writeError = t.pushPacket(p) if t.writeError != nil { break } } t.pendingPackets = t.pendingPackets[:0] t.mu.Unlock() } // drain startKex channel. We don't service t.requestKex // because nobody does blocking sends there. go func() { for init := range t.startKex { init.done <- t.writeError } }() // Unblock reader. t.conn.Close() } // The protocol uses uint32 for packet counters, so we can't let them // reach 1<<32. We will actually read and write more packets than // this, though: the other side may send more packets, and after we // hit this limit on writing we will send a few more packets for the // key exchange itself. const packetRekeyThreshold = (1 << 31) func (t *handshakeTransport) resetReadThresholds() { t.readPacketsLeft = packetRekeyThreshold if t.config.RekeyThreshold > 0 { t.readBytesLeft = int64(t.config.RekeyThreshold) } else if t.algorithms != nil { t.readBytesLeft = t.algorithms.r.rekeyBytes() } else { t.readBytesLeft = 1 << 30 } } func (t *handshakeTransport) readOnePacket(first bool) ([]byte, error) { p, err := t.conn.readPacket() if err != nil { return nil, err } if t.readPacketsLeft > 0 { t.readPacketsLeft-- } else { t.requestKeyExchange() } if t.readBytesLeft > 0 { t.readBytesLeft -= int64(len(p)) } else { t.requestKeyExchange() } if debugHandshake { t.printPacket(p, false) } if first && p[0] != msgKexInit { return nil, fmt.Errorf("ssh: first packet should be msgKexInit") } if p[0] != msgKexInit { return p, nil } firstKex := t.sessionID == nil kex := pendingKex{ done: make(chan error, 1), otherInit: p, } t.startKex <- &kex err = <-kex.done if debugHandshake { log.Printf("%s exited key exchange (first %v), err %v", t.id(), firstKex, err) } if err != nil { return nil, err } t.resetReadThresholds() // By default, a key exchange is hidden from higher layers by // translating it into msgIgnore. successPacket := []byte{msgIgnore} if firstKex { // sendKexInit() for the first kex waits for // msgNewKeys so the authentication process is // guaranteed to happen over an encrypted transport. successPacket = []byte{msgNewKeys} } return successPacket, nil } // sendKexInit sends a key change message. func (t *handshakeTransport) sendKexInit() error { t.mu.Lock() defer t.mu.Unlock() if t.sentInitMsg != nil { // kexInits may be sent either in response to the other side, // or because our side wants to initiate a key change, so we // may have already sent a kexInit. In that case, don't send a // second kexInit. return nil } msg := &kexInitMsg{ KexAlgos: t.config.KeyExchanges, CiphersClientServer: t.config.Ciphers, CiphersServerClient: t.config.Ciphers, MACsClientServer: t.config.MACs, MACsServerClient: t.config.MACs, CompressionClientServer: supportedCompressions, CompressionServerClient: supportedCompressions, } io.ReadFull(rand.Reader, msg.Cookie[:]) if len(t.hostKeys) > 0 { for _, k := range t.hostKeys { msg.ServerHostKeyAlgos = append( msg.ServerHostKeyAlgos, k.PublicKey().Type()) } } else { msg.ServerHostKeyAlgos = t.hostKeyAlgorithms } packet := Marshal(msg) // writePacket destroys the contents, so save a copy. packetCopy := make([]byte, len(packet)) copy(packetCopy, packet) if err := t.pushPacket(packetCopy); err != nil { return err } t.sentInitMsg = msg t.sentInitPacket = packet return nil } func (t *handshakeTransport) writePacket(p []byte) error { switch p[0] { case msgKexInit: return errors.New("ssh: only handshakeTransport can send kexInit") case msgNewKeys: return errors.New("ssh: only handshakeTransport can send newKeys") } t.mu.Lock() defer t.mu.Unlock() if t.writeError != nil { return t.writeError } if t.sentInitMsg != nil { // Copy the packet so the writer can reuse the buffer. cp := make([]byte, len(p)) copy(cp, p) t.pendingPackets = append(t.pendingPackets, cp) return nil } if t.writeBytesLeft > 0 { t.writeBytesLeft -= int64(len(p)) } else { t.requestKeyExchange() } if t.writePacketsLeft > 0 { t.writePacketsLeft-- } else { t.requestKeyExchange() } if err := t.pushPacket(p); err != nil { t.writeError = err } return nil } func (t *handshakeTransport) Close() error { return t.conn.Close() } func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error { if debugHandshake { log.Printf("%s entered key exchange", t.id()) } otherInit := &kexInitMsg{} if err := Unmarshal(otherInitPacket, otherInit); err != nil { return err } magics := handshakeMagics{ clientVersion: t.clientVersion, serverVersion: t.serverVersion, clientKexInit: otherInitPacket, serverKexInit: t.sentInitPacket, } clientInit := otherInit serverInit := t.sentInitMsg if len(t.hostKeys) == 0 { clientInit, serverInit = serverInit, clientInit magics.clientKexInit = t.sentInitPacket magics.serverKexInit = otherInitPacket } var err error t.algorithms, err = findAgreedAlgorithms(clientInit, serverInit) if err != nil { return err } // We don't send FirstKexFollows, but we handle receiving it. // // RFC 4253 section 7 defines the kex and the agreement method for // first_kex_packet_follows. It states that the guessed packet // should be ignored if the "kex algorithm and/or the host // key algorithm is guessed wrong (server and client have // different preferred algorithm), or if any of the other // algorithms cannot be agreed upon". The other algorithms have // already been checked above so the kex algorithm and host key // algorithm are checked here. if otherInit.FirstKexFollows && (clientInit.KexAlgos[0] != serverInit.KexAlgos[0] || clientInit.ServerHostKeyAlgos[0] != serverInit.ServerHostKeyAlgos[0]) { // other side sent a kex message for the wrong algorithm, // which we have to ignore. if _, err := t.conn.readPacket(); err != nil { return err } } kex, ok := kexAlgoMap[t.algorithms.kex] if !ok { return fmt.Errorf("ssh: unexpected key exchange algorithm %v", t.algorithms.kex) } var result *kexResult if len(t.hostKeys) > 0 { result, err = t.server(kex, t.algorithms, &magics) } else { result, err = t.client(kex, t.algorithms, &magics) } if err != nil { return err } if t.sessionID == nil { t.sessionID = result.H } result.SessionID = t.sessionID if err := t.conn.prepareKeyChange(t.algorithms, result); err != nil { return err } if err = t.conn.writePacket([]byte{msgNewKeys}); err != nil { return err } if packet, err := t.conn.readPacket(); err != nil { return err } else if packet[0] != msgNewKeys { return unexpectedMessageError(msgNewKeys, packet[0]) } return nil } func (t *handshakeTransport) server(kex kexAlgorithm, algs *algorithms, magics *handshakeMagics) (*kexResult, error) { var hostKey Signer for _, k := range t.hostKeys { if algs.hostKey == k.PublicKey().Type() { hostKey = k } } r, err := kex.Server(t.conn, t.config.Rand, magics, hostKey) return r, err } func (t *handshakeTransport) client(kex kexAlgorithm, algs *algorithms, magics *handshakeMagics) (*kexResult, error) { result, err := kex.Client(t.conn, t.config.Rand, magics) if err != nil { return nil, err } hostKey, err := ParsePublicKey(result.HostKey) if err != nil { return nil, err } if err := verifyHostKeySignature(hostKey, result); err != nil { return nil, err } err = t.hostKeyCallback(t.dialAddress, t.remoteAddr, hostKey) if err != nil { return nil, err } return result, nil } ================================================ FILE: vendor/golang.org/x/crypto/ssh/kex.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "crypto" "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "crypto/subtle" "errors" "io" "math/big" "golang.org/x/crypto/curve25519" ) const ( kexAlgoDH1SHA1 = "diffie-hellman-group1-sha1" kexAlgoDH14SHA1 = "diffie-hellman-group14-sha1" kexAlgoECDH256 = "ecdh-sha2-nistp256" kexAlgoECDH384 = "ecdh-sha2-nistp384" kexAlgoECDH521 = "ecdh-sha2-nistp521" kexAlgoCurve25519SHA256 = "curve25519-sha256@libssh.org" ) // kexResult captures the outcome of a key exchange. type kexResult struct { // Session hash. See also RFC 4253, section 8. H []byte // Shared secret. See also RFC 4253, section 8. K []byte // Host key as hashed into H. HostKey []byte // Signature of H. Signature []byte // A cryptographic hash function that matches the security // level of the key exchange algorithm. It is used for // calculating H, and for deriving keys from H and K. Hash crypto.Hash // The session ID, which is the first H computed. This is used // to derive key material inside the transport. SessionID []byte } // handshakeMagics contains data that is always included in the // session hash. type handshakeMagics struct { clientVersion, serverVersion []byte clientKexInit, serverKexInit []byte } func (m *handshakeMagics) write(w io.Writer) { writeString(w, m.clientVersion) writeString(w, m.serverVersion) writeString(w, m.clientKexInit) writeString(w, m.serverKexInit) } // kexAlgorithm abstracts different key exchange algorithms. type kexAlgorithm interface { // Server runs server-side key agreement, signing the result // with a hostkey. Server(p packetConn, rand io.Reader, magics *handshakeMagics, s Signer) (*kexResult, error) // Client runs the client-side key agreement. Caller is // responsible for verifying the host key signature. Client(p packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) } // dhGroup is a multiplicative group suitable for implementing Diffie-Hellman key agreement. type dhGroup struct { g, p, pMinus1 *big.Int } func (group *dhGroup) diffieHellman(theirPublic, myPrivate *big.Int) (*big.Int, error) { if theirPublic.Cmp(bigOne) <= 0 || theirPublic.Cmp(group.pMinus1) >= 0 { return nil, errors.New("ssh: DH parameter out of bounds") } return new(big.Int).Exp(theirPublic, myPrivate, group.p), nil } func (group *dhGroup) Client(c packetConn, randSource io.Reader, magics *handshakeMagics) (*kexResult, error) { hashFunc := crypto.SHA1 var x *big.Int for { var err error if x, err = rand.Int(randSource, group.pMinus1); err != nil { return nil, err } if x.Sign() > 0 { break } } X := new(big.Int).Exp(group.g, x, group.p) kexDHInit := kexDHInitMsg{ X: X, } if err := c.writePacket(Marshal(&kexDHInit)); err != nil { return nil, err } packet, err := c.readPacket() if err != nil { return nil, err } var kexDHReply kexDHReplyMsg if err = Unmarshal(packet, &kexDHReply); err != nil { return nil, err } ki, err := group.diffieHellman(kexDHReply.Y, x) if err != nil { return nil, err } h := hashFunc.New() magics.write(h) writeString(h, kexDHReply.HostKey) writeInt(h, X) writeInt(h, kexDHReply.Y) K := make([]byte, intLength(ki)) marshalInt(K, ki) h.Write(K) return &kexResult{ H: h.Sum(nil), K: K, HostKey: kexDHReply.HostKey, Signature: kexDHReply.Signature, Hash: crypto.SHA1, }, nil } func (group *dhGroup) Server(c packetConn, randSource io.Reader, magics *handshakeMagics, priv Signer) (result *kexResult, err error) { hashFunc := crypto.SHA1 packet, err := c.readPacket() if err != nil { return } var kexDHInit kexDHInitMsg if err = Unmarshal(packet, &kexDHInit); err != nil { return } var y *big.Int for { if y, err = rand.Int(randSource, group.pMinus1); err != nil { return } if y.Sign() > 0 { break } } Y := new(big.Int).Exp(group.g, y, group.p) ki, err := group.diffieHellman(kexDHInit.X, y) if err != nil { return nil, err } hostKeyBytes := priv.PublicKey().Marshal() h := hashFunc.New() magics.write(h) writeString(h, hostKeyBytes) writeInt(h, kexDHInit.X) writeInt(h, Y) K := make([]byte, intLength(ki)) marshalInt(K, ki) h.Write(K) H := h.Sum(nil) // H is already a hash, but the hostkey signing will apply its // own key-specific hash algorithm. sig, err := signAndMarshal(priv, randSource, H) if err != nil { return nil, err } kexDHReply := kexDHReplyMsg{ HostKey: hostKeyBytes, Y: Y, Signature: sig, } packet = Marshal(&kexDHReply) err = c.writePacket(packet) return &kexResult{ H: H, K: K, HostKey: hostKeyBytes, Signature: sig, Hash: crypto.SHA1, }, nil } // ecdh performs Elliptic Curve Diffie-Hellman key exchange as // described in RFC 5656, section 4. type ecdh struct { curve elliptic.Curve } func (kex *ecdh) Client(c packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) { ephKey, err := ecdsa.GenerateKey(kex.curve, rand) if err != nil { return nil, err } kexInit := kexECDHInitMsg{ ClientPubKey: elliptic.Marshal(kex.curve, ephKey.PublicKey.X, ephKey.PublicKey.Y), } serialized := Marshal(&kexInit) if err := c.writePacket(serialized); err != nil { return nil, err } packet, err := c.readPacket() if err != nil { return nil, err } var reply kexECDHReplyMsg if err = Unmarshal(packet, &reply); err != nil { return nil, err } x, y, err := unmarshalECKey(kex.curve, reply.EphemeralPubKey) if err != nil { return nil, err } // generate shared secret secret, _ := kex.curve.ScalarMult(x, y, ephKey.D.Bytes()) h := ecHash(kex.curve).New() magics.write(h) writeString(h, reply.HostKey) writeString(h, kexInit.ClientPubKey) writeString(h, reply.EphemeralPubKey) K := make([]byte, intLength(secret)) marshalInt(K, secret) h.Write(K) return &kexResult{ H: h.Sum(nil), K: K, HostKey: reply.HostKey, Signature: reply.Signature, Hash: ecHash(kex.curve), }, nil } // unmarshalECKey parses and checks an EC key. func unmarshalECKey(curve elliptic.Curve, pubkey []byte) (x, y *big.Int, err error) { x, y = elliptic.Unmarshal(curve, pubkey) if x == nil { return nil, nil, errors.New("ssh: elliptic.Unmarshal failure") } if !validateECPublicKey(curve, x, y) { return nil, nil, errors.New("ssh: public key not on curve") } return x, y, nil } // validateECPublicKey checks that the point is a valid public key for // the given curve. See [SEC1], 3.2.2 func validateECPublicKey(curve elliptic.Curve, x, y *big.Int) bool { if x.Sign() == 0 && y.Sign() == 0 { return false } if x.Cmp(curve.Params().P) >= 0 { return false } if y.Cmp(curve.Params().P) >= 0 { return false } if !curve.IsOnCurve(x, y) { return false } // We don't check if N * PubKey == 0, since // // - the NIST curves have cofactor = 1, so this is implicit. // (We don't foresee an implementation that supports non NIST // curves) // // - for ephemeral keys, we don't need to worry about small // subgroup attacks. return true } func (kex *ecdh) Server(c packetConn, rand io.Reader, magics *handshakeMagics, priv Signer) (result *kexResult, err error) { packet, err := c.readPacket() if err != nil { return nil, err } var kexECDHInit kexECDHInitMsg if err = Unmarshal(packet, &kexECDHInit); err != nil { return nil, err } clientX, clientY, err := unmarshalECKey(kex.curve, kexECDHInit.ClientPubKey) if err != nil { return nil, err } // We could cache this key across multiple users/multiple // connection attempts, but the benefit is small. OpenSSH // generates a new key for each incoming connection. ephKey, err := ecdsa.GenerateKey(kex.curve, rand) if err != nil { return nil, err } hostKeyBytes := priv.PublicKey().Marshal() serializedEphKey := elliptic.Marshal(kex.curve, ephKey.PublicKey.X, ephKey.PublicKey.Y) // generate shared secret secret, _ := kex.curve.ScalarMult(clientX, clientY, ephKey.D.Bytes()) h := ecHash(kex.curve).New() magics.write(h) writeString(h, hostKeyBytes) writeString(h, kexECDHInit.ClientPubKey) writeString(h, serializedEphKey) K := make([]byte, intLength(secret)) marshalInt(K, secret) h.Write(K) H := h.Sum(nil) // H is already a hash, but the hostkey signing will apply its // own key-specific hash algorithm. sig, err := signAndMarshal(priv, rand, H) if err != nil { return nil, err } reply := kexECDHReplyMsg{ EphemeralPubKey: serializedEphKey, HostKey: hostKeyBytes, Signature: sig, } serialized := Marshal(&reply) if err := c.writePacket(serialized); err != nil { return nil, err } return &kexResult{ H: H, K: K, HostKey: reply.HostKey, Signature: sig, Hash: ecHash(kex.curve), }, nil } var kexAlgoMap = map[string]kexAlgorithm{} func init() { // This is the group called diffie-hellman-group1-sha1 in RFC // 4253 and Oakley Group 2 in RFC 2409. p, _ := new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF", 16) kexAlgoMap[kexAlgoDH1SHA1] = &dhGroup{ g: new(big.Int).SetInt64(2), p: p, pMinus1: new(big.Int).Sub(p, bigOne), } // This is the group called diffie-hellman-group14-sha1 in RFC // 4253 and Oakley Group 14 in RFC 3526. p, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF", 16) kexAlgoMap[kexAlgoDH14SHA1] = &dhGroup{ g: new(big.Int).SetInt64(2), p: p, pMinus1: new(big.Int).Sub(p, bigOne), } kexAlgoMap[kexAlgoECDH521] = &ecdh{elliptic.P521()} kexAlgoMap[kexAlgoECDH384] = &ecdh{elliptic.P384()} kexAlgoMap[kexAlgoECDH256] = &ecdh{elliptic.P256()} kexAlgoMap[kexAlgoCurve25519SHA256] = &curve25519sha256{} } // curve25519sha256 implements the curve25519-sha256@libssh.org key // agreement protocol, as described in // https://git.libssh.org/projects/libssh.git/tree/doc/curve25519-sha256@libssh.org.txt type curve25519sha256 struct{} type curve25519KeyPair struct { priv [32]byte pub [32]byte } func (kp *curve25519KeyPair) generate(rand io.Reader) error { if _, err := io.ReadFull(rand, kp.priv[:]); err != nil { return err } curve25519.ScalarBaseMult(&kp.pub, &kp.priv) return nil } // curve25519Zeros is just an array of 32 zero bytes so that we have something // convenient to compare against in order to reject curve25519 points with the // wrong order. var curve25519Zeros [32]byte func (kex *curve25519sha256) Client(c packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) { var kp curve25519KeyPair if err := kp.generate(rand); err != nil { return nil, err } if err := c.writePacket(Marshal(&kexECDHInitMsg{kp.pub[:]})); err != nil { return nil, err } packet, err := c.readPacket() if err != nil { return nil, err } var reply kexECDHReplyMsg if err = Unmarshal(packet, &reply); err != nil { return nil, err } if len(reply.EphemeralPubKey) != 32 { return nil, errors.New("ssh: peer's curve25519 public value has wrong length") } var servPub, secret [32]byte copy(servPub[:], reply.EphemeralPubKey) curve25519.ScalarMult(&secret, &kp.priv, &servPub) if subtle.ConstantTimeCompare(secret[:], curve25519Zeros[:]) == 1 { return nil, errors.New("ssh: peer's curve25519 public value has wrong order") } h := crypto.SHA256.New() magics.write(h) writeString(h, reply.HostKey) writeString(h, kp.pub[:]) writeString(h, reply.EphemeralPubKey) ki := new(big.Int).SetBytes(secret[:]) K := make([]byte, intLength(ki)) marshalInt(K, ki) h.Write(K) return &kexResult{ H: h.Sum(nil), K: K, HostKey: reply.HostKey, Signature: reply.Signature, Hash: crypto.SHA256, }, nil } func (kex *curve25519sha256) Server(c packetConn, rand io.Reader, magics *handshakeMagics, priv Signer) (result *kexResult, err error) { packet, err := c.readPacket() if err != nil { return } var kexInit kexECDHInitMsg if err = Unmarshal(packet, &kexInit); err != nil { return } if len(kexInit.ClientPubKey) != 32 { return nil, errors.New("ssh: peer's curve25519 public value has wrong length") } var kp curve25519KeyPair if err := kp.generate(rand); err != nil { return nil, err } var clientPub, secret [32]byte copy(clientPub[:], kexInit.ClientPubKey) curve25519.ScalarMult(&secret, &kp.priv, &clientPub) if subtle.ConstantTimeCompare(secret[:], curve25519Zeros[:]) == 1 { return nil, errors.New("ssh: peer's curve25519 public value has wrong order") } hostKeyBytes := priv.PublicKey().Marshal() h := crypto.SHA256.New() magics.write(h) writeString(h, hostKeyBytes) writeString(h, kexInit.ClientPubKey) writeString(h, kp.pub[:]) ki := new(big.Int).SetBytes(secret[:]) K := make([]byte, intLength(ki)) marshalInt(K, ki) h.Write(K) H := h.Sum(nil) sig, err := signAndMarshal(priv, rand, H) if err != nil { return nil, err } reply := kexECDHReplyMsg{ EphemeralPubKey: kp.pub[:], HostKey: hostKeyBytes, Signature: sig, } if err := c.writePacket(Marshal(&reply)); err != nil { return nil, err } return &kexResult{ H: H, K: K, HostKey: hostKeyBytes, Signature: sig, Hash: crypto.SHA256, }, nil } ================================================ FILE: vendor/golang.org/x/crypto/ssh/keys.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "bytes" "crypto" "crypto/dsa" "crypto/ecdsa" "crypto/elliptic" "crypto/md5" "crypto/rsa" "crypto/sha256" "crypto/x509" "encoding/asn1" "encoding/base64" "encoding/hex" "encoding/pem" "errors" "fmt" "io" "math/big" "strings" "golang.org/x/crypto/ed25519" ) // These constants represent the algorithm names for key types supported by this // package. const ( KeyAlgoRSA = "ssh-rsa" KeyAlgoDSA = "ssh-dss" KeyAlgoECDSA256 = "ecdsa-sha2-nistp256" KeyAlgoECDSA384 = "ecdsa-sha2-nistp384" KeyAlgoECDSA521 = "ecdsa-sha2-nistp521" KeyAlgoED25519 = "ssh-ed25519" ) // These constants represent non-default signature algorithms that are supported // as algorithm parameters to AlgorithmSigner.SignWithAlgorithm methods. See // [PROTOCOL.agent] section 4.5.1 and // https://tools.ietf.org/html/draft-ietf-curdle-rsa-sha2-10 const ( SigAlgoRSA = "ssh-rsa" SigAlgoRSASHA2256 = "rsa-sha2-256" SigAlgoRSASHA2512 = "rsa-sha2-512" ) // parsePubKey parses a public key of the given algorithm. // Use ParsePublicKey for keys with prepended algorithm. func parsePubKey(in []byte, algo string) (pubKey PublicKey, rest []byte, err error) { switch algo { case KeyAlgoRSA: return parseRSA(in) case KeyAlgoDSA: return parseDSA(in) case KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521: return parseECDSA(in) case KeyAlgoED25519: return parseED25519(in) case CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01: cert, err := parseCert(in, certToPrivAlgo(algo)) if err != nil { return nil, nil, err } return cert, nil, nil } return nil, nil, fmt.Errorf("ssh: unknown key algorithm: %v", algo) } // parseAuthorizedKey parses a public key in OpenSSH authorized_keys format // (see sshd(8) manual page) once the options and key type fields have been // removed. func parseAuthorizedKey(in []byte) (out PublicKey, comment string, err error) { in = bytes.TrimSpace(in) i := bytes.IndexAny(in, " \t") if i == -1 { i = len(in) } base64Key := in[:i] key := make([]byte, base64.StdEncoding.DecodedLen(len(base64Key))) n, err := base64.StdEncoding.Decode(key, base64Key) if err != nil { return nil, "", err } key = key[:n] out, err = ParsePublicKey(key) if err != nil { return nil, "", err } comment = string(bytes.TrimSpace(in[i:])) return out, comment, nil } // ParseKnownHosts parses an entry in the format of the known_hosts file. // // The known_hosts format is documented in the sshd(8) manual page. This // function will parse a single entry from in. On successful return, marker // will contain the optional marker value (i.e. "cert-authority" or "revoked") // or else be empty, hosts will contain the hosts that this entry matches, // pubKey will contain the public key and comment will contain any trailing // comment at the end of the line. See the sshd(8) manual page for the various // forms that a host string can take. // // The unparsed remainder of the input will be returned in rest. This function // can be called repeatedly to parse multiple entries. // // If no entries were found in the input then err will be io.EOF. Otherwise a // non-nil err value indicates a parse error. func ParseKnownHosts(in []byte) (marker string, hosts []string, pubKey PublicKey, comment string, rest []byte, err error) { for len(in) > 0 { end := bytes.IndexByte(in, '\n') if end != -1 { rest = in[end+1:] in = in[:end] } else { rest = nil } end = bytes.IndexByte(in, '\r') if end != -1 { in = in[:end] } in = bytes.TrimSpace(in) if len(in) == 0 || in[0] == '#' { in = rest continue } i := bytes.IndexAny(in, " \t") if i == -1 { in = rest continue } // Strip out the beginning of the known_host key. // This is either an optional marker or a (set of) hostname(s). keyFields := bytes.Fields(in) if len(keyFields) < 3 || len(keyFields) > 5 { return "", nil, nil, "", nil, errors.New("ssh: invalid entry in known_hosts data") } // keyFields[0] is either "@cert-authority", "@revoked" or a comma separated // list of hosts marker := "" if keyFields[0][0] == '@' { marker = string(keyFields[0][1:]) keyFields = keyFields[1:] } hosts := string(keyFields[0]) // keyFields[1] contains the key type (e.g. “ssh-rsa”). // However, that information is duplicated inside the // base64-encoded key and so is ignored here. key := bytes.Join(keyFields[2:], []byte(" ")) if pubKey, comment, err = parseAuthorizedKey(key); err != nil { return "", nil, nil, "", nil, err } return marker, strings.Split(hosts, ","), pubKey, comment, rest, nil } return "", nil, nil, "", nil, io.EOF } // ParseAuthorizedKeys parses a public key from an authorized_keys // file used in OpenSSH according to the sshd(8) manual page. func ParseAuthorizedKey(in []byte) (out PublicKey, comment string, options []string, rest []byte, err error) { for len(in) > 0 { end := bytes.IndexByte(in, '\n') if end != -1 { rest = in[end+1:] in = in[:end] } else { rest = nil } end = bytes.IndexByte(in, '\r') if end != -1 { in = in[:end] } in = bytes.TrimSpace(in) if len(in) == 0 || in[0] == '#' { in = rest continue } i := bytes.IndexAny(in, " \t") if i == -1 { in = rest continue } if out, comment, err = parseAuthorizedKey(in[i:]); err == nil { return out, comment, options, rest, nil } // No key type recognised. Maybe there's an options field at // the beginning. var b byte inQuote := false var candidateOptions []string optionStart := 0 for i, b = range in { isEnd := !inQuote && (b == ' ' || b == '\t') if (b == ',' && !inQuote) || isEnd { if i-optionStart > 0 { candidateOptions = append(candidateOptions, string(in[optionStart:i])) } optionStart = i + 1 } if isEnd { break } if b == '"' && (i == 0 || (i > 0 && in[i-1] != '\\')) { inQuote = !inQuote } } for i < len(in) && (in[i] == ' ' || in[i] == '\t') { i++ } if i == len(in) { // Invalid line: unmatched quote in = rest continue } in = in[i:] i = bytes.IndexAny(in, " \t") if i == -1 { in = rest continue } if out, comment, err = parseAuthorizedKey(in[i:]); err == nil { options = candidateOptions return out, comment, options, rest, nil } in = rest continue } return nil, "", nil, nil, errors.New("ssh: no key found") } // ParsePublicKey parses an SSH public key formatted for use in // the SSH wire protocol according to RFC 4253, section 6.6. func ParsePublicKey(in []byte) (out PublicKey, err error) { algo, in, ok := parseString(in) if !ok { return nil, errShortRead } var rest []byte out, rest, err = parsePubKey(in, string(algo)) if len(rest) > 0 { return nil, errors.New("ssh: trailing junk in public key") } return out, err } // MarshalAuthorizedKey serializes key for inclusion in an OpenSSH // authorized_keys file. The return value ends with newline. func MarshalAuthorizedKey(key PublicKey) []byte { b := &bytes.Buffer{} b.WriteString(key.Type()) b.WriteByte(' ') e := base64.NewEncoder(base64.StdEncoding, b) e.Write(key.Marshal()) e.Close() b.WriteByte('\n') return b.Bytes() } // PublicKey is an abstraction of different types of public keys. type PublicKey interface { // Type returns the key's type, e.g. "ssh-rsa". Type() string // Marshal returns the serialized key data in SSH wire format, // with the name prefix. To unmarshal the returned data, use // the ParsePublicKey function. Marshal() []byte // Verify that sig is a signature on the given data using this // key. This function will hash the data appropriately first. Verify(data []byte, sig *Signature) error } // CryptoPublicKey, if implemented by a PublicKey, // returns the underlying crypto.PublicKey form of the key. type CryptoPublicKey interface { CryptoPublicKey() crypto.PublicKey } // A Signer can create signatures that verify against a public key. type Signer interface { // PublicKey returns an associated PublicKey instance. PublicKey() PublicKey // Sign returns raw signature for the given data. This method // will apply the hash specified for the keytype to the data. Sign(rand io.Reader, data []byte) (*Signature, error) } // A AlgorithmSigner is a Signer that also supports specifying a specific // algorithm to use for signing. type AlgorithmSigner interface { Signer // SignWithAlgorithm is like Signer.Sign, but allows specification of a // non-default signing algorithm. See the SigAlgo* constants in this // package for signature algorithms supported by this package. Callers may // pass an empty string for the algorithm in which case the AlgorithmSigner // will use its default algorithm. SignWithAlgorithm(rand io.Reader, data []byte, algorithm string) (*Signature, error) } type rsaPublicKey rsa.PublicKey func (r *rsaPublicKey) Type() string { return "ssh-rsa" } // parseRSA parses an RSA key according to RFC 4253, section 6.6. func parseRSA(in []byte) (out PublicKey, rest []byte, err error) { var w struct { E *big.Int N *big.Int Rest []byte `ssh:"rest"` } if err := Unmarshal(in, &w); err != nil { return nil, nil, err } if w.E.BitLen() > 24 { return nil, nil, errors.New("ssh: exponent too large") } e := w.E.Int64() if e < 3 || e&1 == 0 { return nil, nil, errors.New("ssh: incorrect exponent") } var key rsa.PublicKey key.E = int(e) key.N = w.N return (*rsaPublicKey)(&key), w.Rest, nil } func (r *rsaPublicKey) Marshal() []byte { e := new(big.Int).SetInt64(int64(r.E)) // RSA publickey struct layout should match the struct used by // parseRSACert in the x/crypto/ssh/agent package. wirekey := struct { Name string E *big.Int N *big.Int }{ KeyAlgoRSA, e, r.N, } return Marshal(&wirekey) } func (r *rsaPublicKey) Verify(data []byte, sig *Signature) error { var hash crypto.Hash switch sig.Format { case SigAlgoRSA: hash = crypto.SHA1 case SigAlgoRSASHA2256: hash = crypto.SHA256 case SigAlgoRSASHA2512: hash = crypto.SHA512 default: return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, r.Type()) } h := hash.New() h.Write(data) digest := h.Sum(nil) return rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), hash, digest, sig.Blob) } func (r *rsaPublicKey) CryptoPublicKey() crypto.PublicKey { return (*rsa.PublicKey)(r) } type dsaPublicKey dsa.PublicKey func (k *dsaPublicKey) Type() string { return "ssh-dss" } func checkDSAParams(param *dsa.Parameters) error { // SSH specifies FIPS 186-2, which only provided a single size // (1024 bits) DSA key. FIPS 186-3 allows for larger key // sizes, which would confuse SSH. if l := param.P.BitLen(); l != 1024 { return fmt.Errorf("ssh: unsupported DSA key size %d", l) } return nil } // parseDSA parses an DSA key according to RFC 4253, section 6.6. func parseDSA(in []byte) (out PublicKey, rest []byte, err error) { var w struct { P, Q, G, Y *big.Int Rest []byte `ssh:"rest"` } if err := Unmarshal(in, &w); err != nil { return nil, nil, err } param := dsa.Parameters{ P: w.P, Q: w.Q, G: w.G, } if err := checkDSAParams(¶m); err != nil { return nil, nil, err } key := &dsaPublicKey{ Parameters: param, Y: w.Y, } return key, w.Rest, nil } func (k *dsaPublicKey) Marshal() []byte { // DSA publickey struct layout should match the struct used by // parseDSACert in the x/crypto/ssh/agent package. w := struct { Name string P, Q, G, Y *big.Int }{ k.Type(), k.P, k.Q, k.G, k.Y, } return Marshal(&w) } func (k *dsaPublicKey) Verify(data []byte, sig *Signature) error { if sig.Format != k.Type() { return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) } h := crypto.SHA1.New() h.Write(data) digest := h.Sum(nil) // Per RFC 4253, section 6.6, // The value for 'dss_signature_blob' is encoded as a string containing // r, followed by s (which are 160-bit integers, without lengths or // padding, unsigned, and in network byte order). // For DSS purposes, sig.Blob should be exactly 40 bytes in length. if len(sig.Blob) != 40 { return errors.New("ssh: DSA signature parse error") } r := new(big.Int).SetBytes(sig.Blob[:20]) s := new(big.Int).SetBytes(sig.Blob[20:]) if dsa.Verify((*dsa.PublicKey)(k), digest, r, s) { return nil } return errors.New("ssh: signature did not verify") } func (k *dsaPublicKey) CryptoPublicKey() crypto.PublicKey { return (*dsa.PublicKey)(k) } type dsaPrivateKey struct { *dsa.PrivateKey } func (k *dsaPrivateKey) PublicKey() PublicKey { return (*dsaPublicKey)(&k.PrivateKey.PublicKey) } func (k *dsaPrivateKey) Sign(rand io.Reader, data []byte) (*Signature, error) { return k.SignWithAlgorithm(rand, data, "") } func (k *dsaPrivateKey) SignWithAlgorithm(rand io.Reader, data []byte, algorithm string) (*Signature, error) { if algorithm != "" && algorithm != k.PublicKey().Type() { return nil, fmt.Errorf("ssh: unsupported signature algorithm %s", algorithm) } h := crypto.SHA1.New() h.Write(data) digest := h.Sum(nil) r, s, err := dsa.Sign(rand, k.PrivateKey, digest) if err != nil { return nil, err } sig := make([]byte, 40) rb := r.Bytes() sb := s.Bytes() copy(sig[20-len(rb):20], rb) copy(sig[40-len(sb):], sb) return &Signature{ Format: k.PublicKey().Type(), Blob: sig, }, nil } type ecdsaPublicKey ecdsa.PublicKey func (k *ecdsaPublicKey) Type() string { return "ecdsa-sha2-" + k.nistID() } func (k *ecdsaPublicKey) nistID() string { switch k.Params().BitSize { case 256: return "nistp256" case 384: return "nistp384" case 521: return "nistp521" } panic("ssh: unsupported ecdsa key size") } type ed25519PublicKey ed25519.PublicKey func (k ed25519PublicKey) Type() string { return KeyAlgoED25519 } func parseED25519(in []byte) (out PublicKey, rest []byte, err error) { var w struct { KeyBytes []byte Rest []byte `ssh:"rest"` } if err := Unmarshal(in, &w); err != nil { return nil, nil, err } key := ed25519.PublicKey(w.KeyBytes) return (ed25519PublicKey)(key), w.Rest, nil } func (k ed25519PublicKey) Marshal() []byte { w := struct { Name string KeyBytes []byte }{ KeyAlgoED25519, []byte(k), } return Marshal(&w) } func (k ed25519PublicKey) Verify(b []byte, sig *Signature) error { if sig.Format != k.Type() { return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) } edKey := (ed25519.PublicKey)(k) if ok := ed25519.Verify(edKey, b, sig.Blob); !ok { return errors.New("ssh: signature did not verify") } return nil } func (k ed25519PublicKey) CryptoPublicKey() crypto.PublicKey { return ed25519.PublicKey(k) } func supportedEllipticCurve(curve elliptic.Curve) bool { return curve == elliptic.P256() || curve == elliptic.P384() || curve == elliptic.P521() } // ecHash returns the hash to match the given elliptic curve, see RFC // 5656, section 6.2.1 func ecHash(curve elliptic.Curve) crypto.Hash { bitSize := curve.Params().BitSize switch { case bitSize <= 256: return crypto.SHA256 case bitSize <= 384: return crypto.SHA384 } return crypto.SHA512 } // parseECDSA parses an ECDSA key according to RFC 5656, section 3.1. func parseECDSA(in []byte) (out PublicKey, rest []byte, err error) { var w struct { Curve string KeyBytes []byte Rest []byte `ssh:"rest"` } if err := Unmarshal(in, &w); err != nil { return nil, nil, err } key := new(ecdsa.PublicKey) switch w.Curve { case "nistp256": key.Curve = elliptic.P256() case "nistp384": key.Curve = elliptic.P384() case "nistp521": key.Curve = elliptic.P521() default: return nil, nil, errors.New("ssh: unsupported curve") } key.X, key.Y = elliptic.Unmarshal(key.Curve, w.KeyBytes) if key.X == nil || key.Y == nil { return nil, nil, errors.New("ssh: invalid curve point") } return (*ecdsaPublicKey)(key), w.Rest, nil } func (k *ecdsaPublicKey) Marshal() []byte { // See RFC 5656, section 3.1. keyBytes := elliptic.Marshal(k.Curve, k.X, k.Y) // ECDSA publickey struct layout should match the struct used by // parseECDSACert in the x/crypto/ssh/agent package. w := struct { Name string ID string Key []byte }{ k.Type(), k.nistID(), keyBytes, } return Marshal(&w) } func (k *ecdsaPublicKey) Verify(data []byte, sig *Signature) error { if sig.Format != k.Type() { return fmt.Errorf("ssh: signature type %s for key type %s", sig.Format, k.Type()) } h := ecHash(k.Curve).New() h.Write(data) digest := h.Sum(nil) // Per RFC 5656, section 3.1.2, // The ecdsa_signature_blob value has the following specific encoding: // mpint r // mpint s var ecSig struct { R *big.Int S *big.Int } if err := Unmarshal(sig.Blob, &ecSig); err != nil { return err } if ecdsa.Verify((*ecdsa.PublicKey)(k), digest, ecSig.R, ecSig.S) { return nil } return errors.New("ssh: signature did not verify") } func (k *ecdsaPublicKey) CryptoPublicKey() crypto.PublicKey { return (*ecdsa.PublicKey)(k) } // NewSignerFromKey takes an *rsa.PrivateKey, *dsa.PrivateKey, // *ecdsa.PrivateKey or any other crypto.Signer and returns a // corresponding Signer instance. ECDSA keys must use P-256, P-384 or // P-521. DSA keys must use parameter size L1024N160. func NewSignerFromKey(key interface{}) (Signer, error) { switch key := key.(type) { case crypto.Signer: return NewSignerFromSigner(key) case *dsa.PrivateKey: return newDSAPrivateKey(key) default: return nil, fmt.Errorf("ssh: unsupported key type %T", key) } } func newDSAPrivateKey(key *dsa.PrivateKey) (Signer, error) { if err := checkDSAParams(&key.PublicKey.Parameters); err != nil { return nil, err } return &dsaPrivateKey{key}, nil } type wrappedSigner struct { signer crypto.Signer pubKey PublicKey } // NewSignerFromSigner takes any crypto.Signer implementation and // returns a corresponding Signer interface. This can be used, for // example, with keys kept in hardware modules. func NewSignerFromSigner(signer crypto.Signer) (Signer, error) { pubKey, err := NewPublicKey(signer.Public()) if err != nil { return nil, err } return &wrappedSigner{signer, pubKey}, nil } func (s *wrappedSigner) PublicKey() PublicKey { return s.pubKey } func (s *wrappedSigner) Sign(rand io.Reader, data []byte) (*Signature, error) { return s.SignWithAlgorithm(rand, data, "") } func (s *wrappedSigner) SignWithAlgorithm(rand io.Reader, data []byte, algorithm string) (*Signature, error) { var hashFunc crypto.Hash if _, ok := s.pubKey.(*rsaPublicKey); ok { // RSA keys support a few hash functions determined by the requested signature algorithm switch algorithm { case "", SigAlgoRSA: algorithm = SigAlgoRSA hashFunc = crypto.SHA1 case SigAlgoRSASHA2256: hashFunc = crypto.SHA256 case SigAlgoRSASHA2512: hashFunc = crypto.SHA512 default: return nil, fmt.Errorf("ssh: unsupported signature algorithm %s", algorithm) } } else { // The only supported algorithm for all other key types is the same as the type of the key if algorithm == "" { algorithm = s.pubKey.Type() } else if algorithm != s.pubKey.Type() { return nil, fmt.Errorf("ssh: unsupported signature algorithm %s", algorithm) } switch key := s.pubKey.(type) { case *dsaPublicKey: hashFunc = crypto.SHA1 case *ecdsaPublicKey: hashFunc = ecHash(key.Curve) case ed25519PublicKey: default: return nil, fmt.Errorf("ssh: unsupported key type %T", key) } } var digest []byte if hashFunc != 0 { h := hashFunc.New() h.Write(data) digest = h.Sum(nil) } else { digest = data } signature, err := s.signer.Sign(rand, digest, hashFunc) if err != nil { return nil, err } // crypto.Signer.Sign is expected to return an ASN.1-encoded signature // for ECDSA and DSA, but that's not the encoding expected by SSH, so // re-encode. switch s.pubKey.(type) { case *ecdsaPublicKey, *dsaPublicKey: type asn1Signature struct { R, S *big.Int } asn1Sig := new(asn1Signature) _, err := asn1.Unmarshal(signature, asn1Sig) if err != nil { return nil, err } switch s.pubKey.(type) { case *ecdsaPublicKey: signature = Marshal(asn1Sig) case *dsaPublicKey: signature = make([]byte, 40) r := asn1Sig.R.Bytes() s := asn1Sig.S.Bytes() copy(signature[20-len(r):20], r) copy(signature[40-len(s):40], s) } } return &Signature{ Format: algorithm, Blob: signature, }, nil } // NewPublicKey takes an *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey, // or ed25519.PublicKey returns a corresponding PublicKey instance. // ECDSA keys must use P-256, P-384 or P-521. func NewPublicKey(key interface{}) (PublicKey, error) { switch key := key.(type) { case *rsa.PublicKey: return (*rsaPublicKey)(key), nil case *ecdsa.PublicKey: if !supportedEllipticCurve(key.Curve) { return nil, errors.New("ssh: only P-256, P-384 and P-521 EC keys are supported") } return (*ecdsaPublicKey)(key), nil case *dsa.PublicKey: return (*dsaPublicKey)(key), nil case ed25519.PublicKey: return (ed25519PublicKey)(key), nil default: return nil, fmt.Errorf("ssh: unsupported key type %T", key) } } // ParsePrivateKey returns a Signer from a PEM encoded private key. It supports // the same keys as ParseRawPrivateKey. func ParsePrivateKey(pemBytes []byte) (Signer, error) { key, err := ParseRawPrivateKey(pemBytes) if err != nil { return nil, err } return NewSignerFromKey(key) } // ParsePrivateKeyWithPassphrase returns a Signer from a PEM encoded private // key and passphrase. It supports the same keys as // ParseRawPrivateKeyWithPassphrase. func ParsePrivateKeyWithPassphrase(pemBytes, passPhrase []byte) (Signer, error) { key, err := ParseRawPrivateKeyWithPassphrase(pemBytes, passPhrase) if err != nil { return nil, err } return NewSignerFromKey(key) } // encryptedBlock tells whether a private key is // encrypted by examining its Proc-Type header // for a mention of ENCRYPTED // according to RFC 1421 Section 4.6.1.1. func encryptedBlock(block *pem.Block) bool { return strings.Contains(block.Headers["Proc-Type"], "ENCRYPTED") } // ParseRawPrivateKey returns a private key from a PEM encoded private key. It // supports RSA (PKCS#1), PKCS#8, DSA (OpenSSL), and ECDSA private keys. func ParseRawPrivateKey(pemBytes []byte) (interface{}, error) { block, _ := pem.Decode(pemBytes) if block == nil { return nil, errors.New("ssh: no key found") } if encryptedBlock(block) { return nil, errors.New("ssh: cannot decode encrypted private keys") } switch block.Type { case "RSA PRIVATE KEY": return x509.ParsePKCS1PrivateKey(block.Bytes) // RFC5208 - https://tools.ietf.org/html/rfc5208 case "PRIVATE KEY": return x509.ParsePKCS8PrivateKey(block.Bytes) case "EC PRIVATE KEY": return x509.ParseECPrivateKey(block.Bytes) case "DSA PRIVATE KEY": return ParseDSAPrivateKey(block.Bytes) case "OPENSSH PRIVATE KEY": return parseOpenSSHPrivateKey(block.Bytes) default: return nil, fmt.Errorf("ssh: unsupported key type %q", block.Type) } } // ParseRawPrivateKeyWithPassphrase returns a private key decrypted with // passphrase from a PEM encoded private key. If wrong passphrase, return // x509.IncorrectPasswordError. func ParseRawPrivateKeyWithPassphrase(pemBytes, passPhrase []byte) (interface{}, error) { block, _ := pem.Decode(pemBytes) if block == nil { return nil, errors.New("ssh: no key found") } buf := block.Bytes if encryptedBlock(block) { if x509.IsEncryptedPEMBlock(block) { var err error buf, err = x509.DecryptPEMBlock(block, passPhrase) if err != nil { if err == x509.IncorrectPasswordError { return nil, err } return nil, fmt.Errorf("ssh: cannot decode encrypted private keys: %v", err) } } } switch block.Type { case "RSA PRIVATE KEY": return x509.ParsePKCS1PrivateKey(buf) case "EC PRIVATE KEY": return x509.ParseECPrivateKey(buf) case "DSA PRIVATE KEY": return ParseDSAPrivateKey(buf) case "OPENSSH PRIVATE KEY": return parseOpenSSHPrivateKey(buf) default: return nil, fmt.Errorf("ssh: unsupported key type %q", block.Type) } } // ParseDSAPrivateKey returns a DSA private key from its ASN.1 DER encoding, as // specified by the OpenSSL DSA man page. func ParseDSAPrivateKey(der []byte) (*dsa.PrivateKey, error) { var k struct { Version int P *big.Int Q *big.Int G *big.Int Pub *big.Int Priv *big.Int } rest, err := asn1.Unmarshal(der, &k) if err != nil { return nil, errors.New("ssh: failed to parse DSA key: " + err.Error()) } if len(rest) > 0 { return nil, errors.New("ssh: garbage after DSA key") } return &dsa.PrivateKey{ PublicKey: dsa.PublicKey{ Parameters: dsa.Parameters{ P: k.P, Q: k.Q, G: k.G, }, Y: k.Pub, }, X: k.Priv, }, nil } // Implemented based on the documentation at // https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key func parseOpenSSHPrivateKey(key []byte) (crypto.PrivateKey, error) { const magic = "openssh-key-v1\x00" if len(key) < len(magic) || string(key[:len(magic)]) != magic { return nil, errors.New("ssh: invalid openssh private key format") } remaining := key[len(magic):] var w struct { CipherName string KdfName string KdfOpts string NumKeys uint32 PubKey []byte PrivKeyBlock []byte } if err := Unmarshal(remaining, &w); err != nil { return nil, err } if w.KdfName != "none" || w.CipherName != "none" { return nil, errors.New("ssh: cannot decode encrypted private keys") } pk1 := struct { Check1 uint32 Check2 uint32 Keytype string Rest []byte `ssh:"rest"` }{} if err := Unmarshal(w.PrivKeyBlock, &pk1); err != nil { return nil, err } if pk1.Check1 != pk1.Check2 { return nil, errors.New("ssh: checkint mismatch") } // we only handle ed25519 and rsa keys currently switch pk1.Keytype { case KeyAlgoRSA: // https://github.com/openssh/openssh-portable/blob/master/sshkey.c#L2760-L2773 key := struct { N *big.Int E *big.Int D *big.Int Iqmp *big.Int P *big.Int Q *big.Int Comment string Pad []byte `ssh:"rest"` }{} if err := Unmarshal(pk1.Rest, &key); err != nil { return nil, err } for i, b := range key.Pad { if int(b) != i+1 { return nil, errors.New("ssh: padding not as expected") } } pk := &rsa.PrivateKey{ PublicKey: rsa.PublicKey{ N: key.N, E: int(key.E.Int64()), }, D: key.D, Primes: []*big.Int{key.P, key.Q}, } if err := pk.Validate(); err != nil { return nil, err } pk.Precompute() return pk, nil case KeyAlgoED25519: key := struct { Pub []byte Priv []byte Comment string Pad []byte `ssh:"rest"` }{} if err := Unmarshal(pk1.Rest, &key); err != nil { return nil, err } if len(key.Priv) != ed25519.PrivateKeySize { return nil, errors.New("ssh: private key unexpected length") } for i, b := range key.Pad { if int(b) != i+1 { return nil, errors.New("ssh: padding not as expected") } } pk := ed25519.PrivateKey(make([]byte, ed25519.PrivateKeySize)) copy(pk, key.Priv) return &pk, nil default: return nil, errors.New("ssh: unhandled key type") } } // FingerprintLegacyMD5 returns the user presentation of the key's // fingerprint as described by RFC 4716 section 4. func FingerprintLegacyMD5(pubKey PublicKey) string { md5sum := md5.Sum(pubKey.Marshal()) hexarray := make([]string, len(md5sum)) for i, c := range md5sum { hexarray[i] = hex.EncodeToString([]byte{c}) } return strings.Join(hexarray, ":") } // FingerprintSHA256 returns the user presentation of the key's // fingerprint as unpadded base64 encoded sha256 hash. // This format was introduced from OpenSSH 6.8. // https://www.openssh.com/txt/release-6.8 // https://tools.ietf.org/html/rfc4648#section-3.2 (unpadded base64 encoding) func FingerprintSHA256(pubKey PublicKey) string { sha256sum := sha256.Sum256(pubKey.Marshal()) hash := base64.RawStdEncoding.EncodeToString(sha256sum[:]) return "SHA256:" + hash } ================================================ FILE: vendor/golang.org/x/crypto/ssh/mac.go ================================================ // Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh // Message authentication support import ( "crypto/hmac" "crypto/sha1" "crypto/sha256" "hash" ) type macMode struct { keySize int etm bool new func(key []byte) hash.Hash } // truncatingMAC wraps around a hash.Hash and truncates the output digest to // a given size. type truncatingMAC struct { length int hmac hash.Hash } func (t truncatingMAC) Write(data []byte) (int, error) { return t.hmac.Write(data) } func (t truncatingMAC) Sum(in []byte) []byte { out := t.hmac.Sum(in) return out[:len(in)+t.length] } func (t truncatingMAC) Reset() { t.hmac.Reset() } func (t truncatingMAC) Size() int { return t.length } func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() } var macModes = map[string]*macMode{ "hmac-sha2-256-etm@openssh.com": {32, true, func(key []byte) hash.Hash { return hmac.New(sha256.New, key) }}, "hmac-sha2-256": {32, false, func(key []byte) hash.Hash { return hmac.New(sha256.New, key) }}, "hmac-sha1": {20, false, func(key []byte) hash.Hash { return hmac.New(sha1.New, key) }}, "hmac-sha1-96": {20, false, func(key []byte) hash.Hash { return truncatingMAC{12, hmac.New(sha1.New, key)} }}, } ================================================ FILE: vendor/golang.org/x/crypto/ssh/messages.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "bytes" "encoding/binary" "errors" "fmt" "io" "math/big" "reflect" "strconv" "strings" ) // These are SSH message type numbers. They are scattered around several // documents but many were taken from [SSH-PARAMETERS]. const ( msgIgnore = 2 msgUnimplemented = 3 msgDebug = 4 msgNewKeys = 21 ) // SSH messages: // // These structures mirror the wire format of the corresponding SSH messages. // They are marshaled using reflection with the marshal and unmarshal functions // in this file. The only wrinkle is that a final member of type []byte with a // ssh tag of "rest" receives the remainder of a packet when unmarshaling. // See RFC 4253, section 11.1. const msgDisconnect = 1 // disconnectMsg is the message that signals a disconnect. It is also // the error type returned from mux.Wait() type disconnectMsg struct { Reason uint32 `sshtype:"1"` Message string Language string } func (d *disconnectMsg) Error() string { return fmt.Sprintf("ssh: disconnect, reason %d: %s", d.Reason, d.Message) } // See RFC 4253, section 7.1. const msgKexInit = 20 type kexInitMsg struct { Cookie [16]byte `sshtype:"20"` KexAlgos []string ServerHostKeyAlgos []string CiphersClientServer []string CiphersServerClient []string MACsClientServer []string MACsServerClient []string CompressionClientServer []string CompressionServerClient []string LanguagesClientServer []string LanguagesServerClient []string FirstKexFollows bool Reserved uint32 } // See RFC 4253, section 8. // Diffie-Helman const msgKexDHInit = 30 type kexDHInitMsg struct { X *big.Int `sshtype:"30"` } const msgKexECDHInit = 30 type kexECDHInitMsg struct { ClientPubKey []byte `sshtype:"30"` } const msgKexECDHReply = 31 type kexECDHReplyMsg struct { HostKey []byte `sshtype:"31"` EphemeralPubKey []byte Signature []byte } const msgKexDHReply = 31 type kexDHReplyMsg struct { HostKey []byte `sshtype:"31"` Y *big.Int Signature []byte } // See RFC 4253, section 10. const msgServiceRequest = 5 type serviceRequestMsg struct { Service string `sshtype:"5"` } // See RFC 4253, section 10. const msgServiceAccept = 6 type serviceAcceptMsg struct { Service string `sshtype:"6"` } // See RFC 4252, section 5. const msgUserAuthRequest = 50 type userAuthRequestMsg struct { User string `sshtype:"50"` Service string Method string Payload []byte `ssh:"rest"` } // Used for debug printouts of packets. type userAuthSuccessMsg struct { } // See RFC 4252, section 5.1 const msgUserAuthFailure = 51 type userAuthFailureMsg struct { Methods []string `sshtype:"51"` PartialSuccess bool } // See RFC 4252, section 5.1 const msgUserAuthSuccess = 52 // See RFC 4252, section 5.4 const msgUserAuthBanner = 53 type userAuthBannerMsg struct { Message string `sshtype:"53"` // unused, but required to allow message parsing Language string } // See RFC 4256, section 3.2 const msgUserAuthInfoRequest = 60 const msgUserAuthInfoResponse = 61 type userAuthInfoRequestMsg struct { User string `sshtype:"60"` Instruction string DeprecatedLanguage string NumPrompts uint32 Prompts []byte `ssh:"rest"` } // See RFC 4254, section 5.1. const msgChannelOpen = 90 type channelOpenMsg struct { ChanType string `sshtype:"90"` PeersID uint32 PeersWindow uint32 MaxPacketSize uint32 TypeSpecificData []byte `ssh:"rest"` } const msgChannelExtendedData = 95 const msgChannelData = 94 // Used for debug print outs of packets. type channelDataMsg struct { PeersID uint32 `sshtype:"94"` Length uint32 Rest []byte `ssh:"rest"` } // See RFC 4254, section 5.1. const msgChannelOpenConfirm = 91 type channelOpenConfirmMsg struct { PeersID uint32 `sshtype:"91"` MyID uint32 MyWindow uint32 MaxPacketSize uint32 TypeSpecificData []byte `ssh:"rest"` } // See RFC 4254, section 5.1. const msgChannelOpenFailure = 92 type channelOpenFailureMsg struct { PeersID uint32 `sshtype:"92"` Reason RejectionReason Message string Language string } const msgChannelRequest = 98 type channelRequestMsg struct { PeersID uint32 `sshtype:"98"` Request string WantReply bool RequestSpecificData []byte `ssh:"rest"` } // See RFC 4254, section 5.4. const msgChannelSuccess = 99 type channelRequestSuccessMsg struct { PeersID uint32 `sshtype:"99"` } // See RFC 4254, section 5.4. const msgChannelFailure = 100 type channelRequestFailureMsg struct { PeersID uint32 `sshtype:"100"` } // See RFC 4254, section 5.3 const msgChannelClose = 97 type channelCloseMsg struct { PeersID uint32 `sshtype:"97"` } // See RFC 4254, section 5.3 const msgChannelEOF = 96 type channelEOFMsg struct { PeersID uint32 `sshtype:"96"` } // See RFC 4254, section 4 const msgGlobalRequest = 80 type globalRequestMsg struct { Type string `sshtype:"80"` WantReply bool Data []byte `ssh:"rest"` } // See RFC 4254, section 4 const msgRequestSuccess = 81 type globalRequestSuccessMsg struct { Data []byte `ssh:"rest" sshtype:"81"` } // See RFC 4254, section 4 const msgRequestFailure = 82 type globalRequestFailureMsg struct { Data []byte `ssh:"rest" sshtype:"82"` } // See RFC 4254, section 5.2 const msgChannelWindowAdjust = 93 type windowAdjustMsg struct { PeersID uint32 `sshtype:"93"` AdditionalBytes uint32 } // See RFC 4252, section 7 const msgUserAuthPubKeyOk = 60 type userAuthPubKeyOkMsg struct { Algo string `sshtype:"60"` PubKey []byte } // typeTags returns the possible type bytes for the given reflect.Type, which // should be a struct. The possible values are separated by a '|' character. func typeTags(structType reflect.Type) (tags []byte) { tagStr := structType.Field(0).Tag.Get("sshtype") for _, tag := range strings.Split(tagStr, "|") { i, err := strconv.Atoi(tag) if err == nil { tags = append(tags, byte(i)) } } return tags } func fieldError(t reflect.Type, field int, problem string) error { if problem != "" { problem = ": " + problem } return fmt.Errorf("ssh: unmarshal error for field %s of type %s%s", t.Field(field).Name, t.Name(), problem) } var errShortRead = errors.New("ssh: short read") // Unmarshal parses data in SSH wire format into a structure. The out // argument should be a pointer to struct. If the first member of the // struct has the "sshtype" tag set to a '|'-separated set of numbers // in decimal, the packet must start with one of those numbers. In // case of error, Unmarshal returns a ParseError or // UnexpectedMessageError. func Unmarshal(data []byte, out interface{}) error { v := reflect.ValueOf(out).Elem() structType := v.Type() expectedTypes := typeTags(structType) var expectedType byte if len(expectedTypes) > 0 { expectedType = expectedTypes[0] } if len(data) == 0 { return parseError(expectedType) } if len(expectedTypes) > 0 { goodType := false for _, e := range expectedTypes { if e > 0 && data[0] == e { goodType = true break } } if !goodType { return fmt.Errorf("ssh: unexpected message type %d (expected one of %v)", data[0], expectedTypes) } data = data[1:] } var ok bool for i := 0; i < v.NumField(); i++ { field := v.Field(i) t := field.Type() switch t.Kind() { case reflect.Bool: if len(data) < 1 { return errShortRead } field.SetBool(data[0] != 0) data = data[1:] case reflect.Array: if t.Elem().Kind() != reflect.Uint8 { return fieldError(structType, i, "array of unsupported type") } if len(data) < t.Len() { return errShortRead } for j, n := 0, t.Len(); j < n; j++ { field.Index(j).Set(reflect.ValueOf(data[j])) } data = data[t.Len():] case reflect.Uint64: var u64 uint64 if u64, data, ok = parseUint64(data); !ok { return errShortRead } field.SetUint(u64) case reflect.Uint32: var u32 uint32 if u32, data, ok = parseUint32(data); !ok { return errShortRead } field.SetUint(uint64(u32)) case reflect.Uint8: if len(data) < 1 { return errShortRead } field.SetUint(uint64(data[0])) data = data[1:] case reflect.String: var s []byte if s, data, ok = parseString(data); !ok { return fieldError(structType, i, "") } field.SetString(string(s)) case reflect.Slice: switch t.Elem().Kind() { case reflect.Uint8: if structType.Field(i).Tag.Get("ssh") == "rest" { field.Set(reflect.ValueOf(data)) data = nil } else { var s []byte if s, data, ok = parseString(data); !ok { return errShortRead } field.Set(reflect.ValueOf(s)) } case reflect.String: var nl []string if nl, data, ok = parseNameList(data); !ok { return errShortRead } field.Set(reflect.ValueOf(nl)) default: return fieldError(structType, i, "slice of unsupported type") } case reflect.Ptr: if t == bigIntType { var n *big.Int if n, data, ok = parseInt(data); !ok { return errShortRead } field.Set(reflect.ValueOf(n)) } else { return fieldError(structType, i, "pointer to unsupported type") } default: return fieldError(structType, i, fmt.Sprintf("unsupported type: %v", t)) } } if len(data) != 0 { return parseError(expectedType) } return nil } // Marshal serializes the message in msg to SSH wire format. The msg // argument should be a struct or pointer to struct. If the first // member has the "sshtype" tag set to a number in decimal, that // number is prepended to the result. If the last of member has the // "ssh" tag set to "rest", its contents are appended to the output. func Marshal(msg interface{}) []byte { out := make([]byte, 0, 64) return marshalStruct(out, msg) } func marshalStruct(out []byte, msg interface{}) []byte { v := reflect.Indirect(reflect.ValueOf(msg)) msgTypes := typeTags(v.Type()) if len(msgTypes) > 0 { out = append(out, msgTypes[0]) } for i, n := 0, v.NumField(); i < n; i++ { field := v.Field(i) switch t := field.Type(); t.Kind() { case reflect.Bool: var v uint8 if field.Bool() { v = 1 } out = append(out, v) case reflect.Array: if t.Elem().Kind() != reflect.Uint8 { panic(fmt.Sprintf("array of non-uint8 in field %d: %T", i, field.Interface())) } for j, l := 0, t.Len(); j < l; j++ { out = append(out, uint8(field.Index(j).Uint())) } case reflect.Uint32: out = appendU32(out, uint32(field.Uint())) case reflect.Uint64: out = appendU64(out, uint64(field.Uint())) case reflect.Uint8: out = append(out, uint8(field.Uint())) case reflect.String: s := field.String() out = appendInt(out, len(s)) out = append(out, s...) case reflect.Slice: switch t.Elem().Kind() { case reflect.Uint8: if v.Type().Field(i).Tag.Get("ssh") != "rest" { out = appendInt(out, field.Len()) } out = append(out, field.Bytes()...) case reflect.String: offset := len(out) out = appendU32(out, 0) if n := field.Len(); n > 0 { for j := 0; j < n; j++ { f := field.Index(j) if j != 0 { out = append(out, ',') } out = append(out, f.String()...) } // overwrite length value binary.BigEndian.PutUint32(out[offset:], uint32(len(out)-offset-4)) } default: panic(fmt.Sprintf("slice of unknown type in field %d: %T", i, field.Interface())) } case reflect.Ptr: if t == bigIntType { var n *big.Int nValue := reflect.ValueOf(&n) nValue.Elem().Set(field) needed := intLength(n) oldLength := len(out) if cap(out)-len(out) < needed { newOut := make([]byte, len(out), 2*(len(out)+needed)) copy(newOut, out) out = newOut } out = out[:oldLength+needed] marshalInt(out[oldLength:], n) } else { panic(fmt.Sprintf("pointer to unknown type in field %d: %T", i, field.Interface())) } } } return out } var bigOne = big.NewInt(1) func parseString(in []byte) (out, rest []byte, ok bool) { if len(in) < 4 { return } length := binary.BigEndian.Uint32(in) in = in[4:] if uint32(len(in)) < length { return } out = in[:length] rest = in[length:] ok = true return } var ( comma = []byte{','} emptyNameList = []string{} ) func parseNameList(in []byte) (out []string, rest []byte, ok bool) { contents, rest, ok := parseString(in) if !ok { return } if len(contents) == 0 { out = emptyNameList return } parts := bytes.Split(contents, comma) out = make([]string, len(parts)) for i, part := range parts { out[i] = string(part) } return } func parseInt(in []byte) (out *big.Int, rest []byte, ok bool) { contents, rest, ok := parseString(in) if !ok { return } out = new(big.Int) if len(contents) > 0 && contents[0]&0x80 == 0x80 { // This is a negative number notBytes := make([]byte, len(contents)) for i := range notBytes { notBytes[i] = ^contents[i] } out.SetBytes(notBytes) out.Add(out, bigOne) out.Neg(out) } else { // Positive number out.SetBytes(contents) } ok = true return } func parseUint32(in []byte) (uint32, []byte, bool) { if len(in) < 4 { return 0, nil, false } return binary.BigEndian.Uint32(in), in[4:], true } func parseUint64(in []byte) (uint64, []byte, bool) { if len(in) < 8 { return 0, nil, false } return binary.BigEndian.Uint64(in), in[8:], true } func intLength(n *big.Int) int { length := 4 /* length bytes */ if n.Sign() < 0 { nMinus1 := new(big.Int).Neg(n) nMinus1.Sub(nMinus1, bigOne) bitLen := nMinus1.BitLen() if bitLen%8 == 0 { // The number will need 0xff padding length++ } length += (bitLen + 7) / 8 } else if n.Sign() == 0 { // A zero is the zero length string } else { bitLen := n.BitLen() if bitLen%8 == 0 { // The number will need 0x00 padding length++ } length += (bitLen + 7) / 8 } return length } func marshalUint32(to []byte, n uint32) []byte { binary.BigEndian.PutUint32(to, n) return to[4:] } func marshalUint64(to []byte, n uint64) []byte { binary.BigEndian.PutUint64(to, n) return to[8:] } func marshalInt(to []byte, n *big.Int) []byte { lengthBytes := to to = to[4:] length := 0 if n.Sign() < 0 { // A negative number has to be converted to two's-complement // form. So we'll subtract 1 and invert. If the // most-significant-bit isn't set then we'll need to pad the // beginning with 0xff in order to keep the number negative. nMinus1 := new(big.Int).Neg(n) nMinus1.Sub(nMinus1, bigOne) bytes := nMinus1.Bytes() for i := range bytes { bytes[i] ^= 0xff } if len(bytes) == 0 || bytes[0]&0x80 == 0 { to[0] = 0xff to = to[1:] length++ } nBytes := copy(to, bytes) to = to[nBytes:] length += nBytes } else if n.Sign() == 0 { // A zero is the zero length string } else { bytes := n.Bytes() if len(bytes) > 0 && bytes[0]&0x80 != 0 { // We'll have to pad this with a 0x00 in order to // stop it looking like a negative number. to[0] = 0 to = to[1:] length++ } nBytes := copy(to, bytes) to = to[nBytes:] length += nBytes } lengthBytes[0] = byte(length >> 24) lengthBytes[1] = byte(length >> 16) lengthBytes[2] = byte(length >> 8) lengthBytes[3] = byte(length) return to } func writeInt(w io.Writer, n *big.Int) { length := intLength(n) buf := make([]byte, length) marshalInt(buf, n) w.Write(buf) } func writeString(w io.Writer, s []byte) { var lengthBytes [4]byte lengthBytes[0] = byte(len(s) >> 24) lengthBytes[1] = byte(len(s) >> 16) lengthBytes[2] = byte(len(s) >> 8) lengthBytes[3] = byte(len(s)) w.Write(lengthBytes[:]) w.Write(s) } func stringLength(n int) int { return 4 + n } func marshalString(to []byte, s []byte) []byte { to[0] = byte(len(s) >> 24) to[1] = byte(len(s) >> 16) to[2] = byte(len(s) >> 8) to[3] = byte(len(s)) to = to[4:] copy(to, s) return to[len(s):] } var bigIntType = reflect.TypeOf((*big.Int)(nil)) // Decode a packet into its corresponding message. func decode(packet []byte) (interface{}, error) { var msg interface{} switch packet[0] { case msgDisconnect: msg = new(disconnectMsg) case msgServiceRequest: msg = new(serviceRequestMsg) case msgServiceAccept: msg = new(serviceAcceptMsg) case msgKexInit: msg = new(kexInitMsg) case msgKexDHInit: msg = new(kexDHInitMsg) case msgKexDHReply: msg = new(kexDHReplyMsg) case msgUserAuthRequest: msg = new(userAuthRequestMsg) case msgUserAuthSuccess: return new(userAuthSuccessMsg), nil case msgUserAuthFailure: msg = new(userAuthFailureMsg) case msgUserAuthPubKeyOk: msg = new(userAuthPubKeyOkMsg) case msgGlobalRequest: msg = new(globalRequestMsg) case msgRequestSuccess: msg = new(globalRequestSuccessMsg) case msgRequestFailure: msg = new(globalRequestFailureMsg) case msgChannelOpen: msg = new(channelOpenMsg) case msgChannelData: msg = new(channelDataMsg) case msgChannelOpenConfirm: msg = new(channelOpenConfirmMsg) case msgChannelOpenFailure: msg = new(channelOpenFailureMsg) case msgChannelWindowAdjust: msg = new(windowAdjustMsg) case msgChannelEOF: msg = new(channelEOFMsg) case msgChannelClose: msg = new(channelCloseMsg) case msgChannelRequest: msg = new(channelRequestMsg) case msgChannelSuccess: msg = new(channelRequestSuccessMsg) case msgChannelFailure: msg = new(channelRequestFailureMsg) default: return nil, unexpectedMessageError(0, packet[0]) } if err := Unmarshal(packet, msg); err != nil { return nil, err } return msg, nil } ================================================ FILE: vendor/golang.org/x/crypto/ssh/mux.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "encoding/binary" "fmt" "io" "log" "sync" "sync/atomic" ) // debugMux, if set, causes messages in the connection protocol to be // logged. const debugMux = false // chanList is a thread safe channel list. type chanList struct { // protects concurrent access to chans sync.Mutex // chans are indexed by the local id of the channel, which the // other side should send in the PeersId field. chans []*channel // This is a debugging aid: it offsets all IDs by this // amount. This helps distinguish otherwise identical // server/client muxes offset uint32 } // Assigns a channel ID to the given channel. func (c *chanList) add(ch *channel) uint32 { c.Lock() defer c.Unlock() for i := range c.chans { if c.chans[i] == nil { c.chans[i] = ch return uint32(i) + c.offset } } c.chans = append(c.chans, ch) return uint32(len(c.chans)-1) + c.offset } // getChan returns the channel for the given ID. func (c *chanList) getChan(id uint32) *channel { id -= c.offset c.Lock() defer c.Unlock() if id < uint32(len(c.chans)) { return c.chans[id] } return nil } func (c *chanList) remove(id uint32) { id -= c.offset c.Lock() if id < uint32(len(c.chans)) { c.chans[id] = nil } c.Unlock() } // dropAll forgets all channels it knows, returning them in a slice. func (c *chanList) dropAll() []*channel { c.Lock() defer c.Unlock() var r []*channel for _, ch := range c.chans { if ch == nil { continue } r = append(r, ch) } c.chans = nil return r } // mux represents the state for the SSH connection protocol, which // multiplexes many channels onto a single packet transport. type mux struct { conn packetConn chanList chanList incomingChannels chan NewChannel globalSentMu sync.Mutex globalResponses chan interface{} incomingRequests chan *Request errCond *sync.Cond err error } // When debugging, each new chanList instantiation has a different // offset. var globalOff uint32 func (m *mux) Wait() error { m.errCond.L.Lock() defer m.errCond.L.Unlock() for m.err == nil { m.errCond.Wait() } return m.err } // newMux returns a mux that runs over the given connection. func newMux(p packetConn) *mux { m := &mux{ conn: p, incomingChannels: make(chan NewChannel, chanSize), globalResponses: make(chan interface{}, 1), incomingRequests: make(chan *Request, chanSize), errCond: newCond(), } if debugMux { m.chanList.offset = atomic.AddUint32(&globalOff, 1) } go m.loop() return m } func (m *mux) sendMessage(msg interface{}) error { p := Marshal(msg) if debugMux { log.Printf("send global(%d): %#v", m.chanList.offset, msg) } return m.conn.writePacket(p) } func (m *mux) SendRequest(name string, wantReply bool, payload []byte) (bool, []byte, error) { if wantReply { m.globalSentMu.Lock() defer m.globalSentMu.Unlock() } if err := m.sendMessage(globalRequestMsg{ Type: name, WantReply: wantReply, Data: payload, }); err != nil { return false, nil, err } if !wantReply { return false, nil, nil } msg, ok := <-m.globalResponses if !ok { return false, nil, io.EOF } switch msg := msg.(type) { case *globalRequestFailureMsg: return false, msg.Data, nil case *globalRequestSuccessMsg: return true, msg.Data, nil default: return false, nil, fmt.Errorf("ssh: unexpected response to request: %#v", msg) } } // ackRequest must be called after processing a global request that // has WantReply set. func (m *mux) ackRequest(ok bool, data []byte) error { if ok { return m.sendMessage(globalRequestSuccessMsg{Data: data}) } return m.sendMessage(globalRequestFailureMsg{Data: data}) } func (m *mux) Close() error { return m.conn.Close() } // loop runs the connection machine. It will process packets until an // error is encountered. To synchronize on loop exit, use mux.Wait. func (m *mux) loop() { var err error for err == nil { err = m.onePacket() } for _, ch := range m.chanList.dropAll() { ch.close() } close(m.incomingChannels) close(m.incomingRequests) close(m.globalResponses) m.conn.Close() m.errCond.L.Lock() m.err = err m.errCond.Broadcast() m.errCond.L.Unlock() if debugMux { log.Println("loop exit", err) } } // onePacket reads and processes one packet. func (m *mux) onePacket() error { packet, err := m.conn.readPacket() if err != nil { return err } if debugMux { if packet[0] == msgChannelData || packet[0] == msgChannelExtendedData { log.Printf("decoding(%d): data packet - %d bytes", m.chanList.offset, len(packet)) } else { p, _ := decode(packet) log.Printf("decoding(%d): %d %#v - %d bytes", m.chanList.offset, packet[0], p, len(packet)) } } switch packet[0] { case msgChannelOpen: return m.handleChannelOpen(packet) case msgGlobalRequest, msgRequestSuccess, msgRequestFailure: return m.handleGlobalPacket(packet) } // assume a channel packet. if len(packet) < 5 { return parseError(packet[0]) } id := binary.BigEndian.Uint32(packet[1:]) ch := m.chanList.getChan(id) if ch == nil { return fmt.Errorf("ssh: invalid channel %d", id) } return ch.handlePacket(packet) } func (m *mux) handleGlobalPacket(packet []byte) error { msg, err := decode(packet) if err != nil { return err } switch msg := msg.(type) { case *globalRequestMsg: m.incomingRequests <- &Request{ Type: msg.Type, WantReply: msg.WantReply, Payload: msg.Data, mux: m, } case *globalRequestSuccessMsg, *globalRequestFailureMsg: m.globalResponses <- msg default: panic(fmt.Sprintf("not a global message %#v", msg)) } return nil } // handleChannelOpen schedules a channel to be Accept()ed. func (m *mux) handleChannelOpen(packet []byte) error { var msg channelOpenMsg if err := Unmarshal(packet, &msg); err != nil { return err } if msg.MaxPacketSize < minPacketLength || msg.MaxPacketSize > 1<<31 { failMsg := channelOpenFailureMsg{ PeersID: msg.PeersID, Reason: ConnectionFailed, Message: "invalid request", Language: "en_US.UTF-8", } return m.sendMessage(failMsg) } c := m.newChannel(msg.ChanType, channelInbound, msg.TypeSpecificData) c.remoteId = msg.PeersID c.maxRemotePayload = msg.MaxPacketSize c.remoteWin.add(msg.PeersWindow) m.incomingChannels <- c return nil } func (m *mux) OpenChannel(chanType string, extra []byte) (Channel, <-chan *Request, error) { ch, err := m.openChannel(chanType, extra) if err != nil { return nil, nil, err } return ch, ch.incomingRequests, nil } func (m *mux) openChannel(chanType string, extra []byte) (*channel, error) { ch := m.newChannel(chanType, channelOutbound, extra) ch.maxIncomingPayload = channelMaxPacket open := channelOpenMsg{ ChanType: chanType, PeersWindow: ch.myWindow, MaxPacketSize: ch.maxIncomingPayload, TypeSpecificData: extra, PeersID: ch.localId, } if err := m.sendMessage(open); err != nil { return nil, err } switch msg := (<-ch.msg).(type) { case *channelOpenConfirmMsg: return ch, nil case *channelOpenFailureMsg: return nil, &OpenChannelError{msg.Reason, msg.Message} default: return nil, fmt.Errorf("ssh: unexpected packet in response to channel open: %T", msg) } } ================================================ FILE: vendor/golang.org/x/crypto/ssh/server.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "bytes" "errors" "fmt" "io" "net" "strings" ) // The Permissions type holds fine-grained permissions that are // specific to a user or a specific authentication method for a user. // The Permissions value for a successful authentication attempt is // available in ServerConn, so it can be used to pass information from // the user-authentication phase to the application layer. type Permissions struct { // CriticalOptions indicate restrictions to the default // permissions, and are typically used in conjunction with // user certificates. The standard for SSH certificates // defines "force-command" (only allow the given command to // execute) and "source-address" (only allow connections from // the given address). The SSH package currently only enforces // the "source-address" critical option. It is up to server // implementations to enforce other critical options, such as // "force-command", by checking them after the SSH handshake // is successful. In general, SSH servers should reject // connections that specify critical options that are unknown // or not supported. CriticalOptions map[string]string // Extensions are extra functionality that the server may // offer on authenticated connections. Lack of support for an // extension does not preclude authenticating a user. Common // extensions are "permit-agent-forwarding", // "permit-X11-forwarding". The Go SSH library currently does // not act on any extension, and it is up to server // implementations to honor them. Extensions can be used to // pass data from the authentication callbacks to the server // application layer. Extensions map[string]string } // ServerConfig holds server specific configuration data. type ServerConfig struct { // Config contains configuration shared between client and server. Config hostKeys []Signer // NoClientAuth is true if clients are allowed to connect without // authenticating. NoClientAuth bool // MaxAuthTries specifies the maximum number of authentication attempts // permitted per connection. If set to a negative number, the number of // attempts are unlimited. If set to zero, the number of attempts are limited // to 6. MaxAuthTries int // PasswordCallback, if non-nil, is called when a user // attempts to authenticate using a password. PasswordCallback func(conn ConnMetadata, password []byte) (*Permissions, error) // PublicKeyCallback, if non-nil, is called when a client // offers a public key for authentication. It must return a nil error // if the given public key can be used to authenticate the // given user. For example, see CertChecker.Authenticate. A // call to this function does not guarantee that the key // offered is in fact used to authenticate. To record any data // depending on the public key, store it inside a // Permissions.Extensions entry. PublicKeyCallback func(conn ConnMetadata, key PublicKey) (*Permissions, error) // KeyboardInteractiveCallback, if non-nil, is called when // keyboard-interactive authentication is selected (RFC // 4256). The client object's Challenge function should be // used to query the user. The callback may offer multiple // Challenge rounds. To avoid information leaks, the client // should be presented a challenge even if the user is // unknown. KeyboardInteractiveCallback func(conn ConnMetadata, client KeyboardInteractiveChallenge) (*Permissions, error) // AuthLogCallback, if non-nil, is called to log all authentication // attempts. AuthLogCallback func(conn ConnMetadata, method string, err error) // ServerVersion is the version identification string to announce in // the public handshake. // If empty, a reasonable default is used. // Note that RFC 4253 section 4.2 requires that this string start with // "SSH-2.0-". ServerVersion string // BannerCallback, if present, is called and the return string is sent to // the client after key exchange completed but before authentication. BannerCallback func(conn ConnMetadata) string } // AddHostKey adds a private key as a host key. If an existing host // key exists with the same algorithm, it is overwritten. Each server // config must have at least one host key. func (s *ServerConfig) AddHostKey(key Signer) { for i, k := range s.hostKeys { if k.PublicKey().Type() == key.PublicKey().Type() { s.hostKeys[i] = key return } } s.hostKeys = append(s.hostKeys, key) } // cachedPubKey contains the results of querying whether a public key is // acceptable for a user. type cachedPubKey struct { user string pubKeyData []byte result error perms *Permissions } const maxCachedPubKeys = 16 // pubKeyCache caches tests for public keys. Since SSH clients // will query whether a public key is acceptable before attempting to // authenticate with it, we end up with duplicate queries for public // key validity. The cache only applies to a single ServerConn. type pubKeyCache struct { keys []cachedPubKey } // get returns the result for a given user/algo/key tuple. func (c *pubKeyCache) get(user string, pubKeyData []byte) (cachedPubKey, bool) { for _, k := range c.keys { if k.user == user && bytes.Equal(k.pubKeyData, pubKeyData) { return k, true } } return cachedPubKey{}, false } // add adds the given tuple to the cache. func (c *pubKeyCache) add(candidate cachedPubKey) { if len(c.keys) < maxCachedPubKeys { c.keys = append(c.keys, candidate) } } // ServerConn is an authenticated SSH connection, as seen from the // server type ServerConn struct { Conn // If the succeeding authentication callback returned a // non-nil Permissions pointer, it is stored here. Permissions *Permissions } // NewServerConn starts a new SSH server with c as the underlying // transport. It starts with a handshake and, if the handshake is // unsuccessful, it closes the connection and returns an error. The // Request and NewChannel channels must be serviced, or the connection // will hang. // // The returned error may be of type *ServerAuthError for // authentication errors. func NewServerConn(c net.Conn, config *ServerConfig) (*ServerConn, <-chan NewChannel, <-chan *Request, error) { fullConf := *config fullConf.SetDefaults() if fullConf.MaxAuthTries == 0 { fullConf.MaxAuthTries = 6 } s := &connection{ sshConn: sshConn{conn: c}, } perms, err := s.serverHandshake(&fullConf) if err != nil { c.Close() return nil, nil, nil, err } return &ServerConn{s, perms}, s.mux.incomingChannels, s.mux.incomingRequests, nil } // signAndMarshal signs the data with the appropriate algorithm, // and serializes the result in SSH wire format. func signAndMarshal(k Signer, rand io.Reader, data []byte) ([]byte, error) { sig, err := k.Sign(rand, data) if err != nil { return nil, err } return Marshal(sig), nil } // handshake performs key exchange and user authentication. func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) { if len(config.hostKeys) == 0 { return nil, errors.New("ssh: server has no host keys") } if !config.NoClientAuth && config.PasswordCallback == nil && config.PublicKeyCallback == nil && config.KeyboardInteractiveCallback == nil { return nil, errors.New("ssh: no authentication methods configured but NoClientAuth is also false") } if config.ServerVersion != "" { s.serverVersion = []byte(config.ServerVersion) } else { s.serverVersion = []byte(packageVersion) } var err error s.clientVersion, err = exchangeVersions(s.sshConn.conn, s.serverVersion) if err != nil { return nil, err } tr := newTransport(s.sshConn.conn, config.Rand, false /* not client */) s.transport = newServerTransport(tr, s.clientVersion, s.serverVersion, config) if err := s.transport.waitSession(); err != nil { return nil, err } // We just did the key change, so the session ID is established. s.sessionID = s.transport.getSessionID() var packet []byte if packet, err = s.transport.readPacket(); err != nil { return nil, err } var serviceRequest serviceRequestMsg if err = Unmarshal(packet, &serviceRequest); err != nil { return nil, err } if serviceRequest.Service != serviceUserAuth { return nil, errors.New("ssh: requested service '" + serviceRequest.Service + "' before authenticating") } serviceAccept := serviceAcceptMsg{ Service: serviceUserAuth, } if err := s.transport.writePacket(Marshal(&serviceAccept)); err != nil { return nil, err } perms, err := s.serverAuthenticate(config) if err != nil { return nil, err } s.mux = newMux(s.transport) return perms, err } func isAcceptableAlgo(algo string) bool { switch algo { case KeyAlgoRSA, KeyAlgoDSA, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, KeyAlgoED25519, CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01, CertAlgoED25519v01: return true } return false } func checkSourceAddress(addr net.Addr, sourceAddrs string) error { if addr == nil { return errors.New("ssh: no address known for client, but source-address match required") } tcpAddr, ok := addr.(*net.TCPAddr) if !ok { return fmt.Errorf("ssh: remote address %v is not an TCP address when checking source-address match", addr) } for _, sourceAddr := range strings.Split(sourceAddrs, ",") { if allowedIP := net.ParseIP(sourceAddr); allowedIP != nil { if allowedIP.Equal(tcpAddr.IP) { return nil } } else { _, ipNet, err := net.ParseCIDR(sourceAddr) if err != nil { return fmt.Errorf("ssh: error parsing source-address restriction %q: %v", sourceAddr, err) } if ipNet.Contains(tcpAddr.IP) { return nil } } } return fmt.Errorf("ssh: remote address %v is not allowed because of source-address restriction", addr) } // ServerAuthError represents server authentication errors and is // sometimes returned by NewServerConn. It appends any authentication // errors that may occur, and is returned if all of the authentication // methods provided by the user failed to authenticate. type ServerAuthError struct { // Errors contains authentication errors returned by the authentication // callback methods. The first entry is typically ErrNoAuth. Errors []error } func (l ServerAuthError) Error() string { var errs []string for _, err := range l.Errors { errs = append(errs, err.Error()) } return "[" + strings.Join(errs, ", ") + "]" } // ErrNoAuth is the error value returned if no // authentication method has been passed yet. This happens as a normal // part of the authentication loop, since the client first tries // 'none' authentication to discover available methods. // It is returned in ServerAuthError.Errors from NewServerConn. var ErrNoAuth = errors.New("ssh: no auth passed yet") func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, error) { sessionID := s.transport.getSessionID() var cache pubKeyCache var perms *Permissions authFailures := 0 var authErrs []error var displayedBanner bool userAuthLoop: for { if authFailures >= config.MaxAuthTries && config.MaxAuthTries > 0 { discMsg := &disconnectMsg{ Reason: 2, Message: "too many authentication failures", } if err := s.transport.writePacket(Marshal(discMsg)); err != nil { return nil, err } return nil, discMsg } var userAuthReq userAuthRequestMsg if packet, err := s.transport.readPacket(); err != nil { if err == io.EOF { return nil, &ServerAuthError{Errors: authErrs} } return nil, err } else if err = Unmarshal(packet, &userAuthReq); err != nil { return nil, err } if userAuthReq.Service != serviceSSH { return nil, errors.New("ssh: client attempted to negotiate for unknown service: " + userAuthReq.Service) } s.user = userAuthReq.User if !displayedBanner && config.BannerCallback != nil { displayedBanner = true msg := config.BannerCallback(s) if msg != "" { bannerMsg := &userAuthBannerMsg{ Message: msg, } if err := s.transport.writePacket(Marshal(bannerMsg)); err != nil { return nil, err } } } perms = nil authErr := ErrNoAuth switch userAuthReq.Method { case "none": if config.NoClientAuth { authErr = nil } // allow initial attempt of 'none' without penalty if authFailures == 0 { authFailures-- } case "password": if config.PasswordCallback == nil { authErr = errors.New("ssh: password auth not configured") break } payload := userAuthReq.Payload if len(payload) < 1 || payload[0] != 0 { return nil, parseError(msgUserAuthRequest) } payload = payload[1:] password, payload, ok := parseString(payload) if !ok || len(payload) > 0 { return nil, parseError(msgUserAuthRequest) } perms, authErr = config.PasswordCallback(s, password) case "keyboard-interactive": if config.KeyboardInteractiveCallback == nil { authErr = errors.New("ssh: keyboard-interactive auth not configured") break } prompter := &sshClientKeyboardInteractive{s} perms, authErr = config.KeyboardInteractiveCallback(s, prompter.Challenge) case "publickey": if config.PublicKeyCallback == nil { authErr = errors.New("ssh: publickey auth not configured") break } payload := userAuthReq.Payload if len(payload) < 1 { return nil, parseError(msgUserAuthRequest) } isQuery := payload[0] == 0 payload = payload[1:] algoBytes, payload, ok := parseString(payload) if !ok { return nil, parseError(msgUserAuthRequest) } algo := string(algoBytes) if !isAcceptableAlgo(algo) { authErr = fmt.Errorf("ssh: algorithm %q not accepted", algo) break } pubKeyData, payload, ok := parseString(payload) if !ok { return nil, parseError(msgUserAuthRequest) } pubKey, err := ParsePublicKey(pubKeyData) if err != nil { return nil, err } candidate, ok := cache.get(s.user, pubKeyData) if !ok { candidate.user = s.user candidate.pubKeyData = pubKeyData candidate.perms, candidate.result = config.PublicKeyCallback(s, pubKey) if candidate.result == nil && candidate.perms != nil && candidate.perms.CriticalOptions != nil && candidate.perms.CriticalOptions[sourceAddressCriticalOption] != "" { candidate.result = checkSourceAddress( s.RemoteAddr(), candidate.perms.CriticalOptions[sourceAddressCriticalOption]) } cache.add(candidate) } if isQuery { // The client can query if the given public key // would be okay. if len(payload) > 0 { return nil, parseError(msgUserAuthRequest) } if candidate.result == nil { okMsg := userAuthPubKeyOkMsg{ Algo: algo, PubKey: pubKeyData, } if err = s.transport.writePacket(Marshal(&okMsg)); err != nil { return nil, err } continue userAuthLoop } authErr = candidate.result } else { sig, payload, ok := parseSignature(payload) if !ok || len(payload) > 0 { return nil, parseError(msgUserAuthRequest) } // Ensure the public key algo and signature algo // are supported. Compare the private key // algorithm name that corresponds to algo with // sig.Format. This is usually the same, but // for certs, the names differ. if !isAcceptableAlgo(sig.Format) { authErr = fmt.Errorf("ssh: algorithm %q not accepted", sig.Format) break } signedData := buildDataSignedForAuth(sessionID, userAuthReq, algoBytes, pubKeyData) if err := pubKey.Verify(signedData, sig); err != nil { return nil, err } authErr = candidate.result perms = candidate.perms } default: authErr = fmt.Errorf("ssh: unknown method %q", userAuthReq.Method) } authErrs = append(authErrs, authErr) if config.AuthLogCallback != nil { config.AuthLogCallback(s, userAuthReq.Method, authErr) } if authErr == nil { break userAuthLoop } authFailures++ var failureMsg userAuthFailureMsg if config.PasswordCallback != nil { failureMsg.Methods = append(failureMsg.Methods, "password") } if config.PublicKeyCallback != nil { failureMsg.Methods = append(failureMsg.Methods, "publickey") } if config.KeyboardInteractiveCallback != nil { failureMsg.Methods = append(failureMsg.Methods, "keyboard-interactive") } if len(failureMsg.Methods) == 0 { return nil, errors.New("ssh: no authentication methods configured but NoClientAuth is also false") } if err := s.transport.writePacket(Marshal(&failureMsg)); err != nil { return nil, err } } if err := s.transport.writePacket([]byte{msgUserAuthSuccess}); err != nil { return nil, err } return perms, nil } // sshClientKeyboardInteractive implements a ClientKeyboardInteractive by // asking the client on the other side of a ServerConn. type sshClientKeyboardInteractive struct { *connection } func (c *sshClientKeyboardInteractive) Challenge(user, instruction string, questions []string, echos []bool) (answers []string, err error) { if len(questions) != len(echos) { return nil, errors.New("ssh: echos and questions must have equal length") } var prompts []byte for i := range questions { prompts = appendString(prompts, questions[i]) prompts = appendBool(prompts, echos[i]) } if err := c.transport.writePacket(Marshal(&userAuthInfoRequestMsg{ Instruction: instruction, NumPrompts: uint32(len(questions)), Prompts: prompts, })); err != nil { return nil, err } packet, err := c.transport.readPacket() if err != nil { return nil, err } if packet[0] != msgUserAuthInfoResponse { return nil, unexpectedMessageError(msgUserAuthInfoResponse, packet[0]) } packet = packet[1:] n, packet, ok := parseUint32(packet) if !ok || int(n) != len(questions) { return nil, parseError(msgUserAuthInfoResponse) } for i := uint32(0); i < n; i++ { ans, rest, ok := parseString(packet) if !ok { return nil, parseError(msgUserAuthInfoResponse) } answers = append(answers, string(ans)) packet = rest } if len(packet) != 0 { return nil, errors.New("ssh: junk at end of message") } return answers, nil } ================================================ FILE: vendor/golang.org/x/crypto/ssh/session.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh // Session implements an interactive session described in // "RFC 4254, section 6". import ( "bytes" "encoding/binary" "errors" "fmt" "io" "io/ioutil" "sync" ) type Signal string // POSIX signals as listed in RFC 4254 Section 6.10. const ( SIGABRT Signal = "ABRT" SIGALRM Signal = "ALRM" SIGFPE Signal = "FPE" SIGHUP Signal = "HUP" SIGILL Signal = "ILL" SIGINT Signal = "INT" SIGKILL Signal = "KILL" SIGPIPE Signal = "PIPE" SIGQUIT Signal = "QUIT" SIGSEGV Signal = "SEGV" SIGTERM Signal = "TERM" SIGUSR1 Signal = "USR1" SIGUSR2 Signal = "USR2" ) var signals = map[Signal]int{ SIGABRT: 6, SIGALRM: 14, SIGFPE: 8, SIGHUP: 1, SIGILL: 4, SIGINT: 2, SIGKILL: 9, SIGPIPE: 13, SIGQUIT: 3, SIGSEGV: 11, SIGTERM: 15, } type TerminalModes map[uint8]uint32 // POSIX terminal mode flags as listed in RFC 4254 Section 8. const ( tty_OP_END = 0 VINTR = 1 VQUIT = 2 VERASE = 3 VKILL = 4 VEOF = 5 VEOL = 6 VEOL2 = 7 VSTART = 8 VSTOP = 9 VSUSP = 10 VDSUSP = 11 VREPRINT = 12 VWERASE = 13 VLNEXT = 14 VFLUSH = 15 VSWTCH = 16 VSTATUS = 17 VDISCARD = 18 IGNPAR = 30 PARMRK = 31 INPCK = 32 ISTRIP = 33 INLCR = 34 IGNCR = 35 ICRNL = 36 IUCLC = 37 IXON = 38 IXANY = 39 IXOFF = 40 IMAXBEL = 41 ISIG = 50 ICANON = 51 XCASE = 52 ECHO = 53 ECHOE = 54 ECHOK = 55 ECHONL = 56 NOFLSH = 57 TOSTOP = 58 IEXTEN = 59 ECHOCTL = 60 ECHOKE = 61 PENDIN = 62 OPOST = 70 OLCUC = 71 ONLCR = 72 OCRNL = 73 ONOCR = 74 ONLRET = 75 CS7 = 90 CS8 = 91 PARENB = 92 PARODD = 93 TTY_OP_ISPEED = 128 TTY_OP_OSPEED = 129 ) // A Session represents a connection to a remote command or shell. type Session struct { // Stdin specifies the remote process's standard input. // If Stdin is nil, the remote process reads from an empty // bytes.Buffer. Stdin io.Reader // Stdout and Stderr specify the remote process's standard // output and error. // // If either is nil, Run connects the corresponding file // descriptor to an instance of ioutil.Discard. There is a // fixed amount of buffering that is shared for the two streams. // If either blocks it may eventually cause the remote // command to block. Stdout io.Writer Stderr io.Writer ch Channel // the channel backing this session started bool // true once Start, Run or Shell is invoked. copyFuncs []func() error errors chan error // one send per copyFunc // true if pipe method is active stdinpipe, stdoutpipe, stderrpipe bool // stdinPipeWriter is non-nil if StdinPipe has not been called // and Stdin was specified by the user; it is the write end of // a pipe connecting Session.Stdin to the stdin channel. stdinPipeWriter io.WriteCloser exitStatus chan error } // SendRequest sends an out-of-band channel request on the SSH channel // underlying the session. func (s *Session) SendRequest(name string, wantReply bool, payload []byte) (bool, error) { return s.ch.SendRequest(name, wantReply, payload) } func (s *Session) Close() error { return s.ch.Close() } // RFC 4254 Section 6.4. type setenvRequest struct { Name string Value string } // Setenv sets an environment variable that will be applied to any // command executed by Shell or Run. func (s *Session) Setenv(name, value string) error { msg := setenvRequest{ Name: name, Value: value, } ok, err := s.ch.SendRequest("env", true, Marshal(&msg)) if err == nil && !ok { err = errors.New("ssh: setenv failed") } return err } // RFC 4254 Section 6.2. type ptyRequestMsg struct { Term string Columns uint32 Rows uint32 Width uint32 Height uint32 Modelist string } // RequestPty requests the association of a pty with the session on the remote host. func (s *Session) RequestPty(term string, h, w int, termmodes TerminalModes) error { var tm []byte for k, v := range termmodes { kv := struct { Key byte Val uint32 }{k, v} tm = append(tm, Marshal(&kv)...) } tm = append(tm, tty_OP_END) req := ptyRequestMsg{ Term: term, Columns: uint32(w), Rows: uint32(h), Width: uint32(w * 8), Height: uint32(h * 8), Modelist: string(tm), } ok, err := s.ch.SendRequest("pty-req", true, Marshal(&req)) if err == nil && !ok { err = errors.New("ssh: pty-req failed") } return err } // RFC 4254 Section 6.5. type subsystemRequestMsg struct { Subsystem string } // RequestSubsystem requests the association of a subsystem with the session on the remote host. // A subsystem is a predefined command that runs in the background when the ssh session is initiated func (s *Session) RequestSubsystem(subsystem string) error { msg := subsystemRequestMsg{ Subsystem: subsystem, } ok, err := s.ch.SendRequest("subsystem", true, Marshal(&msg)) if err == nil && !ok { err = errors.New("ssh: subsystem request failed") } return err } // RFC 4254 Section 6.7. type ptyWindowChangeMsg struct { Columns uint32 Rows uint32 Width uint32 Height uint32 } // WindowChange informs the remote host about a terminal window dimension change to h rows and w columns. func (s *Session) WindowChange(h, w int) error { req := ptyWindowChangeMsg{ Columns: uint32(w), Rows: uint32(h), Width: uint32(w * 8), Height: uint32(h * 8), } _, err := s.ch.SendRequest("window-change", false, Marshal(&req)) return err } // RFC 4254 Section 6.9. type signalMsg struct { Signal string } // Signal sends the given signal to the remote process. // sig is one of the SIG* constants. func (s *Session) Signal(sig Signal) error { msg := signalMsg{ Signal: string(sig), } _, err := s.ch.SendRequest("signal", false, Marshal(&msg)) return err } // RFC 4254 Section 6.5. type execMsg struct { Command string } // Start runs cmd on the remote host. Typically, the remote // server passes cmd to the shell for interpretation. // A Session only accepts one call to Run, Start or Shell. func (s *Session) Start(cmd string) error { if s.started { return errors.New("ssh: session already started") } req := execMsg{ Command: cmd, } ok, err := s.ch.SendRequest("exec", true, Marshal(&req)) if err == nil && !ok { err = fmt.Errorf("ssh: command %v failed", cmd) } if err != nil { return err } return s.start() } // Run runs cmd on the remote host. Typically, the remote // server passes cmd to the shell for interpretation. // A Session only accepts one call to Run, Start, Shell, Output, // or CombinedOutput. // // The returned error is nil if the command runs, has no problems // copying stdin, stdout, and stderr, and exits with a zero exit // status. // // If the remote server does not send an exit status, an error of type // *ExitMissingError is returned. If the command completes // unsuccessfully or is interrupted by a signal, the error is of type // *ExitError. Other error types may be returned for I/O problems. func (s *Session) Run(cmd string) error { err := s.Start(cmd) if err != nil { return err } return s.Wait() } // Output runs cmd on the remote host and returns its standard output. func (s *Session) Output(cmd string) ([]byte, error) { if s.Stdout != nil { return nil, errors.New("ssh: Stdout already set") } var b bytes.Buffer s.Stdout = &b err := s.Run(cmd) return b.Bytes(), err } type singleWriter struct { b bytes.Buffer mu sync.Mutex } func (w *singleWriter) Write(p []byte) (int, error) { w.mu.Lock() defer w.mu.Unlock() return w.b.Write(p) } // CombinedOutput runs cmd on the remote host and returns its combined // standard output and standard error. func (s *Session) CombinedOutput(cmd string) ([]byte, error) { if s.Stdout != nil { return nil, errors.New("ssh: Stdout already set") } if s.Stderr != nil { return nil, errors.New("ssh: Stderr already set") } var b singleWriter s.Stdout = &b s.Stderr = &b err := s.Run(cmd) return b.b.Bytes(), err } // Shell starts a login shell on the remote host. A Session only // accepts one call to Run, Start, Shell, Output, or CombinedOutput. func (s *Session) Shell() error { if s.started { return errors.New("ssh: session already started") } ok, err := s.ch.SendRequest("shell", true, nil) if err == nil && !ok { return errors.New("ssh: could not start shell") } if err != nil { return err } return s.start() } func (s *Session) start() error { s.started = true type F func(*Session) for _, setupFd := range []F{(*Session).stdin, (*Session).stdout, (*Session).stderr} { setupFd(s) } s.errors = make(chan error, len(s.copyFuncs)) for _, fn := range s.copyFuncs { go func(fn func() error) { s.errors <- fn() }(fn) } return nil } // Wait waits for the remote command to exit. // // The returned error is nil if the command runs, has no problems // copying stdin, stdout, and stderr, and exits with a zero exit // status. // // If the remote server does not send an exit status, an error of type // *ExitMissingError is returned. If the command completes // unsuccessfully or is interrupted by a signal, the error is of type // *ExitError. Other error types may be returned for I/O problems. func (s *Session) Wait() error { if !s.started { return errors.New("ssh: session not started") } waitErr := <-s.exitStatus if s.stdinPipeWriter != nil { s.stdinPipeWriter.Close() } var copyError error for range s.copyFuncs { if err := <-s.errors; err != nil && copyError == nil { copyError = err } } if waitErr != nil { return waitErr } return copyError } func (s *Session) wait(reqs <-chan *Request) error { wm := Waitmsg{status: -1} // Wait for msg channel to be closed before returning. for msg := range reqs { switch msg.Type { case "exit-status": wm.status = int(binary.BigEndian.Uint32(msg.Payload)) case "exit-signal": var sigval struct { Signal string CoreDumped bool Error string Lang string } if err := Unmarshal(msg.Payload, &sigval); err != nil { return err } // Must sanitize strings? wm.signal = sigval.Signal wm.msg = sigval.Error wm.lang = sigval.Lang default: // This handles keepalives and matches // OpenSSH's behaviour. if msg.WantReply { msg.Reply(false, nil) } } } if wm.status == 0 { return nil } if wm.status == -1 { // exit-status was never sent from server if wm.signal == "" { // signal was not sent either. RFC 4254 // section 6.10 recommends against this // behavior, but it is allowed, so we let // clients handle it. return &ExitMissingError{} } wm.status = 128 if _, ok := signals[Signal(wm.signal)]; ok { wm.status += signals[Signal(wm.signal)] } } return &ExitError{wm} } // ExitMissingError is returned if a session is torn down cleanly, but // the server sends no confirmation of the exit status. type ExitMissingError struct{} func (e *ExitMissingError) Error() string { return "wait: remote command exited without exit status or exit signal" } func (s *Session) stdin() { if s.stdinpipe { return } var stdin io.Reader if s.Stdin == nil { stdin = new(bytes.Buffer) } else { r, w := io.Pipe() go func() { _, err := io.Copy(w, s.Stdin) w.CloseWithError(err) }() stdin, s.stdinPipeWriter = r, w } s.copyFuncs = append(s.copyFuncs, func() error { _, err := io.Copy(s.ch, stdin) if err1 := s.ch.CloseWrite(); err == nil && err1 != io.EOF { err = err1 } return err }) } func (s *Session) stdout() { if s.stdoutpipe { return } if s.Stdout == nil { s.Stdout = ioutil.Discard } s.copyFuncs = append(s.copyFuncs, func() error { _, err := io.Copy(s.Stdout, s.ch) return err }) } func (s *Session) stderr() { if s.stderrpipe { return } if s.Stderr == nil { s.Stderr = ioutil.Discard } s.copyFuncs = append(s.copyFuncs, func() error { _, err := io.Copy(s.Stderr, s.ch.Stderr()) return err }) } // sessionStdin reroutes Close to CloseWrite. type sessionStdin struct { io.Writer ch Channel } func (s *sessionStdin) Close() error { return s.ch.CloseWrite() } // StdinPipe returns a pipe that will be connected to the // remote command's standard input when the command starts. func (s *Session) StdinPipe() (io.WriteCloser, error) { if s.Stdin != nil { return nil, errors.New("ssh: Stdin already set") } if s.started { return nil, errors.New("ssh: StdinPipe after process started") } s.stdinpipe = true return &sessionStdin{s.ch, s.ch}, nil } // StdoutPipe returns a pipe that will be connected to the // remote command's standard output when the command starts. // There is a fixed amount of buffering that is shared between // stdout and stderr streams. If the StdoutPipe reader is // not serviced fast enough it may eventually cause the // remote command to block. func (s *Session) StdoutPipe() (io.Reader, error) { if s.Stdout != nil { return nil, errors.New("ssh: Stdout already set") } if s.started { return nil, errors.New("ssh: StdoutPipe after process started") } s.stdoutpipe = true return s.ch, nil } // StderrPipe returns a pipe that will be connected to the // remote command's standard error when the command starts. // There is a fixed amount of buffering that is shared between // stdout and stderr streams. If the StderrPipe reader is // not serviced fast enough it may eventually cause the // remote command to block. func (s *Session) StderrPipe() (io.Reader, error) { if s.Stderr != nil { return nil, errors.New("ssh: Stderr already set") } if s.started { return nil, errors.New("ssh: StderrPipe after process started") } s.stderrpipe = true return s.ch.Stderr(), nil } // newSession returns a new interactive session on the remote host. func newSession(ch Channel, reqs <-chan *Request) (*Session, error) { s := &Session{ ch: ch, } s.exitStatus = make(chan error, 1) go func() { s.exitStatus <- s.wait(reqs) }() return s, nil } // An ExitError reports unsuccessful completion of a remote command. type ExitError struct { Waitmsg } func (e *ExitError) Error() string { return e.Waitmsg.String() } // Waitmsg stores the information about an exited remote command // as reported by Wait. type Waitmsg struct { status int signal string msg string lang string } // ExitStatus returns the exit status of the remote command. func (w Waitmsg) ExitStatus() int { return w.status } // Signal returns the exit signal of the remote command if // it was terminated violently. func (w Waitmsg) Signal() string { return w.signal } // Msg returns the exit message given by the remote command func (w Waitmsg) Msg() string { return w.msg } // Lang returns the language tag. See RFC 3066 func (w Waitmsg) Lang() string { return w.lang } func (w Waitmsg) String() string { str := fmt.Sprintf("Process exited with status %v", w.status) if w.signal != "" { str += fmt.Sprintf(" from signal %v", w.signal) } if w.msg != "" { str += fmt.Sprintf(". Reason was: %v", w.msg) } return str } ================================================ FILE: vendor/golang.org/x/crypto/ssh/streamlocal.go ================================================ package ssh import ( "errors" "io" "net" ) // streamLocalChannelOpenDirectMsg is a struct used for SSH_MSG_CHANNEL_OPEN message // with "direct-streamlocal@openssh.com" string. // // See openssh-portable/PROTOCOL, section 2.4. connection: Unix domain socket forwarding // https://github.com/openssh/openssh-portable/blob/master/PROTOCOL#L235 type streamLocalChannelOpenDirectMsg struct { socketPath string reserved0 string reserved1 uint32 } // forwardedStreamLocalPayload is a struct used for SSH_MSG_CHANNEL_OPEN message // with "forwarded-streamlocal@openssh.com" string. type forwardedStreamLocalPayload struct { SocketPath string Reserved0 string } // streamLocalChannelForwardMsg is a struct used for SSH2_MSG_GLOBAL_REQUEST message // with "streamlocal-forward@openssh.com"/"cancel-streamlocal-forward@openssh.com" string. type streamLocalChannelForwardMsg struct { socketPath string } // ListenUnix is similar to ListenTCP but uses a Unix domain socket. func (c *Client) ListenUnix(socketPath string) (net.Listener, error) { c.handleForwardsOnce.Do(c.handleForwards) m := streamLocalChannelForwardMsg{ socketPath, } // send message ok, _, err := c.SendRequest("streamlocal-forward@openssh.com", true, Marshal(&m)) if err != nil { return nil, err } if !ok { return nil, errors.New("ssh: streamlocal-forward@openssh.com request denied by peer") } ch := c.forwards.add(&net.UnixAddr{Name: socketPath, Net: "unix"}) return &unixListener{socketPath, c, ch}, nil } func (c *Client) dialStreamLocal(socketPath string) (Channel, error) { msg := streamLocalChannelOpenDirectMsg{ socketPath: socketPath, } ch, in, err := c.OpenChannel("direct-streamlocal@openssh.com", Marshal(&msg)) if err != nil { return nil, err } go DiscardRequests(in) return ch, err } type unixListener struct { socketPath string conn *Client in <-chan forward } // Accept waits for and returns the next connection to the listener. func (l *unixListener) Accept() (net.Conn, error) { s, ok := <-l.in if !ok { return nil, io.EOF } ch, incoming, err := s.newCh.Accept() if err != nil { return nil, err } go DiscardRequests(incoming) return &chanConn{ Channel: ch, laddr: &net.UnixAddr{ Name: l.socketPath, Net: "unix", }, raddr: &net.UnixAddr{ Name: "@", Net: "unix", }, }, nil } // Close closes the listener. func (l *unixListener) Close() error { // this also closes the listener. l.conn.forwards.remove(&net.UnixAddr{Name: l.socketPath, Net: "unix"}) m := streamLocalChannelForwardMsg{ l.socketPath, } ok, _, err := l.conn.SendRequest("cancel-streamlocal-forward@openssh.com", true, Marshal(&m)) if err == nil && !ok { err = errors.New("ssh: cancel-streamlocal-forward@openssh.com failed") } return err } // Addr returns the listener's network address. func (l *unixListener) Addr() net.Addr { return &net.UnixAddr{ Name: l.socketPath, Net: "unix", } } ================================================ FILE: vendor/golang.org/x/crypto/ssh/tcpip.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "errors" "fmt" "io" "math/rand" "net" "strconv" "strings" "sync" "time" ) // Listen requests the remote peer open a listening socket on // addr. Incoming connections will be available by calling Accept on // the returned net.Listener. The listener must be serviced, or the // SSH connection may hang. // N must be "tcp", "tcp4", "tcp6", or "unix". func (c *Client) Listen(n, addr string) (net.Listener, error) { switch n { case "tcp", "tcp4", "tcp6": laddr, err := net.ResolveTCPAddr(n, addr) if err != nil { return nil, err } return c.ListenTCP(laddr) case "unix": return c.ListenUnix(addr) default: return nil, fmt.Errorf("ssh: unsupported protocol: %s", n) } } // Automatic port allocation is broken with OpenSSH before 6.0. See // also https://bugzilla.mindrot.org/show_bug.cgi?id=2017. In // particular, OpenSSH 5.9 sends a channelOpenMsg with port number 0, // rather than the actual port number. This means you can never open // two different listeners with auto allocated ports. We work around // this by trying explicit ports until we succeed. const openSSHPrefix = "OpenSSH_" var portRandomizer = rand.New(rand.NewSource(time.Now().UnixNano())) // isBrokenOpenSSHVersion returns true if the given version string // specifies a version of OpenSSH that is known to have a bug in port // forwarding. func isBrokenOpenSSHVersion(versionStr string) bool { i := strings.Index(versionStr, openSSHPrefix) if i < 0 { return false } i += len(openSSHPrefix) j := i for ; j < len(versionStr); j++ { if versionStr[j] < '0' || versionStr[j] > '9' { break } } version, _ := strconv.Atoi(versionStr[i:j]) return version < 6 } // autoPortListenWorkaround simulates automatic port allocation by // trying random ports repeatedly. func (c *Client) autoPortListenWorkaround(laddr *net.TCPAddr) (net.Listener, error) { var sshListener net.Listener var err error const tries = 10 for i := 0; i < tries; i++ { addr := *laddr addr.Port = 1024 + portRandomizer.Intn(60000) sshListener, err = c.ListenTCP(&addr) if err == nil { laddr.Port = addr.Port return sshListener, err } } return nil, fmt.Errorf("ssh: listen on random port failed after %d tries: %v", tries, err) } // RFC 4254 7.1 type channelForwardMsg struct { addr string rport uint32 } // handleForwards starts goroutines handling forwarded connections. // It's called on first use by (*Client).ListenTCP to not launch // goroutines until needed. func (c *Client) handleForwards() { go c.forwards.handleChannels(c.HandleChannelOpen("forwarded-tcpip")) go c.forwards.handleChannels(c.HandleChannelOpen("forwarded-streamlocal@openssh.com")) } // ListenTCP requests the remote peer open a listening socket // on laddr. Incoming connections will be available by calling // Accept on the returned net.Listener. func (c *Client) ListenTCP(laddr *net.TCPAddr) (net.Listener, error) { c.handleForwardsOnce.Do(c.handleForwards) if laddr.Port == 0 && isBrokenOpenSSHVersion(string(c.ServerVersion())) { return c.autoPortListenWorkaround(laddr) } m := channelForwardMsg{ laddr.IP.String(), uint32(laddr.Port), } // send message ok, resp, err := c.SendRequest("tcpip-forward", true, Marshal(&m)) if err != nil { return nil, err } if !ok { return nil, errors.New("ssh: tcpip-forward request denied by peer") } // If the original port was 0, then the remote side will // supply a real port number in the response. if laddr.Port == 0 { var p struct { Port uint32 } if err := Unmarshal(resp, &p); err != nil { return nil, err } laddr.Port = int(p.Port) } // Register this forward, using the port number we obtained. ch := c.forwards.add(laddr) return &tcpListener{laddr, c, ch}, nil } // forwardList stores a mapping between remote // forward requests and the tcpListeners. type forwardList struct { sync.Mutex entries []forwardEntry } // forwardEntry represents an established mapping of a laddr on a // remote ssh server to a channel connected to a tcpListener. type forwardEntry struct { laddr net.Addr c chan forward } // forward represents an incoming forwarded tcpip connection. The // arguments to add/remove/lookup should be address as specified in // the original forward-request. type forward struct { newCh NewChannel // the ssh client channel underlying this forward raddr net.Addr // the raddr of the incoming connection } func (l *forwardList) add(addr net.Addr) chan forward { l.Lock() defer l.Unlock() f := forwardEntry{ laddr: addr, c: make(chan forward, 1), } l.entries = append(l.entries, f) return f.c } // See RFC 4254, section 7.2 type forwardedTCPPayload struct { Addr string Port uint32 OriginAddr string OriginPort uint32 } // parseTCPAddr parses the originating address from the remote into a *net.TCPAddr. func parseTCPAddr(addr string, port uint32) (*net.TCPAddr, error) { if port == 0 || port > 65535 { return nil, fmt.Errorf("ssh: port number out of range: %d", port) } ip := net.ParseIP(string(addr)) if ip == nil { return nil, fmt.Errorf("ssh: cannot parse IP address %q", addr) } return &net.TCPAddr{IP: ip, Port: int(port)}, nil } func (l *forwardList) handleChannels(in <-chan NewChannel) { for ch := range in { var ( laddr net.Addr raddr net.Addr err error ) switch channelType := ch.ChannelType(); channelType { case "forwarded-tcpip": var payload forwardedTCPPayload if err = Unmarshal(ch.ExtraData(), &payload); err != nil { ch.Reject(ConnectionFailed, "could not parse forwarded-tcpip payload: "+err.Error()) continue } // RFC 4254 section 7.2 specifies that incoming // addresses should list the address, in string // format. It is implied that this should be an IP // address, as it would be impossible to connect to it // otherwise. laddr, err = parseTCPAddr(payload.Addr, payload.Port) if err != nil { ch.Reject(ConnectionFailed, err.Error()) continue } raddr, err = parseTCPAddr(payload.OriginAddr, payload.OriginPort) if err != nil { ch.Reject(ConnectionFailed, err.Error()) continue } case "forwarded-streamlocal@openssh.com": var payload forwardedStreamLocalPayload if err = Unmarshal(ch.ExtraData(), &payload); err != nil { ch.Reject(ConnectionFailed, "could not parse forwarded-streamlocal@openssh.com payload: "+err.Error()) continue } laddr = &net.UnixAddr{ Name: payload.SocketPath, Net: "unix", } raddr = &net.UnixAddr{ Name: "@", Net: "unix", } default: panic(fmt.Errorf("ssh: unknown channel type %s", channelType)) } if ok := l.forward(laddr, raddr, ch); !ok { // Section 7.2, implementations MUST reject spurious incoming // connections. ch.Reject(Prohibited, "no forward for address") continue } } } // remove removes the forward entry, and the channel feeding its // listener. func (l *forwardList) remove(addr net.Addr) { l.Lock() defer l.Unlock() for i, f := range l.entries { if addr.Network() == f.laddr.Network() && addr.String() == f.laddr.String() { l.entries = append(l.entries[:i], l.entries[i+1:]...) close(f.c) return } } } // closeAll closes and clears all forwards. func (l *forwardList) closeAll() { l.Lock() defer l.Unlock() for _, f := range l.entries { close(f.c) } l.entries = nil } func (l *forwardList) forward(laddr, raddr net.Addr, ch NewChannel) bool { l.Lock() defer l.Unlock() for _, f := range l.entries { if laddr.Network() == f.laddr.Network() && laddr.String() == f.laddr.String() { f.c <- forward{newCh: ch, raddr: raddr} return true } } return false } type tcpListener struct { laddr *net.TCPAddr conn *Client in <-chan forward } // Accept waits for and returns the next connection to the listener. func (l *tcpListener) Accept() (net.Conn, error) { s, ok := <-l.in if !ok { return nil, io.EOF } ch, incoming, err := s.newCh.Accept() if err != nil { return nil, err } go DiscardRequests(incoming) return &chanConn{ Channel: ch, laddr: l.laddr, raddr: s.raddr, }, nil } // Close closes the listener. func (l *tcpListener) Close() error { m := channelForwardMsg{ l.laddr.IP.String(), uint32(l.laddr.Port), } // this also closes the listener. l.conn.forwards.remove(l.laddr) ok, _, err := l.conn.SendRequest("cancel-tcpip-forward", true, Marshal(&m)) if err == nil && !ok { err = errors.New("ssh: cancel-tcpip-forward failed") } return err } // Addr returns the listener's network address. func (l *tcpListener) Addr() net.Addr { return l.laddr } // Dial initiates a connection to the addr from the remote host. // The resulting connection has a zero LocalAddr() and RemoteAddr(). func (c *Client) Dial(n, addr string) (net.Conn, error) { var ch Channel switch n { case "tcp", "tcp4", "tcp6": // Parse the address into host and numeric port. host, portString, err := net.SplitHostPort(addr) if err != nil { return nil, err } port, err := strconv.ParseUint(portString, 10, 16) if err != nil { return nil, err } ch, err = c.dial(net.IPv4zero.String(), 0, host, int(port)) if err != nil { return nil, err } // Use a zero address for local and remote address. zeroAddr := &net.TCPAddr{ IP: net.IPv4zero, Port: 0, } return &chanConn{ Channel: ch, laddr: zeroAddr, raddr: zeroAddr, }, nil case "unix": var err error ch, err = c.dialStreamLocal(addr) if err != nil { return nil, err } return &chanConn{ Channel: ch, laddr: &net.UnixAddr{ Name: "@", Net: "unix", }, raddr: &net.UnixAddr{ Name: addr, Net: "unix", }, }, nil default: return nil, fmt.Errorf("ssh: unsupported protocol: %s", n) } } // DialTCP connects to the remote address raddr on the network net, // which must be "tcp", "tcp4", or "tcp6". If laddr is not nil, it is used // as the local address for the connection. func (c *Client) DialTCP(n string, laddr, raddr *net.TCPAddr) (net.Conn, error) { if laddr == nil { laddr = &net.TCPAddr{ IP: net.IPv4zero, Port: 0, } } ch, err := c.dial(laddr.IP.String(), laddr.Port, raddr.IP.String(), raddr.Port) if err != nil { return nil, err } return &chanConn{ Channel: ch, laddr: laddr, raddr: raddr, }, nil } // RFC 4254 7.2 type channelOpenDirectMsg struct { raddr string rport uint32 laddr string lport uint32 } func (c *Client) dial(laddr string, lport int, raddr string, rport int) (Channel, error) { msg := channelOpenDirectMsg{ raddr: raddr, rport: uint32(rport), laddr: laddr, lport: uint32(lport), } ch, in, err := c.OpenChannel("direct-tcpip", Marshal(&msg)) if err != nil { return nil, err } go DiscardRequests(in) return ch, err } type tcpChan struct { Channel // the backing channel } // chanConn fulfills the net.Conn interface without // the tcpChan having to hold laddr or raddr directly. type chanConn struct { Channel laddr, raddr net.Addr } // LocalAddr returns the local network address. func (t *chanConn) LocalAddr() net.Addr { return t.laddr } // RemoteAddr returns the remote network address. func (t *chanConn) RemoteAddr() net.Addr { return t.raddr } // SetDeadline sets the read and write deadlines associated // with the connection. func (t *chanConn) SetDeadline(deadline time.Time) error { if err := t.SetReadDeadline(deadline); err != nil { return err } return t.SetWriteDeadline(deadline) } // SetReadDeadline sets the read deadline. // A zero value for t means Read will not time out. // After the deadline, the error from Read will implement net.Error // with Timeout() == true. func (t *chanConn) SetReadDeadline(deadline time.Time) error { // for compatibility with previous version, // the error message contains "tcpChan" return errors.New("ssh: tcpChan: deadline not supported") } // SetWriteDeadline exists to satisfy the net.Conn interface // but is not implemented by this type. It always returns an error. func (t *chanConn) SetWriteDeadline(deadline time.Time) error { return errors.New("ssh: tcpChan: deadline not supported") } ================================================ FILE: vendor/golang.org/x/crypto/ssh/terminal/terminal.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package terminal import ( "bytes" "io" "sync" "unicode/utf8" ) // EscapeCodes contains escape sequences that can be written to the terminal in // order to achieve different styles of text. type EscapeCodes struct { // Foreground colors Black, Red, Green, Yellow, Blue, Magenta, Cyan, White []byte // Reset all attributes Reset []byte } var vt100EscapeCodes = EscapeCodes{ Black: []byte{keyEscape, '[', '3', '0', 'm'}, Red: []byte{keyEscape, '[', '3', '1', 'm'}, Green: []byte{keyEscape, '[', '3', '2', 'm'}, Yellow: []byte{keyEscape, '[', '3', '3', 'm'}, Blue: []byte{keyEscape, '[', '3', '4', 'm'}, Magenta: []byte{keyEscape, '[', '3', '5', 'm'}, Cyan: []byte{keyEscape, '[', '3', '6', 'm'}, White: []byte{keyEscape, '[', '3', '7', 'm'}, Reset: []byte{keyEscape, '[', '0', 'm'}, } // Terminal contains the state for running a VT100 terminal that is capable of // reading lines of input. type Terminal struct { // AutoCompleteCallback, if non-null, is called for each keypress with // the full input line and the current position of the cursor (in // bytes, as an index into |line|). If it returns ok=false, the key // press is processed normally. Otherwise it returns a replacement line // and the new cursor position. AutoCompleteCallback func(line string, pos int, key rune) (newLine string, newPos int, ok bool) // Escape contains a pointer to the escape codes for this terminal. // It's always a valid pointer, although the escape codes themselves // may be empty if the terminal doesn't support them. Escape *EscapeCodes // lock protects the terminal and the state in this object from // concurrent processing of a key press and a Write() call. lock sync.Mutex c io.ReadWriter prompt []rune // line is the current line being entered. line []rune // pos is the logical position of the cursor in line pos int // echo is true if local echo is enabled echo bool // pasteActive is true iff there is a bracketed paste operation in // progress. pasteActive bool // cursorX contains the current X value of the cursor where the left // edge is 0. cursorY contains the row number where the first row of // the current line is 0. cursorX, cursorY int // maxLine is the greatest value of cursorY so far. maxLine int termWidth, termHeight int // outBuf contains the terminal data to be sent. outBuf []byte // remainder contains the remainder of any partial key sequences after // a read. It aliases into inBuf. remainder []byte inBuf [256]byte // history contains previously entered commands so that they can be // accessed with the up and down keys. history stRingBuffer // historyIndex stores the currently accessed history entry, where zero // means the immediately previous entry. historyIndex int // When navigating up and down the history it's possible to return to // the incomplete, initial line. That value is stored in // historyPending. historyPending string } // NewTerminal runs a VT100 terminal on the given ReadWriter. If the ReadWriter is // a local terminal, that terminal must first have been put into raw mode. // prompt is a string that is written at the start of each input line (i.e. // "> "). func NewTerminal(c io.ReadWriter, prompt string) *Terminal { return &Terminal{ Escape: &vt100EscapeCodes, c: c, prompt: []rune(prompt), termWidth: 80, termHeight: 24, echo: true, historyIndex: -1, } } const ( keyCtrlD = 4 keyCtrlU = 21 keyEnter = '\r' keyEscape = 27 keyBackspace = 127 keyUnknown = 0xd800 /* UTF-16 surrogate area */ + iota keyUp keyDown keyLeft keyRight keyAltLeft keyAltRight keyHome keyEnd keyDeleteWord keyDeleteLine keyClearScreen keyPasteStart keyPasteEnd ) var ( crlf = []byte{'\r', '\n'} pasteStart = []byte{keyEscape, '[', '2', '0', '0', '~'} pasteEnd = []byte{keyEscape, '[', '2', '0', '1', '~'} ) // bytesToKey tries to parse a key sequence from b. If successful, it returns // the key and the remainder of the input. Otherwise it returns utf8.RuneError. func bytesToKey(b []byte, pasteActive bool) (rune, []byte) { if len(b) == 0 { return utf8.RuneError, nil } if !pasteActive { switch b[0] { case 1: // ^A return keyHome, b[1:] case 5: // ^E return keyEnd, b[1:] case 8: // ^H return keyBackspace, b[1:] case 11: // ^K return keyDeleteLine, b[1:] case 12: // ^L return keyClearScreen, b[1:] case 23: // ^W return keyDeleteWord, b[1:] case 14: // ^N return keyDown, b[1:] case 16: // ^P return keyUp, b[1:] } } if b[0] != keyEscape { if !utf8.FullRune(b) { return utf8.RuneError, b } r, l := utf8.DecodeRune(b) return r, b[l:] } if !pasteActive && len(b) >= 3 && b[0] == keyEscape && b[1] == '[' { switch b[2] { case 'A': return keyUp, b[3:] case 'B': return keyDown, b[3:] case 'C': return keyRight, b[3:] case 'D': return keyLeft, b[3:] case 'H': return keyHome, b[3:] case 'F': return keyEnd, b[3:] } } if !pasteActive && len(b) >= 6 && b[0] == keyEscape && b[1] == '[' && b[2] == '1' && b[3] == ';' && b[4] == '3' { switch b[5] { case 'C': return keyAltRight, b[6:] case 'D': return keyAltLeft, b[6:] } } if !pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteStart) { return keyPasteStart, b[6:] } if pasteActive && len(b) >= 6 && bytes.Equal(b[:6], pasteEnd) { return keyPasteEnd, b[6:] } // If we get here then we have a key that we don't recognise, or a // partial sequence. It's not clear how one should find the end of a // sequence without knowing them all, but it seems that [a-zA-Z~] only // appears at the end of a sequence. for i, c := range b[0:] { if c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '~' { return keyUnknown, b[i+1:] } } return utf8.RuneError, b } // queue appends data to the end of t.outBuf func (t *Terminal) queue(data []rune) { t.outBuf = append(t.outBuf, []byte(string(data))...) } var eraseUnderCursor = []rune{' ', keyEscape, '[', 'D'} var space = []rune{' '} func isPrintable(key rune) bool { isInSurrogateArea := key >= 0xd800 && key <= 0xdbff return key >= 32 && !isInSurrogateArea } // moveCursorToPos appends data to t.outBuf which will move the cursor to the // given, logical position in the text. func (t *Terminal) moveCursorToPos(pos int) { if !t.echo { return } x := visualLength(t.prompt) + pos y := x / t.termWidth x = x % t.termWidth up := 0 if y < t.cursorY { up = t.cursorY - y } down := 0 if y > t.cursorY { down = y - t.cursorY } left := 0 if x < t.cursorX { left = t.cursorX - x } right := 0 if x > t.cursorX { right = x - t.cursorX } t.cursorX = x t.cursorY = y t.move(up, down, left, right) } func (t *Terminal) move(up, down, left, right int) { movement := make([]rune, 3*(up+down+left+right)) m := movement for i := 0; i < up; i++ { m[0] = keyEscape m[1] = '[' m[2] = 'A' m = m[3:] } for i := 0; i < down; i++ { m[0] = keyEscape m[1] = '[' m[2] = 'B' m = m[3:] } for i := 0; i < left; i++ { m[0] = keyEscape m[1] = '[' m[2] = 'D' m = m[3:] } for i := 0; i < right; i++ { m[0] = keyEscape m[1] = '[' m[2] = 'C' m = m[3:] } t.queue(movement) } func (t *Terminal) clearLineToRight() { op := []rune{keyEscape, '[', 'K'} t.queue(op) } const maxLineLength = 4096 func (t *Terminal) setLine(newLine []rune, newPos int) { if t.echo { t.moveCursorToPos(0) t.writeLine(newLine) for i := len(newLine); i < len(t.line); i++ { t.writeLine(space) } t.moveCursorToPos(newPos) } t.line = newLine t.pos = newPos } func (t *Terminal) advanceCursor(places int) { t.cursorX += places t.cursorY += t.cursorX / t.termWidth if t.cursorY > t.maxLine { t.maxLine = t.cursorY } t.cursorX = t.cursorX % t.termWidth if places > 0 && t.cursorX == 0 { // Normally terminals will advance the current position // when writing a character. But that doesn't happen // for the last character in a line. However, when // writing a character (except a new line) that causes // a line wrap, the position will be advanced two // places. // // So, if we are stopping at the end of a line, we // need to write a newline so that our cursor can be // advanced to the next line. t.outBuf = append(t.outBuf, '\r', '\n') } } func (t *Terminal) eraseNPreviousChars(n int) { if n == 0 { return } if t.pos < n { n = t.pos } t.pos -= n t.moveCursorToPos(t.pos) copy(t.line[t.pos:], t.line[n+t.pos:]) t.line = t.line[:len(t.line)-n] if t.echo { t.writeLine(t.line[t.pos:]) for i := 0; i < n; i++ { t.queue(space) } t.advanceCursor(n) t.moveCursorToPos(t.pos) } } // countToLeftWord returns then number of characters from the cursor to the // start of the previous word. func (t *Terminal) countToLeftWord() int { if t.pos == 0 { return 0 } pos := t.pos - 1 for pos > 0 { if t.line[pos] != ' ' { break } pos-- } for pos > 0 { if t.line[pos] == ' ' { pos++ break } pos-- } return t.pos - pos } // countToRightWord returns then number of characters from the cursor to the // start of the next word. func (t *Terminal) countToRightWord() int { pos := t.pos for pos < len(t.line) { if t.line[pos] == ' ' { break } pos++ } for pos < len(t.line) { if t.line[pos] != ' ' { break } pos++ } return pos - t.pos } // visualLength returns the number of visible glyphs in s. func visualLength(runes []rune) int { inEscapeSeq := false length := 0 for _, r := range runes { switch { case inEscapeSeq: if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') { inEscapeSeq = false } case r == '\x1b': inEscapeSeq = true default: length++ } } return length } // handleKey processes the given key and, optionally, returns a line of text // that the user has entered. func (t *Terminal) handleKey(key rune) (line string, ok bool) { if t.pasteActive && key != keyEnter { t.addKeyToLine(key) return } switch key { case keyBackspace: if t.pos == 0 { return } t.eraseNPreviousChars(1) case keyAltLeft: // move left by a word. t.pos -= t.countToLeftWord() t.moveCursorToPos(t.pos) case keyAltRight: // move right by a word. t.pos += t.countToRightWord() t.moveCursorToPos(t.pos) case keyLeft: if t.pos == 0 { return } t.pos-- t.moveCursorToPos(t.pos) case keyRight: if t.pos == len(t.line) { return } t.pos++ t.moveCursorToPos(t.pos) case keyHome: if t.pos == 0 { return } t.pos = 0 t.moveCursorToPos(t.pos) case keyEnd: if t.pos == len(t.line) { return } t.pos = len(t.line) t.moveCursorToPos(t.pos) case keyUp: entry, ok := t.history.NthPreviousEntry(t.historyIndex + 1) if !ok { return "", false } if t.historyIndex == -1 { t.historyPending = string(t.line) } t.historyIndex++ runes := []rune(entry) t.setLine(runes, len(runes)) case keyDown: switch t.historyIndex { case -1: return case 0: runes := []rune(t.historyPending) t.setLine(runes, len(runes)) t.historyIndex-- default: entry, ok := t.history.NthPreviousEntry(t.historyIndex - 1) if ok { t.historyIndex-- runes := []rune(entry) t.setLine(runes, len(runes)) } } case keyEnter: t.moveCursorToPos(len(t.line)) t.queue([]rune("\r\n")) line = string(t.line) ok = true t.line = t.line[:0] t.pos = 0 t.cursorX = 0 t.cursorY = 0 t.maxLine = 0 case keyDeleteWord: // Delete zero or more spaces and then one or more characters. t.eraseNPreviousChars(t.countToLeftWord()) case keyDeleteLine: // Delete everything from the current cursor position to the // end of line. for i := t.pos; i < len(t.line); i++ { t.queue(space) t.advanceCursor(1) } t.line = t.line[:t.pos] t.moveCursorToPos(t.pos) case keyCtrlD: // Erase the character under the current position. // The EOF case when the line is empty is handled in // readLine(). if t.pos < len(t.line) { t.pos++ t.eraseNPreviousChars(1) } case keyCtrlU: t.eraseNPreviousChars(t.pos) case keyClearScreen: // Erases the screen and moves the cursor to the home position. t.queue([]rune("\x1b[2J\x1b[H")) t.queue(t.prompt) t.cursorX, t.cursorY = 0, 0 t.advanceCursor(visualLength(t.prompt)) t.setLine(t.line, t.pos) default: if t.AutoCompleteCallback != nil { prefix := string(t.line[:t.pos]) suffix := string(t.line[t.pos:]) t.lock.Unlock() newLine, newPos, completeOk := t.AutoCompleteCallback(prefix+suffix, len(prefix), key) t.lock.Lock() if completeOk { t.setLine([]rune(newLine), utf8.RuneCount([]byte(newLine)[:newPos])) return } } if !isPrintable(key) { return } if len(t.line) == maxLineLength { return } t.addKeyToLine(key) } return } // addKeyToLine inserts the given key at the current position in the current // line. func (t *Terminal) addKeyToLine(key rune) { if len(t.line) == cap(t.line) { newLine := make([]rune, len(t.line), 2*(1+len(t.line))) copy(newLine, t.line) t.line = newLine } t.line = t.line[:len(t.line)+1] copy(t.line[t.pos+1:], t.line[t.pos:]) t.line[t.pos] = key if t.echo { t.writeLine(t.line[t.pos:]) } t.pos++ t.moveCursorToPos(t.pos) } func (t *Terminal) writeLine(line []rune) { for len(line) != 0 { remainingOnLine := t.termWidth - t.cursorX todo := len(line) if todo > remainingOnLine { todo = remainingOnLine } t.queue(line[:todo]) t.advanceCursor(visualLength(line[:todo])) line = line[todo:] } } // writeWithCRLF writes buf to w but replaces all occurrences of \n with \r\n. func writeWithCRLF(w io.Writer, buf []byte) (n int, err error) { for len(buf) > 0 { i := bytes.IndexByte(buf, '\n') todo := len(buf) if i >= 0 { todo = i } var nn int nn, err = w.Write(buf[:todo]) n += nn if err != nil { return n, err } buf = buf[todo:] if i >= 0 { if _, err = w.Write(crlf); err != nil { return n, err } n++ buf = buf[1:] } } return n, nil } func (t *Terminal) Write(buf []byte) (n int, err error) { t.lock.Lock() defer t.lock.Unlock() if t.cursorX == 0 && t.cursorY == 0 { // This is the easy case: there's nothing on the screen that we // have to move out of the way. return writeWithCRLF(t.c, buf) } // We have a prompt and possibly user input on the screen. We // have to clear it first. t.move(0 /* up */, 0 /* down */, t.cursorX /* left */, 0 /* right */) t.cursorX = 0 t.clearLineToRight() for t.cursorY > 0 { t.move(1 /* up */, 0, 0, 0) t.cursorY-- t.clearLineToRight() } if _, err = t.c.Write(t.outBuf); err != nil { return } t.outBuf = t.outBuf[:0] if n, err = writeWithCRLF(t.c, buf); err != nil { return } t.writeLine(t.prompt) if t.echo { t.writeLine(t.line) } t.moveCursorToPos(t.pos) if _, err = t.c.Write(t.outBuf); err != nil { return } t.outBuf = t.outBuf[:0] return } // ReadPassword temporarily changes the prompt and reads a password, without // echo, from the terminal. func (t *Terminal) ReadPassword(prompt string) (line string, err error) { t.lock.Lock() defer t.lock.Unlock() oldPrompt := t.prompt t.prompt = []rune(prompt) t.echo = false line, err = t.readLine() t.prompt = oldPrompt t.echo = true return } // ReadLine returns a line of input from the terminal. func (t *Terminal) ReadLine() (line string, err error) { t.lock.Lock() defer t.lock.Unlock() return t.readLine() } func (t *Terminal) readLine() (line string, err error) { // t.lock must be held at this point if t.cursorX == 0 && t.cursorY == 0 { t.writeLine(t.prompt) t.c.Write(t.outBuf) t.outBuf = t.outBuf[:0] } lineIsPasted := t.pasteActive for { rest := t.remainder lineOk := false for !lineOk { var key rune key, rest = bytesToKey(rest, t.pasteActive) if key == utf8.RuneError { break } if !t.pasteActive { if key == keyCtrlD { if len(t.line) == 0 { return "", io.EOF } } if key == keyPasteStart { t.pasteActive = true if len(t.line) == 0 { lineIsPasted = true } continue } } else if key == keyPasteEnd { t.pasteActive = false continue } if !t.pasteActive { lineIsPasted = false } line, lineOk = t.handleKey(key) } if len(rest) > 0 { n := copy(t.inBuf[:], rest) t.remainder = t.inBuf[:n] } else { t.remainder = nil } t.c.Write(t.outBuf) t.outBuf = t.outBuf[:0] if lineOk { if t.echo { t.historyIndex = -1 t.history.Add(line) } if lineIsPasted { err = ErrPasteIndicator } return } // t.remainder is a slice at the beginning of t.inBuf // containing a partial key sequence readBuf := t.inBuf[len(t.remainder):] var n int t.lock.Unlock() n, err = t.c.Read(readBuf) t.lock.Lock() if err != nil { return } t.remainder = t.inBuf[:n+len(t.remainder)] } } // SetPrompt sets the prompt to be used when reading subsequent lines. func (t *Terminal) SetPrompt(prompt string) { t.lock.Lock() defer t.lock.Unlock() t.prompt = []rune(prompt) } func (t *Terminal) clearAndRepaintLinePlusNPrevious(numPrevLines int) { // Move cursor to column zero at the start of the line. t.move(t.cursorY, 0, t.cursorX, 0) t.cursorX, t.cursorY = 0, 0 t.clearLineToRight() for t.cursorY < numPrevLines { // Move down a line t.move(0, 1, 0, 0) t.cursorY++ t.clearLineToRight() } // Move back to beginning. t.move(t.cursorY, 0, 0, 0) t.cursorX, t.cursorY = 0, 0 t.queue(t.prompt) t.advanceCursor(visualLength(t.prompt)) t.writeLine(t.line) t.moveCursorToPos(t.pos) } func (t *Terminal) SetSize(width, height int) error { t.lock.Lock() defer t.lock.Unlock() if width == 0 { width = 1 } oldWidth := t.termWidth t.termWidth, t.termHeight = width, height switch { case width == oldWidth: // If the width didn't change then nothing else needs to be // done. return nil case len(t.line) == 0 && t.cursorX == 0 && t.cursorY == 0: // If there is nothing on current line and no prompt printed, // just do nothing return nil case width < oldWidth: // Some terminals (e.g. xterm) will truncate lines that were // too long when shinking. Others, (e.g. gnome-terminal) will // attempt to wrap them. For the former, repainting t.maxLine // works great, but that behaviour goes badly wrong in the case // of the latter because they have doubled every full line. // We assume that we are working on a terminal that wraps lines // and adjust the cursor position based on every previous line // wrapping and turning into two. This causes the prompt on // xterms to move upwards, which isn't great, but it avoids a // huge mess with gnome-terminal. if t.cursorX >= t.termWidth { t.cursorX = t.termWidth - 1 } t.cursorY *= 2 t.clearAndRepaintLinePlusNPrevious(t.maxLine * 2) case width > oldWidth: // If the terminal expands then our position calculations will // be wrong in the future because we think the cursor is // |t.pos| chars into the string, but there will be a gap at // the end of any wrapped line. // // But the position will actually be correct until we move, so // we can move back to the beginning and repaint everything. t.clearAndRepaintLinePlusNPrevious(t.maxLine) } _, err := t.c.Write(t.outBuf) t.outBuf = t.outBuf[:0] return err } type pasteIndicatorError struct{} func (pasteIndicatorError) Error() string { return "terminal: ErrPasteIndicator not correctly handled" } // ErrPasteIndicator may be returned from ReadLine as the error, in addition // to valid line data. It indicates that bracketed paste mode is enabled and // that the returned line consists only of pasted data. Programs may wish to // interpret pasted data more literally than typed data. var ErrPasteIndicator = pasteIndicatorError{} // SetBracketedPasteMode requests that the terminal bracket paste operations // with markers. Not all terminals support this but, if it is supported, then // enabling this mode will stop any autocomplete callback from running due to // pastes. Additionally, any lines that are completely pasted will be returned // from ReadLine with the error set to ErrPasteIndicator. func (t *Terminal) SetBracketedPasteMode(on bool) { if on { io.WriteString(t.c, "\x1b[?2004h") } else { io.WriteString(t.c, "\x1b[?2004l") } } // stRingBuffer is a ring buffer of strings. type stRingBuffer struct { // entries contains max elements. entries []string max int // head contains the index of the element most recently added to the ring. head int // size contains the number of elements in the ring. size int } func (s *stRingBuffer) Add(a string) { if s.entries == nil { const defaultNumEntries = 100 s.entries = make([]string, defaultNumEntries) s.max = defaultNumEntries } s.head = (s.head + 1) % s.max s.entries[s.head] = a if s.size < s.max { s.size++ } } // NthPreviousEntry returns the value passed to the nth previous call to Add. // If n is zero then the immediately prior value is returned, if one, then the // next most recent, and so on. If such an element doesn't exist then ok is // false. func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) { if n >= s.size { return "", false } index := s.head - n if index < 0 { index += s.max } return s.entries[index], true } // readPasswordLine reads from reader until it finds \n or io.EOF. // The slice returned does not include the \n. // readPasswordLine also ignores any \r it finds. func readPasswordLine(reader io.Reader) ([]byte, error) { var buf [1]byte var ret []byte for { n, err := reader.Read(buf[:]) if n > 0 { switch buf[0] { case '\n': return ret, nil case '\r': // remove \r from passwords on Windows default: ret = append(ret, buf[0]) } continue } if err != nil { if err == io.EOF && len(ret) > 0 { return ret, nil } return ret, err } } } ================================================ FILE: vendor/golang.org/x/crypto/ssh/terminal/util.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build aix darwin dragonfly freebsd linux,!appengine netbsd openbsd // Package terminal provides support functions for dealing with terminals, as // commonly found on UNIX systems. // // Putting a terminal into raw mode is the most common requirement: // // oldState, err := terminal.MakeRaw(0) // if err != nil { // panic(err) // } // defer terminal.Restore(0, oldState) package terminal // import "golang.org/x/crypto/ssh/terminal" import ( "golang.org/x/sys/unix" ) // State contains the state of a terminal. type State struct { termios unix.Termios } // IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) return err == nil } // MakeRaw put the terminal connected to the given file descriptor into raw // mode and returns the previous state of the terminal so that it can be // restored. func MakeRaw(fd int) (*State, error) { termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios) if err != nil { return nil, err } oldState := State{termios: *termios} // This attempts to replicate the behaviour documented for cfmakeraw in // the termios(3) manpage. termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON termios.Oflag &^= unix.OPOST termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN termios.Cflag &^= unix.CSIZE | unix.PARENB termios.Cflag |= unix.CS8 termios.Cc[unix.VMIN] = 1 termios.Cc[unix.VTIME] = 0 if err := unix.IoctlSetTermios(fd, ioctlWriteTermios, termios); err != nil { return nil, err } return &oldState, nil } // GetState returns the current state of a terminal which may be useful to // restore the terminal after a signal. func GetState(fd int) (*State, error) { termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios) if err != nil { return nil, err } return &State{termios: *termios}, nil } // Restore restores the terminal connected to the given file descriptor to a // previous state. func Restore(fd int, state *State) error { return unix.IoctlSetTermios(fd, ioctlWriteTermios, &state.termios) } // GetSize returns the dimensions of the given terminal. func GetSize(fd int) (width, height int, err error) { ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ) if err != nil { return -1, -1, err } return int(ws.Col), int(ws.Row), nil } // passwordReader is an io.Reader that reads from a specific file descriptor. type passwordReader int func (r passwordReader) Read(buf []byte) (int, error) { return unix.Read(int(r), buf) } // ReadPassword reads a line of input from a terminal without local echo. This // is commonly used for inputting passwords and other sensitive data. The slice // returned does not include the \n. func ReadPassword(fd int) ([]byte, error) { termios, err := unix.IoctlGetTermios(fd, ioctlReadTermios) if err != nil { return nil, err } newState := *termios newState.Lflag &^= unix.ECHO newState.Lflag |= unix.ICANON | unix.ISIG newState.Iflag |= unix.ICRNL if err := unix.IoctlSetTermios(fd, ioctlWriteTermios, &newState); err != nil { return nil, err } defer unix.IoctlSetTermios(fd, ioctlWriteTermios, termios) return readPasswordLine(passwordReader(fd)) } ================================================ FILE: vendor/golang.org/x/crypto/ssh/terminal/util_aix.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build aix package terminal import "golang.org/x/sys/unix" const ioctlReadTermios = unix.TCGETS const ioctlWriteTermios = unix.TCSETS ================================================ FILE: vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin dragonfly freebsd netbsd openbsd package terminal import "golang.org/x/sys/unix" const ioctlReadTermios = unix.TIOCGETA const ioctlWriteTermios = unix.TIOCSETA ================================================ FILE: vendor/golang.org/x/crypto/ssh/terminal/util_linux.go ================================================ // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package terminal import "golang.org/x/sys/unix" const ioctlReadTermios = unix.TCGETS const ioctlWriteTermios = unix.TCSETS ================================================ FILE: vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package terminal provides support functions for dealing with terminals, as // commonly found on UNIX systems. // // Putting a terminal into raw mode is the most common requirement: // // oldState, err := terminal.MakeRaw(0) // if err != nil { // panic(err) // } // defer terminal.Restore(0, oldState) package terminal import ( "fmt" "runtime" ) type State struct{} // IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { return false } // MakeRaw put the terminal connected to the given file descriptor into raw // mode and returns the previous state of the terminal so that it can be // restored. func MakeRaw(fd int) (*State, error) { return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } // GetState returns the current state of a terminal which may be useful to // restore the terminal after a signal. func GetState(fd int) (*State, error) { return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } // Restore restores the terminal connected to the given file descriptor to a // previous state. func Restore(fd int, state *State) error { return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } // GetSize returns the dimensions of the given terminal. func GetSize(fd int) (width, height int, err error) { return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } // ReadPassword reads a line of input from a terminal without local echo. This // is commonly used for inputting passwords and other sensitive data. The slice // returned does not include the \n. func ReadPassword(fd int) ([]byte, error) { return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) } ================================================ FILE: vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build solaris package terminal // import "golang.org/x/crypto/ssh/terminal" import ( "golang.org/x/sys/unix" "io" "syscall" ) // State contains the state of a terminal. type State struct { termios unix.Termios } // IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { _, err := unix.IoctlGetTermio(fd, unix.TCGETA) return err == nil } // ReadPassword reads a line of input from a terminal without local echo. This // is commonly used for inputting passwords and other sensitive data. The slice // returned does not include the \n. func ReadPassword(fd int) ([]byte, error) { // see also: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libast/common/uwin/getpass.c val, err := unix.IoctlGetTermios(fd, unix.TCGETS) if err != nil { return nil, err } oldState := *val newState := oldState newState.Lflag &^= syscall.ECHO newState.Lflag |= syscall.ICANON | syscall.ISIG newState.Iflag |= syscall.ICRNL err = unix.IoctlSetTermios(fd, unix.TCSETS, &newState) if err != nil { return nil, err } defer unix.IoctlSetTermios(fd, unix.TCSETS, &oldState) var buf [16]byte var ret []byte for { n, err := syscall.Read(fd, buf[:]) if err != nil { return nil, err } if n == 0 { if len(ret) == 0 { return nil, io.EOF } break } if buf[n-1] == '\n' { n-- } ret = append(ret, buf[:n]...) if n < len(buf) { break } } return ret, nil } // MakeRaw puts the terminal connected to the given file descriptor into raw // mode and returns the previous state of the terminal so that it can be // restored. // see http://cr.illumos.org/~webrev/andy_js/1060/ func MakeRaw(fd int) (*State, error) { termios, err := unix.IoctlGetTermios(fd, unix.TCGETS) if err != nil { return nil, err } oldState := State{termios: *termios} termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON termios.Oflag &^= unix.OPOST termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN termios.Cflag &^= unix.CSIZE | unix.PARENB termios.Cflag |= unix.CS8 termios.Cc[unix.VMIN] = 1 termios.Cc[unix.VTIME] = 0 if err := unix.IoctlSetTermios(fd, unix.TCSETS, termios); err != nil { return nil, err } return &oldState, nil } // Restore restores the terminal connected to the given file descriptor to a // previous state. func Restore(fd int, oldState *State) error { return unix.IoctlSetTermios(fd, unix.TCSETS, &oldState.termios) } // GetState returns the current state of a terminal which may be useful to // restore the terminal after a signal. func GetState(fd int) (*State, error) { termios, err := unix.IoctlGetTermios(fd, unix.TCGETS) if err != nil { return nil, err } return &State{termios: *termios}, nil } // GetSize returns the dimensions of the given terminal. func GetSize(fd int) (width, height int, err error) { ws, err := unix.IoctlGetWinsize(fd, unix.TIOCGWINSZ) if err != nil { return 0, 0, err } return int(ws.Col), int(ws.Row), nil } ================================================ FILE: vendor/golang.org/x/crypto/ssh/terminal/util_windows.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build windows // Package terminal provides support functions for dealing with terminals, as // commonly found on UNIX systems. // // Putting a terminal into raw mode is the most common requirement: // // oldState, err := terminal.MakeRaw(0) // if err != nil { // panic(err) // } // defer terminal.Restore(0, oldState) package terminal import ( "os" "golang.org/x/sys/windows" ) type State struct { mode uint32 } // IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { var st uint32 err := windows.GetConsoleMode(windows.Handle(fd), &st) return err == nil } // MakeRaw put the terminal connected to the given file descriptor into raw // mode and returns the previous state of the terminal so that it can be // restored. func MakeRaw(fd int) (*State, error) { var st uint32 if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { return nil, err } raw := st &^ (windows.ENABLE_ECHO_INPUT | windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT) if err := windows.SetConsoleMode(windows.Handle(fd), raw); err != nil { return nil, err } return &State{st}, nil } // GetState returns the current state of a terminal which may be useful to // restore the terminal after a signal. func GetState(fd int) (*State, error) { var st uint32 if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { return nil, err } return &State{st}, nil } // Restore restores the terminal connected to the given file descriptor to a // previous state. func Restore(fd int, state *State) error { return windows.SetConsoleMode(windows.Handle(fd), state.mode) } // GetSize returns the visible dimensions of the given terminal. // // These dimensions don't include any scrollback buffer height. func GetSize(fd int) (width, height int, err error) { var info windows.ConsoleScreenBufferInfo if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil { return 0, 0, err } return int(info.Window.Right - info.Window.Left + 1), int(info.Window.Bottom - info.Window.Top + 1), nil } // ReadPassword reads a line of input from a terminal without local echo. This // is commonly used for inputting passwords and other sensitive data. The slice // returned does not include the \n. func ReadPassword(fd int) ([]byte, error) { var st uint32 if err := windows.GetConsoleMode(windows.Handle(fd), &st); err != nil { return nil, err } old := st st &^= (windows.ENABLE_ECHO_INPUT) st |= (windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT) if err := windows.SetConsoleMode(windows.Handle(fd), st); err != nil { return nil, err } defer windows.SetConsoleMode(windows.Handle(fd), old) var h windows.Handle p, _ := windows.GetCurrentProcess() if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil { return nil, err } f := os.NewFile(uintptr(h), "stdin") defer f.Close() return readPasswordLine(f) } ================================================ FILE: vendor/golang.org/x/crypto/ssh/transport.go ================================================ // Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssh import ( "bufio" "bytes" "errors" "io" "log" ) // debugTransport if set, will print packet types as they go over the // wire. No message decoding is done, to minimize the impact on timing. const debugTransport = false const ( gcmCipherID = "aes128-gcm@openssh.com" aes128cbcID = "aes128-cbc" tripledescbcID = "3des-cbc" ) // packetConn represents a transport that implements packet based // operations. type packetConn interface { // Encrypt and send a packet of data to the remote peer. writePacket(packet []byte) error // Read a packet from the connection. The read is blocking, // i.e. if error is nil, then the returned byte slice is // always non-empty. readPacket() ([]byte, error) // Close closes the write-side of the connection. Close() error } // transport is the keyingTransport that implements the SSH packet // protocol. type transport struct { reader connectionState writer connectionState bufReader *bufio.Reader bufWriter *bufio.Writer rand io.Reader isClient bool io.Closer } // packetCipher represents a combination of SSH encryption/MAC // protocol. A single instance should be used for one direction only. type packetCipher interface { // writePacket encrypts the packet and writes it to w. The // contents of the packet are generally scrambled. writePacket(seqnum uint32, w io.Writer, rand io.Reader, packet []byte) error // readPacket reads and decrypts a packet of data. The // returned packet may be overwritten by future calls of // readPacket. readPacket(seqnum uint32, r io.Reader) ([]byte, error) } // connectionState represents one side (read or write) of the // connection. This is necessary because each direction has its own // keys, and can even have its own algorithms type connectionState struct { packetCipher seqNum uint32 dir direction pendingKeyChange chan packetCipher } // prepareKeyChange sets up key material for a keychange. The key changes in // both directions are triggered by reading and writing a msgNewKey packet // respectively. func (t *transport) prepareKeyChange(algs *algorithms, kexResult *kexResult) error { ciph, err := newPacketCipher(t.reader.dir, algs.r, kexResult) if err != nil { return err } t.reader.pendingKeyChange <- ciph ciph, err = newPacketCipher(t.writer.dir, algs.w, kexResult) if err != nil { return err } t.writer.pendingKeyChange <- ciph return nil } func (t *transport) printPacket(p []byte, write bool) { if len(p) == 0 { return } who := "server" if t.isClient { who = "client" } what := "read" if write { what = "write" } log.Println(what, who, p[0]) } // Read and decrypt next packet. func (t *transport) readPacket() (p []byte, err error) { for { p, err = t.reader.readPacket(t.bufReader) if err != nil { break } if len(p) == 0 || (p[0] != msgIgnore && p[0] != msgDebug) { break } } if debugTransport { t.printPacket(p, false) } return p, err } func (s *connectionState) readPacket(r *bufio.Reader) ([]byte, error) { packet, err := s.packetCipher.readPacket(s.seqNum, r) s.seqNum++ if err == nil && len(packet) == 0 { err = errors.New("ssh: zero length packet") } if len(packet) > 0 { switch packet[0] { case msgNewKeys: select { case cipher := <-s.pendingKeyChange: s.packetCipher = cipher default: return nil, errors.New("ssh: got bogus newkeys message") } case msgDisconnect: // Transform a disconnect message into an // error. Since this is lowest level at which // we interpret message types, doing it here // ensures that we don't have to handle it // elsewhere. var msg disconnectMsg if err := Unmarshal(packet, &msg); err != nil { return nil, err } return nil, &msg } } // The packet may point to an internal buffer, so copy the // packet out here. fresh := make([]byte, len(packet)) copy(fresh, packet) return fresh, err } func (t *transport) writePacket(packet []byte) error { if debugTransport { t.printPacket(packet, true) } return t.writer.writePacket(t.bufWriter, t.rand, packet) } func (s *connectionState) writePacket(w *bufio.Writer, rand io.Reader, packet []byte) error { changeKeys := len(packet) > 0 && packet[0] == msgNewKeys err := s.packetCipher.writePacket(s.seqNum, w, rand, packet) if err != nil { return err } if err = w.Flush(); err != nil { return err } s.seqNum++ if changeKeys { select { case cipher := <-s.pendingKeyChange: s.packetCipher = cipher default: panic("ssh: no key material for msgNewKeys") } } return err } func newTransport(rwc io.ReadWriteCloser, rand io.Reader, isClient bool) *transport { t := &transport{ bufReader: bufio.NewReader(rwc), bufWriter: bufio.NewWriter(rwc), rand: rand, reader: connectionState{ packetCipher: &streamPacketCipher{cipher: noneCipher{}}, pendingKeyChange: make(chan packetCipher, 1), }, writer: connectionState{ packetCipher: &streamPacketCipher{cipher: noneCipher{}}, pendingKeyChange: make(chan packetCipher, 1), }, Closer: rwc, } t.isClient = isClient if isClient { t.reader.dir = serverKeys t.writer.dir = clientKeys } else { t.reader.dir = clientKeys t.writer.dir = serverKeys } return t } type direction struct { ivTag []byte keyTag []byte macKeyTag []byte } var ( serverKeys = direction{[]byte{'B'}, []byte{'D'}, []byte{'F'}} clientKeys = direction{[]byte{'A'}, []byte{'C'}, []byte{'E'}} ) // setupKeys sets the cipher and MAC keys from kex.K, kex.H and sessionId, as // described in RFC 4253, section 6.4. direction should either be serverKeys // (to setup server->client keys) or clientKeys (for client->server keys). func newPacketCipher(d direction, algs directionAlgorithms, kex *kexResult) (packetCipher, error) { cipherMode := cipherModes[algs.Cipher] macMode := macModes[algs.MAC] iv := make([]byte, cipherMode.ivSize) key := make([]byte, cipherMode.keySize) macKey := make([]byte, macMode.keySize) generateKeyMaterial(iv, d.ivTag, kex) generateKeyMaterial(key, d.keyTag, kex) generateKeyMaterial(macKey, d.macKeyTag, kex) return cipherModes[algs.Cipher].create(key, iv, macKey, algs) } // generateKeyMaterial fills out with key material generated from tag, K, H // and sessionId, as specified in RFC 4253, section 7.2. func generateKeyMaterial(out, tag []byte, r *kexResult) { var digestsSoFar []byte h := r.Hash.New() for len(out) > 0 { h.Reset() h.Write(r.K) h.Write(r.H) if len(digestsSoFar) == 0 { h.Write(tag) h.Write(r.SessionID) } else { h.Write(digestsSoFar) } digest := h.Sum(nil) n := copy(out, digest) out = out[n:] if len(out) > 0 { digestsSoFar = append(digestsSoFar, digest...) } } } const packageVersion = "SSH-2.0-Go" // Sends and receives a version line. The versionLine string should // be US ASCII, start with "SSH-2.0-", and should not include a // newline. exchangeVersions returns the other side's version line. func exchangeVersions(rw io.ReadWriter, versionLine []byte) (them []byte, err error) { // Contrary to the RFC, we do not ignore lines that don't // start with "SSH-2.0-" to make the library usable with // nonconforming servers. for _, c := range versionLine { // The spec disallows non US-ASCII chars, and // specifically forbids null chars. if c < 32 { return nil, errors.New("ssh: junk character in version line") } } if _, err = rw.Write(append(versionLine, '\r', '\n')); err != nil { return } them, err = readVersion(rw) return them, err } // maxVersionStringBytes is the maximum number of bytes that we'll // accept as a version string. RFC 4253 section 4.2 limits this at 255 // chars const maxVersionStringBytes = 255 // Read version string as specified by RFC 4253, section 4.2. func readVersion(r io.Reader) ([]byte, error) { versionString := make([]byte, 0, 64) var ok bool var buf [1]byte for length := 0; length < maxVersionStringBytes; length++ { _, err := io.ReadFull(r, buf[:]) if err != nil { return nil, err } // The RFC says that the version should be terminated with \r\n // but several SSH servers actually only send a \n. if buf[0] == '\n' { if !bytes.HasPrefix(versionString, []byte("SSH-")) { // RFC 4253 says we need to ignore all version string lines // except the one containing the SSH version (provided that // all the lines do not exceed 255 bytes in total). versionString = versionString[:0] continue } ok = true break } // non ASCII chars are disallowed, but we are lenient, // since Go doesn't use null-terminated strings. // The RFC allows a comment after a space, however, // all of it (version and comments) goes into the // session hash. versionString = append(versionString, buf[0]) } if !ok { return nil, errors.New("ssh: overflow reading version string") } // There might be a '\r' on the end which we should remove. if len(versionString) > 0 && versionString[len(versionString)-1] == '\r' { versionString = versionString[:len(versionString)-1] } return versionString, nil } ================================================ FILE: vendor/golang.org/x/net/AUTHORS ================================================ # This source code refers to The Go Authors for copyright purposes. # The master list of authors is in the main Go distribution, # visible at http://tip.golang.org/AUTHORS. ================================================ FILE: vendor/golang.org/x/net/CONTRIBUTORS ================================================ # This source code was written by the Go contributors. # The master list of contributors is in the main Go distribution, # visible at http://tip.golang.org/CONTRIBUTORS. ================================================ FILE: vendor/golang.org/x/net/LICENSE ================================================ Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/net/PATENTS ================================================ Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. ================================================ FILE: vendor/golang.org/x/net/context/context.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package context defines the Context type, which carries deadlines, // cancelation signals, and other request-scoped values across API boundaries // and between processes. // As of Go 1.7 this package is available in the standard library under the // name context. https://golang.org/pkg/context. // // Incoming requests to a server should create a Context, and outgoing calls to // servers should accept a Context. The chain of function calls between must // propagate the Context, optionally replacing it with a modified copy created // using WithDeadline, WithTimeout, WithCancel, or WithValue. // // Programs that use Contexts should follow these rules to keep interfaces // consistent across packages and enable static analysis tools to check context // propagation: // // Do not store Contexts inside a struct type; instead, pass a Context // explicitly to each function that needs it. The Context should be the first // parameter, typically named ctx: // // func DoSomething(ctx context.Context, arg Arg) error { // // ... use ctx ... // } // // Do not pass a nil Context, even if a function permits it. Pass context.TODO // if you are unsure about which Context to use. // // Use context Values only for request-scoped data that transits processes and // APIs, not for passing optional parameters to functions. // // The same Context may be passed to functions running in different goroutines; // Contexts are safe for simultaneous use by multiple goroutines. // // See http://blog.golang.org/context for example code for a server that uses // Contexts. package context // import "golang.org/x/net/context" // Background returns a non-nil, empty Context. It is never canceled, has no // values, and has no deadline. It is typically used by the main function, // initialization, and tests, and as the top-level Context for incoming // requests. func Background() Context { return background } // TODO returns a non-nil, empty Context. Code should use context.TODO when // it's unclear which Context to use or it is not yet available (because the // surrounding function has not yet been extended to accept a Context // parameter). TODO is recognized by static analysis tools that determine // whether Contexts are propagated correctly in a program. func TODO() Context { return todo } ================================================ FILE: vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package ctxhttp provides helper functions for performing context-aware HTTP requests. package ctxhttp // import "golang.org/x/net/context/ctxhttp" import ( "context" "io" "net/http" "net/url" "strings" ) // Do sends an HTTP request with the provided http.Client and returns // an HTTP response. // // If the client is nil, http.DefaultClient is used. // // The provided ctx must be non-nil. If it is canceled or times out, // ctx.Err() will be returned. func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { if client == nil { client = http.DefaultClient } resp, err := client.Do(req.WithContext(ctx)) // If we got an error, and the context has been canceled, // the context's error is probably more useful. if err != nil { select { case <-ctx.Done(): err = ctx.Err() default: } } return resp, err } // Get issues a GET request via the Do function. func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, err } return Do(ctx, client, req) } // Head issues a HEAD request via the Do function. func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { req, err := http.NewRequest("HEAD", url, nil) if err != nil { return nil, err } return Do(ctx, client, req) } // Post issues a POST request via the Do function. func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { req, err := http.NewRequest("POST", url, body) if err != nil { return nil, err } req.Header.Set("Content-Type", bodyType) return Do(ctx, client, req) } // PostForm issues a POST request via the Do function. func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) } ================================================ FILE: vendor/golang.org/x/net/context/go17.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build go1.7 package context import ( "context" // standard library's context, as of Go 1.7 "time" ) var ( todo = context.TODO() background = context.Background() ) // Canceled is the error returned by Context.Err when the context is canceled. var Canceled = context.Canceled // DeadlineExceeded is the error returned by Context.Err when the context's // deadline passes. var DeadlineExceeded = context.DeadlineExceeded // WithCancel returns a copy of parent with a new Done channel. The returned // context's Done channel is closed when the returned cancel function is called // or when the parent context's Done channel is closed, whichever happens first. // // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this Context complete. func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { ctx, f := context.WithCancel(parent) return ctx, CancelFunc(f) } // WithDeadline returns a copy of the parent context with the deadline adjusted // to be no later than d. If the parent's deadline is already earlier than d, // WithDeadline(parent, d) is semantically equivalent to parent. The returned // context's Done channel is closed when the deadline expires, when the returned // cancel function is called, or when the parent context's Done channel is // closed, whichever happens first. // // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this Context complete. func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { ctx, f := context.WithDeadline(parent, deadline) return ctx, CancelFunc(f) } // WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). // // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this Context complete: // // func slowOperationWithTimeout(ctx context.Context) (Result, error) { // ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) // defer cancel() // releases resources if slowOperation completes before timeout elapses // return slowOperation(ctx) // } func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { return WithDeadline(parent, time.Now().Add(timeout)) } // WithValue returns a copy of parent in which the value associated with key is // val. // // Use context Values only for request-scoped data that transits processes and // APIs, not for passing optional parameters to functions. func WithValue(parent Context, key interface{}, val interface{}) Context { return context.WithValue(parent, key, val) } ================================================ FILE: vendor/golang.org/x/net/context/go19.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build go1.9 package context import "context" // standard library's context, as of Go 1.7 // A Context carries a deadline, a cancelation signal, and other values across // API boundaries. // // Context's methods may be called by multiple goroutines simultaneously. type Context = context.Context // A CancelFunc tells an operation to abandon its work. // A CancelFunc does not wait for the work to stop. // After the first call, subsequent calls to a CancelFunc do nothing. type CancelFunc = context.CancelFunc ================================================ FILE: vendor/golang.org/x/net/context/pre_go17.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !go1.7 package context import ( "errors" "fmt" "sync" "time" ) // An emptyCtx is never canceled, has no values, and has no deadline. It is not // struct{}, since vars of this type must have distinct addresses. type emptyCtx int func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { return } func (*emptyCtx) Done() <-chan struct{} { return nil } func (*emptyCtx) Err() error { return nil } func (*emptyCtx) Value(key interface{}) interface{} { return nil } func (e *emptyCtx) String() string { switch e { case background: return "context.Background" case todo: return "context.TODO" } return "unknown empty Context" } var ( background = new(emptyCtx) todo = new(emptyCtx) ) // Canceled is the error returned by Context.Err when the context is canceled. var Canceled = errors.New("context canceled") // DeadlineExceeded is the error returned by Context.Err when the context's // deadline passes. var DeadlineExceeded = errors.New("context deadline exceeded") // WithCancel returns a copy of parent with a new Done channel. The returned // context's Done channel is closed when the returned cancel function is called // or when the parent context's Done channel is closed, whichever happens first. // // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this Context complete. func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { c := newCancelCtx(parent) propagateCancel(parent, c) return c, func() { c.cancel(true, Canceled) } } // newCancelCtx returns an initialized cancelCtx. func newCancelCtx(parent Context) *cancelCtx { return &cancelCtx{ Context: parent, done: make(chan struct{}), } } // propagateCancel arranges for child to be canceled when parent is. func propagateCancel(parent Context, child canceler) { if parent.Done() == nil { return // parent is never canceled } if p, ok := parentCancelCtx(parent); ok { p.mu.Lock() if p.err != nil { // parent has already been canceled child.cancel(false, p.err) } else { if p.children == nil { p.children = make(map[canceler]bool) } p.children[child] = true } p.mu.Unlock() } else { go func() { select { case <-parent.Done(): child.cancel(false, parent.Err()) case <-child.Done(): } }() } } // parentCancelCtx follows a chain of parent references until it finds a // *cancelCtx. This function understands how each of the concrete types in this // package represents its parent. func parentCancelCtx(parent Context) (*cancelCtx, bool) { for { switch c := parent.(type) { case *cancelCtx: return c, true case *timerCtx: return c.cancelCtx, true case *valueCtx: parent = c.Context default: return nil, false } } } // removeChild removes a context from its parent. func removeChild(parent Context, child canceler) { p, ok := parentCancelCtx(parent) if !ok { return } p.mu.Lock() if p.children != nil { delete(p.children, child) } p.mu.Unlock() } // A canceler is a context type that can be canceled directly. The // implementations are *cancelCtx and *timerCtx. type canceler interface { cancel(removeFromParent bool, err error) Done() <-chan struct{} } // A cancelCtx can be canceled. When canceled, it also cancels any children // that implement canceler. type cancelCtx struct { Context done chan struct{} // closed by the first cancel call. mu sync.Mutex children map[canceler]bool // set to nil by the first cancel call err error // set to non-nil by the first cancel call } func (c *cancelCtx) Done() <-chan struct{} { return c.done } func (c *cancelCtx) Err() error { c.mu.Lock() defer c.mu.Unlock() return c.err } func (c *cancelCtx) String() string { return fmt.Sprintf("%v.WithCancel", c.Context) } // cancel closes c.done, cancels each of c's children, and, if // removeFromParent is true, removes c from its parent's children. func (c *cancelCtx) cancel(removeFromParent bool, err error) { if err == nil { panic("context: internal error: missing cancel error") } c.mu.Lock() if c.err != nil { c.mu.Unlock() return // already canceled } c.err = err close(c.done) for child := range c.children { // NOTE: acquiring the child's lock while holding parent's lock. child.cancel(false, err) } c.children = nil c.mu.Unlock() if removeFromParent { removeChild(c.Context, c) } } // WithDeadline returns a copy of the parent context with the deadline adjusted // to be no later than d. If the parent's deadline is already earlier than d, // WithDeadline(parent, d) is semantically equivalent to parent. The returned // context's Done channel is closed when the deadline expires, when the returned // cancel function is called, or when the parent context's Done channel is // closed, whichever happens first. // // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this Context complete. func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { if cur, ok := parent.Deadline(); ok && cur.Before(deadline) { // The current deadline is already sooner than the new one. return WithCancel(parent) } c := &timerCtx{ cancelCtx: newCancelCtx(parent), deadline: deadline, } propagateCancel(parent, c) d := deadline.Sub(time.Now()) if d <= 0 { c.cancel(true, DeadlineExceeded) // deadline has already passed return c, func() { c.cancel(true, Canceled) } } c.mu.Lock() defer c.mu.Unlock() if c.err == nil { c.timer = time.AfterFunc(d, func() { c.cancel(true, DeadlineExceeded) }) } return c, func() { c.cancel(true, Canceled) } } // A timerCtx carries a timer and a deadline. It embeds a cancelCtx to // implement Done and Err. It implements cancel by stopping its timer then // delegating to cancelCtx.cancel. type timerCtx struct { *cancelCtx timer *time.Timer // Under cancelCtx.mu. deadline time.Time } func (c *timerCtx) Deadline() (deadline time.Time, ok bool) { return c.deadline, true } func (c *timerCtx) String() string { return fmt.Sprintf("%v.WithDeadline(%s [%s])", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now())) } func (c *timerCtx) cancel(removeFromParent bool, err error) { c.cancelCtx.cancel(false, err) if removeFromParent { // Remove this timerCtx from its parent cancelCtx's children. removeChild(c.cancelCtx.Context, c) } c.mu.Lock() if c.timer != nil { c.timer.Stop() c.timer = nil } c.mu.Unlock() } // WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). // // Canceling this context releases resources associated with it, so code should // call cancel as soon as the operations running in this Context complete: // // func slowOperationWithTimeout(ctx context.Context) (Result, error) { // ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) // defer cancel() // releases resources if slowOperation completes before timeout elapses // return slowOperation(ctx) // } func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { return WithDeadline(parent, time.Now().Add(timeout)) } // WithValue returns a copy of parent in which the value associated with key is // val. // // Use context Values only for request-scoped data that transits processes and // APIs, not for passing optional parameters to functions. func WithValue(parent Context, key interface{}, val interface{}) Context { return &valueCtx{parent, key, val} } // A valueCtx carries a key-value pair. It implements Value for that key and // delegates all other calls to the embedded Context. type valueCtx struct { Context key, val interface{} } func (c *valueCtx) String() string { return fmt.Sprintf("%v.WithValue(%#v, %#v)", c.Context, c.key, c.val) } func (c *valueCtx) Value(key interface{}) interface{} { if c.key == key { return c.val } return c.Context.Value(key) } ================================================ FILE: vendor/golang.org/x/net/context/pre_go19.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !go1.9 package context import "time" // A Context carries a deadline, a cancelation signal, and other values across // API boundaries. // // Context's methods may be called by multiple goroutines simultaneously. type Context interface { // Deadline returns the time when work done on behalf of this context // should be canceled. Deadline returns ok==false when no deadline is // set. Successive calls to Deadline return the same results. Deadline() (deadline time.Time, ok bool) // Done returns a channel that's closed when work done on behalf of this // context should be canceled. Done may return nil if this context can // never be canceled. Successive calls to Done return the same value. // // WithCancel arranges for Done to be closed when cancel is called; // WithDeadline arranges for Done to be closed when the deadline // expires; WithTimeout arranges for Done to be closed when the timeout // elapses. // // Done is provided for use in select statements: // // // Stream generates values with DoSomething and sends them to out // // until DoSomething returns an error or ctx.Done is closed. // func Stream(ctx context.Context, out chan<- Value) error { // for { // v, err := DoSomething(ctx) // if err != nil { // return err // } // select { // case <-ctx.Done(): // return ctx.Err() // case out <- v: // } // } // } // // See http://blog.golang.org/pipelines for more examples of how to use // a Done channel for cancelation. Done() <-chan struct{} // Err returns a non-nil error value after Done is closed. Err returns // Canceled if the context was canceled or DeadlineExceeded if the // context's deadline passed. No other values for Err are defined. // After Done is closed, successive calls to Err return the same value. Err() error // Value returns the value associated with this context for key, or nil // if no value is associated with key. Successive calls to Value with // the same key returns the same result. // // Use context values only for request-scoped data that transits // processes and API boundaries, not for passing optional parameters to // functions. // // A key identifies a specific value in a Context. Functions that wish // to store values in Context typically allocate a key in a global // variable then use that key as the argument to context.WithValue and // Context.Value. A key can be any type that supports equality; // packages should define keys as an unexported type to avoid // collisions. // // Packages that define a Context key should provide type-safe accessors // for the values stores using that key: // // // Package user defines a User type that's stored in Contexts. // package user // // import "golang.org/x/net/context" // // // User is the type of value stored in the Contexts. // type User struct {...} // // // key is an unexported type for keys defined in this package. // // This prevents collisions with keys defined in other packages. // type key int // // // userKey is the key for user.User values in Contexts. It is // // unexported; clients use user.NewContext and user.FromContext // // instead of using this key directly. // var userKey key = 0 // // // NewContext returns a new Context that carries value u. // func NewContext(ctx context.Context, u *User) context.Context { // return context.WithValue(ctx, userKey, u) // } // // // FromContext returns the User value stored in ctx, if any. // func FromContext(ctx context.Context) (*User, bool) { // u, ok := ctx.Value(userKey).(*User) // return u, ok // } Value(key interface{}) interface{} } // A CancelFunc tells an operation to abandon its work. // A CancelFunc does not wait for the work to stop. // After the first call, subsequent calls to a CancelFunc do nothing. type CancelFunc func() ================================================ FILE: vendor/golang.org/x/net/http/httpguts/guts.go ================================================ // Copyright 2018 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 httpguts provides functions implementing various details // of the HTTP specification. // // This package is shared by the standard library (which vendors it) // and x/net/http2. It comes with no API stability promise. package httpguts import ( "net/textproto" "strings" ) // ValidTrailerHeader reports whether name is a valid header field name to appear // in trailers. // See RFC 7230, Section 4.1.2 func ValidTrailerHeader(name string) bool { name = textproto.CanonicalMIMEHeaderKey(name) if strings.HasPrefix(name, "If-") || badTrailer[name] { return false } return true } var badTrailer = map[string]bool{ "Authorization": true, "Cache-Control": true, "Connection": true, "Content-Encoding": true, "Content-Length": true, "Content-Range": true, "Content-Type": true, "Expect": true, "Host": true, "Keep-Alive": true, "Max-Forwards": true, "Pragma": true, "Proxy-Authenticate": true, "Proxy-Authorization": true, "Proxy-Connection": true, "Range": true, "Realm": true, "Te": true, "Trailer": true, "Transfer-Encoding": true, "Www-Authenticate": true, } ================================================ FILE: vendor/golang.org/x/net/http/httpguts/httplex.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package httpguts import ( "net" "strings" "unicode/utf8" "golang.org/x/net/idna" ) var isTokenTable = [127]bool{ '!': true, '#': true, '$': true, '%': true, '&': true, '\'': true, '*': true, '+': true, '-': true, '.': true, '0': true, '1': true, '2': true, '3': true, '4': true, '5': true, '6': true, '7': true, '8': true, '9': true, 'A': true, 'B': true, 'C': true, 'D': true, 'E': true, 'F': true, 'G': true, 'H': true, 'I': true, 'J': true, 'K': true, 'L': true, 'M': true, 'N': true, 'O': true, 'P': true, 'Q': true, 'R': true, 'S': true, 'T': true, 'U': true, 'W': true, 'V': true, 'X': true, 'Y': true, 'Z': true, '^': true, '_': true, '`': true, 'a': true, 'b': true, 'c': true, 'd': true, 'e': true, 'f': true, 'g': true, 'h': true, 'i': true, 'j': true, 'k': true, 'l': true, 'm': true, 'n': true, 'o': true, 'p': true, 'q': true, 'r': true, 's': true, 't': true, 'u': true, 'v': true, 'w': true, 'x': true, 'y': true, 'z': true, '|': true, '~': true, } func IsTokenRune(r rune) bool { i := int(r) return i < len(isTokenTable) && isTokenTable[i] } func isNotToken(r rune) bool { return !IsTokenRune(r) } // HeaderValuesContainsToken reports whether any string in values // contains the provided token, ASCII case-insensitively. func HeaderValuesContainsToken(values []string, token string) bool { for _, v := range values { if headerValueContainsToken(v, token) { return true } } return false } // isOWS reports whether b is an optional whitespace byte, as defined // by RFC 7230 section 3.2.3. func isOWS(b byte) bool { return b == ' ' || b == '\t' } // trimOWS returns x with all optional whitespace removes from the // beginning and end. func trimOWS(x string) string { // TODO: consider using strings.Trim(x, " \t") instead, // if and when it's fast enough. See issue 10292. // But this ASCII-only code will probably always beat UTF-8 // aware code. for len(x) > 0 && isOWS(x[0]) { x = x[1:] } for len(x) > 0 && isOWS(x[len(x)-1]) { x = x[:len(x)-1] } return x } // headerValueContainsToken reports whether v (assumed to be a // 0#element, in the ABNF extension described in RFC 7230 section 7) // contains token amongst its comma-separated tokens, ASCII // case-insensitively. func headerValueContainsToken(v string, token string) bool { v = trimOWS(v) if comma := strings.IndexByte(v, ','); comma != -1 { return tokenEqual(trimOWS(v[:comma]), token) || headerValueContainsToken(v[comma+1:], token) } return tokenEqual(v, token) } // lowerASCII returns the ASCII lowercase version of b. func lowerASCII(b byte) byte { if 'A' <= b && b <= 'Z' { return b + ('a' - 'A') } return b } // tokenEqual reports whether t1 and t2 are equal, ASCII case-insensitively. func tokenEqual(t1, t2 string) bool { if len(t1) != len(t2) { return false } for i, b := range t1 { if b >= utf8.RuneSelf { // No UTF-8 or non-ASCII allowed in tokens. return false } if lowerASCII(byte(b)) != lowerASCII(t2[i]) { return false } } return true } // isLWS reports whether b is linear white space, according // to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 // LWS = [CRLF] 1*( SP | HT ) func isLWS(b byte) bool { return b == ' ' || b == '\t' } // isCTL reports whether b is a control byte, according // to http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 // CTL = func isCTL(b byte) bool { const del = 0x7f // a CTL return b < ' ' || b == del } // ValidHeaderFieldName reports whether v is a valid HTTP/1.x header name. // HTTP/2 imposes the additional restriction that uppercase ASCII // letters are not allowed. // // RFC 7230 says: // header-field = field-name ":" OWS field-value OWS // field-name = token // token = 1*tchar // tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / // "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA func ValidHeaderFieldName(v string) bool { if len(v) == 0 { return false } for _, r := range v { if !IsTokenRune(r) { return false } } return true } // ValidHostHeader reports whether h is a valid host header. func ValidHostHeader(h string) bool { // The latest spec is actually this: // // http://tools.ietf.org/html/rfc7230#section-5.4 // Host = uri-host [ ":" port ] // // Where uri-host is: // http://tools.ietf.org/html/rfc3986#section-3.2.2 // // But we're going to be much more lenient for now and just // search for any byte that's not a valid byte in any of those // expressions. for i := 0; i < len(h); i++ { if !validHostByte[h[i]] { return false } } return true } // See the validHostHeader comment. var validHostByte = [256]bool{ '0': true, '1': true, '2': true, '3': true, '4': true, '5': true, '6': true, '7': true, '8': true, '9': true, 'a': true, 'b': true, 'c': true, 'd': true, 'e': true, 'f': true, 'g': true, 'h': true, 'i': true, 'j': true, 'k': true, 'l': true, 'm': true, 'n': true, 'o': true, 'p': true, 'q': true, 'r': true, 's': true, 't': true, 'u': true, 'v': true, 'w': true, 'x': true, 'y': true, 'z': true, 'A': true, 'B': true, 'C': true, 'D': true, 'E': true, 'F': true, 'G': true, 'H': true, 'I': true, 'J': true, 'K': true, 'L': true, 'M': true, 'N': true, 'O': true, 'P': true, 'Q': true, 'R': true, 'S': true, 'T': true, 'U': true, 'V': true, 'W': true, 'X': true, 'Y': true, 'Z': true, '!': true, // sub-delims '$': true, // sub-delims '%': true, // pct-encoded (and used in IPv6 zones) '&': true, // sub-delims '(': true, // sub-delims ')': true, // sub-delims '*': true, // sub-delims '+': true, // sub-delims ',': true, // sub-delims '-': true, // unreserved '.': true, // unreserved ':': true, // IPv6address + Host expression's optional port ';': true, // sub-delims '=': true, // sub-delims '[': true, '\'': true, // sub-delims ']': true, '_': true, // unreserved '~': true, // unreserved } // ValidHeaderFieldValue reports whether v is a valid "field-value" according to // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 : // // message-header = field-name ":" [ field-value ] // field-value = *( field-content | LWS ) // field-content = // // http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2.2 : // // TEXT = // LWS = [CRLF] 1*( SP | HT ) // CTL = // // RFC 7230 says: // field-value = *( field-content / obs-fold ) // obj-fold = N/A to http2, and deprecated // field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] // field-vchar = VCHAR / obs-text // obs-text = %x80-FF // VCHAR = "any visible [USASCII] character" // // http2 further says: "Similarly, HTTP/2 allows header field values // that are not valid. While most of the values that can be encoded // will not alter header field parsing, carriage return (CR, ASCII // 0xd), line feed (LF, ASCII 0xa), and the zero character (NUL, ASCII // 0x0) might be exploited by an attacker if they are translated // verbatim. Any request or response that contains a character not // permitted in a header field value MUST be treated as malformed // (Section 8.1.2.6). Valid characters are defined by the // field-content ABNF rule in Section 3.2 of [RFC7230]." // // This function does not (yet?) properly handle the rejection of // strings that begin or end with SP or HTAB. func ValidHeaderFieldValue(v string) bool { for i := 0; i < len(v); i++ { b := v[i] if isCTL(b) && !isLWS(b) { return false } } return true } func isASCII(s string) bool { for i := 0; i < len(s); i++ { if s[i] >= utf8.RuneSelf { return false } } return true } // PunycodeHostPort returns the IDNA Punycode version // of the provided "host" or "host:port" string. func PunycodeHostPort(v string) (string, error) { if isASCII(v) { return v, nil } host, port, err := net.SplitHostPort(v) if err != nil { // The input 'v' argument was just a "host" argument, // without a port. This error should not be returned // to the caller. host = v port = "" } host, err = idna.ToASCII(host) if err != nil { // Non-UTF-8? Not representable in Punycode, in any // case. return "", err } if port == "" { return host, nil } return net.JoinHostPort(host, port), nil } ================================================ FILE: vendor/golang.org/x/net/http2/.gitignore ================================================ *~ h2i/h2i ================================================ FILE: vendor/golang.org/x/net/http2/Dockerfile ================================================ # # This Dockerfile builds a recent curl with HTTP/2 client support, using # a recent nghttp2 build. # # See the Makefile for how to tag it. If Docker and that image is found, the # Go tests use this curl binary for integration tests. # FROM ubuntu:trusty RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y git-core build-essential wget RUN apt-get install -y --no-install-recommends \ autotools-dev libtool pkg-config zlib1g-dev \ libcunit1-dev libssl-dev libxml2-dev libevent-dev \ automake autoconf # The list of packages nghttp2 recommends for h2load: RUN apt-get install -y --no-install-recommends make binutils \ autoconf automake autotools-dev \ libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev \ libev-dev libevent-dev libjansson-dev libjemalloc-dev \ cython python3.4-dev python-setuptools # Note: setting NGHTTP2_VER before the git clone, so an old git clone isn't cached: ENV NGHTTP2_VER 895da9a RUN cd /root && git clone https://github.com/tatsuhiro-t/nghttp2.git WORKDIR /root/nghttp2 RUN git reset --hard $NGHTTP2_VER RUN autoreconf -i RUN automake RUN autoconf RUN ./configure RUN make RUN make install WORKDIR /root RUN wget http://curl.haxx.se/download/curl-7.45.0.tar.gz RUN tar -zxvf curl-7.45.0.tar.gz WORKDIR /root/curl-7.45.0 RUN ./configure --with-ssl --with-nghttp2=/usr/local RUN make RUN make install RUN ldconfig CMD ["-h"] ENTRYPOINT ["/usr/local/bin/curl"] ================================================ FILE: vendor/golang.org/x/net/http2/Makefile ================================================ curlimage: docker build -t gohttp2/curl . ================================================ FILE: vendor/golang.org/x/net/http2/README ================================================ This is a work-in-progress HTTP/2 implementation for Go. It will eventually live in the Go standard library and won't require any changes to your code to use. It will just be automatic. Status: * The server support is pretty good. A few things are missing but are being worked on. * The client work has just started but shares a lot of code is coming along much quicker. Docs are at https://godoc.org/golang.org/x/net/http2 Demo test server at https://http2.golang.org/ Help & bug reports welcome! Contributing: https://golang.org/doc/contribute.html Bugs: https://golang.org/issue/new?title=x/net/http2:+ ================================================ FILE: vendor/golang.org/x/net/http2/ciphers.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 // A list of the possible cipher suite ids. Taken from // https://www.iana.org/assignments/tls-parameters/tls-parameters.txt const ( cipher_TLS_NULL_WITH_NULL_NULL uint16 = 0x0000 cipher_TLS_RSA_WITH_NULL_MD5 uint16 = 0x0001 cipher_TLS_RSA_WITH_NULL_SHA uint16 = 0x0002 cipher_TLS_RSA_EXPORT_WITH_RC4_40_MD5 uint16 = 0x0003 cipher_TLS_RSA_WITH_RC4_128_MD5 uint16 = 0x0004 cipher_TLS_RSA_WITH_RC4_128_SHA uint16 = 0x0005 cipher_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 uint16 = 0x0006 cipher_TLS_RSA_WITH_IDEA_CBC_SHA uint16 = 0x0007 cipher_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0008 cipher_TLS_RSA_WITH_DES_CBC_SHA uint16 = 0x0009 cipher_TLS_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x000A cipher_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x000B cipher_TLS_DH_DSS_WITH_DES_CBC_SHA uint16 = 0x000C cipher_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA uint16 = 0x000D cipher_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x000E cipher_TLS_DH_RSA_WITH_DES_CBC_SHA uint16 = 0x000F cipher_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x0010 cipher_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0011 cipher_TLS_DHE_DSS_WITH_DES_CBC_SHA uint16 = 0x0012 cipher_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA uint16 = 0x0013 cipher_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0014 cipher_TLS_DHE_RSA_WITH_DES_CBC_SHA uint16 = 0x0015 cipher_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x0016 cipher_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 uint16 = 0x0017 cipher_TLS_DH_anon_WITH_RC4_128_MD5 uint16 = 0x0018 cipher_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA uint16 = 0x0019 cipher_TLS_DH_anon_WITH_DES_CBC_SHA uint16 = 0x001A cipher_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA uint16 = 0x001B // Reserved uint16 = 0x001C-1D cipher_TLS_KRB5_WITH_DES_CBC_SHA uint16 = 0x001E cipher_TLS_KRB5_WITH_3DES_EDE_CBC_SHA uint16 = 0x001F cipher_TLS_KRB5_WITH_RC4_128_SHA uint16 = 0x0020 cipher_TLS_KRB5_WITH_IDEA_CBC_SHA uint16 = 0x0021 cipher_TLS_KRB5_WITH_DES_CBC_MD5 uint16 = 0x0022 cipher_TLS_KRB5_WITH_3DES_EDE_CBC_MD5 uint16 = 0x0023 cipher_TLS_KRB5_WITH_RC4_128_MD5 uint16 = 0x0024 cipher_TLS_KRB5_WITH_IDEA_CBC_MD5 uint16 = 0x0025 cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA uint16 = 0x0026 cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA uint16 = 0x0027 cipher_TLS_KRB5_EXPORT_WITH_RC4_40_SHA uint16 = 0x0028 cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 uint16 = 0x0029 cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 uint16 = 0x002A cipher_TLS_KRB5_EXPORT_WITH_RC4_40_MD5 uint16 = 0x002B cipher_TLS_PSK_WITH_NULL_SHA uint16 = 0x002C cipher_TLS_DHE_PSK_WITH_NULL_SHA uint16 = 0x002D cipher_TLS_RSA_PSK_WITH_NULL_SHA uint16 = 0x002E cipher_TLS_RSA_WITH_AES_128_CBC_SHA uint16 = 0x002F cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA uint16 = 0x0030 cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA uint16 = 0x0031 cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA uint16 = 0x0032 cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0x0033 cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA uint16 = 0x0034 cipher_TLS_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0035 cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA uint16 = 0x0036 cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0037 cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA uint16 = 0x0038 cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0039 cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA uint16 = 0x003A cipher_TLS_RSA_WITH_NULL_SHA256 uint16 = 0x003B cipher_TLS_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x003C cipher_TLS_RSA_WITH_AES_256_CBC_SHA256 uint16 = 0x003D cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA256 uint16 = 0x003E cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x003F cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 uint16 = 0x0040 cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0041 cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0042 cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0043 cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0044 cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0045 cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA uint16 = 0x0046 // Reserved uint16 = 0x0047-4F // Reserved uint16 = 0x0050-58 // Reserved uint16 = 0x0059-5C // Unassigned uint16 = 0x005D-5F // Reserved uint16 = 0x0060-66 cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x0067 cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA256 uint16 = 0x0068 cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA256 uint16 = 0x0069 cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 uint16 = 0x006A cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 uint16 = 0x006B cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA256 uint16 = 0x006C cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA256 uint16 = 0x006D // Unassigned uint16 = 0x006E-83 cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0084 cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0085 cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0086 cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0087 cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0088 cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA uint16 = 0x0089 cipher_TLS_PSK_WITH_RC4_128_SHA uint16 = 0x008A cipher_TLS_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0x008B cipher_TLS_PSK_WITH_AES_128_CBC_SHA uint16 = 0x008C cipher_TLS_PSK_WITH_AES_256_CBC_SHA uint16 = 0x008D cipher_TLS_DHE_PSK_WITH_RC4_128_SHA uint16 = 0x008E cipher_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0x008F cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA uint16 = 0x0090 cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA uint16 = 0x0091 cipher_TLS_RSA_PSK_WITH_RC4_128_SHA uint16 = 0x0092 cipher_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0x0093 cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA uint16 = 0x0094 cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA uint16 = 0x0095 cipher_TLS_RSA_WITH_SEED_CBC_SHA uint16 = 0x0096 cipher_TLS_DH_DSS_WITH_SEED_CBC_SHA uint16 = 0x0097 cipher_TLS_DH_RSA_WITH_SEED_CBC_SHA uint16 = 0x0098 cipher_TLS_DHE_DSS_WITH_SEED_CBC_SHA uint16 = 0x0099 cipher_TLS_DHE_RSA_WITH_SEED_CBC_SHA uint16 = 0x009A cipher_TLS_DH_anon_WITH_SEED_CBC_SHA uint16 = 0x009B cipher_TLS_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x009C cipher_TLS_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x009D cipher_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x009E cipher_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x009F cipher_TLS_DH_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x00A0 cipher_TLS_DH_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x00A1 cipher_TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 uint16 = 0x00A2 cipher_TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 uint16 = 0x00A3 cipher_TLS_DH_DSS_WITH_AES_128_GCM_SHA256 uint16 = 0x00A4 cipher_TLS_DH_DSS_WITH_AES_256_GCM_SHA384 uint16 = 0x00A5 cipher_TLS_DH_anon_WITH_AES_128_GCM_SHA256 uint16 = 0x00A6 cipher_TLS_DH_anon_WITH_AES_256_GCM_SHA384 uint16 = 0x00A7 cipher_TLS_PSK_WITH_AES_128_GCM_SHA256 uint16 = 0x00A8 cipher_TLS_PSK_WITH_AES_256_GCM_SHA384 uint16 = 0x00A9 cipher_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 uint16 = 0x00AA cipher_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 uint16 = 0x00AB cipher_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 uint16 = 0x00AC cipher_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 uint16 = 0x00AD cipher_TLS_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0x00AE cipher_TLS_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0x00AF cipher_TLS_PSK_WITH_NULL_SHA256 uint16 = 0x00B0 cipher_TLS_PSK_WITH_NULL_SHA384 uint16 = 0x00B1 cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0x00B2 cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0x00B3 cipher_TLS_DHE_PSK_WITH_NULL_SHA256 uint16 = 0x00B4 cipher_TLS_DHE_PSK_WITH_NULL_SHA384 uint16 = 0x00B5 cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0x00B6 cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0x00B7 cipher_TLS_RSA_PSK_WITH_NULL_SHA256 uint16 = 0x00B8 cipher_TLS_RSA_PSK_WITH_NULL_SHA384 uint16 = 0x00B9 cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BA cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BB cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BC cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BD cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BE cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0x00BF cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C0 cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C1 cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C2 cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C3 cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C4 cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 uint16 = 0x00C5 // Unassigned uint16 = 0x00C6-FE cipher_TLS_EMPTY_RENEGOTIATION_INFO_SCSV uint16 = 0x00FF // Unassigned uint16 = 0x01-55,* cipher_TLS_FALLBACK_SCSV uint16 = 0x5600 // Unassigned uint16 = 0x5601 - 0xC000 cipher_TLS_ECDH_ECDSA_WITH_NULL_SHA uint16 = 0xC001 cipher_TLS_ECDH_ECDSA_WITH_RC4_128_SHA uint16 = 0xC002 cipher_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC003 cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xC004 cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xC005 cipher_TLS_ECDHE_ECDSA_WITH_NULL_SHA uint16 = 0xC006 cipher_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA uint16 = 0xC007 cipher_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC008 cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xC009 cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xC00A cipher_TLS_ECDH_RSA_WITH_NULL_SHA uint16 = 0xC00B cipher_TLS_ECDH_RSA_WITH_RC4_128_SHA uint16 = 0xC00C cipher_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC00D cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA uint16 = 0xC00E cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA uint16 = 0xC00F cipher_TLS_ECDHE_RSA_WITH_NULL_SHA uint16 = 0xC010 cipher_TLS_ECDHE_RSA_WITH_RC4_128_SHA uint16 = 0xC011 cipher_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC012 cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0xC013 cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0xC014 cipher_TLS_ECDH_anon_WITH_NULL_SHA uint16 = 0xC015 cipher_TLS_ECDH_anon_WITH_RC4_128_SHA uint16 = 0xC016 cipher_TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA uint16 = 0xC017 cipher_TLS_ECDH_anon_WITH_AES_128_CBC_SHA uint16 = 0xC018 cipher_TLS_ECDH_anon_WITH_AES_256_CBC_SHA uint16 = 0xC019 cipher_TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC01A cipher_TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xC01B cipher_TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA uint16 = 0xC01C cipher_TLS_SRP_SHA_WITH_AES_128_CBC_SHA uint16 = 0xC01D cipher_TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA uint16 = 0xC01E cipher_TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA uint16 = 0xC01F cipher_TLS_SRP_SHA_WITH_AES_256_CBC_SHA uint16 = 0xC020 cipher_TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA uint16 = 0xC021 cipher_TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA uint16 = 0xC022 cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC023 cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC024 cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC025 cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC026 cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC027 cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC028 cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0xC029 cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 uint16 = 0xC02A cipher_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC02B cipher_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC02C cipher_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC02D cipher_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC02E cipher_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC02F cipher_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC030 cipher_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xC031 cipher_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0xC032 cipher_TLS_ECDHE_PSK_WITH_RC4_128_SHA uint16 = 0xC033 cipher_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA uint16 = 0xC034 cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA uint16 = 0xC035 cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA uint16 = 0xC036 cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 uint16 = 0xC037 cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 uint16 = 0xC038 cipher_TLS_ECDHE_PSK_WITH_NULL_SHA uint16 = 0xC039 cipher_TLS_ECDHE_PSK_WITH_NULL_SHA256 uint16 = 0xC03A cipher_TLS_ECDHE_PSK_WITH_NULL_SHA384 uint16 = 0xC03B cipher_TLS_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC03C cipher_TLS_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC03D cipher_TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC03E cipher_TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC03F cipher_TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC040 cipher_TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC041 cipher_TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC042 cipher_TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC043 cipher_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC044 cipher_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC045 cipher_TLS_DH_anon_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC046 cipher_TLS_DH_anon_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC047 cipher_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC048 cipher_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC049 cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC04A cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC04B cipher_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC04C cipher_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC04D cipher_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC04E cipher_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC04F cipher_TLS_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC050 cipher_TLS_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC051 cipher_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC052 cipher_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC053 cipher_TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC054 cipher_TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC055 cipher_TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC056 cipher_TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC057 cipher_TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC058 cipher_TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC059 cipher_TLS_DH_anon_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC05A cipher_TLS_DH_anon_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC05B cipher_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC05C cipher_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC05D cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC05E cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC05F cipher_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC060 cipher_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC061 cipher_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC062 cipher_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC063 cipher_TLS_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC064 cipher_TLS_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC065 cipher_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC066 cipher_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC067 cipher_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC068 cipher_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC069 cipher_TLS_PSK_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC06A cipher_TLS_PSK_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC06B cipher_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC06C cipher_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC06D cipher_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 uint16 = 0xC06E cipher_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 uint16 = 0xC06F cipher_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 uint16 = 0xC070 cipher_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 uint16 = 0xC071 cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC072 cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC073 cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC074 cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC075 cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC076 cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC077 cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC078 cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC079 cipher_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC07A cipher_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC07B cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC07C cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC07D cipher_TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC07E cipher_TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC07F cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC080 cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC081 cipher_TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC082 cipher_TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC083 cipher_TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC084 cipher_TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC085 cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC086 cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC087 cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC088 cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC089 cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC08A cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC08B cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC08C cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC08D cipher_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC08E cipher_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC08F cipher_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC090 cipher_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC091 cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 uint16 = 0xC092 cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 uint16 = 0xC093 cipher_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC094 cipher_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC095 cipher_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC096 cipher_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC097 cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC098 cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC099 cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 uint16 = 0xC09A cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 uint16 = 0xC09B cipher_TLS_RSA_WITH_AES_128_CCM uint16 = 0xC09C cipher_TLS_RSA_WITH_AES_256_CCM uint16 = 0xC09D cipher_TLS_DHE_RSA_WITH_AES_128_CCM uint16 = 0xC09E cipher_TLS_DHE_RSA_WITH_AES_256_CCM uint16 = 0xC09F cipher_TLS_RSA_WITH_AES_128_CCM_8 uint16 = 0xC0A0 cipher_TLS_RSA_WITH_AES_256_CCM_8 uint16 = 0xC0A1 cipher_TLS_DHE_RSA_WITH_AES_128_CCM_8 uint16 = 0xC0A2 cipher_TLS_DHE_RSA_WITH_AES_256_CCM_8 uint16 = 0xC0A3 cipher_TLS_PSK_WITH_AES_128_CCM uint16 = 0xC0A4 cipher_TLS_PSK_WITH_AES_256_CCM uint16 = 0xC0A5 cipher_TLS_DHE_PSK_WITH_AES_128_CCM uint16 = 0xC0A6 cipher_TLS_DHE_PSK_WITH_AES_256_CCM uint16 = 0xC0A7 cipher_TLS_PSK_WITH_AES_128_CCM_8 uint16 = 0xC0A8 cipher_TLS_PSK_WITH_AES_256_CCM_8 uint16 = 0xC0A9 cipher_TLS_PSK_DHE_WITH_AES_128_CCM_8 uint16 = 0xC0AA cipher_TLS_PSK_DHE_WITH_AES_256_CCM_8 uint16 = 0xC0AB cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CCM uint16 = 0xC0AC cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CCM uint16 = 0xC0AD cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 uint16 = 0xC0AE cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 uint16 = 0xC0AF // Unassigned uint16 = 0xC0B0-FF // Unassigned uint16 = 0xC1-CB,* // Unassigned uint16 = 0xCC00-A7 cipher_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCA8 cipher_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCA9 cipher_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAA cipher_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAB cipher_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAC cipher_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAD cipher_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 uint16 = 0xCCAE ) // isBadCipher reports whether the cipher is blacklisted by the HTTP/2 spec. // References: // https://tools.ietf.org/html/rfc7540#appendix-A // Reject cipher suites from Appendix A. // "This list includes those cipher suites that do not // offer an ephemeral key exchange and those that are // based on the TLS null, stream or block cipher type" func isBadCipher(cipher uint16) bool { switch cipher { case cipher_TLS_NULL_WITH_NULL_NULL, cipher_TLS_RSA_WITH_NULL_MD5, cipher_TLS_RSA_WITH_NULL_SHA, cipher_TLS_RSA_EXPORT_WITH_RC4_40_MD5, cipher_TLS_RSA_WITH_RC4_128_MD5, cipher_TLS_RSA_WITH_RC4_128_SHA, cipher_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5, cipher_TLS_RSA_WITH_IDEA_CBC_SHA, cipher_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_RSA_WITH_DES_CBC_SHA, cipher_TLS_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_DH_DSS_WITH_DES_CBC_SHA, cipher_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_DH_RSA_WITH_DES_CBC_SHA, cipher_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_DHE_DSS_WITH_DES_CBC_SHA, cipher_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_DHE_RSA_WITH_DES_CBC_SHA, cipher_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5, cipher_TLS_DH_anon_WITH_RC4_128_MD5, cipher_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA, cipher_TLS_DH_anon_WITH_DES_CBC_SHA, cipher_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA, cipher_TLS_KRB5_WITH_DES_CBC_SHA, cipher_TLS_KRB5_WITH_3DES_EDE_CBC_SHA, cipher_TLS_KRB5_WITH_RC4_128_SHA, cipher_TLS_KRB5_WITH_IDEA_CBC_SHA, cipher_TLS_KRB5_WITH_DES_CBC_MD5, cipher_TLS_KRB5_WITH_3DES_EDE_CBC_MD5, cipher_TLS_KRB5_WITH_RC4_128_MD5, cipher_TLS_KRB5_WITH_IDEA_CBC_MD5, cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA, cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA, cipher_TLS_KRB5_EXPORT_WITH_RC4_40_SHA, cipher_TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5, cipher_TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5, cipher_TLS_KRB5_EXPORT_WITH_RC4_40_MD5, cipher_TLS_PSK_WITH_NULL_SHA, cipher_TLS_DHE_PSK_WITH_NULL_SHA, cipher_TLS_RSA_PSK_WITH_NULL_SHA, cipher_TLS_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA, cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA, cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA, cipher_TLS_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA, cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA, cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA, cipher_TLS_RSA_WITH_NULL_SHA256, cipher_TLS_RSA_WITH_AES_128_CBC_SHA256, cipher_TLS_RSA_WITH_AES_256_CBC_SHA256, cipher_TLS_DH_DSS_WITH_AES_128_CBC_SHA256, cipher_TLS_DH_RSA_WITH_AES_128_CBC_SHA256, cipher_TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA, cipher_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, cipher_TLS_DH_DSS_WITH_AES_256_CBC_SHA256, cipher_TLS_DH_RSA_WITH_AES_256_CBC_SHA256, cipher_TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, cipher_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, cipher_TLS_DH_anon_WITH_AES_128_CBC_SHA256, cipher_TLS_DH_anon_WITH_AES_256_CBC_SHA256, cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA, cipher_TLS_PSK_WITH_RC4_128_SHA, cipher_TLS_PSK_WITH_3DES_EDE_CBC_SHA, cipher_TLS_PSK_WITH_AES_128_CBC_SHA, cipher_TLS_PSK_WITH_AES_256_CBC_SHA, cipher_TLS_DHE_PSK_WITH_RC4_128_SHA, cipher_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA, cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA, cipher_TLS_RSA_PSK_WITH_RC4_128_SHA, cipher_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA, cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA, cipher_TLS_RSA_WITH_SEED_CBC_SHA, cipher_TLS_DH_DSS_WITH_SEED_CBC_SHA, cipher_TLS_DH_RSA_WITH_SEED_CBC_SHA, cipher_TLS_DHE_DSS_WITH_SEED_CBC_SHA, cipher_TLS_DHE_RSA_WITH_SEED_CBC_SHA, cipher_TLS_DH_anon_WITH_SEED_CBC_SHA, cipher_TLS_RSA_WITH_AES_128_GCM_SHA256, cipher_TLS_RSA_WITH_AES_256_GCM_SHA384, cipher_TLS_DH_RSA_WITH_AES_128_GCM_SHA256, cipher_TLS_DH_RSA_WITH_AES_256_GCM_SHA384, cipher_TLS_DH_DSS_WITH_AES_128_GCM_SHA256, cipher_TLS_DH_DSS_WITH_AES_256_GCM_SHA384, cipher_TLS_DH_anon_WITH_AES_128_GCM_SHA256, cipher_TLS_DH_anon_WITH_AES_256_GCM_SHA384, cipher_TLS_PSK_WITH_AES_128_GCM_SHA256, cipher_TLS_PSK_WITH_AES_256_GCM_SHA384, cipher_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256, cipher_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384, cipher_TLS_PSK_WITH_AES_128_CBC_SHA256, cipher_TLS_PSK_WITH_AES_256_CBC_SHA384, cipher_TLS_PSK_WITH_NULL_SHA256, cipher_TLS_PSK_WITH_NULL_SHA384, cipher_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, cipher_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384, cipher_TLS_DHE_PSK_WITH_NULL_SHA256, cipher_TLS_DHE_PSK_WITH_NULL_SHA384, cipher_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256, cipher_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384, cipher_TLS_RSA_PSK_WITH_NULL_SHA256, cipher_TLS_RSA_PSK_WITH_NULL_SHA384, cipher_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256, cipher_TLS_EMPTY_RENEGOTIATION_INFO_SCSV, cipher_TLS_ECDH_ECDSA_WITH_NULL_SHA, cipher_TLS_ECDH_ECDSA_WITH_RC4_128_SHA, cipher_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, cipher_TLS_ECDHE_ECDSA_WITH_NULL_SHA, cipher_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, cipher_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, cipher_TLS_ECDH_RSA_WITH_NULL_SHA, cipher_TLS_ECDH_RSA_WITH_RC4_128_SHA, cipher_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_ECDHE_RSA_WITH_NULL_SHA, cipher_TLS_ECDHE_RSA_WITH_RC4_128_SHA, cipher_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_ECDH_anon_WITH_NULL_SHA, cipher_TLS_ECDH_anon_WITH_RC4_128_SHA, cipher_TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDH_anon_WITH_AES_128_CBC_SHA, cipher_TLS_ECDH_anon_WITH_AES_256_CBC_SHA, cipher_TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA, cipher_TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA, cipher_TLS_SRP_SHA_WITH_AES_128_CBC_SHA, cipher_TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA, cipher_TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA, cipher_TLS_SRP_SHA_WITH_AES_256_CBC_SHA, cipher_TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA, cipher_TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA, cipher_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, cipher_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, cipher_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, cipher_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, cipher_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, cipher_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, cipher_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, cipher_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, cipher_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, cipher_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, cipher_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, cipher_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, cipher_TLS_ECDHE_PSK_WITH_RC4_128_SHA, cipher_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA, cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA, cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA, cipher_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256, cipher_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384, cipher_TLS_ECDHE_PSK_WITH_NULL_SHA, cipher_TLS_ECDHE_PSK_WITH_NULL_SHA256, cipher_TLS_ECDHE_PSK_WITH_NULL_SHA384, cipher_TLS_RSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_RSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DH_anon_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DH_anon_WITH_ARIA_256_CBC_SHA384, cipher_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256, cipher_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384, cipher_TLS_RSA_WITH_ARIA_128_GCM_SHA256, cipher_TLS_RSA_WITH_ARIA_256_GCM_SHA384, cipher_TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256, cipher_TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384, cipher_TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256, cipher_TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384, cipher_TLS_DH_anon_WITH_ARIA_128_GCM_SHA256, cipher_TLS_DH_anon_WITH_ARIA_256_GCM_SHA384, cipher_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256, cipher_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384, cipher_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256, cipher_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384, cipher_TLS_PSK_WITH_ARIA_128_CBC_SHA256, cipher_TLS_PSK_WITH_ARIA_256_CBC_SHA384, cipher_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256, cipher_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384, cipher_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256, cipher_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384, cipher_TLS_PSK_WITH_ARIA_128_GCM_SHA256, cipher_TLS_PSK_WITH_ARIA_256_GCM_SHA384, cipher_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256, cipher_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384, cipher_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256, cipher_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384, cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256, cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384, cipher_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256, cipher_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384, cipher_TLS_RSA_WITH_AES_128_CCM, cipher_TLS_RSA_WITH_AES_256_CCM, cipher_TLS_RSA_WITH_AES_128_CCM_8, cipher_TLS_RSA_WITH_AES_256_CCM_8, cipher_TLS_PSK_WITH_AES_128_CCM, cipher_TLS_PSK_WITH_AES_256_CCM, cipher_TLS_PSK_WITH_AES_128_CCM_8, cipher_TLS_PSK_WITH_AES_256_CCM_8: return true default: return false } } ================================================ FILE: vendor/golang.org/x/net/http2/client_conn_pool.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Transport code's client connection pooling. package http2 import ( "crypto/tls" "net/http" "sync" ) // ClientConnPool manages a pool of HTTP/2 client connections. type ClientConnPool interface { GetClientConn(req *http.Request, addr string) (*ClientConn, error) MarkDead(*ClientConn) } // clientConnPoolIdleCloser is the interface implemented by ClientConnPool // implementations which can close their idle connections. type clientConnPoolIdleCloser interface { ClientConnPool closeIdleConnections() } var ( _ clientConnPoolIdleCloser = (*clientConnPool)(nil) _ clientConnPoolIdleCloser = noDialClientConnPool{} ) // TODO: use singleflight for dialing and addConnCalls? type clientConnPool struct { t *Transport mu sync.Mutex // TODO: maybe switch to RWMutex // TODO: add support for sharing conns based on cert names // (e.g. share conn for googleapis.com and appspot.com) conns map[string][]*ClientConn // key is host:port dialing map[string]*dialCall // currently in-flight dials keys map[*ClientConn][]string addConnCalls map[string]*addConnCall // in-flight addConnIfNeede calls } func (p *clientConnPool) GetClientConn(req *http.Request, addr string) (*ClientConn, error) { return p.getClientConn(req, addr, dialOnMiss) } const ( dialOnMiss = true noDialOnMiss = false ) // shouldTraceGetConn reports whether getClientConn should call any // ClientTrace.GetConn hook associated with the http.Request. // // This complexity is needed to avoid double calls of the GetConn hook // during the back-and-forth between net/http and x/net/http2 (when the // net/http.Transport is upgraded to also speak http2), as well as support // the case where x/net/http2 is being used directly. func (p *clientConnPool) shouldTraceGetConn(st clientConnIdleState) bool { // If our Transport wasn't made via ConfigureTransport, always // trace the GetConn hook if provided, because that means the // http2 package is being used directly and it's the one // dialing, as opposed to net/http. if _, ok := p.t.ConnPool.(noDialClientConnPool); !ok { return true } // Otherwise, only use the GetConn hook if this connection has // been used previously for other requests. For fresh // connections, the net/http package does the dialing. return !st.freshConn } func (p *clientConnPool) getClientConn(req *http.Request, addr string, dialOnMiss bool) (*ClientConn, error) { if isConnectionCloseRequest(req) && dialOnMiss { // It gets its own connection. traceGetConn(req, addr) const singleUse = true cc, err := p.t.dialClientConn(addr, singleUse) if err != nil { return nil, err } return cc, nil } p.mu.Lock() for _, cc := range p.conns[addr] { if st := cc.idleState(); st.canTakeNewRequest { if p.shouldTraceGetConn(st) { traceGetConn(req, addr) } p.mu.Unlock() return cc, nil } } if !dialOnMiss { p.mu.Unlock() return nil, ErrNoCachedConn } traceGetConn(req, addr) call := p.getStartDialLocked(addr) p.mu.Unlock() <-call.done return call.res, call.err } // dialCall is an in-flight Transport dial call to a host. type dialCall struct { p *clientConnPool done chan struct{} // closed when done res *ClientConn // valid after done is closed err error // valid after done is closed } // requires p.mu is held. func (p *clientConnPool) getStartDialLocked(addr string) *dialCall { if call, ok := p.dialing[addr]; ok { // A dial is already in-flight. Don't start another. return call } call := &dialCall{p: p, done: make(chan struct{})} if p.dialing == nil { p.dialing = make(map[string]*dialCall) } p.dialing[addr] = call go call.dial(addr) return call } // run in its own goroutine. func (c *dialCall) dial(addr string) { const singleUse = false // shared conn c.res, c.err = c.p.t.dialClientConn(addr, singleUse) close(c.done) c.p.mu.Lock() delete(c.p.dialing, addr) if c.err == nil { c.p.addConnLocked(addr, c.res) } c.p.mu.Unlock() } // addConnIfNeeded makes a NewClientConn out of c if a connection for key doesn't // already exist. It coalesces concurrent calls with the same key. // This is used by the http1 Transport code when it creates a new connection. Because // the http1 Transport doesn't de-dup TCP dials to outbound hosts (because it doesn't know // the protocol), it can get into a situation where it has multiple TLS connections. // This code decides which ones live or die. // The return value used is whether c was used. // c is never closed. func (p *clientConnPool) addConnIfNeeded(key string, t *Transport, c *tls.Conn) (used bool, err error) { p.mu.Lock() for _, cc := range p.conns[key] { if cc.CanTakeNewRequest() { p.mu.Unlock() return false, nil } } call, dup := p.addConnCalls[key] if !dup { if p.addConnCalls == nil { p.addConnCalls = make(map[string]*addConnCall) } call = &addConnCall{ p: p, done: make(chan struct{}), } p.addConnCalls[key] = call go call.run(t, key, c) } p.mu.Unlock() <-call.done if call.err != nil { return false, call.err } return !dup, nil } type addConnCall struct { p *clientConnPool done chan struct{} // closed when done err error } func (c *addConnCall) run(t *Transport, key string, tc *tls.Conn) { cc, err := t.NewClientConn(tc) p := c.p p.mu.Lock() if err != nil { c.err = err } else { p.addConnLocked(key, cc) } delete(p.addConnCalls, key) p.mu.Unlock() close(c.done) } func (p *clientConnPool) addConn(key string, cc *ClientConn) { p.mu.Lock() p.addConnLocked(key, cc) p.mu.Unlock() } // p.mu must be held func (p *clientConnPool) addConnLocked(key string, cc *ClientConn) { for _, v := range p.conns[key] { if v == cc { return } } if p.conns == nil { p.conns = make(map[string][]*ClientConn) } if p.keys == nil { p.keys = make(map[*ClientConn][]string) } p.conns[key] = append(p.conns[key], cc) p.keys[cc] = append(p.keys[cc], key) } func (p *clientConnPool) MarkDead(cc *ClientConn) { p.mu.Lock() defer p.mu.Unlock() for _, key := range p.keys[cc] { vv, ok := p.conns[key] if !ok { continue } newList := filterOutClientConn(vv, cc) if len(newList) > 0 { p.conns[key] = newList } else { delete(p.conns, key) } } delete(p.keys, cc) } func (p *clientConnPool) closeIdleConnections() { p.mu.Lock() defer p.mu.Unlock() // TODO: don't close a cc if it was just added to the pool // milliseconds ago and has never been used. There's currently // a small race window with the HTTP/1 Transport's integration // where it can add an idle conn just before using it, and // somebody else can concurrently call CloseIdleConns and // break some caller's RoundTrip. for _, vv := range p.conns { for _, cc := range vv { cc.closeIfIdle() } } } func filterOutClientConn(in []*ClientConn, exclude *ClientConn) []*ClientConn { out := in[:0] for _, v := range in { if v != exclude { out = append(out, v) } } // If we filtered it out, zero out the last item to prevent // the GC from seeing it. if len(in) != len(out) { in[len(in)-1] = nil } return out } // noDialClientConnPool is an implementation of http2.ClientConnPool // which never dials. We let the HTTP/1.1 client dial and use its TLS // connection instead. type noDialClientConnPool struct{ *clientConnPool } func (p noDialClientConnPool) GetClientConn(req *http.Request, addr string) (*ClientConn, error) { return p.getClientConn(req, addr, noDialOnMiss) } ================================================ FILE: vendor/golang.org/x/net/http2/databuffer.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "errors" "fmt" "sync" ) // Buffer chunks are allocated from a pool to reduce pressure on GC. // The maximum wasted space per dataBuffer is 2x the largest size class, // which happens when the dataBuffer has multiple chunks and there is // one unread byte in both the first and last chunks. We use a few size // classes to minimize overheads for servers that typically receive very // small request bodies. // // TODO: Benchmark to determine if the pools are necessary. The GC may have // improved enough that we can instead allocate chunks like this: // make([]byte, max(16<<10, expectedBytesRemaining)) var ( dataChunkSizeClasses = []int{ 1 << 10, 2 << 10, 4 << 10, 8 << 10, 16 << 10, } dataChunkPools = [...]sync.Pool{ {New: func() interface{} { return make([]byte, 1<<10) }}, {New: func() interface{} { return make([]byte, 2<<10) }}, {New: func() interface{} { return make([]byte, 4<<10) }}, {New: func() interface{} { return make([]byte, 8<<10) }}, {New: func() interface{} { return make([]byte, 16<<10) }}, } ) func getDataBufferChunk(size int64) []byte { i := 0 for ; i < len(dataChunkSizeClasses)-1; i++ { if size <= int64(dataChunkSizeClasses[i]) { break } } return dataChunkPools[i].Get().([]byte) } func putDataBufferChunk(p []byte) { for i, n := range dataChunkSizeClasses { if len(p) == n { dataChunkPools[i].Put(p) return } } panic(fmt.Sprintf("unexpected buffer len=%v", len(p))) } // dataBuffer is an io.ReadWriter backed by a list of data chunks. // Each dataBuffer is used to read DATA frames on a single stream. // The buffer is divided into chunks so the server can limit the // total memory used by a single connection without limiting the // request body size on any single stream. type dataBuffer struct { chunks [][]byte r int // next byte to read is chunks[0][r] w int // next byte to write is chunks[len(chunks)-1][w] size int // total buffered bytes expected int64 // we expect at least this many bytes in future Write calls (ignored if <= 0) } var errReadEmpty = errors.New("read from empty dataBuffer") // Read copies bytes from the buffer into p. // It is an error to read when no data is available. func (b *dataBuffer) Read(p []byte) (int, error) { if b.size == 0 { return 0, errReadEmpty } var ntotal int for len(p) > 0 && b.size > 0 { readFrom := b.bytesFromFirstChunk() n := copy(p, readFrom) p = p[n:] ntotal += n b.r += n b.size -= n // If the first chunk has been consumed, advance to the next chunk. if b.r == len(b.chunks[0]) { putDataBufferChunk(b.chunks[0]) end := len(b.chunks) - 1 copy(b.chunks[:end], b.chunks[1:]) b.chunks[end] = nil b.chunks = b.chunks[:end] b.r = 0 } } return ntotal, nil } func (b *dataBuffer) bytesFromFirstChunk() []byte { if len(b.chunks) == 1 { return b.chunks[0][b.r:b.w] } return b.chunks[0][b.r:] } // Len returns the number of bytes of the unread portion of the buffer. func (b *dataBuffer) Len() int { return b.size } // Write appends p to the buffer. func (b *dataBuffer) Write(p []byte) (int, error) { ntotal := len(p) for len(p) > 0 { // If the last chunk is empty, allocate a new chunk. Try to allocate // enough to fully copy p plus any additional bytes we expect to // receive. However, this may allocate less than len(p). want := int64(len(p)) if b.expected > want { want = b.expected } chunk := b.lastChunkOrAlloc(want) n := copy(chunk[b.w:], p) p = p[n:] b.w += n b.size += n b.expected -= int64(n) } return ntotal, nil } func (b *dataBuffer) lastChunkOrAlloc(want int64) []byte { if len(b.chunks) != 0 { last := b.chunks[len(b.chunks)-1] if b.w < len(last) { return last } } chunk := getDataBufferChunk(want) b.chunks = append(b.chunks, chunk) b.w = 0 return chunk } ================================================ FILE: vendor/golang.org/x/net/http2/errors.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "errors" "fmt" ) // An ErrCode is an unsigned 32-bit error code as defined in the HTTP/2 spec. type ErrCode uint32 const ( ErrCodeNo ErrCode = 0x0 ErrCodeProtocol ErrCode = 0x1 ErrCodeInternal ErrCode = 0x2 ErrCodeFlowControl ErrCode = 0x3 ErrCodeSettingsTimeout ErrCode = 0x4 ErrCodeStreamClosed ErrCode = 0x5 ErrCodeFrameSize ErrCode = 0x6 ErrCodeRefusedStream ErrCode = 0x7 ErrCodeCancel ErrCode = 0x8 ErrCodeCompression ErrCode = 0x9 ErrCodeConnect ErrCode = 0xa ErrCodeEnhanceYourCalm ErrCode = 0xb ErrCodeInadequateSecurity ErrCode = 0xc ErrCodeHTTP11Required ErrCode = 0xd ) var errCodeName = map[ErrCode]string{ ErrCodeNo: "NO_ERROR", ErrCodeProtocol: "PROTOCOL_ERROR", ErrCodeInternal: "INTERNAL_ERROR", ErrCodeFlowControl: "FLOW_CONTROL_ERROR", ErrCodeSettingsTimeout: "SETTINGS_TIMEOUT", ErrCodeStreamClosed: "STREAM_CLOSED", ErrCodeFrameSize: "FRAME_SIZE_ERROR", ErrCodeRefusedStream: "REFUSED_STREAM", ErrCodeCancel: "CANCEL", ErrCodeCompression: "COMPRESSION_ERROR", ErrCodeConnect: "CONNECT_ERROR", ErrCodeEnhanceYourCalm: "ENHANCE_YOUR_CALM", ErrCodeInadequateSecurity: "INADEQUATE_SECURITY", ErrCodeHTTP11Required: "HTTP_1_1_REQUIRED", } func (e ErrCode) String() string { if s, ok := errCodeName[e]; ok { return s } return fmt.Sprintf("unknown error code 0x%x", uint32(e)) } // ConnectionError is an error that results in the termination of the // entire connection. type ConnectionError ErrCode func (e ConnectionError) Error() string { return fmt.Sprintf("connection error: %s", ErrCode(e)) } // StreamError is an error that only affects one stream within an // HTTP/2 connection. type StreamError struct { StreamID uint32 Code ErrCode Cause error // optional additional detail } func streamError(id uint32, code ErrCode) StreamError { return StreamError{StreamID: id, Code: code} } func (e StreamError) Error() string { if e.Cause != nil { return fmt.Sprintf("stream error: stream ID %d; %v; %v", e.StreamID, e.Code, e.Cause) } return fmt.Sprintf("stream error: stream ID %d; %v", e.StreamID, e.Code) } // 6.9.1 The Flow Control Window // "If a sender receives a WINDOW_UPDATE that causes a flow control // window to exceed this maximum it MUST terminate either the stream // or the connection, as appropriate. For streams, [...]; for the // connection, a GOAWAY frame with a FLOW_CONTROL_ERROR code." type goAwayFlowError struct{} func (goAwayFlowError) Error() string { return "connection exceeded flow control window size" } // connError represents an HTTP/2 ConnectionError error code, along // with a string (for debugging) explaining why. // // Errors of this type are only returned by the frame parser functions // and converted into ConnectionError(Code), after stashing away // the Reason into the Framer's errDetail field, accessible via // the (*Framer).ErrorDetail method. type connError struct { Code ErrCode // the ConnectionError error code Reason string // additional reason } func (e connError) Error() string { return fmt.Sprintf("http2: connection error: %v: %v", e.Code, e.Reason) } type pseudoHeaderError string func (e pseudoHeaderError) Error() string { return fmt.Sprintf("invalid pseudo-header %q", string(e)) } type duplicatePseudoHeaderError string func (e duplicatePseudoHeaderError) Error() string { return fmt.Sprintf("duplicate pseudo-header %q", string(e)) } type headerFieldNameError string func (e headerFieldNameError) Error() string { return fmt.Sprintf("invalid header field name %q", string(e)) } type headerFieldValueError string func (e headerFieldValueError) Error() string { return fmt.Sprintf("invalid header field value %q", string(e)) } var ( errMixPseudoHeaderTypes = errors.New("mix of request and response pseudo headers") errPseudoAfterRegular = errors.New("pseudo header field after regular") ) ================================================ FILE: vendor/golang.org/x/net/http2/flow.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Flow control package http2 // flow is the flow control window's size. type flow struct { // n is the number of DATA bytes we're allowed to send. // A flow is kept both on a conn and a per-stream. n int32 // conn points to the shared connection-level flow that is // shared by all streams on that conn. It is nil for the flow // that's on the conn directly. conn *flow } func (f *flow) setConnFlow(cf *flow) { f.conn = cf } func (f *flow) available() int32 { n := f.n if f.conn != nil && f.conn.n < n { n = f.conn.n } return n } func (f *flow) take(n int32) { if n > f.available() { panic("internal error: took too much") } f.n -= n if f.conn != nil { f.conn.n -= n } } // add adds n bytes (positive or negative) to the flow control window. // It returns false if the sum would exceed 2^31-1. func (f *flow) add(n int32) bool { sum := f.n + n if (sum > n) == (f.n > 0) { f.n = sum return true } return false } ================================================ FILE: vendor/golang.org/x/net/http2/frame.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "bytes" "encoding/binary" "errors" "fmt" "io" "log" "strings" "sync" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" ) const frameHeaderLen = 9 var padZeros = make([]byte, 255) // zeros for padding // A FrameType is a registered frame type as defined in // http://http2.github.io/http2-spec/#rfc.section.11.2 type FrameType uint8 const ( FrameData FrameType = 0x0 FrameHeaders FrameType = 0x1 FramePriority FrameType = 0x2 FrameRSTStream FrameType = 0x3 FrameSettings FrameType = 0x4 FramePushPromise FrameType = 0x5 FramePing FrameType = 0x6 FrameGoAway FrameType = 0x7 FrameWindowUpdate FrameType = 0x8 FrameContinuation FrameType = 0x9 ) var frameName = map[FrameType]string{ FrameData: "DATA", FrameHeaders: "HEADERS", FramePriority: "PRIORITY", FrameRSTStream: "RST_STREAM", FrameSettings: "SETTINGS", FramePushPromise: "PUSH_PROMISE", FramePing: "PING", FrameGoAway: "GOAWAY", FrameWindowUpdate: "WINDOW_UPDATE", FrameContinuation: "CONTINUATION", } func (t FrameType) String() string { if s, ok := frameName[t]; ok { return s } return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", uint8(t)) } // Flags is a bitmask of HTTP/2 flags. // The meaning of flags varies depending on the frame type. type Flags uint8 // Has reports whether f contains all (0 or more) flags in v. func (f Flags) Has(v Flags) bool { return (f & v) == v } // Frame-specific FrameHeader flag bits. const ( // Data Frame FlagDataEndStream Flags = 0x1 FlagDataPadded Flags = 0x8 // Headers Frame FlagHeadersEndStream Flags = 0x1 FlagHeadersEndHeaders Flags = 0x4 FlagHeadersPadded Flags = 0x8 FlagHeadersPriority Flags = 0x20 // Settings Frame FlagSettingsAck Flags = 0x1 // Ping Frame FlagPingAck Flags = 0x1 // Continuation Frame FlagContinuationEndHeaders Flags = 0x4 FlagPushPromiseEndHeaders Flags = 0x4 FlagPushPromisePadded Flags = 0x8 ) var flagName = map[FrameType]map[Flags]string{ FrameData: { FlagDataEndStream: "END_STREAM", FlagDataPadded: "PADDED", }, FrameHeaders: { FlagHeadersEndStream: "END_STREAM", FlagHeadersEndHeaders: "END_HEADERS", FlagHeadersPadded: "PADDED", FlagHeadersPriority: "PRIORITY", }, FrameSettings: { FlagSettingsAck: "ACK", }, FramePing: { FlagPingAck: "ACK", }, FrameContinuation: { FlagContinuationEndHeaders: "END_HEADERS", }, FramePushPromise: { FlagPushPromiseEndHeaders: "END_HEADERS", FlagPushPromisePadded: "PADDED", }, } // a frameParser parses a frame given its FrameHeader and payload // bytes. The length of payload will always equal fh.Length (which // might be 0). type frameParser func(fc *frameCache, fh FrameHeader, payload []byte) (Frame, error) var frameParsers = map[FrameType]frameParser{ FrameData: parseDataFrame, FrameHeaders: parseHeadersFrame, FramePriority: parsePriorityFrame, FrameRSTStream: parseRSTStreamFrame, FrameSettings: parseSettingsFrame, FramePushPromise: parsePushPromise, FramePing: parsePingFrame, FrameGoAway: parseGoAwayFrame, FrameWindowUpdate: parseWindowUpdateFrame, FrameContinuation: parseContinuationFrame, } func typeFrameParser(t FrameType) frameParser { if f := frameParsers[t]; f != nil { return f } return parseUnknownFrame } // A FrameHeader is the 9 byte header of all HTTP/2 frames. // // See http://http2.github.io/http2-spec/#FrameHeader type FrameHeader struct { valid bool // caller can access []byte fields in the Frame // Type is the 1 byte frame type. There are ten standard frame // types, but extension frame types may be written by WriteRawFrame // and will be returned by ReadFrame (as UnknownFrame). Type FrameType // Flags are the 1 byte of 8 potential bit flags per frame. // They are specific to the frame type. Flags Flags // Length is the length of the frame, not including the 9 byte header. // The maximum size is one byte less than 16MB (uint24), but only // frames up to 16KB are allowed without peer agreement. Length uint32 // StreamID is which stream this frame is for. Certain frames // are not stream-specific, in which case this field is 0. StreamID uint32 } // Header returns h. It exists so FrameHeaders can be embedded in other // specific frame types and implement the Frame interface. func (h FrameHeader) Header() FrameHeader { return h } func (h FrameHeader) String() string { var buf bytes.Buffer buf.WriteString("[FrameHeader ") h.writeDebug(&buf) buf.WriteByte(']') return buf.String() } func (h FrameHeader) writeDebug(buf *bytes.Buffer) { buf.WriteString(h.Type.String()) if h.Flags != 0 { buf.WriteString(" flags=") set := 0 for i := uint8(0); i < 8; i++ { if h.Flags&(1< 1 { buf.WriteByte('|') } name := flagName[h.Type][Flags(1<>24), byte(streamID>>16), byte(streamID>>8), byte(streamID)) } func (f *Framer) endWrite() error { // Now that we know the final size, fill in the FrameHeader in // the space previously reserved for it. Abuse append. length := len(f.wbuf) - frameHeaderLen if length >= (1 << 24) { return ErrFrameTooLarge } _ = append(f.wbuf[:0], byte(length>>16), byte(length>>8), byte(length)) if f.logWrites { f.logWrite() } n, err := f.w.Write(f.wbuf) if err == nil && n != len(f.wbuf) { err = io.ErrShortWrite } return err } func (f *Framer) logWrite() { if f.debugFramer == nil { f.debugFramerBuf = new(bytes.Buffer) f.debugFramer = NewFramer(nil, f.debugFramerBuf) f.debugFramer.logReads = false // we log it ourselves, saying "wrote" below // Let us read anything, even if we accidentally wrote it // in the wrong order: f.debugFramer.AllowIllegalReads = true } f.debugFramerBuf.Write(f.wbuf) fr, err := f.debugFramer.ReadFrame() if err != nil { f.debugWriteLoggerf("http2: Framer %p: failed to decode just-written frame", f) return } f.debugWriteLoggerf("http2: Framer %p: wrote %v", f, summarizeFrame(fr)) } func (f *Framer) writeByte(v byte) { f.wbuf = append(f.wbuf, v) } func (f *Framer) writeBytes(v []byte) { f.wbuf = append(f.wbuf, v...) } func (f *Framer) writeUint16(v uint16) { f.wbuf = append(f.wbuf, byte(v>>8), byte(v)) } func (f *Framer) writeUint32(v uint32) { f.wbuf = append(f.wbuf, byte(v>>24), byte(v>>16), byte(v>>8), byte(v)) } const ( minMaxFrameSize = 1 << 14 maxFrameSize = 1<<24 - 1 ) // SetReuseFrames allows the Framer to reuse Frames. // If called on a Framer, Frames returned by calls to ReadFrame are only // valid until the next call to ReadFrame. func (fr *Framer) SetReuseFrames() { if fr.frameCache != nil { return } fr.frameCache = &frameCache{} } type frameCache struct { dataFrame DataFrame } func (fc *frameCache) getDataFrame() *DataFrame { if fc == nil { return &DataFrame{} } return &fc.dataFrame } // NewFramer returns a Framer that writes frames to w and reads them from r. func NewFramer(w io.Writer, r io.Reader) *Framer { fr := &Framer{ w: w, r: r, logReads: logFrameReads, logWrites: logFrameWrites, debugReadLoggerf: log.Printf, debugWriteLoggerf: log.Printf, } fr.getReadBuf = func(size uint32) []byte { if cap(fr.readBuf) >= int(size) { return fr.readBuf[:size] } fr.readBuf = make([]byte, size) return fr.readBuf } fr.SetMaxReadFrameSize(maxFrameSize) return fr } // SetMaxReadFrameSize sets the maximum size of a frame // that will be read by a subsequent call to ReadFrame. // It is the caller's responsibility to advertise this // limit with a SETTINGS frame. func (fr *Framer) SetMaxReadFrameSize(v uint32) { if v > maxFrameSize { v = maxFrameSize } fr.maxReadSize = v } // ErrorDetail returns a more detailed error of the last error // returned by Framer.ReadFrame. For instance, if ReadFrame // returns a StreamError with code PROTOCOL_ERROR, ErrorDetail // will say exactly what was invalid. ErrorDetail is not guaranteed // to return a non-nil value and like the rest of the http2 package, // its return value is not protected by an API compatibility promise. // ErrorDetail is reset after the next call to ReadFrame. func (fr *Framer) ErrorDetail() error { return fr.errDetail } // ErrFrameTooLarge is returned from Framer.ReadFrame when the peer // sends a frame that is larger than declared with SetMaxReadFrameSize. var ErrFrameTooLarge = errors.New("http2: frame too large") // terminalReadFrameError reports whether err is an unrecoverable // error from ReadFrame and no other frames should be read. func terminalReadFrameError(err error) bool { if _, ok := err.(StreamError); ok { return false } return err != nil } // ReadFrame reads a single frame. The returned Frame is only valid // until the next call to ReadFrame. // // If the frame is larger than previously set with SetMaxReadFrameSize, the // returned error is ErrFrameTooLarge. Other errors may be of type // ConnectionError, StreamError, or anything else from the underlying // reader. func (fr *Framer) ReadFrame() (Frame, error) { fr.errDetail = nil if fr.lastFrame != nil { fr.lastFrame.invalidate() } fh, err := readFrameHeader(fr.headerBuf[:], fr.r) if err != nil { return nil, err } if fh.Length > fr.maxReadSize { return nil, ErrFrameTooLarge } payload := fr.getReadBuf(fh.Length) if _, err := io.ReadFull(fr.r, payload); err != nil { return nil, err } f, err := typeFrameParser(fh.Type)(fr.frameCache, fh, payload) if err != nil { if ce, ok := err.(connError); ok { return nil, fr.connError(ce.Code, ce.Reason) } return nil, err } if err := fr.checkFrameOrder(f); err != nil { return nil, err } if fr.logReads { fr.debugReadLoggerf("http2: Framer %p: read %v", fr, summarizeFrame(f)) } if fh.Type == FrameHeaders && fr.ReadMetaHeaders != nil { return fr.readMetaFrame(f.(*HeadersFrame)) } return f, nil } // connError returns ConnectionError(code) but first // stashes away a public reason to the caller can optionally relay it // to the peer before hanging up on them. This might help others debug // their implementations. func (fr *Framer) connError(code ErrCode, reason string) error { fr.errDetail = errors.New(reason) return ConnectionError(code) } // checkFrameOrder reports an error if f is an invalid frame to return // next from ReadFrame. Mostly it checks whether HEADERS and // CONTINUATION frames are contiguous. func (fr *Framer) checkFrameOrder(f Frame) error { last := fr.lastFrame fr.lastFrame = f if fr.AllowIllegalReads { return nil } fh := f.Header() if fr.lastHeaderStream != 0 { if fh.Type != FrameContinuation { return fr.connError(ErrCodeProtocol, fmt.Sprintf("got %s for stream %d; expected CONTINUATION following %s for stream %d", fh.Type, fh.StreamID, last.Header().Type, fr.lastHeaderStream)) } if fh.StreamID != fr.lastHeaderStream { return fr.connError(ErrCodeProtocol, fmt.Sprintf("got CONTINUATION for stream %d; expected stream %d", fh.StreamID, fr.lastHeaderStream)) } } else if fh.Type == FrameContinuation { return fr.connError(ErrCodeProtocol, fmt.Sprintf("unexpected CONTINUATION for stream %d", fh.StreamID)) } switch fh.Type { case FrameHeaders, FrameContinuation: if fh.Flags.Has(FlagHeadersEndHeaders) { fr.lastHeaderStream = 0 } else { fr.lastHeaderStream = fh.StreamID } } return nil } // A DataFrame conveys arbitrary, variable-length sequences of octets // associated with a stream. // See http://http2.github.io/http2-spec/#rfc.section.6.1 type DataFrame struct { FrameHeader data []byte } func (f *DataFrame) StreamEnded() bool { return f.FrameHeader.Flags.Has(FlagDataEndStream) } // Data returns the frame's data octets, not including any padding // size byte or padding suffix bytes. // The caller must not retain the returned memory past the next // call to ReadFrame. func (f *DataFrame) Data() []byte { f.checkValid() return f.data } func parseDataFrame(fc *frameCache, fh FrameHeader, payload []byte) (Frame, error) { if fh.StreamID == 0 { // DATA frames MUST be associated with a stream. If a // DATA frame is received whose stream identifier // field is 0x0, the recipient MUST respond with a // connection error (Section 5.4.1) of type // PROTOCOL_ERROR. return nil, connError{ErrCodeProtocol, "DATA frame with stream ID 0"} } f := fc.getDataFrame() f.FrameHeader = fh var padSize byte if fh.Flags.Has(FlagDataPadded) { var err error payload, padSize, err = readByte(payload) if err != nil { return nil, err } } if int(padSize) > len(payload) { // If the length of the padding is greater than the // length of the frame payload, the recipient MUST // treat this as a connection error. // Filed: https://github.com/http2/http2-spec/issues/610 return nil, connError{ErrCodeProtocol, "pad size larger than data payload"} } f.data = payload[:len(payload)-int(padSize)] return f, nil } var ( errStreamID = errors.New("invalid stream ID") errDepStreamID = errors.New("invalid dependent stream ID") errPadLength = errors.New("pad length too large") errPadBytes = errors.New("padding bytes must all be zeros unless AllowIllegalWrites is enabled") ) func validStreamIDOrZero(streamID uint32) bool { return streamID&(1<<31) == 0 } func validStreamID(streamID uint32) bool { return streamID != 0 && streamID&(1<<31) == 0 } // WriteData writes a DATA frame. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility not to violate the maximum frame size // and to not call other Write methods concurrently. func (f *Framer) WriteData(streamID uint32, endStream bool, data []byte) error { return f.WriteDataPadded(streamID, endStream, data, nil) } // WriteDataPadded writes a DATA frame with optional padding. // // If pad is nil, the padding bit is not sent. // The length of pad must not exceed 255 bytes. // The bytes of pad must all be zero, unless f.AllowIllegalWrites is set. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility not to violate the maximum frame size // and to not call other Write methods concurrently. func (f *Framer) WriteDataPadded(streamID uint32, endStream bool, data, pad []byte) error { if !validStreamID(streamID) && !f.AllowIllegalWrites { return errStreamID } if len(pad) > 0 { if len(pad) > 255 { return errPadLength } if !f.AllowIllegalWrites { for _, b := range pad { if b != 0 { // "Padding octets MUST be set to zero when sending." return errPadBytes } } } } var flags Flags if endStream { flags |= FlagDataEndStream } if pad != nil { flags |= FlagDataPadded } f.startWrite(FrameData, flags, streamID) if pad != nil { f.wbuf = append(f.wbuf, byte(len(pad))) } f.wbuf = append(f.wbuf, data...) f.wbuf = append(f.wbuf, pad...) return f.endWrite() } // A SettingsFrame conveys configuration parameters that affect how // endpoints communicate, such as preferences and constraints on peer // behavior. // // See http://http2.github.io/http2-spec/#SETTINGS type SettingsFrame struct { FrameHeader p []byte } func parseSettingsFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { if fh.Flags.Has(FlagSettingsAck) && fh.Length > 0 { // When this (ACK 0x1) bit is set, the payload of the // SETTINGS frame MUST be empty. Receipt of a // SETTINGS frame with the ACK flag set and a length // field value other than 0 MUST be treated as a // connection error (Section 5.4.1) of type // FRAME_SIZE_ERROR. return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID != 0 { // SETTINGS frames always apply to a connection, // never a single stream. The stream identifier for a // SETTINGS frame MUST be zero (0x0). If an endpoint // receives a SETTINGS frame whose stream identifier // field is anything other than 0x0, the endpoint MUST // respond with a connection error (Section 5.4.1) of // type PROTOCOL_ERROR. return nil, ConnectionError(ErrCodeProtocol) } if len(p)%6 != 0 { // Expecting even number of 6 byte settings. return nil, ConnectionError(ErrCodeFrameSize) } f := &SettingsFrame{FrameHeader: fh, p: p} if v, ok := f.Value(SettingInitialWindowSize); ok && v > (1<<31)-1 { // Values above the maximum flow control window size of 2^31 - 1 MUST // be treated as a connection error (Section 5.4.1) of type // FLOW_CONTROL_ERROR. return nil, ConnectionError(ErrCodeFlowControl) } return f, nil } func (f *SettingsFrame) IsAck() bool { return f.FrameHeader.Flags.Has(FlagSettingsAck) } func (f *SettingsFrame) Value(id SettingID) (v uint32, ok bool) { f.checkValid() for i := 0; i < f.NumSettings(); i++ { if s := f.Setting(i); s.ID == id { return s.Val, true } } return 0, false } // Setting returns the setting from the frame at the given 0-based index. // The index must be >= 0 and less than f.NumSettings(). func (f *SettingsFrame) Setting(i int) Setting { buf := f.p return Setting{ ID: SettingID(binary.BigEndian.Uint16(buf[i*6 : i*6+2])), Val: binary.BigEndian.Uint32(buf[i*6+2 : i*6+6]), } } func (f *SettingsFrame) NumSettings() int { return len(f.p) / 6 } // HasDuplicates reports whether f contains any duplicate setting IDs. func (f *SettingsFrame) HasDuplicates() bool { num := f.NumSettings() if num == 0 { return false } // If it's small enough (the common case), just do the n^2 // thing and avoid a map allocation. if num < 10 { for i := 0; i < num; i++ { idi := f.Setting(i).ID for j := i + 1; j < num; j++ { idj := f.Setting(j).ID if idi == idj { return true } } } return false } seen := map[SettingID]bool{} for i := 0; i < num; i++ { id := f.Setting(i).ID if seen[id] { return true } seen[id] = true } return false } // ForeachSetting runs fn for each setting. // It stops and returns the first error. func (f *SettingsFrame) ForeachSetting(fn func(Setting) error) error { f.checkValid() for i := 0; i < f.NumSettings(); i++ { if err := fn(f.Setting(i)); err != nil { return err } } return nil } // WriteSettings writes a SETTINGS frame with zero or more settings // specified and the ACK bit not set. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WriteSettings(settings ...Setting) error { f.startWrite(FrameSettings, 0, 0) for _, s := range settings { f.writeUint16(uint16(s.ID)) f.writeUint32(s.Val) } return f.endWrite() } // WriteSettingsAck writes an empty SETTINGS frame with the ACK bit set. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WriteSettingsAck() error { f.startWrite(FrameSettings, FlagSettingsAck, 0) return f.endWrite() } // A PingFrame is a mechanism for measuring a minimal round trip time // from the sender, as well as determining whether an idle connection // is still functional. // See http://http2.github.io/http2-spec/#rfc.section.6.7 type PingFrame struct { FrameHeader Data [8]byte } func (f *PingFrame) IsAck() bool { return f.Flags.Has(FlagPingAck) } func parsePingFrame(_ *frameCache, fh FrameHeader, payload []byte) (Frame, error) { if len(payload) != 8 { return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID != 0 { return nil, ConnectionError(ErrCodeProtocol) } f := &PingFrame{FrameHeader: fh} copy(f.Data[:], payload) return f, nil } func (f *Framer) WritePing(ack bool, data [8]byte) error { var flags Flags if ack { flags = FlagPingAck } f.startWrite(FramePing, flags, 0) f.writeBytes(data[:]) return f.endWrite() } // A GoAwayFrame informs the remote peer to stop creating streams on this connection. // See http://http2.github.io/http2-spec/#rfc.section.6.8 type GoAwayFrame struct { FrameHeader LastStreamID uint32 ErrCode ErrCode debugData []byte } // DebugData returns any debug data in the GOAWAY frame. Its contents // are not defined. // The caller must not retain the returned memory past the next // call to ReadFrame. func (f *GoAwayFrame) DebugData() []byte { f.checkValid() return f.debugData } func parseGoAwayFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { if fh.StreamID != 0 { return nil, ConnectionError(ErrCodeProtocol) } if len(p) < 8 { return nil, ConnectionError(ErrCodeFrameSize) } return &GoAwayFrame{ FrameHeader: fh, LastStreamID: binary.BigEndian.Uint32(p[:4]) & (1<<31 - 1), ErrCode: ErrCode(binary.BigEndian.Uint32(p[4:8])), debugData: p[8:], }, nil } func (f *Framer) WriteGoAway(maxStreamID uint32, code ErrCode, debugData []byte) error { f.startWrite(FrameGoAway, 0, 0) f.writeUint32(maxStreamID & (1<<31 - 1)) f.writeUint32(uint32(code)) f.writeBytes(debugData) return f.endWrite() } // An UnknownFrame is the frame type returned when the frame type is unknown // or no specific frame type parser exists. type UnknownFrame struct { FrameHeader p []byte } // Payload returns the frame's payload (after the header). It is not // valid to call this method after a subsequent call to // Framer.ReadFrame, nor is it valid to retain the returned slice. // The memory is owned by the Framer and is invalidated when the next // frame is read. func (f *UnknownFrame) Payload() []byte { f.checkValid() return f.p } func parseUnknownFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { return &UnknownFrame{fh, p}, nil } // A WindowUpdateFrame is used to implement flow control. // See http://http2.github.io/http2-spec/#rfc.section.6.9 type WindowUpdateFrame struct { FrameHeader Increment uint32 // never read with high bit set } func parseWindowUpdateFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { if len(p) != 4 { return nil, ConnectionError(ErrCodeFrameSize) } inc := binary.BigEndian.Uint32(p[:4]) & 0x7fffffff // mask off high reserved bit if inc == 0 { // A receiver MUST treat the receipt of a // WINDOW_UPDATE frame with an flow control window // increment of 0 as a stream error (Section 5.4.2) of // type PROTOCOL_ERROR; errors on the connection flow // control window MUST be treated as a connection // error (Section 5.4.1). if fh.StreamID == 0 { return nil, ConnectionError(ErrCodeProtocol) } return nil, streamError(fh.StreamID, ErrCodeProtocol) } return &WindowUpdateFrame{ FrameHeader: fh, Increment: inc, }, nil } // WriteWindowUpdate writes a WINDOW_UPDATE frame. // The increment value must be between 1 and 2,147,483,647, inclusive. // If the Stream ID is zero, the window update applies to the // connection as a whole. func (f *Framer) WriteWindowUpdate(streamID, incr uint32) error { // "The legal range for the increment to the flow control window is 1 to 2^31-1 (2,147,483,647) octets." if (incr < 1 || incr > 2147483647) && !f.AllowIllegalWrites { return errors.New("illegal window increment value") } f.startWrite(FrameWindowUpdate, 0, streamID) f.writeUint32(incr) return f.endWrite() } // A HeadersFrame is used to open a stream and additionally carries a // header block fragment. type HeadersFrame struct { FrameHeader // Priority is set if FlagHeadersPriority is set in the FrameHeader. Priority PriorityParam headerFragBuf []byte // not owned } func (f *HeadersFrame) HeaderBlockFragment() []byte { f.checkValid() return f.headerFragBuf } func (f *HeadersFrame) HeadersEnded() bool { return f.FrameHeader.Flags.Has(FlagHeadersEndHeaders) } func (f *HeadersFrame) StreamEnded() bool { return f.FrameHeader.Flags.Has(FlagHeadersEndStream) } func (f *HeadersFrame) HasPriority() bool { return f.FrameHeader.Flags.Has(FlagHeadersPriority) } func parseHeadersFrame(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err error) { hf := &HeadersFrame{ FrameHeader: fh, } if fh.StreamID == 0 { // HEADERS frames MUST be associated with a stream. If a HEADERS frame // is received whose stream identifier field is 0x0, the recipient MUST // respond with a connection error (Section 5.4.1) of type // PROTOCOL_ERROR. return nil, connError{ErrCodeProtocol, "HEADERS frame with stream ID 0"} } var padLength uint8 if fh.Flags.Has(FlagHeadersPadded) { if p, padLength, err = readByte(p); err != nil { return } } if fh.Flags.Has(FlagHeadersPriority) { var v uint32 p, v, err = readUint32(p) if err != nil { return nil, err } hf.Priority.StreamDep = v & 0x7fffffff hf.Priority.Exclusive = (v != hf.Priority.StreamDep) // high bit was set p, hf.Priority.Weight, err = readByte(p) if err != nil { return nil, err } } if len(p)-int(padLength) <= 0 { return nil, streamError(fh.StreamID, ErrCodeProtocol) } hf.headerFragBuf = p[:len(p)-int(padLength)] return hf, nil } // HeadersFrameParam are the parameters for writing a HEADERS frame. type HeadersFrameParam struct { // StreamID is the required Stream ID to initiate. StreamID uint32 // BlockFragment is part (or all) of a Header Block. BlockFragment []byte // EndStream indicates that the header block is the last that // the endpoint will send for the identified stream. Setting // this flag causes the stream to enter one of "half closed" // states. EndStream bool // EndHeaders indicates that this frame contains an entire // header block and is not followed by any // CONTINUATION frames. EndHeaders bool // PadLength is the optional number of bytes of zeros to add // to this frame. PadLength uint8 // Priority, if non-zero, includes stream priority information // in the HEADER frame. Priority PriorityParam } // WriteHeaders writes a single HEADERS frame. // // This is a low-level header writing method. Encoding headers and // splitting them into any necessary CONTINUATION frames is handled // elsewhere. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WriteHeaders(p HeadersFrameParam) error { if !validStreamID(p.StreamID) && !f.AllowIllegalWrites { return errStreamID } var flags Flags if p.PadLength != 0 { flags |= FlagHeadersPadded } if p.EndStream { flags |= FlagHeadersEndStream } if p.EndHeaders { flags |= FlagHeadersEndHeaders } if !p.Priority.IsZero() { flags |= FlagHeadersPriority } f.startWrite(FrameHeaders, flags, p.StreamID) if p.PadLength != 0 { f.writeByte(p.PadLength) } if !p.Priority.IsZero() { v := p.Priority.StreamDep if !validStreamIDOrZero(v) && !f.AllowIllegalWrites { return errDepStreamID } if p.Priority.Exclusive { v |= 1 << 31 } f.writeUint32(v) f.writeByte(p.Priority.Weight) } f.wbuf = append(f.wbuf, p.BlockFragment...) f.wbuf = append(f.wbuf, padZeros[:p.PadLength]...) return f.endWrite() } // A PriorityFrame specifies the sender-advised priority of a stream. // See http://http2.github.io/http2-spec/#rfc.section.6.3 type PriorityFrame struct { FrameHeader PriorityParam } // PriorityParam are the stream prioritzation parameters. type PriorityParam struct { // StreamDep is a 31-bit stream identifier for the // stream that this stream depends on. Zero means no // dependency. StreamDep uint32 // Exclusive is whether the dependency is exclusive. Exclusive bool // Weight is the stream's zero-indexed weight. It should be // set together with StreamDep, or neither should be set. Per // the spec, "Add one to the value to obtain a weight between // 1 and 256." Weight uint8 } func (p PriorityParam) IsZero() bool { return p == PriorityParam{} } func parsePriorityFrame(_ *frameCache, fh FrameHeader, payload []byte) (Frame, error) { if fh.StreamID == 0 { return nil, connError{ErrCodeProtocol, "PRIORITY frame with stream ID 0"} } if len(payload) != 5 { return nil, connError{ErrCodeFrameSize, fmt.Sprintf("PRIORITY frame payload size was %d; want 5", len(payload))} } v := binary.BigEndian.Uint32(payload[:4]) streamID := v & 0x7fffffff // mask off high bit return &PriorityFrame{ FrameHeader: fh, PriorityParam: PriorityParam{ Weight: payload[4], StreamDep: streamID, Exclusive: streamID != v, // was high bit set? }, }, nil } // WritePriority writes a PRIORITY frame. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WritePriority(streamID uint32, p PriorityParam) error { if !validStreamID(streamID) && !f.AllowIllegalWrites { return errStreamID } if !validStreamIDOrZero(p.StreamDep) { return errDepStreamID } f.startWrite(FramePriority, 0, streamID) v := p.StreamDep if p.Exclusive { v |= 1 << 31 } f.writeUint32(v) f.writeByte(p.Weight) return f.endWrite() } // A RSTStreamFrame allows for abnormal termination of a stream. // See http://http2.github.io/http2-spec/#rfc.section.6.4 type RSTStreamFrame struct { FrameHeader ErrCode ErrCode } func parseRSTStreamFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { if len(p) != 4 { return nil, ConnectionError(ErrCodeFrameSize) } if fh.StreamID == 0 { return nil, ConnectionError(ErrCodeProtocol) } return &RSTStreamFrame{fh, ErrCode(binary.BigEndian.Uint32(p[:4]))}, nil } // WriteRSTStream writes a RST_STREAM frame. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WriteRSTStream(streamID uint32, code ErrCode) error { if !validStreamID(streamID) && !f.AllowIllegalWrites { return errStreamID } f.startWrite(FrameRSTStream, 0, streamID) f.writeUint32(uint32(code)) return f.endWrite() } // A ContinuationFrame is used to continue a sequence of header block fragments. // See http://http2.github.io/http2-spec/#rfc.section.6.10 type ContinuationFrame struct { FrameHeader headerFragBuf []byte } func parseContinuationFrame(_ *frameCache, fh FrameHeader, p []byte) (Frame, error) { if fh.StreamID == 0 { return nil, connError{ErrCodeProtocol, "CONTINUATION frame with stream ID 0"} } return &ContinuationFrame{fh, p}, nil } func (f *ContinuationFrame) HeaderBlockFragment() []byte { f.checkValid() return f.headerFragBuf } func (f *ContinuationFrame) HeadersEnded() bool { return f.FrameHeader.Flags.Has(FlagContinuationEndHeaders) } // WriteContinuation writes a CONTINUATION frame. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WriteContinuation(streamID uint32, endHeaders bool, headerBlockFragment []byte) error { if !validStreamID(streamID) && !f.AllowIllegalWrites { return errStreamID } var flags Flags if endHeaders { flags |= FlagContinuationEndHeaders } f.startWrite(FrameContinuation, flags, streamID) f.wbuf = append(f.wbuf, headerBlockFragment...) return f.endWrite() } // A PushPromiseFrame is used to initiate a server stream. // See http://http2.github.io/http2-spec/#rfc.section.6.6 type PushPromiseFrame struct { FrameHeader PromiseID uint32 headerFragBuf []byte // not owned } func (f *PushPromiseFrame) HeaderBlockFragment() []byte { f.checkValid() return f.headerFragBuf } func (f *PushPromiseFrame) HeadersEnded() bool { return f.FrameHeader.Flags.Has(FlagPushPromiseEndHeaders) } func parsePushPromise(_ *frameCache, fh FrameHeader, p []byte) (_ Frame, err error) { pp := &PushPromiseFrame{ FrameHeader: fh, } if pp.StreamID == 0 { // PUSH_PROMISE frames MUST be associated with an existing, // peer-initiated stream. The stream identifier of a // PUSH_PROMISE frame indicates the stream it is associated // with. If the stream identifier field specifies the value // 0x0, a recipient MUST respond with a connection error // (Section 5.4.1) of type PROTOCOL_ERROR. return nil, ConnectionError(ErrCodeProtocol) } // The PUSH_PROMISE frame includes optional padding. // Padding fields and flags are identical to those defined for DATA frames var padLength uint8 if fh.Flags.Has(FlagPushPromisePadded) { if p, padLength, err = readByte(p); err != nil { return } } p, pp.PromiseID, err = readUint32(p) if err != nil { return } pp.PromiseID = pp.PromiseID & (1<<31 - 1) if int(padLength) > len(p) { // like the DATA frame, error out if padding is longer than the body. return nil, ConnectionError(ErrCodeProtocol) } pp.headerFragBuf = p[:len(p)-int(padLength)] return pp, nil } // PushPromiseParam are the parameters for writing a PUSH_PROMISE frame. type PushPromiseParam struct { // StreamID is the required Stream ID to initiate. StreamID uint32 // PromiseID is the required Stream ID which this // Push Promises PromiseID uint32 // BlockFragment is part (or all) of a Header Block. BlockFragment []byte // EndHeaders indicates that this frame contains an entire // header block and is not followed by any // CONTINUATION frames. EndHeaders bool // PadLength is the optional number of bytes of zeros to add // to this frame. PadLength uint8 } // WritePushPromise writes a single PushPromise Frame. // // As with Header Frames, This is the low level call for writing // individual frames. Continuation frames are handled elsewhere. // // It will perform exactly one Write to the underlying Writer. // It is the caller's responsibility to not call other Write methods concurrently. func (f *Framer) WritePushPromise(p PushPromiseParam) error { if !validStreamID(p.StreamID) && !f.AllowIllegalWrites { return errStreamID } var flags Flags if p.PadLength != 0 { flags |= FlagPushPromisePadded } if p.EndHeaders { flags |= FlagPushPromiseEndHeaders } f.startWrite(FramePushPromise, flags, p.StreamID) if p.PadLength != 0 { f.writeByte(p.PadLength) } if !validStreamID(p.PromiseID) && !f.AllowIllegalWrites { return errStreamID } f.writeUint32(p.PromiseID) f.wbuf = append(f.wbuf, p.BlockFragment...) f.wbuf = append(f.wbuf, padZeros[:p.PadLength]...) return f.endWrite() } // WriteRawFrame writes a raw frame. This can be used to write // extension frames unknown to this package. func (f *Framer) WriteRawFrame(t FrameType, flags Flags, streamID uint32, payload []byte) error { f.startWrite(t, flags, streamID) f.writeBytes(payload) return f.endWrite() } func readByte(p []byte) (remain []byte, b byte, err error) { if len(p) == 0 { return nil, 0, io.ErrUnexpectedEOF } return p[1:], p[0], nil } func readUint32(p []byte) (remain []byte, v uint32, err error) { if len(p) < 4 { return nil, 0, io.ErrUnexpectedEOF } return p[4:], binary.BigEndian.Uint32(p[:4]), nil } type streamEnder interface { StreamEnded() bool } type headersEnder interface { HeadersEnded() bool } type headersOrContinuation interface { headersEnder HeaderBlockFragment() []byte } // A MetaHeadersFrame is the representation of one HEADERS frame and // zero or more contiguous CONTINUATION frames and the decoding of // their HPACK-encoded contents. // // This type of frame does not appear on the wire and is only returned // by the Framer when Framer.ReadMetaHeaders is set. type MetaHeadersFrame struct { *HeadersFrame // Fields are the fields contained in the HEADERS and // CONTINUATION frames. The underlying slice is owned by the // Framer and must not be retained after the next call to // ReadFrame. // // Fields are guaranteed to be in the correct http2 order and // not have unknown pseudo header fields or invalid header // field names or values. Required pseudo header fields may be // missing, however. Use the MetaHeadersFrame.Pseudo accessor // method access pseudo headers. Fields []hpack.HeaderField // Truncated is whether the max header list size limit was hit // and Fields is incomplete. The hpack decoder state is still // valid, however. Truncated bool } // PseudoValue returns the given pseudo header field's value. // The provided pseudo field should not contain the leading colon. func (mh *MetaHeadersFrame) PseudoValue(pseudo string) string { for _, hf := range mh.Fields { if !hf.IsPseudo() { return "" } if hf.Name[1:] == pseudo { return hf.Value } } return "" } // RegularFields returns the regular (non-pseudo) header fields of mh. // The caller does not own the returned slice. func (mh *MetaHeadersFrame) RegularFields() []hpack.HeaderField { for i, hf := range mh.Fields { if !hf.IsPseudo() { return mh.Fields[i:] } } return nil } // PseudoFields returns the pseudo header fields of mh. // The caller does not own the returned slice. func (mh *MetaHeadersFrame) PseudoFields() []hpack.HeaderField { for i, hf := range mh.Fields { if !hf.IsPseudo() { return mh.Fields[:i] } } return mh.Fields } func (mh *MetaHeadersFrame) checkPseudos() error { var isRequest, isResponse bool pf := mh.PseudoFields() for i, hf := range pf { switch hf.Name { case ":method", ":path", ":scheme", ":authority": isRequest = true case ":status": isResponse = true default: return pseudoHeaderError(hf.Name) } // Check for duplicates. // This would be a bad algorithm, but N is 4. // And this doesn't allocate. for _, hf2 := range pf[:i] { if hf.Name == hf2.Name { return duplicatePseudoHeaderError(hf.Name) } } } if isRequest && isResponse { return errMixPseudoHeaderTypes } return nil } func (fr *Framer) maxHeaderStringLen() int { v := fr.maxHeaderListSize() if uint32(int(v)) == v { return int(v) } // They had a crazy big number for MaxHeaderBytes anyway, // so give them unlimited header lengths: return 0 } // readMetaFrame returns 0 or more CONTINUATION frames from fr and // merge them into the provided hf and returns a MetaHeadersFrame // with the decoded hpack values. func (fr *Framer) readMetaFrame(hf *HeadersFrame) (*MetaHeadersFrame, error) { if fr.AllowIllegalReads { return nil, errors.New("illegal use of AllowIllegalReads with ReadMetaHeaders") } mh := &MetaHeadersFrame{ HeadersFrame: hf, } var remainSize = fr.maxHeaderListSize() var sawRegular bool var invalid error // pseudo header field errors hdec := fr.ReadMetaHeaders hdec.SetEmitEnabled(true) hdec.SetMaxStringLength(fr.maxHeaderStringLen()) hdec.SetEmitFunc(func(hf hpack.HeaderField) { if VerboseLogs && fr.logReads { fr.debugReadLoggerf("http2: decoded hpack field %+v", hf) } if !httpguts.ValidHeaderFieldValue(hf.Value) { invalid = headerFieldValueError(hf.Value) } isPseudo := strings.HasPrefix(hf.Name, ":") if isPseudo { if sawRegular { invalid = errPseudoAfterRegular } } else { sawRegular = true if !validWireHeaderFieldName(hf.Name) { invalid = headerFieldNameError(hf.Name) } } if invalid != nil { hdec.SetEmitEnabled(false) return } size := hf.Size() if size > remainSize { hdec.SetEmitEnabled(false) mh.Truncated = true return } remainSize -= size mh.Fields = append(mh.Fields, hf) }) // Lose reference to MetaHeadersFrame: defer hdec.SetEmitFunc(func(hf hpack.HeaderField) {}) var hc headersOrContinuation = hf for { frag := hc.HeaderBlockFragment() if _, err := hdec.Write(frag); err != nil { return nil, ConnectionError(ErrCodeCompression) } if hc.HeadersEnded() { break } if f, err := fr.ReadFrame(); err != nil { return nil, err } else { hc = f.(*ContinuationFrame) // guaranteed by checkFrameOrder } } mh.HeadersFrame.headerFragBuf = nil mh.HeadersFrame.invalidate() if err := hdec.Close(); err != nil { return nil, ConnectionError(ErrCodeCompression) } if invalid != nil { fr.errDetail = invalid if VerboseLogs { log.Printf("http2: invalid header: %v", invalid) } return nil, StreamError{mh.StreamID, ErrCodeProtocol, invalid} } if err := mh.checkPseudos(); err != nil { fr.errDetail = err if VerboseLogs { log.Printf("http2: invalid pseudo headers: %v", err) } return nil, StreamError{mh.StreamID, ErrCodeProtocol, err} } return mh, nil } func summarizeFrame(f Frame) string { var buf bytes.Buffer f.Header().writeDebug(&buf) switch f := f.(type) { case *SettingsFrame: n := 0 f.ForeachSetting(func(s Setting) error { n++ if n == 1 { buf.WriteString(", settings:") } fmt.Fprintf(&buf, " %v=%v,", s.ID, s.Val) return nil }) if n > 0 { buf.Truncate(buf.Len() - 1) // remove trailing comma } case *DataFrame: data := f.Data() const max = 256 if len(data) > max { data = data[:max] } fmt.Fprintf(&buf, " data=%q", data) if len(f.Data()) > max { fmt.Fprintf(&buf, " (%d bytes omitted)", len(f.Data())-max) } case *WindowUpdateFrame: if f.StreamID == 0 { buf.WriteString(" (conn)") } fmt.Fprintf(&buf, " incr=%v", f.Increment) case *PingFrame: fmt.Fprintf(&buf, " ping=%q", f.Data[:]) case *GoAwayFrame: fmt.Fprintf(&buf, " LastStreamID=%v ErrCode=%v Debug=%q", f.LastStreamID, f.ErrCode, f.debugData) case *RSTStreamFrame: fmt.Fprintf(&buf, " ErrCode=%v", f.ErrCode) } return buf.String() } ================================================ FILE: vendor/golang.org/x/net/http2/go111.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build go1.11 package http2 import ( "net/http/httptrace" "net/textproto" ) func traceHasWroteHeaderField(trace *httptrace.ClientTrace) bool { return trace != nil && trace.WroteHeaderField != nil } func traceWroteHeaderField(trace *httptrace.ClientTrace, k, v string) { if trace != nil && trace.WroteHeaderField != nil { trace.WroteHeaderField(k, []string{v}) } } func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error { if trace != nil { return trace.Got1xxResponse } return nil } ================================================ FILE: vendor/golang.org/x/net/http2/gotrack.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Defensive debug-only utility to track that functions run on the // goroutine that they're supposed to. package http2 import ( "bytes" "errors" "fmt" "os" "runtime" "strconv" "sync" ) var DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" type goroutineLock uint64 func newGoroutineLock() goroutineLock { if !DebugGoroutines { return 0 } return goroutineLock(curGoroutineID()) } func (g goroutineLock) check() { if !DebugGoroutines { return } if curGoroutineID() != uint64(g) { panic("running on the wrong goroutine") } } func (g goroutineLock) checkNotOn() { if !DebugGoroutines { return } if curGoroutineID() == uint64(g) { panic("running on the wrong goroutine") } } var goroutineSpace = []byte("goroutine ") func curGoroutineID() uint64 { bp := littleBuf.Get().(*[]byte) defer littleBuf.Put(bp) b := *bp b = b[:runtime.Stack(b, false)] // Parse the 4707 out of "goroutine 4707 [" b = bytes.TrimPrefix(b, goroutineSpace) i := bytes.IndexByte(b, ' ') if i < 0 { panic(fmt.Sprintf("No space found in %q", b)) } b = b[:i] n, err := parseUintBytes(b, 10, 64) if err != nil { panic(fmt.Sprintf("Failed to parse goroutine ID out of %q: %v", b, err)) } return n } var littleBuf = sync.Pool{ New: func() interface{} { buf := make([]byte, 64) return &buf }, } // parseUintBytes is like strconv.ParseUint, but using a []byte. func parseUintBytes(s []byte, base int, bitSize int) (n uint64, err error) { var cutoff, maxVal uint64 if bitSize == 0 { bitSize = int(strconv.IntSize) } s0 := s switch { case len(s) < 1: err = strconv.ErrSyntax goto Error case 2 <= base && base <= 36: // valid base; nothing to do case base == 0: // Look for octal, hex prefix. switch { case s[0] == '0' && len(s) > 1 && (s[1] == 'x' || s[1] == 'X'): base = 16 s = s[2:] if len(s) < 1 { err = strconv.ErrSyntax goto Error } case s[0] == '0': base = 8 default: base = 10 } default: err = errors.New("invalid base " + strconv.Itoa(base)) goto Error } n = 0 cutoff = cutoff64(base) maxVal = 1<= base { n = 0 err = strconv.ErrSyntax goto Error } if n >= cutoff { // n*base overflows n = 1<<64 - 1 err = strconv.ErrRange goto Error } n *= uint64(base) n1 := n + uint64(v) if n1 < n || n1 > maxVal { // n+v overflows n = 1<<64 - 1 err = strconv.ErrRange goto Error } n = n1 } return n, nil Error: return n, &strconv.NumError{Func: "ParseUint", Num: string(s0), Err: err} } // Return the first number n such that n*base >= 1<<64. func cutoff64(base int) uint64 { if base < 2 { return 0 } return (1<<64-1)/uint64(base) + 1 } ================================================ FILE: vendor/golang.org/x/net/http2/headermap.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "net/http" "strings" "sync" ) var ( commonBuildOnce sync.Once commonLowerHeader map[string]string // Go-Canonical-Case -> lower-case commonCanonHeader map[string]string // lower-case -> Go-Canonical-Case ) func buildCommonHeaderMapsOnce() { commonBuildOnce.Do(buildCommonHeaderMaps) } func buildCommonHeaderMaps() { common := []string{ "accept", "accept-charset", "accept-encoding", "accept-language", "accept-ranges", "age", "access-control-allow-origin", "allow", "authorization", "cache-control", "content-disposition", "content-encoding", "content-language", "content-length", "content-location", "content-range", "content-type", "cookie", "date", "etag", "expect", "expires", "from", "host", "if-match", "if-modified-since", "if-none-match", "if-unmodified-since", "last-modified", "link", "location", "max-forwards", "proxy-authenticate", "proxy-authorization", "range", "referer", "refresh", "retry-after", "server", "set-cookie", "strict-transport-security", "trailer", "transfer-encoding", "user-agent", "vary", "via", "www-authenticate", } commonLowerHeader = make(map[string]string, len(common)) commonCanonHeader = make(map[string]string, len(common)) for _, v := range common { chk := http.CanonicalHeaderKey(v) commonLowerHeader[chk] = v commonCanonHeader[v] = chk } } func lowerHeader(v string) string { buildCommonHeaderMapsOnce() if s, ok := commonLowerHeader[v]; ok { return s } return strings.ToLower(v) } ================================================ FILE: vendor/golang.org/x/net/http2/hpack/encode.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hpack import ( "io" ) const ( uint32Max = ^uint32(0) initialHeaderTableSize = 4096 ) type Encoder struct { dynTab dynamicTable // minSize is the minimum table size set by // SetMaxDynamicTableSize after the previous Header Table Size // Update. minSize uint32 // maxSizeLimit is the maximum table size this encoder // supports. This will protect the encoder from too large // size. maxSizeLimit uint32 // tableSizeUpdate indicates whether "Header Table Size // Update" is required. tableSizeUpdate bool w io.Writer buf []byte } // NewEncoder returns a new Encoder which performs HPACK encoding. An // encoded data is written to w. func NewEncoder(w io.Writer) *Encoder { e := &Encoder{ minSize: uint32Max, maxSizeLimit: initialHeaderTableSize, tableSizeUpdate: false, w: w, } e.dynTab.table.init() e.dynTab.setMaxSize(initialHeaderTableSize) return e } // WriteField encodes f into a single Write to e's underlying Writer. // This function may also produce bytes for "Header Table Size Update" // if necessary. If produced, it is done before encoding f. func (e *Encoder) WriteField(f HeaderField) error { e.buf = e.buf[:0] if e.tableSizeUpdate { e.tableSizeUpdate = false if e.minSize < e.dynTab.maxSize { e.buf = appendTableSize(e.buf, e.minSize) } e.minSize = uint32Max e.buf = appendTableSize(e.buf, e.dynTab.maxSize) } idx, nameValueMatch := e.searchTable(f) if nameValueMatch { e.buf = appendIndexed(e.buf, idx) } else { indexing := e.shouldIndex(f) if indexing { e.dynTab.add(f) } if idx == 0 { e.buf = appendNewName(e.buf, f, indexing) } else { e.buf = appendIndexedName(e.buf, f, idx, indexing) } } n, err := e.w.Write(e.buf) if err == nil && n != len(e.buf) { err = io.ErrShortWrite } return err } // searchTable searches f in both stable and dynamic header tables. // The static header table is searched first. Only when there is no // exact match for both name and value, the dynamic header table is // then searched. If there is no match, i is 0. If both name and value // match, i is the matched index and nameValueMatch becomes true. If // only name matches, i points to that index and nameValueMatch // becomes false. func (e *Encoder) searchTable(f HeaderField) (i uint64, nameValueMatch bool) { i, nameValueMatch = staticTable.search(f) if nameValueMatch { return i, true } j, nameValueMatch := e.dynTab.table.search(f) if nameValueMatch || (i == 0 && j != 0) { return j + uint64(staticTable.len()), nameValueMatch } return i, false } // SetMaxDynamicTableSize changes the dynamic header table size to v. // The actual size is bounded by the value passed to // SetMaxDynamicTableSizeLimit. func (e *Encoder) SetMaxDynamicTableSize(v uint32) { if v > e.maxSizeLimit { v = e.maxSizeLimit } if v < e.minSize { e.minSize = v } e.tableSizeUpdate = true e.dynTab.setMaxSize(v) } // SetMaxDynamicTableSizeLimit changes the maximum value that can be // specified in SetMaxDynamicTableSize to v. By default, it is set to // 4096, which is the same size of the default dynamic header table // size described in HPACK specification. If the current maximum // dynamic header table size is strictly greater than v, "Header Table // Size Update" will be done in the next WriteField call and the // maximum dynamic header table size is truncated to v. func (e *Encoder) SetMaxDynamicTableSizeLimit(v uint32) { e.maxSizeLimit = v if e.dynTab.maxSize > v { e.tableSizeUpdate = true e.dynTab.setMaxSize(v) } } // shouldIndex reports whether f should be indexed. func (e *Encoder) shouldIndex(f HeaderField) bool { return !f.Sensitive && f.Size() <= e.dynTab.maxSize } // appendIndexed appends index i, as encoded in "Indexed Header Field" // representation, to dst and returns the extended buffer. func appendIndexed(dst []byte, i uint64) []byte { first := len(dst) dst = appendVarInt(dst, 7, i) dst[first] |= 0x80 return dst } // appendNewName appends f, as encoded in one of "Literal Header field // - New Name" representation variants, to dst and returns the // extended buffer. // // If f.Sensitive is true, "Never Indexed" representation is used. If // f.Sensitive is false and indexing is true, "Inremental Indexing" // representation is used. func appendNewName(dst []byte, f HeaderField, indexing bool) []byte { dst = append(dst, encodeTypeByte(indexing, f.Sensitive)) dst = appendHpackString(dst, f.Name) return appendHpackString(dst, f.Value) } // appendIndexedName appends f and index i referring indexed name // entry, as encoded in one of "Literal Header field - Indexed Name" // representation variants, to dst and returns the extended buffer. // // If f.Sensitive is true, "Never Indexed" representation is used. If // f.Sensitive is false and indexing is true, "Incremental Indexing" // representation is used. func appendIndexedName(dst []byte, f HeaderField, i uint64, indexing bool) []byte { first := len(dst) var n byte if indexing { n = 6 } else { n = 4 } dst = appendVarInt(dst, n, i) dst[first] |= encodeTypeByte(indexing, f.Sensitive) return appendHpackString(dst, f.Value) } // appendTableSize appends v, as encoded in "Header Table Size Update" // representation, to dst and returns the extended buffer. func appendTableSize(dst []byte, v uint32) []byte { first := len(dst) dst = appendVarInt(dst, 5, uint64(v)) dst[first] |= 0x20 return dst } // appendVarInt appends i, as encoded in variable integer form using n // bit prefix, to dst and returns the extended buffer. // // See // http://http2.github.io/http2-spec/compression.html#integer.representation func appendVarInt(dst []byte, n byte, i uint64) []byte { k := uint64((1 << n) - 1) if i < k { return append(dst, byte(i)) } dst = append(dst, byte(k)) i -= k for ; i >= 128; i >>= 7 { dst = append(dst, byte(0x80|(i&0x7f))) } return append(dst, byte(i)) } // appendHpackString appends s, as encoded in "String Literal" // representation, to dst and returns the extended buffer. // // s will be encoded in Huffman codes only when it produces strictly // shorter byte string. func appendHpackString(dst []byte, s string) []byte { huffmanLength := HuffmanEncodeLength(s) if huffmanLength < uint64(len(s)) { first := len(dst) dst = appendVarInt(dst, 7, huffmanLength) dst = AppendHuffmanString(dst, s) dst[first] |= 0x80 } else { dst = appendVarInt(dst, 7, uint64(len(s))) dst = append(dst, s...) } return dst } // encodeTypeByte returns type byte. If sensitive is true, type byte // for "Never Indexed" representation is returned. If sensitive is // false and indexing is true, type byte for "Incremental Indexing" // representation is returned. Otherwise, type byte for "Without // Indexing" is returned. func encodeTypeByte(indexing, sensitive bool) byte { if sensitive { return 0x10 } if indexing { return 0x40 } return 0 } ================================================ FILE: vendor/golang.org/x/net/http2/hpack/hpack.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package hpack implements HPACK, a compression format for // efficiently representing HTTP header fields in the context of HTTP/2. // // See http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-09 package hpack import ( "bytes" "errors" "fmt" ) // A DecodingError is something the spec defines as a decoding error. type DecodingError struct { Err error } func (de DecodingError) Error() string { return fmt.Sprintf("decoding error: %v", de.Err) } // An InvalidIndexError is returned when an encoder references a table // entry before the static table or after the end of the dynamic table. type InvalidIndexError int func (e InvalidIndexError) Error() string { return fmt.Sprintf("invalid indexed representation index %d", int(e)) } // A HeaderField is a name-value pair. Both the name and value are // treated as opaque sequences of octets. type HeaderField struct { Name, Value string // Sensitive means that this header field should never be // indexed. Sensitive bool } // IsPseudo reports whether the header field is an http2 pseudo header. // That is, it reports whether it starts with a colon. // It is not otherwise guaranteed to be a valid pseudo header field, // though. func (hf HeaderField) IsPseudo() bool { return len(hf.Name) != 0 && hf.Name[0] == ':' } func (hf HeaderField) String() string { var suffix string if hf.Sensitive { suffix = " (sensitive)" } return fmt.Sprintf("header field %q = %q%s", hf.Name, hf.Value, suffix) } // Size returns the size of an entry per RFC 7541 section 4.1. func (hf HeaderField) Size() uint32 { // http://http2.github.io/http2-spec/compression.html#rfc.section.4.1 // "The size of the dynamic table is the sum of the size of // its entries. The size of an entry is the sum of its name's // length in octets (as defined in Section 5.2), its value's // length in octets (see Section 5.2), plus 32. The size of // an entry is calculated using the length of the name and // value without any Huffman encoding applied." // This can overflow if somebody makes a large HeaderField // Name and/or Value by hand, but we don't care, because that // won't happen on the wire because the encoding doesn't allow // it. return uint32(len(hf.Name) + len(hf.Value) + 32) } // A Decoder is the decoding context for incremental processing of // header blocks. type Decoder struct { dynTab dynamicTable emit func(f HeaderField) emitEnabled bool // whether calls to emit are enabled maxStrLen int // 0 means unlimited // buf is the unparsed buffer. It's only written to // saveBuf if it was truncated in the middle of a header // block. Because it's usually not owned, we can only // process it under Write. buf []byte // not owned; only valid during Write // saveBuf is previous data passed to Write which we weren't able // to fully parse before. Unlike buf, we own this data. saveBuf bytes.Buffer firstField bool // processing the first field of the header block } // NewDecoder returns a new decoder with the provided maximum dynamic // table size. The emitFunc will be called for each valid field // parsed, in the same goroutine as calls to Write, before Write returns. func NewDecoder(maxDynamicTableSize uint32, emitFunc func(f HeaderField)) *Decoder { d := &Decoder{ emit: emitFunc, emitEnabled: true, firstField: true, } d.dynTab.table.init() d.dynTab.allowedMaxSize = maxDynamicTableSize d.dynTab.setMaxSize(maxDynamicTableSize) return d } // ErrStringLength is returned by Decoder.Write when the max string length // (as configured by Decoder.SetMaxStringLength) would be violated. var ErrStringLength = errors.New("hpack: string too long") // SetMaxStringLength sets the maximum size of a HeaderField name or // value string. If a string exceeds this length (even after any // decompression), Write will return ErrStringLength. // A value of 0 means unlimited and is the default from NewDecoder. func (d *Decoder) SetMaxStringLength(n int) { d.maxStrLen = n } // SetEmitFunc changes the callback used when new header fields // are decoded. // It must be non-nil. It does not affect EmitEnabled. func (d *Decoder) SetEmitFunc(emitFunc func(f HeaderField)) { d.emit = emitFunc } // SetEmitEnabled controls whether the emitFunc provided to NewDecoder // should be called. The default is true. // // This facility exists to let servers enforce MAX_HEADER_LIST_SIZE // while still decoding and keeping in-sync with decoder state, but // without doing unnecessary decompression or generating unnecessary // garbage for header fields past the limit. func (d *Decoder) SetEmitEnabled(v bool) { d.emitEnabled = v } // EmitEnabled reports whether calls to the emitFunc provided to NewDecoder // are currently enabled. The default is true. func (d *Decoder) EmitEnabled() bool { return d.emitEnabled } // TODO: add method *Decoder.Reset(maxSize, emitFunc) to let callers re-use Decoders and their // underlying buffers for garbage reasons. func (d *Decoder) SetMaxDynamicTableSize(v uint32) { d.dynTab.setMaxSize(v) } // SetAllowedMaxDynamicTableSize sets the upper bound that the encoded // stream (via dynamic table size updates) may set the maximum size // to. func (d *Decoder) SetAllowedMaxDynamicTableSize(v uint32) { d.dynTab.allowedMaxSize = v } type dynamicTable struct { // http://http2.github.io/http2-spec/compression.html#rfc.section.2.3.2 table headerFieldTable size uint32 // in bytes maxSize uint32 // current maxSize allowedMaxSize uint32 // maxSize may go up to this, inclusive } func (dt *dynamicTable) setMaxSize(v uint32) { dt.maxSize = v dt.evict() } func (dt *dynamicTable) add(f HeaderField) { dt.table.addEntry(f) dt.size += f.Size() dt.evict() } // If we're too big, evict old stuff. func (dt *dynamicTable) evict() { var n int for dt.size > dt.maxSize && n < dt.table.len() { dt.size -= dt.table.ents[n].Size() n++ } dt.table.evictOldest(n) } func (d *Decoder) maxTableIndex() int { // This should never overflow. RFC 7540 Section 6.5.2 limits the size of // the dynamic table to 2^32 bytes, where each entry will occupy more than // one byte. Further, the staticTable has a fixed, small length. return d.dynTab.table.len() + staticTable.len() } func (d *Decoder) at(i uint64) (hf HeaderField, ok bool) { // See Section 2.3.3. if i == 0 { return } if i <= uint64(staticTable.len()) { return staticTable.ents[i-1], true } if i > uint64(d.maxTableIndex()) { return } // In the dynamic table, newer entries have lower indices. // However, dt.ents[0] is the oldest entry. Hence, dt.ents is // the reversed dynamic table. dt := d.dynTab.table return dt.ents[dt.len()-(int(i)-staticTable.len())], true } // Decode decodes an entire block. // // TODO: remove this method and make it incremental later? This is // easier for debugging now. func (d *Decoder) DecodeFull(p []byte) ([]HeaderField, error) { var hf []HeaderField saveFunc := d.emit defer func() { d.emit = saveFunc }() d.emit = func(f HeaderField) { hf = append(hf, f) } if _, err := d.Write(p); err != nil { return nil, err } if err := d.Close(); err != nil { return nil, err } return hf, nil } // Close declares that the decoding is complete and resets the Decoder // to be reused again for a new header block. If there is any remaining // data in the decoder's buffer, Close returns an error. func (d *Decoder) Close() error { if d.saveBuf.Len() > 0 { d.saveBuf.Reset() return DecodingError{errors.New("truncated headers")} } d.firstField = true return nil } func (d *Decoder) Write(p []byte) (n int, err error) { if len(p) == 0 { // Prevent state machine CPU attacks (making us redo // work up to the point of finding out we don't have // enough data) return } // Only copy the data if we have to. Optimistically assume // that p will contain a complete header block. if d.saveBuf.Len() == 0 { d.buf = p } else { d.saveBuf.Write(p) d.buf = d.saveBuf.Bytes() d.saveBuf.Reset() } for len(d.buf) > 0 { err = d.parseHeaderFieldRepr() if err == errNeedMore { // Extra paranoia, making sure saveBuf won't // get too large. All the varint and string // reading code earlier should already catch // overlong things and return ErrStringLength, // but keep this as a last resort. const varIntOverhead = 8 // conservative if d.maxStrLen != 0 && int64(len(d.buf)) > 2*(int64(d.maxStrLen)+varIntOverhead) { return 0, ErrStringLength } d.saveBuf.Write(d.buf) return len(p), nil } d.firstField = false if err != nil { break } } return len(p), err } // errNeedMore is an internal sentinel error value that means the // buffer is truncated and we need to read more data before we can // continue parsing. var errNeedMore = errors.New("need more data") type indexType int const ( indexedTrue indexType = iota indexedFalse indexedNever ) func (v indexType) indexed() bool { return v == indexedTrue } func (v indexType) sensitive() bool { return v == indexedNever } // returns errNeedMore if there isn't enough data available. // any other error is fatal. // consumes d.buf iff it returns nil. // precondition: must be called with len(d.buf) > 0 func (d *Decoder) parseHeaderFieldRepr() error { b := d.buf[0] switch { case b&128 != 0: // Indexed representation. // High bit set? // http://http2.github.io/http2-spec/compression.html#rfc.section.6.1 return d.parseFieldIndexed() case b&192 == 64: // 6.2.1 Literal Header Field with Incremental Indexing // 0b10xxxxxx: top two bits are 10 // http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.1 return d.parseFieldLiteral(6, indexedTrue) case b&240 == 0: // 6.2.2 Literal Header Field without Indexing // 0b0000xxxx: top four bits are 0000 // http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.2 return d.parseFieldLiteral(4, indexedFalse) case b&240 == 16: // 6.2.3 Literal Header Field never Indexed // 0b0001xxxx: top four bits are 0001 // http://http2.github.io/http2-spec/compression.html#rfc.section.6.2.3 return d.parseFieldLiteral(4, indexedNever) case b&224 == 32: // 6.3 Dynamic Table Size Update // Top three bits are '001'. // http://http2.github.io/http2-spec/compression.html#rfc.section.6.3 return d.parseDynamicTableSizeUpdate() } return DecodingError{errors.New("invalid encoding")} } // (same invariants and behavior as parseHeaderFieldRepr) func (d *Decoder) parseFieldIndexed() error { buf := d.buf idx, buf, err := readVarInt(7, buf) if err != nil { return err } hf, ok := d.at(idx) if !ok { return DecodingError{InvalidIndexError(idx)} } d.buf = buf return d.callEmit(HeaderField{Name: hf.Name, Value: hf.Value}) } // (same invariants and behavior as parseHeaderFieldRepr) func (d *Decoder) parseFieldLiteral(n uint8, it indexType) error { buf := d.buf nameIdx, buf, err := readVarInt(n, buf) if err != nil { return err } var hf HeaderField wantStr := d.emitEnabled || it.indexed() if nameIdx > 0 { ihf, ok := d.at(nameIdx) if !ok { return DecodingError{InvalidIndexError(nameIdx)} } hf.Name = ihf.Name } else { hf.Name, buf, err = d.readString(buf, wantStr) if err != nil { return err } } hf.Value, buf, err = d.readString(buf, wantStr) if err != nil { return err } d.buf = buf if it.indexed() { d.dynTab.add(hf) } hf.Sensitive = it.sensitive() return d.callEmit(hf) } func (d *Decoder) callEmit(hf HeaderField) error { if d.maxStrLen != 0 { if len(hf.Name) > d.maxStrLen || len(hf.Value) > d.maxStrLen { return ErrStringLength } } if d.emitEnabled { d.emit(hf) } return nil } // (same invariants and behavior as parseHeaderFieldRepr) func (d *Decoder) parseDynamicTableSizeUpdate() error { // RFC 7541, sec 4.2: This dynamic table size update MUST occur at the // beginning of the first header block following the change to the dynamic table size. if !d.firstField && d.dynTab.size > 0 { return DecodingError{errors.New("dynamic table size update MUST occur at the beginning of a header block")} } buf := d.buf size, buf, err := readVarInt(5, buf) if err != nil { return err } if size > uint64(d.dynTab.allowedMaxSize) { return DecodingError{errors.New("dynamic table size update too large")} } d.dynTab.setMaxSize(uint32(size)) d.buf = buf return nil } var errVarintOverflow = DecodingError{errors.New("varint integer overflow")} // readVarInt reads an unsigned variable length integer off the // beginning of p. n is the parameter as described in // http://http2.github.io/http2-spec/compression.html#rfc.section.5.1. // // n must always be between 1 and 8. // // The returned remain buffer is either a smaller suffix of p, or err != nil. // The error is errNeedMore if p doesn't contain a complete integer. func readVarInt(n byte, p []byte) (i uint64, remain []byte, err error) { if n < 1 || n > 8 { panic("bad n") } if len(p) == 0 { return 0, p, errNeedMore } i = uint64(p[0]) if n < 8 { i &= (1 << uint64(n)) - 1 } if i < (1< 0 { b := p[0] p = p[1:] i += uint64(b&127) << m if b&128 == 0 { return i, p, nil } m += 7 if m >= 63 { // TODO: proper overflow check. making this up. return 0, origP, errVarintOverflow } } return 0, origP, errNeedMore } // readString decodes an hpack string from p. // // wantStr is whether s will be used. If false, decompression and // []byte->string garbage are skipped if s will be ignored // anyway. This does mean that huffman decoding errors for non-indexed // strings past the MAX_HEADER_LIST_SIZE are ignored, but the server // is returning an error anyway, and because they're not indexed, the error // won't affect the decoding state. func (d *Decoder) readString(p []byte, wantStr bool) (s string, remain []byte, err error) { if len(p) == 0 { return "", p, errNeedMore } isHuff := p[0]&128 != 0 strLen, p, err := readVarInt(7, p) if err != nil { return "", p, err } if d.maxStrLen != 0 && strLen > uint64(d.maxStrLen) { return "", nil, ErrStringLength } if uint64(len(p)) < strLen { return "", p, errNeedMore } if !isHuff { if wantStr { s = string(p[:strLen]) } return s, p[strLen:], nil } if wantStr { buf := bufPool.Get().(*bytes.Buffer) buf.Reset() // don't trust others defer bufPool.Put(buf) if err := huffmanDecode(buf, d.maxStrLen, p[:strLen]); err != nil { buf.Reset() return "", nil, err } s = buf.String() buf.Reset() // be nice to GC } return s, p[strLen:], nil } ================================================ FILE: vendor/golang.org/x/net/http2/hpack/huffman.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hpack import ( "bytes" "errors" "io" "sync" ) var bufPool = sync.Pool{ New: func() interface{} { return new(bytes.Buffer) }, } // HuffmanDecode decodes the string in v and writes the expanded // result to w, returning the number of bytes written to w and the // Write call's return value. At most one Write call is made. func HuffmanDecode(w io.Writer, v []byte) (int, error) { buf := bufPool.Get().(*bytes.Buffer) buf.Reset() defer bufPool.Put(buf) if err := huffmanDecode(buf, 0, v); err != nil { return 0, err } return w.Write(buf.Bytes()) } // HuffmanDecodeToString decodes the string in v. func HuffmanDecodeToString(v []byte) (string, error) { buf := bufPool.Get().(*bytes.Buffer) buf.Reset() defer bufPool.Put(buf) if err := huffmanDecode(buf, 0, v); err != nil { return "", err } return buf.String(), nil } // ErrInvalidHuffman is returned for errors found decoding // Huffman-encoded strings. var ErrInvalidHuffman = errors.New("hpack: invalid Huffman-encoded data") // huffmanDecode decodes v to buf. // If maxLen is greater than 0, attempts to write more to buf than // maxLen bytes will return ErrStringLength. func huffmanDecode(buf *bytes.Buffer, maxLen int, v []byte) error { rootHuffmanNode := getRootHuffmanNode() n := rootHuffmanNode // cur is the bit buffer that has not been fed into n. // cbits is the number of low order bits in cur that are valid. // sbits is the number of bits of the symbol prefix being decoded. cur, cbits, sbits := uint(0), uint8(0), uint8(0) for _, b := range v { cur = cur<<8 | uint(b) cbits += 8 sbits += 8 for cbits >= 8 { idx := byte(cur >> (cbits - 8)) n = n.children[idx] if n == nil { return ErrInvalidHuffman } if n.children == nil { if maxLen != 0 && buf.Len() == maxLen { return ErrStringLength } buf.WriteByte(n.sym) cbits -= n.codeLen n = rootHuffmanNode sbits = cbits } else { cbits -= 8 } } } for cbits > 0 { n = n.children[byte(cur<<(8-cbits))] if n == nil { return ErrInvalidHuffman } if n.children != nil || n.codeLen > cbits { break } if maxLen != 0 && buf.Len() == maxLen { return ErrStringLength } buf.WriteByte(n.sym) cbits -= n.codeLen n = rootHuffmanNode sbits = cbits } if sbits > 7 { // Either there was an incomplete symbol, or overlong padding. // Both are decoding errors per RFC 7541 section 5.2. return ErrInvalidHuffman } if mask := uint(1< 8 { codeLen -= 8 i := uint8(code >> codeLen) if cur.children[i] == nil { cur.children[i] = newInternalNode() } cur = cur.children[i] } shift := 8 - codeLen start, end := int(uint8(code<> (nbits - rembits)) dst[len(dst)-1] |= t } return dst } // HuffmanEncodeLength returns the number of bytes required to encode // s in Huffman codes. The result is round up to byte boundary. func HuffmanEncodeLength(s string) uint64 { n := uint64(0) for i := 0; i < len(s); i++ { n += uint64(huffmanCodeLen[s[i]]) } return (n + 7) / 8 } // appendByteToHuffmanCode appends Huffman code for c to dst and // returns the extended buffer and the remaining bits in the last // element. The appending is not byte aligned and the remaining bits // in the last element of dst is given in rembits. func appendByteToHuffmanCode(dst []byte, rembits uint8, c byte) ([]byte, uint8) { code := huffmanCodes[c] nbits := huffmanCodeLen[c] for { if rembits > nbits { t := uint8(code << (rembits - nbits)) dst[len(dst)-1] |= t rembits -= nbits break } t := uint8(code >> (nbits - rembits)) dst[len(dst)-1] |= t nbits -= rembits rembits = 8 if nbits == 0 { break } dst = append(dst, 0) } return dst, rembits } ================================================ FILE: vendor/golang.org/x/net/http2/hpack/tables.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package hpack import ( "fmt" ) // headerFieldTable implements a list of HeaderFields. // This is used to implement the static and dynamic tables. type headerFieldTable struct { // For static tables, entries are never evicted. // // For dynamic tables, entries are evicted from ents[0] and added to the end. // Each entry has a unique id that starts at one and increments for each // entry that is added. This unique id is stable across evictions, meaning // it can be used as a pointer to a specific entry. As in hpack, unique ids // are 1-based. The unique id for ents[k] is k + evictCount + 1. // // Zero is not a valid unique id. // // evictCount should not overflow in any remotely practical situation. In // practice, we will have one dynamic table per HTTP/2 connection. If we // assume a very powerful server that handles 1M QPS per connection and each // request adds (then evicts) 100 entries from the table, it would still take // 2M years for evictCount to overflow. ents []HeaderField evictCount uint64 // byName maps a HeaderField name to the unique id of the newest entry with // the same name. See above for a definition of "unique id". byName map[string]uint64 // byNameValue maps a HeaderField name/value pair to the unique id of the newest // entry with the same name and value. See above for a definition of "unique id". byNameValue map[pairNameValue]uint64 } type pairNameValue struct { name, value string } func (t *headerFieldTable) init() { t.byName = make(map[string]uint64) t.byNameValue = make(map[pairNameValue]uint64) } // len reports the number of entries in the table. func (t *headerFieldTable) len() int { return len(t.ents) } // addEntry adds a new entry. func (t *headerFieldTable) addEntry(f HeaderField) { id := uint64(t.len()) + t.evictCount + 1 t.byName[f.Name] = id t.byNameValue[pairNameValue{f.Name, f.Value}] = id t.ents = append(t.ents, f) } // evictOldest evicts the n oldest entries in the table. func (t *headerFieldTable) evictOldest(n int) { if n > t.len() { panic(fmt.Sprintf("evictOldest(%v) on table with %v entries", n, t.len())) } for k := 0; k < n; k++ { f := t.ents[k] id := t.evictCount + uint64(k) + 1 if t.byName[f.Name] == id { delete(t.byName, f.Name) } if p := (pairNameValue{f.Name, f.Value}); t.byNameValue[p] == id { delete(t.byNameValue, p) } } copy(t.ents, t.ents[n:]) for k := t.len() - n; k < t.len(); k++ { t.ents[k] = HeaderField{} // so strings can be garbage collected } t.ents = t.ents[:t.len()-n] if t.evictCount+uint64(n) < t.evictCount { panic("evictCount overflow") } t.evictCount += uint64(n) } // search finds f in the table. If there is no match, i is 0. // If both name and value match, i is the matched index and nameValueMatch // becomes true. If only name matches, i points to that index and // nameValueMatch becomes false. // // The returned index is a 1-based HPACK index. For dynamic tables, HPACK says // that index 1 should be the newest entry, but t.ents[0] is the oldest entry, // meaning t.ents is reversed for dynamic tables. Hence, when t is a dynamic // table, the return value i actually refers to the entry t.ents[t.len()-i]. // // All tables are assumed to be a dynamic tables except for the global // staticTable pointer. // // See Section 2.3.3. func (t *headerFieldTable) search(f HeaderField) (i uint64, nameValueMatch bool) { if !f.Sensitive { if id := t.byNameValue[pairNameValue{f.Name, f.Value}]; id != 0 { return t.idToIndex(id), true } } if id := t.byName[f.Name]; id != 0 { return t.idToIndex(id), false } return 0, false } // idToIndex converts a unique id to an HPACK index. // See Section 2.3.3. func (t *headerFieldTable) idToIndex(id uint64) uint64 { if id <= t.evictCount { panic(fmt.Sprintf("id (%v) <= evictCount (%v)", id, t.evictCount)) } k := id - t.evictCount - 1 // convert id to an index t.ents[k] if t != staticTable { return uint64(t.len()) - k // dynamic table } return k + 1 } // http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B var staticTable = newStaticTable() var staticTableEntries = [...]HeaderField{ {Name: ":authority"}, {Name: ":method", Value: "GET"}, {Name: ":method", Value: "POST"}, {Name: ":path", Value: "/"}, {Name: ":path", Value: "/index.html"}, {Name: ":scheme", Value: "http"}, {Name: ":scheme", Value: "https"}, {Name: ":status", Value: "200"}, {Name: ":status", Value: "204"}, {Name: ":status", Value: "206"}, {Name: ":status", Value: "304"}, {Name: ":status", Value: "400"}, {Name: ":status", Value: "404"}, {Name: ":status", Value: "500"}, {Name: "accept-charset"}, {Name: "accept-encoding", Value: "gzip, deflate"}, {Name: "accept-language"}, {Name: "accept-ranges"}, {Name: "accept"}, {Name: "access-control-allow-origin"}, {Name: "age"}, {Name: "allow"}, {Name: "authorization"}, {Name: "cache-control"}, {Name: "content-disposition"}, {Name: "content-encoding"}, {Name: "content-language"}, {Name: "content-length"}, {Name: "content-location"}, {Name: "content-range"}, {Name: "content-type"}, {Name: "cookie"}, {Name: "date"}, {Name: "etag"}, {Name: "expect"}, {Name: "expires"}, {Name: "from"}, {Name: "host"}, {Name: "if-match"}, {Name: "if-modified-since"}, {Name: "if-none-match"}, {Name: "if-range"}, {Name: "if-unmodified-since"}, {Name: "last-modified"}, {Name: "link"}, {Name: "location"}, {Name: "max-forwards"}, {Name: "proxy-authenticate"}, {Name: "proxy-authorization"}, {Name: "range"}, {Name: "referer"}, {Name: "refresh"}, {Name: "retry-after"}, {Name: "server"}, {Name: "set-cookie"}, {Name: "strict-transport-security"}, {Name: "transfer-encoding"}, {Name: "user-agent"}, {Name: "vary"}, {Name: "via"}, {Name: "www-authenticate"}, } func newStaticTable() *headerFieldTable { t := &headerFieldTable{} t.init() for _, e := range staticTableEntries[:] { t.addEntry(e) } return t } var huffmanCodes = [256]uint32{ 0x1ff8, 0x7fffd8, 0xfffffe2, 0xfffffe3, 0xfffffe4, 0xfffffe5, 0xfffffe6, 0xfffffe7, 0xfffffe8, 0xffffea, 0x3ffffffc, 0xfffffe9, 0xfffffea, 0x3ffffffd, 0xfffffeb, 0xfffffec, 0xfffffed, 0xfffffee, 0xfffffef, 0xffffff0, 0xffffff1, 0xffffff2, 0x3ffffffe, 0xffffff3, 0xffffff4, 0xffffff5, 0xffffff6, 0xffffff7, 0xffffff8, 0xffffff9, 0xffffffa, 0xffffffb, 0x14, 0x3f8, 0x3f9, 0xffa, 0x1ff9, 0x15, 0xf8, 0x7fa, 0x3fa, 0x3fb, 0xf9, 0x7fb, 0xfa, 0x16, 0x17, 0x18, 0x0, 0x1, 0x2, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x5c, 0xfb, 0x7ffc, 0x20, 0xffb, 0x3fc, 0x1ffa, 0x21, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0xfc, 0x73, 0xfd, 0x1ffb, 0x7fff0, 0x1ffc, 0x3ffc, 0x22, 0x7ffd, 0x3, 0x23, 0x4, 0x24, 0x5, 0x25, 0x26, 0x27, 0x6, 0x74, 0x75, 0x28, 0x29, 0x2a, 0x7, 0x2b, 0x76, 0x2c, 0x8, 0x9, 0x2d, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7ffe, 0x7fc, 0x3ffd, 0x1ffd, 0xffffffc, 0xfffe6, 0x3fffd2, 0xfffe7, 0xfffe8, 0x3fffd3, 0x3fffd4, 0x3fffd5, 0x7fffd9, 0x3fffd6, 0x7fffda, 0x7fffdb, 0x7fffdc, 0x7fffdd, 0x7fffde, 0xffffeb, 0x7fffdf, 0xffffec, 0xffffed, 0x3fffd7, 0x7fffe0, 0xffffee, 0x7fffe1, 0x7fffe2, 0x7fffe3, 0x7fffe4, 0x1fffdc, 0x3fffd8, 0x7fffe5, 0x3fffd9, 0x7fffe6, 0x7fffe7, 0xffffef, 0x3fffda, 0x1fffdd, 0xfffe9, 0x3fffdb, 0x3fffdc, 0x7fffe8, 0x7fffe9, 0x1fffde, 0x7fffea, 0x3fffdd, 0x3fffde, 0xfffff0, 0x1fffdf, 0x3fffdf, 0x7fffeb, 0x7fffec, 0x1fffe0, 0x1fffe1, 0x3fffe0, 0x1fffe2, 0x7fffed, 0x3fffe1, 0x7fffee, 0x7fffef, 0xfffea, 0x3fffe2, 0x3fffe3, 0x3fffe4, 0x7ffff0, 0x3fffe5, 0x3fffe6, 0x7ffff1, 0x3ffffe0, 0x3ffffe1, 0xfffeb, 0x7fff1, 0x3fffe7, 0x7ffff2, 0x3fffe8, 0x1ffffec, 0x3ffffe2, 0x3ffffe3, 0x3ffffe4, 0x7ffffde, 0x7ffffdf, 0x3ffffe5, 0xfffff1, 0x1ffffed, 0x7fff2, 0x1fffe3, 0x3ffffe6, 0x7ffffe0, 0x7ffffe1, 0x3ffffe7, 0x7ffffe2, 0xfffff2, 0x1fffe4, 0x1fffe5, 0x3ffffe8, 0x3ffffe9, 0xffffffd, 0x7ffffe3, 0x7ffffe4, 0x7ffffe5, 0xfffec, 0xfffff3, 0xfffed, 0x1fffe6, 0x3fffe9, 0x1fffe7, 0x1fffe8, 0x7ffff3, 0x3fffea, 0x3fffeb, 0x1ffffee, 0x1ffffef, 0xfffff4, 0xfffff5, 0x3ffffea, 0x7ffff4, 0x3ffffeb, 0x7ffffe6, 0x3ffffec, 0x3ffffed, 0x7ffffe7, 0x7ffffe8, 0x7ffffe9, 0x7ffffea, 0x7ffffeb, 0xffffffe, 0x7ffffec, 0x7ffffed, 0x7ffffee, 0x7ffffef, 0x7fffff0, 0x3ffffee, } var huffmanCodeLen = [256]uint8{ 13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, 6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10, 13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6, 15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5, 6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28, 20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23, 24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24, 22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23, 21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23, 26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25, 19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27, 20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23, 26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26, } ================================================ FILE: vendor/golang.org/x/net/http2/http2.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package http2 implements the HTTP/2 protocol. // // This package is low-level and intended to be used directly by very // few people. Most users will use it indirectly through the automatic // use by the net/http package (from Go 1.6 and later). // For use in earlier Go versions see ConfigureServer. (Transport support // requires Go 1.6 or later) // // See https://http2.github.io/ for more information on HTTP/2. // // See https://http2.golang.org/ for a test server running this code. // package http2 // import "golang.org/x/net/http2" import ( "bufio" "crypto/tls" "errors" "fmt" "io" "net/http" "os" "sort" "strconv" "strings" "sync" "golang.org/x/net/http/httpguts" ) var ( VerboseLogs bool logFrameWrites bool logFrameReads bool inTests bool ) func init() { e := os.Getenv("GODEBUG") if strings.Contains(e, "http2debug=1") { VerboseLogs = true } if strings.Contains(e, "http2debug=2") { VerboseLogs = true logFrameWrites = true logFrameReads = true } } const ( // ClientPreface is the string that must be sent by new // connections from clients. ClientPreface = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" // SETTINGS_MAX_FRAME_SIZE default // http://http2.github.io/http2-spec/#rfc.section.6.5.2 initialMaxFrameSize = 16384 // NextProtoTLS is the NPN/ALPN protocol negotiated during // HTTP/2's TLS setup. NextProtoTLS = "h2" // http://http2.github.io/http2-spec/#SettingValues initialHeaderTableSize = 4096 initialWindowSize = 65535 // 6.9.2 Initial Flow Control Window Size defaultMaxReadFrameSize = 1 << 20 ) var ( clientPreface = []byte(ClientPreface) ) type streamState int // HTTP/2 stream states. // // See http://tools.ietf.org/html/rfc7540#section-5.1. // // For simplicity, the server code merges "reserved (local)" into // "half-closed (remote)". This is one less state transition to track. // The only downside is that we send PUSH_PROMISEs slightly less // liberally than allowable. More discussion here: // https://lists.w3.org/Archives/Public/ietf-http-wg/2016JulSep/0599.html // // "reserved (remote)" is omitted since the client code does not // support server push. const ( stateIdle streamState = iota stateOpen stateHalfClosedLocal stateHalfClosedRemote stateClosed ) var stateName = [...]string{ stateIdle: "Idle", stateOpen: "Open", stateHalfClosedLocal: "HalfClosedLocal", stateHalfClosedRemote: "HalfClosedRemote", stateClosed: "Closed", } func (st streamState) String() string { return stateName[st] } // Setting is a setting parameter: which setting it is, and its value. type Setting struct { // ID is which setting is being set. // See http://http2.github.io/http2-spec/#SettingValues ID SettingID // Val is the value. Val uint32 } func (s Setting) String() string { return fmt.Sprintf("[%v = %d]", s.ID, s.Val) } // Valid reports whether the setting is valid. func (s Setting) Valid() error { // Limits and error codes from 6.5.2 Defined SETTINGS Parameters switch s.ID { case SettingEnablePush: if s.Val != 1 && s.Val != 0 { return ConnectionError(ErrCodeProtocol) } case SettingInitialWindowSize: if s.Val > 1<<31-1 { return ConnectionError(ErrCodeFlowControl) } case SettingMaxFrameSize: if s.Val < 16384 || s.Val > 1<<24-1 { return ConnectionError(ErrCodeProtocol) } } return nil } // A SettingID is an HTTP/2 setting as defined in // http://http2.github.io/http2-spec/#iana-settings type SettingID uint16 const ( SettingHeaderTableSize SettingID = 0x1 SettingEnablePush SettingID = 0x2 SettingMaxConcurrentStreams SettingID = 0x3 SettingInitialWindowSize SettingID = 0x4 SettingMaxFrameSize SettingID = 0x5 SettingMaxHeaderListSize SettingID = 0x6 ) var settingName = map[SettingID]string{ SettingHeaderTableSize: "HEADER_TABLE_SIZE", SettingEnablePush: "ENABLE_PUSH", SettingMaxConcurrentStreams: "MAX_CONCURRENT_STREAMS", SettingInitialWindowSize: "INITIAL_WINDOW_SIZE", SettingMaxFrameSize: "MAX_FRAME_SIZE", SettingMaxHeaderListSize: "MAX_HEADER_LIST_SIZE", } func (s SettingID) String() string { if v, ok := settingName[s]; ok { return v } return fmt.Sprintf("UNKNOWN_SETTING_%d", uint16(s)) } var ( errInvalidHeaderFieldName = errors.New("http2: invalid header field name") errInvalidHeaderFieldValue = errors.New("http2: invalid header field value") ) // validWireHeaderFieldName reports whether v is a valid header field // name (key). See httpguts.ValidHeaderName for the base rules. // // Further, http2 says: // "Just as in HTTP/1.x, header field names are strings of ASCII // characters that are compared in a case-insensitive // fashion. However, header field names MUST be converted to // lowercase prior to their encoding in HTTP/2. " func validWireHeaderFieldName(v string) bool { if len(v) == 0 { return false } for _, r := range v { if !httpguts.IsTokenRune(r) { return false } if 'A' <= r && r <= 'Z' { return false } } return true } func httpCodeString(code int) string { switch code { case 200: return "200" case 404: return "404" } return strconv.Itoa(code) } // from pkg io type stringWriter interface { WriteString(s string) (n int, err error) } // A gate lets two goroutines coordinate their activities. type gate chan struct{} func (g gate) Done() { g <- struct{}{} } func (g gate) Wait() { <-g } // A closeWaiter is like a sync.WaitGroup but only goes 1 to 0 (open to closed). type closeWaiter chan struct{} // Init makes a closeWaiter usable. // It exists because so a closeWaiter value can be placed inside a // larger struct and have the Mutex and Cond's memory in the same // allocation. func (cw *closeWaiter) Init() { *cw = make(chan struct{}) } // Close marks the closeWaiter as closed and unblocks any waiters. func (cw closeWaiter) Close() { close(cw) } // Wait waits for the closeWaiter to become closed. func (cw closeWaiter) Wait() { <-cw } // bufferedWriter is a buffered writer that writes to w. // Its buffered writer is lazily allocated as needed, to minimize // idle memory usage with many connections. type bufferedWriter struct { w io.Writer // immutable bw *bufio.Writer // non-nil when data is buffered } func newBufferedWriter(w io.Writer) *bufferedWriter { return &bufferedWriter{w: w} } // bufWriterPoolBufferSize is the size of bufio.Writer's // buffers created using bufWriterPool. // // TODO: pick a less arbitrary value? this is a bit under // (3 x typical 1500 byte MTU) at least. Other than that, // not much thought went into it. const bufWriterPoolBufferSize = 4 << 10 var bufWriterPool = sync.Pool{ New: func() interface{} { return bufio.NewWriterSize(nil, bufWriterPoolBufferSize) }, } func (w *bufferedWriter) Available() int { if w.bw == nil { return bufWriterPoolBufferSize } return w.bw.Available() } func (w *bufferedWriter) Write(p []byte) (n int, err error) { if w.bw == nil { bw := bufWriterPool.Get().(*bufio.Writer) bw.Reset(w.w) w.bw = bw } return w.bw.Write(p) } func (w *bufferedWriter) Flush() error { bw := w.bw if bw == nil { return nil } err := bw.Flush() bw.Reset(nil) bufWriterPool.Put(bw) w.bw = nil return err } func mustUint31(v int32) uint32 { if v < 0 || v > 2147483647 { panic("out of range") } return uint32(v) } // bodyAllowedForStatus reports whether a given response status code // permits a body. See RFC 7230, section 3.3. func bodyAllowedForStatus(status int) bool { switch { case status >= 100 && status <= 199: return false case status == 204: return false case status == 304: return false } return true } type httpError struct { msg string timeout bool } func (e *httpError) Error() string { return e.msg } func (e *httpError) Timeout() bool { return e.timeout } func (e *httpError) Temporary() bool { return true } var errTimeout error = &httpError{msg: "http2: timeout awaiting response headers", timeout: true} type connectionStater interface { ConnectionState() tls.ConnectionState } var sorterPool = sync.Pool{New: func() interface{} { return new(sorter) }} type sorter struct { v []string // owned by sorter } func (s *sorter) Len() int { return len(s.v) } func (s *sorter) Swap(i, j int) { s.v[i], s.v[j] = s.v[j], s.v[i] } func (s *sorter) Less(i, j int) bool { return s.v[i] < s.v[j] } // Keys returns the sorted keys of h. // // The returned slice is only valid until s used again or returned to // its pool. func (s *sorter) Keys(h http.Header) []string { keys := s.v[:0] for k := range h { keys = append(keys, k) } s.v = keys sort.Sort(s) return keys } func (s *sorter) SortStrings(ss []string) { // Our sorter works on s.v, which sorter owns, so // stash it away while we sort the user's buffer. save := s.v s.v = ss sort.Sort(s) s.v = save } // validPseudoPath reports whether v is a valid :path pseudo-header // value. It must be either: // // *) a non-empty string starting with '/' // *) the string '*', for OPTIONS requests. // // For now this is only used a quick check for deciding when to clean // up Opaque URLs before sending requests from the Transport. // See golang.org/issue/16847 // // We used to enforce that the path also didn't start with "//", but // Google's GFE accepts such paths and Chrome sends them, so ignore // that part of the spec. See golang.org/issue/19103. func validPseudoPath(v string) bool { return (len(v) > 0 && v[0] == '/') || v == "*" } ================================================ FILE: vendor/golang.org/x/net/http2/not_go111.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !go1.11 package http2 import ( "net/http/httptrace" "net/textproto" ) func traceHasWroteHeaderField(trace *httptrace.ClientTrace) bool { return false } func traceWroteHeaderField(trace *httptrace.ClientTrace, k, v string) {} func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error { return nil } ================================================ FILE: vendor/golang.org/x/net/http2/pipe.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "errors" "io" "sync" ) // pipe is a goroutine-safe io.Reader/io.Writer pair. It's like // io.Pipe except there are no PipeReader/PipeWriter halves, and the // underlying buffer is an interface. (io.Pipe is always unbuffered) type pipe struct { mu sync.Mutex c sync.Cond // c.L lazily initialized to &p.mu b pipeBuffer // nil when done reading err error // read error once empty. non-nil means closed. breakErr error // immediate read error (caller doesn't see rest of b) donec chan struct{} // closed on error readFn func() // optional code to run in Read before error } type pipeBuffer interface { Len() int io.Writer io.Reader } func (p *pipe) Len() int { p.mu.Lock() defer p.mu.Unlock() if p.b == nil { return 0 } return p.b.Len() } // Read waits until data is available and copies bytes // from the buffer into p. func (p *pipe) Read(d []byte) (n int, err error) { p.mu.Lock() defer p.mu.Unlock() if p.c.L == nil { p.c.L = &p.mu } for { if p.breakErr != nil { return 0, p.breakErr } if p.b != nil && p.b.Len() > 0 { return p.b.Read(d) } if p.err != nil { if p.readFn != nil { p.readFn() // e.g. copy trailers p.readFn = nil // not sticky like p.err } p.b = nil return 0, p.err } p.c.Wait() } } var errClosedPipeWrite = errors.New("write on closed buffer") // Write copies bytes from p into the buffer and wakes a reader. // It is an error to write more data than the buffer can hold. func (p *pipe) Write(d []byte) (n int, err error) { p.mu.Lock() defer p.mu.Unlock() if p.c.L == nil { p.c.L = &p.mu } defer p.c.Signal() if p.err != nil { return 0, errClosedPipeWrite } if p.breakErr != nil { return len(d), nil // discard when there is no reader } return p.b.Write(d) } // CloseWithError causes the next Read (waking up a current blocked // Read if needed) to return the provided err after all data has been // read. // // The error must be non-nil. func (p *pipe) CloseWithError(err error) { p.closeWithError(&p.err, err, nil) } // BreakWithError causes the next Read (waking up a current blocked // Read if needed) to return the provided err immediately, without // waiting for unread data. func (p *pipe) BreakWithError(err error) { p.closeWithError(&p.breakErr, err, nil) } // closeWithErrorAndCode is like CloseWithError but also sets some code to run // in the caller's goroutine before returning the error. func (p *pipe) closeWithErrorAndCode(err error, fn func()) { p.closeWithError(&p.err, err, fn) } func (p *pipe) closeWithError(dst *error, err error, fn func()) { if err == nil { panic("err must be non-nil") } p.mu.Lock() defer p.mu.Unlock() if p.c.L == nil { p.c.L = &p.mu } defer p.c.Signal() if *dst != nil { // Already been done. return } p.readFn = fn if dst == &p.breakErr { p.b = nil } *dst = err p.closeDoneLocked() } // requires p.mu be held. func (p *pipe) closeDoneLocked() { if p.donec == nil { return } // Close if unclosed. This isn't racy since we always // hold p.mu while closing. select { case <-p.donec: default: close(p.donec) } } // Err returns the error (if any) first set by BreakWithError or CloseWithError. func (p *pipe) Err() error { p.mu.Lock() defer p.mu.Unlock() if p.breakErr != nil { return p.breakErr } return p.err } // Done returns a channel which is closed if and when this pipe is closed // with CloseWithError. func (p *pipe) Done() <-chan struct{} { p.mu.Lock() defer p.mu.Unlock() if p.donec == nil { p.donec = make(chan struct{}) if p.err != nil || p.breakErr != nil { // Already hit an error. p.closeDoneLocked() } } return p.donec } ================================================ FILE: vendor/golang.org/x/net/http2/server.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // TODO: turn off the serve goroutine when idle, so // an idle conn only has the readFrames goroutine active. (which could // also be optimized probably to pin less memory in crypto/tls). This // would involve tracking when the serve goroutine is active (atomic // int32 read/CAS probably?) and starting it up when frames arrive, // and shutting it down when all handlers exit. the occasional PING // packets could use time.AfterFunc to call sc.wakeStartServeLoop() // (which is a no-op if already running) and then queue the PING write // as normal. The serve loop would then exit in most cases (if no // Handlers running) and not be woken up again until the PING packet // returns. // TODO (maybe): add a mechanism for Handlers to going into // half-closed-local mode (rw.(io.Closer) test?) but not exit their // handler, and continue to be able to read from the // Request.Body. This would be a somewhat semantic change from HTTP/1 // (or at least what we expose in net/http), so I'd probably want to // add it there too. For now, this package says that returning from // the Handler ServeHTTP function means you're both done reading and // done writing, without a way to stop just one or the other. package http2 import ( "bufio" "bytes" "context" "crypto/tls" "errors" "fmt" "io" "log" "math" "net" "net/http" "net/textproto" "net/url" "os" "reflect" "runtime" "strconv" "strings" "sync" "time" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" ) const ( prefaceTimeout = 10 * time.Second firstSettingsTimeout = 2 * time.Second // should be in-flight with preface anyway handlerChunkWriteSize = 4 << 10 defaultMaxStreams = 250 // TODO: make this 100 as the GFE seems to? ) var ( errClientDisconnected = errors.New("client disconnected") errClosedBody = errors.New("body closed by handler") errHandlerComplete = errors.New("http2: request body closed due to handler exiting") errStreamClosed = errors.New("http2: stream closed") ) var responseWriterStatePool = sync.Pool{ New: func() interface{} { rws := &responseWriterState{} rws.bw = bufio.NewWriterSize(chunkWriter{rws}, handlerChunkWriteSize) return rws }, } // Test hooks. var ( testHookOnConn func() testHookGetServerConn func(*serverConn) testHookOnPanicMu *sync.Mutex // nil except in tests testHookOnPanic func(sc *serverConn, panicVal interface{}) (rePanic bool) ) // Server is an HTTP/2 server. type Server struct { // MaxHandlers limits the number of http.Handler ServeHTTP goroutines // which may run at a time over all connections. // Negative or zero no limit. // TODO: implement MaxHandlers int // MaxConcurrentStreams optionally specifies the number of // concurrent streams that each client may have open at a // time. This is unrelated to the number of http.Handler goroutines // which may be active globally, which is MaxHandlers. // If zero, MaxConcurrentStreams defaults to at least 100, per // the HTTP/2 spec's recommendations. MaxConcurrentStreams uint32 // MaxReadFrameSize optionally specifies the largest frame // this server is willing to read. A valid value is between // 16k and 16M, inclusive. If zero or otherwise invalid, a // default value is used. MaxReadFrameSize uint32 // PermitProhibitedCipherSuites, if true, permits the use of // cipher suites prohibited by the HTTP/2 spec. PermitProhibitedCipherSuites bool // IdleTimeout specifies how long until idle clients should be // closed with a GOAWAY frame. PING frames are not considered // activity for the purposes of IdleTimeout. IdleTimeout time.Duration // MaxUploadBufferPerConnection is the size of the initial flow // control window for each connections. The HTTP/2 spec does not // allow this to be smaller than 65535 or larger than 2^32-1. // If the value is outside this range, a default value will be // used instead. MaxUploadBufferPerConnection int32 // MaxUploadBufferPerStream is the size of the initial flow control // window for each stream. The HTTP/2 spec does not allow this to // be larger than 2^32-1. If the value is zero or larger than the // maximum, a default value will be used instead. MaxUploadBufferPerStream int32 // NewWriteScheduler constructs a write scheduler for a connection. // If nil, a default scheduler is chosen. NewWriteScheduler func() WriteScheduler // Internal state. This is a pointer (rather than embedded directly) // so that we don't embed a Mutex in this struct, which will make the // struct non-copyable, which might break some callers. state *serverInternalState } func (s *Server) initialConnRecvWindowSize() int32 { if s.MaxUploadBufferPerConnection > initialWindowSize { return s.MaxUploadBufferPerConnection } return 1 << 20 } func (s *Server) initialStreamRecvWindowSize() int32 { if s.MaxUploadBufferPerStream > 0 { return s.MaxUploadBufferPerStream } return 1 << 20 } func (s *Server) maxReadFrameSize() uint32 { if v := s.MaxReadFrameSize; v >= minMaxFrameSize && v <= maxFrameSize { return v } return defaultMaxReadFrameSize } func (s *Server) maxConcurrentStreams() uint32 { if v := s.MaxConcurrentStreams; v > 0 { return v } return defaultMaxStreams } type serverInternalState struct { mu sync.Mutex activeConns map[*serverConn]struct{} } func (s *serverInternalState) registerConn(sc *serverConn) { if s == nil { return // if the Server was used without calling ConfigureServer } s.mu.Lock() s.activeConns[sc] = struct{}{} s.mu.Unlock() } func (s *serverInternalState) unregisterConn(sc *serverConn) { if s == nil { return // if the Server was used without calling ConfigureServer } s.mu.Lock() delete(s.activeConns, sc) s.mu.Unlock() } func (s *serverInternalState) startGracefulShutdown() { if s == nil { return // if the Server was used without calling ConfigureServer } s.mu.Lock() for sc := range s.activeConns { sc.startGracefulShutdown() } s.mu.Unlock() } // ConfigureServer adds HTTP/2 support to a net/http Server. // // The configuration conf may be nil. // // ConfigureServer must be called before s begins serving. func ConfigureServer(s *http.Server, conf *Server) error { if s == nil { panic("nil *http.Server") } if conf == nil { conf = new(Server) } conf.state = &serverInternalState{activeConns: make(map[*serverConn]struct{})} if h1, h2 := s, conf; h2.IdleTimeout == 0 { if h1.IdleTimeout != 0 { h2.IdleTimeout = h1.IdleTimeout } else { h2.IdleTimeout = h1.ReadTimeout } } s.RegisterOnShutdown(conf.state.startGracefulShutdown) if s.TLSConfig == nil { s.TLSConfig = new(tls.Config) } else if s.TLSConfig.CipherSuites != nil { // If they already provided a CipherSuite list, return // an error if it has a bad order or is missing // ECDHE_RSA_WITH_AES_128_GCM_SHA256 or ECDHE_ECDSA_WITH_AES_128_GCM_SHA256. haveRequired := false sawBad := false for i, cs := range s.TLSConfig.CipherSuites { switch cs { case tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, // Alternative MTI cipher to not discourage ECDSA-only servers. // See http://golang.org/cl/30721 for further information. tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: haveRequired = true } if isBadCipher(cs) { sawBad = true } else if sawBad { return fmt.Errorf("http2: TLSConfig.CipherSuites index %d contains an HTTP/2-approved cipher suite (%#04x), but it comes after unapproved cipher suites. With this configuration, clients that don't support previous, approved cipher suites may be given an unapproved one and reject the connection.", i, cs) } } if !haveRequired { return fmt.Errorf("http2: TLSConfig.CipherSuites is missing an HTTP/2-required AES_128_GCM_SHA256 cipher.") } } // Note: not setting MinVersion to tls.VersionTLS12, // as we don't want to interfere with HTTP/1.1 traffic // on the user's server. We enforce TLS 1.2 later once // we accept a connection. Ideally this should be done // during next-proto selection, but using TLS <1.2 with // HTTP/2 is still the client's bug. s.TLSConfig.PreferServerCipherSuites = true haveNPN := false for _, p := range s.TLSConfig.NextProtos { if p == NextProtoTLS { haveNPN = true break } } if !haveNPN { s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, NextProtoTLS) } if s.TLSNextProto == nil { s.TLSNextProto = map[string]func(*http.Server, *tls.Conn, http.Handler){} } protoHandler := func(hs *http.Server, c *tls.Conn, h http.Handler) { if testHookOnConn != nil { testHookOnConn() } // The TLSNextProto interface predates contexts, so // the net/http package passes down its per-connection // base context via an exported but unadvertised // method on the Handler. This is for internal // net/http<=>http2 use only. var ctx context.Context type baseContexter interface { BaseContext() context.Context } if bc, ok := h.(baseContexter); ok { ctx = bc.BaseContext() } conf.ServeConn(c, &ServeConnOpts{ Context: ctx, Handler: h, BaseConfig: hs, }) } s.TLSNextProto[NextProtoTLS] = protoHandler return nil } // ServeConnOpts are options for the Server.ServeConn method. type ServeConnOpts struct { // Context is the base context to use. // If nil, context.Background is used. Context context.Context // BaseConfig optionally sets the base configuration // for values. If nil, defaults are used. BaseConfig *http.Server // Handler specifies which handler to use for processing // requests. If nil, BaseConfig.Handler is used. If BaseConfig // or BaseConfig.Handler is nil, http.DefaultServeMux is used. Handler http.Handler } func (o *ServeConnOpts) context() context.Context { if o.Context != nil { return o.Context } return context.Background() } func (o *ServeConnOpts) baseConfig() *http.Server { if o != nil && o.BaseConfig != nil { return o.BaseConfig } return new(http.Server) } func (o *ServeConnOpts) handler() http.Handler { if o != nil { if o.Handler != nil { return o.Handler } if o.BaseConfig != nil && o.BaseConfig.Handler != nil { return o.BaseConfig.Handler } } return http.DefaultServeMux } // ServeConn serves HTTP/2 requests on the provided connection and // blocks until the connection is no longer readable. // // ServeConn starts speaking HTTP/2 assuming that c has not had any // reads or writes. It writes its initial settings frame and expects // to be able to read the preface and settings frame from the // client. If c has a ConnectionState method like a *tls.Conn, the // ConnectionState is used to verify the TLS ciphersuite and to set // the Request.TLS field in Handlers. // // ServeConn does not support h2c by itself. Any h2c support must be // implemented in terms of providing a suitably-behaving net.Conn. // // The opts parameter is optional. If nil, default values are used. func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { baseCtx, cancel := serverConnBaseContext(c, opts) defer cancel() sc := &serverConn{ srv: s, hs: opts.baseConfig(), conn: c, baseCtx: baseCtx, remoteAddrStr: c.RemoteAddr().String(), bw: newBufferedWriter(c), handler: opts.handler(), streams: make(map[uint32]*stream), readFrameCh: make(chan readFrameResult), wantWriteFrameCh: make(chan FrameWriteRequest, 8), serveMsgCh: make(chan interface{}, 8), wroteFrameCh: make(chan frameWriteResult, 1), // buffered; one send in writeFrameAsync bodyReadCh: make(chan bodyReadMsg), // buffering doesn't matter either way doneServing: make(chan struct{}), clientMaxStreams: math.MaxUint32, // Section 6.5.2: "Initially, there is no limit to this value" advMaxStreams: s.maxConcurrentStreams(), initialStreamSendWindowSize: initialWindowSize, maxFrameSize: initialMaxFrameSize, headerTableSize: initialHeaderTableSize, serveG: newGoroutineLock(), pushEnabled: true, } s.state.registerConn(sc) defer s.state.unregisterConn(sc) // The net/http package sets the write deadline from the // http.Server.WriteTimeout during the TLS handshake, but then // passes the connection off to us with the deadline already set. // Write deadlines are set per stream in serverConn.newStream. // Disarm the net.Conn write deadline here. if sc.hs.WriteTimeout != 0 { sc.conn.SetWriteDeadline(time.Time{}) } if s.NewWriteScheduler != nil { sc.writeSched = s.NewWriteScheduler() } else { sc.writeSched = NewRandomWriteScheduler() } // These start at the RFC-specified defaults. If there is a higher // configured value for inflow, that will be updated when we send a // WINDOW_UPDATE shortly after sending SETTINGS. sc.flow.add(initialWindowSize) sc.inflow.add(initialWindowSize) sc.hpackEncoder = hpack.NewEncoder(&sc.headerWriteBuf) fr := NewFramer(sc.bw, c) fr.ReadMetaHeaders = hpack.NewDecoder(initialHeaderTableSize, nil) fr.MaxHeaderListSize = sc.maxHeaderListSize() fr.SetMaxReadFrameSize(s.maxReadFrameSize()) sc.framer = fr if tc, ok := c.(connectionStater); ok { sc.tlsState = new(tls.ConnectionState) *sc.tlsState = tc.ConnectionState() // 9.2 Use of TLS Features // An implementation of HTTP/2 over TLS MUST use TLS // 1.2 or higher with the restrictions on feature set // and cipher suite described in this section. Due to // implementation limitations, it might not be // possible to fail TLS negotiation. An endpoint MUST // immediately terminate an HTTP/2 connection that // does not meet the TLS requirements described in // this section with a connection error (Section // 5.4.1) of type INADEQUATE_SECURITY. if sc.tlsState.Version < tls.VersionTLS12 { sc.rejectConn(ErrCodeInadequateSecurity, "TLS version too low") return } if sc.tlsState.ServerName == "" { // Client must use SNI, but we don't enforce that anymore, // since it was causing problems when connecting to bare IP // addresses during development. // // TODO: optionally enforce? Or enforce at the time we receive // a new request, and verify the ServerName matches the :authority? // But that precludes proxy situations, perhaps. // // So for now, do nothing here again. } if !s.PermitProhibitedCipherSuites && isBadCipher(sc.tlsState.CipherSuite) { // "Endpoints MAY choose to generate a connection error // (Section 5.4.1) of type INADEQUATE_SECURITY if one of // the prohibited cipher suites are negotiated." // // We choose that. In my opinion, the spec is weak // here. It also says both parties must support at least // TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 so there's no // excuses here. If we really must, we could allow an // "AllowInsecureWeakCiphers" option on the server later. // Let's see how it plays out first. sc.rejectConn(ErrCodeInadequateSecurity, fmt.Sprintf("Prohibited TLS 1.2 Cipher Suite: %x", sc.tlsState.CipherSuite)) return } } if hook := testHookGetServerConn; hook != nil { hook(sc) } sc.serve() } func serverConnBaseContext(c net.Conn, opts *ServeConnOpts) (ctx context.Context, cancel func()) { ctx, cancel = context.WithCancel(opts.context()) ctx = context.WithValue(ctx, http.LocalAddrContextKey, c.LocalAddr()) if hs := opts.baseConfig(); hs != nil { ctx = context.WithValue(ctx, http.ServerContextKey, hs) } return } func (sc *serverConn) rejectConn(err ErrCode, debug string) { sc.vlogf("http2: server rejecting conn: %v, %s", err, debug) // ignoring errors. hanging up anyway. sc.framer.WriteGoAway(0, err, []byte(debug)) sc.bw.Flush() sc.conn.Close() } type serverConn struct { // Immutable: srv *Server hs *http.Server conn net.Conn bw *bufferedWriter // writing to conn handler http.Handler baseCtx context.Context framer *Framer doneServing chan struct{} // closed when serverConn.serve ends readFrameCh chan readFrameResult // written by serverConn.readFrames wantWriteFrameCh chan FrameWriteRequest // from handlers -> serve wroteFrameCh chan frameWriteResult // from writeFrameAsync -> serve, tickles more frame writes bodyReadCh chan bodyReadMsg // from handlers -> serve serveMsgCh chan interface{} // misc messages & code to send to / run on the serve loop flow flow // conn-wide (not stream-specific) outbound flow control inflow flow // conn-wide inbound flow control tlsState *tls.ConnectionState // shared by all handlers, like net/http remoteAddrStr string writeSched WriteScheduler // Everything following is owned by the serve loop; use serveG.check(): serveG goroutineLock // used to verify funcs are on serve() pushEnabled bool sawFirstSettings bool // got the initial SETTINGS frame after the preface needToSendSettingsAck bool unackedSettings int // how many SETTINGS have we sent without ACKs? clientMaxStreams uint32 // SETTINGS_MAX_CONCURRENT_STREAMS from client (our PUSH_PROMISE limit) advMaxStreams uint32 // our SETTINGS_MAX_CONCURRENT_STREAMS advertised the client curClientStreams uint32 // number of open streams initiated by the client curPushedStreams uint32 // number of open streams initiated by server push maxClientStreamID uint32 // max ever seen from client (odd), or 0 if there have been no client requests maxPushPromiseID uint32 // ID of the last push promise (even), or 0 if there have been no pushes streams map[uint32]*stream initialStreamSendWindowSize int32 maxFrameSize int32 headerTableSize uint32 peerMaxHeaderListSize uint32 // zero means unknown (default) canonHeader map[string]string // http2-lower-case -> Go-Canonical-Case writingFrame bool // started writing a frame (on serve goroutine or separate) writingFrameAsync bool // started a frame on its own goroutine but haven't heard back on wroteFrameCh needsFrameFlush bool // last frame write wasn't a flush inGoAway bool // we've started to or sent GOAWAY inFrameScheduleLoop bool // whether we're in the scheduleFrameWrite loop needToSendGoAway bool // we need to schedule a GOAWAY frame write goAwayCode ErrCode shutdownTimer *time.Timer // nil until used idleTimer *time.Timer // nil if unused // Owned by the writeFrameAsync goroutine: headerWriteBuf bytes.Buffer hpackEncoder *hpack.Encoder // Used by startGracefulShutdown. shutdownOnce sync.Once } func (sc *serverConn) maxHeaderListSize() uint32 { n := sc.hs.MaxHeaderBytes if n <= 0 { n = http.DefaultMaxHeaderBytes } // http2's count is in a slightly different unit and includes 32 bytes per pair. // So, take the net/http.Server value and pad it up a bit, assuming 10 headers. const perFieldOverhead = 32 // per http2 spec const typicalHeaders = 10 // conservative return uint32(n + typicalHeaders*perFieldOverhead) } func (sc *serverConn) curOpenStreams() uint32 { sc.serveG.check() return sc.curClientStreams + sc.curPushedStreams } // stream represents a stream. This is the minimal metadata needed by // the serve goroutine. Most of the actual stream state is owned by // the http.Handler's goroutine in the responseWriter. Because the // responseWriter's responseWriterState is recycled at the end of a // handler, this struct intentionally has no pointer to the // *responseWriter{,State} itself, as the Handler ending nils out the // responseWriter's state field. type stream struct { // immutable: sc *serverConn id uint32 body *pipe // non-nil if expecting DATA frames cw closeWaiter // closed wait stream transitions to closed state ctx context.Context cancelCtx func() // owned by serverConn's serve loop: bodyBytes int64 // body bytes seen so far declBodyBytes int64 // or -1 if undeclared flow flow // limits writing from Handler to client inflow flow // what the client is allowed to POST/etc to us parent *stream // or nil numTrailerValues int64 weight uint8 state streamState resetQueued bool // RST_STREAM queued for write; set by sc.resetStream gotTrailerHeader bool // HEADER frame for trailers was seen wroteHeaders bool // whether we wrote headers (not status 100) writeDeadline *time.Timer // nil if unused trailer http.Header // accumulated trailers reqTrailer http.Header // handler's Request.Trailer } func (sc *serverConn) Framer() *Framer { return sc.framer } func (sc *serverConn) CloseConn() error { return sc.conn.Close() } func (sc *serverConn) Flush() error { return sc.bw.Flush() } func (sc *serverConn) HeaderEncoder() (*hpack.Encoder, *bytes.Buffer) { return sc.hpackEncoder, &sc.headerWriteBuf } func (sc *serverConn) state(streamID uint32) (streamState, *stream) { sc.serveG.check() // http://tools.ietf.org/html/rfc7540#section-5.1 if st, ok := sc.streams[streamID]; ok { return st.state, st } // "The first use of a new stream identifier implicitly closes all // streams in the "idle" state that might have been initiated by // that peer with a lower-valued stream identifier. For example, if // a client sends a HEADERS frame on stream 7 without ever sending a // frame on stream 5, then stream 5 transitions to the "closed" // state when the first frame for stream 7 is sent or received." if streamID%2 == 1 { if streamID <= sc.maxClientStreamID { return stateClosed, nil } } else { if streamID <= sc.maxPushPromiseID { return stateClosed, nil } } return stateIdle, nil } // setConnState calls the net/http ConnState hook for this connection, if configured. // Note that the net/http package does StateNew and StateClosed for us. // There is currently no plan for StateHijacked or hijacking HTTP/2 connections. func (sc *serverConn) setConnState(state http.ConnState) { if sc.hs.ConnState != nil { sc.hs.ConnState(sc.conn, state) } } func (sc *serverConn) vlogf(format string, args ...interface{}) { if VerboseLogs { sc.logf(format, args...) } } func (sc *serverConn) logf(format string, args ...interface{}) { if lg := sc.hs.ErrorLog; lg != nil { lg.Printf(format, args...) } else { log.Printf(format, args...) } } // errno returns v's underlying uintptr, else 0. // // TODO: remove this helper function once http2 can use build // tags. See comment in isClosedConnError. func errno(v error) uintptr { if rv := reflect.ValueOf(v); rv.Kind() == reflect.Uintptr { return uintptr(rv.Uint()) } return 0 } // isClosedConnError reports whether err is an error from use of a closed // network connection. func isClosedConnError(err error) bool { if err == nil { return false } // TODO: remove this string search and be more like the Windows // case below. That might involve modifying the standard library // to return better error types. str := err.Error() if strings.Contains(str, "use of closed network connection") { return true } // TODO(bradfitz): x/tools/cmd/bundle doesn't really support // build tags, so I can't make an http2_windows.go file with // Windows-specific stuff. Fix that and move this, once we // have a way to bundle this into std's net/http somehow. if runtime.GOOS == "windows" { if oe, ok := err.(*net.OpError); ok && oe.Op == "read" { if se, ok := oe.Err.(*os.SyscallError); ok && se.Syscall == "wsarecv" { const WSAECONNABORTED = 10053 const WSAECONNRESET = 10054 if n := errno(se.Err); n == WSAECONNRESET || n == WSAECONNABORTED { return true } } } } return false } func (sc *serverConn) condlogf(err error, format string, args ...interface{}) { if err == nil { return } if err == io.EOF || err == io.ErrUnexpectedEOF || isClosedConnError(err) || err == errPrefaceTimeout { // Boring, expected errors. sc.vlogf(format, args...) } else { sc.logf(format, args...) } } func (sc *serverConn) canonicalHeader(v string) string { sc.serveG.check() buildCommonHeaderMapsOnce() cv, ok := commonCanonHeader[v] if ok { return cv } cv, ok = sc.canonHeader[v] if ok { return cv } if sc.canonHeader == nil { sc.canonHeader = make(map[string]string) } cv = http.CanonicalHeaderKey(v) sc.canonHeader[v] = cv return cv } type readFrameResult struct { f Frame // valid until readMore is called err error // readMore should be called once the consumer no longer needs or // retains f. After readMore, f is invalid and more frames can be // read. readMore func() } // readFrames is the loop that reads incoming frames. // It takes care to only read one frame at a time, blocking until the // consumer is done with the frame. // It's run on its own goroutine. func (sc *serverConn) readFrames() { gate := make(gate) gateDone := gate.Done for { f, err := sc.framer.ReadFrame() select { case sc.readFrameCh <- readFrameResult{f, err, gateDone}: case <-sc.doneServing: return } select { case <-gate: case <-sc.doneServing: return } if terminalReadFrameError(err) { return } } } // frameWriteResult is the message passed from writeFrameAsync to the serve goroutine. type frameWriteResult struct { wr FrameWriteRequest // what was written (or attempted) err error // result of the writeFrame call } // writeFrameAsync runs in its own goroutine and writes a single frame // and then reports when it's done. // At most one goroutine can be running writeFrameAsync at a time per // serverConn. func (sc *serverConn) writeFrameAsync(wr FrameWriteRequest) { err := wr.write.writeFrame(sc) sc.wroteFrameCh <- frameWriteResult{wr, err} } func (sc *serverConn) closeAllStreamsOnConnClose() { sc.serveG.check() for _, st := range sc.streams { sc.closeStream(st, errClientDisconnected) } } func (sc *serverConn) stopShutdownTimer() { sc.serveG.check() if t := sc.shutdownTimer; t != nil { t.Stop() } } func (sc *serverConn) notePanic() { // Note: this is for serverConn.serve panicking, not http.Handler code. if testHookOnPanicMu != nil { testHookOnPanicMu.Lock() defer testHookOnPanicMu.Unlock() } if testHookOnPanic != nil { if e := recover(); e != nil { if testHookOnPanic(sc, e) { panic(e) } } } } func (sc *serverConn) serve() { sc.serveG.check() defer sc.notePanic() defer sc.conn.Close() defer sc.closeAllStreamsOnConnClose() defer sc.stopShutdownTimer() defer close(sc.doneServing) // unblocks handlers trying to send if VerboseLogs { sc.vlogf("http2: server connection from %v on %p", sc.conn.RemoteAddr(), sc.hs) } sc.writeFrame(FrameWriteRequest{ write: writeSettings{ {SettingMaxFrameSize, sc.srv.maxReadFrameSize()}, {SettingMaxConcurrentStreams, sc.advMaxStreams}, {SettingMaxHeaderListSize, sc.maxHeaderListSize()}, {SettingInitialWindowSize, uint32(sc.srv.initialStreamRecvWindowSize())}, }, }) sc.unackedSettings++ // Each connection starts with intialWindowSize inflow tokens. // If a higher value is configured, we add more tokens. if diff := sc.srv.initialConnRecvWindowSize() - initialWindowSize; diff > 0 { sc.sendWindowUpdate(nil, int(diff)) } if err := sc.readPreface(); err != nil { sc.condlogf(err, "http2: server: error reading preface from client %v: %v", sc.conn.RemoteAddr(), err) return } // Now that we've got the preface, get us out of the // "StateNew" state. We can't go directly to idle, though. // Active means we read some data and anticipate a request. We'll // do another Active when we get a HEADERS frame. sc.setConnState(http.StateActive) sc.setConnState(http.StateIdle) if sc.srv.IdleTimeout != 0 { sc.idleTimer = time.AfterFunc(sc.srv.IdleTimeout, sc.onIdleTimer) defer sc.idleTimer.Stop() } go sc.readFrames() // closed by defer sc.conn.Close above settingsTimer := time.AfterFunc(firstSettingsTimeout, sc.onSettingsTimer) defer settingsTimer.Stop() loopNum := 0 for { loopNum++ select { case wr := <-sc.wantWriteFrameCh: if se, ok := wr.write.(StreamError); ok { sc.resetStream(se) break } sc.writeFrame(wr) case res := <-sc.wroteFrameCh: sc.wroteFrame(res) case res := <-sc.readFrameCh: if !sc.processFrameFromReader(res) { return } res.readMore() if settingsTimer != nil { settingsTimer.Stop() settingsTimer = nil } case m := <-sc.bodyReadCh: sc.noteBodyRead(m.st, m.n) case msg := <-sc.serveMsgCh: switch v := msg.(type) { case func(int): v(loopNum) // for testing case *serverMessage: switch v { case settingsTimerMsg: sc.logf("timeout waiting for SETTINGS frames from %v", sc.conn.RemoteAddr()) return case idleTimerMsg: sc.vlogf("connection is idle") sc.goAway(ErrCodeNo) case shutdownTimerMsg: sc.vlogf("GOAWAY close timer fired; closing conn from %v", sc.conn.RemoteAddr()) return case gracefulShutdownMsg: sc.startGracefulShutdownInternal() default: panic("unknown timer") } case *startPushRequest: sc.startPush(v) default: panic(fmt.Sprintf("unexpected type %T", v)) } } // Start the shutdown timer after sending a GOAWAY. When sending GOAWAY // with no error code (graceful shutdown), don't start the timer until // all open streams have been completed. sentGoAway := sc.inGoAway && !sc.needToSendGoAway && !sc.writingFrame gracefulShutdownComplete := sc.goAwayCode == ErrCodeNo && sc.curOpenStreams() == 0 if sentGoAway && sc.shutdownTimer == nil && (sc.goAwayCode != ErrCodeNo || gracefulShutdownComplete) { sc.shutDownIn(goAwayTimeout) } } } func (sc *serverConn) awaitGracefulShutdown(sharedCh <-chan struct{}, privateCh chan struct{}) { select { case <-sc.doneServing: case <-sharedCh: close(privateCh) } } type serverMessage int // Message values sent to serveMsgCh. var ( settingsTimerMsg = new(serverMessage) idleTimerMsg = new(serverMessage) shutdownTimerMsg = new(serverMessage) gracefulShutdownMsg = new(serverMessage) ) func (sc *serverConn) onSettingsTimer() { sc.sendServeMsg(settingsTimerMsg) } func (sc *serverConn) onIdleTimer() { sc.sendServeMsg(idleTimerMsg) } func (sc *serverConn) onShutdownTimer() { sc.sendServeMsg(shutdownTimerMsg) } func (sc *serverConn) sendServeMsg(msg interface{}) { sc.serveG.checkNotOn() // NOT select { case sc.serveMsgCh <- msg: case <-sc.doneServing: } } var errPrefaceTimeout = errors.New("timeout waiting for client preface") // readPreface reads the ClientPreface greeting from the peer or // returns errPrefaceTimeout on timeout, or an error if the greeting // is invalid. func (sc *serverConn) readPreface() error { errc := make(chan error, 1) go func() { // Read the client preface buf := make([]byte, len(ClientPreface)) if _, err := io.ReadFull(sc.conn, buf); err != nil { errc <- err } else if !bytes.Equal(buf, clientPreface) { errc <- fmt.Errorf("bogus greeting %q", buf) } else { errc <- nil } }() timer := time.NewTimer(prefaceTimeout) // TODO: configurable on *Server? defer timer.Stop() select { case <-timer.C: return errPrefaceTimeout case err := <-errc: if err == nil { if VerboseLogs { sc.vlogf("http2: server: client %v said hello", sc.conn.RemoteAddr()) } } return err } } var errChanPool = sync.Pool{ New: func() interface{} { return make(chan error, 1) }, } var writeDataPool = sync.Pool{ New: func() interface{} { return new(writeData) }, } // writeDataFromHandler writes DATA response frames from a handler on // the given stream. func (sc *serverConn) writeDataFromHandler(stream *stream, data []byte, endStream bool) error { ch := errChanPool.Get().(chan error) writeArg := writeDataPool.Get().(*writeData) *writeArg = writeData{stream.id, data, endStream} err := sc.writeFrameFromHandler(FrameWriteRequest{ write: writeArg, stream: stream, done: ch, }) if err != nil { return err } var frameWriteDone bool // the frame write is done (successfully or not) select { case err = <-ch: frameWriteDone = true case <-sc.doneServing: return errClientDisconnected case <-stream.cw: // If both ch and stream.cw were ready (as might // happen on the final Write after an http.Handler // ends), prefer the write result. Otherwise this // might just be us successfully closing the stream. // The writeFrameAsync and serve goroutines guarantee // that the ch send will happen before the stream.cw // close. select { case err = <-ch: frameWriteDone = true default: return errStreamClosed } } errChanPool.Put(ch) if frameWriteDone { writeDataPool.Put(writeArg) } return err } // writeFrameFromHandler sends wr to sc.wantWriteFrameCh, but aborts // if the connection has gone away. // // This must not be run from the serve goroutine itself, else it might // deadlock writing to sc.wantWriteFrameCh (which is only mildly // buffered and is read by serve itself). If you're on the serve // goroutine, call writeFrame instead. func (sc *serverConn) writeFrameFromHandler(wr FrameWriteRequest) error { sc.serveG.checkNotOn() // NOT select { case sc.wantWriteFrameCh <- wr: return nil case <-sc.doneServing: // Serve loop is gone. // Client has closed their connection to the server. return errClientDisconnected } } // writeFrame schedules a frame to write and sends it if there's nothing // already being written. // // There is no pushback here (the serve goroutine never blocks). It's // the http.Handlers that block, waiting for their previous frames to // make it onto the wire // // If you're not on the serve goroutine, use writeFrameFromHandler instead. func (sc *serverConn) writeFrame(wr FrameWriteRequest) { sc.serveG.check() // If true, wr will not be written and wr.done will not be signaled. var ignoreWrite bool // We are not allowed to write frames on closed streams. RFC 7540 Section // 5.1.1 says: "An endpoint MUST NOT send frames other than PRIORITY on // a closed stream." Our server never sends PRIORITY, so that exception // does not apply. // // The serverConn might close an open stream while the stream's handler // is still running. For example, the server might close a stream when it // receives bad data from the client. If this happens, the handler might // attempt to write a frame after the stream has been closed (since the // handler hasn't yet been notified of the close). In this case, we simply // ignore the frame. The handler will notice that the stream is closed when // it waits for the frame to be written. // // As an exception to this rule, we allow sending RST_STREAM after close. // This allows us to immediately reject new streams without tracking any // state for those streams (except for the queued RST_STREAM frame). This // may result in duplicate RST_STREAMs in some cases, but the client should // ignore those. if wr.StreamID() != 0 { _, isReset := wr.write.(StreamError) if state, _ := sc.state(wr.StreamID()); state == stateClosed && !isReset { ignoreWrite = true } } // Don't send a 100-continue response if we've already sent headers. // See golang.org/issue/14030. switch wr.write.(type) { case *writeResHeaders: wr.stream.wroteHeaders = true case write100ContinueHeadersFrame: if wr.stream.wroteHeaders { // We do not need to notify wr.done because this frame is // never written with wr.done != nil. if wr.done != nil { panic("wr.done != nil for write100ContinueHeadersFrame") } ignoreWrite = true } } if !ignoreWrite { sc.writeSched.Push(wr) } sc.scheduleFrameWrite() } // startFrameWrite starts a goroutine to write wr (in a separate // goroutine since that might block on the network), and updates the // serve goroutine's state about the world, updated from info in wr. func (sc *serverConn) startFrameWrite(wr FrameWriteRequest) { sc.serveG.check() if sc.writingFrame { panic("internal error: can only be writing one frame at a time") } st := wr.stream if st != nil { switch st.state { case stateHalfClosedLocal: switch wr.write.(type) { case StreamError, handlerPanicRST, writeWindowUpdate: // RFC 7540 Section 5.1 allows sending RST_STREAM, PRIORITY, and WINDOW_UPDATE // in this state. (We never send PRIORITY from the server, so that is not checked.) default: panic(fmt.Sprintf("internal error: attempt to send frame on a half-closed-local stream: %v", wr)) } case stateClosed: panic(fmt.Sprintf("internal error: attempt to send frame on a closed stream: %v", wr)) } } if wpp, ok := wr.write.(*writePushPromise); ok { var err error wpp.promisedID, err = wpp.allocatePromisedID() if err != nil { sc.writingFrameAsync = false wr.replyToWriter(err) return } } sc.writingFrame = true sc.needsFrameFlush = true if wr.write.staysWithinBuffer(sc.bw.Available()) { sc.writingFrameAsync = false err := wr.write.writeFrame(sc) sc.wroteFrame(frameWriteResult{wr, err}) } else { sc.writingFrameAsync = true go sc.writeFrameAsync(wr) } } // errHandlerPanicked is the error given to any callers blocked in a read from // Request.Body when the main goroutine panics. Since most handlers read in the // main ServeHTTP goroutine, this will show up rarely. var errHandlerPanicked = errors.New("http2: handler panicked") // wroteFrame is called on the serve goroutine with the result of // whatever happened on writeFrameAsync. func (sc *serverConn) wroteFrame(res frameWriteResult) { sc.serveG.check() if !sc.writingFrame { panic("internal error: expected to be already writing a frame") } sc.writingFrame = false sc.writingFrameAsync = false wr := res.wr if writeEndsStream(wr.write) { st := wr.stream if st == nil { panic("internal error: expecting non-nil stream") } switch st.state { case stateOpen: // Here we would go to stateHalfClosedLocal in // theory, but since our handler is done and // the net/http package provides no mechanism // for closing a ResponseWriter while still // reading data (see possible TODO at top of // this file), we go into closed state here // anyway, after telling the peer we're // hanging up on them. We'll transition to // stateClosed after the RST_STREAM frame is // written. st.state = stateHalfClosedLocal // Section 8.1: a server MAY request that the client abort // transmission of a request without error by sending a // RST_STREAM with an error code of NO_ERROR after sending // a complete response. sc.resetStream(streamError(st.id, ErrCodeNo)) case stateHalfClosedRemote: sc.closeStream(st, errHandlerComplete) } } else { switch v := wr.write.(type) { case StreamError: // st may be unknown if the RST_STREAM was generated to reject bad input. if st, ok := sc.streams[v.StreamID]; ok { sc.closeStream(st, v) } case handlerPanicRST: sc.closeStream(wr.stream, errHandlerPanicked) } } // Reply (if requested) to unblock the ServeHTTP goroutine. wr.replyToWriter(res.err) sc.scheduleFrameWrite() } // scheduleFrameWrite tickles the frame writing scheduler. // // If a frame is already being written, nothing happens. This will be called again // when the frame is done being written. // // If a frame isn't being written we need to send one, the best frame // to send is selected, preferring first things that aren't // stream-specific (e.g. ACKing settings), and then finding the // highest priority stream. // // If a frame isn't being written and there's nothing else to send, we // flush the write buffer. func (sc *serverConn) scheduleFrameWrite() { sc.serveG.check() if sc.writingFrame || sc.inFrameScheduleLoop { return } sc.inFrameScheduleLoop = true for !sc.writingFrameAsync { if sc.needToSendGoAway { sc.needToSendGoAway = false sc.startFrameWrite(FrameWriteRequest{ write: &writeGoAway{ maxStreamID: sc.maxClientStreamID, code: sc.goAwayCode, }, }) continue } if sc.needToSendSettingsAck { sc.needToSendSettingsAck = false sc.startFrameWrite(FrameWriteRequest{write: writeSettingsAck{}}) continue } if !sc.inGoAway || sc.goAwayCode == ErrCodeNo { if wr, ok := sc.writeSched.Pop(); ok { sc.startFrameWrite(wr) continue } } if sc.needsFrameFlush { sc.startFrameWrite(FrameWriteRequest{write: flushFrameWriter{}}) sc.needsFrameFlush = false // after startFrameWrite, since it sets this true continue } break } sc.inFrameScheduleLoop = false } // startGracefulShutdown gracefully shuts down a connection. This // sends GOAWAY with ErrCodeNo to tell the client we're gracefully // shutting down. The connection isn't closed until all current // streams are done. // // startGracefulShutdown returns immediately; it does not wait until // the connection has shut down. func (sc *serverConn) startGracefulShutdown() { sc.serveG.checkNotOn() // NOT sc.shutdownOnce.Do(func() { sc.sendServeMsg(gracefulShutdownMsg) }) } // After sending GOAWAY, the connection will close after goAwayTimeout. // If we close the connection immediately after sending GOAWAY, there may // be unsent data in our kernel receive buffer, which will cause the kernel // to send a TCP RST on close() instead of a FIN. This RST will abort the // connection immediately, whether or not the client had received the GOAWAY. // // Ideally we should delay for at least 1 RTT + epsilon so the client has // a chance to read the GOAWAY and stop sending messages. Measuring RTT // is hard, so we approximate with 1 second. See golang.org/issue/18701. // // This is a var so it can be shorter in tests, where all requests uses the // loopback interface making the expected RTT very small. // // TODO: configurable? var goAwayTimeout = 1 * time.Second func (sc *serverConn) startGracefulShutdownInternal() { sc.goAway(ErrCodeNo) } func (sc *serverConn) goAway(code ErrCode) { sc.serveG.check() if sc.inGoAway { return } sc.inGoAway = true sc.needToSendGoAway = true sc.goAwayCode = code sc.scheduleFrameWrite() } func (sc *serverConn) shutDownIn(d time.Duration) { sc.serveG.check() sc.shutdownTimer = time.AfterFunc(d, sc.onShutdownTimer) } func (sc *serverConn) resetStream(se StreamError) { sc.serveG.check() sc.writeFrame(FrameWriteRequest{write: se}) if st, ok := sc.streams[se.StreamID]; ok { st.resetQueued = true } } // processFrameFromReader processes the serve loop's read from readFrameCh from the // frame-reading goroutine. // processFrameFromReader returns whether the connection should be kept open. func (sc *serverConn) processFrameFromReader(res readFrameResult) bool { sc.serveG.check() err := res.err if err != nil { if err == ErrFrameTooLarge { sc.goAway(ErrCodeFrameSize) return true // goAway will close the loop } clientGone := err == io.EOF || err == io.ErrUnexpectedEOF || isClosedConnError(err) if clientGone { // TODO: could we also get into this state if // the peer does a half close // (e.g. CloseWrite) because they're done // sending frames but they're still wanting // our open replies? Investigate. // TODO: add CloseWrite to crypto/tls.Conn first // so we have a way to test this? I suppose // just for testing we could have a non-TLS mode. return false } } else { f := res.f if VerboseLogs { sc.vlogf("http2: server read frame %v", summarizeFrame(f)) } err = sc.processFrame(f) if err == nil { return true } } switch ev := err.(type) { case StreamError: sc.resetStream(ev) return true case goAwayFlowError: sc.goAway(ErrCodeFlowControl) return true case ConnectionError: sc.logf("http2: server connection error from %v: %v", sc.conn.RemoteAddr(), ev) sc.goAway(ErrCode(ev)) return true // goAway will handle shutdown default: if res.err != nil { sc.vlogf("http2: server closing client connection; error reading frame from client %s: %v", sc.conn.RemoteAddr(), err) } else { sc.logf("http2: server closing client connection: %v", err) } return false } } func (sc *serverConn) processFrame(f Frame) error { sc.serveG.check() // First frame received must be SETTINGS. if !sc.sawFirstSettings { if _, ok := f.(*SettingsFrame); !ok { return ConnectionError(ErrCodeProtocol) } sc.sawFirstSettings = true } switch f := f.(type) { case *SettingsFrame: return sc.processSettings(f) case *MetaHeadersFrame: return sc.processHeaders(f) case *WindowUpdateFrame: return sc.processWindowUpdate(f) case *PingFrame: return sc.processPing(f) case *DataFrame: return sc.processData(f) case *RSTStreamFrame: return sc.processResetStream(f) case *PriorityFrame: return sc.processPriority(f) case *GoAwayFrame: return sc.processGoAway(f) case *PushPromiseFrame: // A client cannot push. Thus, servers MUST treat the receipt of a PUSH_PROMISE // frame as a connection error (Section 5.4.1) of type PROTOCOL_ERROR. return ConnectionError(ErrCodeProtocol) default: sc.vlogf("http2: server ignoring frame: %v", f.Header()) return nil } } func (sc *serverConn) processPing(f *PingFrame) error { sc.serveG.check() if f.IsAck() { // 6.7 PING: " An endpoint MUST NOT respond to PING frames // containing this flag." return nil } if f.StreamID != 0 { // "PING frames are not associated with any individual // stream. If a PING frame is received with a stream // identifier field value other than 0x0, the recipient MUST // respond with a connection error (Section 5.4.1) of type // PROTOCOL_ERROR." return ConnectionError(ErrCodeProtocol) } if sc.inGoAway && sc.goAwayCode != ErrCodeNo { return nil } sc.writeFrame(FrameWriteRequest{write: writePingAck{f}}) return nil } func (sc *serverConn) processWindowUpdate(f *WindowUpdateFrame) error { sc.serveG.check() switch { case f.StreamID != 0: // stream-level flow control state, st := sc.state(f.StreamID) if state == stateIdle { // Section 5.1: "Receiving any frame other than HEADERS // or PRIORITY on a stream in this state MUST be // treated as a connection error (Section 5.4.1) of // type PROTOCOL_ERROR." return ConnectionError(ErrCodeProtocol) } if st == nil { // "WINDOW_UPDATE can be sent by a peer that has sent a // frame bearing the END_STREAM flag. This means that a // receiver could receive a WINDOW_UPDATE frame on a "half // closed (remote)" or "closed" stream. A receiver MUST // NOT treat this as an error, see Section 5.1." return nil } if !st.flow.add(int32(f.Increment)) { return streamError(f.StreamID, ErrCodeFlowControl) } default: // connection-level flow control if !sc.flow.add(int32(f.Increment)) { return goAwayFlowError{} } } sc.scheduleFrameWrite() return nil } func (sc *serverConn) processResetStream(f *RSTStreamFrame) error { sc.serveG.check() state, st := sc.state(f.StreamID) if state == stateIdle { // 6.4 "RST_STREAM frames MUST NOT be sent for a // stream in the "idle" state. If a RST_STREAM frame // identifying an idle stream is received, the // recipient MUST treat this as a connection error // (Section 5.4.1) of type PROTOCOL_ERROR. return ConnectionError(ErrCodeProtocol) } if st != nil { st.cancelCtx() sc.closeStream(st, streamError(f.StreamID, f.ErrCode)) } return nil } func (sc *serverConn) closeStream(st *stream, err error) { sc.serveG.check() if st.state == stateIdle || st.state == stateClosed { panic(fmt.Sprintf("invariant; can't close stream in state %v", st.state)) } st.state = stateClosed if st.writeDeadline != nil { st.writeDeadline.Stop() } if st.isPushed() { sc.curPushedStreams-- } else { sc.curClientStreams-- } delete(sc.streams, st.id) if len(sc.streams) == 0 { sc.setConnState(http.StateIdle) if sc.srv.IdleTimeout != 0 { sc.idleTimer.Reset(sc.srv.IdleTimeout) } if h1ServerKeepAlivesDisabled(sc.hs) { sc.startGracefulShutdownInternal() } } if p := st.body; p != nil { // Return any buffered unread bytes worth of conn-level flow control. // See golang.org/issue/16481 sc.sendWindowUpdate(nil, p.Len()) p.CloseWithError(err) } st.cw.Close() // signals Handler's CloseNotifier, unblocks writes, etc sc.writeSched.CloseStream(st.id) } func (sc *serverConn) processSettings(f *SettingsFrame) error { sc.serveG.check() if f.IsAck() { sc.unackedSettings-- if sc.unackedSettings < 0 { // Why is the peer ACKing settings we never sent? // The spec doesn't mention this case, but // hang up on them anyway. return ConnectionError(ErrCodeProtocol) } return nil } if f.NumSettings() > 100 || f.HasDuplicates() { // This isn't actually in the spec, but hang up on // suspiciously large settings frames or those with // duplicate entries. return ConnectionError(ErrCodeProtocol) } if err := f.ForeachSetting(sc.processSetting); err != nil { return err } sc.needToSendSettingsAck = true sc.scheduleFrameWrite() return nil } func (sc *serverConn) processSetting(s Setting) error { sc.serveG.check() if err := s.Valid(); err != nil { return err } if VerboseLogs { sc.vlogf("http2: server processing setting %v", s) } switch s.ID { case SettingHeaderTableSize: sc.headerTableSize = s.Val sc.hpackEncoder.SetMaxDynamicTableSize(s.Val) case SettingEnablePush: sc.pushEnabled = s.Val != 0 case SettingMaxConcurrentStreams: sc.clientMaxStreams = s.Val case SettingInitialWindowSize: return sc.processSettingInitialWindowSize(s.Val) case SettingMaxFrameSize: sc.maxFrameSize = int32(s.Val) // the maximum valid s.Val is < 2^31 case SettingMaxHeaderListSize: sc.peerMaxHeaderListSize = s.Val default: // Unknown setting: "An endpoint that receives a SETTINGS // frame with any unknown or unsupported identifier MUST // ignore that setting." if VerboseLogs { sc.vlogf("http2: server ignoring unknown setting %v", s) } } return nil } func (sc *serverConn) processSettingInitialWindowSize(val uint32) error { sc.serveG.check() // Note: val already validated to be within range by // processSetting's Valid call. // "A SETTINGS frame can alter the initial flow control window // size for all current streams. When the value of // SETTINGS_INITIAL_WINDOW_SIZE changes, a receiver MUST // adjust the size of all stream flow control windows that it // maintains by the difference between the new value and the // old value." old := sc.initialStreamSendWindowSize sc.initialStreamSendWindowSize = int32(val) growth := int32(val) - old // may be negative for _, st := range sc.streams { if !st.flow.add(growth) { // 6.9.2 Initial Flow Control Window Size // "An endpoint MUST treat a change to // SETTINGS_INITIAL_WINDOW_SIZE that causes any flow // control window to exceed the maximum size as a // connection error (Section 5.4.1) of type // FLOW_CONTROL_ERROR." return ConnectionError(ErrCodeFlowControl) } } return nil } func (sc *serverConn) processData(f *DataFrame) error { sc.serveG.check() if sc.inGoAway && sc.goAwayCode != ErrCodeNo { return nil } data := f.Data() // "If a DATA frame is received whose stream is not in "open" // or "half closed (local)" state, the recipient MUST respond // with a stream error (Section 5.4.2) of type STREAM_CLOSED." id := f.Header().StreamID state, st := sc.state(id) if id == 0 || state == stateIdle { // Section 5.1: "Receiving any frame other than HEADERS // or PRIORITY on a stream in this state MUST be // treated as a connection error (Section 5.4.1) of // type PROTOCOL_ERROR." return ConnectionError(ErrCodeProtocol) } if st == nil || state != stateOpen || st.gotTrailerHeader || st.resetQueued { // This includes sending a RST_STREAM if the stream is // in stateHalfClosedLocal (which currently means that // the http.Handler returned, so it's done reading & // done writing). Try to stop the client from sending // more DATA. // But still enforce their connection-level flow control, // and return any flow control bytes since we're not going // to consume them. if sc.inflow.available() < int32(f.Length) { return streamError(id, ErrCodeFlowControl) } // Deduct the flow control from inflow, since we're // going to immediately add it back in // sendWindowUpdate, which also schedules sending the // frames. sc.inflow.take(int32(f.Length)) sc.sendWindowUpdate(nil, int(f.Length)) // conn-level if st != nil && st.resetQueued { // Already have a stream error in flight. Don't send another. return nil } return streamError(id, ErrCodeStreamClosed) } if st.body == nil { panic("internal error: should have a body in this state") } // Sender sending more than they'd declared? if st.declBodyBytes != -1 && st.bodyBytes+int64(len(data)) > st.declBodyBytes { st.body.CloseWithError(fmt.Errorf("sender tried to send more than declared Content-Length of %d bytes", st.declBodyBytes)) // RFC 7540, sec 8.1.2.6: A request or response is also malformed if the // value of a content-length header field does not equal the sum of the // DATA frame payload lengths that form the body. return streamError(id, ErrCodeProtocol) } if f.Length > 0 { // Check whether the client has flow control quota. if st.inflow.available() < int32(f.Length) { return streamError(id, ErrCodeFlowControl) } st.inflow.take(int32(f.Length)) if len(data) > 0 { wrote, err := st.body.Write(data) if err != nil { return streamError(id, ErrCodeStreamClosed) } if wrote != len(data) { panic("internal error: bad Writer") } st.bodyBytes += int64(len(data)) } // Return any padded flow control now, since we won't // refund it later on body reads. if pad := int32(f.Length) - int32(len(data)); pad > 0 { sc.sendWindowUpdate32(nil, pad) sc.sendWindowUpdate32(st, pad) } } if f.StreamEnded() { st.endStream() } return nil } func (sc *serverConn) processGoAway(f *GoAwayFrame) error { sc.serveG.check() if f.ErrCode != ErrCodeNo { sc.logf("http2: received GOAWAY %+v, starting graceful shutdown", f) } else { sc.vlogf("http2: received GOAWAY %+v, starting graceful shutdown", f) } sc.startGracefulShutdownInternal() // http://tools.ietf.org/html/rfc7540#section-6.8 // We should not create any new streams, which means we should disable push. sc.pushEnabled = false return nil } // isPushed reports whether the stream is server-initiated. func (st *stream) isPushed() bool { return st.id%2 == 0 } // endStream closes a Request.Body's pipe. It is called when a DATA // frame says a request body is over (or after trailers). func (st *stream) endStream() { sc := st.sc sc.serveG.check() if st.declBodyBytes != -1 && st.declBodyBytes != st.bodyBytes { st.body.CloseWithError(fmt.Errorf("request declared a Content-Length of %d but only wrote %d bytes", st.declBodyBytes, st.bodyBytes)) } else { st.body.closeWithErrorAndCode(io.EOF, st.copyTrailersToHandlerRequest) st.body.CloseWithError(io.EOF) } st.state = stateHalfClosedRemote } // copyTrailersToHandlerRequest is run in the Handler's goroutine in // its Request.Body.Read just before it gets io.EOF. func (st *stream) copyTrailersToHandlerRequest() { for k, vv := range st.trailer { if _, ok := st.reqTrailer[k]; ok { // Only copy it over it was pre-declared. st.reqTrailer[k] = vv } } } // onWriteTimeout is run on its own goroutine (from time.AfterFunc) // when the stream's WriteTimeout has fired. func (st *stream) onWriteTimeout() { st.sc.writeFrameFromHandler(FrameWriteRequest{write: streamError(st.id, ErrCodeInternal)}) } func (sc *serverConn) processHeaders(f *MetaHeadersFrame) error { sc.serveG.check() id := f.StreamID if sc.inGoAway { // Ignore. return nil } // http://tools.ietf.org/html/rfc7540#section-5.1.1 // Streams initiated by a client MUST use odd-numbered stream // identifiers. [...] An endpoint that receives an unexpected // stream identifier MUST respond with a connection error // (Section 5.4.1) of type PROTOCOL_ERROR. if id%2 != 1 { return ConnectionError(ErrCodeProtocol) } // A HEADERS frame can be used to create a new stream or // send a trailer for an open one. If we already have a stream // open, let it process its own HEADERS frame (trailers at this // point, if it's valid). if st := sc.streams[f.StreamID]; st != nil { if st.resetQueued { // We're sending RST_STREAM to close the stream, so don't bother // processing this frame. return nil } // RFC 7540, sec 5.1: If an endpoint receives additional frames, other than // WINDOW_UPDATE, PRIORITY, or RST_STREAM, for a stream that is in // this state, it MUST respond with a stream error (Section 5.4.2) of // type STREAM_CLOSED. if st.state == stateHalfClosedRemote { return streamError(id, ErrCodeStreamClosed) } return st.processTrailerHeaders(f) } // [...] The identifier of a newly established stream MUST be // numerically greater than all streams that the initiating // endpoint has opened or reserved. [...] An endpoint that // receives an unexpected stream identifier MUST respond with // a connection error (Section 5.4.1) of type PROTOCOL_ERROR. if id <= sc.maxClientStreamID { return ConnectionError(ErrCodeProtocol) } sc.maxClientStreamID = id if sc.idleTimer != nil { sc.idleTimer.Stop() } // http://tools.ietf.org/html/rfc7540#section-5.1.2 // [...] Endpoints MUST NOT exceed the limit set by their peer. An // endpoint that receives a HEADERS frame that causes their // advertised concurrent stream limit to be exceeded MUST treat // this as a stream error (Section 5.4.2) of type PROTOCOL_ERROR // or REFUSED_STREAM. if sc.curClientStreams+1 > sc.advMaxStreams { if sc.unackedSettings == 0 { // They should know better. return streamError(id, ErrCodeProtocol) } // Assume it's a network race, where they just haven't // received our last SETTINGS update. But actually // this can't happen yet, because we don't yet provide // a way for users to adjust server parameters at // runtime. return streamError(id, ErrCodeRefusedStream) } initialState := stateOpen if f.StreamEnded() { initialState = stateHalfClosedRemote } st := sc.newStream(id, 0, initialState) if f.HasPriority() { if err := checkPriority(f.StreamID, f.Priority); err != nil { return err } sc.writeSched.AdjustStream(st.id, f.Priority) } rw, req, err := sc.newWriterAndRequest(st, f) if err != nil { return err } st.reqTrailer = req.Trailer if st.reqTrailer != nil { st.trailer = make(http.Header) } st.body = req.Body.(*requestBody).pipe // may be nil st.declBodyBytes = req.ContentLength handler := sc.handler.ServeHTTP if f.Truncated { // Their header list was too long. Send a 431 error. handler = handleHeaderListTooLong } else if err := checkValidHTTP2RequestHeaders(req.Header); err != nil { handler = new400Handler(err) } // The net/http package sets the read deadline from the // http.Server.ReadTimeout during the TLS handshake, but then // passes the connection off to us with the deadline already // set. Disarm it here after the request headers are read, // similar to how the http1 server works. Here it's // technically more like the http1 Server's ReadHeaderTimeout // (in Go 1.8), though. That's a more sane option anyway. if sc.hs.ReadTimeout != 0 { sc.conn.SetReadDeadline(time.Time{}) } go sc.runHandler(rw, req, handler) return nil } func (st *stream) processTrailerHeaders(f *MetaHeadersFrame) error { sc := st.sc sc.serveG.check() if st.gotTrailerHeader { return ConnectionError(ErrCodeProtocol) } st.gotTrailerHeader = true if !f.StreamEnded() { return streamError(st.id, ErrCodeProtocol) } if len(f.PseudoFields()) > 0 { return streamError(st.id, ErrCodeProtocol) } if st.trailer != nil { for _, hf := range f.RegularFields() { key := sc.canonicalHeader(hf.Name) if !httpguts.ValidTrailerHeader(key) { // TODO: send more details to the peer somehow. But http2 has // no way to send debug data at a stream level. Discuss with // HTTP folk. return streamError(st.id, ErrCodeProtocol) } st.trailer[key] = append(st.trailer[key], hf.Value) } } st.endStream() return nil } func checkPriority(streamID uint32, p PriorityParam) error { if streamID == p.StreamDep { // Section 5.3.1: "A stream cannot depend on itself. An endpoint MUST treat // this as a stream error (Section 5.4.2) of type PROTOCOL_ERROR." // Section 5.3.3 says that a stream can depend on one of its dependencies, // so it's only self-dependencies that are forbidden. return streamError(streamID, ErrCodeProtocol) } return nil } func (sc *serverConn) processPriority(f *PriorityFrame) error { if sc.inGoAway { return nil } if err := checkPriority(f.StreamID, f.PriorityParam); err != nil { return err } sc.writeSched.AdjustStream(f.StreamID, f.PriorityParam) return nil } func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream { sc.serveG.check() if id == 0 { panic("internal error: cannot create stream with id 0") } ctx, cancelCtx := context.WithCancel(sc.baseCtx) st := &stream{ sc: sc, id: id, state: state, ctx: ctx, cancelCtx: cancelCtx, } st.cw.Init() st.flow.conn = &sc.flow // link to conn-level counter st.flow.add(sc.initialStreamSendWindowSize) st.inflow.conn = &sc.inflow // link to conn-level counter st.inflow.add(sc.srv.initialStreamRecvWindowSize()) if sc.hs.WriteTimeout != 0 { st.writeDeadline = time.AfterFunc(sc.hs.WriteTimeout, st.onWriteTimeout) } sc.streams[id] = st sc.writeSched.OpenStream(st.id, OpenStreamOptions{PusherID: pusherID}) if st.isPushed() { sc.curPushedStreams++ } else { sc.curClientStreams++ } if sc.curOpenStreams() == 1 { sc.setConnState(http.StateActive) } return st } func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*responseWriter, *http.Request, error) { sc.serveG.check() rp := requestParam{ method: f.PseudoValue("method"), scheme: f.PseudoValue("scheme"), authority: f.PseudoValue("authority"), path: f.PseudoValue("path"), } isConnect := rp.method == "CONNECT" if isConnect { if rp.path != "" || rp.scheme != "" || rp.authority == "" { return nil, nil, streamError(f.StreamID, ErrCodeProtocol) } } else if rp.method == "" || rp.path == "" || (rp.scheme != "https" && rp.scheme != "http") { // See 8.1.2.6 Malformed Requests and Responses: // // Malformed requests or responses that are detected // MUST be treated as a stream error (Section 5.4.2) // of type PROTOCOL_ERROR." // // 8.1.2.3 Request Pseudo-Header Fields // "All HTTP/2 requests MUST include exactly one valid // value for the :method, :scheme, and :path // pseudo-header fields" return nil, nil, streamError(f.StreamID, ErrCodeProtocol) } bodyOpen := !f.StreamEnded() if rp.method == "HEAD" && bodyOpen { // HEAD requests can't have bodies return nil, nil, streamError(f.StreamID, ErrCodeProtocol) } rp.header = make(http.Header) for _, hf := range f.RegularFields() { rp.header.Add(sc.canonicalHeader(hf.Name), hf.Value) } if rp.authority == "" { rp.authority = rp.header.Get("Host") } rw, req, err := sc.newWriterAndRequestNoBody(st, rp) if err != nil { return nil, nil, err } if bodyOpen { if vv, ok := rp.header["Content-Length"]; ok { req.ContentLength, _ = strconv.ParseInt(vv[0], 10, 64) } else { req.ContentLength = -1 } req.Body.(*requestBody).pipe = &pipe{ b: &dataBuffer{expected: req.ContentLength}, } } return rw, req, nil } type requestParam struct { method string scheme, authority, path string header http.Header } func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp requestParam) (*responseWriter, *http.Request, error) { sc.serveG.check() var tlsState *tls.ConnectionState // nil if not scheme https if rp.scheme == "https" { tlsState = sc.tlsState } needsContinue := rp.header.Get("Expect") == "100-continue" if needsContinue { rp.header.Del("Expect") } // Merge Cookie headers into one "; "-delimited value. if cookies := rp.header["Cookie"]; len(cookies) > 1 { rp.header.Set("Cookie", strings.Join(cookies, "; ")) } // Setup Trailers var trailer http.Header for _, v := range rp.header["Trailer"] { for _, key := range strings.Split(v, ",") { key = http.CanonicalHeaderKey(strings.TrimSpace(key)) switch key { case "Transfer-Encoding", "Trailer", "Content-Length": // Bogus. (copy of http1 rules) // Ignore. default: if trailer == nil { trailer = make(http.Header) } trailer[key] = nil } } } delete(rp.header, "Trailer") var url_ *url.URL var requestURI string if rp.method == "CONNECT" { url_ = &url.URL{Host: rp.authority} requestURI = rp.authority // mimic HTTP/1 server behavior } else { var err error url_, err = url.ParseRequestURI(rp.path) if err != nil { return nil, nil, streamError(st.id, ErrCodeProtocol) } requestURI = rp.path } body := &requestBody{ conn: sc, stream: st, needsContinue: needsContinue, } req := &http.Request{ Method: rp.method, URL: url_, RemoteAddr: sc.remoteAddrStr, Header: rp.header, RequestURI: requestURI, Proto: "HTTP/2.0", ProtoMajor: 2, ProtoMinor: 0, TLS: tlsState, Host: rp.authority, Body: body, Trailer: trailer, } req = req.WithContext(st.ctx) rws := responseWriterStatePool.Get().(*responseWriterState) bwSave := rws.bw *rws = responseWriterState{} // zero all the fields rws.conn = sc rws.bw = bwSave rws.bw.Reset(chunkWriter{rws}) rws.stream = st rws.req = req rws.body = body rw := &responseWriter{rws: rws} return rw, req, nil } // Run on its own goroutine. func (sc *serverConn) runHandler(rw *responseWriter, req *http.Request, handler func(http.ResponseWriter, *http.Request)) { didPanic := true defer func() { rw.rws.stream.cancelCtx() if didPanic { e := recover() sc.writeFrameFromHandler(FrameWriteRequest{ write: handlerPanicRST{rw.rws.stream.id}, stream: rw.rws.stream, }) // Same as net/http: if e != nil && e != http.ErrAbortHandler { const size = 64 << 10 buf := make([]byte, size) buf = buf[:runtime.Stack(buf, false)] sc.logf("http2: panic serving %v: %v\n%s", sc.conn.RemoteAddr(), e, buf) } return } rw.handlerDone() }() handler(rw, req) didPanic = false } func handleHeaderListTooLong(w http.ResponseWriter, r *http.Request) { // 10.5.1 Limits on Header Block Size: // .. "A server that receives a larger header block than it is // willing to handle can send an HTTP 431 (Request Header Fields Too // Large) status code" const statusRequestHeaderFieldsTooLarge = 431 // only in Go 1.6+ w.WriteHeader(statusRequestHeaderFieldsTooLarge) io.WriteString(w, "

HTTP Error 431

Request Header Field(s) Too Large

") } // called from handler goroutines. // h may be nil. func (sc *serverConn) writeHeaders(st *stream, headerData *writeResHeaders) error { sc.serveG.checkNotOn() // NOT on var errc chan error if headerData.h != nil { // If there's a header map (which we don't own), so we have to block on // waiting for this frame to be written, so an http.Flush mid-handler // writes out the correct value of keys, before a handler later potentially // mutates it. errc = errChanPool.Get().(chan error) } if err := sc.writeFrameFromHandler(FrameWriteRequest{ write: headerData, stream: st, done: errc, }); err != nil { return err } if errc != nil { select { case err := <-errc: errChanPool.Put(errc) return err case <-sc.doneServing: return errClientDisconnected case <-st.cw: return errStreamClosed } } return nil } // called from handler goroutines. func (sc *serverConn) write100ContinueHeaders(st *stream) { sc.writeFrameFromHandler(FrameWriteRequest{ write: write100ContinueHeadersFrame{st.id}, stream: st, }) } // A bodyReadMsg tells the server loop that the http.Handler read n // bytes of the DATA from the client on the given stream. type bodyReadMsg struct { st *stream n int } // called from handler goroutines. // Notes that the handler for the given stream ID read n bytes of its body // and schedules flow control tokens to be sent. func (sc *serverConn) noteBodyReadFromHandler(st *stream, n int, err error) { sc.serveG.checkNotOn() // NOT on if n > 0 { select { case sc.bodyReadCh <- bodyReadMsg{st, n}: case <-sc.doneServing: } } } func (sc *serverConn) noteBodyRead(st *stream, n int) { sc.serveG.check() sc.sendWindowUpdate(nil, n) // conn-level if st.state != stateHalfClosedRemote && st.state != stateClosed { // Don't send this WINDOW_UPDATE if the stream is closed // remotely. sc.sendWindowUpdate(st, n) } } // st may be nil for conn-level func (sc *serverConn) sendWindowUpdate(st *stream, n int) { sc.serveG.check() // "The legal range for the increment to the flow control // window is 1 to 2^31-1 (2,147,483,647) octets." // A Go Read call on 64-bit machines could in theory read // a larger Read than this. Very unlikely, but we handle it here // rather than elsewhere for now. const maxUint31 = 1<<31 - 1 for n >= maxUint31 { sc.sendWindowUpdate32(st, maxUint31) n -= maxUint31 } sc.sendWindowUpdate32(st, int32(n)) } // st may be nil for conn-level func (sc *serverConn) sendWindowUpdate32(st *stream, n int32) { sc.serveG.check() if n == 0 { return } if n < 0 { panic("negative update") } var streamID uint32 if st != nil { streamID = st.id } sc.writeFrame(FrameWriteRequest{ write: writeWindowUpdate{streamID: streamID, n: uint32(n)}, stream: st, }) var ok bool if st == nil { ok = sc.inflow.add(n) } else { ok = st.inflow.add(n) } if !ok { panic("internal error; sent too many window updates without decrements?") } } // requestBody is the Handler's Request.Body type. // Read and Close may be called concurrently. type requestBody struct { stream *stream conn *serverConn closed bool // for use by Close only sawEOF bool // for use by Read only pipe *pipe // non-nil if we have a HTTP entity message body needsContinue bool // need to send a 100-continue } func (b *requestBody) Close() error { if b.pipe != nil && !b.closed { b.pipe.BreakWithError(errClosedBody) } b.closed = true return nil } func (b *requestBody) Read(p []byte) (n int, err error) { if b.needsContinue { b.needsContinue = false b.conn.write100ContinueHeaders(b.stream) } if b.pipe == nil || b.sawEOF { return 0, io.EOF } n, err = b.pipe.Read(p) if err == io.EOF { b.sawEOF = true } if b.conn == nil && inTests { return } b.conn.noteBodyReadFromHandler(b.stream, n, err) return } // responseWriter is the http.ResponseWriter implementation. It's // intentionally small (1 pointer wide) to minimize garbage. The // responseWriterState pointer inside is zeroed at the end of a // request (in handlerDone) and calls on the responseWriter thereafter // simply crash (caller's mistake), but the much larger responseWriterState // and buffers are reused between multiple requests. type responseWriter struct { rws *responseWriterState } // Optional http.ResponseWriter interfaces implemented. var ( _ http.CloseNotifier = (*responseWriter)(nil) _ http.Flusher = (*responseWriter)(nil) _ stringWriter = (*responseWriter)(nil) ) type responseWriterState struct { // immutable within a request: stream *stream req *http.Request body *requestBody // to close at end of request, if DATA frames didn't conn *serverConn // TODO: adjust buffer writing sizes based on server config, frame size updates from peer, etc bw *bufio.Writer // writing to a chunkWriter{this *responseWriterState} // mutated by http.Handler goroutine: handlerHeader http.Header // nil until called snapHeader http.Header // snapshot of handlerHeader at WriteHeader time trailers []string // set in writeChunk status int // status code passed to WriteHeader wroteHeader bool // WriteHeader called (explicitly or implicitly). Not necessarily sent to user yet. sentHeader bool // have we sent the header frame? handlerDone bool // handler has finished dirty bool // a Write failed; don't reuse this responseWriterState sentContentLen int64 // non-zero if handler set a Content-Length header wroteBytes int64 closeNotifierMu sync.Mutex // guards closeNotifierCh closeNotifierCh chan bool // nil until first used } type chunkWriter struct{ rws *responseWriterState } func (cw chunkWriter) Write(p []byte) (n int, err error) { return cw.rws.writeChunk(p) } func (rws *responseWriterState) hasTrailers() bool { return len(rws.trailers) > 0 } func (rws *responseWriterState) hasNonemptyTrailers() bool { for _, trailer := range rws.trailers { if _, ok := rws.handlerHeader[trailer]; ok { return true } } return false } // declareTrailer is called for each Trailer header when the // response header is written. It notes that a header will need to be // written in the trailers at the end of the response. func (rws *responseWriterState) declareTrailer(k string) { k = http.CanonicalHeaderKey(k) if !httpguts.ValidTrailerHeader(k) { // Forbidden by RFC 7230, section 4.1.2. rws.conn.logf("ignoring invalid trailer %q", k) return } if !strSliceContains(rws.trailers, k) { rws.trailers = append(rws.trailers, k) } } // writeChunk writes chunks from the bufio.Writer. But because // bufio.Writer may bypass its chunking, sometimes p may be // arbitrarily large. // // writeChunk is also responsible (on the first chunk) for sending the // HEADER response. func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { if !rws.wroteHeader { rws.writeHeader(200) } isHeadResp := rws.req.Method == "HEAD" if !rws.sentHeader { rws.sentHeader = true var ctype, clen string if clen = rws.snapHeader.Get("Content-Length"); clen != "" { rws.snapHeader.Del("Content-Length") clen64, err := strconv.ParseInt(clen, 10, 64) if err == nil && clen64 >= 0 { rws.sentContentLen = clen64 } else { clen = "" } } if clen == "" && rws.handlerDone && bodyAllowedForStatus(rws.status) && (len(p) > 0 || !isHeadResp) { clen = strconv.Itoa(len(p)) } _, hasContentType := rws.snapHeader["Content-Type"] if !hasContentType && bodyAllowedForStatus(rws.status) && len(p) > 0 { ctype = http.DetectContentType(p) } var date string if _, ok := rws.snapHeader["Date"]; !ok { // TODO(bradfitz): be faster here, like net/http? measure. date = time.Now().UTC().Format(http.TimeFormat) } for _, v := range rws.snapHeader["Trailer"] { foreachHeaderElement(v, rws.declareTrailer) } // "Connection" headers aren't allowed in HTTP/2 (RFC 7540, 8.1.2.2), // but respect "Connection" == "close" to mean sending a GOAWAY and tearing // down the TCP connection when idle, like we do for HTTP/1. // TODO: remove more Connection-specific header fields here, in addition // to "Connection". if _, ok := rws.snapHeader["Connection"]; ok { v := rws.snapHeader.Get("Connection") delete(rws.snapHeader, "Connection") if v == "close" { rws.conn.startGracefulShutdown() } } endStream := (rws.handlerDone && !rws.hasTrailers() && len(p) == 0) || isHeadResp err = rws.conn.writeHeaders(rws.stream, &writeResHeaders{ streamID: rws.stream.id, httpResCode: rws.status, h: rws.snapHeader, endStream: endStream, contentType: ctype, contentLength: clen, date: date, }) if err != nil { rws.dirty = true return 0, err } if endStream { return 0, nil } } if isHeadResp { return len(p), nil } if len(p) == 0 && !rws.handlerDone { return 0, nil } if rws.handlerDone { rws.promoteUndeclaredTrailers() } // only send trailers if they have actually been defined by the // server handler. hasNonemptyTrailers := rws.hasNonemptyTrailers() endStream := rws.handlerDone && !hasNonemptyTrailers if len(p) > 0 || endStream { // only send a 0 byte DATA frame if we're ending the stream. if err := rws.conn.writeDataFromHandler(rws.stream, p, endStream); err != nil { rws.dirty = true return 0, err } } if rws.handlerDone && hasNonemptyTrailers { err = rws.conn.writeHeaders(rws.stream, &writeResHeaders{ streamID: rws.stream.id, h: rws.handlerHeader, trailers: rws.trailers, endStream: true, }) if err != nil { rws.dirty = true } return len(p), err } return len(p), nil } // TrailerPrefix is a magic prefix for ResponseWriter.Header map keys // that, if present, signals that the map entry is actually for // the response trailers, and not the response headers. The prefix // is stripped after the ServeHTTP call finishes and the values are // sent in the trailers. // // This mechanism is intended only for trailers that are not known // prior to the headers being written. If the set of trailers is fixed // or known before the header is written, the normal Go trailers mechanism // is preferred: // https://golang.org/pkg/net/http/#ResponseWriter // https://golang.org/pkg/net/http/#example_ResponseWriter_trailers const TrailerPrefix = "Trailer:" // promoteUndeclaredTrailers permits http.Handlers to set trailers // after the header has already been flushed. Because the Go // ResponseWriter interface has no way to set Trailers (only the // Header), and because we didn't want to expand the ResponseWriter // interface, and because nobody used trailers, and because RFC 7230 // says you SHOULD (but not must) predeclare any trailers in the // header, the official ResponseWriter rules said trailers in Go must // be predeclared, and then we reuse the same ResponseWriter.Header() // map to mean both Headers and Trailers. When it's time to write the // Trailers, we pick out the fields of Headers that were declared as // trailers. That worked for a while, until we found the first major // user of Trailers in the wild: gRPC (using them only over http2), // and gRPC libraries permit setting trailers mid-stream without // predeclarnig them. So: change of plans. We still permit the old // way, but we also permit this hack: if a Header() key begins with // "Trailer:", the suffix of that key is a Trailer. Because ':' is an // invalid token byte anyway, there is no ambiguity. (And it's already // filtered out) It's mildly hacky, but not terrible. // // This method runs after the Handler is done and promotes any Header // fields to be trailers. func (rws *responseWriterState) promoteUndeclaredTrailers() { for k, vv := range rws.handlerHeader { if !strings.HasPrefix(k, TrailerPrefix) { continue } trailerKey := strings.TrimPrefix(k, TrailerPrefix) rws.declareTrailer(trailerKey) rws.handlerHeader[http.CanonicalHeaderKey(trailerKey)] = vv } if len(rws.trailers) > 1 { sorter := sorterPool.Get().(*sorter) sorter.SortStrings(rws.trailers) sorterPool.Put(sorter) } } func (w *responseWriter) Flush() { rws := w.rws if rws == nil { panic("Header called after Handler finished") } if rws.bw.Buffered() > 0 { if err := rws.bw.Flush(); err != nil { // Ignore the error. The frame writer already knows. return } } else { // The bufio.Writer won't call chunkWriter.Write // (writeChunk with zero bytes, so we have to do it // ourselves to force the HTTP response header and/or // final DATA frame (with END_STREAM) to be sent. rws.writeChunk(nil) } } func (w *responseWriter) CloseNotify() <-chan bool { rws := w.rws if rws == nil { panic("CloseNotify called after Handler finished") } rws.closeNotifierMu.Lock() ch := rws.closeNotifierCh if ch == nil { ch = make(chan bool, 1) rws.closeNotifierCh = ch cw := rws.stream.cw go func() { cw.Wait() // wait for close ch <- true }() } rws.closeNotifierMu.Unlock() return ch } func (w *responseWriter) Header() http.Header { rws := w.rws if rws == nil { panic("Header called after Handler finished") } if rws.handlerHeader == nil { rws.handlerHeader = make(http.Header) } return rws.handlerHeader } // checkWriteHeaderCode is a copy of net/http's checkWriteHeaderCode. func checkWriteHeaderCode(code int) { // Issue 22880: require valid WriteHeader status codes. // For now we only enforce that it's three digits. // In the future we might block things over 599 (600 and above aren't defined // at http://httpwg.org/specs/rfc7231.html#status.codes) // and we might block under 200 (once we have more mature 1xx support). // But for now any three digits. // // We used to send "HTTP/1.1 000 0" on the wire in responses but there's // no equivalent bogus thing we can realistically send in HTTP/2, // so we'll consistently panic instead and help people find their bugs // early. (We can't return an error from WriteHeader even if we wanted to.) if code < 100 || code > 999 { panic(fmt.Sprintf("invalid WriteHeader code %v", code)) } } func (w *responseWriter) WriteHeader(code int) { rws := w.rws if rws == nil { panic("WriteHeader called after Handler finished") } rws.writeHeader(code) } func (rws *responseWriterState) writeHeader(code int) { if !rws.wroteHeader { checkWriteHeaderCode(code) rws.wroteHeader = true rws.status = code if len(rws.handlerHeader) > 0 { rws.snapHeader = cloneHeader(rws.handlerHeader) } } } func cloneHeader(h http.Header) http.Header { h2 := make(http.Header, len(h)) for k, vv := range h { vv2 := make([]string, len(vv)) copy(vv2, vv) h2[k] = vv2 } return h2 } // The Life Of A Write is like this: // // * Handler calls w.Write or w.WriteString -> // * -> rws.bw (*bufio.Writer) -> // * (Handler might call Flush) // * -> chunkWriter{rws} // * -> responseWriterState.writeChunk(p []byte) // * -> responseWriterState.writeChunk (most of the magic; see comment there) func (w *responseWriter) Write(p []byte) (n int, err error) { return w.write(len(p), p, "") } func (w *responseWriter) WriteString(s string) (n int, err error) { return w.write(len(s), nil, s) } // either dataB or dataS is non-zero. func (w *responseWriter) write(lenData int, dataB []byte, dataS string) (n int, err error) { rws := w.rws if rws == nil { panic("Write called after Handler finished") } if !rws.wroteHeader { w.WriteHeader(200) } if !bodyAllowedForStatus(rws.status) { return 0, http.ErrBodyNotAllowed } rws.wroteBytes += int64(len(dataB)) + int64(len(dataS)) // only one can be set if rws.sentContentLen != 0 && rws.wroteBytes > rws.sentContentLen { // TODO: send a RST_STREAM return 0, errors.New("http2: handler wrote more than declared Content-Length") } if dataB != nil { return rws.bw.Write(dataB) } else { return rws.bw.WriteString(dataS) } } func (w *responseWriter) handlerDone() { rws := w.rws dirty := rws.dirty rws.handlerDone = true w.Flush() w.rws = nil if !dirty { // Only recycle the pool if all prior Write calls to // the serverConn goroutine completed successfully. If // they returned earlier due to resets from the peer // there might still be write goroutines outstanding // from the serverConn referencing the rws memory. See // issue 20704. responseWriterStatePool.Put(rws) } } // Push errors. var ( ErrRecursivePush = errors.New("http2: recursive push not allowed") ErrPushLimitReached = errors.New("http2: push would exceed peer's SETTINGS_MAX_CONCURRENT_STREAMS") ) var _ http.Pusher = (*responseWriter)(nil) func (w *responseWriter) Push(target string, opts *http.PushOptions) error { st := w.rws.stream sc := st.sc sc.serveG.checkNotOn() // No recursive pushes: "PUSH_PROMISE frames MUST only be sent on a peer-initiated stream." // http://tools.ietf.org/html/rfc7540#section-6.6 if st.isPushed() { return ErrRecursivePush } if opts == nil { opts = new(http.PushOptions) } // Default options. if opts.Method == "" { opts.Method = "GET" } if opts.Header == nil { opts.Header = http.Header{} } wantScheme := "http" if w.rws.req.TLS != nil { wantScheme = "https" } // Validate the request. u, err := url.Parse(target) if err != nil { return err } if u.Scheme == "" { if !strings.HasPrefix(target, "/") { return fmt.Errorf("target must be an absolute URL or an absolute path: %q", target) } u.Scheme = wantScheme u.Host = w.rws.req.Host } else { if u.Scheme != wantScheme { return fmt.Errorf("cannot push URL with scheme %q from request with scheme %q", u.Scheme, wantScheme) } if u.Host == "" { return errors.New("URL must have a host") } } for k := range opts.Header { if strings.HasPrefix(k, ":") { return fmt.Errorf("promised request headers cannot include pseudo header %q", k) } // These headers are meaningful only if the request has a body, // but PUSH_PROMISE requests cannot have a body. // http://tools.ietf.org/html/rfc7540#section-8.2 // Also disallow Host, since the promised URL must be absolute. switch strings.ToLower(k) { case "content-length", "content-encoding", "trailer", "te", "expect", "host": return fmt.Errorf("promised request headers cannot include %q", k) } } if err := checkValidHTTP2RequestHeaders(opts.Header); err != nil { return err } // The RFC effectively limits promised requests to GET and HEAD: // "Promised requests MUST be cacheable [GET, HEAD, or POST], and MUST be safe [GET or HEAD]" // http://tools.ietf.org/html/rfc7540#section-8.2 if opts.Method != "GET" && opts.Method != "HEAD" { return fmt.Errorf("method %q must be GET or HEAD", opts.Method) } msg := &startPushRequest{ parent: st, method: opts.Method, url: u, header: cloneHeader(opts.Header), done: errChanPool.Get().(chan error), } select { case <-sc.doneServing: return errClientDisconnected case <-st.cw: return errStreamClosed case sc.serveMsgCh <- msg: } select { case <-sc.doneServing: return errClientDisconnected case <-st.cw: return errStreamClosed case err := <-msg.done: errChanPool.Put(msg.done) return err } } type startPushRequest struct { parent *stream method string url *url.URL header http.Header done chan error } func (sc *serverConn) startPush(msg *startPushRequest) { sc.serveG.check() // http://tools.ietf.org/html/rfc7540#section-6.6. // PUSH_PROMISE frames MUST only be sent on a peer-initiated stream that // is in either the "open" or "half-closed (remote)" state. if msg.parent.state != stateOpen && msg.parent.state != stateHalfClosedRemote { // responseWriter.Push checks that the stream is peer-initiaed. msg.done <- errStreamClosed return } // http://tools.ietf.org/html/rfc7540#section-6.6. if !sc.pushEnabled { msg.done <- http.ErrNotSupported return } // PUSH_PROMISE frames must be sent in increasing order by stream ID, so // we allocate an ID for the promised stream lazily, when the PUSH_PROMISE // is written. Once the ID is allocated, we start the request handler. allocatePromisedID := func() (uint32, error) { sc.serveG.check() // Check this again, just in case. Technically, we might have received // an updated SETTINGS by the time we got around to writing this frame. if !sc.pushEnabled { return 0, http.ErrNotSupported } // http://tools.ietf.org/html/rfc7540#section-6.5.2. if sc.curPushedStreams+1 > sc.clientMaxStreams { return 0, ErrPushLimitReached } // http://tools.ietf.org/html/rfc7540#section-5.1.1. // Streams initiated by the server MUST use even-numbered identifiers. // A server that is unable to establish a new stream identifier can send a GOAWAY // frame so that the client is forced to open a new connection for new streams. if sc.maxPushPromiseID+2 >= 1<<31 { sc.startGracefulShutdownInternal() return 0, ErrPushLimitReached } sc.maxPushPromiseID += 2 promisedID := sc.maxPushPromiseID // http://tools.ietf.org/html/rfc7540#section-8.2. // Strictly speaking, the new stream should start in "reserved (local)", then // transition to "half closed (remote)" after sending the initial HEADERS, but // we start in "half closed (remote)" for simplicity. // See further comments at the definition of stateHalfClosedRemote. promised := sc.newStream(promisedID, msg.parent.id, stateHalfClosedRemote) rw, req, err := sc.newWriterAndRequestNoBody(promised, requestParam{ method: msg.method, scheme: msg.url.Scheme, authority: msg.url.Host, path: msg.url.RequestURI(), header: cloneHeader(msg.header), // clone since handler runs concurrently with writing the PUSH_PROMISE }) if err != nil { // Should not happen, since we've already validated msg.url. panic(fmt.Sprintf("newWriterAndRequestNoBody(%+v): %v", msg.url, err)) } go sc.runHandler(rw, req, sc.handler.ServeHTTP) return promisedID, nil } sc.writeFrame(FrameWriteRequest{ write: &writePushPromise{ streamID: msg.parent.id, method: msg.method, url: msg.url, h: msg.header, allocatePromisedID: allocatePromisedID, }, stream: msg.parent, done: msg.done, }) } // foreachHeaderElement splits v according to the "#rule" construction // in RFC 7230 section 7 and calls fn for each non-empty element. func foreachHeaderElement(v string, fn func(string)) { v = textproto.TrimString(v) if v == "" { return } if !strings.Contains(v, ",") { fn(v) return } for _, f := range strings.Split(v, ",") { if f = textproto.TrimString(f); f != "" { fn(f) } } } // From http://httpwg.org/specs/rfc7540.html#rfc.section.8.1.2.2 var connHeaders = []string{ "Connection", "Keep-Alive", "Proxy-Connection", "Transfer-Encoding", "Upgrade", } // checkValidHTTP2RequestHeaders checks whether h is a valid HTTP/2 request, // per RFC 7540 Section 8.1.2.2. // The returned error is reported to users. func checkValidHTTP2RequestHeaders(h http.Header) error { for _, k := range connHeaders { if _, ok := h[k]; ok { return fmt.Errorf("request header %q is not valid in HTTP/2", k) } } te := h["Te"] if len(te) > 0 && (len(te) > 1 || (te[0] != "trailers" && te[0] != "")) { return errors.New(`request header "TE" may only be "trailers" in HTTP/2`) } return nil } func new400Handler(err error) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), http.StatusBadRequest) } } // h1ServerKeepAlivesDisabled reports whether hs has its keep-alives // disabled. See comments on h1ServerShutdownChan above for why // the code is written this way. func h1ServerKeepAlivesDisabled(hs *http.Server) bool { var x interface{} = hs type I interface { doKeepAlives() bool } if hs, ok := x.(I); ok { return !hs.doKeepAlives() } return false } ================================================ FILE: vendor/golang.org/x/net/http2/transport.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Transport code. package http2 import ( "bufio" "bytes" "compress/gzip" "context" "crypto/rand" "crypto/tls" "errors" "fmt" "io" "io/ioutil" "log" "math" mathrand "math/rand" "net" "net/http" "net/http/httptrace" "net/textproto" "sort" "strconv" "strings" "sync" "sync/atomic" "time" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" "golang.org/x/net/idna" ) const ( // transportDefaultConnFlow is how many connection-level flow control // tokens we give the server at start-up, past the default 64k. transportDefaultConnFlow = 1 << 30 // transportDefaultStreamFlow is how many stream-level flow // control tokens we announce to the peer, and how many bytes // we buffer per stream. transportDefaultStreamFlow = 4 << 20 // transportDefaultStreamMinRefresh is the minimum number of bytes we'll send // a stream-level WINDOW_UPDATE for at a time. transportDefaultStreamMinRefresh = 4 << 10 defaultUserAgent = "Go-http-client/2.0" ) // Transport is an HTTP/2 Transport. // // A Transport internally caches connections to servers. It is safe // for concurrent use by multiple goroutines. type Transport struct { // DialTLS specifies an optional dial function for creating // TLS connections for requests. // // If DialTLS is nil, tls.Dial is used. // // If the returned net.Conn has a ConnectionState method like tls.Conn, // it will be used to set http.Response.TLS. DialTLS func(network, addr string, cfg *tls.Config) (net.Conn, error) // TLSClientConfig specifies the TLS configuration to use with // tls.Client. If nil, the default configuration is used. TLSClientConfig *tls.Config // ConnPool optionally specifies an alternate connection pool to use. // If nil, the default is used. ConnPool ClientConnPool // DisableCompression, if true, prevents the Transport from // requesting compression with an "Accept-Encoding: gzip" // request header when the Request contains no existing // Accept-Encoding value. If the Transport requests gzip on // its own and gets a gzipped response, it's transparently // decoded in the Response.Body. However, if the user // explicitly requested gzip it is not automatically // uncompressed. DisableCompression bool // AllowHTTP, if true, permits HTTP/2 requests using the insecure, // plain-text "http" scheme. Note that this does not enable h2c support. AllowHTTP bool // MaxHeaderListSize is the http2 SETTINGS_MAX_HEADER_LIST_SIZE to // send in the initial settings frame. It is how many bytes // of response headers are allowed. Unlike the http2 spec, zero here // means to use a default limit (currently 10MB). If you actually // want to advertise an ulimited value to the peer, Transport // interprets the highest possible value here (0xffffffff or 1<<32-1) // to mean no limit. MaxHeaderListSize uint32 // StrictMaxConcurrentStreams controls whether the server's // SETTINGS_MAX_CONCURRENT_STREAMS should be respected // globally. If false, new TCP connections are created to the // server as needed to keep each under the per-connection // SETTINGS_MAX_CONCURRENT_STREAMS limit. If true, the // server's SETTINGS_MAX_CONCURRENT_STREAMS is interpreted as // a global limit and callers of RoundTrip block when needed, // waiting for their turn. StrictMaxConcurrentStreams bool // t1, if non-nil, is the standard library Transport using // this transport. Its settings are used (but not its // RoundTrip method, etc). t1 *http.Transport connPoolOnce sync.Once connPoolOrDef ClientConnPool // non-nil version of ConnPool } func (t *Transport) maxHeaderListSize() uint32 { if t.MaxHeaderListSize == 0 { return 10 << 20 } if t.MaxHeaderListSize == 0xffffffff { return 0 } return t.MaxHeaderListSize } func (t *Transport) disableCompression() bool { return t.DisableCompression || (t.t1 != nil && t.t1.DisableCompression) } // ConfigureTransport configures a net/http HTTP/1 Transport to use HTTP/2. // It returns an error if t1 has already been HTTP/2-enabled. func ConfigureTransport(t1 *http.Transport) error { _, err := configureTransport(t1) return err } func configureTransport(t1 *http.Transport) (*Transport, error) { connPool := new(clientConnPool) t2 := &Transport{ ConnPool: noDialClientConnPool{connPool}, t1: t1, } connPool.t = t2 if err := registerHTTPSProtocol(t1, noDialH2RoundTripper{t2}); err != nil { return nil, err } if t1.TLSClientConfig == nil { t1.TLSClientConfig = new(tls.Config) } if !strSliceContains(t1.TLSClientConfig.NextProtos, "h2") { t1.TLSClientConfig.NextProtos = append([]string{"h2"}, t1.TLSClientConfig.NextProtos...) } if !strSliceContains(t1.TLSClientConfig.NextProtos, "http/1.1") { t1.TLSClientConfig.NextProtos = append(t1.TLSClientConfig.NextProtos, "http/1.1") } upgradeFn := func(authority string, c *tls.Conn) http.RoundTripper { addr := authorityAddr("https", authority) if used, err := connPool.addConnIfNeeded(addr, t2, c); err != nil { go c.Close() return erringRoundTripper{err} } else if !used { // Turns out we don't need this c. // For example, two goroutines made requests to the same host // at the same time, both kicking off TCP dials. (since protocol // was unknown) go c.Close() } return t2 } if m := t1.TLSNextProto; len(m) == 0 { t1.TLSNextProto = map[string]func(string, *tls.Conn) http.RoundTripper{ "h2": upgradeFn, } } else { m["h2"] = upgradeFn } return t2, nil } func (t *Transport) connPool() ClientConnPool { t.connPoolOnce.Do(t.initConnPool) return t.connPoolOrDef } func (t *Transport) initConnPool() { if t.ConnPool != nil { t.connPoolOrDef = t.ConnPool } else { t.connPoolOrDef = &clientConnPool{t: t} } } // ClientConn is the state of a single HTTP/2 client connection to an // HTTP/2 server. type ClientConn struct { t *Transport tconn net.Conn // usually *tls.Conn, except specialized impls tlsState *tls.ConnectionState // nil only for specialized impls reused uint32 // whether conn is being reused; atomic singleUse bool // whether being used for a single http.Request // readLoop goroutine fields: readerDone chan struct{} // closed on error readerErr error // set before readerDone is closed idleTimeout time.Duration // or 0 for never idleTimer *time.Timer mu sync.Mutex // guards following cond *sync.Cond // hold mu; broadcast on flow/closed changes flow flow // our conn-level flow control quota (cs.flow is per stream) inflow flow // peer's conn-level flow control closing bool closed bool wantSettingsAck bool // we sent a SETTINGS frame and haven't heard back goAway *GoAwayFrame // if non-nil, the GoAwayFrame we received goAwayDebug string // goAway frame's debug data, retained as a string streams map[uint32]*clientStream // client-initiated nextStreamID uint32 pendingRequests int // requests blocked and waiting to be sent because len(streams) == maxConcurrentStreams pings map[[8]byte]chan struct{} // in flight ping data to notification channel bw *bufio.Writer br *bufio.Reader fr *Framer lastActive time.Time // Settings from peer: (also guarded by mu) maxFrameSize uint32 maxConcurrentStreams uint32 peerMaxHeaderListSize uint64 initialWindowSize uint32 hbuf bytes.Buffer // HPACK encoder writes into this henc *hpack.Encoder freeBuf [][]byte wmu sync.Mutex // held while writing; acquire AFTER mu if holding both werr error // first write error that has occurred } // clientStream is the state for a single HTTP/2 stream. One of these // is created for each Transport.RoundTrip call. type clientStream struct { cc *ClientConn req *http.Request trace *httptrace.ClientTrace // or nil ID uint32 resc chan resAndError bufPipe pipe // buffered pipe with the flow-controlled response payload startedWrite bool // started request body write; guarded by cc.mu requestedGzip bool on100 func() // optional code to run if get a 100 continue response flow flow // guarded by cc.mu inflow flow // guarded by cc.mu bytesRemain int64 // -1 means unknown; owned by transportResponseBody.Read readErr error // sticky read error; owned by transportResponseBody.Read stopReqBody error // if non-nil, stop writing req body; guarded by cc.mu didReset bool // whether we sent a RST_STREAM to the server; guarded by cc.mu peerReset chan struct{} // closed on peer reset resetErr error // populated before peerReset is closed done chan struct{} // closed when stream remove from cc.streams map; close calls guarded by cc.mu // owned by clientConnReadLoop: firstByte bool // got the first response byte pastHeaders bool // got first MetaHeadersFrame (actual headers) pastTrailers bool // got optional second MetaHeadersFrame (trailers) num1xx uint8 // number of 1xx responses seen trailer http.Header // accumulated trailers resTrailer *http.Header // client's Response.Trailer } // awaitRequestCancel waits for the user to cancel a request or for the done // channel to be signaled. A non-nil error is returned only if the request was // canceled. func awaitRequestCancel(req *http.Request, done <-chan struct{}) error { ctx := req.Context() if req.Cancel == nil && ctx.Done() == nil { return nil } select { case <-req.Cancel: return errRequestCanceled case <-ctx.Done(): return ctx.Err() case <-done: return nil } } var got1xxFuncForTests func(int, textproto.MIMEHeader) error // get1xxTraceFunc returns the value of request's httptrace.ClientTrace.Got1xxResponse func, // if any. It returns nil if not set or if the Go version is too old. func (cs *clientStream) get1xxTraceFunc() func(int, textproto.MIMEHeader) error { if fn := got1xxFuncForTests; fn != nil { return fn } return traceGot1xxResponseFunc(cs.trace) } // awaitRequestCancel waits for the user to cancel a request, its context to // expire, or for the request to be done (any way it might be removed from the // cc.streams map: peer reset, successful completion, TCP connection breakage, // etc). If the request is canceled, then cs will be canceled and closed. func (cs *clientStream) awaitRequestCancel(req *http.Request) { if err := awaitRequestCancel(req, cs.done); err != nil { cs.cancelStream() cs.bufPipe.CloseWithError(err) } } func (cs *clientStream) cancelStream() { cc := cs.cc cc.mu.Lock() didReset := cs.didReset cs.didReset = true cc.mu.Unlock() if !didReset { cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) cc.forgetStreamID(cs.ID) } } // checkResetOrDone reports any error sent in a RST_STREAM frame by the // server, or errStreamClosed if the stream is complete. func (cs *clientStream) checkResetOrDone() error { select { case <-cs.peerReset: return cs.resetErr case <-cs.done: return errStreamClosed default: return nil } } func (cs *clientStream) getStartedWrite() bool { cc := cs.cc cc.mu.Lock() defer cc.mu.Unlock() return cs.startedWrite } func (cs *clientStream) abortRequestBodyWrite(err error) { if err == nil { panic("nil error") } cc := cs.cc cc.mu.Lock() cs.stopReqBody = err cc.cond.Broadcast() cc.mu.Unlock() } type stickyErrWriter struct { w io.Writer err *error } func (sew stickyErrWriter) Write(p []byte) (n int, err error) { if *sew.err != nil { return 0, *sew.err } n, err = sew.w.Write(p) *sew.err = err return } // noCachedConnError is the concrete type of ErrNoCachedConn, which // needs to be detected by net/http regardless of whether it's its // bundled version (in h2_bundle.go with a rewritten type name) or // from a user's x/net/http2. As such, as it has a unique method name // (IsHTTP2NoCachedConnError) that net/http sniffs for via func // isNoCachedConnError. type noCachedConnError struct{} func (noCachedConnError) IsHTTP2NoCachedConnError() {} func (noCachedConnError) Error() string { return "http2: no cached connection was available" } // isNoCachedConnError reports whether err is of type noCachedConnError // or its equivalent renamed type in net/http2's h2_bundle.go. Both types // may coexist in the same running program. func isNoCachedConnError(err error) bool { _, ok := err.(interface{ IsHTTP2NoCachedConnError() }) return ok } var ErrNoCachedConn error = noCachedConnError{} // RoundTripOpt are options for the Transport.RoundTripOpt method. type RoundTripOpt struct { // OnlyCachedConn controls whether RoundTripOpt may // create a new TCP connection. If set true and // no cached connection is available, RoundTripOpt // will return ErrNoCachedConn. OnlyCachedConn bool } func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { return t.RoundTripOpt(req, RoundTripOpt{}) } // authorityAddr returns a given authority (a host/IP, or host:port / ip:port) // and returns a host:port. The port 443 is added if needed. func authorityAddr(scheme string, authority string) (addr string) { host, port, err := net.SplitHostPort(authority) if err != nil { // authority didn't have a port port = "443" if scheme == "http" { port = "80" } host = authority } if a, err := idna.ToASCII(host); err == nil { host = a } // IPv6 address literal, without a port: if strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") { return host + ":" + port } return net.JoinHostPort(host, port) } // RoundTripOpt is like RoundTrip, but takes options. func (t *Transport) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) { if !(req.URL.Scheme == "https" || (req.URL.Scheme == "http" && t.AllowHTTP)) { return nil, errors.New("http2: unsupported scheme") } addr := authorityAddr(req.URL.Scheme, req.URL.Host) for retry := 0; ; retry++ { cc, err := t.connPool().GetClientConn(req, addr) if err != nil { t.vlogf("http2: Transport failed to get client conn for %s: %v", addr, err) return nil, err } reused := !atomic.CompareAndSwapUint32(&cc.reused, 0, 1) traceGotConn(req, cc, reused) res, gotErrAfterReqBodyWrite, err := cc.roundTrip(req) if err != nil && retry <= 6 { if req, err = shouldRetryRequest(req, err, gotErrAfterReqBodyWrite); err == nil { // After the first retry, do exponential backoff with 10% jitter. if retry == 0 { continue } backoff := float64(uint(1) << (uint(retry) - 1)) backoff += backoff * (0.1 * mathrand.Float64()) select { case <-time.After(time.Second * time.Duration(backoff)): continue case <-req.Context().Done(): return nil, req.Context().Err() } } } if err != nil { t.vlogf("RoundTrip failure: %v", err) return nil, err } return res, nil } } // CloseIdleConnections closes any connections which were previously // connected from previous requests but are now sitting idle. // It does not interrupt any connections currently in use. func (t *Transport) CloseIdleConnections() { if cp, ok := t.connPool().(clientConnPoolIdleCloser); ok { cp.closeIdleConnections() } } var ( errClientConnClosed = errors.New("http2: client conn is closed") errClientConnUnusable = errors.New("http2: client conn not usable") errClientConnGotGoAway = errors.New("http2: Transport received Server's graceful shutdown GOAWAY") ) // shouldRetryRequest is called by RoundTrip when a request fails to get // response headers. It is always called with a non-nil error. // It returns either a request to retry (either the same request, or a // modified clone), or an error if the request can't be replayed. func shouldRetryRequest(req *http.Request, err error, afterBodyWrite bool) (*http.Request, error) { if !canRetryError(err) { return nil, err } // If the Body is nil (or http.NoBody), it's safe to reuse // this request and its Body. if req.Body == nil || req.Body == http.NoBody { return req, nil } // If the request body can be reset back to its original // state via the optional req.GetBody, do that. if req.GetBody != nil { // TODO: consider a req.Body.Close here? or audit that all caller paths do? body, err := req.GetBody() if err != nil { return nil, err } newReq := *req newReq.Body = body return &newReq, nil } // The Request.Body can't reset back to the beginning, but we // don't seem to have started to read from it yet, so reuse // the request directly. The "afterBodyWrite" means the // bodyWrite process has started, which becomes true before // the first Read. if !afterBodyWrite { return req, nil } return nil, fmt.Errorf("http2: Transport: cannot retry err [%v] after Request.Body was written; define Request.GetBody to avoid this error", err) } func canRetryError(err error) bool { if err == errClientConnUnusable || err == errClientConnGotGoAway { return true } if se, ok := err.(StreamError); ok { return se.Code == ErrCodeRefusedStream } return false } func (t *Transport) dialClientConn(addr string, singleUse bool) (*ClientConn, error) { host, _, err := net.SplitHostPort(addr) if err != nil { return nil, err } tconn, err := t.dialTLS()("tcp", addr, t.newTLSConfig(host)) if err != nil { return nil, err } return t.newClientConn(tconn, singleUse) } func (t *Transport) newTLSConfig(host string) *tls.Config { cfg := new(tls.Config) if t.TLSClientConfig != nil { *cfg = *t.TLSClientConfig.Clone() } if !strSliceContains(cfg.NextProtos, NextProtoTLS) { cfg.NextProtos = append([]string{NextProtoTLS}, cfg.NextProtos...) } if cfg.ServerName == "" { cfg.ServerName = host } return cfg } func (t *Transport) dialTLS() func(string, string, *tls.Config) (net.Conn, error) { if t.DialTLS != nil { return t.DialTLS } return t.dialTLSDefault } func (t *Transport) dialTLSDefault(network, addr string, cfg *tls.Config) (net.Conn, error) { cn, err := tls.Dial(network, addr, cfg) if err != nil { return nil, err } if err := cn.Handshake(); err != nil { return nil, err } if !cfg.InsecureSkipVerify { if err := cn.VerifyHostname(cfg.ServerName); err != nil { return nil, err } } state := cn.ConnectionState() if p := state.NegotiatedProtocol; p != NextProtoTLS { return nil, fmt.Errorf("http2: unexpected ALPN protocol %q; want %q", p, NextProtoTLS) } if !state.NegotiatedProtocolIsMutual { return nil, errors.New("http2: could not negotiate protocol mutually") } return cn, nil } // disableKeepAlives reports whether connections should be closed as // soon as possible after handling the first request. func (t *Transport) disableKeepAlives() bool { return t.t1 != nil && t.t1.DisableKeepAlives } func (t *Transport) expectContinueTimeout() time.Duration { if t.t1 == nil { return 0 } return t.t1.ExpectContinueTimeout } func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { return t.newClientConn(c, false) } func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) { cc := &ClientConn{ t: t, tconn: c, readerDone: make(chan struct{}), nextStreamID: 1, maxFrameSize: 16 << 10, // spec default initialWindowSize: 65535, // spec default maxConcurrentStreams: 1000, // "infinite", per spec. 1000 seems good enough. peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead. streams: make(map[uint32]*clientStream), singleUse: singleUse, wantSettingsAck: true, pings: make(map[[8]byte]chan struct{}), } if d := t.idleConnTimeout(); d != 0 { cc.idleTimeout = d cc.idleTimer = time.AfterFunc(d, cc.onIdleTimeout) } if VerboseLogs { t.vlogf("http2: Transport creating client conn %p to %v", cc, c.RemoteAddr()) } cc.cond = sync.NewCond(&cc.mu) cc.flow.add(int32(initialWindowSize)) // TODO: adjust this writer size to account for frame size + // MTU + crypto/tls record padding. cc.bw = bufio.NewWriter(stickyErrWriter{c, &cc.werr}) cc.br = bufio.NewReader(c) cc.fr = NewFramer(cc.bw, cc.br) cc.fr.ReadMetaHeaders = hpack.NewDecoder(initialHeaderTableSize, nil) cc.fr.MaxHeaderListSize = t.maxHeaderListSize() // TODO: SetMaxDynamicTableSize, SetMaxDynamicTableSizeLimit on // henc in response to SETTINGS frames? cc.henc = hpack.NewEncoder(&cc.hbuf) if t.AllowHTTP { cc.nextStreamID = 3 } if cs, ok := c.(connectionStater); ok { state := cs.ConnectionState() cc.tlsState = &state } initialSettings := []Setting{ {ID: SettingEnablePush, Val: 0}, {ID: SettingInitialWindowSize, Val: transportDefaultStreamFlow}, } if max := t.maxHeaderListSize(); max != 0 { initialSettings = append(initialSettings, Setting{ID: SettingMaxHeaderListSize, Val: max}) } cc.bw.Write(clientPreface) cc.fr.WriteSettings(initialSettings...) cc.fr.WriteWindowUpdate(0, transportDefaultConnFlow) cc.inflow.add(transportDefaultConnFlow + initialWindowSize) cc.bw.Flush() if cc.werr != nil { return nil, cc.werr } go cc.readLoop() return cc, nil } func (cc *ClientConn) setGoAway(f *GoAwayFrame) { cc.mu.Lock() defer cc.mu.Unlock() old := cc.goAway cc.goAway = f // Merge the previous and current GoAway error frames. if cc.goAwayDebug == "" { cc.goAwayDebug = string(f.DebugData()) } if old != nil && old.ErrCode != ErrCodeNo { cc.goAway.ErrCode = old.ErrCode } last := f.LastStreamID for streamID, cs := range cc.streams { if streamID > last { select { case cs.resc <- resAndError{err: errClientConnGotGoAway}: default: } } } } // CanTakeNewRequest reports whether the connection can take a new request, // meaning it has not been closed or received or sent a GOAWAY. func (cc *ClientConn) CanTakeNewRequest() bool { cc.mu.Lock() defer cc.mu.Unlock() return cc.canTakeNewRequestLocked() } // clientConnIdleState describes the suitability of a client // connection to initiate a new RoundTrip request. type clientConnIdleState struct { canTakeNewRequest bool freshConn bool // whether it's unused by any previous request } func (cc *ClientConn) idleState() clientConnIdleState { cc.mu.Lock() defer cc.mu.Unlock() return cc.idleStateLocked() } func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) { if cc.singleUse && cc.nextStreamID > 1 { return } var maxConcurrentOkay bool if cc.t.StrictMaxConcurrentStreams { // We'll tell the caller we can take a new request to // prevent the caller from dialing a new TCP // connection, but then we'll block later before // writing it. maxConcurrentOkay = true } else { maxConcurrentOkay = int64(len(cc.streams)+1) < int64(cc.maxConcurrentStreams) } st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && maxConcurrentOkay && int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 st.freshConn = cc.nextStreamID == 1 && st.canTakeNewRequest return } func (cc *ClientConn) canTakeNewRequestLocked() bool { st := cc.idleStateLocked() return st.canTakeNewRequest } // onIdleTimeout is called from a time.AfterFunc goroutine. It will // only be called when we're idle, but because we're coming from a new // goroutine, there could be a new request coming in at the same time, // so this simply calls the synchronized closeIfIdle to shut down this // connection. The timer could just call closeIfIdle, but this is more // clear. func (cc *ClientConn) onIdleTimeout() { cc.closeIfIdle() } func (cc *ClientConn) closeIfIdle() { cc.mu.Lock() if len(cc.streams) > 0 { cc.mu.Unlock() return } cc.closed = true nextID := cc.nextStreamID // TODO: do clients send GOAWAY too? maybe? Just Close: cc.mu.Unlock() if VerboseLogs { cc.vlogf("http2: Transport closing idle conn %p (forSingleUse=%v, maxStream=%v)", cc, cc.singleUse, nextID-2) } cc.tconn.Close() } var shutdownEnterWaitStateHook = func() {} // Shutdown gracefully close the client connection, waiting for running streams to complete. func (cc *ClientConn) Shutdown(ctx context.Context) error { if err := cc.sendGoAway(); err != nil { return err } // Wait for all in-flight streams to complete or connection to close done := make(chan error, 1) cancelled := false // guarded by cc.mu go func() { cc.mu.Lock() defer cc.mu.Unlock() for { if len(cc.streams) == 0 || cc.closed { cc.closed = true done <- cc.tconn.Close() break } if cancelled { break } cc.cond.Wait() } }() shutdownEnterWaitStateHook() select { case err := <-done: return err case <-ctx.Done(): cc.mu.Lock() // Free the goroutine above cancelled = true cc.cond.Broadcast() cc.mu.Unlock() return ctx.Err() } } func (cc *ClientConn) sendGoAway() error { cc.mu.Lock() defer cc.mu.Unlock() cc.wmu.Lock() defer cc.wmu.Unlock() if cc.closing { // GOAWAY sent already return nil } // Send a graceful shutdown frame to server maxStreamID := cc.nextStreamID if err := cc.fr.WriteGoAway(maxStreamID, ErrCodeNo, nil); err != nil { return err } if err := cc.bw.Flush(); err != nil { return err } // Prevent new requests cc.closing = true return nil } // Close closes the client connection immediately. // // In-flight requests are interrupted. For a graceful shutdown, use Shutdown instead. func (cc *ClientConn) Close() error { cc.mu.Lock() defer cc.cond.Broadcast() defer cc.mu.Unlock() err := errors.New("http2: client connection force closed via ClientConn.Close") for id, cs := range cc.streams { select { case cs.resc <- resAndError{err: err}: default: } cs.bufPipe.CloseWithError(err) delete(cc.streams, id) } cc.closed = true return cc.tconn.Close() } const maxAllocFrameSize = 512 << 10 // frameBuffer returns a scratch buffer suitable for writing DATA frames. // They're capped at the min of the peer's max frame size or 512KB // (kinda arbitrarily), but definitely capped so we don't allocate 4GB // bufers. func (cc *ClientConn) frameScratchBuffer() []byte { cc.mu.Lock() size := cc.maxFrameSize if size > maxAllocFrameSize { size = maxAllocFrameSize } for i, buf := range cc.freeBuf { if len(buf) >= int(size) { cc.freeBuf[i] = nil cc.mu.Unlock() return buf[:size] } } cc.mu.Unlock() return make([]byte, size) } func (cc *ClientConn) putFrameScratchBuffer(buf []byte) { cc.mu.Lock() defer cc.mu.Unlock() const maxBufs = 4 // arbitrary; 4 concurrent requests per conn? investigate. if len(cc.freeBuf) < maxBufs { cc.freeBuf = append(cc.freeBuf, buf) return } for i, old := range cc.freeBuf { if old == nil { cc.freeBuf[i] = buf return } } // forget about it. } // errRequestCanceled is a copy of net/http's errRequestCanceled because it's not // exported. At least they'll be DeepEqual for h1-vs-h2 comparisons tests. var errRequestCanceled = errors.New("net/http: request canceled") func commaSeparatedTrailers(req *http.Request) (string, error) { keys := make([]string, 0, len(req.Trailer)) for k := range req.Trailer { k = http.CanonicalHeaderKey(k) switch k { case "Transfer-Encoding", "Trailer", "Content-Length": return "", &badStringError{"invalid Trailer key", k} } keys = append(keys, k) } if len(keys) > 0 { sort.Strings(keys) return strings.Join(keys, ","), nil } return "", nil } func (cc *ClientConn) responseHeaderTimeout() time.Duration { if cc.t.t1 != nil { return cc.t.t1.ResponseHeaderTimeout } // No way to do this (yet?) with just an http2.Transport. Probably // no need. Request.Cancel this is the new way. We only need to support // this for compatibility with the old http.Transport fields when // we're doing transparent http2. return 0 } // checkConnHeaders checks whether req has any invalid connection-level headers. // per RFC 7540 section 8.1.2.2: Connection-Specific Header Fields. // Certain headers are special-cased as okay but not transmitted later. func checkConnHeaders(req *http.Request) error { if v := req.Header.Get("Upgrade"); v != "" { return fmt.Errorf("http2: invalid Upgrade request header: %q", req.Header["Upgrade"]) } if vv := req.Header["Transfer-Encoding"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && vv[0] != "chunked") { return fmt.Errorf("http2: invalid Transfer-Encoding request header: %q", vv) } if vv := req.Header["Connection"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && !strings.EqualFold(vv[0], "close") && !strings.EqualFold(vv[0], "keep-alive")) { return fmt.Errorf("http2: invalid Connection request header: %q", vv) } return nil } // actualContentLength returns a sanitized version of // req.ContentLength, where 0 actually means zero (not unknown) and -1 // means unknown. func actualContentLength(req *http.Request) int64 { if req.Body == nil || req.Body == http.NoBody { return 0 } if req.ContentLength != 0 { return req.ContentLength } return -1 } func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { resp, _, err := cc.roundTrip(req) return resp, err } func (cc *ClientConn) roundTrip(req *http.Request) (res *http.Response, gotErrAfterReqBodyWrite bool, err error) { if err := checkConnHeaders(req); err != nil { return nil, false, err } if cc.idleTimer != nil { cc.idleTimer.Stop() } trailers, err := commaSeparatedTrailers(req) if err != nil { return nil, false, err } hasTrailers := trailers != "" cc.mu.Lock() if err := cc.awaitOpenSlotForRequest(req); err != nil { cc.mu.Unlock() return nil, false, err } body := req.Body contentLen := actualContentLength(req) hasBody := contentLen != 0 // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? var requestedGzip bool if !cc.t.disableCompression() && req.Header.Get("Accept-Encoding") == "" && req.Header.Get("Range") == "" && req.Method != "HEAD" { // Request gzip only, not deflate. Deflate is ambiguous and // not as universally supported anyway. // See: http://www.gzip.org/zlib/zlib_faq.html#faq38 // // Note that we don't request this for HEAD requests, // due to a bug in nginx: // http://trac.nginx.org/nginx/ticket/358 // https://golang.org/issue/5522 // // We don't request gzip if the request is for a range, since // auto-decoding a portion of a gzipped document will just fail // anyway. See https://golang.org/issue/8923 requestedGzip = true } // we send: HEADERS{1}, CONTINUATION{0,} + DATA{0,} (DATA is // sent by writeRequestBody below, along with any Trailers, // again in form HEADERS{1}, CONTINUATION{0,}) hdrs, err := cc.encodeHeaders(req, requestedGzip, trailers, contentLen) if err != nil { cc.mu.Unlock() return nil, false, err } cs := cc.newStream() cs.req = req cs.trace = httptrace.ContextClientTrace(req.Context()) cs.requestedGzip = requestedGzip bodyWriter := cc.t.getBodyWriterState(cs, body) cs.on100 = bodyWriter.on100 cc.wmu.Lock() endStream := !hasBody && !hasTrailers werr := cc.writeHeaders(cs.ID, endStream, int(cc.maxFrameSize), hdrs) cc.wmu.Unlock() traceWroteHeaders(cs.trace) cc.mu.Unlock() if werr != nil { if hasBody { req.Body.Close() // per RoundTripper contract bodyWriter.cancel() } cc.forgetStreamID(cs.ID) // Don't bother sending a RST_STREAM (our write already failed; // no need to keep writing) traceWroteRequest(cs.trace, werr) return nil, false, werr } var respHeaderTimer <-chan time.Time if hasBody { bodyWriter.scheduleBodyWrite() } else { traceWroteRequest(cs.trace, nil) if d := cc.responseHeaderTimeout(); d != 0 { timer := time.NewTimer(d) defer timer.Stop() respHeaderTimer = timer.C } } readLoopResCh := cs.resc bodyWritten := false ctx := req.Context() handleReadLoopResponse := func(re resAndError) (*http.Response, bool, error) { res := re.res if re.err != nil || res.StatusCode > 299 { // On error or status code 3xx, 4xx, 5xx, etc abort any // ongoing write, assuming that the server doesn't care // about our request body. If the server replied with 1xx or // 2xx, however, then assume the server DOES potentially // want our body (e.g. full-duplex streaming: // golang.org/issue/13444). If it turns out the server // doesn't, they'll RST_STREAM us soon enough. This is a // heuristic to avoid adding knobs to Transport. Hopefully // we can keep it. bodyWriter.cancel() cs.abortRequestBodyWrite(errStopReqBodyWrite) } if re.err != nil { cc.forgetStreamID(cs.ID) return nil, cs.getStartedWrite(), re.err } res.Request = req res.TLS = cc.tlsState return res, false, nil } for { select { case re := <-readLoopResCh: return handleReadLoopResponse(re) case <-respHeaderTimer: if !hasBody || bodyWritten { cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) } else { bodyWriter.cancel() cs.abortRequestBodyWrite(errStopReqBodyWriteAndCancel) } cc.forgetStreamID(cs.ID) return nil, cs.getStartedWrite(), errTimeout case <-ctx.Done(): if !hasBody || bodyWritten { cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) } else { bodyWriter.cancel() cs.abortRequestBodyWrite(errStopReqBodyWriteAndCancel) } cc.forgetStreamID(cs.ID) return nil, cs.getStartedWrite(), ctx.Err() case <-req.Cancel: if !hasBody || bodyWritten { cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) } else { bodyWriter.cancel() cs.abortRequestBodyWrite(errStopReqBodyWriteAndCancel) } cc.forgetStreamID(cs.ID) return nil, cs.getStartedWrite(), errRequestCanceled case <-cs.peerReset: // processResetStream already removed the // stream from the streams map; no need for // forgetStreamID. return nil, cs.getStartedWrite(), cs.resetErr case err := <-bodyWriter.resc: // Prefer the read loop's response, if available. Issue 16102. select { case re := <-readLoopResCh: return handleReadLoopResponse(re) default: } if err != nil { cc.forgetStreamID(cs.ID) return nil, cs.getStartedWrite(), err } bodyWritten = true if d := cc.responseHeaderTimeout(); d != 0 { timer := time.NewTimer(d) defer timer.Stop() respHeaderTimer = timer.C } } } } // awaitOpenSlotForRequest waits until len(streams) < maxConcurrentStreams. // Must hold cc.mu. func (cc *ClientConn) awaitOpenSlotForRequest(req *http.Request) error { var waitingForConn chan struct{} var waitingForConnErr error // guarded by cc.mu for { cc.lastActive = time.Now() if cc.closed || !cc.canTakeNewRequestLocked() { if waitingForConn != nil { close(waitingForConn) } return errClientConnUnusable } if int64(len(cc.streams))+1 <= int64(cc.maxConcurrentStreams) { if waitingForConn != nil { close(waitingForConn) } return nil } // Unfortunately, we cannot wait on a condition variable and channel at // the same time, so instead, we spin up a goroutine to check if the // request is canceled while we wait for a slot to open in the connection. if waitingForConn == nil { waitingForConn = make(chan struct{}) go func() { if err := awaitRequestCancel(req, waitingForConn); err != nil { cc.mu.Lock() waitingForConnErr = err cc.cond.Broadcast() cc.mu.Unlock() } }() } cc.pendingRequests++ cc.cond.Wait() cc.pendingRequests-- if waitingForConnErr != nil { return waitingForConnErr } } } // requires cc.wmu be held func (cc *ClientConn) writeHeaders(streamID uint32, endStream bool, maxFrameSize int, hdrs []byte) error { first := true // first frame written (HEADERS is first, then CONTINUATION) for len(hdrs) > 0 && cc.werr == nil { chunk := hdrs if len(chunk) > maxFrameSize { chunk = chunk[:maxFrameSize] } hdrs = hdrs[len(chunk):] endHeaders := len(hdrs) == 0 if first { cc.fr.WriteHeaders(HeadersFrameParam{ StreamID: streamID, BlockFragment: chunk, EndStream: endStream, EndHeaders: endHeaders, }) first = false } else { cc.fr.WriteContinuation(streamID, endHeaders, chunk) } } // TODO(bradfitz): this Flush could potentially block (as // could the WriteHeaders call(s) above), which means they // wouldn't respond to Request.Cancel being readable. That's // rare, but this should probably be in a goroutine. cc.bw.Flush() return cc.werr } // internal error values; they don't escape to callers var ( // abort request body write; don't send cancel errStopReqBodyWrite = errors.New("http2: aborting request body write") // abort request body write, but send stream reset of cancel. errStopReqBodyWriteAndCancel = errors.New("http2: canceling request") ) func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) (err error) { cc := cs.cc sentEnd := false // whether we sent the final DATA frame w/ END_STREAM buf := cc.frameScratchBuffer() defer cc.putFrameScratchBuffer(buf) defer func() { traceWroteRequest(cs.trace, err) // TODO: write h12Compare test showing whether // Request.Body is closed by the Transport, // and in multiple cases: server replies <=299 and >299 // while still writing request body cerr := bodyCloser.Close() if err == nil { err = cerr } }() req := cs.req hasTrailers := req.Trailer != nil var sawEOF bool for !sawEOF { n, err := body.Read(buf) if err == io.EOF { sawEOF = true err = nil } else if err != nil { cc.writeStreamReset(cs.ID, ErrCodeCancel, err) return err } remain := buf[:n] for len(remain) > 0 && err == nil { var allowed int32 allowed, err = cs.awaitFlowControl(len(remain)) switch { case err == errStopReqBodyWrite: return err case err == errStopReqBodyWriteAndCancel: cc.writeStreamReset(cs.ID, ErrCodeCancel, nil) return err case err != nil: return err } cc.wmu.Lock() data := remain[:allowed] remain = remain[allowed:] sentEnd = sawEOF && len(remain) == 0 && !hasTrailers err = cc.fr.WriteData(cs.ID, sentEnd, data) if err == nil { // TODO(bradfitz): this flush is for latency, not bandwidth. // Most requests won't need this. Make this opt-in or // opt-out? Use some heuristic on the body type? Nagel-like // timers? Based on 'n'? Only last chunk of this for loop, // unless flow control tokens are low? For now, always. // If we change this, see comment below. err = cc.bw.Flush() } cc.wmu.Unlock() } if err != nil { return err } } if sentEnd { // Already sent END_STREAM (which implies we have no // trailers) and flushed, because currently all // WriteData frames above get a flush. So we're done. return nil } var trls []byte if hasTrailers { cc.mu.Lock() trls, err = cc.encodeTrailers(req) cc.mu.Unlock() if err != nil { cc.writeStreamReset(cs.ID, ErrCodeInternal, err) cc.forgetStreamID(cs.ID) return err } } cc.mu.Lock() maxFrameSize := int(cc.maxFrameSize) cc.mu.Unlock() cc.wmu.Lock() defer cc.wmu.Unlock() // Two ways to send END_STREAM: either with trailers, or // with an empty DATA frame. if len(trls) > 0 { err = cc.writeHeaders(cs.ID, true, maxFrameSize, trls) } else { err = cc.fr.WriteData(cs.ID, true, nil) } if ferr := cc.bw.Flush(); ferr != nil && err == nil { err = ferr } return err } // awaitFlowControl waits for [1, min(maxBytes, cc.cs.maxFrameSize)] flow // control tokens from the server. // It returns either the non-zero number of tokens taken or an error // if the stream is dead. func (cs *clientStream) awaitFlowControl(maxBytes int) (taken int32, err error) { cc := cs.cc cc.mu.Lock() defer cc.mu.Unlock() for { if cc.closed { return 0, errClientConnClosed } if cs.stopReqBody != nil { return 0, cs.stopReqBody } if err := cs.checkResetOrDone(); err != nil { return 0, err } if a := cs.flow.available(); a > 0 { take := a if int(take) > maxBytes { take = int32(maxBytes) // can't truncate int; take is int32 } if take > int32(cc.maxFrameSize) { take = int32(cc.maxFrameSize) } cs.flow.take(take) return take, nil } cc.cond.Wait() } } type badStringError struct { what string str string } func (e *badStringError) Error() string { return fmt.Sprintf("%s %q", e.what, e.str) } // requires cc.mu be held. func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trailers string, contentLength int64) ([]byte, error) { cc.hbuf.Reset() host := req.Host if host == "" { host = req.URL.Host } host, err := httpguts.PunycodeHostPort(host) if err != nil { return nil, err } var path string if req.Method != "CONNECT" { path = req.URL.RequestURI() if !validPseudoPath(path) { orig := path path = strings.TrimPrefix(path, req.URL.Scheme+"://"+host) if !validPseudoPath(path) { if req.URL.Opaque != "" { return nil, fmt.Errorf("invalid request :path %q from URL.Opaque = %q", orig, req.URL.Opaque) } else { return nil, fmt.Errorf("invalid request :path %q", orig) } } } } // Check for any invalid headers and return an error before we // potentially pollute our hpack state. (We want to be able to // continue to reuse the hpack encoder for future requests) for k, vv := range req.Header { if !httpguts.ValidHeaderFieldName(k) { return nil, fmt.Errorf("invalid HTTP header name %q", k) } for _, v := range vv { if !httpguts.ValidHeaderFieldValue(v) { return nil, fmt.Errorf("invalid HTTP header value %q for header %q", v, k) } } } enumerateHeaders := func(f func(name, value string)) { // 8.1.2.3 Request Pseudo-Header Fields // The :path pseudo-header field includes the path and query parts of the // target URI (the path-absolute production and optionally a '?' character // followed by the query production (see Sections 3.3 and 3.4 of // [RFC3986]). f(":authority", host) m := req.Method if m == "" { m = http.MethodGet } f(":method", m) if req.Method != "CONNECT" { f(":path", path) f(":scheme", req.URL.Scheme) } if trailers != "" { f("trailer", trailers) } var didUA bool for k, vv := range req.Header { if strings.EqualFold(k, "host") || strings.EqualFold(k, "content-length") { // Host is :authority, already sent. // Content-Length is automatic, set below. continue } else if strings.EqualFold(k, "connection") || strings.EqualFold(k, "proxy-connection") || strings.EqualFold(k, "transfer-encoding") || strings.EqualFold(k, "upgrade") || strings.EqualFold(k, "keep-alive") { // Per 8.1.2.2 Connection-Specific Header // Fields, don't send connection-specific // fields. We have already checked if any // are error-worthy so just ignore the rest. continue } else if strings.EqualFold(k, "user-agent") { // Match Go's http1 behavior: at most one // User-Agent. If set to nil or empty string, // then omit it. Otherwise if not mentioned, // include the default (below). didUA = true if len(vv) < 1 { continue } vv = vv[:1] if vv[0] == "" { continue } } for _, v := range vv { f(k, v) } } if shouldSendReqContentLength(req.Method, contentLength) { f("content-length", strconv.FormatInt(contentLength, 10)) } if addGzipHeader { f("accept-encoding", "gzip") } if !didUA { f("user-agent", defaultUserAgent) } } // Do a first pass over the headers counting bytes to ensure // we don't exceed cc.peerMaxHeaderListSize. This is done as a // separate pass before encoding the headers to prevent // modifying the hpack state. hlSize := uint64(0) enumerateHeaders(func(name, value string) { hf := hpack.HeaderField{Name: name, Value: value} hlSize += uint64(hf.Size()) }) if hlSize > cc.peerMaxHeaderListSize { return nil, errRequestHeaderListSize } trace := httptrace.ContextClientTrace(req.Context()) traceHeaders := traceHasWroteHeaderField(trace) // Header list size is ok. Write the headers. enumerateHeaders(func(name, value string) { name = strings.ToLower(name) cc.writeHeader(name, value) if traceHeaders { traceWroteHeaderField(trace, name, value) } }) return cc.hbuf.Bytes(), nil } // shouldSendReqContentLength reports whether the http2.Transport should send // a "content-length" request header. This logic is basically a copy of the net/http // transferWriter.shouldSendContentLength. // The contentLength is the corrected contentLength (so 0 means actually 0, not unknown). // -1 means unknown. func shouldSendReqContentLength(method string, contentLength int64) bool { if contentLength > 0 { return true } if contentLength < 0 { return false } // For zero bodies, whether we send a content-length depends on the method. // It also kinda doesn't matter for http2 either way, with END_STREAM. switch method { case "POST", "PUT", "PATCH": return true default: return false } } // requires cc.mu be held. func (cc *ClientConn) encodeTrailers(req *http.Request) ([]byte, error) { cc.hbuf.Reset() hlSize := uint64(0) for k, vv := range req.Trailer { for _, v := range vv { hf := hpack.HeaderField{Name: k, Value: v} hlSize += uint64(hf.Size()) } } if hlSize > cc.peerMaxHeaderListSize { return nil, errRequestHeaderListSize } for k, vv := range req.Trailer { // Transfer-Encoding, etc.. have already been filtered at the // start of RoundTrip lowKey := strings.ToLower(k) for _, v := range vv { cc.writeHeader(lowKey, v) } } return cc.hbuf.Bytes(), nil } func (cc *ClientConn) writeHeader(name, value string) { if VerboseLogs { log.Printf("http2: Transport encoding header %q = %q", name, value) } cc.henc.WriteField(hpack.HeaderField{Name: name, Value: value}) } type resAndError struct { res *http.Response err error } // requires cc.mu be held. func (cc *ClientConn) newStream() *clientStream { cs := &clientStream{ cc: cc, ID: cc.nextStreamID, resc: make(chan resAndError, 1), peerReset: make(chan struct{}), done: make(chan struct{}), } cs.flow.add(int32(cc.initialWindowSize)) cs.flow.setConnFlow(&cc.flow) cs.inflow.add(transportDefaultStreamFlow) cs.inflow.setConnFlow(&cc.inflow) cc.nextStreamID += 2 cc.streams[cs.ID] = cs return cs } func (cc *ClientConn) forgetStreamID(id uint32) { cc.streamByID(id, true) } func (cc *ClientConn) streamByID(id uint32, andRemove bool) *clientStream { cc.mu.Lock() defer cc.mu.Unlock() cs := cc.streams[id] if andRemove && cs != nil && !cc.closed { cc.lastActive = time.Now() delete(cc.streams, id) if len(cc.streams) == 0 && cc.idleTimer != nil { cc.idleTimer.Reset(cc.idleTimeout) } close(cs.done) // Wake up checkResetOrDone via clientStream.awaitFlowControl and // wake up RoundTrip if there is a pending request. cc.cond.Broadcast() } return cs } // clientConnReadLoop is the state owned by the clientConn's frame-reading readLoop. type clientConnReadLoop struct { cc *ClientConn closeWhenIdle bool } // readLoop runs in its own goroutine and reads and dispatches frames. func (cc *ClientConn) readLoop() { rl := &clientConnReadLoop{cc: cc} defer rl.cleanup() cc.readerErr = rl.run() if ce, ok := cc.readerErr.(ConnectionError); ok { cc.wmu.Lock() cc.fr.WriteGoAway(0, ErrCode(ce), nil) cc.wmu.Unlock() } } // GoAwayError is returned by the Transport when the server closes the // TCP connection after sending a GOAWAY frame. type GoAwayError struct { LastStreamID uint32 ErrCode ErrCode DebugData string } func (e GoAwayError) Error() string { return fmt.Sprintf("http2: server sent GOAWAY and closed the connection; LastStreamID=%v, ErrCode=%v, debug=%q", e.LastStreamID, e.ErrCode, e.DebugData) } func isEOFOrNetReadError(err error) bool { if err == io.EOF { return true } ne, ok := err.(*net.OpError) return ok && ne.Op == "read" } func (rl *clientConnReadLoop) cleanup() { cc := rl.cc defer cc.tconn.Close() defer cc.t.connPool().MarkDead(cc) defer close(cc.readerDone) if cc.idleTimer != nil { cc.idleTimer.Stop() } // Close any response bodies if the server closes prematurely. // TODO: also do this if we've written the headers but not // gotten a response yet. err := cc.readerErr cc.mu.Lock() if cc.goAway != nil && isEOFOrNetReadError(err) { err = GoAwayError{ LastStreamID: cc.goAway.LastStreamID, ErrCode: cc.goAway.ErrCode, DebugData: cc.goAwayDebug, } } else if err == io.EOF { err = io.ErrUnexpectedEOF } for _, cs := range cc.streams { cs.bufPipe.CloseWithError(err) // no-op if already closed select { case cs.resc <- resAndError{err: err}: default: } close(cs.done) } cc.closed = true cc.cond.Broadcast() cc.mu.Unlock() } func (rl *clientConnReadLoop) run() error { cc := rl.cc rl.closeWhenIdle = cc.t.disableKeepAlives() || cc.singleUse gotReply := false // ever saw a HEADERS reply gotSettings := false for { f, err := cc.fr.ReadFrame() if err != nil { cc.vlogf("http2: Transport readFrame error on conn %p: (%T) %v", cc, err, err) } if se, ok := err.(StreamError); ok { if cs := cc.streamByID(se.StreamID, false); cs != nil { cs.cc.writeStreamReset(cs.ID, se.Code, err) cs.cc.forgetStreamID(cs.ID) if se.Cause == nil { se.Cause = cc.fr.errDetail } rl.endStreamError(cs, se) } continue } else if err != nil { return err } if VerboseLogs { cc.vlogf("http2: Transport received %s", summarizeFrame(f)) } if !gotSettings { if _, ok := f.(*SettingsFrame); !ok { cc.logf("protocol error: received %T before a SETTINGS frame", f) return ConnectionError(ErrCodeProtocol) } gotSettings = true } maybeIdle := false // whether frame might transition us to idle switch f := f.(type) { case *MetaHeadersFrame: err = rl.processHeaders(f) maybeIdle = true gotReply = true case *DataFrame: err = rl.processData(f) maybeIdle = true case *GoAwayFrame: err = rl.processGoAway(f) maybeIdle = true case *RSTStreamFrame: err = rl.processResetStream(f) maybeIdle = true case *SettingsFrame: err = rl.processSettings(f) case *PushPromiseFrame: err = rl.processPushPromise(f) case *WindowUpdateFrame: err = rl.processWindowUpdate(f) case *PingFrame: err = rl.processPing(f) default: cc.logf("Transport: unhandled response frame type %T", f) } if err != nil { if VerboseLogs { cc.vlogf("http2: Transport conn %p received error from processing frame %v: %v", cc, summarizeFrame(f), err) } return err } if rl.closeWhenIdle && gotReply && maybeIdle { cc.closeIfIdle() } } } func (rl *clientConnReadLoop) processHeaders(f *MetaHeadersFrame) error { cc := rl.cc cs := cc.streamByID(f.StreamID, false) if cs == nil { // We'd get here if we canceled a request while the // server had its response still in flight. So if this // was just something we canceled, ignore it. return nil } if f.StreamEnded() { // Issue 20521: If the stream has ended, streamByID() causes // clientStream.done to be closed, which causes the request's bodyWriter // to be closed with an errStreamClosed, which may be received by // clientConn.RoundTrip before the result of processing these headers. // Deferring stream closure allows the header processing to occur first. // clientConn.RoundTrip may still receive the bodyWriter error first, but // the fix for issue 16102 prioritises any response. // // Issue 22413: If there is no request body, we should close the // stream before writing to cs.resc so that the stream is closed // immediately once RoundTrip returns. if cs.req.Body != nil { defer cc.forgetStreamID(f.StreamID) } else { cc.forgetStreamID(f.StreamID) } } if !cs.firstByte { if cs.trace != nil { // TODO(bradfitz): move first response byte earlier, // when we first read the 9 byte header, not waiting // until all the HEADERS+CONTINUATION frames have been // merged. This works for now. traceFirstResponseByte(cs.trace) } cs.firstByte = true } if !cs.pastHeaders { cs.pastHeaders = true } else { return rl.processTrailers(cs, f) } res, err := rl.handleResponse(cs, f) if err != nil { if _, ok := err.(ConnectionError); ok { return err } // Any other error type is a stream error. cs.cc.writeStreamReset(f.StreamID, ErrCodeProtocol, err) cc.forgetStreamID(cs.ID) cs.resc <- resAndError{err: err} return nil // return nil from process* funcs to keep conn alive } if res == nil { // (nil, nil) special case. See handleResponse docs. return nil } cs.resTrailer = &res.Trailer cs.resc <- resAndError{res: res} return nil } // may return error types nil, or ConnectionError. Any other error value // is a StreamError of type ErrCodeProtocol. The returned error in that case // is the detail. // // As a special case, handleResponse may return (nil, nil) to skip the // frame (currently only used for 1xx responses). func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFrame) (*http.Response, error) { if f.Truncated { return nil, errResponseHeaderListSize } status := f.PseudoValue("status") if status == "" { return nil, errors.New("malformed response from server: missing status pseudo header") } statusCode, err := strconv.Atoi(status) if err != nil { return nil, errors.New("malformed response from server: malformed non-numeric status pseudo header") } header := make(http.Header) res := &http.Response{ Proto: "HTTP/2.0", ProtoMajor: 2, Header: header, StatusCode: statusCode, Status: status + " " + http.StatusText(statusCode), } for _, hf := range f.RegularFields() { key := http.CanonicalHeaderKey(hf.Name) if key == "Trailer" { t := res.Trailer if t == nil { t = make(http.Header) res.Trailer = t } foreachHeaderElement(hf.Value, func(v string) { t[http.CanonicalHeaderKey(v)] = nil }) } else { header[key] = append(header[key], hf.Value) } } if statusCode >= 100 && statusCode <= 199 { cs.num1xx++ const max1xxResponses = 5 // arbitrary bound on number of informational responses, same as net/http if cs.num1xx > max1xxResponses { return nil, errors.New("http2: too many 1xx informational responses") } if fn := cs.get1xxTraceFunc(); fn != nil { if err := fn(statusCode, textproto.MIMEHeader(header)); err != nil { return nil, err } } if statusCode == 100 { traceGot100Continue(cs.trace) if cs.on100 != nil { cs.on100() // forces any write delay timer to fire } } cs.pastHeaders = false // do it all again return nil, nil } streamEnded := f.StreamEnded() isHead := cs.req.Method == "HEAD" if !streamEnded || isHead { res.ContentLength = -1 if clens := res.Header["Content-Length"]; len(clens) == 1 { if clen64, err := strconv.ParseInt(clens[0], 10, 64); err == nil { res.ContentLength = clen64 } else { // TODO: care? unlike http/1, it won't mess up our framing, so it's // more safe smuggling-wise to ignore. } } else if len(clens) > 1 { // TODO: care? unlike http/1, it won't mess up our framing, so it's // more safe smuggling-wise to ignore. } } if streamEnded || isHead { res.Body = noBody return res, nil } cs.bufPipe = pipe{b: &dataBuffer{expected: res.ContentLength}} cs.bytesRemain = res.ContentLength res.Body = transportResponseBody{cs} go cs.awaitRequestCancel(cs.req) if cs.requestedGzip && res.Header.Get("Content-Encoding") == "gzip" { res.Header.Del("Content-Encoding") res.Header.Del("Content-Length") res.ContentLength = -1 res.Body = &gzipReader{body: res.Body} res.Uncompressed = true } return res, nil } func (rl *clientConnReadLoop) processTrailers(cs *clientStream, f *MetaHeadersFrame) error { if cs.pastTrailers { // Too many HEADERS frames for this stream. return ConnectionError(ErrCodeProtocol) } cs.pastTrailers = true if !f.StreamEnded() { // We expect that any headers for trailers also // has END_STREAM. return ConnectionError(ErrCodeProtocol) } if len(f.PseudoFields()) > 0 { // No pseudo header fields are defined for trailers. // TODO: ConnectionError might be overly harsh? Check. return ConnectionError(ErrCodeProtocol) } trailer := make(http.Header) for _, hf := range f.RegularFields() { key := http.CanonicalHeaderKey(hf.Name) trailer[key] = append(trailer[key], hf.Value) } cs.trailer = trailer rl.endStream(cs) return nil } // transportResponseBody is the concrete type of Transport.RoundTrip's // Response.Body. It is an io.ReadCloser. On Read, it reads from cs.body. // On Close it sends RST_STREAM if EOF wasn't already seen. type transportResponseBody struct { cs *clientStream } func (b transportResponseBody) Read(p []byte) (n int, err error) { cs := b.cs cc := cs.cc if cs.readErr != nil { return 0, cs.readErr } n, err = b.cs.bufPipe.Read(p) if cs.bytesRemain != -1 { if int64(n) > cs.bytesRemain { n = int(cs.bytesRemain) if err == nil { err = errors.New("net/http: server replied with more than declared Content-Length; truncated") cc.writeStreamReset(cs.ID, ErrCodeProtocol, err) } cs.readErr = err return int(cs.bytesRemain), err } cs.bytesRemain -= int64(n) if err == io.EOF && cs.bytesRemain > 0 { err = io.ErrUnexpectedEOF cs.readErr = err return n, err } } if n == 0 { // No flow control tokens to send back. return } cc.mu.Lock() defer cc.mu.Unlock() var connAdd, streamAdd int32 // Check the conn-level first, before the stream-level. if v := cc.inflow.available(); v < transportDefaultConnFlow/2 { connAdd = transportDefaultConnFlow - v cc.inflow.add(connAdd) } if err == nil { // No need to refresh if the stream is over or failed. // Consider any buffered body data (read from the conn but not // consumed by the client) when computing flow control for this // stream. v := int(cs.inflow.available()) + cs.bufPipe.Len() if v < transportDefaultStreamFlow-transportDefaultStreamMinRefresh { streamAdd = int32(transportDefaultStreamFlow - v) cs.inflow.add(streamAdd) } } if connAdd != 0 || streamAdd != 0 { cc.wmu.Lock() defer cc.wmu.Unlock() if connAdd != 0 { cc.fr.WriteWindowUpdate(0, mustUint31(connAdd)) } if streamAdd != 0 { cc.fr.WriteWindowUpdate(cs.ID, mustUint31(streamAdd)) } cc.bw.Flush() } return } var errClosedResponseBody = errors.New("http2: response body closed") func (b transportResponseBody) Close() error { cs := b.cs cc := cs.cc serverSentStreamEnd := cs.bufPipe.Err() == io.EOF unread := cs.bufPipe.Len() if unread > 0 || !serverSentStreamEnd { cc.mu.Lock() cc.wmu.Lock() if !serverSentStreamEnd { cc.fr.WriteRSTStream(cs.ID, ErrCodeCancel) cs.didReset = true } // Return connection-level flow control. if unread > 0 { cc.inflow.add(int32(unread)) cc.fr.WriteWindowUpdate(0, uint32(unread)) } cc.bw.Flush() cc.wmu.Unlock() cc.mu.Unlock() } cs.bufPipe.BreakWithError(errClosedResponseBody) cc.forgetStreamID(cs.ID) return nil } func (rl *clientConnReadLoop) processData(f *DataFrame) error { cc := rl.cc cs := cc.streamByID(f.StreamID, f.StreamEnded()) data := f.Data() if cs == nil { cc.mu.Lock() neverSent := cc.nextStreamID cc.mu.Unlock() if f.StreamID >= neverSent { // We never asked for this. cc.logf("http2: Transport received unsolicited DATA frame; closing connection") return ConnectionError(ErrCodeProtocol) } // We probably did ask for this, but canceled. Just ignore it. // TODO: be stricter here? only silently ignore things which // we canceled, but not things which were closed normally // by the peer? Tough without accumulating too much state. // But at least return their flow control: if f.Length > 0 { cc.mu.Lock() cc.inflow.add(int32(f.Length)) cc.mu.Unlock() cc.wmu.Lock() cc.fr.WriteWindowUpdate(0, uint32(f.Length)) cc.bw.Flush() cc.wmu.Unlock() } return nil } if !cs.firstByte { cc.logf("protocol error: received DATA before a HEADERS frame") rl.endStreamError(cs, StreamError{ StreamID: f.StreamID, Code: ErrCodeProtocol, }) return nil } if f.Length > 0 { if cs.req.Method == "HEAD" && len(data) > 0 { cc.logf("protocol error: received DATA on a HEAD request") rl.endStreamError(cs, StreamError{ StreamID: f.StreamID, Code: ErrCodeProtocol, }) return nil } // Check connection-level flow control. cc.mu.Lock() if cs.inflow.available() >= int32(f.Length) { cs.inflow.take(int32(f.Length)) } else { cc.mu.Unlock() return ConnectionError(ErrCodeFlowControl) } // Return any padded flow control now, since we won't // refund it later on body reads. var refund int if pad := int(f.Length) - len(data); pad > 0 { refund += pad } // Return len(data) now if the stream is already closed, // since data will never be read. didReset := cs.didReset if didReset { refund += len(data) } if refund > 0 { cc.inflow.add(int32(refund)) cc.wmu.Lock() cc.fr.WriteWindowUpdate(0, uint32(refund)) if !didReset { cs.inflow.add(int32(refund)) cc.fr.WriteWindowUpdate(cs.ID, uint32(refund)) } cc.bw.Flush() cc.wmu.Unlock() } cc.mu.Unlock() if len(data) > 0 && !didReset { if _, err := cs.bufPipe.Write(data); err != nil { rl.endStreamError(cs, err) return err } } } if f.StreamEnded() { rl.endStream(cs) } return nil } var errInvalidTrailers = errors.New("http2: invalid trailers") func (rl *clientConnReadLoop) endStream(cs *clientStream) { // TODO: check that any declared content-length matches, like // server.go's (*stream).endStream method. rl.endStreamError(cs, nil) } func (rl *clientConnReadLoop) endStreamError(cs *clientStream, err error) { var code func() if err == nil { err = io.EOF code = cs.copyTrailers } if isConnectionCloseRequest(cs.req) { rl.closeWhenIdle = true } cs.bufPipe.closeWithErrorAndCode(err, code) select { case cs.resc <- resAndError{err: err}: default: } } func (cs *clientStream) copyTrailers() { for k, vv := range cs.trailer { t := cs.resTrailer if *t == nil { *t = make(http.Header) } (*t)[k] = vv } } func (rl *clientConnReadLoop) processGoAway(f *GoAwayFrame) error { cc := rl.cc cc.t.connPool().MarkDead(cc) if f.ErrCode != 0 { // TODO: deal with GOAWAY more. particularly the error code cc.vlogf("transport got GOAWAY with error code = %v", f.ErrCode) } cc.setGoAway(f) return nil } func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { cc := rl.cc cc.mu.Lock() defer cc.mu.Unlock() if f.IsAck() { if cc.wantSettingsAck { cc.wantSettingsAck = false return nil } return ConnectionError(ErrCodeProtocol) } err := f.ForeachSetting(func(s Setting) error { switch s.ID { case SettingMaxFrameSize: cc.maxFrameSize = s.Val case SettingMaxConcurrentStreams: cc.maxConcurrentStreams = s.Val case SettingMaxHeaderListSize: cc.peerMaxHeaderListSize = uint64(s.Val) case SettingInitialWindowSize: // Values above the maximum flow-control // window size of 2^31-1 MUST be treated as a // connection error (Section 5.4.1) of type // FLOW_CONTROL_ERROR. if s.Val > math.MaxInt32 { return ConnectionError(ErrCodeFlowControl) } // Adjust flow control of currently-open // frames by the difference of the old initial // window size and this one. delta := int32(s.Val) - int32(cc.initialWindowSize) for _, cs := range cc.streams { cs.flow.add(delta) } cc.cond.Broadcast() cc.initialWindowSize = s.Val default: // TODO(bradfitz): handle more settings? SETTINGS_HEADER_TABLE_SIZE probably. cc.vlogf("Unhandled Setting: %v", s) } return nil }) if err != nil { return err } cc.wmu.Lock() defer cc.wmu.Unlock() cc.fr.WriteSettingsAck() cc.bw.Flush() return cc.werr } func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error { cc := rl.cc cs := cc.streamByID(f.StreamID, false) if f.StreamID != 0 && cs == nil { return nil } cc.mu.Lock() defer cc.mu.Unlock() fl := &cc.flow if cs != nil { fl = &cs.flow } if !fl.add(int32(f.Increment)) { return ConnectionError(ErrCodeFlowControl) } cc.cond.Broadcast() return nil } func (rl *clientConnReadLoop) processResetStream(f *RSTStreamFrame) error { cs := rl.cc.streamByID(f.StreamID, true) if cs == nil { // TODO: return error if server tries to RST_STEAM an idle stream return nil } select { case <-cs.peerReset: // Already reset. // This is the only goroutine // which closes this, so there // isn't a race. default: err := streamError(cs.ID, f.ErrCode) cs.resetErr = err close(cs.peerReset) cs.bufPipe.CloseWithError(err) cs.cc.cond.Broadcast() // wake up checkResetOrDone via clientStream.awaitFlowControl } return nil } // Ping sends a PING frame to the server and waits for the ack. func (cc *ClientConn) Ping(ctx context.Context) error { c := make(chan struct{}) // Generate a random payload var p [8]byte for { if _, err := rand.Read(p[:]); err != nil { return err } cc.mu.Lock() // check for dup before insert if _, found := cc.pings[p]; !found { cc.pings[p] = c cc.mu.Unlock() break } cc.mu.Unlock() } cc.wmu.Lock() if err := cc.fr.WritePing(false, p); err != nil { cc.wmu.Unlock() return err } if err := cc.bw.Flush(); err != nil { cc.wmu.Unlock() return err } cc.wmu.Unlock() select { case <-c: return nil case <-ctx.Done(): return ctx.Err() case <-cc.readerDone: // connection closed return cc.readerErr } } func (rl *clientConnReadLoop) processPing(f *PingFrame) error { if f.IsAck() { cc := rl.cc cc.mu.Lock() defer cc.mu.Unlock() // If ack, notify listener if any if c, ok := cc.pings[f.Data]; ok { close(c) delete(cc.pings, f.Data) } return nil } cc := rl.cc cc.wmu.Lock() defer cc.wmu.Unlock() if err := cc.fr.WritePing(true, f.Data); err != nil { return err } return cc.bw.Flush() } func (rl *clientConnReadLoop) processPushPromise(f *PushPromiseFrame) error { // We told the peer we don't want them. // Spec says: // "PUSH_PROMISE MUST NOT be sent if the SETTINGS_ENABLE_PUSH // setting of the peer endpoint is set to 0. An endpoint that // has set this setting and has received acknowledgement MUST // treat the receipt of a PUSH_PROMISE frame as a connection // error (Section 5.4.1) of type PROTOCOL_ERROR." return ConnectionError(ErrCodeProtocol) } func (cc *ClientConn) writeStreamReset(streamID uint32, code ErrCode, err error) { // TODO: map err to more interesting error codes, once the // HTTP community comes up with some. But currently for // RST_STREAM there's no equivalent to GOAWAY frame's debug // data, and the error codes are all pretty vague ("cancel"). cc.wmu.Lock() cc.fr.WriteRSTStream(streamID, code) cc.bw.Flush() cc.wmu.Unlock() } var ( errResponseHeaderListSize = errors.New("http2: response header list larger than advertised limit") errRequestHeaderListSize = errors.New("http2: request header list larger than peer's advertised limit") errPseudoTrailers = errors.New("http2: invalid pseudo header in trailers") ) func (cc *ClientConn) logf(format string, args ...interface{}) { cc.t.logf(format, args...) } func (cc *ClientConn) vlogf(format string, args ...interface{}) { cc.t.vlogf(format, args...) } func (t *Transport) vlogf(format string, args ...interface{}) { if VerboseLogs { t.logf(format, args...) } } func (t *Transport) logf(format string, args ...interface{}) { log.Printf(format, args...) } var noBody io.ReadCloser = ioutil.NopCloser(bytes.NewReader(nil)) func strSliceContains(ss []string, s string) bool { for _, v := range ss { if v == s { return true } } return false } type erringRoundTripper struct{ err error } func (rt erringRoundTripper) RoundTrip(*http.Request) (*http.Response, error) { return nil, rt.err } // gzipReader wraps a response body so it can lazily // call gzip.NewReader on the first call to Read type gzipReader struct { body io.ReadCloser // underlying Response.Body zr *gzip.Reader // lazily-initialized gzip reader zerr error // sticky error } func (gz *gzipReader) Read(p []byte) (n int, err error) { if gz.zerr != nil { return 0, gz.zerr } if gz.zr == nil { gz.zr, err = gzip.NewReader(gz.body) if err != nil { gz.zerr = err return 0, err } } return gz.zr.Read(p) } func (gz *gzipReader) Close() error { return gz.body.Close() } type errorReader struct{ err error } func (r errorReader) Read(p []byte) (int, error) { return 0, r.err } // bodyWriterState encapsulates various state around the Transport's writing // of the request body, particularly regarding doing delayed writes of the body // when the request contains "Expect: 100-continue". type bodyWriterState struct { cs *clientStream timer *time.Timer // if non-nil, we're doing a delayed write fnonce *sync.Once // to call fn with fn func() // the code to run in the goroutine, writing the body resc chan error // result of fn's execution delay time.Duration // how long we should delay a delayed write for } func (t *Transport) getBodyWriterState(cs *clientStream, body io.Reader) (s bodyWriterState) { s.cs = cs if body == nil { return } resc := make(chan error, 1) s.resc = resc s.fn = func() { cs.cc.mu.Lock() cs.startedWrite = true cs.cc.mu.Unlock() resc <- cs.writeRequestBody(body, cs.req.Body) } s.delay = t.expectContinueTimeout() if s.delay == 0 || !httpguts.HeaderValuesContainsToken( cs.req.Header["Expect"], "100-continue") { return } s.fnonce = new(sync.Once) // Arm the timer with a very large duration, which we'll // intentionally lower later. It has to be large now because // we need a handle to it before writing the headers, but the // s.delay value is defined to not start until after the // request headers were written. const hugeDuration = 365 * 24 * time.Hour s.timer = time.AfterFunc(hugeDuration, func() { s.fnonce.Do(s.fn) }) return } func (s bodyWriterState) cancel() { if s.timer != nil { s.timer.Stop() } } func (s bodyWriterState) on100() { if s.timer == nil { // If we didn't do a delayed write, ignore the server's // bogus 100 continue response. return } s.timer.Stop() go func() { s.fnonce.Do(s.fn) }() } // scheduleBodyWrite starts writing the body, either immediately (in // the common case) or after the delay timeout. It should not be // called until after the headers have been written. func (s bodyWriterState) scheduleBodyWrite() { if s.timer == nil { // We're not doing a delayed write (see // getBodyWriterState), so just start the writing // goroutine immediately. go s.fn() return } traceWait100Continue(s.cs.trace) if s.timer.Stop() { s.timer.Reset(s.delay) } } // isConnectionCloseRequest reports whether req should use its own // connection for a single request and then close the connection. func isConnectionCloseRequest(req *http.Request) bool { return req.Close || httpguts.HeaderValuesContainsToken(req.Header["Connection"], "close") } // registerHTTPSProtocol calls Transport.RegisterProtocol but // converting panics into errors. func registerHTTPSProtocol(t *http.Transport, rt noDialH2RoundTripper) (err error) { defer func() { if e := recover(); e != nil { err = fmt.Errorf("%v", e) } }() t.RegisterProtocol("https", rt) return nil } // noDialH2RoundTripper is a RoundTripper which only tries to complete the request // if there's already has a cached connection to the host. // (The field is exported so it can be accessed via reflect from net/http; tested // by TestNoDialH2RoundTripperType) type noDialH2RoundTripper struct{ *Transport } func (rt noDialH2RoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { res, err := rt.Transport.RoundTrip(req) if isNoCachedConnError(err) { return nil, http.ErrSkipAltProtocol } return res, err } func (t *Transport) idleConnTimeout() time.Duration { if t.t1 != nil { return t.t1.IdleConnTimeout } return 0 } func traceGetConn(req *http.Request, hostPort string) { trace := httptrace.ContextClientTrace(req.Context()) if trace == nil || trace.GetConn == nil { return } trace.GetConn(hostPort) } func traceGotConn(req *http.Request, cc *ClientConn, reused bool) { trace := httptrace.ContextClientTrace(req.Context()) if trace == nil || trace.GotConn == nil { return } ci := httptrace.GotConnInfo{Conn: cc.tconn} ci.Reused = reused cc.mu.Lock() ci.WasIdle = len(cc.streams) == 0 && reused if ci.WasIdle && !cc.lastActive.IsZero() { ci.IdleTime = time.Now().Sub(cc.lastActive) } cc.mu.Unlock() trace.GotConn(ci) } func traceWroteHeaders(trace *httptrace.ClientTrace) { if trace != nil && trace.WroteHeaders != nil { trace.WroteHeaders() } } func traceGot100Continue(trace *httptrace.ClientTrace) { if trace != nil && trace.Got100Continue != nil { trace.Got100Continue() } } func traceWait100Continue(trace *httptrace.ClientTrace) { if trace != nil && trace.Wait100Continue != nil { trace.Wait100Continue() } } func traceWroteRequest(trace *httptrace.ClientTrace, err error) { if trace != nil && trace.WroteRequest != nil { trace.WroteRequest(httptrace.WroteRequestInfo{Err: err}) } } func traceFirstResponseByte(trace *httptrace.ClientTrace) { if trace != nil && trace.GotFirstResponseByte != nil { trace.GotFirstResponseByte() } } ================================================ FILE: vendor/golang.org/x/net/http2/write.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "bytes" "fmt" "log" "net/http" "net/url" "golang.org/x/net/http/httpguts" "golang.org/x/net/http2/hpack" ) // writeFramer is implemented by any type that is used to write frames. type writeFramer interface { writeFrame(writeContext) error // staysWithinBuffer reports whether this writer promises that // it will only write less than or equal to size bytes, and it // won't Flush the write context. staysWithinBuffer(size int) bool } // writeContext is the interface needed by the various frame writer // types below. All the writeFrame methods below are scheduled via the // frame writing scheduler (see writeScheduler in writesched.go). // // This interface is implemented by *serverConn. // // TODO: decide whether to a) use this in the client code (which didn't // end up using this yet, because it has a simpler design, not // currently implementing priorities), or b) delete this and // make the server code a bit more concrete. type writeContext interface { Framer() *Framer Flush() error CloseConn() error // HeaderEncoder returns an HPACK encoder that writes to the // returned buffer. HeaderEncoder() (*hpack.Encoder, *bytes.Buffer) } // writeEndsStream reports whether w writes a frame that will transition // the stream to a half-closed local state. This returns false for RST_STREAM, // which closes the entire stream (not just the local half). func writeEndsStream(w writeFramer) bool { switch v := w.(type) { case *writeData: return v.endStream case *writeResHeaders: return v.endStream case nil: // This can only happen if the caller reuses w after it's // been intentionally nil'ed out to prevent use. Keep this // here to catch future refactoring breaking it. panic("writeEndsStream called on nil writeFramer") } return false } type flushFrameWriter struct{} func (flushFrameWriter) writeFrame(ctx writeContext) error { return ctx.Flush() } func (flushFrameWriter) staysWithinBuffer(max int) bool { return false } type writeSettings []Setting func (s writeSettings) staysWithinBuffer(max int) bool { const settingSize = 6 // uint16 + uint32 return frameHeaderLen+settingSize*len(s) <= max } func (s writeSettings) writeFrame(ctx writeContext) error { return ctx.Framer().WriteSettings([]Setting(s)...) } type writeGoAway struct { maxStreamID uint32 code ErrCode } func (p *writeGoAway) writeFrame(ctx writeContext) error { err := ctx.Framer().WriteGoAway(p.maxStreamID, p.code, nil) ctx.Flush() // ignore error: we're hanging up on them anyway return err } func (*writeGoAway) staysWithinBuffer(max int) bool { return false } // flushes type writeData struct { streamID uint32 p []byte endStream bool } func (w *writeData) String() string { return fmt.Sprintf("writeData(stream=%d, p=%d, endStream=%v)", w.streamID, len(w.p), w.endStream) } func (w *writeData) writeFrame(ctx writeContext) error { return ctx.Framer().WriteData(w.streamID, w.endStream, w.p) } func (w *writeData) staysWithinBuffer(max int) bool { return frameHeaderLen+len(w.p) <= max } // handlerPanicRST is the message sent from handler goroutines when // the handler panics. type handlerPanicRST struct { StreamID uint32 } func (hp handlerPanicRST) writeFrame(ctx writeContext) error { return ctx.Framer().WriteRSTStream(hp.StreamID, ErrCodeInternal) } func (hp handlerPanicRST) staysWithinBuffer(max int) bool { return frameHeaderLen+4 <= max } func (se StreamError) writeFrame(ctx writeContext) error { return ctx.Framer().WriteRSTStream(se.StreamID, se.Code) } func (se StreamError) staysWithinBuffer(max int) bool { return frameHeaderLen+4 <= max } type writePingAck struct{ pf *PingFrame } func (w writePingAck) writeFrame(ctx writeContext) error { return ctx.Framer().WritePing(true, w.pf.Data) } func (w writePingAck) staysWithinBuffer(max int) bool { return frameHeaderLen+len(w.pf.Data) <= max } type writeSettingsAck struct{} func (writeSettingsAck) writeFrame(ctx writeContext) error { return ctx.Framer().WriteSettingsAck() } func (writeSettingsAck) staysWithinBuffer(max int) bool { return frameHeaderLen <= max } // splitHeaderBlock splits headerBlock into fragments so that each fragment fits // in a single frame, then calls fn for each fragment. firstFrag/lastFrag are true // for the first/last fragment, respectively. func splitHeaderBlock(ctx writeContext, headerBlock []byte, fn func(ctx writeContext, frag []byte, firstFrag, lastFrag bool) error) error { // For now we're lazy and just pick the minimum MAX_FRAME_SIZE // that all peers must support (16KB). Later we could care // more and send larger frames if the peer advertised it, but // there's little point. Most headers are small anyway (so we // generally won't have CONTINUATION frames), and extra frames // only waste 9 bytes anyway. const maxFrameSize = 16384 first := true for len(headerBlock) > 0 { frag := headerBlock if len(frag) > maxFrameSize { frag = frag[:maxFrameSize] } headerBlock = headerBlock[len(frag):] if err := fn(ctx, frag, first, len(headerBlock) == 0); err != nil { return err } first = false } return nil } // writeResHeaders is a request to write a HEADERS and 0+ CONTINUATION frames // for HTTP response headers or trailers from a server handler. type writeResHeaders struct { streamID uint32 httpResCode int // 0 means no ":status" line h http.Header // may be nil trailers []string // if non-nil, which keys of h to write. nil means all. endStream bool date string contentType string contentLength string } func encKV(enc *hpack.Encoder, k, v string) { if VerboseLogs { log.Printf("http2: server encoding header %q = %q", k, v) } enc.WriteField(hpack.HeaderField{Name: k, Value: v}) } func (w *writeResHeaders) staysWithinBuffer(max int) bool { // TODO: this is a common one. It'd be nice to return true // here and get into the fast path if we could be clever and // calculate the size fast enough, or at least a conservative // upper bound that usually fires. (Maybe if w.h and // w.trailers are nil, so we don't need to enumerate it.) // Otherwise I'm afraid that just calculating the length to // answer this question would be slower than the ~2µs benefit. return false } func (w *writeResHeaders) writeFrame(ctx writeContext) error { enc, buf := ctx.HeaderEncoder() buf.Reset() if w.httpResCode != 0 { encKV(enc, ":status", httpCodeString(w.httpResCode)) } encodeHeaders(enc, w.h, w.trailers) if w.contentType != "" { encKV(enc, "content-type", w.contentType) } if w.contentLength != "" { encKV(enc, "content-length", w.contentLength) } if w.date != "" { encKV(enc, "date", w.date) } headerBlock := buf.Bytes() if len(headerBlock) == 0 && w.trailers == nil { panic("unexpected empty hpack") } return splitHeaderBlock(ctx, headerBlock, w.writeHeaderBlock) } func (w *writeResHeaders) writeHeaderBlock(ctx writeContext, frag []byte, firstFrag, lastFrag bool) error { if firstFrag { return ctx.Framer().WriteHeaders(HeadersFrameParam{ StreamID: w.streamID, BlockFragment: frag, EndStream: w.endStream, EndHeaders: lastFrag, }) } else { return ctx.Framer().WriteContinuation(w.streamID, lastFrag, frag) } } // writePushPromise is a request to write a PUSH_PROMISE and 0+ CONTINUATION frames. type writePushPromise struct { streamID uint32 // pusher stream method string // for :method url *url.URL // for :scheme, :authority, :path h http.Header // Creates an ID for a pushed stream. This runs on serveG just before // the frame is written. The returned ID is copied to promisedID. allocatePromisedID func() (uint32, error) promisedID uint32 } func (w *writePushPromise) staysWithinBuffer(max int) bool { // TODO: see writeResHeaders.staysWithinBuffer return false } func (w *writePushPromise) writeFrame(ctx writeContext) error { enc, buf := ctx.HeaderEncoder() buf.Reset() encKV(enc, ":method", w.method) encKV(enc, ":scheme", w.url.Scheme) encKV(enc, ":authority", w.url.Host) encKV(enc, ":path", w.url.RequestURI()) encodeHeaders(enc, w.h, nil) headerBlock := buf.Bytes() if len(headerBlock) == 0 { panic("unexpected empty hpack") } return splitHeaderBlock(ctx, headerBlock, w.writeHeaderBlock) } func (w *writePushPromise) writeHeaderBlock(ctx writeContext, frag []byte, firstFrag, lastFrag bool) error { if firstFrag { return ctx.Framer().WritePushPromise(PushPromiseParam{ StreamID: w.streamID, PromiseID: w.promisedID, BlockFragment: frag, EndHeaders: lastFrag, }) } else { return ctx.Framer().WriteContinuation(w.streamID, lastFrag, frag) } } type write100ContinueHeadersFrame struct { streamID uint32 } func (w write100ContinueHeadersFrame) writeFrame(ctx writeContext) error { enc, buf := ctx.HeaderEncoder() buf.Reset() encKV(enc, ":status", "100") return ctx.Framer().WriteHeaders(HeadersFrameParam{ StreamID: w.streamID, BlockFragment: buf.Bytes(), EndStream: false, EndHeaders: true, }) } func (w write100ContinueHeadersFrame) staysWithinBuffer(max int) bool { // Sloppy but conservative: return 9+2*(len(":status")+len("100")) <= max } type writeWindowUpdate struct { streamID uint32 // or 0 for conn-level n uint32 } func (wu writeWindowUpdate) staysWithinBuffer(max int) bool { return frameHeaderLen+4 <= max } func (wu writeWindowUpdate) writeFrame(ctx writeContext) error { return ctx.Framer().WriteWindowUpdate(wu.streamID, wu.n) } // encodeHeaders encodes an http.Header. If keys is not nil, then (k, h[k]) // is encoded only if k is in keys. func encodeHeaders(enc *hpack.Encoder, h http.Header, keys []string) { if keys == nil { sorter := sorterPool.Get().(*sorter) // Using defer here, since the returned keys from the // sorter.Keys method is only valid until the sorter // is returned: defer sorterPool.Put(sorter) keys = sorter.Keys(h) } for _, k := range keys { vv := h[k] k = lowerHeader(k) if !validWireHeaderFieldName(k) { // Skip it as backup paranoia. Per // golang.org/issue/14048, these should // already be rejected at a higher level. continue } isTE := k == "transfer-encoding" for _, v := range vv { if !httpguts.ValidHeaderFieldValue(v) { // TODO: return an error? golang.org/issue/14048 // For now just omit it. continue } // TODO: more of "8.1.2.2 Connection-Specific Header Fields" if isTE && v != "trailers" { continue } encKV(enc, k, v) } } } ================================================ FILE: vendor/golang.org/x/net/http2/writesched.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import "fmt" // WriteScheduler is the interface implemented by HTTP/2 write schedulers. // Methods are never called concurrently. type WriteScheduler interface { // OpenStream opens a new stream in the write scheduler. // It is illegal to call this with streamID=0 or with a streamID that is // already open -- the call may panic. OpenStream(streamID uint32, options OpenStreamOptions) // CloseStream closes a stream in the write scheduler. Any frames queued on // this stream should be discarded. It is illegal to call this on a stream // that is not open -- the call may panic. CloseStream(streamID uint32) // AdjustStream adjusts the priority of the given stream. This may be called // on a stream that has not yet been opened or has been closed. Note that // RFC 7540 allows PRIORITY frames to be sent on streams in any state. See: // https://tools.ietf.org/html/rfc7540#section-5.1 AdjustStream(streamID uint32, priority PriorityParam) // Push queues a frame in the scheduler. In most cases, this will not be // called with wr.StreamID()!=0 unless that stream is currently open. The one // exception is RST_STREAM frames, which may be sent on idle or closed streams. Push(wr FrameWriteRequest) // Pop dequeues the next frame to write. Returns false if no frames can // be written. Frames with a given wr.StreamID() are Pop'd in the same // order they are Push'd. Pop() (wr FrameWriteRequest, ok bool) } // OpenStreamOptions specifies extra options for WriteScheduler.OpenStream. type OpenStreamOptions struct { // PusherID is zero if the stream was initiated by the client. Otherwise, // PusherID names the stream that pushed the newly opened stream. PusherID uint32 } // FrameWriteRequest is a request to write a frame. type FrameWriteRequest struct { // write is the interface value that does the writing, once the // WriteScheduler has selected this frame to write. The write // functions are all defined in write.go. write writeFramer // stream is the stream on which this frame will be written. // nil for non-stream frames like PING and SETTINGS. stream *stream // done, if non-nil, must be a buffered channel with space for // 1 message and is sent the return value from write (or an // earlier error) when the frame has been written. done chan error } // StreamID returns the id of the stream this frame will be written to. // 0 is used for non-stream frames such as PING and SETTINGS. func (wr FrameWriteRequest) StreamID() uint32 { if wr.stream == nil { if se, ok := wr.write.(StreamError); ok { // (*serverConn).resetStream doesn't set // stream because it doesn't necessarily have // one. So special case this type of write // message. return se.StreamID } return 0 } return wr.stream.id } // DataSize returns the number of flow control bytes that must be consumed // to write this entire frame. This is 0 for non-DATA frames. func (wr FrameWriteRequest) DataSize() int { if wd, ok := wr.write.(*writeData); ok { return len(wd.p) } return 0 } // Consume consumes min(n, available) bytes from this frame, where available // is the number of flow control bytes available on the stream. Consume returns // 0, 1, or 2 frames, where the integer return value gives the number of frames // returned. // // If flow control prevents consuming any bytes, this returns (_, _, 0). If // the entire frame was consumed, this returns (wr, _, 1). Otherwise, this // returns (consumed, rest, 2), where 'consumed' contains the consumed bytes and // 'rest' contains the remaining bytes. The consumed bytes are deducted from the // underlying stream's flow control budget. func (wr FrameWriteRequest) Consume(n int32) (FrameWriteRequest, FrameWriteRequest, int) { var empty FrameWriteRequest // Non-DATA frames are always consumed whole. wd, ok := wr.write.(*writeData) if !ok || len(wd.p) == 0 { return wr, empty, 1 } // Might need to split after applying limits. allowed := wr.stream.flow.available() if n < allowed { allowed = n } if wr.stream.sc.maxFrameSize < allowed { allowed = wr.stream.sc.maxFrameSize } if allowed <= 0 { return empty, empty, 0 } if len(wd.p) > int(allowed) { wr.stream.flow.take(allowed) consumed := FrameWriteRequest{ stream: wr.stream, write: &writeData{ streamID: wd.streamID, p: wd.p[:allowed], // Even if the original had endStream set, there // are bytes remaining because len(wd.p) > allowed, // so we know endStream is false. endStream: false, }, // Our caller is blocking on the final DATA frame, not // this intermediate frame, so no need to wait. done: nil, } rest := FrameWriteRequest{ stream: wr.stream, write: &writeData{ streamID: wd.streamID, p: wd.p[allowed:], endStream: wd.endStream, }, done: wr.done, } return consumed, rest, 2 } // The frame is consumed whole. // NB: This cast cannot overflow because allowed is <= math.MaxInt32. wr.stream.flow.take(int32(len(wd.p))) return wr, empty, 1 } // String is for debugging only. func (wr FrameWriteRequest) String() string { var des string if s, ok := wr.write.(fmt.Stringer); ok { des = s.String() } else { des = fmt.Sprintf("%T", wr.write) } return fmt.Sprintf("[FrameWriteRequest stream=%d, ch=%v, writer=%v]", wr.StreamID(), wr.done != nil, des) } // replyToWriter sends err to wr.done and panics if the send must block // This does nothing if wr.done is nil. func (wr *FrameWriteRequest) replyToWriter(err error) { if wr.done == nil { return } select { case wr.done <- err: default: panic(fmt.Sprintf("unbuffered done channel passed in for type %T", wr.write)) } wr.write = nil // prevent use (assume it's tainted after wr.done send) } // writeQueue is used by implementations of WriteScheduler. type writeQueue struct { s []FrameWriteRequest } func (q *writeQueue) empty() bool { return len(q.s) == 0 } func (q *writeQueue) push(wr FrameWriteRequest) { q.s = append(q.s, wr) } func (q *writeQueue) shift() FrameWriteRequest { if len(q.s) == 0 { panic("invalid use of queue") } wr := q.s[0] // TODO: less copy-happy queue. copy(q.s, q.s[1:]) q.s[len(q.s)-1] = FrameWriteRequest{} q.s = q.s[:len(q.s)-1] return wr } // consume consumes up to n bytes from q.s[0]. If the frame is // entirely consumed, it is removed from the queue. If the frame // is partially consumed, the frame is kept with the consumed // bytes removed. Returns true iff any bytes were consumed. func (q *writeQueue) consume(n int32) (FrameWriteRequest, bool) { if len(q.s) == 0 { return FrameWriteRequest{}, false } consumed, rest, numresult := q.s[0].Consume(n) switch numresult { case 0: return FrameWriteRequest{}, false case 1: q.shift() case 2: q.s[0] = rest } return consumed, true } type writeQueuePool []*writeQueue // put inserts an unused writeQueue into the pool. func (p *writeQueuePool) put(q *writeQueue) { for i := range q.s { q.s[i] = FrameWriteRequest{} } q.s = q.s[:0] *p = append(*p, q) } // get returns an empty writeQueue. func (p *writeQueuePool) get() *writeQueue { ln := len(*p) if ln == 0 { return new(writeQueue) } x := ln - 1 q := (*p)[x] (*p)[x] = nil *p = (*p)[:x] return q } ================================================ FILE: vendor/golang.org/x/net/http2/writesched_priority.go ================================================ // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import ( "fmt" "math" "sort" ) // RFC 7540, Section 5.3.5: the default weight is 16. const priorityDefaultWeight = 15 // 16 = 15 + 1 // PriorityWriteSchedulerConfig configures a priorityWriteScheduler. type PriorityWriteSchedulerConfig struct { // MaxClosedNodesInTree controls the maximum number of closed streams to // retain in the priority tree. Setting this to zero saves a small amount // of memory at the cost of performance. // // See RFC 7540, Section 5.3.4: // "It is possible for a stream to become closed while prioritization // information ... is in transit. ... This potentially creates suboptimal // prioritization, since the stream could be given a priority that is // different from what is intended. To avoid these problems, an endpoint // SHOULD retain stream prioritization state for a period after streams // become closed. The longer state is retained, the lower the chance that // streams are assigned incorrect or default priority values." MaxClosedNodesInTree int // MaxIdleNodesInTree controls the maximum number of idle streams to // retain in the priority tree. Setting this to zero saves a small amount // of memory at the cost of performance. // // See RFC 7540, Section 5.3.4: // Similarly, streams that are in the "idle" state can be assigned // priority or become a parent of other streams. This allows for the // creation of a grouping node in the dependency tree, which enables // more flexible expressions of priority. Idle streams begin with a // default priority (Section 5.3.5). MaxIdleNodesInTree int // ThrottleOutOfOrderWrites enables write throttling to help ensure that // data is delivered in priority order. This works around a race where // stream B depends on stream A and both streams are about to call Write // to queue DATA frames. If B wins the race, a naive scheduler would eagerly // write as much data from B as possible, but this is suboptimal because A // is a higher-priority stream. With throttling enabled, we write a small // amount of data from B to minimize the amount of bandwidth that B can // steal from A. ThrottleOutOfOrderWrites bool } // NewPriorityWriteScheduler constructs a WriteScheduler that schedules // frames by following HTTP/2 priorities as described in RFC 7540 Section 5.3. // If cfg is nil, default options are used. func NewPriorityWriteScheduler(cfg *PriorityWriteSchedulerConfig) WriteScheduler { if cfg == nil { // For justification of these defaults, see: // https://docs.google.com/document/d/1oLhNg1skaWD4_DtaoCxdSRN5erEXrH-KnLrMwEpOtFY cfg = &PriorityWriteSchedulerConfig{ MaxClosedNodesInTree: 10, MaxIdleNodesInTree: 10, ThrottleOutOfOrderWrites: false, } } ws := &priorityWriteScheduler{ nodes: make(map[uint32]*priorityNode), maxClosedNodesInTree: cfg.MaxClosedNodesInTree, maxIdleNodesInTree: cfg.MaxIdleNodesInTree, enableWriteThrottle: cfg.ThrottleOutOfOrderWrites, } ws.nodes[0] = &ws.root if cfg.ThrottleOutOfOrderWrites { ws.writeThrottleLimit = 1024 } else { ws.writeThrottleLimit = math.MaxInt32 } return ws } type priorityNodeState int const ( priorityNodeOpen priorityNodeState = iota priorityNodeClosed priorityNodeIdle ) // priorityNode is a node in an HTTP/2 priority tree. // Each node is associated with a single stream ID. // See RFC 7540, Section 5.3. type priorityNode struct { q writeQueue // queue of pending frames to write id uint32 // id of the stream, or 0 for the root of the tree weight uint8 // the actual weight is weight+1, so the value is in [1,256] state priorityNodeState // open | closed | idle bytes int64 // number of bytes written by this node, or 0 if closed subtreeBytes int64 // sum(node.bytes) of all nodes in this subtree // These links form the priority tree. parent *priorityNode kids *priorityNode // start of the kids list prev, next *priorityNode // doubly-linked list of siblings } func (n *priorityNode) setParent(parent *priorityNode) { if n == parent { panic("setParent to self") } if n.parent == parent { return } // Unlink from current parent. if parent := n.parent; parent != nil { if n.prev == nil { parent.kids = n.next } else { n.prev.next = n.next } if n.next != nil { n.next.prev = n.prev } } // Link to new parent. // If parent=nil, remove n from the tree. // Always insert at the head of parent.kids (this is assumed by walkReadyInOrder). n.parent = parent if parent == nil { n.next = nil n.prev = nil } else { n.next = parent.kids n.prev = nil if n.next != nil { n.next.prev = n } parent.kids = n } } func (n *priorityNode) addBytes(b int64) { n.bytes += b for ; n != nil; n = n.parent { n.subtreeBytes += b } } // walkReadyInOrder iterates over the tree in priority order, calling f for each node // with a non-empty write queue. When f returns true, this funcion returns true and the // walk halts. tmp is used as scratch space for sorting. // // f(n, openParent) takes two arguments: the node to visit, n, and a bool that is true // if any ancestor p of n is still open (ignoring the root node). func (n *priorityNode) walkReadyInOrder(openParent bool, tmp *[]*priorityNode, f func(*priorityNode, bool) bool) bool { if !n.q.empty() && f(n, openParent) { return true } if n.kids == nil { return false } // Don't consider the root "open" when updating openParent since // we can't send data frames on the root stream (only control frames). if n.id != 0 { openParent = openParent || (n.state == priorityNodeOpen) } // Common case: only one kid or all kids have the same weight. // Some clients don't use weights; other clients (like web browsers) // use mostly-linear priority trees. w := n.kids.weight needSort := false for k := n.kids.next; k != nil; k = k.next { if k.weight != w { needSort = true break } } if !needSort { for k := n.kids; k != nil; k = k.next { if k.walkReadyInOrder(openParent, tmp, f) { return true } } return false } // Uncommon case: sort the child nodes. We remove the kids from the parent, // then re-insert after sorting so we can reuse tmp for future sort calls. *tmp = (*tmp)[:0] for n.kids != nil { *tmp = append(*tmp, n.kids) n.kids.setParent(nil) } sort.Sort(sortPriorityNodeSiblings(*tmp)) for i := len(*tmp) - 1; i >= 0; i-- { (*tmp)[i].setParent(n) // setParent inserts at the head of n.kids } for k := n.kids; k != nil; k = k.next { if k.walkReadyInOrder(openParent, tmp, f) { return true } } return false } type sortPriorityNodeSiblings []*priorityNode func (z sortPriorityNodeSiblings) Len() int { return len(z) } func (z sortPriorityNodeSiblings) Swap(i, k int) { z[i], z[k] = z[k], z[i] } func (z sortPriorityNodeSiblings) Less(i, k int) bool { // Prefer the subtree that has sent fewer bytes relative to its weight. // See sections 5.3.2 and 5.3.4. wi, bi := float64(z[i].weight+1), float64(z[i].subtreeBytes) wk, bk := float64(z[k].weight+1), float64(z[k].subtreeBytes) if bi == 0 && bk == 0 { return wi >= wk } if bk == 0 { return false } return bi/bk <= wi/wk } type priorityWriteScheduler struct { // root is the root of the priority tree, where root.id = 0. // The root queues control frames that are not associated with any stream. root priorityNode // nodes maps stream ids to priority tree nodes. nodes map[uint32]*priorityNode // maxID is the maximum stream id in nodes. maxID uint32 // lists of nodes that have been closed or are idle, but are kept in // the tree for improved prioritization. When the lengths exceed either // maxClosedNodesInTree or maxIdleNodesInTree, old nodes are discarded. closedNodes, idleNodes []*priorityNode // From the config. maxClosedNodesInTree int maxIdleNodesInTree int writeThrottleLimit int32 enableWriteThrottle bool // tmp is scratch space for priorityNode.walkReadyInOrder to reduce allocations. tmp []*priorityNode // pool of empty queues for reuse. queuePool writeQueuePool } func (ws *priorityWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) { // The stream may be currently idle but cannot be opened or closed. if curr := ws.nodes[streamID]; curr != nil { if curr.state != priorityNodeIdle { panic(fmt.Sprintf("stream %d already opened", streamID)) } curr.state = priorityNodeOpen return } // RFC 7540, Section 5.3.5: // "All streams are initially assigned a non-exclusive dependency on stream 0x0. // Pushed streams initially depend on their associated stream. In both cases, // streams are assigned a default weight of 16." parent := ws.nodes[options.PusherID] if parent == nil { parent = &ws.root } n := &priorityNode{ q: *ws.queuePool.get(), id: streamID, weight: priorityDefaultWeight, state: priorityNodeOpen, } n.setParent(parent) ws.nodes[streamID] = n if streamID > ws.maxID { ws.maxID = streamID } } func (ws *priorityWriteScheduler) CloseStream(streamID uint32) { if streamID == 0 { panic("violation of WriteScheduler interface: cannot close stream 0") } if ws.nodes[streamID] == nil { panic(fmt.Sprintf("violation of WriteScheduler interface: unknown stream %d", streamID)) } if ws.nodes[streamID].state != priorityNodeOpen { panic(fmt.Sprintf("violation of WriteScheduler interface: stream %d already closed", streamID)) } n := ws.nodes[streamID] n.state = priorityNodeClosed n.addBytes(-n.bytes) q := n.q ws.queuePool.put(&q) n.q.s = nil if ws.maxClosedNodesInTree > 0 { ws.addClosedOrIdleNode(&ws.closedNodes, ws.maxClosedNodesInTree, n) } else { ws.removeNode(n) } } func (ws *priorityWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) { if streamID == 0 { panic("adjustPriority on root") } // If streamID does not exist, there are two cases: // - A closed stream that has been removed (this will have ID <= maxID) // - An idle stream that is being used for "grouping" (this will have ID > maxID) n := ws.nodes[streamID] if n == nil { if streamID <= ws.maxID || ws.maxIdleNodesInTree == 0 { return } ws.maxID = streamID n = &priorityNode{ q: *ws.queuePool.get(), id: streamID, weight: priorityDefaultWeight, state: priorityNodeIdle, } n.setParent(&ws.root) ws.nodes[streamID] = n ws.addClosedOrIdleNode(&ws.idleNodes, ws.maxIdleNodesInTree, n) } // Section 5.3.1: A dependency on a stream that is not currently in the tree // results in that stream being given a default priority (Section 5.3.5). parent := ws.nodes[priority.StreamDep] if parent == nil { n.setParent(&ws.root) n.weight = priorityDefaultWeight return } // Ignore if the client tries to make a node its own parent. if n == parent { return } // Section 5.3.3: // "If a stream is made dependent on one of its own dependencies, the // formerly dependent stream is first moved to be dependent on the // reprioritized stream's previous parent. The moved dependency retains // its weight." // // That is: if parent depends on n, move parent to depend on n.parent. for x := parent.parent; x != nil; x = x.parent { if x == n { parent.setParent(n.parent) break } } // Section 5.3.3: The exclusive flag causes the stream to become the sole // dependency of its parent stream, causing other dependencies to become // dependent on the exclusive stream. if priority.Exclusive { k := parent.kids for k != nil { next := k.next if k != n { k.setParent(n) } k = next } } n.setParent(parent) n.weight = priority.Weight } func (ws *priorityWriteScheduler) Push(wr FrameWriteRequest) { var n *priorityNode if id := wr.StreamID(); id == 0 { n = &ws.root } else { n = ws.nodes[id] if n == nil { // id is an idle or closed stream. wr should not be a HEADERS or // DATA frame. However, wr can be a RST_STREAM. In this case, we // push wr onto the root, rather than creating a new priorityNode, // since RST_STREAM is tiny and the stream's priority is unknown // anyway. See issue #17919. if wr.DataSize() > 0 { panic("add DATA on non-open stream") } n = &ws.root } } n.q.push(wr) } func (ws *priorityWriteScheduler) Pop() (wr FrameWriteRequest, ok bool) { ws.root.walkReadyInOrder(false, &ws.tmp, func(n *priorityNode, openParent bool) bool { limit := int32(math.MaxInt32) if openParent { limit = ws.writeThrottleLimit } wr, ok = n.q.consume(limit) if !ok { return false } n.addBytes(int64(wr.DataSize())) // If B depends on A and B continuously has data available but A // does not, gradually increase the throttling limit to allow B to // steal more and more bandwidth from A. if openParent { ws.writeThrottleLimit += 1024 if ws.writeThrottleLimit < 0 { ws.writeThrottleLimit = math.MaxInt32 } } else if ws.enableWriteThrottle { ws.writeThrottleLimit = 1024 } return true }) return wr, ok } func (ws *priorityWriteScheduler) addClosedOrIdleNode(list *[]*priorityNode, maxSize int, n *priorityNode) { if maxSize == 0 { return } if len(*list) == maxSize { // Remove the oldest node, then shift left. ws.removeNode((*list)[0]) x := (*list)[1:] copy(*list, x) *list = (*list)[:len(x)] } *list = append(*list, n) } func (ws *priorityWriteScheduler) removeNode(n *priorityNode) { for k := n.kids; k != nil; k = k.next { k.setParent(n.parent) } n.setParent(nil) delete(ws.nodes, n.id) } ================================================ FILE: vendor/golang.org/x/net/http2/writesched_random.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package http2 import "math" // NewRandomWriteScheduler constructs a WriteScheduler that ignores HTTP/2 // priorities. Control frames like SETTINGS and PING are written before DATA // frames, but if no control frames are queued and multiple streams have queued // HEADERS or DATA frames, Pop selects a ready stream arbitrarily. func NewRandomWriteScheduler() WriteScheduler { return &randomWriteScheduler{sq: make(map[uint32]*writeQueue)} } type randomWriteScheduler struct { // zero are frames not associated with a specific stream. zero writeQueue // sq contains the stream-specific queues, keyed by stream ID. // When a stream is idle or closed, it's deleted from the map. sq map[uint32]*writeQueue // pool of empty queues for reuse. queuePool writeQueuePool } func (ws *randomWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) { // no-op: idle streams are not tracked } func (ws *randomWriteScheduler) CloseStream(streamID uint32) { q, ok := ws.sq[streamID] if !ok { return } delete(ws.sq, streamID) ws.queuePool.put(q) } func (ws *randomWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) { // no-op: priorities are ignored } func (ws *randomWriteScheduler) Push(wr FrameWriteRequest) { id := wr.StreamID() if id == 0 { ws.zero.push(wr) return } q, ok := ws.sq[id] if !ok { q = ws.queuePool.get() ws.sq[id] = q } q.push(wr) } func (ws *randomWriteScheduler) Pop() (FrameWriteRequest, bool) { // Control frames first. if !ws.zero.empty() { return ws.zero.shift(), true } // Iterate over all non-idle streams until finding one that can be consumed. for _, q := range ws.sq { if wr, ok := q.consume(math.MaxInt32); ok { return wr, true } } return FrameWriteRequest{}, false } ================================================ FILE: vendor/golang.org/x/net/idna/idna10.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build go1.10 // Package idna implements IDNA2008 using the compatibility processing // defined by UTS (Unicode Technical Standard) #46, which defines a standard to // deal with the transition from IDNA2003. // // IDNA2008 (Internationalized Domain Names for Applications), is defined in RFC // 5890, RFC 5891, RFC 5892, RFC 5893 and RFC 5894. // UTS #46 is defined in https://www.unicode.org/reports/tr46. // See https://unicode.org/cldr/utility/idna.jsp for a visualization of the // differences between these two standards. package idna // import "golang.org/x/net/idna" import ( "fmt" "strings" "unicode/utf8" "golang.org/x/text/secure/bidirule" "golang.org/x/text/unicode/bidi" "golang.org/x/text/unicode/norm" ) // NOTE: Unlike common practice in Go APIs, the functions will return a // sanitized domain name in case of errors. Browsers sometimes use a partially // evaluated string as lookup. // TODO: the current error handling is, in my opinion, the least opinionated. // Other strategies are also viable, though: // Option 1) Return an empty string in case of error, but allow the user to // specify explicitly which errors to ignore. // Option 2) Return the partially evaluated string if it is itself a valid // string, otherwise return the empty string in case of error. // Option 3) Option 1 and 2. // Option 4) Always return an empty string for now and implement Option 1 as // needed, and document that the return string may not be empty in case of // error in the future. // I think Option 1 is best, but it is quite opinionated. // ToASCII is a wrapper for Punycode.ToASCII. func ToASCII(s string) (string, error) { return Punycode.process(s, true) } // ToUnicode is a wrapper for Punycode.ToUnicode. func ToUnicode(s string) (string, error) { return Punycode.process(s, false) } // An Option configures a Profile at creation time. type Option func(*options) // Transitional sets a Profile to use the Transitional mapping as defined in UTS // #46. This will cause, for example, "ß" to be mapped to "ss". Using the // transitional mapping provides a compromise between IDNA2003 and IDNA2008 // compatibility. It is used by most browsers when resolving domain names. This // option is only meaningful if combined with MapForLookup. func Transitional(transitional bool) Option { return func(o *options) { o.transitional = true } } // VerifyDNSLength sets whether a Profile should fail if any of the IDN parts // are longer than allowed by the RFC. func VerifyDNSLength(verify bool) Option { return func(o *options) { o.verifyDNSLength = verify } } // RemoveLeadingDots removes leading label separators. Leading runes that map to // dots, such as U+3002 IDEOGRAPHIC FULL STOP, are removed as well. // // This is the behavior suggested by the UTS #46 and is adopted by some // browsers. func RemoveLeadingDots(remove bool) Option { return func(o *options) { o.removeLeadingDots = remove } } // ValidateLabels sets whether to check the mandatory label validation criteria // as defined in Section 5.4 of RFC 5891. This includes testing for correct use // of hyphens ('-'), normalization, validity of runes, and the context rules. func ValidateLabels(enable bool) Option { return func(o *options) { // Don't override existing mappings, but set one that at least checks // normalization if it is not set. if o.mapping == nil && enable { o.mapping = normalize } o.trie = trie o.validateLabels = enable o.fromPuny = validateFromPunycode } } // StrictDomainName limits the set of permissible ASCII characters to those // allowed in domain names as defined in RFC 1034 (A-Z, a-z, 0-9 and the // hyphen). This is set by default for MapForLookup and ValidateForRegistration. // // This option is useful, for instance, for browsers that allow characters // outside this range, for example a '_' (U+005F LOW LINE). See // http://www.rfc-editor.org/std/std3.txt for more details This option // corresponds to the UseSTD3ASCIIRules option in UTS #46. func StrictDomainName(use bool) Option { return func(o *options) { o.trie = trie o.useSTD3Rules = use o.fromPuny = validateFromPunycode } } // NOTE: the following options pull in tables. The tables should not be linked // in as long as the options are not used. // BidiRule enables the Bidi rule as defined in RFC 5893. Any application // that relies on proper validation of labels should include this rule. func BidiRule() Option { return func(o *options) { o.bidirule = bidirule.ValidString } } // ValidateForRegistration sets validation options to verify that a given IDN is // properly formatted for registration as defined by Section 4 of RFC 5891. func ValidateForRegistration() Option { return func(o *options) { o.mapping = validateRegistration StrictDomainName(true)(o) ValidateLabels(true)(o) VerifyDNSLength(true)(o) BidiRule()(o) } } // MapForLookup sets validation and mapping options such that a given IDN is // transformed for domain name lookup according to the requirements set out in // Section 5 of RFC 5891. The mappings follow the recommendations of RFC 5894, // RFC 5895 and UTS 46. It does not add the Bidi Rule. Use the BidiRule option // to add this check. // // The mappings include normalization and mapping case, width and other // compatibility mappings. func MapForLookup() Option { return func(o *options) { o.mapping = validateAndMap StrictDomainName(true)(o) ValidateLabels(true)(o) } } type options struct { transitional bool useSTD3Rules bool validateLabels bool verifyDNSLength bool removeLeadingDots bool trie *idnaTrie // fromPuny calls validation rules when converting A-labels to U-labels. fromPuny func(p *Profile, s string) error // mapping implements a validation and mapping step as defined in RFC 5895 // or UTS 46, tailored to, for example, domain registration or lookup. mapping func(p *Profile, s string) (mapped string, isBidi bool, err error) // bidirule, if specified, checks whether s conforms to the Bidi Rule // defined in RFC 5893. bidirule func(s string) bool } // A Profile defines the configuration of an IDNA mapper. type Profile struct { options } func apply(o *options, opts []Option) { for _, f := range opts { f(o) } } // New creates a new Profile. // // With no options, the returned Profile is the most permissive and equals the // Punycode Profile. Options can be passed to further restrict the Profile. The // MapForLookup and ValidateForRegistration options set a collection of options, // for lookup and registration purposes respectively, which can be tailored by // adding more fine-grained options, where later options override earlier // options. func New(o ...Option) *Profile { p := &Profile{} apply(&p.options, o) return p } // ToASCII converts a domain or domain label to its ASCII form. For example, // ToASCII("bücher.example.com") is "xn--bcher-kva.example.com", and // ToASCII("golang") is "golang". If an error is encountered it will return // an error and a (partially) processed result. func (p *Profile) ToASCII(s string) (string, error) { return p.process(s, true) } // ToUnicode converts a domain or domain label to its Unicode form. For example, // ToUnicode("xn--bcher-kva.example.com") is "bücher.example.com", and // ToUnicode("golang") is "golang". If an error is encountered it will return // an error and a (partially) processed result. func (p *Profile) ToUnicode(s string) (string, error) { pp := *p pp.transitional = false return pp.process(s, false) } // String reports a string with a description of the profile for debugging // purposes. The string format may change with different versions. func (p *Profile) String() string { s := "" if p.transitional { s = "Transitional" } else { s = "NonTransitional" } if p.useSTD3Rules { s += ":UseSTD3Rules" } if p.validateLabels { s += ":ValidateLabels" } if p.verifyDNSLength { s += ":VerifyDNSLength" } return s } var ( // Punycode is a Profile that does raw punycode processing with a minimum // of validation. Punycode *Profile = punycode // Lookup is the recommended profile for looking up domain names, according // to Section 5 of RFC 5891. The exact configuration of this profile may // change over time. Lookup *Profile = lookup // Display is the recommended profile for displaying domain names. // The configuration of this profile may change over time. Display *Profile = display // Registration is the recommended profile for checking whether a given // IDN is valid for registration, according to Section 4 of RFC 5891. Registration *Profile = registration punycode = &Profile{} lookup = &Profile{options{ transitional: true, useSTD3Rules: true, validateLabels: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateAndMap, bidirule: bidirule.ValidString, }} display = &Profile{options{ useSTD3Rules: true, validateLabels: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateAndMap, bidirule: bidirule.ValidString, }} registration = &Profile{options{ useSTD3Rules: true, validateLabels: true, verifyDNSLength: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateRegistration, bidirule: bidirule.ValidString, }} // TODO: profiles // Register: recommended for approving domain names: don't do any mappings // but rather reject on invalid input. Bundle or block deviation characters. ) type labelError struct{ label, code_ string } func (e labelError) code() string { return e.code_ } func (e labelError) Error() string { return fmt.Sprintf("idna: invalid label %q", e.label) } type runeError rune func (e runeError) code() string { return "P1" } func (e runeError) Error() string { return fmt.Sprintf("idna: disallowed rune %U", e) } // process implements the algorithm described in section 4 of UTS #46, // see https://www.unicode.org/reports/tr46. func (p *Profile) process(s string, toASCII bool) (string, error) { var err error var isBidi bool if p.mapping != nil { s, isBidi, err = p.mapping(p, s) } // Remove leading empty labels. if p.removeLeadingDots { for ; len(s) > 0 && s[0] == '.'; s = s[1:] { } } // TODO: allow for a quick check of the tables data. // It seems like we should only create this error on ToASCII, but the // UTS 46 conformance tests suggests we should always check this. if err == nil && p.verifyDNSLength && s == "" { err = &labelError{s, "A4"} } labels := labelIter{orig: s} for ; !labels.done(); labels.next() { label := labels.label() if label == "" { // Empty labels are not okay. The label iterator skips the last // label if it is empty. if err == nil && p.verifyDNSLength { err = &labelError{s, "A4"} } continue } if strings.HasPrefix(label, acePrefix) { u, err2 := decode(label[len(acePrefix):]) if err2 != nil { if err == nil { err = err2 } // Spec says keep the old label. continue } isBidi = isBidi || bidirule.DirectionString(u) != bidi.LeftToRight labels.set(u) if err == nil && p.validateLabels { err = p.fromPuny(p, u) } if err == nil { // This should be called on NonTransitional, according to the // spec, but that currently does not have any effect. Use the // original profile to preserve options. err = p.validateLabel(u) } } else if err == nil { err = p.validateLabel(label) } } if isBidi && p.bidirule != nil && err == nil { for labels.reset(); !labels.done(); labels.next() { if !p.bidirule(labels.label()) { err = &labelError{s, "B"} break } } } if toASCII { for labels.reset(); !labels.done(); labels.next() { label := labels.label() if !ascii(label) { a, err2 := encode(acePrefix, label) if err == nil { err = err2 } label = a labels.set(a) } n := len(label) if p.verifyDNSLength && err == nil && (n == 0 || n > 63) { err = &labelError{label, "A4"} } } } s = labels.result() if toASCII && p.verifyDNSLength && err == nil { // Compute the length of the domain name minus the root label and its dot. n := len(s) if n > 0 && s[n-1] == '.' { n-- } if len(s) < 1 || n > 253 { err = &labelError{s, "A4"} } } return s, err } func normalize(p *Profile, s string) (mapped string, isBidi bool, err error) { // TODO: consider first doing a quick check to see if any of these checks // need to be done. This will make it slower in the general case, but // faster in the common case. mapped = norm.NFC.String(s) isBidi = bidirule.DirectionString(mapped) == bidi.RightToLeft return mapped, isBidi, nil } func validateRegistration(p *Profile, s string) (idem string, bidi bool, err error) { // TODO: filter need for normalization in loop below. if !norm.NFC.IsNormalString(s) { return s, false, &labelError{s, "V1"} } for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) if sz == 0 { return s, bidi, runeError(utf8.RuneError) } bidi = bidi || info(v).isBidi(s[i:]) // Copy bytes not copied so far. switch p.simplify(info(v).category()) { // TODO: handle the NV8 defined in the Unicode idna data set to allow // for strict conformance to IDNA2008. case valid, deviation: case disallowed, mapped, unknown, ignored: r, _ := utf8.DecodeRuneInString(s[i:]) return s, bidi, runeError(r) } i += sz } return s, bidi, nil } func (c info) isBidi(s string) bool { if !c.isMapped() { return c&attributesMask == rtl } // TODO: also store bidi info for mapped data. This is possible, but a bit // cumbersome and not for the common case. p, _ := bidi.LookupString(s) switch p.Class() { case bidi.R, bidi.AL, bidi.AN: return true } return false } func validateAndMap(p *Profile, s string) (vm string, bidi bool, err error) { var ( b []byte k int ) // combinedInfoBits contains the or-ed bits of all runes. We use this // to derive the mayNeedNorm bit later. This may trigger normalization // overeagerly, but it will not do so in the common case. The end result // is another 10% saving on BenchmarkProfile for the common case. var combinedInfoBits info for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) if sz == 0 { b = append(b, s[k:i]...) b = append(b, "\ufffd"...) k = len(s) if err == nil { err = runeError(utf8.RuneError) } break } combinedInfoBits |= info(v) bidi = bidi || info(v).isBidi(s[i:]) start := i i += sz // Copy bytes not copied so far. switch p.simplify(info(v).category()) { case valid: continue case disallowed: if err == nil { r, _ := utf8.DecodeRuneInString(s[start:]) err = runeError(r) } continue case mapped, deviation: b = append(b, s[k:start]...) b = info(v).appendMapping(b, s[start:i]) case ignored: b = append(b, s[k:start]...) // drop the rune case unknown: b = append(b, s[k:start]...) b = append(b, "\ufffd"...) } k = i } if k == 0 { // No changes so far. if combinedInfoBits&mayNeedNorm != 0 { s = norm.NFC.String(s) } } else { b = append(b, s[k:]...) if norm.NFC.QuickSpan(b) != len(b) { b = norm.NFC.Bytes(b) } // TODO: the punycode converters require strings as input. s = string(b) } return s, bidi, err } // A labelIter allows iterating over domain name labels. type labelIter struct { orig string slice []string curStart int curEnd int i int } func (l *labelIter) reset() { l.curStart = 0 l.curEnd = 0 l.i = 0 } func (l *labelIter) done() bool { return l.curStart >= len(l.orig) } func (l *labelIter) result() string { if l.slice != nil { return strings.Join(l.slice, ".") } return l.orig } func (l *labelIter) label() string { if l.slice != nil { return l.slice[l.i] } p := strings.IndexByte(l.orig[l.curStart:], '.') l.curEnd = l.curStart + p if p == -1 { l.curEnd = len(l.orig) } return l.orig[l.curStart:l.curEnd] } // next sets the value to the next label. It skips the last label if it is empty. func (l *labelIter) next() { l.i++ if l.slice != nil { if l.i >= len(l.slice) || l.i == len(l.slice)-1 && l.slice[l.i] == "" { l.curStart = len(l.orig) } } else { l.curStart = l.curEnd + 1 if l.curStart == len(l.orig)-1 && l.orig[l.curStart] == '.' { l.curStart = len(l.orig) } } } func (l *labelIter) set(s string) { if l.slice == nil { l.slice = strings.Split(l.orig, ".") } l.slice[l.i] = s } // acePrefix is the ASCII Compatible Encoding prefix. const acePrefix = "xn--" func (p *Profile) simplify(cat category) category { switch cat { case disallowedSTD3Mapped: if p.useSTD3Rules { cat = disallowed } else { cat = mapped } case disallowedSTD3Valid: if p.useSTD3Rules { cat = disallowed } else { cat = valid } case deviation: if !p.transitional { cat = valid } case validNV8, validXV8: // TODO: handle V2008 cat = valid } return cat } func validateFromPunycode(p *Profile, s string) error { if !norm.NFC.IsNormalString(s) { return &labelError{s, "V1"} } // TODO: detect whether string may have to be normalized in the following // loop. for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) if sz == 0 { return runeError(utf8.RuneError) } if c := p.simplify(info(v).category()); c != valid && c != deviation { return &labelError{s, "V6"} } i += sz } return nil } const ( zwnj = "\u200c" zwj = "\u200d" ) type joinState int8 const ( stateStart joinState = iota stateVirama stateBefore stateBeforeVirama stateAfter stateFAIL ) var joinStates = [][numJoinTypes]joinState{ stateStart: { joiningL: stateBefore, joiningD: stateBefore, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateVirama, }, stateVirama: { joiningL: stateBefore, joiningD: stateBefore, }, stateBefore: { joiningL: stateBefore, joiningD: stateBefore, joiningT: stateBefore, joinZWNJ: stateAfter, joinZWJ: stateFAIL, joinVirama: stateBeforeVirama, }, stateBeforeVirama: { joiningL: stateBefore, joiningD: stateBefore, joiningT: stateBefore, }, stateAfter: { joiningL: stateFAIL, joiningD: stateBefore, joiningT: stateAfter, joiningR: stateStart, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateAfter, // no-op as we can't accept joiners here }, stateFAIL: { 0: stateFAIL, joiningL: stateFAIL, joiningD: stateFAIL, joiningT: stateFAIL, joiningR: stateFAIL, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateFAIL, }, } // validateLabel validates the criteria from Section 4.1. Item 1, 4, and 6 are // already implicitly satisfied by the overall implementation. func (p *Profile) validateLabel(s string) (err error) { if s == "" { if p.verifyDNSLength { return &labelError{s, "A4"} } return nil } if !p.validateLabels { return nil } trie := p.trie // p.validateLabels is only set if trie is set. if len(s) > 4 && s[2] == '-' && s[3] == '-' { return &labelError{s, "V2"} } if s[0] == '-' || s[len(s)-1] == '-' { return &labelError{s, "V3"} } // TODO: merge the use of this in the trie. v, sz := trie.lookupString(s) x := info(v) if x.isModifier() { return &labelError{s, "V5"} } // Quickly return in the absence of zero-width (non) joiners. if strings.Index(s, zwj) == -1 && strings.Index(s, zwnj) == -1 { return nil } st := stateStart for i := 0; ; { jt := x.joinType() if s[i:i+sz] == zwj { jt = joinZWJ } else if s[i:i+sz] == zwnj { jt = joinZWNJ } st = joinStates[st][jt] if x.isViramaModifier() { st = joinStates[st][joinVirama] } if i += sz; i == len(s) { break } v, sz = trie.lookupString(s[i:]) x = info(v) } if st == stateFAIL || st == stateAfter { return &labelError{s, "C"} } return nil } func ascii(s string) bool { for i := 0; i < len(s); i++ { if s[i] >= utf8.RuneSelf { return false } } return true } ================================================ FILE: vendor/golang.org/x/net/idna/idna9.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !go1.10 // Package idna implements IDNA2008 using the compatibility processing // defined by UTS (Unicode Technical Standard) #46, which defines a standard to // deal with the transition from IDNA2003. // // IDNA2008 (Internationalized Domain Names for Applications), is defined in RFC // 5890, RFC 5891, RFC 5892, RFC 5893 and RFC 5894. // UTS #46 is defined in https://www.unicode.org/reports/tr46. // See https://unicode.org/cldr/utility/idna.jsp for a visualization of the // differences between these two standards. package idna // import "golang.org/x/net/idna" import ( "fmt" "strings" "unicode/utf8" "golang.org/x/text/secure/bidirule" "golang.org/x/text/unicode/norm" ) // NOTE: Unlike common practice in Go APIs, the functions will return a // sanitized domain name in case of errors. Browsers sometimes use a partially // evaluated string as lookup. // TODO: the current error handling is, in my opinion, the least opinionated. // Other strategies are also viable, though: // Option 1) Return an empty string in case of error, but allow the user to // specify explicitly which errors to ignore. // Option 2) Return the partially evaluated string if it is itself a valid // string, otherwise return the empty string in case of error. // Option 3) Option 1 and 2. // Option 4) Always return an empty string for now and implement Option 1 as // needed, and document that the return string may not be empty in case of // error in the future. // I think Option 1 is best, but it is quite opinionated. // ToASCII is a wrapper for Punycode.ToASCII. func ToASCII(s string) (string, error) { return Punycode.process(s, true) } // ToUnicode is a wrapper for Punycode.ToUnicode. func ToUnicode(s string) (string, error) { return Punycode.process(s, false) } // An Option configures a Profile at creation time. type Option func(*options) // Transitional sets a Profile to use the Transitional mapping as defined in UTS // #46. This will cause, for example, "ß" to be mapped to "ss". Using the // transitional mapping provides a compromise between IDNA2003 and IDNA2008 // compatibility. It is used by most browsers when resolving domain names. This // option is only meaningful if combined with MapForLookup. func Transitional(transitional bool) Option { return func(o *options) { o.transitional = true } } // VerifyDNSLength sets whether a Profile should fail if any of the IDN parts // are longer than allowed by the RFC. func VerifyDNSLength(verify bool) Option { return func(o *options) { o.verifyDNSLength = verify } } // RemoveLeadingDots removes leading label separators. Leading runes that map to // dots, such as U+3002 IDEOGRAPHIC FULL STOP, are removed as well. // // This is the behavior suggested by the UTS #46 and is adopted by some // browsers. func RemoveLeadingDots(remove bool) Option { return func(o *options) { o.removeLeadingDots = remove } } // ValidateLabels sets whether to check the mandatory label validation criteria // as defined in Section 5.4 of RFC 5891. This includes testing for correct use // of hyphens ('-'), normalization, validity of runes, and the context rules. func ValidateLabels(enable bool) Option { return func(o *options) { // Don't override existing mappings, but set one that at least checks // normalization if it is not set. if o.mapping == nil && enable { o.mapping = normalize } o.trie = trie o.validateLabels = enable o.fromPuny = validateFromPunycode } } // StrictDomainName limits the set of permissable ASCII characters to those // allowed in domain names as defined in RFC 1034 (A-Z, a-z, 0-9 and the // hyphen). This is set by default for MapForLookup and ValidateForRegistration. // // This option is useful, for instance, for browsers that allow characters // outside this range, for example a '_' (U+005F LOW LINE). See // http://www.rfc-editor.org/std/std3.txt for more details This option // corresponds to the UseSTD3ASCIIRules option in UTS #46. func StrictDomainName(use bool) Option { return func(o *options) { o.trie = trie o.useSTD3Rules = use o.fromPuny = validateFromPunycode } } // NOTE: the following options pull in tables. The tables should not be linked // in as long as the options are not used. // BidiRule enables the Bidi rule as defined in RFC 5893. Any application // that relies on proper validation of labels should include this rule. func BidiRule() Option { return func(o *options) { o.bidirule = bidirule.ValidString } } // ValidateForRegistration sets validation options to verify that a given IDN is // properly formatted for registration as defined by Section 4 of RFC 5891. func ValidateForRegistration() Option { return func(o *options) { o.mapping = validateRegistration StrictDomainName(true)(o) ValidateLabels(true)(o) VerifyDNSLength(true)(o) BidiRule()(o) } } // MapForLookup sets validation and mapping options such that a given IDN is // transformed for domain name lookup according to the requirements set out in // Section 5 of RFC 5891. The mappings follow the recommendations of RFC 5894, // RFC 5895 and UTS 46. It does not add the Bidi Rule. Use the BidiRule option // to add this check. // // The mappings include normalization and mapping case, width and other // compatibility mappings. func MapForLookup() Option { return func(o *options) { o.mapping = validateAndMap StrictDomainName(true)(o) ValidateLabels(true)(o) RemoveLeadingDots(true)(o) } } type options struct { transitional bool useSTD3Rules bool validateLabels bool verifyDNSLength bool removeLeadingDots bool trie *idnaTrie // fromPuny calls validation rules when converting A-labels to U-labels. fromPuny func(p *Profile, s string) error // mapping implements a validation and mapping step as defined in RFC 5895 // or UTS 46, tailored to, for example, domain registration or lookup. mapping func(p *Profile, s string) (string, error) // bidirule, if specified, checks whether s conforms to the Bidi Rule // defined in RFC 5893. bidirule func(s string) bool } // A Profile defines the configuration of a IDNA mapper. type Profile struct { options } func apply(o *options, opts []Option) { for _, f := range opts { f(o) } } // New creates a new Profile. // // With no options, the returned Profile is the most permissive and equals the // Punycode Profile. Options can be passed to further restrict the Profile. The // MapForLookup and ValidateForRegistration options set a collection of options, // for lookup and registration purposes respectively, which can be tailored by // adding more fine-grained options, where later options override earlier // options. func New(o ...Option) *Profile { p := &Profile{} apply(&p.options, o) return p } // ToASCII converts a domain or domain label to its ASCII form. For example, // ToASCII("bücher.example.com") is "xn--bcher-kva.example.com", and // ToASCII("golang") is "golang". If an error is encountered it will return // an error and a (partially) processed result. func (p *Profile) ToASCII(s string) (string, error) { return p.process(s, true) } // ToUnicode converts a domain or domain label to its Unicode form. For example, // ToUnicode("xn--bcher-kva.example.com") is "bücher.example.com", and // ToUnicode("golang") is "golang". If an error is encountered it will return // an error and a (partially) processed result. func (p *Profile) ToUnicode(s string) (string, error) { pp := *p pp.transitional = false return pp.process(s, false) } // String reports a string with a description of the profile for debugging // purposes. The string format may change with different versions. func (p *Profile) String() string { s := "" if p.transitional { s = "Transitional" } else { s = "NonTransitional" } if p.useSTD3Rules { s += ":UseSTD3Rules" } if p.validateLabels { s += ":ValidateLabels" } if p.verifyDNSLength { s += ":VerifyDNSLength" } return s } var ( // Punycode is a Profile that does raw punycode processing with a minimum // of validation. Punycode *Profile = punycode // Lookup is the recommended profile for looking up domain names, according // to Section 5 of RFC 5891. The exact configuration of this profile may // change over time. Lookup *Profile = lookup // Display is the recommended profile for displaying domain names. // The configuration of this profile may change over time. Display *Profile = display // Registration is the recommended profile for checking whether a given // IDN is valid for registration, according to Section 4 of RFC 5891. Registration *Profile = registration punycode = &Profile{} lookup = &Profile{options{ transitional: true, useSTD3Rules: true, validateLabels: true, removeLeadingDots: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateAndMap, bidirule: bidirule.ValidString, }} display = &Profile{options{ useSTD3Rules: true, validateLabels: true, removeLeadingDots: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateAndMap, bidirule: bidirule.ValidString, }} registration = &Profile{options{ useSTD3Rules: true, validateLabels: true, verifyDNSLength: true, trie: trie, fromPuny: validateFromPunycode, mapping: validateRegistration, bidirule: bidirule.ValidString, }} // TODO: profiles // Register: recommended for approving domain names: don't do any mappings // but rather reject on invalid input. Bundle or block deviation characters. ) type labelError struct{ label, code_ string } func (e labelError) code() string { return e.code_ } func (e labelError) Error() string { return fmt.Sprintf("idna: invalid label %q", e.label) } type runeError rune func (e runeError) code() string { return "P1" } func (e runeError) Error() string { return fmt.Sprintf("idna: disallowed rune %U", e) } // process implements the algorithm described in section 4 of UTS #46, // see https://www.unicode.org/reports/tr46. func (p *Profile) process(s string, toASCII bool) (string, error) { var err error if p.mapping != nil { s, err = p.mapping(p, s) } // Remove leading empty labels. if p.removeLeadingDots { for ; len(s) > 0 && s[0] == '.'; s = s[1:] { } } // It seems like we should only create this error on ToASCII, but the // UTS 46 conformance tests suggests we should always check this. if err == nil && p.verifyDNSLength && s == "" { err = &labelError{s, "A4"} } labels := labelIter{orig: s} for ; !labels.done(); labels.next() { label := labels.label() if label == "" { // Empty labels are not okay. The label iterator skips the last // label if it is empty. if err == nil && p.verifyDNSLength { err = &labelError{s, "A4"} } continue } if strings.HasPrefix(label, acePrefix) { u, err2 := decode(label[len(acePrefix):]) if err2 != nil { if err == nil { err = err2 } // Spec says keep the old label. continue } labels.set(u) if err == nil && p.validateLabels { err = p.fromPuny(p, u) } if err == nil { // This should be called on NonTransitional, according to the // spec, but that currently does not have any effect. Use the // original profile to preserve options. err = p.validateLabel(u) } } else if err == nil { err = p.validateLabel(label) } } if toASCII { for labels.reset(); !labels.done(); labels.next() { label := labels.label() if !ascii(label) { a, err2 := encode(acePrefix, label) if err == nil { err = err2 } label = a labels.set(a) } n := len(label) if p.verifyDNSLength && err == nil && (n == 0 || n > 63) { err = &labelError{label, "A4"} } } } s = labels.result() if toASCII && p.verifyDNSLength && err == nil { // Compute the length of the domain name minus the root label and its dot. n := len(s) if n > 0 && s[n-1] == '.' { n-- } if len(s) < 1 || n > 253 { err = &labelError{s, "A4"} } } return s, err } func normalize(p *Profile, s string) (string, error) { return norm.NFC.String(s), nil } func validateRegistration(p *Profile, s string) (string, error) { if !norm.NFC.IsNormalString(s) { return s, &labelError{s, "V1"} } for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) // Copy bytes not copied so far. switch p.simplify(info(v).category()) { // TODO: handle the NV8 defined in the Unicode idna data set to allow // for strict conformance to IDNA2008. case valid, deviation: case disallowed, mapped, unknown, ignored: r, _ := utf8.DecodeRuneInString(s[i:]) return s, runeError(r) } i += sz } return s, nil } func validateAndMap(p *Profile, s string) (string, error) { var ( err error b []byte k int ) for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) start := i i += sz // Copy bytes not copied so far. switch p.simplify(info(v).category()) { case valid: continue case disallowed: if err == nil { r, _ := utf8.DecodeRuneInString(s[start:]) err = runeError(r) } continue case mapped, deviation: b = append(b, s[k:start]...) b = info(v).appendMapping(b, s[start:i]) case ignored: b = append(b, s[k:start]...) // drop the rune case unknown: b = append(b, s[k:start]...) b = append(b, "\ufffd"...) } k = i } if k == 0 { // No changes so far. s = norm.NFC.String(s) } else { b = append(b, s[k:]...) if norm.NFC.QuickSpan(b) != len(b) { b = norm.NFC.Bytes(b) } // TODO: the punycode converters require strings as input. s = string(b) } return s, err } // A labelIter allows iterating over domain name labels. type labelIter struct { orig string slice []string curStart int curEnd int i int } func (l *labelIter) reset() { l.curStart = 0 l.curEnd = 0 l.i = 0 } func (l *labelIter) done() bool { return l.curStart >= len(l.orig) } func (l *labelIter) result() string { if l.slice != nil { return strings.Join(l.slice, ".") } return l.orig } func (l *labelIter) label() string { if l.slice != nil { return l.slice[l.i] } p := strings.IndexByte(l.orig[l.curStart:], '.') l.curEnd = l.curStart + p if p == -1 { l.curEnd = len(l.orig) } return l.orig[l.curStart:l.curEnd] } // next sets the value to the next label. It skips the last label if it is empty. func (l *labelIter) next() { l.i++ if l.slice != nil { if l.i >= len(l.slice) || l.i == len(l.slice)-1 && l.slice[l.i] == "" { l.curStart = len(l.orig) } } else { l.curStart = l.curEnd + 1 if l.curStart == len(l.orig)-1 && l.orig[l.curStart] == '.' { l.curStart = len(l.orig) } } } func (l *labelIter) set(s string) { if l.slice == nil { l.slice = strings.Split(l.orig, ".") } l.slice[l.i] = s } // acePrefix is the ASCII Compatible Encoding prefix. const acePrefix = "xn--" func (p *Profile) simplify(cat category) category { switch cat { case disallowedSTD3Mapped: if p.useSTD3Rules { cat = disallowed } else { cat = mapped } case disallowedSTD3Valid: if p.useSTD3Rules { cat = disallowed } else { cat = valid } case deviation: if !p.transitional { cat = valid } case validNV8, validXV8: // TODO: handle V2008 cat = valid } return cat } func validateFromPunycode(p *Profile, s string) error { if !norm.NFC.IsNormalString(s) { return &labelError{s, "V1"} } for i := 0; i < len(s); { v, sz := trie.lookupString(s[i:]) if c := p.simplify(info(v).category()); c != valid && c != deviation { return &labelError{s, "V6"} } i += sz } return nil } const ( zwnj = "\u200c" zwj = "\u200d" ) type joinState int8 const ( stateStart joinState = iota stateVirama stateBefore stateBeforeVirama stateAfter stateFAIL ) var joinStates = [][numJoinTypes]joinState{ stateStart: { joiningL: stateBefore, joiningD: stateBefore, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateVirama, }, stateVirama: { joiningL: stateBefore, joiningD: stateBefore, }, stateBefore: { joiningL: stateBefore, joiningD: stateBefore, joiningT: stateBefore, joinZWNJ: stateAfter, joinZWJ: stateFAIL, joinVirama: stateBeforeVirama, }, stateBeforeVirama: { joiningL: stateBefore, joiningD: stateBefore, joiningT: stateBefore, }, stateAfter: { joiningL: stateFAIL, joiningD: stateBefore, joiningT: stateAfter, joiningR: stateStart, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateAfter, // no-op as we can't accept joiners here }, stateFAIL: { 0: stateFAIL, joiningL: stateFAIL, joiningD: stateFAIL, joiningT: stateFAIL, joiningR: stateFAIL, joinZWNJ: stateFAIL, joinZWJ: stateFAIL, joinVirama: stateFAIL, }, } // validateLabel validates the criteria from Section 4.1. Item 1, 4, and 6 are // already implicitly satisfied by the overall implementation. func (p *Profile) validateLabel(s string) error { if s == "" { if p.verifyDNSLength { return &labelError{s, "A4"} } return nil } if p.bidirule != nil && !p.bidirule(s) { return &labelError{s, "B"} } if !p.validateLabels { return nil } trie := p.trie // p.validateLabels is only set if trie is set. if len(s) > 4 && s[2] == '-' && s[3] == '-' { return &labelError{s, "V2"} } if s[0] == '-' || s[len(s)-1] == '-' { return &labelError{s, "V3"} } // TODO: merge the use of this in the trie. v, sz := trie.lookupString(s) x := info(v) if x.isModifier() { return &labelError{s, "V5"} } // Quickly return in the absence of zero-width (non) joiners. if strings.Index(s, zwj) == -1 && strings.Index(s, zwnj) == -1 { return nil } st := stateStart for i := 0; ; { jt := x.joinType() if s[i:i+sz] == zwj { jt = joinZWJ } else if s[i:i+sz] == zwnj { jt = joinZWNJ } st = joinStates[st][jt] if x.isViramaModifier() { st = joinStates[st][joinVirama] } if i += sz; i == len(s) { break } v, sz = trie.lookupString(s[i:]) x = info(v) } if st == stateFAIL || st == stateAfter { return &labelError{s, "C"} } return nil } func ascii(s string) bool { for i := 0; i < len(s); i++ { if s[i] >= utf8.RuneSelf { return false } } return true } ================================================ FILE: vendor/golang.org/x/net/idna/punycode.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package idna // This file implements the Punycode algorithm from RFC 3492. import ( "math" "strings" "unicode/utf8" ) // These parameter values are specified in section 5. // // All computation is done with int32s, so that overflow behavior is identical // regardless of whether int is 32-bit or 64-bit. const ( base int32 = 36 damp int32 = 700 initialBias int32 = 72 initialN int32 = 128 skew int32 = 38 tmax int32 = 26 tmin int32 = 1 ) func punyError(s string) error { return &labelError{s, "A3"} } // decode decodes a string as specified in section 6.2. func decode(encoded string) (string, error) { if encoded == "" { return "", nil } pos := 1 + strings.LastIndex(encoded, "-") if pos == 1 { return "", punyError(encoded) } if pos == len(encoded) { return encoded[:len(encoded)-1], nil } output := make([]rune, 0, len(encoded)) if pos != 0 { for _, r := range encoded[:pos-1] { output = append(output, r) } } i, n, bias := int32(0), initialN, initialBias for pos < len(encoded) { oldI, w := i, int32(1) for k := base; ; k += base { if pos == len(encoded) { return "", punyError(encoded) } digit, ok := decodeDigit(encoded[pos]) if !ok { return "", punyError(encoded) } pos++ i += digit * w if i < 0 { return "", punyError(encoded) } t := k - bias if t < tmin { t = tmin } else if t > tmax { t = tmax } if digit < t { break } w *= base - t if w >= math.MaxInt32/base { return "", punyError(encoded) } } x := int32(len(output) + 1) bias = adapt(i-oldI, x, oldI == 0) n += i / x i %= x if n > utf8.MaxRune || len(output) >= 1024 { return "", punyError(encoded) } output = append(output, 0) copy(output[i+1:], output[i:]) output[i] = n i++ } return string(output), nil } // encode encodes a string as specified in section 6.3 and prepends prefix to // the result. // // The "while h < length(input)" line in the specification becomes "for // remaining != 0" in the Go code, because len(s) in Go is in bytes, not runes. func encode(prefix, s string) (string, error) { output := make([]byte, len(prefix), len(prefix)+1+2*len(s)) copy(output, prefix) delta, n, bias := int32(0), initialN, initialBias b, remaining := int32(0), int32(0) for _, r := range s { if r < 0x80 { b++ output = append(output, byte(r)) } else { remaining++ } } h := b if b > 0 { output = append(output, '-') } for remaining != 0 { m := int32(0x7fffffff) for _, r := range s { if m > r && r >= n { m = r } } delta += (m - n) * (h + 1) if delta < 0 { return "", punyError(s) } n = m for _, r := range s { if r < n { delta++ if delta < 0 { return "", punyError(s) } continue } if r > n { continue } q := delta for k := base; ; k += base { t := k - bias if t < tmin { t = tmin } else if t > tmax { t = tmax } if q < t { break } output = append(output, encodeDigit(t+(q-t)%(base-t))) q = (q - t) / (base - t) } output = append(output, encodeDigit(q)) bias = adapt(delta, h+1, h == b) delta = 0 h++ remaining-- } delta++ n++ } return string(output), nil } func decodeDigit(x byte) (digit int32, ok bool) { switch { case '0' <= x && x <= '9': return int32(x - ('0' - 26)), true case 'A' <= x && x <= 'Z': return int32(x - 'A'), true case 'a' <= x && x <= 'z': return int32(x - 'a'), true } return 0, false } func encodeDigit(digit int32) byte { switch { case 0 <= digit && digit < 26: return byte(digit + 'a') case 26 <= digit && digit < 36: return byte(digit + ('0' - 26)) } panic("idna: internal error in punycode encoding") } // adapt is the bias adaptation function specified in section 6.1. func adapt(delta, numPoints int32, firstTime bool) int32 { if firstTime { delta /= damp } else { delta /= 2 } delta += delta / numPoints k := int32(0) for delta > ((base-tmin)*tmax)/2 { delta /= base - tmin k += base } return k + (base-tmin+1)*delta/(delta+skew) } ================================================ FILE: vendor/golang.org/x/net/idna/tables10.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // +build go1.10,!go1.13 package idna // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "10.0.0" var mappings string = "" + // Size: 8175 bytes "\x00\x01 \x03 ̈\x01a\x03 ̄\x012\x013\x03 ́\x03 ̧\x011\x01o\x051⁄4\x051⁄2" + "\x053⁄4\x03i̇\x03l·\x03ʼn\x01s\x03dž\x03ⱥ\x03ⱦ\x01h\x01j\x01r\x01w\x01y" + "\x03 ̆\x03 ̇\x03 ̊\x03 ̨\x03 ̃\x03 ̋\x01l\x01x\x04̈́\x03 ι\x01;\x05 ̈́" + "\x04եւ\x04اٴ\x04وٴ\x04ۇٴ\x04يٴ\x06क़\x06ख़\x06ग़\x06ज़\x06ड़\x06ढ़\x06फ़" + "\x06य़\x06ড়\x06ঢ়\x06য়\x06ਲ਼\x06ਸ਼\x06ਖ਼\x06ਗ਼\x06ਜ਼\x06ਫ਼\x06ଡ଼\x06ଢ଼" + "\x06ํา\x06ໍາ\x06ຫນ\x06ຫມ\x06གྷ\x06ཌྷ\x06དྷ\x06བྷ\x06ཛྷ\x06ཀྵ\x06ཱི\x06ཱུ" + "\x06ྲྀ\x09ྲཱྀ\x06ླྀ\x09ླཱྀ\x06ཱྀ\x06ྒྷ\x06ྜྷ\x06ྡྷ\x06ྦྷ\x06ྫྷ\x06ྐྵ\x02" + "в\x02д\x02о\x02с\x02т\x02ъ\x02ѣ\x02æ\x01b\x01d\x01e\x02ǝ\x01g\x01i\x01k" + "\x01m\x01n\x02ȣ\x01p\x01t\x01u\x02ɐ\x02ɑ\x02ə\x02ɛ\x02ɜ\x02ŋ\x02ɔ\x02ɯ" + "\x01v\x02β\x02γ\x02δ\x02φ\x02χ\x02ρ\x02н\x02ɒ\x01c\x02ɕ\x02ð\x01f\x02ɟ" + "\x02ɡ\x02ɥ\x02ɨ\x02ɩ\x02ɪ\x02ʝ\x02ɭ\x02ʟ\x02ɱ\x02ɰ\x02ɲ\x02ɳ\x02ɴ\x02ɵ" + "\x02ɸ\x02ʂ\x02ʃ\x02ƫ\x02ʉ\x02ʊ\x02ʋ\x02ʌ\x01z\x02ʐ\x02ʑ\x02ʒ\x02θ\x02ss" + "\x02ά\x02έ\x02ή\x02ί\x02ό\x02ύ\x02ώ\x05ἀι\x05ἁι\x05ἂι\x05ἃι\x05ἄι\x05ἅι" + "\x05ἆι\x05ἇι\x05ἠι\x05ἡι\x05ἢι\x05ἣι\x05ἤι\x05ἥι\x05ἦι\x05ἧι\x05ὠι\x05ὡι" + "\x05ὢι\x05ὣι\x05ὤι\x05ὥι\x05ὦι\x05ὧι\x05ὰι\x04αι\x04άι\x05ᾶι\x02ι\x05 ̈͂" + "\x05ὴι\x04ηι\x04ήι\x05ῆι\x05 ̓̀\x05 ̓́\x05 ̓͂\x02ΐ\x05 ̔̀\x05 ̔́\x05 ̔͂" + "\x02ΰ\x05 ̈̀\x01`\x05ὼι\x04ωι\x04ώι\x05ῶι\x06′′\x09′′′\x06‵‵\x09‵‵‵\x02!" + "!\x02??\x02?!\x02!?\x0c′′′′\x010\x014\x015\x016\x017\x018\x019\x01+\x01=" + "\x01(\x01)\x02rs\x02ħ\x02no\x01q\x02sm\x02tm\x02ω\x02å\x02א\x02ב\x02ג" + "\x02ד\x02π\x051⁄7\x051⁄9\x061⁄10\x051⁄3\x052⁄3\x051⁄5\x052⁄5\x053⁄5\x054" + "⁄5\x051⁄6\x055⁄6\x051⁄8\x053⁄8\x055⁄8\x057⁄8\x041⁄\x02ii\x02iv\x02vi" + "\x04viii\x02ix\x02xi\x050⁄3\x06∫∫\x09∫∫∫\x06∮∮\x09∮∮∮\x0210\x0211\x0212" + "\x0213\x0214\x0215\x0216\x0217\x0218\x0219\x0220\x04(10)\x04(11)\x04(12)" + "\x04(13)\x04(14)\x04(15)\x04(16)\x04(17)\x04(18)\x04(19)\x04(20)\x0c∫∫∫∫" + "\x02==\x05⫝̸\x02ɫ\x02ɽ\x02ȿ\x02ɀ\x01.\x04 ゙\x04 ゚\x06より\x06コト\x05(ᄀ)\x05" + "(ᄂ)\x05(ᄃ)\x05(ᄅ)\x05(ᄆ)\x05(ᄇ)\x05(ᄉ)\x05(ᄋ)\x05(ᄌ)\x05(ᄎ)\x05(ᄏ)\x05(ᄐ" + ")\x05(ᄑ)\x05(ᄒ)\x05(가)\x05(나)\x05(다)\x05(라)\x05(마)\x05(바)\x05(사)\x05(아)" + "\x05(자)\x05(차)\x05(카)\x05(타)\x05(파)\x05(하)\x05(주)\x08(오전)\x08(오후)\x05(一)" + "\x05(二)\x05(三)\x05(四)\x05(五)\x05(六)\x05(七)\x05(八)\x05(九)\x05(十)\x05(月)" + "\x05(火)\x05(水)\x05(木)\x05(金)\x05(土)\x05(日)\x05(株)\x05(有)\x05(社)\x05(名)" + "\x05(特)\x05(財)\x05(祝)\x05(労)\x05(代)\x05(呼)\x05(学)\x05(監)\x05(企)\x05(資)" + "\x05(協)\x05(祭)\x05(休)\x05(自)\x05(至)\x0221\x0222\x0223\x0224\x0225\x0226" + "\x0227\x0228\x0229\x0230\x0231\x0232\x0233\x0234\x0235\x06참고\x06주의\x0236" + "\x0237\x0238\x0239\x0240\x0241\x0242\x0243\x0244\x0245\x0246\x0247\x0248" + "\x0249\x0250\x041月\x042月\x043月\x044月\x045月\x046月\x047月\x048月\x049月\x0510" + "月\x0511月\x0512月\x02hg\x02ev\x0cアパート\x0cアルファ\x0cアンペア\x09アール\x0cイニング\x09" + "インチ\x09ウォン\x0fエスクード\x0cエーカー\x09オンス\x09オーム\x09カイリ\x0cカラット\x0cカロリー\x09ガロ" + "ン\x09ガンマ\x06ギガ\x09ギニー\x0cキュリー\x0cギルダー\x06キロ\x0fキログラム\x12キロメートル\x0fキロワッ" + "ト\x09グラム\x0fグラムトン\x0fクルゼイロ\x0cクローネ\x09ケース\x09コルナ\x09コーポ\x0cサイクル\x0fサンチ" + "ーム\x0cシリング\x09センチ\x09セント\x09ダース\x06デシ\x06ドル\x06トン\x06ナノ\x09ノット\x09ハイツ" + "\x0fパーセント\x09パーツ\x0cバーレル\x0fピアストル\x09ピクル\x06ピコ\x06ビル\x0fファラッド\x0cフィート" + "\x0fブッシェル\x09フラン\x0fヘクタール\x06ペソ\x09ペニヒ\x09ヘルツ\x09ペンス\x09ページ\x09ベータ\x0cポイ" + "ント\x09ボルト\x06ホン\x09ポンド\x09ホール\x09ホーン\x0cマイクロ\x09マイル\x09マッハ\x09マルク\x0fマ" + "ンション\x0cミクロン\x06ミリ\x0fミリバール\x06メガ\x0cメガトン\x0cメートル\x09ヤード\x09ヤール\x09ユアン" + "\x0cリットル\x06リラ\x09ルピー\x0cルーブル\x06レム\x0fレントゲン\x09ワット\x040点\x041点\x042点" + "\x043点\x044点\x045点\x046点\x047点\x048点\x049点\x0510点\x0511点\x0512点\x0513点" + "\x0514点\x0515点\x0516点\x0517点\x0518点\x0519点\x0520点\x0521点\x0522点\x0523点" + "\x0524点\x02da\x02au\x02ov\x02pc\x02dm\x02iu\x06平成\x06昭和\x06大正\x06明治\x0c株" + "式会社\x02pa\x02na\x02ma\x02ka\x02kb\x02mb\x02gb\x04kcal\x02pf\x02nf\x02m" + "g\x02kg\x02hz\x02ml\x02dl\x02kl\x02fm\x02nm\x02mm\x02cm\x02km\x02m2\x02m" + "3\x05m∕s\x06m∕s2\x07rad∕s\x08rad∕s2\x02ps\x02ns\x02ms\x02pv\x02nv\x02mv" + "\x02kv\x02pw\x02nw\x02mw\x02kw\x02bq\x02cc\x02cd\x06c∕kg\x02db\x02gy\x02" + "ha\x02hp\x02in\x02kk\x02kt\x02lm\x02ln\x02lx\x02ph\x02pr\x02sr\x02sv\x02" + "wb\x05v∕m\x05a∕m\x041日\x042日\x043日\x044日\x045日\x046日\x047日\x048日\x049日" + "\x0510日\x0511日\x0512日\x0513日\x0514日\x0515日\x0516日\x0517日\x0518日\x0519日" + "\x0520日\x0521日\x0522日\x0523日\x0524日\x0525日\x0526日\x0527日\x0528日\x0529日" + "\x0530日\x0531日\x02ь\x02ɦ\x02ɬ\x02ʞ\x02ʇ\x02œ\x04𤋮\x04𢡊\x04𢡄\x04𣏕\x04𥉉" + "\x04𥳐\x04𧻓\x02ff\x02fi\x02fl\x02st\x04մն\x04մե\x04մի\x04վն\x04մխ\x04יִ" + "\x04ײַ\x02ע\x02ה\x02כ\x02ל\x02ם\x02ר\x02ת\x04שׁ\x04שׂ\x06שּׁ\x06שּׂ\x04א" + "ַ\x04אָ\x04אּ\x04בּ\x04גּ\x04דּ\x04הּ\x04וּ\x04זּ\x04טּ\x04יּ\x04ךּ\x04" + "כּ\x04לּ\x04מּ\x04נּ\x04סּ\x04ףּ\x04פּ\x04צּ\x04קּ\x04רּ\x04שּ\x04תּ" + "\x04וֹ\x04בֿ\x04כֿ\x04פֿ\x04אל\x02ٱ\x02ٻ\x02پ\x02ڀ\x02ٺ\x02ٿ\x02ٹ\x02ڤ" + "\x02ڦ\x02ڄ\x02ڃ\x02چ\x02ڇ\x02ڍ\x02ڌ\x02ڎ\x02ڈ\x02ژ\x02ڑ\x02ک\x02گ\x02ڳ" + "\x02ڱ\x02ں\x02ڻ\x02ۀ\x02ہ\x02ھ\x02ے\x02ۓ\x02ڭ\x02ۇ\x02ۆ\x02ۈ\x02ۋ\x02ۅ" + "\x02ۉ\x02ې\x02ى\x04ئا\x04ئە\x04ئو\x04ئۇ\x04ئۆ\x04ئۈ\x04ئې\x04ئى\x02ی\x04" + "ئج\x04ئح\x04ئم\x04ئي\x04بج\x04بح\x04بخ\x04بم\x04بى\x04بي\x04تج\x04تح" + "\x04تخ\x04تم\x04تى\x04تي\x04ثج\x04ثم\x04ثى\x04ثي\x04جح\x04جم\x04حج\x04حم" + "\x04خج\x04خح\x04خم\x04سج\x04سح\x04سخ\x04سم\x04صح\x04صم\x04ضج\x04ضح\x04ضخ" + "\x04ضم\x04طح\x04طم\x04ظم\x04عج\x04عم\x04غج\x04غم\x04فج\x04فح\x04فخ\x04فم" + "\x04فى\x04في\x04قح\x04قم\x04قى\x04قي\x04كا\x04كج\x04كح\x04كخ\x04كل\x04كم" + "\x04كى\x04كي\x04لج\x04لح\x04لخ\x04لم\x04لى\x04لي\x04مج\x04مح\x04مخ\x04مم" + "\x04مى\x04مي\x04نج\x04نح\x04نخ\x04نم\x04نى\x04ني\x04هج\x04هم\x04هى\x04هي" + "\x04يج\x04يح\x04يخ\x04يم\x04يى\x04يي\x04ذٰ\x04رٰ\x04ىٰ\x05 ٌّ\x05 ٍّ\x05" + " َّ\x05 ُّ\x05 ِّ\x05 ّٰ\x04ئر\x04ئز\x04ئن\x04بر\x04بز\x04بن\x04تر\x04تز" + "\x04تن\x04ثر\x04ثز\x04ثن\x04ما\x04نر\x04نز\x04نن\x04ير\x04يز\x04ين\x04ئخ" + "\x04ئه\x04به\x04ته\x04صخ\x04له\x04نه\x04هٰ\x04يه\x04ثه\x04سه\x04شم\x04شه" + "\x06ـَّ\x06ـُّ\x06ـِّ\x04طى\x04طي\x04عى\x04عي\x04غى\x04غي\x04سى\x04سي" + "\x04شى\x04شي\x04حى\x04حي\x04جى\x04جي\x04خى\x04خي\x04صى\x04صي\x04ضى\x04ضي" + "\x04شج\x04شح\x04شخ\x04شر\x04سر\x04صر\x04ضر\x04اً\x06تجم\x06تحج\x06تحم" + "\x06تخم\x06تمج\x06تمح\x06تمخ\x06جمح\x06حمي\x06حمى\x06سحج\x06سجح\x06سجى" + "\x06سمح\x06سمج\x06سمم\x06صحح\x06صمم\x06شحم\x06شجي\x06شمخ\x06شمم\x06ضحى" + "\x06ضخم\x06طمح\x06طمم\x06طمي\x06عجم\x06عمم\x06عمى\x06غمم\x06غمي\x06غمى" + "\x06فخم\x06قمح\x06قمم\x06لحم\x06لحي\x06لحى\x06لجج\x06لخم\x06لمح\x06محج" + "\x06محم\x06محي\x06مجح\x06مجم\x06مخج\x06مخم\x06مجخ\x06همج\x06همم\x06نحم" + "\x06نحى\x06نجم\x06نجى\x06نمي\x06نمى\x06يمم\x06بخي\x06تجي\x06تجى\x06تخي" + "\x06تخى\x06تمي\x06تمى\x06جمي\x06جحى\x06جمى\x06سخى\x06صحي\x06شحي\x06ضحي" + "\x06لجي\x06لمي\x06يحي\x06يجي\x06يمي\x06ممي\x06قمي\x06نحي\x06عمي\x06كمي" + "\x06نجح\x06مخي\x06لجم\x06كمم\x06جحي\x06حجي\x06مجي\x06فمي\x06بحي\x06سخي" + "\x06نجي\x06صلے\x06قلے\x08الله\x08اكبر\x08محمد\x08صلعم\x08رسول\x08عليه" + "\x08وسلم\x06صلى!صلى الله عليه وسلم\x0fجل جلاله\x08ریال\x01,\x01:\x01!" + "\x01?\x01_\x01{\x01}\x01[\x01]\x01#\x01&\x01*\x01-\x01<\x01>\x01\\\x01$" + "\x01%\x01@\x04ـً\x04ـَ\x04ـُ\x04ـِ\x04ـّ\x04ـْ\x02ء\x02آ\x02أ\x02ؤ\x02إ" + "\x02ئ\x02ا\x02ب\x02ة\x02ت\x02ث\x02ج\x02ح\x02خ\x02د\x02ذ\x02ر\x02ز\x02س" + "\x02ش\x02ص\x02ض\x02ط\x02ظ\x02ع\x02غ\x02ف\x02ق\x02ك\x02ل\x02م\x02ن\x02ه" + "\x02و\x02ي\x04لآ\x04لأ\x04لإ\x04لا\x01\x22\x01'\x01/\x01^\x01|\x01~\x02¢" + "\x02£\x02¬\x02¦\x02¥\x08𝅗𝅥\x08𝅘𝅥\x0c𝅘𝅥𝅮\x0c𝅘𝅥𝅯\x0c𝅘𝅥𝅰\x0c𝅘𝅥𝅱\x0c𝅘𝅥𝅲\x08𝆹" + "𝅥\x08𝆺𝅥\x0c𝆹𝅥𝅮\x0c𝆺𝅥𝅮\x0c𝆹𝅥𝅯\x0c𝆺𝅥𝅯\x02ı\x02ȷ\x02α\x02ε\x02ζ\x02η\x02" + "κ\x02λ\x02μ\x02ν\x02ξ\x02ο\x02σ\x02τ\x02υ\x02ψ\x03∇\x03∂\x02ϝ\x02ٮ\x02ڡ" + "\x02ٯ\x020,\x021,\x022,\x023,\x024,\x025,\x026,\x027,\x028,\x029,\x03(a)" + "\x03(b)\x03(c)\x03(d)\x03(e)\x03(f)\x03(g)\x03(h)\x03(i)\x03(j)\x03(k)" + "\x03(l)\x03(m)\x03(n)\x03(o)\x03(p)\x03(q)\x03(r)\x03(s)\x03(t)\x03(u)" + "\x03(v)\x03(w)\x03(x)\x03(y)\x03(z)\x07〔s〕\x02wz\x02hv\x02sd\x03ppv\x02w" + "c\x02mc\x02md\x02dj\x06ほか\x06ココ\x03サ\x03手\x03字\x03双\x03デ\x03二\x03多\x03解" + "\x03天\x03交\x03映\x03無\x03料\x03前\x03後\x03再\x03新\x03初\x03終\x03生\x03販\x03声" + "\x03吹\x03演\x03投\x03捕\x03一\x03三\x03遊\x03左\x03中\x03右\x03指\x03走\x03打\x03禁" + "\x03空\x03合\x03満\x03有\x03月\x03申\x03割\x03営\x03配\x09〔本〕\x09〔三〕\x09〔二〕\x09〔安" + "〕\x09〔点〕\x09〔打〕\x09〔盗〕\x09〔勝〕\x09〔敗〕\x03得\x03可\x03丽\x03丸\x03乁\x03你\x03" + "侮\x03侻\x03倂\x03偺\x03備\x03僧\x03像\x03㒞\x03免\x03兔\x03兤\x03具\x03㒹\x03內\x03" + "冗\x03冤\x03仌\x03冬\x03况\x03凵\x03刃\x03㓟\x03刻\x03剆\x03剷\x03㔕\x03勇\x03勉\x03" + "勤\x03勺\x03包\x03匆\x03北\x03卉\x03卑\x03博\x03即\x03卽\x03卿\x03灰\x03及\x03叟\x03" + "叫\x03叱\x03吆\x03咞\x03吸\x03呈\x03周\x03咢\x03哶\x03唐\x03啓\x03啣\x03善\x03喙\x03" + "喫\x03喳\x03嗂\x03圖\x03嘆\x03圗\x03噑\x03噴\x03切\x03壮\x03城\x03埴\x03堍\x03型\x03" + "堲\x03報\x03墬\x03売\x03壷\x03夆\x03夢\x03奢\x03姬\x03娛\x03娧\x03姘\x03婦\x03㛮\x03" + "嬈\x03嬾\x03寃\x03寘\x03寧\x03寳\x03寿\x03将\x03尢\x03㞁\x03屠\x03屮\x03峀\x03岍\x03" + "嵃\x03嵮\x03嵫\x03嵼\x03巡\x03巢\x03㠯\x03巽\x03帨\x03帽\x03幩\x03㡢\x03㡼\x03庰\x03" + "庳\x03庶\x03廊\x03廾\x03舁\x03弢\x03㣇\x03形\x03彫\x03㣣\x03徚\x03忍\x03志\x03忹\x03" + "悁\x03㤺\x03㤜\x03悔\x03惇\x03慈\x03慌\x03慎\x03慺\x03憎\x03憲\x03憤\x03憯\x03懞\x03" + "懲\x03懶\x03成\x03戛\x03扝\x03抱\x03拔\x03捐\x03挽\x03拼\x03捨\x03掃\x03揤\x03搢\x03" + "揅\x03掩\x03㨮\x03摩\x03摾\x03撝\x03摷\x03㩬\x03敏\x03敬\x03旣\x03書\x03晉\x03㬙\x03" + "暑\x03㬈\x03㫤\x03冒\x03冕\x03最\x03暜\x03肭\x03䏙\x03朗\x03望\x03朡\x03杞\x03杓\x03" + "㭉\x03柺\x03枅\x03桒\x03梅\x03梎\x03栟\x03椔\x03㮝\x03楂\x03榣\x03槪\x03檨\x03櫛\x03" + "㰘\x03次\x03歔\x03㱎\x03歲\x03殟\x03殺\x03殻\x03汎\x03沿\x03泍\x03汧\x03洖\x03派\x03" + "海\x03流\x03浩\x03浸\x03涅\x03洴\x03港\x03湮\x03㴳\x03滋\x03滇\x03淹\x03潮\x03濆\x03" + "瀹\x03瀞\x03瀛\x03㶖\x03灊\x03災\x03灷\x03炭\x03煅\x03熜\x03爨\x03爵\x03牐\x03犀\x03" + "犕\x03獺\x03王\x03㺬\x03玥\x03㺸\x03瑇\x03瑜\x03瑱\x03璅\x03瓊\x03㼛\x03甤\x03甾\x03" + "異\x03瘐\x03㿼\x03䀈\x03直\x03眞\x03真\x03睊\x03䀹\x03瞋\x03䁆\x03䂖\x03硎\x03碌\x03" + "磌\x03䃣\x03祖\x03福\x03秫\x03䄯\x03穀\x03穊\x03穏\x03䈂\x03篆\x03築\x03䈧\x03糒\x03" + "䊠\x03糨\x03糣\x03紀\x03絣\x03䌁\x03緇\x03縂\x03繅\x03䌴\x03䍙\x03罺\x03羕\x03翺\x03" + "者\x03聠\x03聰\x03䏕\x03育\x03脃\x03䐋\x03脾\x03媵\x03舄\x03辞\x03䑫\x03芑\x03芋\x03" + "芝\x03劳\x03花\x03芳\x03芽\x03苦\x03若\x03茝\x03荣\x03莭\x03茣\x03莽\x03菧\x03著\x03" + "荓\x03菊\x03菌\x03菜\x03䔫\x03蓱\x03蓳\x03蔖\x03蕤\x03䕝\x03䕡\x03䕫\x03虐\x03虜\x03" + "虧\x03虩\x03蚩\x03蚈\x03蜎\x03蛢\x03蝹\x03蜨\x03蝫\x03螆\x03蟡\x03蠁\x03䗹\x03衠\x03" + "衣\x03裗\x03裞\x03䘵\x03裺\x03㒻\x03䚾\x03䛇\x03誠\x03諭\x03變\x03豕\x03貫\x03賁\x03" + "贛\x03起\x03跋\x03趼\x03跰\x03軔\x03輸\x03邔\x03郱\x03鄑\x03鄛\x03鈸\x03鋗\x03鋘\x03" + "鉼\x03鏹\x03鐕\x03開\x03䦕\x03閷\x03䧦\x03雃\x03嶲\x03霣\x03䩮\x03䩶\x03韠\x03䪲\x03" + "頋\x03頩\x03飢\x03䬳\x03餩\x03馧\x03駂\x03駾\x03䯎\x03鬒\x03鱀\x03鳽\x03䳎\x03䳭\x03" + "鵧\x03䳸\x03麻\x03䵖\x03黹\x03黾\x03鼅\x03鼏\x03鼖\x03鼻" var xorData string = "" + // Size: 4855 bytes "\x02\x0c\x09\x02\xb0\xec\x02\xad\xd8\x02\xad\xd9\x02\x06\x07\x02\x0f\x12" + "\x02\x0f\x1f\x02\x0f\x1d\x02\x01\x13\x02\x0f\x16\x02\x0f\x0b\x02\x0f3" + "\x02\x0f7\x02\x0f?\x02\x0f/\x02\x0f*\x02\x0c&\x02\x0c*\x02\x0c;\x02\x0c9" + "\x02\x0c%\x02\xab\xed\x02\xab\xe2\x02\xab\xe3\x02\xa9\xe0\x02\xa9\xe1" + "\x02\xa9\xe6\x02\xa3\xcb\x02\xa3\xc8\x02\xa3\xc9\x02\x01#\x02\x01\x08" + "\x02\x0e>\x02\x0e'\x02\x0f\x03\x02\x03\x0d\x02\x03\x09\x02\x03\x17\x02" + "\x03\x0e\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07" + "\x0d\x02\x02\x0c\x02\x0c0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\x22" + "\x02\x01)\x02\x01\x0a\x02\x01\x0c\x02\x02\x06\x02\x02\x02\x02\x03\x10" + "\x03\x037 \x03\x0b+\x03\x02\x01\x04\x02\x01\x02\x02\x019\x02\x03\x1c\x02" + "\x02$\x03\x80p$\x02\x03:\x02\x03\x0a\x03\xc1r.\x03\xc1r,\x03\xc1r\x02" + "\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xc1s<\x03\xc1s*" + "\x03\xc2L$\x03\xc2L;\x02\x09)\x02\x0a\x19\x03\x83\xab\xe3\x03\x83\xab" + "\xf2\x03 4\xe0\x03\x81\xab\xea\x03\x81\xab\xf3\x03 4\xef\x03\x96\xe1\xcd" + "\x03\x84\xe5\xc3\x02\x0d\x11\x03\x8b\xec\xcb\x03\x94\xec\xcf\x03\x9a\xec" + "\xc2\x03\x8b\xec\xdb\x03\x94\xec\xdf\x03\x9a\xec\xd2\x03\x01\x0c!\x03" + "\x01\x0c#\x03ʠ\x9d\x03ʣ\x9c\x03ʢ\x9f\x03ʥ\x9e\x03ʤ\x91\x03ʧ\x90\x03ʦ\x93" + "\x03ʩ\x92\x03ʨ\x95\x03\xca\xf3\xb5\x03\xca\xf0\xb4\x03\xca\xf1\xb7\x03" + "\xca\xf6\xb6\x03\xca\xf7\x89\x03\xca\xf4\x88\x03\xca\xf5\x8b\x03\xca\xfa" + "\x8a\x03\xca\xfb\x8d\x03\xca\xf8\x8c\x03\xca\xf9\x8f\x03\xca\xfe\x8e\x03" + "\xca\xff\x81\x03\xca\xfc\x80\x03\xca\xfd\x83\x03\xca\xe2\x82\x03\xca\xe3" + "\x85\x03\xca\xe0\x84\x03\xca\xe1\x87\x03\xca\xe6\x86\x03\xca\xe7\x99\x03" + "\xca\xe4\x98\x03\xca\xe5\x9b\x03\xca\xea\x9a\x03\xca\xeb\x9d\x03\xca\xe8" + "\x9c\x03ؓ\x89\x03ߔ\x8b\x02\x010\x03\x03\x04\x1e\x03\x04\x15\x12\x03\x0b" + "\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06\x05" + "\x1d\x03\x06\x06\x00\x03\x06\x06\x0a\x03\x06\x06'\x03\x06\x062\x03\x0786" + "\x03\x079/\x03\x079 \x03\x07:\x0e\x03\x07:\x1b\x03\x07:%\x03\x07;/\x03" + "\x07;%\x03\x074\x11\x03\x076\x09\x03\x077*\x03\x070\x01\x03\x070\x0f\x03" + "\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-\x03" + "\x073\x14\x03\x073>\x03\x07'\x09\x03\x07 \x00\x03\x07\x1f\x0b\x03\x07" + "\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03\x07" + "\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\x0c&\x03\x07\x0c\x08\x03\x07" + "\x0c\x13\x03\x07\x0d\x02\x03\x07\x0d\x1c\x03\x07\x0b5\x03\x07\x0b\x0a" + "\x03\x07\x0b\x01\x03\x07\x0b\x0f\x03\x07\x05\x00\x03\x07\x05\x09\x03\x07" + "\x05\x0b\x03\x07\x07\x01\x03\x07\x07\x08\x03\x07\x00<\x03\x07\x00+\x03" + "\x07\x01)\x03\x07\x01\x1b\x03\x07\x01\x08\x03\x07\x03?\x03\x0445\x03\x04" + "4\x08\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03\x04+ " + "\x03\x04+<\x03\x04*&\x03\x04*\x22\x03\x04&8\x03\x04!\x01\x03\x04!\x22" + "\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04\x03" + "\x04\x12\x0a\x03\x04\x0d\x1d\x03\x04\x0d\x07\x03\x04\x0d \x03\x05<>\x03" + "\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1d\x03\x054\x02\x03\x054" + "\x07\x03\x0571\x03\x053\x1a\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03\x05)" + ":\x03\x05)<\x03\x05)\x0c\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$\x1e" + "\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\x226\x03" + "\x05\x22\x0c\x03\x05\x22\x1c\x03\x05\x19\x0a\x03\x05\x1b\x09\x03\x05\x1b" + "\x0c\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\x0c\x03\x05\x0c\x05\x03" + "\x05\x0e\x0f\x03\x05\x01\x0e\x03\x05\x00(\x03\x05\x030\x03\x05\x03\x06" + "\x03\x0a==\x03\x0a=1\x03\x0a=,\x03\x0a=\x0c\x03\x0a??\x03\x0a<\x08\x03" + "\x0a9!\x03\x0a9)\x03\x0a97\x03\x0a99\x03\x0a6\x0a\x03\x0a6\x1c\x03\x0a6" + "\x17\x03\x0a7'\x03\x0a78\x03\x0a73\x03\x0a'\x01\x03\x0a'&\x03\x0a\x1f" + "\x0e\x03\x0a\x1f\x03\x03\x0a\x1f3\x03\x0a\x1b/\x03\x0a\x18\x19\x03\x0a" + "\x19\x01\x03\x0a\x16\x14\x03\x0a\x0e\x22\x03\x0a\x0f\x10\x03\x0a\x0f\x02" + "\x03\x0a\x0f \x03\x0a\x0c\x04\x03\x0a\x0b>\x03\x0a\x0b+\x03\x0a\x08/\x03" + "\x0a\x046\x03\x0a\x05\x14\x03\x0a\x00\x04\x03\x0a\x00\x10\x03\x0a\x00" + "\x14\x03\x0b<3\x03\x0b;*\x03\x0b9\x22\x03\x0b9)\x03\x0b97\x03\x0b+\x10" + "\x03\x0b((\x03\x0b&5\x03\x0b$\x1c\x03\x0b$\x12\x03\x0b%\x04\x03\x0b#<" + "\x03\x0b#0\x03\x0b#\x0d\x03\x0b#\x19\x03\x0b!:\x03\x0b!\x1f\x03\x0b!\x00" + "\x03\x0b\x1e5\x03\x0b\x1c\x1d\x03\x0b\x1d-\x03\x0b\x1d(\x03\x0b\x18.\x03" + "\x0b\x18 \x03\x0b\x18\x16\x03\x0b\x14\x13\x03\x0b\x15$\x03\x0b\x15\x22" + "\x03\x0b\x12\x1b\x03\x0b\x12\x10\x03\x0b\x132\x03\x0b\x13=\x03\x0b\x12" + "\x18\x03\x0b\x0c&\x03\x0b\x061\x03\x0b\x06:\x03\x0b\x05#\x03\x0b\x05<" + "\x03\x0b\x04\x0b\x03\x0b\x04\x04\x03\x0b\x04\x1b\x03\x0b\x042\x03\x0b" + "\x041\x03\x0b\x03\x03\x03\x0b\x03\x1d\x03\x0b\x03/\x03\x0b\x03+\x03\x0b" + "\x02\x1b\x03\x0b\x02\x00\x03\x0b\x01\x1e\x03\x0b\x01\x08\x03\x0b\x015" + "\x03\x06\x0d9\x03\x06\x0d=\x03\x06\x0d?\x03\x02\x001\x03\x02\x003\x03" + "\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1b\x03\x02\x004\x03\x02\x00<\x03" + "\x02\x02\x0a\x03\x02\x02\x0e\x03\x02\x01\x1a\x03\x02\x01\x07\x03\x02\x01" + "\x05\x03\x02\x01\x0b\x03\x02\x01%\x03\x02\x01\x0c\x03\x02\x01\x04\x03" + "\x02\x01\x1c\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03" + "\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02" + "\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022" + "\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01" + "\x11\x03\x02\x01\x1e\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0f\x03" + "\x02\x01\x08\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\x0d\x03\x02\x03" + "\x13\x03\x02\x03\x1d\x03\x02\x03\x1f\x03\x02\x00\x03\x03\x02\x00\x0d\x03" + "\x02\x00\x01\x03\x02\x00\x1b\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00" + "\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1f\x03\x07>\x1d\x03\x06\x1d\x0e" + "\x03\x07>\x1c\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>" + "\x02\x03\x06\x224\x03\x06\x1a.\x03\x07<%\x03\x06\x1c\x0b\x03\x0609\x03" + "\x05\x1f\x01\x03\x04'\x08\x03\x93\xfd\xf5\x03\x02\x0d \x03\x02\x0d#\x03" + "\x02\x0d!\x03\x02\x0d&\x03\x02\x0d\x22\x03\x02\x0d/\x03\x02\x0d,\x03\x02" + "\x0d$\x03\x02\x0d'\x03\x02\x0d%\x03\x02\x0d;\x03\x02\x0d=\x03\x02\x0d?" + "\x03\x099.\x03\x08\x0b7\x03\x08\x02\x14\x03\x08\x14\x0d\x03\x08.:\x03" + "\x089'\x03\x0f\x0b\x18\x03\x0f\x1c1\x03\x0f\x17&\x03\x0f9\x1f\x03\x0f0" + "\x0c\x03\x0e\x0a9\x03\x0e\x056\x03\x0e\x1c#\x03\x0f\x13\x0e\x03\x072\x00" + "\x03\x070\x0d\x03\x072\x0b\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0f(\x03" + "\x072\x05\x03\x06\x0f,\x03\x073\x15\x03\x06\x07\x08\x03\x05\x16\x02\x03" + "\x04\x0b \x03\x05:8\x03\x05\x16%\x03\x0a\x0d\x1f\x03\x06\x16\x10\x03\x05" + "\x1d5\x03\x05*;\x03\x05\x16\x1b\x03\x04.-\x03\x06\x1a\x19\x03\x04\x03," + "\x03\x0b87\x03\x04/\x0a\x03\x06\x00,\x03\x04-\x01\x03\x04\x1e-\x03\x06/(" + "\x03\x0a\x0b5\x03\x06\x0e7\x03\x06\x07.\x03\x0597\x03\x0a*%\x03\x0760" + "\x03\x06\x0c;\x03\x05'\x00\x03\x072.\x03\x072\x08\x03\x06=\x01\x03\x06" + "\x05\x1b\x03\x06\x06\x12\x03\x06$=\x03\x06'\x0d\x03\x04\x11\x0f\x03\x076" + ",\x03\x06\x07;\x03\x06.,\x03\x86\xf9\xea\x03\x8f\xff\xeb\x02\x092\x02" + "\x095\x02\x094\x02\x09;\x02\x09>\x02\x098\x02\x09*\x02\x09/\x02\x09,\x02" + "\x09%\x02\x09&\x02\x09#\x02\x09 \x02\x08!\x02\x08%\x02\x08$\x02\x08+\x02" + "\x08.\x02\x08*\x02\x08&\x02\x088\x02\x08>\x02\x084\x02\x086\x02\x080\x02" + "\x08\x10\x02\x08\x17\x02\x08\x12\x02\x08\x1d\x02\x08\x1f\x02\x08\x13\x02" + "\x08\x15\x02\x08\x14\x02\x08\x0c\x03\x8b\xfd\xd0\x03\x81\xec\xc6\x03\x87" + "\xe0\x8a\x03-2\xe3\x03\x80\xef\xe4\x03-2\xea\x03\x88\xe6\xeb\x03\x8e\xe6" + "\xe8\x03\x84\xe6\xe9\x03\x97\xe6\xee\x03-2\xf9\x03-2\xf6\x03\x8e\xe3\xad" + "\x03\x80\xe3\x92\x03\x88\xe3\x90\x03\x8e\xe3\x90\x03\x80\xe3\x97\x03\x88" + "\xe3\x95\x03\x88\xfe\xcb\x03\x8e\xfe\xca\x03\x84\xfe\xcd\x03\x91\xef\xc9" + "\x03-2\xc1\x03-2\xc0\x03-2\xcb\x03\x88@\x09\x03\x8e@\x08\x03\x8f\xe0\xf5" + "\x03\x8e\xe6\xf9\x03\x8e\xe0\xfa\x03\x93\xff\xf4\x03\x84\xee\xd3\x03\x0b" + "(\x04\x023 \x021;\x02\x01*\x03\x0b#\x10\x03\x0b 0\x03\x0b!\x10\x03\x0b!0" + "\x03\x07\x15\x08\x03\x09?5\x03\x07\x1f\x08\x03\x07\x17\x0b\x03\x09\x1f" + "\x15\x03\x0b\x1c7\x03\x0a+#\x03\x06\x1a\x1b\x03\x06\x1a\x14\x03\x0a\x01" + "\x18\x03\x06#\x1b\x03\x0a2\x0c\x03\x0a\x01\x04\x03\x09#;\x03\x08='\x03" + "\x08\x1a\x0a\x03\x07\x03\x0a\x111\x03\x09\x1b\x09\x03\x073.\x03\x07\x01\x00" + "\x03\x09/,\x03\x07#>\x03\x07\x048\x03\x0a\x1f\x22\x03\x098>\x03\x09\x11" + "\x00\x03\x08/\x17\x03\x06'\x22\x03\x0b\x1a+\x03\x0a\x22\x19\x03\x0a/1" + "\x03\x0974\x03\x09\x0f\x22\x03\x08,\x22\x03\x08?\x14\x03\x07$5\x03\x07<3" + "\x03\x07=*\x03\x07\x13\x18\x03\x068\x0a\x03\x06\x09\x16\x03\x06\x13\x00" + "\x03\x08\x067\x03\x08\x01\x03\x03\x08\x12\x1d\x03\x07+7\x03\x06(;\x03" + "\x06\x1c?\x03\x07\x0e\x17\x03\x0a\x06\x1d\x03\x0a\x19\x07\x03\x08\x14$" + "\x03\x07$;\x03\x08,$\x03\x08\x06\x0d\x03\x07\x16\x0a\x03\x06>>\x03\x0a" + "\x06\x12\x03\x0a\x14)\x03\x09\x0d\x1f\x03\x09\x12\x17\x03\x09\x19\x01" + "\x03\x08\x11 \x03\x08\x1d'\x03\x06<\x1a\x03\x0a.\x00\x03\x07'\x18\x03" + "\x0a\x22\x08\x03\x08\x0d\x0a\x03\x08\x13)\x03\x07*)\x03\x06<,\x03\x07" + "\x0b\x1a\x03\x09.\x14\x03\x09\x0d\x1e\x03\x07\x0e#\x03\x0b\x1d'\x03\x0a" + "\x0a8\x03\x09%2\x03\x08+&\x03\x080\x12\x03\x0a)4\x03\x08\x06\x1f\x03\x0b" + "\x1b\x1a\x03\x0a\x1b\x0f\x03\x0b\x1d*\x03\x09\x16$\x03\x090\x11\x03\x08" + "\x11\x08\x03\x0a*(\x03\x0a\x042\x03\x089,\x03\x074'\x03\x07\x0f\x05\x03" + "\x09\x0b\x0a\x03\x07\x1b\x01\x03\x09\x17:\x03\x09.\x0d\x03\x07.\x11\x03" + "\x09+\x15\x03\x080\x13\x03\x0b\x1f\x19\x03\x0a \x11\x03\x0a\x220\x03\x09" + "\x07;\x03\x08\x16\x1c\x03\x07,\x13\x03\x07\x0e/\x03\x06\x221\x03\x0a." + "\x0a\x03\x0a7\x02\x03\x0a\x032\x03\x0a\x1d.\x03\x091\x06\x03\x09\x19:" + "\x03\x08\x02/\x03\x060+\x03\x06\x0f-\x03\x06\x1c\x1f\x03\x06\x1d\x07\x03" + "\x0a,\x11\x03\x09=\x0d\x03\x09\x0b;\x03\x07\x1b/\x03\x0a\x1f:\x03\x09 " + "\x1f\x03\x09.\x10\x03\x094\x0b\x03\x09\x1a1\x03\x08#\x1a\x03\x084\x1d" + "\x03\x08\x01\x1f\x03\x08\x11\x22\x03\x07'8\x03\x07\x1a>\x03\x0757\x03" + "\x06&9\x03\x06+\x11\x03\x0a.\x0b\x03\x0a,>\x03\x0a4#\x03\x08%\x17\x03" + "\x07\x05\x22\x03\x07\x0c\x0b\x03\x0a\x1d+\x03\x0a\x19\x16\x03\x09+\x1f" + "\x03\x09\x08\x0b\x03\x08\x16\x18\x03\x08+\x12\x03\x0b\x1d\x0c\x03\x0a=" + "\x10\x03\x0a\x09\x0d\x03\x0a\x10\x11\x03\x09&0\x03\x08(\x1f\x03\x087\x07" + "\x03\x08\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06," + "\x03\x0b\x18>\x03\x08\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\x09%\x18\x03" + "\x0b\x1c<\x03\x0a%!\x03\x0a\x09\x12\x03\x0a\x16\x02\x03\x090'\x03\x09" + "\x0e=\x03\x08 \x0e\x03\x08>\x03\x03\x074>\x03\x06&?\x03\x06\x19\x09\x03" + "\x06?(\x03\x0a-\x0e\x03\x09:3\x03\x098:\x03\x09\x12\x0b\x03\x09\x1d\x17" + "\x03\x087\x05\x03\x082\x14\x03\x08\x06%\x03\x08\x13\x1f\x03\x06\x06\x0e" + "\x03\x0a\x22<\x03\x09/<\x03\x06>+\x03\x0a'?\x03\x0a\x13\x0c\x03\x09\x10<" + "\x03\x07\x1b=\x03\x0a\x19\x13\x03\x09\x22\x1d\x03\x09\x07\x0d\x03\x08)" + "\x1c\x03\x06=\x1a\x03\x0a/4\x03\x0a7\x11\x03\x0a\x16:\x03\x09?3\x03\x09:" + "/\x03\x09\x05\x0a\x03\x09\x14\x06\x03\x087\x22\x03\x080\x07\x03\x08\x1a" + "\x1f\x03\x07\x04(\x03\x07\x04\x09\x03\x06 %\x03\x06<\x08\x03\x0a+\x14" + "\x03\x09\x1d\x16\x03\x0a70\x03\x08 >\x03\x0857\x03\x070\x0a\x03\x06=\x12" + "\x03\x06\x16%\x03\x06\x1d,\x03\x099#\x03\x09\x10>\x03\x07 \x1e\x03\x08" + "\x0c<\x03\x08\x0b\x18\x03\x08\x15+\x03\x08,:\x03\x08%\x22\x03\x07\x0a$" + "\x03\x0b\x1c=\x03\x07+\x08\x03\x0a/\x05\x03\x0a \x07\x03\x0a\x12'\x03" + "\x09#\x11\x03\x08\x1b\x15\x03\x0a\x06\x01\x03\x09\x1c\x1b\x03\x0922\x03" + "\x07\x14<\x03\x07\x09\x04\x03\x061\x04\x03\x07\x0e\x01\x03\x0a\x13\x18" + "\x03\x0a-\x0c\x03\x0a?\x0d\x03\x0a\x09\x0a\x03\x091&\x03\x0a/\x0b\x03" + "\x08$<\x03\x083\x1d\x03\x08\x0c$\x03\x08\x0d\x07\x03\x08\x0d?\x03\x08" + "\x0e\x14\x03\x065\x0a\x03\x08\x1a#\x03\x08\x16#\x03\x0702\x03\x07\x03" + "\x1a\x03\x06(\x1d\x03\x06+\x1b\x03\x06\x0b\x05\x03\x06\x0b\x17\x03\x06" + "\x0c\x04\x03\x06\x1e\x19\x03\x06+0\x03\x062\x18\x03\x0b\x16\x1e\x03\x0a+" + "\x16\x03\x0a-?\x03\x0a#:\x03\x0a#\x10\x03\x0a%$\x03\x0a>+\x03\x0a01\x03" + "\x0a1\x10\x03\x0a\x099\x03\x0a\x0a\x12\x03\x0a\x19\x1f\x03\x0a\x19\x12" + "\x03\x09*)\x03\x09-\x16\x03\x09.1\x03\x09.2\x03\x09<\x0e\x03\x09> \x03" + "\x093\x12\x03\x09\x0b\x01\x03\x09\x1c2\x03\x09\x11\x1c\x03\x09\x15%\x03" + "\x08,&\x03\x08!\x22\x03\x089(\x03\x08\x0b\x1a\x03\x08\x0d2\x03\x08\x0c" + "\x04\x03\x08\x0c\x06\x03\x08\x0c\x1f\x03\x08\x0c\x0c\x03\x08\x0f\x1f\x03" + "\x08\x0f\x1d\x03\x08\x00\x14\x03\x08\x03\x14\x03\x08\x06\x16\x03\x08\x1e" + "#\x03\x08\x11\x11\x03\x08\x10\x18\x03\x08\x14(\x03\x07)\x1e\x03\x07.1" + "\x03\x07 $\x03\x07 '\x03\x078\x08\x03\x07\x0d0\x03\x07\x0f7\x03\x07\x05#" + "\x03\x07\x05\x1a\x03\x07\x1a7\x03\x07\x1d-\x03\x07\x17\x10\x03\x06)\x1f" + "\x03\x062\x0b\x03\x066\x16\x03\x06\x09\x11\x03\x09(\x1e\x03\x07!5\x03" + "\x0b\x11\x16\x03\x0a/\x04\x03\x0a,\x1a\x03\x0b\x173\x03\x0a,1\x03\x0a/5" + "\x03\x0a\x221\x03\x0a\x22\x0d\x03\x0a?%\x03\x0a<,\x03\x0a?#\x03\x0a>\x19" + "\x03\x0a\x08&\x03\x0a\x0b\x0e\x03\x0a\x0c:\x03\x0a\x0c+\x03\x0a\x03\x22" + "\x03\x0a\x06)\x03\x0a\x11\x10\x03\x0a\x11\x1a\x03\x0a\x17-\x03\x0a\x14(" + "\x03\x09)\x1e\x03\x09/\x09\x03\x09.\x00\x03\x09,\x07\x03\x09/*\x03\x09-9" + "\x03\x09\x228\x03\x09%\x09\x03\x09:\x12\x03\x09;\x1d\x03\x09?\x06\x03" + "\x093%\x03\x096\x05\x03\x096\x08\x03\x097\x02\x03\x09\x07,\x03\x09\x04," + "\x03\x09\x1f\x16\x03\x09\x11\x03\x03\x09\x11\x12\x03\x09\x168\x03\x08*" + "\x05\x03\x08/2\x03\x084:\x03\x08\x22+\x03\x08 0\x03\x08&\x0a\x03\x08;" + "\x10\x03\x08>$\x03\x08>\x18\x03\x0829\x03\x082:\x03\x081,\x03\x081<\x03" + "\x081\x1c\x03\x087#\x03\x087*\x03\x08\x09'\x03\x08\x00\x1d\x03\x08\x05-" + "\x03\x08\x1f4\x03\x08\x1d\x04\x03\x08\x16\x0f\x03\x07*7\x03\x07'!\x03" + "\x07%\x1b\x03\x077\x0c\x03\x07\x0c1\x03\x07\x0c.\x03\x07\x00\x06\x03\x07" + "\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03" + "\x07\x06\x06\x03\x07\x05\x0a\x03\x07\x1f\x09\x03\x07\x17:\x03\x06*1\x03" + "\x06-\x1d\x03\x06\x223\x03\x062:\x03\x060$\x03\x066\x1e\x03\x064\x12\x03" + "\x0645\x03\x06\x0b\x00\x03\x06\x0b7\x03\x06\x07\x1f\x03\x06\x15\x12\x03" + "\x0c\x05\x0f\x03\x0b+\x0b\x03\x0b+-\x03\x06\x16\x1b\x03\x06\x15\x17\x03" + "\x89\xca\xea\x03\x89\xca\xe8\x03\x0c8\x10\x03\x0c8\x01\x03\x0c8\x0f\x03" + "\x0d8%\x03\x0d8!\x03\x0c8-\x03\x0c8/\x03\x0c8+\x03\x0c87\x03\x0c85\x03" + "\x0c9\x09\x03\x0c9\x0d\x03\x0c9\x0f\x03\x0c9\x0b\x03\xcfu\x0c\x03\xcfu" + "\x0f\x03\xcfu\x0e\x03\xcfu\x09\x03\x0c9\x10\x03\x0d9\x0c\x03\xcf`;\x03" + "\xcf`>\x03\xcf`9\x03\xcf`8\x03\xcf`7\x03\xcf`*\x03\xcf`-\x03\xcf`,\x03" + "\x0d\x1b\x1a\x03\x0d\x1b&\x03\x0c=.\x03\x0c=%\x03\x0c>\x1e\x03\x0c>\x14" + "\x03\x0c?\x06\x03\x0c?\x0b\x03\x0c?\x0c\x03\x0c?\x0d\x03\x0c?\x02\x03" + "\x0c>\x0f\x03\x0c>\x08\x03\x0c>\x09\x03\x0c>,\x03\x0c>\x0c\x03\x0c?\x13" + "\x03\x0c?\x16\x03\x0c?\x15\x03\x0c?\x1c\x03\x0c?\x1f\x03\x0c?\x1d\x03" + "\x0c?\x1a\x03\x0c?\x17\x03\x0c?\x08\x03\x0c?\x09\x03\x0c?\x0e\x03\x0c?" + "\x04\x03\x0c?\x05\x03\x0c" + "\x03\x0c=2\x03\x0c=6\x03\x0c<\x07\x03\x0c<\x05\x03\x0e:!\x03\x0e:#\x03" + "\x0e8\x09\x03\x0e:&\x03\x0e8\x0b\x03\x0e:$\x03\x0e:,\x03\x0e8\x1a\x03" + "\x0e8\x1e\x03\x0e:*\x03\x0e:7\x03\x0e:5\x03\x0e:;\x03\x0e:\x15\x03\x0e:<" + "\x03\x0e:4\x03\x0e:'\x03\x0e:-\x03\x0e:%\x03\x0e:?\x03\x0e:=\x03\x0e:)" + "\x03\x0e:/\x03\xcfs'\x03\x0d=\x0f\x03\x0d+*\x03\x0d99\x03\x0d9;\x03\x0d9" + "?\x03\x0d)\x0d\x03\x0d(%\x02\x01\x18\x02\x01(\x02\x01\x1e\x03\x0f$!\x03" + "\x0f87\x03\x0f4\x0e\x03\x0f5\x1d\x03\x06'\x03\x03\x0f\x08\x18\x03\x0f" + "\x0d\x1b\x03\x0e2=\x03\x0e;\x08\x03\x0e:\x0b\x03\x0e\x06$\x03\x0e\x0d)" + "\x03\x0e\x16\x1f\x03\x0e\x16\x1b\x03\x0d$\x0a\x03\x05,\x1d\x03\x0d. \x03" + "\x0d.#\x03\x0c(/\x03\x09%\x02\x03\x0d90\x03\x0d\x0e4\x03\x0d\x0d\x0f\x03" + "\x0c#\x00\x03\x0c,\x1e\x03\x0c2\x0e\x03\x0c\x01\x17\x03\x0c\x09:\x03\x0e" + "\x173\x03\x0c\x08\x03\x03\x0c\x11\x07\x03\x0c\x10\x18\x03\x0c\x1f\x1c" + "\x03\x0c\x19\x0e\x03\x0c\x1a\x1f\x03\x0f0>\x03\x0b->\x03\x0b<+\x03\x0b8" + "\x13\x03\x0b\x043\x03\x0b\x14\x03\x03\x0b\x16%\x03\x0d\x22&\x03\x0b\x1a" + "\x1a\x03\x0b\x1a\x04\x03\x0a%9\x03\x0a&2\x03\x0a&0\x03\x0a!\x1a\x03\x0a!" + "7\x03\x0a5\x10\x03\x0a=4\x03\x0a?\x0e\x03\x0a>\x10\x03\x0a\x00 \x03\x0a" + "\x0f:\x03\x0a\x0f9\x03\x0a\x0b\x0a\x03\x0a\x17%\x03\x0a\x1b-\x03\x09-" + "\x1a\x03\x09,4\x03\x09.,\x03\x09)\x09\x03\x096!\x03\x091\x1f\x03\x093" + "\x16\x03\x0c+\x1f\x03\x098 \x03\x098=\x03\x0c(\x1a\x03\x0c(\x16\x03\x09" + "\x0a+\x03\x09\x16\x12\x03\x09\x13\x0e\x03\x09\x153\x03\x08)!\x03\x09\x1a" + "\x01\x03\x09\x18\x01\x03\x08%#\x03\x08>\x22\x03\x08\x05%\x03\x08\x02*" + "\x03\x08\x15;\x03\x08\x1b7\x03\x0f\x07\x1d\x03\x0f\x04\x03\x03\x070\x0c" + "\x03\x07;\x0b\x03\x07\x08\x17\x03\x07\x12\x06\x03\x06/-\x03\x0671\x03" + "\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1e\x03\x05,\x17\x03\x05 \x1d\x03" + "\x05\x22\x05\x03\x050\x1d" // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // idnaTrie. Total size: 29052 bytes (28.37 KiB). Checksum: ef06e7ecc26f36dd. type idnaTrie struct{} func newIdnaTrie(i int) *idnaTrie { return &idnaTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *idnaTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 125: return uint16(idnaValues[n<<6+uint32(b)]) default: n -= 125 return uint16(idnaSparse.lookup(n, b)) } } // idnaValues: 127 blocks, 8128 entries, 16256 bytes // The third block is the zero block. var idnaValues = [8128]uint16{ // Block 0x0, offset 0x0 0x00: 0x0080, 0x01: 0x0080, 0x02: 0x0080, 0x03: 0x0080, 0x04: 0x0080, 0x05: 0x0080, 0x06: 0x0080, 0x07: 0x0080, 0x08: 0x0080, 0x09: 0x0080, 0x0a: 0x0080, 0x0b: 0x0080, 0x0c: 0x0080, 0x0d: 0x0080, 0x0e: 0x0080, 0x0f: 0x0080, 0x10: 0x0080, 0x11: 0x0080, 0x12: 0x0080, 0x13: 0x0080, 0x14: 0x0080, 0x15: 0x0080, 0x16: 0x0080, 0x17: 0x0080, 0x18: 0x0080, 0x19: 0x0080, 0x1a: 0x0080, 0x1b: 0x0080, 0x1c: 0x0080, 0x1d: 0x0080, 0x1e: 0x0080, 0x1f: 0x0080, 0x20: 0x0080, 0x21: 0x0080, 0x22: 0x0080, 0x23: 0x0080, 0x24: 0x0080, 0x25: 0x0080, 0x26: 0x0080, 0x27: 0x0080, 0x28: 0x0080, 0x29: 0x0080, 0x2a: 0x0080, 0x2b: 0x0080, 0x2c: 0x0080, 0x2d: 0x0008, 0x2e: 0x0008, 0x2f: 0x0080, 0x30: 0x0008, 0x31: 0x0008, 0x32: 0x0008, 0x33: 0x0008, 0x34: 0x0008, 0x35: 0x0008, 0x36: 0x0008, 0x37: 0x0008, 0x38: 0x0008, 0x39: 0x0008, 0x3a: 0x0080, 0x3b: 0x0080, 0x3c: 0x0080, 0x3d: 0x0080, 0x3e: 0x0080, 0x3f: 0x0080, // Block 0x1, offset 0x40 0x40: 0x0080, 0x41: 0xe105, 0x42: 0xe105, 0x43: 0xe105, 0x44: 0xe105, 0x45: 0xe105, 0x46: 0xe105, 0x47: 0xe105, 0x48: 0xe105, 0x49: 0xe105, 0x4a: 0xe105, 0x4b: 0xe105, 0x4c: 0xe105, 0x4d: 0xe105, 0x4e: 0xe105, 0x4f: 0xe105, 0x50: 0xe105, 0x51: 0xe105, 0x52: 0xe105, 0x53: 0xe105, 0x54: 0xe105, 0x55: 0xe105, 0x56: 0xe105, 0x57: 0xe105, 0x58: 0xe105, 0x59: 0xe105, 0x5a: 0xe105, 0x5b: 0x0080, 0x5c: 0x0080, 0x5d: 0x0080, 0x5e: 0x0080, 0x5f: 0x0080, 0x60: 0x0080, 0x61: 0x0008, 0x62: 0x0008, 0x63: 0x0008, 0x64: 0x0008, 0x65: 0x0008, 0x66: 0x0008, 0x67: 0x0008, 0x68: 0x0008, 0x69: 0x0008, 0x6a: 0x0008, 0x6b: 0x0008, 0x6c: 0x0008, 0x6d: 0x0008, 0x6e: 0x0008, 0x6f: 0x0008, 0x70: 0x0008, 0x71: 0x0008, 0x72: 0x0008, 0x73: 0x0008, 0x74: 0x0008, 0x75: 0x0008, 0x76: 0x0008, 0x77: 0x0008, 0x78: 0x0008, 0x79: 0x0008, 0x7a: 0x0008, 0x7b: 0x0080, 0x7c: 0x0080, 0x7d: 0x0080, 0x7e: 0x0080, 0x7f: 0x0080, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x0040, 0xc1: 0x0040, 0xc2: 0x0040, 0xc3: 0x0040, 0xc4: 0x0040, 0xc5: 0x0040, 0xc6: 0x0040, 0xc7: 0x0040, 0xc8: 0x0040, 0xc9: 0x0040, 0xca: 0x0040, 0xcb: 0x0040, 0xcc: 0x0040, 0xcd: 0x0040, 0xce: 0x0040, 0xcf: 0x0040, 0xd0: 0x0040, 0xd1: 0x0040, 0xd2: 0x0040, 0xd3: 0x0040, 0xd4: 0x0040, 0xd5: 0x0040, 0xd6: 0x0040, 0xd7: 0x0040, 0xd8: 0x0040, 0xd9: 0x0040, 0xda: 0x0040, 0xdb: 0x0040, 0xdc: 0x0040, 0xdd: 0x0040, 0xde: 0x0040, 0xdf: 0x0040, 0xe0: 0x000a, 0xe1: 0x0018, 0xe2: 0x0018, 0xe3: 0x0018, 0xe4: 0x0018, 0xe5: 0x0018, 0xe6: 0x0018, 0xe7: 0x0018, 0xe8: 0x001a, 0xe9: 0x0018, 0xea: 0x0039, 0xeb: 0x0018, 0xec: 0x0018, 0xed: 0x03c0, 0xee: 0x0018, 0xef: 0x004a, 0xf0: 0x0018, 0xf1: 0x0018, 0xf2: 0x0069, 0xf3: 0x0079, 0xf4: 0x008a, 0xf5: 0x0005, 0xf6: 0x0018, 0xf7: 0x0008, 0xf8: 0x00aa, 0xf9: 0x00c9, 0xfa: 0x00d9, 0xfb: 0x0018, 0xfc: 0x00e9, 0xfd: 0x0119, 0xfe: 0x0149, 0xff: 0x0018, // Block 0x4, offset 0x100 0x100: 0xe00d, 0x101: 0x0008, 0x102: 0xe00d, 0x103: 0x0008, 0x104: 0xe00d, 0x105: 0x0008, 0x106: 0xe00d, 0x107: 0x0008, 0x108: 0xe00d, 0x109: 0x0008, 0x10a: 0xe00d, 0x10b: 0x0008, 0x10c: 0xe00d, 0x10d: 0x0008, 0x10e: 0xe00d, 0x10f: 0x0008, 0x110: 0xe00d, 0x111: 0x0008, 0x112: 0xe00d, 0x113: 0x0008, 0x114: 0xe00d, 0x115: 0x0008, 0x116: 0xe00d, 0x117: 0x0008, 0x118: 0xe00d, 0x119: 0x0008, 0x11a: 0xe00d, 0x11b: 0x0008, 0x11c: 0xe00d, 0x11d: 0x0008, 0x11e: 0xe00d, 0x11f: 0x0008, 0x120: 0xe00d, 0x121: 0x0008, 0x122: 0xe00d, 0x123: 0x0008, 0x124: 0xe00d, 0x125: 0x0008, 0x126: 0xe00d, 0x127: 0x0008, 0x128: 0xe00d, 0x129: 0x0008, 0x12a: 0xe00d, 0x12b: 0x0008, 0x12c: 0xe00d, 0x12d: 0x0008, 0x12e: 0xe00d, 0x12f: 0x0008, 0x130: 0x0179, 0x131: 0x0008, 0x132: 0x0035, 0x133: 0x004d, 0x134: 0xe00d, 0x135: 0x0008, 0x136: 0xe00d, 0x137: 0x0008, 0x138: 0x0008, 0x139: 0xe01d, 0x13a: 0x0008, 0x13b: 0xe03d, 0x13c: 0x0008, 0x13d: 0xe01d, 0x13e: 0x0008, 0x13f: 0x0199, // Block 0x5, offset 0x140 0x140: 0x0199, 0x141: 0xe01d, 0x142: 0x0008, 0x143: 0xe03d, 0x144: 0x0008, 0x145: 0xe01d, 0x146: 0x0008, 0x147: 0xe07d, 0x148: 0x0008, 0x149: 0x01b9, 0x14a: 0xe00d, 0x14b: 0x0008, 0x14c: 0xe00d, 0x14d: 0x0008, 0x14e: 0xe00d, 0x14f: 0x0008, 0x150: 0xe00d, 0x151: 0x0008, 0x152: 0xe00d, 0x153: 0x0008, 0x154: 0xe00d, 0x155: 0x0008, 0x156: 0xe00d, 0x157: 0x0008, 0x158: 0xe00d, 0x159: 0x0008, 0x15a: 0xe00d, 0x15b: 0x0008, 0x15c: 0xe00d, 0x15d: 0x0008, 0x15e: 0xe00d, 0x15f: 0x0008, 0x160: 0xe00d, 0x161: 0x0008, 0x162: 0xe00d, 0x163: 0x0008, 0x164: 0xe00d, 0x165: 0x0008, 0x166: 0xe00d, 0x167: 0x0008, 0x168: 0xe00d, 0x169: 0x0008, 0x16a: 0xe00d, 0x16b: 0x0008, 0x16c: 0xe00d, 0x16d: 0x0008, 0x16e: 0xe00d, 0x16f: 0x0008, 0x170: 0xe00d, 0x171: 0x0008, 0x172: 0xe00d, 0x173: 0x0008, 0x174: 0xe00d, 0x175: 0x0008, 0x176: 0xe00d, 0x177: 0x0008, 0x178: 0x0065, 0x179: 0xe01d, 0x17a: 0x0008, 0x17b: 0xe03d, 0x17c: 0x0008, 0x17d: 0xe01d, 0x17e: 0x0008, 0x17f: 0x01d9, // Block 0x6, offset 0x180 0x180: 0x0008, 0x181: 0x007d, 0x182: 0xe00d, 0x183: 0x0008, 0x184: 0xe00d, 0x185: 0x0008, 0x186: 0x007d, 0x187: 0xe07d, 0x188: 0x0008, 0x189: 0x0095, 0x18a: 0x00ad, 0x18b: 0xe03d, 0x18c: 0x0008, 0x18d: 0x0008, 0x18e: 0x00c5, 0x18f: 0x00dd, 0x190: 0x00f5, 0x191: 0xe01d, 0x192: 0x0008, 0x193: 0x010d, 0x194: 0x0125, 0x195: 0x0008, 0x196: 0x013d, 0x197: 0x013d, 0x198: 0xe00d, 0x199: 0x0008, 0x19a: 0x0008, 0x19b: 0x0008, 0x19c: 0x010d, 0x19d: 0x0155, 0x19e: 0x0008, 0x19f: 0x016d, 0x1a0: 0xe00d, 0x1a1: 0x0008, 0x1a2: 0xe00d, 0x1a3: 0x0008, 0x1a4: 0xe00d, 0x1a5: 0x0008, 0x1a6: 0x0185, 0x1a7: 0xe07d, 0x1a8: 0x0008, 0x1a9: 0x019d, 0x1aa: 0x0008, 0x1ab: 0x0008, 0x1ac: 0xe00d, 0x1ad: 0x0008, 0x1ae: 0x0185, 0x1af: 0xe0fd, 0x1b0: 0x0008, 0x1b1: 0x01b5, 0x1b2: 0x01cd, 0x1b3: 0xe03d, 0x1b4: 0x0008, 0x1b5: 0xe01d, 0x1b6: 0x0008, 0x1b7: 0x01e5, 0x1b8: 0xe00d, 0x1b9: 0x0008, 0x1ba: 0x0008, 0x1bb: 0x0008, 0x1bc: 0xe00d, 0x1bd: 0x0008, 0x1be: 0x0008, 0x1bf: 0x0008, // Block 0x7, offset 0x1c0 0x1c0: 0x0008, 0x1c1: 0x0008, 0x1c2: 0x0008, 0x1c3: 0x0008, 0x1c4: 0x01e9, 0x1c5: 0x01e9, 0x1c6: 0x01e9, 0x1c7: 0x01fd, 0x1c8: 0x0215, 0x1c9: 0x022d, 0x1ca: 0x0245, 0x1cb: 0x025d, 0x1cc: 0x0275, 0x1cd: 0xe01d, 0x1ce: 0x0008, 0x1cf: 0xe0fd, 0x1d0: 0x0008, 0x1d1: 0xe01d, 0x1d2: 0x0008, 0x1d3: 0xe03d, 0x1d4: 0x0008, 0x1d5: 0xe01d, 0x1d6: 0x0008, 0x1d7: 0xe07d, 0x1d8: 0x0008, 0x1d9: 0xe01d, 0x1da: 0x0008, 0x1db: 0xe03d, 0x1dc: 0x0008, 0x1dd: 0x0008, 0x1de: 0xe00d, 0x1df: 0x0008, 0x1e0: 0xe00d, 0x1e1: 0x0008, 0x1e2: 0xe00d, 0x1e3: 0x0008, 0x1e4: 0xe00d, 0x1e5: 0x0008, 0x1e6: 0xe00d, 0x1e7: 0x0008, 0x1e8: 0xe00d, 0x1e9: 0x0008, 0x1ea: 0xe00d, 0x1eb: 0x0008, 0x1ec: 0xe00d, 0x1ed: 0x0008, 0x1ee: 0xe00d, 0x1ef: 0x0008, 0x1f0: 0x0008, 0x1f1: 0x028d, 0x1f2: 0x02a5, 0x1f3: 0x02bd, 0x1f4: 0xe00d, 0x1f5: 0x0008, 0x1f6: 0x02d5, 0x1f7: 0x02ed, 0x1f8: 0xe00d, 0x1f9: 0x0008, 0x1fa: 0xe00d, 0x1fb: 0x0008, 0x1fc: 0xe00d, 0x1fd: 0x0008, 0x1fe: 0xe00d, 0x1ff: 0x0008, // Block 0x8, offset 0x200 0x200: 0xe00d, 0x201: 0x0008, 0x202: 0xe00d, 0x203: 0x0008, 0x204: 0xe00d, 0x205: 0x0008, 0x206: 0xe00d, 0x207: 0x0008, 0x208: 0xe00d, 0x209: 0x0008, 0x20a: 0xe00d, 0x20b: 0x0008, 0x20c: 0xe00d, 0x20d: 0x0008, 0x20e: 0xe00d, 0x20f: 0x0008, 0x210: 0xe00d, 0x211: 0x0008, 0x212: 0xe00d, 0x213: 0x0008, 0x214: 0xe00d, 0x215: 0x0008, 0x216: 0xe00d, 0x217: 0x0008, 0x218: 0xe00d, 0x219: 0x0008, 0x21a: 0xe00d, 0x21b: 0x0008, 0x21c: 0xe00d, 0x21d: 0x0008, 0x21e: 0xe00d, 0x21f: 0x0008, 0x220: 0x0305, 0x221: 0x0008, 0x222: 0xe00d, 0x223: 0x0008, 0x224: 0xe00d, 0x225: 0x0008, 0x226: 0xe00d, 0x227: 0x0008, 0x228: 0xe00d, 0x229: 0x0008, 0x22a: 0xe00d, 0x22b: 0x0008, 0x22c: 0xe00d, 0x22d: 0x0008, 0x22e: 0xe00d, 0x22f: 0x0008, 0x230: 0xe00d, 0x231: 0x0008, 0x232: 0xe00d, 0x233: 0x0008, 0x234: 0x0008, 0x235: 0x0008, 0x236: 0x0008, 0x237: 0x0008, 0x238: 0x0008, 0x239: 0x0008, 0x23a: 0x0209, 0x23b: 0xe03d, 0x23c: 0x0008, 0x23d: 0x031d, 0x23e: 0x0229, 0x23f: 0x0008, // Block 0x9, offset 0x240 0x240: 0x0008, 0x241: 0x0008, 0x242: 0x0018, 0x243: 0x0018, 0x244: 0x0018, 0x245: 0x0018, 0x246: 0x0008, 0x247: 0x0008, 0x248: 0x0008, 0x249: 0x0008, 0x24a: 0x0008, 0x24b: 0x0008, 0x24c: 0x0008, 0x24d: 0x0008, 0x24e: 0x0008, 0x24f: 0x0008, 0x250: 0x0008, 0x251: 0x0008, 0x252: 0x0018, 0x253: 0x0018, 0x254: 0x0018, 0x255: 0x0018, 0x256: 0x0018, 0x257: 0x0018, 0x258: 0x029a, 0x259: 0x02ba, 0x25a: 0x02da, 0x25b: 0x02fa, 0x25c: 0x031a, 0x25d: 0x033a, 0x25e: 0x0018, 0x25f: 0x0018, 0x260: 0x03ad, 0x261: 0x0359, 0x262: 0x01d9, 0x263: 0x0369, 0x264: 0x03c5, 0x265: 0x0018, 0x266: 0x0018, 0x267: 0x0018, 0x268: 0x0018, 0x269: 0x0018, 0x26a: 0x0018, 0x26b: 0x0018, 0x26c: 0x0008, 0x26d: 0x0018, 0x26e: 0x0008, 0x26f: 0x0018, 0x270: 0x0018, 0x271: 0x0018, 0x272: 0x0018, 0x273: 0x0018, 0x274: 0x0018, 0x275: 0x0018, 0x276: 0x0018, 0x277: 0x0018, 0x278: 0x0018, 0x279: 0x0018, 0x27a: 0x0018, 0x27b: 0x0018, 0x27c: 0x0018, 0x27d: 0x0018, 0x27e: 0x0018, 0x27f: 0x0018, // Block 0xa, offset 0x280 0x280: 0x03dd, 0x281: 0x03dd, 0x282: 0x3308, 0x283: 0x03f5, 0x284: 0x0379, 0x285: 0x040d, 0x286: 0x3308, 0x287: 0x3308, 0x288: 0x3308, 0x289: 0x3308, 0x28a: 0x3308, 0x28b: 0x3308, 0x28c: 0x3308, 0x28d: 0x3308, 0x28e: 0x3308, 0x28f: 0x33c0, 0x290: 0x3308, 0x291: 0x3308, 0x292: 0x3308, 0x293: 0x3308, 0x294: 0x3308, 0x295: 0x3308, 0x296: 0x3308, 0x297: 0x3308, 0x298: 0x3308, 0x299: 0x3308, 0x29a: 0x3308, 0x29b: 0x3308, 0x29c: 0x3308, 0x29d: 0x3308, 0x29e: 0x3308, 0x29f: 0x3308, 0x2a0: 0x3308, 0x2a1: 0x3308, 0x2a2: 0x3308, 0x2a3: 0x3308, 0x2a4: 0x3308, 0x2a5: 0x3308, 0x2a6: 0x3308, 0x2a7: 0x3308, 0x2a8: 0x3308, 0x2a9: 0x3308, 0x2aa: 0x3308, 0x2ab: 0x3308, 0x2ac: 0x3308, 0x2ad: 0x3308, 0x2ae: 0x3308, 0x2af: 0x3308, 0x2b0: 0xe00d, 0x2b1: 0x0008, 0x2b2: 0xe00d, 0x2b3: 0x0008, 0x2b4: 0x0425, 0x2b5: 0x0008, 0x2b6: 0xe00d, 0x2b7: 0x0008, 0x2b8: 0x0040, 0x2b9: 0x0040, 0x2ba: 0x03a2, 0x2bb: 0x0008, 0x2bc: 0x0008, 0x2bd: 0x0008, 0x2be: 0x03c2, 0x2bf: 0x043d, // Block 0xb, offset 0x2c0 0x2c0: 0x0040, 0x2c1: 0x0040, 0x2c2: 0x0040, 0x2c3: 0x0040, 0x2c4: 0x008a, 0x2c5: 0x03d2, 0x2c6: 0xe155, 0x2c7: 0x0455, 0x2c8: 0xe12d, 0x2c9: 0xe13d, 0x2ca: 0xe12d, 0x2cb: 0x0040, 0x2cc: 0x03dd, 0x2cd: 0x0040, 0x2ce: 0x046d, 0x2cf: 0x0485, 0x2d0: 0x0008, 0x2d1: 0xe105, 0x2d2: 0xe105, 0x2d3: 0xe105, 0x2d4: 0xe105, 0x2d5: 0xe105, 0x2d6: 0xe105, 0x2d7: 0xe105, 0x2d8: 0xe105, 0x2d9: 0xe105, 0x2da: 0xe105, 0x2db: 0xe105, 0x2dc: 0xe105, 0x2dd: 0xe105, 0x2de: 0xe105, 0x2df: 0xe105, 0x2e0: 0x049d, 0x2e1: 0x049d, 0x2e2: 0x0040, 0x2e3: 0x049d, 0x2e4: 0x049d, 0x2e5: 0x049d, 0x2e6: 0x049d, 0x2e7: 0x049d, 0x2e8: 0x049d, 0x2e9: 0x049d, 0x2ea: 0x049d, 0x2eb: 0x049d, 0x2ec: 0x0008, 0x2ed: 0x0008, 0x2ee: 0x0008, 0x2ef: 0x0008, 0x2f0: 0x0008, 0x2f1: 0x0008, 0x2f2: 0x0008, 0x2f3: 0x0008, 0x2f4: 0x0008, 0x2f5: 0x0008, 0x2f6: 0x0008, 0x2f7: 0x0008, 0x2f8: 0x0008, 0x2f9: 0x0008, 0x2fa: 0x0008, 0x2fb: 0x0008, 0x2fc: 0x0008, 0x2fd: 0x0008, 0x2fe: 0x0008, 0x2ff: 0x0008, // Block 0xc, offset 0x300 0x300: 0x0008, 0x301: 0x0008, 0x302: 0xe00f, 0x303: 0x0008, 0x304: 0x0008, 0x305: 0x0008, 0x306: 0x0008, 0x307: 0x0008, 0x308: 0x0008, 0x309: 0x0008, 0x30a: 0x0008, 0x30b: 0x0008, 0x30c: 0x0008, 0x30d: 0x0008, 0x30e: 0x0008, 0x30f: 0xe0c5, 0x310: 0x04b5, 0x311: 0x04cd, 0x312: 0xe0bd, 0x313: 0xe0f5, 0x314: 0xe0fd, 0x315: 0xe09d, 0x316: 0xe0b5, 0x317: 0x0008, 0x318: 0xe00d, 0x319: 0x0008, 0x31a: 0xe00d, 0x31b: 0x0008, 0x31c: 0xe00d, 0x31d: 0x0008, 0x31e: 0xe00d, 0x31f: 0x0008, 0x320: 0xe00d, 0x321: 0x0008, 0x322: 0xe00d, 0x323: 0x0008, 0x324: 0xe00d, 0x325: 0x0008, 0x326: 0xe00d, 0x327: 0x0008, 0x328: 0xe00d, 0x329: 0x0008, 0x32a: 0xe00d, 0x32b: 0x0008, 0x32c: 0xe00d, 0x32d: 0x0008, 0x32e: 0xe00d, 0x32f: 0x0008, 0x330: 0x04e5, 0x331: 0xe185, 0x332: 0xe18d, 0x333: 0x0008, 0x334: 0x04fd, 0x335: 0x03dd, 0x336: 0x0018, 0x337: 0xe07d, 0x338: 0x0008, 0x339: 0xe1d5, 0x33a: 0xe00d, 0x33b: 0x0008, 0x33c: 0x0008, 0x33d: 0x0515, 0x33e: 0x052d, 0x33f: 0x052d, // Block 0xd, offset 0x340 0x340: 0x0008, 0x341: 0x0008, 0x342: 0x0008, 0x343: 0x0008, 0x344: 0x0008, 0x345: 0x0008, 0x346: 0x0008, 0x347: 0x0008, 0x348: 0x0008, 0x349: 0x0008, 0x34a: 0x0008, 0x34b: 0x0008, 0x34c: 0x0008, 0x34d: 0x0008, 0x34e: 0x0008, 0x34f: 0x0008, 0x350: 0x0008, 0x351: 0x0008, 0x352: 0x0008, 0x353: 0x0008, 0x354: 0x0008, 0x355: 0x0008, 0x356: 0x0008, 0x357: 0x0008, 0x358: 0x0008, 0x359: 0x0008, 0x35a: 0x0008, 0x35b: 0x0008, 0x35c: 0x0008, 0x35d: 0x0008, 0x35e: 0x0008, 0x35f: 0x0008, 0x360: 0xe00d, 0x361: 0x0008, 0x362: 0xe00d, 0x363: 0x0008, 0x364: 0xe00d, 0x365: 0x0008, 0x366: 0xe00d, 0x367: 0x0008, 0x368: 0xe00d, 0x369: 0x0008, 0x36a: 0xe00d, 0x36b: 0x0008, 0x36c: 0xe00d, 0x36d: 0x0008, 0x36e: 0xe00d, 0x36f: 0x0008, 0x370: 0xe00d, 0x371: 0x0008, 0x372: 0xe00d, 0x373: 0x0008, 0x374: 0xe00d, 0x375: 0x0008, 0x376: 0xe00d, 0x377: 0x0008, 0x378: 0xe00d, 0x379: 0x0008, 0x37a: 0xe00d, 0x37b: 0x0008, 0x37c: 0xe00d, 0x37d: 0x0008, 0x37e: 0xe00d, 0x37f: 0x0008, // Block 0xe, offset 0x380 0x380: 0xe00d, 0x381: 0x0008, 0x382: 0x0018, 0x383: 0x3308, 0x384: 0x3308, 0x385: 0x3308, 0x386: 0x3308, 0x387: 0x3308, 0x388: 0x3318, 0x389: 0x3318, 0x38a: 0xe00d, 0x38b: 0x0008, 0x38c: 0xe00d, 0x38d: 0x0008, 0x38e: 0xe00d, 0x38f: 0x0008, 0x390: 0xe00d, 0x391: 0x0008, 0x392: 0xe00d, 0x393: 0x0008, 0x394: 0xe00d, 0x395: 0x0008, 0x396: 0xe00d, 0x397: 0x0008, 0x398: 0xe00d, 0x399: 0x0008, 0x39a: 0xe00d, 0x39b: 0x0008, 0x39c: 0xe00d, 0x39d: 0x0008, 0x39e: 0xe00d, 0x39f: 0x0008, 0x3a0: 0xe00d, 0x3a1: 0x0008, 0x3a2: 0xe00d, 0x3a3: 0x0008, 0x3a4: 0xe00d, 0x3a5: 0x0008, 0x3a6: 0xe00d, 0x3a7: 0x0008, 0x3a8: 0xe00d, 0x3a9: 0x0008, 0x3aa: 0xe00d, 0x3ab: 0x0008, 0x3ac: 0xe00d, 0x3ad: 0x0008, 0x3ae: 0xe00d, 0x3af: 0x0008, 0x3b0: 0xe00d, 0x3b1: 0x0008, 0x3b2: 0xe00d, 0x3b3: 0x0008, 0x3b4: 0xe00d, 0x3b5: 0x0008, 0x3b6: 0xe00d, 0x3b7: 0x0008, 0x3b8: 0xe00d, 0x3b9: 0x0008, 0x3ba: 0xe00d, 0x3bb: 0x0008, 0x3bc: 0xe00d, 0x3bd: 0x0008, 0x3be: 0xe00d, 0x3bf: 0x0008, // Block 0xf, offset 0x3c0 0x3c0: 0x0040, 0x3c1: 0xe01d, 0x3c2: 0x0008, 0x3c3: 0xe03d, 0x3c4: 0x0008, 0x3c5: 0xe01d, 0x3c6: 0x0008, 0x3c7: 0xe07d, 0x3c8: 0x0008, 0x3c9: 0xe01d, 0x3ca: 0x0008, 0x3cb: 0xe03d, 0x3cc: 0x0008, 0x3cd: 0xe01d, 0x3ce: 0x0008, 0x3cf: 0x0008, 0x3d0: 0xe00d, 0x3d1: 0x0008, 0x3d2: 0xe00d, 0x3d3: 0x0008, 0x3d4: 0xe00d, 0x3d5: 0x0008, 0x3d6: 0xe00d, 0x3d7: 0x0008, 0x3d8: 0xe00d, 0x3d9: 0x0008, 0x3da: 0xe00d, 0x3db: 0x0008, 0x3dc: 0xe00d, 0x3dd: 0x0008, 0x3de: 0xe00d, 0x3df: 0x0008, 0x3e0: 0xe00d, 0x3e1: 0x0008, 0x3e2: 0xe00d, 0x3e3: 0x0008, 0x3e4: 0xe00d, 0x3e5: 0x0008, 0x3e6: 0xe00d, 0x3e7: 0x0008, 0x3e8: 0xe00d, 0x3e9: 0x0008, 0x3ea: 0xe00d, 0x3eb: 0x0008, 0x3ec: 0xe00d, 0x3ed: 0x0008, 0x3ee: 0xe00d, 0x3ef: 0x0008, 0x3f0: 0xe00d, 0x3f1: 0x0008, 0x3f2: 0xe00d, 0x3f3: 0x0008, 0x3f4: 0xe00d, 0x3f5: 0x0008, 0x3f6: 0xe00d, 0x3f7: 0x0008, 0x3f8: 0xe00d, 0x3f9: 0x0008, 0x3fa: 0xe00d, 0x3fb: 0x0008, 0x3fc: 0xe00d, 0x3fd: 0x0008, 0x3fe: 0xe00d, 0x3ff: 0x0008, // Block 0x10, offset 0x400 0x400: 0xe00d, 0x401: 0x0008, 0x402: 0xe00d, 0x403: 0x0008, 0x404: 0xe00d, 0x405: 0x0008, 0x406: 0xe00d, 0x407: 0x0008, 0x408: 0xe00d, 0x409: 0x0008, 0x40a: 0xe00d, 0x40b: 0x0008, 0x40c: 0xe00d, 0x40d: 0x0008, 0x40e: 0xe00d, 0x40f: 0x0008, 0x410: 0xe00d, 0x411: 0x0008, 0x412: 0xe00d, 0x413: 0x0008, 0x414: 0xe00d, 0x415: 0x0008, 0x416: 0xe00d, 0x417: 0x0008, 0x418: 0xe00d, 0x419: 0x0008, 0x41a: 0xe00d, 0x41b: 0x0008, 0x41c: 0xe00d, 0x41d: 0x0008, 0x41e: 0xe00d, 0x41f: 0x0008, 0x420: 0xe00d, 0x421: 0x0008, 0x422: 0xe00d, 0x423: 0x0008, 0x424: 0xe00d, 0x425: 0x0008, 0x426: 0xe00d, 0x427: 0x0008, 0x428: 0xe00d, 0x429: 0x0008, 0x42a: 0xe00d, 0x42b: 0x0008, 0x42c: 0xe00d, 0x42d: 0x0008, 0x42e: 0xe00d, 0x42f: 0x0008, 0x430: 0x0040, 0x431: 0x03f5, 0x432: 0x03f5, 0x433: 0x03f5, 0x434: 0x03f5, 0x435: 0x03f5, 0x436: 0x03f5, 0x437: 0x03f5, 0x438: 0x03f5, 0x439: 0x03f5, 0x43a: 0x03f5, 0x43b: 0x03f5, 0x43c: 0x03f5, 0x43d: 0x03f5, 0x43e: 0x03f5, 0x43f: 0x03f5, // Block 0x11, offset 0x440 0x440: 0x0840, 0x441: 0x0840, 0x442: 0x0840, 0x443: 0x0840, 0x444: 0x0840, 0x445: 0x0840, 0x446: 0x0018, 0x447: 0x0018, 0x448: 0x0818, 0x449: 0x0018, 0x44a: 0x0018, 0x44b: 0x0818, 0x44c: 0x0018, 0x44d: 0x0818, 0x44e: 0x0018, 0x44f: 0x0018, 0x450: 0x3308, 0x451: 0x3308, 0x452: 0x3308, 0x453: 0x3308, 0x454: 0x3308, 0x455: 0x3308, 0x456: 0x3308, 0x457: 0x3308, 0x458: 0x3308, 0x459: 0x3308, 0x45a: 0x3308, 0x45b: 0x0818, 0x45c: 0x0b40, 0x45d: 0x0040, 0x45e: 0x0818, 0x45f: 0x0818, 0x460: 0x0a08, 0x461: 0x0808, 0x462: 0x0c08, 0x463: 0x0c08, 0x464: 0x0c08, 0x465: 0x0c08, 0x466: 0x0a08, 0x467: 0x0c08, 0x468: 0x0a08, 0x469: 0x0c08, 0x46a: 0x0a08, 0x46b: 0x0a08, 0x46c: 0x0a08, 0x46d: 0x0a08, 0x46e: 0x0a08, 0x46f: 0x0c08, 0x470: 0x0c08, 0x471: 0x0c08, 0x472: 0x0c08, 0x473: 0x0a08, 0x474: 0x0a08, 0x475: 0x0a08, 0x476: 0x0a08, 0x477: 0x0a08, 0x478: 0x0a08, 0x479: 0x0a08, 0x47a: 0x0a08, 0x47b: 0x0a08, 0x47c: 0x0a08, 0x47d: 0x0a08, 0x47e: 0x0a08, 0x47f: 0x0a08, // Block 0x12, offset 0x480 0x480: 0x0818, 0x481: 0x0a08, 0x482: 0x0a08, 0x483: 0x0a08, 0x484: 0x0a08, 0x485: 0x0a08, 0x486: 0x0a08, 0x487: 0x0a08, 0x488: 0x0c08, 0x489: 0x0a08, 0x48a: 0x0a08, 0x48b: 0x3308, 0x48c: 0x3308, 0x48d: 0x3308, 0x48e: 0x3308, 0x48f: 0x3308, 0x490: 0x3308, 0x491: 0x3308, 0x492: 0x3308, 0x493: 0x3308, 0x494: 0x3308, 0x495: 0x3308, 0x496: 0x3308, 0x497: 0x3308, 0x498: 0x3308, 0x499: 0x3308, 0x49a: 0x3308, 0x49b: 0x3308, 0x49c: 0x3308, 0x49d: 0x3308, 0x49e: 0x3308, 0x49f: 0x3308, 0x4a0: 0x0808, 0x4a1: 0x0808, 0x4a2: 0x0808, 0x4a3: 0x0808, 0x4a4: 0x0808, 0x4a5: 0x0808, 0x4a6: 0x0808, 0x4a7: 0x0808, 0x4a8: 0x0808, 0x4a9: 0x0808, 0x4aa: 0x0018, 0x4ab: 0x0818, 0x4ac: 0x0818, 0x4ad: 0x0818, 0x4ae: 0x0a08, 0x4af: 0x0a08, 0x4b0: 0x3308, 0x4b1: 0x0c08, 0x4b2: 0x0c08, 0x4b3: 0x0c08, 0x4b4: 0x0808, 0x4b5: 0x0429, 0x4b6: 0x0451, 0x4b7: 0x0479, 0x4b8: 0x04a1, 0x4b9: 0x0a08, 0x4ba: 0x0a08, 0x4bb: 0x0a08, 0x4bc: 0x0a08, 0x4bd: 0x0a08, 0x4be: 0x0a08, 0x4bf: 0x0a08, // Block 0x13, offset 0x4c0 0x4c0: 0x0c08, 0x4c1: 0x0a08, 0x4c2: 0x0a08, 0x4c3: 0x0c08, 0x4c4: 0x0c08, 0x4c5: 0x0c08, 0x4c6: 0x0c08, 0x4c7: 0x0c08, 0x4c8: 0x0c08, 0x4c9: 0x0c08, 0x4ca: 0x0c08, 0x4cb: 0x0c08, 0x4cc: 0x0a08, 0x4cd: 0x0c08, 0x4ce: 0x0a08, 0x4cf: 0x0c08, 0x4d0: 0x0a08, 0x4d1: 0x0a08, 0x4d2: 0x0c08, 0x4d3: 0x0c08, 0x4d4: 0x0818, 0x4d5: 0x0c08, 0x4d6: 0x3308, 0x4d7: 0x3308, 0x4d8: 0x3308, 0x4d9: 0x3308, 0x4da: 0x3308, 0x4db: 0x3308, 0x4dc: 0x3308, 0x4dd: 0x0840, 0x4de: 0x0018, 0x4df: 0x3308, 0x4e0: 0x3308, 0x4e1: 0x3308, 0x4e2: 0x3308, 0x4e3: 0x3308, 0x4e4: 0x3308, 0x4e5: 0x0808, 0x4e6: 0x0808, 0x4e7: 0x3308, 0x4e8: 0x3308, 0x4e9: 0x0018, 0x4ea: 0x3308, 0x4eb: 0x3308, 0x4ec: 0x3308, 0x4ed: 0x3308, 0x4ee: 0x0c08, 0x4ef: 0x0c08, 0x4f0: 0x0008, 0x4f1: 0x0008, 0x4f2: 0x0008, 0x4f3: 0x0008, 0x4f4: 0x0008, 0x4f5: 0x0008, 0x4f6: 0x0008, 0x4f7: 0x0008, 0x4f8: 0x0008, 0x4f9: 0x0008, 0x4fa: 0x0a08, 0x4fb: 0x0a08, 0x4fc: 0x0a08, 0x4fd: 0x0808, 0x4fe: 0x0808, 0x4ff: 0x0a08, // Block 0x14, offset 0x500 0x500: 0x0818, 0x501: 0x0818, 0x502: 0x0818, 0x503: 0x0818, 0x504: 0x0818, 0x505: 0x0818, 0x506: 0x0818, 0x507: 0x0818, 0x508: 0x0818, 0x509: 0x0818, 0x50a: 0x0818, 0x50b: 0x0818, 0x50c: 0x0818, 0x50d: 0x0818, 0x50e: 0x0040, 0x50f: 0x0b40, 0x510: 0x0c08, 0x511: 0x3308, 0x512: 0x0a08, 0x513: 0x0a08, 0x514: 0x0a08, 0x515: 0x0c08, 0x516: 0x0c08, 0x517: 0x0c08, 0x518: 0x0c08, 0x519: 0x0c08, 0x51a: 0x0a08, 0x51b: 0x0a08, 0x51c: 0x0a08, 0x51d: 0x0a08, 0x51e: 0x0c08, 0x51f: 0x0a08, 0x520: 0x0a08, 0x521: 0x0a08, 0x522: 0x0a08, 0x523: 0x0a08, 0x524: 0x0a08, 0x525: 0x0a08, 0x526: 0x0a08, 0x527: 0x0a08, 0x528: 0x0c08, 0x529: 0x0a08, 0x52a: 0x0c08, 0x52b: 0x0a08, 0x52c: 0x0c08, 0x52d: 0x0a08, 0x52e: 0x0a08, 0x52f: 0x0c08, 0x530: 0x3308, 0x531: 0x3308, 0x532: 0x3308, 0x533: 0x3308, 0x534: 0x3308, 0x535: 0x3308, 0x536: 0x3308, 0x537: 0x3308, 0x538: 0x3308, 0x539: 0x3308, 0x53a: 0x3308, 0x53b: 0x3308, 0x53c: 0x3308, 0x53d: 0x3308, 0x53e: 0x3308, 0x53f: 0x3308, // Block 0x15, offset 0x540 0x540: 0x0c08, 0x541: 0x0a08, 0x542: 0x0a08, 0x543: 0x0a08, 0x544: 0x0a08, 0x545: 0x0a08, 0x546: 0x0c08, 0x547: 0x0c08, 0x548: 0x0a08, 0x549: 0x0c08, 0x54a: 0x0a08, 0x54b: 0x0a08, 0x54c: 0x0a08, 0x54d: 0x0a08, 0x54e: 0x0a08, 0x54f: 0x0a08, 0x550: 0x0a08, 0x551: 0x0a08, 0x552: 0x0a08, 0x553: 0x0a08, 0x554: 0x0c08, 0x555: 0x0a08, 0x556: 0x0808, 0x557: 0x0808, 0x558: 0x0808, 0x559: 0x3308, 0x55a: 0x3308, 0x55b: 0x3308, 0x55c: 0x0040, 0x55d: 0x0040, 0x55e: 0x0818, 0x55f: 0x0040, 0x560: 0x0a08, 0x561: 0x0808, 0x562: 0x0a08, 0x563: 0x0a08, 0x564: 0x0a08, 0x565: 0x0a08, 0x566: 0x0808, 0x567: 0x0c08, 0x568: 0x0a08, 0x569: 0x0c08, 0x56a: 0x0c08, 0x56b: 0x0040, 0x56c: 0x0040, 0x56d: 0x0040, 0x56e: 0x0040, 0x56f: 0x0040, 0x570: 0x0040, 0x571: 0x0040, 0x572: 0x0040, 0x573: 0x0040, 0x574: 0x0040, 0x575: 0x0040, 0x576: 0x0040, 0x577: 0x0040, 0x578: 0x0040, 0x579: 0x0040, 0x57a: 0x0040, 0x57b: 0x0040, 0x57c: 0x0040, 0x57d: 0x0040, 0x57e: 0x0040, 0x57f: 0x0040, // Block 0x16, offset 0x580 0x580: 0x3008, 0x581: 0x3308, 0x582: 0x3308, 0x583: 0x3308, 0x584: 0x3308, 0x585: 0x3308, 0x586: 0x3308, 0x587: 0x3308, 0x588: 0x3308, 0x589: 0x3008, 0x58a: 0x3008, 0x58b: 0x3008, 0x58c: 0x3008, 0x58d: 0x3b08, 0x58e: 0x3008, 0x58f: 0x3008, 0x590: 0x0008, 0x591: 0x3308, 0x592: 0x3308, 0x593: 0x3308, 0x594: 0x3308, 0x595: 0x3308, 0x596: 0x3308, 0x597: 0x3308, 0x598: 0x04c9, 0x599: 0x0501, 0x59a: 0x0539, 0x59b: 0x0571, 0x59c: 0x05a9, 0x59d: 0x05e1, 0x59e: 0x0619, 0x59f: 0x0651, 0x5a0: 0x0008, 0x5a1: 0x0008, 0x5a2: 0x3308, 0x5a3: 0x3308, 0x5a4: 0x0018, 0x5a5: 0x0018, 0x5a6: 0x0008, 0x5a7: 0x0008, 0x5a8: 0x0008, 0x5a9: 0x0008, 0x5aa: 0x0008, 0x5ab: 0x0008, 0x5ac: 0x0008, 0x5ad: 0x0008, 0x5ae: 0x0008, 0x5af: 0x0008, 0x5b0: 0x0018, 0x5b1: 0x0008, 0x5b2: 0x0008, 0x5b3: 0x0008, 0x5b4: 0x0008, 0x5b5: 0x0008, 0x5b6: 0x0008, 0x5b7: 0x0008, 0x5b8: 0x0008, 0x5b9: 0x0008, 0x5ba: 0x0008, 0x5bb: 0x0008, 0x5bc: 0x0008, 0x5bd: 0x0008, 0x5be: 0x0008, 0x5bf: 0x0008, // Block 0x17, offset 0x5c0 0x5c0: 0x0008, 0x5c1: 0x3308, 0x5c2: 0x3008, 0x5c3: 0x3008, 0x5c4: 0x0040, 0x5c5: 0x0008, 0x5c6: 0x0008, 0x5c7: 0x0008, 0x5c8: 0x0008, 0x5c9: 0x0008, 0x5ca: 0x0008, 0x5cb: 0x0008, 0x5cc: 0x0008, 0x5cd: 0x0040, 0x5ce: 0x0040, 0x5cf: 0x0008, 0x5d0: 0x0008, 0x5d1: 0x0040, 0x5d2: 0x0040, 0x5d3: 0x0008, 0x5d4: 0x0008, 0x5d5: 0x0008, 0x5d6: 0x0008, 0x5d7: 0x0008, 0x5d8: 0x0008, 0x5d9: 0x0008, 0x5da: 0x0008, 0x5db: 0x0008, 0x5dc: 0x0008, 0x5dd: 0x0008, 0x5de: 0x0008, 0x5df: 0x0008, 0x5e0: 0x0008, 0x5e1: 0x0008, 0x5e2: 0x0008, 0x5e3: 0x0008, 0x5e4: 0x0008, 0x5e5: 0x0008, 0x5e6: 0x0008, 0x5e7: 0x0008, 0x5e8: 0x0008, 0x5e9: 0x0040, 0x5ea: 0x0008, 0x5eb: 0x0008, 0x5ec: 0x0008, 0x5ed: 0x0008, 0x5ee: 0x0008, 0x5ef: 0x0008, 0x5f0: 0x0008, 0x5f1: 0x0040, 0x5f2: 0x0008, 0x5f3: 0x0040, 0x5f4: 0x0040, 0x5f5: 0x0040, 0x5f6: 0x0008, 0x5f7: 0x0008, 0x5f8: 0x0008, 0x5f9: 0x0008, 0x5fa: 0x0040, 0x5fb: 0x0040, 0x5fc: 0x3308, 0x5fd: 0x0008, 0x5fe: 0x3008, 0x5ff: 0x3008, // Block 0x18, offset 0x600 0x600: 0x3008, 0x601: 0x3308, 0x602: 0x3308, 0x603: 0x3308, 0x604: 0x3308, 0x605: 0x0040, 0x606: 0x0040, 0x607: 0x3008, 0x608: 0x3008, 0x609: 0x0040, 0x60a: 0x0040, 0x60b: 0x3008, 0x60c: 0x3008, 0x60d: 0x3b08, 0x60e: 0x0008, 0x60f: 0x0040, 0x610: 0x0040, 0x611: 0x0040, 0x612: 0x0040, 0x613: 0x0040, 0x614: 0x0040, 0x615: 0x0040, 0x616: 0x0040, 0x617: 0x3008, 0x618: 0x0040, 0x619: 0x0040, 0x61a: 0x0040, 0x61b: 0x0040, 0x61c: 0x0689, 0x61d: 0x06c1, 0x61e: 0x0040, 0x61f: 0x06f9, 0x620: 0x0008, 0x621: 0x0008, 0x622: 0x3308, 0x623: 0x3308, 0x624: 0x0040, 0x625: 0x0040, 0x626: 0x0008, 0x627: 0x0008, 0x628: 0x0008, 0x629: 0x0008, 0x62a: 0x0008, 0x62b: 0x0008, 0x62c: 0x0008, 0x62d: 0x0008, 0x62e: 0x0008, 0x62f: 0x0008, 0x630: 0x0008, 0x631: 0x0008, 0x632: 0x0018, 0x633: 0x0018, 0x634: 0x0018, 0x635: 0x0018, 0x636: 0x0018, 0x637: 0x0018, 0x638: 0x0018, 0x639: 0x0018, 0x63a: 0x0018, 0x63b: 0x0018, 0x63c: 0x0008, 0x63d: 0x0018, 0x63e: 0x0040, 0x63f: 0x0040, // Block 0x19, offset 0x640 0x640: 0x0040, 0x641: 0x3308, 0x642: 0x3308, 0x643: 0x3008, 0x644: 0x0040, 0x645: 0x0008, 0x646: 0x0008, 0x647: 0x0008, 0x648: 0x0008, 0x649: 0x0008, 0x64a: 0x0008, 0x64b: 0x0040, 0x64c: 0x0040, 0x64d: 0x0040, 0x64e: 0x0040, 0x64f: 0x0008, 0x650: 0x0008, 0x651: 0x0040, 0x652: 0x0040, 0x653: 0x0008, 0x654: 0x0008, 0x655: 0x0008, 0x656: 0x0008, 0x657: 0x0008, 0x658: 0x0008, 0x659: 0x0008, 0x65a: 0x0008, 0x65b: 0x0008, 0x65c: 0x0008, 0x65d: 0x0008, 0x65e: 0x0008, 0x65f: 0x0008, 0x660: 0x0008, 0x661: 0x0008, 0x662: 0x0008, 0x663: 0x0008, 0x664: 0x0008, 0x665: 0x0008, 0x666: 0x0008, 0x667: 0x0008, 0x668: 0x0008, 0x669: 0x0040, 0x66a: 0x0008, 0x66b: 0x0008, 0x66c: 0x0008, 0x66d: 0x0008, 0x66e: 0x0008, 0x66f: 0x0008, 0x670: 0x0008, 0x671: 0x0040, 0x672: 0x0008, 0x673: 0x0731, 0x674: 0x0040, 0x675: 0x0008, 0x676: 0x0769, 0x677: 0x0040, 0x678: 0x0008, 0x679: 0x0008, 0x67a: 0x0040, 0x67b: 0x0040, 0x67c: 0x3308, 0x67d: 0x0040, 0x67e: 0x3008, 0x67f: 0x3008, // Block 0x1a, offset 0x680 0x680: 0x3008, 0x681: 0x3308, 0x682: 0x3308, 0x683: 0x0040, 0x684: 0x0040, 0x685: 0x0040, 0x686: 0x0040, 0x687: 0x3308, 0x688: 0x3308, 0x689: 0x0040, 0x68a: 0x0040, 0x68b: 0x3308, 0x68c: 0x3308, 0x68d: 0x3b08, 0x68e: 0x0040, 0x68f: 0x0040, 0x690: 0x0040, 0x691: 0x3308, 0x692: 0x0040, 0x693: 0x0040, 0x694: 0x0040, 0x695: 0x0040, 0x696: 0x0040, 0x697: 0x0040, 0x698: 0x0040, 0x699: 0x07a1, 0x69a: 0x07d9, 0x69b: 0x0811, 0x69c: 0x0008, 0x69d: 0x0040, 0x69e: 0x0849, 0x69f: 0x0040, 0x6a0: 0x0040, 0x6a1: 0x0040, 0x6a2: 0x0040, 0x6a3: 0x0040, 0x6a4: 0x0040, 0x6a5: 0x0040, 0x6a6: 0x0008, 0x6a7: 0x0008, 0x6a8: 0x0008, 0x6a9: 0x0008, 0x6aa: 0x0008, 0x6ab: 0x0008, 0x6ac: 0x0008, 0x6ad: 0x0008, 0x6ae: 0x0008, 0x6af: 0x0008, 0x6b0: 0x3308, 0x6b1: 0x3308, 0x6b2: 0x0008, 0x6b3: 0x0008, 0x6b4: 0x0008, 0x6b5: 0x3308, 0x6b6: 0x0040, 0x6b7: 0x0040, 0x6b8: 0x0040, 0x6b9: 0x0040, 0x6ba: 0x0040, 0x6bb: 0x0040, 0x6bc: 0x0040, 0x6bd: 0x0040, 0x6be: 0x0040, 0x6bf: 0x0040, // Block 0x1b, offset 0x6c0 0x6c0: 0x0040, 0x6c1: 0x3308, 0x6c2: 0x3308, 0x6c3: 0x3008, 0x6c4: 0x0040, 0x6c5: 0x0008, 0x6c6: 0x0008, 0x6c7: 0x0008, 0x6c8: 0x0008, 0x6c9: 0x0008, 0x6ca: 0x0008, 0x6cb: 0x0008, 0x6cc: 0x0008, 0x6cd: 0x0008, 0x6ce: 0x0040, 0x6cf: 0x0008, 0x6d0: 0x0008, 0x6d1: 0x0008, 0x6d2: 0x0040, 0x6d3: 0x0008, 0x6d4: 0x0008, 0x6d5: 0x0008, 0x6d6: 0x0008, 0x6d7: 0x0008, 0x6d8: 0x0008, 0x6d9: 0x0008, 0x6da: 0x0008, 0x6db: 0x0008, 0x6dc: 0x0008, 0x6dd: 0x0008, 0x6de: 0x0008, 0x6df: 0x0008, 0x6e0: 0x0008, 0x6e1: 0x0008, 0x6e2: 0x0008, 0x6e3: 0x0008, 0x6e4: 0x0008, 0x6e5: 0x0008, 0x6e6: 0x0008, 0x6e7: 0x0008, 0x6e8: 0x0008, 0x6e9: 0x0040, 0x6ea: 0x0008, 0x6eb: 0x0008, 0x6ec: 0x0008, 0x6ed: 0x0008, 0x6ee: 0x0008, 0x6ef: 0x0008, 0x6f0: 0x0008, 0x6f1: 0x0040, 0x6f2: 0x0008, 0x6f3: 0x0008, 0x6f4: 0x0040, 0x6f5: 0x0008, 0x6f6: 0x0008, 0x6f7: 0x0008, 0x6f8: 0x0008, 0x6f9: 0x0008, 0x6fa: 0x0040, 0x6fb: 0x0040, 0x6fc: 0x3308, 0x6fd: 0x0008, 0x6fe: 0x3008, 0x6ff: 0x3008, // Block 0x1c, offset 0x700 0x700: 0x3008, 0x701: 0x3308, 0x702: 0x3308, 0x703: 0x3308, 0x704: 0x3308, 0x705: 0x3308, 0x706: 0x0040, 0x707: 0x3308, 0x708: 0x3308, 0x709: 0x3008, 0x70a: 0x0040, 0x70b: 0x3008, 0x70c: 0x3008, 0x70d: 0x3b08, 0x70e: 0x0040, 0x70f: 0x0040, 0x710: 0x0008, 0x711: 0x0040, 0x712: 0x0040, 0x713: 0x0040, 0x714: 0x0040, 0x715: 0x0040, 0x716: 0x0040, 0x717: 0x0040, 0x718: 0x0040, 0x719: 0x0040, 0x71a: 0x0040, 0x71b: 0x0040, 0x71c: 0x0040, 0x71d: 0x0040, 0x71e: 0x0040, 0x71f: 0x0040, 0x720: 0x0008, 0x721: 0x0008, 0x722: 0x3308, 0x723: 0x3308, 0x724: 0x0040, 0x725: 0x0040, 0x726: 0x0008, 0x727: 0x0008, 0x728: 0x0008, 0x729: 0x0008, 0x72a: 0x0008, 0x72b: 0x0008, 0x72c: 0x0008, 0x72d: 0x0008, 0x72e: 0x0008, 0x72f: 0x0008, 0x730: 0x0018, 0x731: 0x0018, 0x732: 0x0040, 0x733: 0x0040, 0x734: 0x0040, 0x735: 0x0040, 0x736: 0x0040, 0x737: 0x0040, 0x738: 0x0040, 0x739: 0x0008, 0x73a: 0x3308, 0x73b: 0x3308, 0x73c: 0x3308, 0x73d: 0x3308, 0x73e: 0x3308, 0x73f: 0x3308, // Block 0x1d, offset 0x740 0x740: 0x0040, 0x741: 0x3308, 0x742: 0x3008, 0x743: 0x3008, 0x744: 0x0040, 0x745: 0x0008, 0x746: 0x0008, 0x747: 0x0008, 0x748: 0x0008, 0x749: 0x0008, 0x74a: 0x0008, 0x74b: 0x0008, 0x74c: 0x0008, 0x74d: 0x0040, 0x74e: 0x0040, 0x74f: 0x0008, 0x750: 0x0008, 0x751: 0x0040, 0x752: 0x0040, 0x753: 0x0008, 0x754: 0x0008, 0x755: 0x0008, 0x756: 0x0008, 0x757: 0x0008, 0x758: 0x0008, 0x759: 0x0008, 0x75a: 0x0008, 0x75b: 0x0008, 0x75c: 0x0008, 0x75d: 0x0008, 0x75e: 0x0008, 0x75f: 0x0008, 0x760: 0x0008, 0x761: 0x0008, 0x762: 0x0008, 0x763: 0x0008, 0x764: 0x0008, 0x765: 0x0008, 0x766: 0x0008, 0x767: 0x0008, 0x768: 0x0008, 0x769: 0x0040, 0x76a: 0x0008, 0x76b: 0x0008, 0x76c: 0x0008, 0x76d: 0x0008, 0x76e: 0x0008, 0x76f: 0x0008, 0x770: 0x0008, 0x771: 0x0040, 0x772: 0x0008, 0x773: 0x0008, 0x774: 0x0040, 0x775: 0x0008, 0x776: 0x0008, 0x777: 0x0008, 0x778: 0x0008, 0x779: 0x0008, 0x77a: 0x0040, 0x77b: 0x0040, 0x77c: 0x3308, 0x77d: 0x0008, 0x77e: 0x3008, 0x77f: 0x3308, // Block 0x1e, offset 0x780 0x780: 0x3008, 0x781: 0x3308, 0x782: 0x3308, 0x783: 0x3308, 0x784: 0x3308, 0x785: 0x0040, 0x786: 0x0040, 0x787: 0x3008, 0x788: 0x3008, 0x789: 0x0040, 0x78a: 0x0040, 0x78b: 0x3008, 0x78c: 0x3008, 0x78d: 0x3b08, 0x78e: 0x0040, 0x78f: 0x0040, 0x790: 0x0040, 0x791: 0x0040, 0x792: 0x0040, 0x793: 0x0040, 0x794: 0x0040, 0x795: 0x0040, 0x796: 0x3308, 0x797: 0x3008, 0x798: 0x0040, 0x799: 0x0040, 0x79a: 0x0040, 0x79b: 0x0040, 0x79c: 0x0881, 0x79d: 0x08b9, 0x79e: 0x0040, 0x79f: 0x0008, 0x7a0: 0x0008, 0x7a1: 0x0008, 0x7a2: 0x3308, 0x7a3: 0x3308, 0x7a4: 0x0040, 0x7a5: 0x0040, 0x7a6: 0x0008, 0x7a7: 0x0008, 0x7a8: 0x0008, 0x7a9: 0x0008, 0x7aa: 0x0008, 0x7ab: 0x0008, 0x7ac: 0x0008, 0x7ad: 0x0008, 0x7ae: 0x0008, 0x7af: 0x0008, 0x7b0: 0x0018, 0x7b1: 0x0008, 0x7b2: 0x0018, 0x7b3: 0x0018, 0x7b4: 0x0018, 0x7b5: 0x0018, 0x7b6: 0x0018, 0x7b7: 0x0018, 0x7b8: 0x0040, 0x7b9: 0x0040, 0x7ba: 0x0040, 0x7bb: 0x0040, 0x7bc: 0x0040, 0x7bd: 0x0040, 0x7be: 0x0040, 0x7bf: 0x0040, // Block 0x1f, offset 0x7c0 0x7c0: 0x0040, 0x7c1: 0x0040, 0x7c2: 0x3308, 0x7c3: 0x0008, 0x7c4: 0x0040, 0x7c5: 0x0008, 0x7c6: 0x0008, 0x7c7: 0x0008, 0x7c8: 0x0008, 0x7c9: 0x0008, 0x7ca: 0x0008, 0x7cb: 0x0040, 0x7cc: 0x0040, 0x7cd: 0x0040, 0x7ce: 0x0008, 0x7cf: 0x0008, 0x7d0: 0x0008, 0x7d1: 0x0040, 0x7d2: 0x0008, 0x7d3: 0x0008, 0x7d4: 0x0008, 0x7d5: 0x0008, 0x7d6: 0x0040, 0x7d7: 0x0040, 0x7d8: 0x0040, 0x7d9: 0x0008, 0x7da: 0x0008, 0x7db: 0x0040, 0x7dc: 0x0008, 0x7dd: 0x0040, 0x7de: 0x0008, 0x7df: 0x0008, 0x7e0: 0x0040, 0x7e1: 0x0040, 0x7e2: 0x0040, 0x7e3: 0x0008, 0x7e4: 0x0008, 0x7e5: 0x0040, 0x7e6: 0x0040, 0x7e7: 0x0040, 0x7e8: 0x0008, 0x7e9: 0x0008, 0x7ea: 0x0008, 0x7eb: 0x0040, 0x7ec: 0x0040, 0x7ed: 0x0040, 0x7ee: 0x0008, 0x7ef: 0x0008, 0x7f0: 0x0008, 0x7f1: 0x0008, 0x7f2: 0x0008, 0x7f3: 0x0008, 0x7f4: 0x0008, 0x7f5: 0x0008, 0x7f6: 0x0008, 0x7f7: 0x0008, 0x7f8: 0x0008, 0x7f9: 0x0008, 0x7fa: 0x0040, 0x7fb: 0x0040, 0x7fc: 0x0040, 0x7fd: 0x0040, 0x7fe: 0x3008, 0x7ff: 0x3008, // Block 0x20, offset 0x800 0x800: 0x3308, 0x801: 0x3008, 0x802: 0x3008, 0x803: 0x3008, 0x804: 0x3008, 0x805: 0x0040, 0x806: 0x3308, 0x807: 0x3308, 0x808: 0x3308, 0x809: 0x0040, 0x80a: 0x3308, 0x80b: 0x3308, 0x80c: 0x3308, 0x80d: 0x3b08, 0x80e: 0x0040, 0x80f: 0x0040, 0x810: 0x0040, 0x811: 0x0040, 0x812: 0x0040, 0x813: 0x0040, 0x814: 0x0040, 0x815: 0x3308, 0x816: 0x3308, 0x817: 0x0040, 0x818: 0x0008, 0x819: 0x0008, 0x81a: 0x0008, 0x81b: 0x0040, 0x81c: 0x0040, 0x81d: 0x0040, 0x81e: 0x0040, 0x81f: 0x0040, 0x820: 0x0008, 0x821: 0x0008, 0x822: 0x3308, 0x823: 0x3308, 0x824: 0x0040, 0x825: 0x0040, 0x826: 0x0008, 0x827: 0x0008, 0x828: 0x0008, 0x829: 0x0008, 0x82a: 0x0008, 0x82b: 0x0008, 0x82c: 0x0008, 0x82d: 0x0008, 0x82e: 0x0008, 0x82f: 0x0008, 0x830: 0x0040, 0x831: 0x0040, 0x832: 0x0040, 0x833: 0x0040, 0x834: 0x0040, 0x835: 0x0040, 0x836: 0x0040, 0x837: 0x0040, 0x838: 0x0018, 0x839: 0x0018, 0x83a: 0x0018, 0x83b: 0x0018, 0x83c: 0x0018, 0x83d: 0x0018, 0x83e: 0x0018, 0x83f: 0x0018, // Block 0x21, offset 0x840 0x840: 0x0008, 0x841: 0x3308, 0x842: 0x3008, 0x843: 0x3008, 0x844: 0x0040, 0x845: 0x0008, 0x846: 0x0008, 0x847: 0x0008, 0x848: 0x0008, 0x849: 0x0008, 0x84a: 0x0008, 0x84b: 0x0008, 0x84c: 0x0008, 0x84d: 0x0040, 0x84e: 0x0008, 0x84f: 0x0008, 0x850: 0x0008, 0x851: 0x0040, 0x852: 0x0008, 0x853: 0x0008, 0x854: 0x0008, 0x855: 0x0008, 0x856: 0x0008, 0x857: 0x0008, 0x858: 0x0008, 0x859: 0x0008, 0x85a: 0x0008, 0x85b: 0x0008, 0x85c: 0x0008, 0x85d: 0x0008, 0x85e: 0x0008, 0x85f: 0x0008, 0x860: 0x0008, 0x861: 0x0008, 0x862: 0x0008, 0x863: 0x0008, 0x864: 0x0008, 0x865: 0x0008, 0x866: 0x0008, 0x867: 0x0008, 0x868: 0x0008, 0x869: 0x0040, 0x86a: 0x0008, 0x86b: 0x0008, 0x86c: 0x0008, 0x86d: 0x0008, 0x86e: 0x0008, 0x86f: 0x0008, 0x870: 0x0008, 0x871: 0x0008, 0x872: 0x0008, 0x873: 0x0008, 0x874: 0x0040, 0x875: 0x0008, 0x876: 0x0008, 0x877: 0x0008, 0x878: 0x0008, 0x879: 0x0008, 0x87a: 0x0040, 0x87b: 0x0040, 0x87c: 0x3308, 0x87d: 0x0008, 0x87e: 0x3008, 0x87f: 0x3308, // Block 0x22, offset 0x880 0x880: 0x3008, 0x881: 0x3008, 0x882: 0x3008, 0x883: 0x3008, 0x884: 0x3008, 0x885: 0x0040, 0x886: 0x3308, 0x887: 0x3008, 0x888: 0x3008, 0x889: 0x0040, 0x88a: 0x3008, 0x88b: 0x3008, 0x88c: 0x3308, 0x88d: 0x3b08, 0x88e: 0x0040, 0x88f: 0x0040, 0x890: 0x0040, 0x891: 0x0040, 0x892: 0x0040, 0x893: 0x0040, 0x894: 0x0040, 0x895: 0x3008, 0x896: 0x3008, 0x897: 0x0040, 0x898: 0x0040, 0x899: 0x0040, 0x89a: 0x0040, 0x89b: 0x0040, 0x89c: 0x0040, 0x89d: 0x0040, 0x89e: 0x0008, 0x89f: 0x0040, 0x8a0: 0x0008, 0x8a1: 0x0008, 0x8a2: 0x3308, 0x8a3: 0x3308, 0x8a4: 0x0040, 0x8a5: 0x0040, 0x8a6: 0x0008, 0x8a7: 0x0008, 0x8a8: 0x0008, 0x8a9: 0x0008, 0x8aa: 0x0008, 0x8ab: 0x0008, 0x8ac: 0x0008, 0x8ad: 0x0008, 0x8ae: 0x0008, 0x8af: 0x0008, 0x8b0: 0x0040, 0x8b1: 0x0008, 0x8b2: 0x0008, 0x8b3: 0x0040, 0x8b4: 0x0040, 0x8b5: 0x0040, 0x8b6: 0x0040, 0x8b7: 0x0040, 0x8b8: 0x0040, 0x8b9: 0x0040, 0x8ba: 0x0040, 0x8bb: 0x0040, 0x8bc: 0x0040, 0x8bd: 0x0040, 0x8be: 0x0040, 0x8bf: 0x0040, // Block 0x23, offset 0x8c0 0x8c0: 0x3008, 0x8c1: 0x3308, 0x8c2: 0x3308, 0x8c3: 0x3308, 0x8c4: 0x3308, 0x8c5: 0x0040, 0x8c6: 0x3008, 0x8c7: 0x3008, 0x8c8: 0x3008, 0x8c9: 0x0040, 0x8ca: 0x3008, 0x8cb: 0x3008, 0x8cc: 0x3008, 0x8cd: 0x3b08, 0x8ce: 0x0008, 0x8cf: 0x0018, 0x8d0: 0x0040, 0x8d1: 0x0040, 0x8d2: 0x0040, 0x8d3: 0x0040, 0x8d4: 0x0008, 0x8d5: 0x0008, 0x8d6: 0x0008, 0x8d7: 0x3008, 0x8d8: 0x0018, 0x8d9: 0x0018, 0x8da: 0x0018, 0x8db: 0x0018, 0x8dc: 0x0018, 0x8dd: 0x0018, 0x8de: 0x0018, 0x8df: 0x0008, 0x8e0: 0x0008, 0x8e1: 0x0008, 0x8e2: 0x3308, 0x8e3: 0x3308, 0x8e4: 0x0040, 0x8e5: 0x0040, 0x8e6: 0x0008, 0x8e7: 0x0008, 0x8e8: 0x0008, 0x8e9: 0x0008, 0x8ea: 0x0008, 0x8eb: 0x0008, 0x8ec: 0x0008, 0x8ed: 0x0008, 0x8ee: 0x0008, 0x8ef: 0x0008, 0x8f0: 0x0018, 0x8f1: 0x0018, 0x8f2: 0x0018, 0x8f3: 0x0018, 0x8f4: 0x0018, 0x8f5: 0x0018, 0x8f6: 0x0018, 0x8f7: 0x0018, 0x8f8: 0x0018, 0x8f9: 0x0018, 0x8fa: 0x0008, 0x8fb: 0x0008, 0x8fc: 0x0008, 0x8fd: 0x0008, 0x8fe: 0x0008, 0x8ff: 0x0008, // Block 0x24, offset 0x900 0x900: 0x0040, 0x901: 0x0008, 0x902: 0x0008, 0x903: 0x0040, 0x904: 0x0008, 0x905: 0x0040, 0x906: 0x0040, 0x907: 0x0008, 0x908: 0x0008, 0x909: 0x0040, 0x90a: 0x0008, 0x90b: 0x0040, 0x90c: 0x0040, 0x90d: 0x0008, 0x90e: 0x0040, 0x90f: 0x0040, 0x910: 0x0040, 0x911: 0x0040, 0x912: 0x0040, 0x913: 0x0040, 0x914: 0x0008, 0x915: 0x0008, 0x916: 0x0008, 0x917: 0x0008, 0x918: 0x0040, 0x919: 0x0008, 0x91a: 0x0008, 0x91b: 0x0008, 0x91c: 0x0008, 0x91d: 0x0008, 0x91e: 0x0008, 0x91f: 0x0008, 0x920: 0x0040, 0x921: 0x0008, 0x922: 0x0008, 0x923: 0x0008, 0x924: 0x0040, 0x925: 0x0008, 0x926: 0x0040, 0x927: 0x0008, 0x928: 0x0040, 0x929: 0x0040, 0x92a: 0x0008, 0x92b: 0x0008, 0x92c: 0x0040, 0x92d: 0x0008, 0x92e: 0x0008, 0x92f: 0x0008, 0x930: 0x0008, 0x931: 0x3308, 0x932: 0x0008, 0x933: 0x0929, 0x934: 0x3308, 0x935: 0x3308, 0x936: 0x3308, 0x937: 0x3308, 0x938: 0x3308, 0x939: 0x3308, 0x93a: 0x0040, 0x93b: 0x3308, 0x93c: 0x3308, 0x93d: 0x0008, 0x93e: 0x0040, 0x93f: 0x0040, // Block 0x25, offset 0x940 0x940: 0x0008, 0x941: 0x0008, 0x942: 0x0008, 0x943: 0x09d1, 0x944: 0x0008, 0x945: 0x0008, 0x946: 0x0008, 0x947: 0x0008, 0x948: 0x0040, 0x949: 0x0008, 0x94a: 0x0008, 0x94b: 0x0008, 0x94c: 0x0008, 0x94d: 0x0a09, 0x94e: 0x0008, 0x94f: 0x0008, 0x950: 0x0008, 0x951: 0x0008, 0x952: 0x0a41, 0x953: 0x0008, 0x954: 0x0008, 0x955: 0x0008, 0x956: 0x0008, 0x957: 0x0a79, 0x958: 0x0008, 0x959: 0x0008, 0x95a: 0x0008, 0x95b: 0x0008, 0x95c: 0x0ab1, 0x95d: 0x0008, 0x95e: 0x0008, 0x95f: 0x0008, 0x960: 0x0008, 0x961: 0x0008, 0x962: 0x0008, 0x963: 0x0008, 0x964: 0x0008, 0x965: 0x0008, 0x966: 0x0008, 0x967: 0x0008, 0x968: 0x0008, 0x969: 0x0ae9, 0x96a: 0x0008, 0x96b: 0x0008, 0x96c: 0x0008, 0x96d: 0x0040, 0x96e: 0x0040, 0x96f: 0x0040, 0x970: 0x0040, 0x971: 0x3308, 0x972: 0x3308, 0x973: 0x0b21, 0x974: 0x3308, 0x975: 0x0b59, 0x976: 0x0b91, 0x977: 0x0bc9, 0x978: 0x0c19, 0x979: 0x0c51, 0x97a: 0x3308, 0x97b: 0x3308, 0x97c: 0x3308, 0x97d: 0x3308, 0x97e: 0x3308, 0x97f: 0x3008, // Block 0x26, offset 0x980 0x980: 0x3308, 0x981: 0x0ca1, 0x982: 0x3308, 0x983: 0x3308, 0x984: 0x3b08, 0x985: 0x0018, 0x986: 0x3308, 0x987: 0x3308, 0x988: 0x0008, 0x989: 0x0008, 0x98a: 0x0008, 0x98b: 0x0008, 0x98c: 0x0008, 0x98d: 0x3308, 0x98e: 0x3308, 0x98f: 0x3308, 0x990: 0x3308, 0x991: 0x3308, 0x992: 0x3308, 0x993: 0x0cd9, 0x994: 0x3308, 0x995: 0x3308, 0x996: 0x3308, 0x997: 0x3308, 0x998: 0x0040, 0x999: 0x3308, 0x99a: 0x3308, 0x99b: 0x3308, 0x99c: 0x3308, 0x99d: 0x0d11, 0x99e: 0x3308, 0x99f: 0x3308, 0x9a0: 0x3308, 0x9a1: 0x3308, 0x9a2: 0x0d49, 0x9a3: 0x3308, 0x9a4: 0x3308, 0x9a5: 0x3308, 0x9a6: 0x3308, 0x9a7: 0x0d81, 0x9a8: 0x3308, 0x9a9: 0x3308, 0x9aa: 0x3308, 0x9ab: 0x3308, 0x9ac: 0x0db9, 0x9ad: 0x3308, 0x9ae: 0x3308, 0x9af: 0x3308, 0x9b0: 0x3308, 0x9b1: 0x3308, 0x9b2: 0x3308, 0x9b3: 0x3308, 0x9b4: 0x3308, 0x9b5: 0x3308, 0x9b6: 0x3308, 0x9b7: 0x3308, 0x9b8: 0x3308, 0x9b9: 0x0df1, 0x9ba: 0x3308, 0x9bb: 0x3308, 0x9bc: 0x3308, 0x9bd: 0x0040, 0x9be: 0x0018, 0x9bf: 0x0018, // Block 0x27, offset 0x9c0 0x9c0: 0x0008, 0x9c1: 0x0008, 0x9c2: 0x0008, 0x9c3: 0x0008, 0x9c4: 0x0008, 0x9c5: 0x0008, 0x9c6: 0x0008, 0x9c7: 0x0008, 0x9c8: 0x0008, 0x9c9: 0x0008, 0x9ca: 0x0008, 0x9cb: 0x0008, 0x9cc: 0x0008, 0x9cd: 0x0008, 0x9ce: 0x0008, 0x9cf: 0x0008, 0x9d0: 0x0008, 0x9d1: 0x0008, 0x9d2: 0x0008, 0x9d3: 0x0008, 0x9d4: 0x0008, 0x9d5: 0x0008, 0x9d6: 0x0008, 0x9d7: 0x0008, 0x9d8: 0x0008, 0x9d9: 0x0008, 0x9da: 0x0008, 0x9db: 0x0008, 0x9dc: 0x0008, 0x9dd: 0x0008, 0x9de: 0x0008, 0x9df: 0x0008, 0x9e0: 0x0008, 0x9e1: 0x0008, 0x9e2: 0x0008, 0x9e3: 0x0008, 0x9e4: 0x0008, 0x9e5: 0x0008, 0x9e6: 0x0008, 0x9e7: 0x0008, 0x9e8: 0x0008, 0x9e9: 0x0008, 0x9ea: 0x0008, 0x9eb: 0x0008, 0x9ec: 0x0039, 0x9ed: 0x0ed1, 0x9ee: 0x0ee9, 0x9ef: 0x0008, 0x9f0: 0x0ef9, 0x9f1: 0x0f09, 0x9f2: 0x0f19, 0x9f3: 0x0f31, 0x9f4: 0x0249, 0x9f5: 0x0f41, 0x9f6: 0x0259, 0x9f7: 0x0f51, 0x9f8: 0x0359, 0x9f9: 0x0f61, 0x9fa: 0x0f71, 0x9fb: 0x0008, 0x9fc: 0x00d9, 0x9fd: 0x0f81, 0x9fe: 0x0f99, 0x9ff: 0x0269, // Block 0x28, offset 0xa00 0xa00: 0x0fa9, 0xa01: 0x0fb9, 0xa02: 0x0279, 0xa03: 0x0039, 0xa04: 0x0fc9, 0xa05: 0x0fe1, 0xa06: 0x059d, 0xa07: 0x0ee9, 0xa08: 0x0ef9, 0xa09: 0x0f09, 0xa0a: 0x0ff9, 0xa0b: 0x1011, 0xa0c: 0x1029, 0xa0d: 0x0f31, 0xa0e: 0x0008, 0xa0f: 0x0f51, 0xa10: 0x0f61, 0xa11: 0x1041, 0xa12: 0x00d9, 0xa13: 0x1059, 0xa14: 0x05b5, 0xa15: 0x05b5, 0xa16: 0x0f99, 0xa17: 0x0fa9, 0xa18: 0x0fb9, 0xa19: 0x059d, 0xa1a: 0x1071, 0xa1b: 0x1089, 0xa1c: 0x05cd, 0xa1d: 0x1099, 0xa1e: 0x10b1, 0xa1f: 0x10c9, 0xa20: 0x10e1, 0xa21: 0x10f9, 0xa22: 0x0f41, 0xa23: 0x0269, 0xa24: 0x0fb9, 0xa25: 0x1089, 0xa26: 0x1099, 0xa27: 0x10b1, 0xa28: 0x1111, 0xa29: 0x10e1, 0xa2a: 0x10f9, 0xa2b: 0x0008, 0xa2c: 0x0008, 0xa2d: 0x0008, 0xa2e: 0x0008, 0xa2f: 0x0008, 0xa30: 0x0008, 0xa31: 0x0008, 0xa32: 0x0008, 0xa33: 0x0008, 0xa34: 0x0008, 0xa35: 0x0008, 0xa36: 0x0008, 0xa37: 0x0008, 0xa38: 0x1129, 0xa39: 0x0008, 0xa3a: 0x0008, 0xa3b: 0x0008, 0xa3c: 0x0008, 0xa3d: 0x0008, 0xa3e: 0x0008, 0xa3f: 0x0008, // Block 0x29, offset 0xa40 0xa40: 0x0008, 0xa41: 0x0008, 0xa42: 0x0008, 0xa43: 0x0008, 0xa44: 0x0008, 0xa45: 0x0008, 0xa46: 0x0008, 0xa47: 0x0008, 0xa48: 0x0008, 0xa49: 0x0008, 0xa4a: 0x0008, 0xa4b: 0x0008, 0xa4c: 0x0008, 0xa4d: 0x0008, 0xa4e: 0x0008, 0xa4f: 0x0008, 0xa50: 0x0008, 0xa51: 0x0008, 0xa52: 0x0008, 0xa53: 0x0008, 0xa54: 0x0008, 0xa55: 0x0008, 0xa56: 0x0008, 0xa57: 0x0008, 0xa58: 0x0008, 0xa59: 0x0008, 0xa5a: 0x0008, 0xa5b: 0x1141, 0xa5c: 0x1159, 0xa5d: 0x1169, 0xa5e: 0x1181, 0xa5f: 0x1029, 0xa60: 0x1199, 0xa61: 0x11a9, 0xa62: 0x11c1, 0xa63: 0x11d9, 0xa64: 0x11f1, 0xa65: 0x1209, 0xa66: 0x1221, 0xa67: 0x05e5, 0xa68: 0x1239, 0xa69: 0x1251, 0xa6a: 0xe17d, 0xa6b: 0x1269, 0xa6c: 0x1281, 0xa6d: 0x1299, 0xa6e: 0x12b1, 0xa6f: 0x12c9, 0xa70: 0x12e1, 0xa71: 0x12f9, 0xa72: 0x1311, 0xa73: 0x1329, 0xa74: 0x1341, 0xa75: 0x1359, 0xa76: 0x1371, 0xa77: 0x1389, 0xa78: 0x05fd, 0xa79: 0x13a1, 0xa7a: 0x13b9, 0xa7b: 0x13d1, 0xa7c: 0x13e1, 0xa7d: 0x13f9, 0xa7e: 0x1411, 0xa7f: 0x1429, // Block 0x2a, offset 0xa80 0xa80: 0xe00d, 0xa81: 0x0008, 0xa82: 0xe00d, 0xa83: 0x0008, 0xa84: 0xe00d, 0xa85: 0x0008, 0xa86: 0xe00d, 0xa87: 0x0008, 0xa88: 0xe00d, 0xa89: 0x0008, 0xa8a: 0xe00d, 0xa8b: 0x0008, 0xa8c: 0xe00d, 0xa8d: 0x0008, 0xa8e: 0xe00d, 0xa8f: 0x0008, 0xa90: 0xe00d, 0xa91: 0x0008, 0xa92: 0xe00d, 0xa93: 0x0008, 0xa94: 0xe00d, 0xa95: 0x0008, 0xa96: 0xe00d, 0xa97: 0x0008, 0xa98: 0xe00d, 0xa99: 0x0008, 0xa9a: 0xe00d, 0xa9b: 0x0008, 0xa9c: 0xe00d, 0xa9d: 0x0008, 0xa9e: 0xe00d, 0xa9f: 0x0008, 0xaa0: 0xe00d, 0xaa1: 0x0008, 0xaa2: 0xe00d, 0xaa3: 0x0008, 0xaa4: 0xe00d, 0xaa5: 0x0008, 0xaa6: 0xe00d, 0xaa7: 0x0008, 0xaa8: 0xe00d, 0xaa9: 0x0008, 0xaaa: 0xe00d, 0xaab: 0x0008, 0xaac: 0xe00d, 0xaad: 0x0008, 0xaae: 0xe00d, 0xaaf: 0x0008, 0xab0: 0xe00d, 0xab1: 0x0008, 0xab2: 0xe00d, 0xab3: 0x0008, 0xab4: 0xe00d, 0xab5: 0x0008, 0xab6: 0xe00d, 0xab7: 0x0008, 0xab8: 0xe00d, 0xab9: 0x0008, 0xaba: 0xe00d, 0xabb: 0x0008, 0xabc: 0xe00d, 0xabd: 0x0008, 0xabe: 0xe00d, 0xabf: 0x0008, // Block 0x2b, offset 0xac0 0xac0: 0xe00d, 0xac1: 0x0008, 0xac2: 0xe00d, 0xac3: 0x0008, 0xac4: 0xe00d, 0xac5: 0x0008, 0xac6: 0xe00d, 0xac7: 0x0008, 0xac8: 0xe00d, 0xac9: 0x0008, 0xaca: 0xe00d, 0xacb: 0x0008, 0xacc: 0xe00d, 0xacd: 0x0008, 0xace: 0xe00d, 0xacf: 0x0008, 0xad0: 0xe00d, 0xad1: 0x0008, 0xad2: 0xe00d, 0xad3: 0x0008, 0xad4: 0xe00d, 0xad5: 0x0008, 0xad6: 0x0008, 0xad7: 0x0008, 0xad8: 0x0008, 0xad9: 0x0008, 0xada: 0x0615, 0xadb: 0x0635, 0xadc: 0x0008, 0xadd: 0x0008, 0xade: 0x1441, 0xadf: 0x0008, 0xae0: 0xe00d, 0xae1: 0x0008, 0xae2: 0xe00d, 0xae3: 0x0008, 0xae4: 0xe00d, 0xae5: 0x0008, 0xae6: 0xe00d, 0xae7: 0x0008, 0xae8: 0xe00d, 0xae9: 0x0008, 0xaea: 0xe00d, 0xaeb: 0x0008, 0xaec: 0xe00d, 0xaed: 0x0008, 0xaee: 0xe00d, 0xaef: 0x0008, 0xaf0: 0xe00d, 0xaf1: 0x0008, 0xaf2: 0xe00d, 0xaf3: 0x0008, 0xaf4: 0xe00d, 0xaf5: 0x0008, 0xaf6: 0xe00d, 0xaf7: 0x0008, 0xaf8: 0xe00d, 0xaf9: 0x0008, 0xafa: 0xe00d, 0xafb: 0x0008, 0xafc: 0xe00d, 0xafd: 0x0008, 0xafe: 0xe00d, 0xaff: 0x0008, // Block 0x2c, offset 0xb00 0xb00: 0x0008, 0xb01: 0x0008, 0xb02: 0x0008, 0xb03: 0x0008, 0xb04: 0x0008, 0xb05: 0x0008, 0xb06: 0x0040, 0xb07: 0x0040, 0xb08: 0xe045, 0xb09: 0xe045, 0xb0a: 0xe045, 0xb0b: 0xe045, 0xb0c: 0xe045, 0xb0d: 0xe045, 0xb0e: 0x0040, 0xb0f: 0x0040, 0xb10: 0x0008, 0xb11: 0x0008, 0xb12: 0x0008, 0xb13: 0x0008, 0xb14: 0x0008, 0xb15: 0x0008, 0xb16: 0x0008, 0xb17: 0x0008, 0xb18: 0x0040, 0xb19: 0xe045, 0xb1a: 0x0040, 0xb1b: 0xe045, 0xb1c: 0x0040, 0xb1d: 0xe045, 0xb1e: 0x0040, 0xb1f: 0xe045, 0xb20: 0x0008, 0xb21: 0x0008, 0xb22: 0x0008, 0xb23: 0x0008, 0xb24: 0x0008, 0xb25: 0x0008, 0xb26: 0x0008, 0xb27: 0x0008, 0xb28: 0xe045, 0xb29: 0xe045, 0xb2a: 0xe045, 0xb2b: 0xe045, 0xb2c: 0xe045, 0xb2d: 0xe045, 0xb2e: 0xe045, 0xb2f: 0xe045, 0xb30: 0x0008, 0xb31: 0x1459, 0xb32: 0x0008, 0xb33: 0x1471, 0xb34: 0x0008, 0xb35: 0x1489, 0xb36: 0x0008, 0xb37: 0x14a1, 0xb38: 0x0008, 0xb39: 0x14b9, 0xb3a: 0x0008, 0xb3b: 0x14d1, 0xb3c: 0x0008, 0xb3d: 0x14e9, 0xb3e: 0x0040, 0xb3f: 0x0040, // Block 0x2d, offset 0xb40 0xb40: 0x1501, 0xb41: 0x1531, 0xb42: 0x1561, 0xb43: 0x1591, 0xb44: 0x15c1, 0xb45: 0x15f1, 0xb46: 0x1621, 0xb47: 0x1651, 0xb48: 0x1501, 0xb49: 0x1531, 0xb4a: 0x1561, 0xb4b: 0x1591, 0xb4c: 0x15c1, 0xb4d: 0x15f1, 0xb4e: 0x1621, 0xb4f: 0x1651, 0xb50: 0x1681, 0xb51: 0x16b1, 0xb52: 0x16e1, 0xb53: 0x1711, 0xb54: 0x1741, 0xb55: 0x1771, 0xb56: 0x17a1, 0xb57: 0x17d1, 0xb58: 0x1681, 0xb59: 0x16b1, 0xb5a: 0x16e1, 0xb5b: 0x1711, 0xb5c: 0x1741, 0xb5d: 0x1771, 0xb5e: 0x17a1, 0xb5f: 0x17d1, 0xb60: 0x1801, 0xb61: 0x1831, 0xb62: 0x1861, 0xb63: 0x1891, 0xb64: 0x18c1, 0xb65: 0x18f1, 0xb66: 0x1921, 0xb67: 0x1951, 0xb68: 0x1801, 0xb69: 0x1831, 0xb6a: 0x1861, 0xb6b: 0x1891, 0xb6c: 0x18c1, 0xb6d: 0x18f1, 0xb6e: 0x1921, 0xb6f: 0x1951, 0xb70: 0x0008, 0xb71: 0x0008, 0xb72: 0x1981, 0xb73: 0x19b1, 0xb74: 0x19d9, 0xb75: 0x0040, 0xb76: 0x0008, 0xb77: 0x1a01, 0xb78: 0xe045, 0xb79: 0xe045, 0xb7a: 0x064d, 0xb7b: 0x1459, 0xb7c: 0x19b1, 0xb7d: 0x0666, 0xb7e: 0x1a31, 0xb7f: 0x0686, // Block 0x2e, offset 0xb80 0xb80: 0x06a6, 0xb81: 0x1a4a, 0xb82: 0x1a79, 0xb83: 0x1aa9, 0xb84: 0x1ad1, 0xb85: 0x0040, 0xb86: 0x0008, 0xb87: 0x1af9, 0xb88: 0x06c5, 0xb89: 0x1471, 0xb8a: 0x06dd, 0xb8b: 0x1489, 0xb8c: 0x1aa9, 0xb8d: 0x1b2a, 0xb8e: 0x1b5a, 0xb8f: 0x1b8a, 0xb90: 0x0008, 0xb91: 0x0008, 0xb92: 0x0008, 0xb93: 0x1bb9, 0xb94: 0x0040, 0xb95: 0x0040, 0xb96: 0x0008, 0xb97: 0x0008, 0xb98: 0xe045, 0xb99: 0xe045, 0xb9a: 0x06f5, 0xb9b: 0x14a1, 0xb9c: 0x0040, 0xb9d: 0x1bd2, 0xb9e: 0x1c02, 0xb9f: 0x1c32, 0xba0: 0x0008, 0xba1: 0x0008, 0xba2: 0x0008, 0xba3: 0x1c61, 0xba4: 0x0008, 0xba5: 0x0008, 0xba6: 0x0008, 0xba7: 0x0008, 0xba8: 0xe045, 0xba9: 0xe045, 0xbaa: 0x070d, 0xbab: 0x14d1, 0xbac: 0xe04d, 0xbad: 0x1c7a, 0xbae: 0x03d2, 0xbaf: 0x1caa, 0xbb0: 0x0040, 0xbb1: 0x0040, 0xbb2: 0x1cb9, 0xbb3: 0x1ce9, 0xbb4: 0x1d11, 0xbb5: 0x0040, 0xbb6: 0x0008, 0xbb7: 0x1d39, 0xbb8: 0x0725, 0xbb9: 0x14b9, 0xbba: 0x0515, 0xbbb: 0x14e9, 0xbbc: 0x1ce9, 0xbbd: 0x073e, 0xbbe: 0x075e, 0xbbf: 0x0040, // Block 0x2f, offset 0xbc0 0xbc0: 0x000a, 0xbc1: 0x000a, 0xbc2: 0x000a, 0xbc3: 0x000a, 0xbc4: 0x000a, 0xbc5: 0x000a, 0xbc6: 0x000a, 0xbc7: 0x000a, 0xbc8: 0x000a, 0xbc9: 0x000a, 0xbca: 0x000a, 0xbcb: 0x03c0, 0xbcc: 0x0003, 0xbcd: 0x0003, 0xbce: 0x0340, 0xbcf: 0x0b40, 0xbd0: 0x0018, 0xbd1: 0xe00d, 0xbd2: 0x0018, 0xbd3: 0x0018, 0xbd4: 0x0018, 0xbd5: 0x0018, 0xbd6: 0x0018, 0xbd7: 0x077e, 0xbd8: 0x0018, 0xbd9: 0x0018, 0xbda: 0x0018, 0xbdb: 0x0018, 0xbdc: 0x0018, 0xbdd: 0x0018, 0xbde: 0x0018, 0xbdf: 0x0018, 0xbe0: 0x0018, 0xbe1: 0x0018, 0xbe2: 0x0018, 0xbe3: 0x0018, 0xbe4: 0x0040, 0xbe5: 0x0040, 0xbe6: 0x0040, 0xbe7: 0x0018, 0xbe8: 0x0040, 0xbe9: 0x0040, 0xbea: 0x0340, 0xbeb: 0x0340, 0xbec: 0x0340, 0xbed: 0x0340, 0xbee: 0x0340, 0xbef: 0x000a, 0xbf0: 0x0018, 0xbf1: 0x0018, 0xbf2: 0x0018, 0xbf3: 0x1d69, 0xbf4: 0x1da1, 0xbf5: 0x0018, 0xbf6: 0x1df1, 0xbf7: 0x1e29, 0xbf8: 0x0018, 0xbf9: 0x0018, 0xbfa: 0x0018, 0xbfb: 0x0018, 0xbfc: 0x1e7a, 0xbfd: 0x0018, 0xbfe: 0x079e, 0xbff: 0x0018, // Block 0x30, offset 0xc00 0xc00: 0x0018, 0xc01: 0x0018, 0xc02: 0x0018, 0xc03: 0x0018, 0xc04: 0x0018, 0xc05: 0x0018, 0xc06: 0x0018, 0xc07: 0x1e92, 0xc08: 0x1eaa, 0xc09: 0x1ec2, 0xc0a: 0x0018, 0xc0b: 0x0018, 0xc0c: 0x0018, 0xc0d: 0x0018, 0xc0e: 0x0018, 0xc0f: 0x0018, 0xc10: 0x0018, 0xc11: 0x0018, 0xc12: 0x0018, 0xc13: 0x0018, 0xc14: 0x0018, 0xc15: 0x0018, 0xc16: 0x0018, 0xc17: 0x1ed9, 0xc18: 0x0018, 0xc19: 0x0018, 0xc1a: 0x0018, 0xc1b: 0x0018, 0xc1c: 0x0018, 0xc1d: 0x0018, 0xc1e: 0x0018, 0xc1f: 0x000a, 0xc20: 0x03c0, 0xc21: 0x0340, 0xc22: 0x0340, 0xc23: 0x0340, 0xc24: 0x03c0, 0xc25: 0x0040, 0xc26: 0x0040, 0xc27: 0x0040, 0xc28: 0x0040, 0xc29: 0x0040, 0xc2a: 0x0340, 0xc2b: 0x0340, 0xc2c: 0x0340, 0xc2d: 0x0340, 0xc2e: 0x0340, 0xc2f: 0x0340, 0xc30: 0x1f41, 0xc31: 0x0f41, 0xc32: 0x0040, 0xc33: 0x0040, 0xc34: 0x1f51, 0xc35: 0x1f61, 0xc36: 0x1f71, 0xc37: 0x1f81, 0xc38: 0x1f91, 0xc39: 0x1fa1, 0xc3a: 0x1fb2, 0xc3b: 0x07bd, 0xc3c: 0x1fc2, 0xc3d: 0x1fd2, 0xc3e: 0x1fe2, 0xc3f: 0x0f71, // Block 0x31, offset 0xc40 0xc40: 0x1f41, 0xc41: 0x00c9, 0xc42: 0x0069, 0xc43: 0x0079, 0xc44: 0x1f51, 0xc45: 0x1f61, 0xc46: 0x1f71, 0xc47: 0x1f81, 0xc48: 0x1f91, 0xc49: 0x1fa1, 0xc4a: 0x1fb2, 0xc4b: 0x07d5, 0xc4c: 0x1fc2, 0xc4d: 0x1fd2, 0xc4e: 0x1fe2, 0xc4f: 0x0040, 0xc50: 0x0039, 0xc51: 0x0f09, 0xc52: 0x00d9, 0xc53: 0x0369, 0xc54: 0x0ff9, 0xc55: 0x0249, 0xc56: 0x0f51, 0xc57: 0x0359, 0xc58: 0x0f61, 0xc59: 0x0f71, 0xc5a: 0x0f99, 0xc5b: 0x01d9, 0xc5c: 0x0fa9, 0xc5d: 0x0040, 0xc5e: 0x0040, 0xc5f: 0x0040, 0xc60: 0x0018, 0xc61: 0x0018, 0xc62: 0x0018, 0xc63: 0x0018, 0xc64: 0x0018, 0xc65: 0x0018, 0xc66: 0x0018, 0xc67: 0x0018, 0xc68: 0x1ff1, 0xc69: 0x0018, 0xc6a: 0x0018, 0xc6b: 0x0018, 0xc6c: 0x0018, 0xc6d: 0x0018, 0xc6e: 0x0018, 0xc6f: 0x0018, 0xc70: 0x0018, 0xc71: 0x0018, 0xc72: 0x0018, 0xc73: 0x0018, 0xc74: 0x0018, 0xc75: 0x0018, 0xc76: 0x0018, 0xc77: 0x0018, 0xc78: 0x0018, 0xc79: 0x0018, 0xc7a: 0x0018, 0xc7b: 0x0018, 0xc7c: 0x0018, 0xc7d: 0x0018, 0xc7e: 0x0018, 0xc7f: 0x0018, // Block 0x32, offset 0xc80 0xc80: 0x07ee, 0xc81: 0x080e, 0xc82: 0x1159, 0xc83: 0x082d, 0xc84: 0x0018, 0xc85: 0x084e, 0xc86: 0x086e, 0xc87: 0x1011, 0xc88: 0x0018, 0xc89: 0x088d, 0xc8a: 0x0f31, 0xc8b: 0x0249, 0xc8c: 0x0249, 0xc8d: 0x0249, 0xc8e: 0x0249, 0xc8f: 0x2009, 0xc90: 0x0f41, 0xc91: 0x0f41, 0xc92: 0x0359, 0xc93: 0x0359, 0xc94: 0x0018, 0xc95: 0x0f71, 0xc96: 0x2021, 0xc97: 0x0018, 0xc98: 0x0018, 0xc99: 0x0f99, 0xc9a: 0x2039, 0xc9b: 0x0269, 0xc9c: 0x0269, 0xc9d: 0x0269, 0xc9e: 0x0018, 0xc9f: 0x0018, 0xca0: 0x2049, 0xca1: 0x08ad, 0xca2: 0x2061, 0xca3: 0x0018, 0xca4: 0x13d1, 0xca5: 0x0018, 0xca6: 0x2079, 0xca7: 0x0018, 0xca8: 0x13d1, 0xca9: 0x0018, 0xcaa: 0x0f51, 0xcab: 0x2091, 0xcac: 0x0ee9, 0xcad: 0x1159, 0xcae: 0x0018, 0xcaf: 0x0f09, 0xcb0: 0x0f09, 0xcb1: 0x1199, 0xcb2: 0x0040, 0xcb3: 0x0f61, 0xcb4: 0x00d9, 0xcb5: 0x20a9, 0xcb6: 0x20c1, 0xcb7: 0x20d9, 0xcb8: 0x20f1, 0xcb9: 0x0f41, 0xcba: 0x0018, 0xcbb: 0x08cd, 0xcbc: 0x2109, 0xcbd: 0x10b1, 0xcbe: 0x10b1, 0xcbf: 0x2109, // Block 0x33, offset 0xcc0 0xcc0: 0x08ed, 0xcc1: 0x0018, 0xcc2: 0x0018, 0xcc3: 0x0018, 0xcc4: 0x0018, 0xcc5: 0x0ef9, 0xcc6: 0x0ef9, 0xcc7: 0x0f09, 0xcc8: 0x0f41, 0xcc9: 0x0259, 0xcca: 0x0018, 0xccb: 0x0018, 0xccc: 0x0018, 0xccd: 0x0018, 0xcce: 0x0008, 0xccf: 0x0018, 0xcd0: 0x2121, 0xcd1: 0x2151, 0xcd2: 0x2181, 0xcd3: 0x21b9, 0xcd4: 0x21e9, 0xcd5: 0x2219, 0xcd6: 0x2249, 0xcd7: 0x2279, 0xcd8: 0x22a9, 0xcd9: 0x22d9, 0xcda: 0x2309, 0xcdb: 0x2339, 0xcdc: 0x2369, 0xcdd: 0x2399, 0xcde: 0x23c9, 0xcdf: 0x23f9, 0xce0: 0x0f41, 0xce1: 0x2421, 0xce2: 0x0905, 0xce3: 0x2439, 0xce4: 0x1089, 0xce5: 0x2451, 0xce6: 0x0925, 0xce7: 0x2469, 0xce8: 0x2491, 0xce9: 0x0369, 0xcea: 0x24a9, 0xceb: 0x0945, 0xcec: 0x0359, 0xced: 0x1159, 0xcee: 0x0ef9, 0xcef: 0x0f61, 0xcf0: 0x0f41, 0xcf1: 0x2421, 0xcf2: 0x0965, 0xcf3: 0x2439, 0xcf4: 0x1089, 0xcf5: 0x2451, 0xcf6: 0x0985, 0xcf7: 0x2469, 0xcf8: 0x2491, 0xcf9: 0x0369, 0xcfa: 0x24a9, 0xcfb: 0x09a5, 0xcfc: 0x0359, 0xcfd: 0x1159, 0xcfe: 0x0ef9, 0xcff: 0x0f61, // Block 0x34, offset 0xd00 0xd00: 0x0018, 0xd01: 0x0018, 0xd02: 0x0018, 0xd03: 0x0018, 0xd04: 0x0018, 0xd05: 0x0018, 0xd06: 0x0018, 0xd07: 0x0018, 0xd08: 0x0018, 0xd09: 0x0018, 0xd0a: 0x0018, 0xd0b: 0x0040, 0xd0c: 0x0040, 0xd0d: 0x0040, 0xd0e: 0x0040, 0xd0f: 0x0040, 0xd10: 0x0040, 0xd11: 0x0040, 0xd12: 0x0040, 0xd13: 0x0040, 0xd14: 0x0040, 0xd15: 0x0040, 0xd16: 0x0040, 0xd17: 0x0040, 0xd18: 0x0040, 0xd19: 0x0040, 0xd1a: 0x0040, 0xd1b: 0x0040, 0xd1c: 0x0040, 0xd1d: 0x0040, 0xd1e: 0x0040, 0xd1f: 0x0040, 0xd20: 0x00c9, 0xd21: 0x0069, 0xd22: 0x0079, 0xd23: 0x1f51, 0xd24: 0x1f61, 0xd25: 0x1f71, 0xd26: 0x1f81, 0xd27: 0x1f91, 0xd28: 0x1fa1, 0xd29: 0x2601, 0xd2a: 0x2619, 0xd2b: 0x2631, 0xd2c: 0x2649, 0xd2d: 0x2661, 0xd2e: 0x2679, 0xd2f: 0x2691, 0xd30: 0x26a9, 0xd31: 0x26c1, 0xd32: 0x26d9, 0xd33: 0x26f1, 0xd34: 0x0a06, 0xd35: 0x0a26, 0xd36: 0x0a46, 0xd37: 0x0a66, 0xd38: 0x0a86, 0xd39: 0x0aa6, 0xd3a: 0x0ac6, 0xd3b: 0x0ae6, 0xd3c: 0x0b06, 0xd3d: 0x270a, 0xd3e: 0x2732, 0xd3f: 0x275a, // Block 0x35, offset 0xd40 0xd40: 0x2782, 0xd41: 0x27aa, 0xd42: 0x27d2, 0xd43: 0x27fa, 0xd44: 0x2822, 0xd45: 0x284a, 0xd46: 0x2872, 0xd47: 0x289a, 0xd48: 0x0040, 0xd49: 0x0040, 0xd4a: 0x0040, 0xd4b: 0x0040, 0xd4c: 0x0040, 0xd4d: 0x0040, 0xd4e: 0x0040, 0xd4f: 0x0040, 0xd50: 0x0040, 0xd51: 0x0040, 0xd52: 0x0040, 0xd53: 0x0040, 0xd54: 0x0040, 0xd55: 0x0040, 0xd56: 0x0040, 0xd57: 0x0040, 0xd58: 0x0040, 0xd59: 0x0040, 0xd5a: 0x0040, 0xd5b: 0x0040, 0xd5c: 0x0b26, 0xd5d: 0x0b46, 0xd5e: 0x0b66, 0xd5f: 0x0b86, 0xd60: 0x0ba6, 0xd61: 0x0bc6, 0xd62: 0x0be6, 0xd63: 0x0c06, 0xd64: 0x0c26, 0xd65: 0x0c46, 0xd66: 0x0c66, 0xd67: 0x0c86, 0xd68: 0x0ca6, 0xd69: 0x0cc6, 0xd6a: 0x0ce6, 0xd6b: 0x0d06, 0xd6c: 0x0d26, 0xd6d: 0x0d46, 0xd6e: 0x0d66, 0xd6f: 0x0d86, 0xd70: 0x0da6, 0xd71: 0x0dc6, 0xd72: 0x0de6, 0xd73: 0x0e06, 0xd74: 0x0e26, 0xd75: 0x0e46, 0xd76: 0x0039, 0xd77: 0x0ee9, 0xd78: 0x1159, 0xd79: 0x0ef9, 0xd7a: 0x0f09, 0xd7b: 0x1199, 0xd7c: 0x0f31, 0xd7d: 0x0249, 0xd7e: 0x0f41, 0xd7f: 0x0259, // Block 0x36, offset 0xd80 0xd80: 0x0f51, 0xd81: 0x0359, 0xd82: 0x0f61, 0xd83: 0x0f71, 0xd84: 0x00d9, 0xd85: 0x0f99, 0xd86: 0x2039, 0xd87: 0x0269, 0xd88: 0x01d9, 0xd89: 0x0fa9, 0xd8a: 0x0fb9, 0xd8b: 0x1089, 0xd8c: 0x0279, 0xd8d: 0x0369, 0xd8e: 0x0289, 0xd8f: 0x13d1, 0xd90: 0x0039, 0xd91: 0x0ee9, 0xd92: 0x1159, 0xd93: 0x0ef9, 0xd94: 0x0f09, 0xd95: 0x1199, 0xd96: 0x0f31, 0xd97: 0x0249, 0xd98: 0x0f41, 0xd99: 0x0259, 0xd9a: 0x0f51, 0xd9b: 0x0359, 0xd9c: 0x0f61, 0xd9d: 0x0f71, 0xd9e: 0x00d9, 0xd9f: 0x0f99, 0xda0: 0x2039, 0xda1: 0x0269, 0xda2: 0x01d9, 0xda3: 0x0fa9, 0xda4: 0x0fb9, 0xda5: 0x1089, 0xda6: 0x0279, 0xda7: 0x0369, 0xda8: 0x0289, 0xda9: 0x13d1, 0xdaa: 0x1f41, 0xdab: 0x0018, 0xdac: 0x0018, 0xdad: 0x0018, 0xdae: 0x0018, 0xdaf: 0x0018, 0xdb0: 0x0018, 0xdb1: 0x0018, 0xdb2: 0x0018, 0xdb3: 0x0018, 0xdb4: 0x0018, 0xdb5: 0x0018, 0xdb6: 0x0018, 0xdb7: 0x0018, 0xdb8: 0x0018, 0xdb9: 0x0018, 0xdba: 0x0018, 0xdbb: 0x0018, 0xdbc: 0x0018, 0xdbd: 0x0018, 0xdbe: 0x0018, 0xdbf: 0x0018, // Block 0x37, offset 0xdc0 0xdc0: 0x0008, 0xdc1: 0x0008, 0xdc2: 0x0008, 0xdc3: 0x0008, 0xdc4: 0x0008, 0xdc5: 0x0008, 0xdc6: 0x0008, 0xdc7: 0x0008, 0xdc8: 0x0008, 0xdc9: 0x0008, 0xdca: 0x0008, 0xdcb: 0x0008, 0xdcc: 0x0008, 0xdcd: 0x0008, 0xdce: 0x0008, 0xdcf: 0x0008, 0xdd0: 0x0008, 0xdd1: 0x0008, 0xdd2: 0x0008, 0xdd3: 0x0008, 0xdd4: 0x0008, 0xdd5: 0x0008, 0xdd6: 0x0008, 0xdd7: 0x0008, 0xdd8: 0x0008, 0xdd9: 0x0008, 0xdda: 0x0008, 0xddb: 0x0008, 0xddc: 0x0008, 0xddd: 0x0008, 0xdde: 0x0008, 0xddf: 0x0040, 0xde0: 0xe00d, 0xde1: 0x0008, 0xde2: 0x2971, 0xde3: 0x0ebd, 0xde4: 0x2989, 0xde5: 0x0008, 0xde6: 0x0008, 0xde7: 0xe07d, 0xde8: 0x0008, 0xde9: 0xe01d, 0xdea: 0x0008, 0xdeb: 0xe03d, 0xdec: 0x0008, 0xded: 0x0fe1, 0xdee: 0x1281, 0xdef: 0x0fc9, 0xdf0: 0x1141, 0xdf1: 0x0008, 0xdf2: 0xe00d, 0xdf3: 0x0008, 0xdf4: 0x0008, 0xdf5: 0xe01d, 0xdf6: 0x0008, 0xdf7: 0x0008, 0xdf8: 0x0008, 0xdf9: 0x0008, 0xdfa: 0x0008, 0xdfb: 0x0008, 0xdfc: 0x0259, 0xdfd: 0x1089, 0xdfe: 0x29a1, 0xdff: 0x29b9, // Block 0x38, offset 0xe00 0xe00: 0xe00d, 0xe01: 0x0008, 0xe02: 0xe00d, 0xe03: 0x0008, 0xe04: 0xe00d, 0xe05: 0x0008, 0xe06: 0xe00d, 0xe07: 0x0008, 0xe08: 0xe00d, 0xe09: 0x0008, 0xe0a: 0xe00d, 0xe0b: 0x0008, 0xe0c: 0xe00d, 0xe0d: 0x0008, 0xe0e: 0xe00d, 0xe0f: 0x0008, 0xe10: 0xe00d, 0xe11: 0x0008, 0xe12: 0xe00d, 0xe13: 0x0008, 0xe14: 0xe00d, 0xe15: 0x0008, 0xe16: 0xe00d, 0xe17: 0x0008, 0xe18: 0xe00d, 0xe19: 0x0008, 0xe1a: 0xe00d, 0xe1b: 0x0008, 0xe1c: 0xe00d, 0xe1d: 0x0008, 0xe1e: 0xe00d, 0xe1f: 0x0008, 0xe20: 0xe00d, 0xe21: 0x0008, 0xe22: 0xe00d, 0xe23: 0x0008, 0xe24: 0x0008, 0xe25: 0x0018, 0xe26: 0x0018, 0xe27: 0x0018, 0xe28: 0x0018, 0xe29: 0x0018, 0xe2a: 0x0018, 0xe2b: 0xe03d, 0xe2c: 0x0008, 0xe2d: 0xe01d, 0xe2e: 0x0008, 0xe2f: 0x3308, 0xe30: 0x3308, 0xe31: 0x3308, 0xe32: 0xe00d, 0xe33: 0x0008, 0xe34: 0x0040, 0xe35: 0x0040, 0xe36: 0x0040, 0xe37: 0x0040, 0xe38: 0x0040, 0xe39: 0x0018, 0xe3a: 0x0018, 0xe3b: 0x0018, 0xe3c: 0x0018, 0xe3d: 0x0018, 0xe3e: 0x0018, 0xe3f: 0x0018, // Block 0x39, offset 0xe40 0xe40: 0x26fd, 0xe41: 0x271d, 0xe42: 0x273d, 0xe43: 0x275d, 0xe44: 0x277d, 0xe45: 0x279d, 0xe46: 0x27bd, 0xe47: 0x27dd, 0xe48: 0x27fd, 0xe49: 0x281d, 0xe4a: 0x283d, 0xe4b: 0x285d, 0xe4c: 0x287d, 0xe4d: 0x289d, 0xe4e: 0x28bd, 0xe4f: 0x28dd, 0xe50: 0x28fd, 0xe51: 0x291d, 0xe52: 0x293d, 0xe53: 0x295d, 0xe54: 0x297d, 0xe55: 0x299d, 0xe56: 0x0040, 0xe57: 0x0040, 0xe58: 0x0040, 0xe59: 0x0040, 0xe5a: 0x0040, 0xe5b: 0x0040, 0xe5c: 0x0040, 0xe5d: 0x0040, 0xe5e: 0x0040, 0xe5f: 0x0040, 0xe60: 0x0040, 0xe61: 0x0040, 0xe62: 0x0040, 0xe63: 0x0040, 0xe64: 0x0040, 0xe65: 0x0040, 0xe66: 0x0040, 0xe67: 0x0040, 0xe68: 0x0040, 0xe69: 0x0040, 0xe6a: 0x0040, 0xe6b: 0x0040, 0xe6c: 0x0040, 0xe6d: 0x0040, 0xe6e: 0x0040, 0xe6f: 0x0040, 0xe70: 0x0040, 0xe71: 0x0040, 0xe72: 0x0040, 0xe73: 0x0040, 0xe74: 0x0040, 0xe75: 0x0040, 0xe76: 0x0040, 0xe77: 0x0040, 0xe78: 0x0040, 0xe79: 0x0040, 0xe7a: 0x0040, 0xe7b: 0x0040, 0xe7c: 0x0040, 0xe7d: 0x0040, 0xe7e: 0x0040, 0xe7f: 0x0040, // Block 0x3a, offset 0xe80 0xe80: 0x000a, 0xe81: 0x0018, 0xe82: 0x29d1, 0xe83: 0x0018, 0xe84: 0x0018, 0xe85: 0x0008, 0xe86: 0x0008, 0xe87: 0x0008, 0xe88: 0x0018, 0xe89: 0x0018, 0xe8a: 0x0018, 0xe8b: 0x0018, 0xe8c: 0x0018, 0xe8d: 0x0018, 0xe8e: 0x0018, 0xe8f: 0x0018, 0xe90: 0x0018, 0xe91: 0x0018, 0xe92: 0x0018, 0xe93: 0x0018, 0xe94: 0x0018, 0xe95: 0x0018, 0xe96: 0x0018, 0xe97: 0x0018, 0xe98: 0x0018, 0xe99: 0x0018, 0xe9a: 0x0018, 0xe9b: 0x0018, 0xe9c: 0x0018, 0xe9d: 0x0018, 0xe9e: 0x0018, 0xe9f: 0x0018, 0xea0: 0x0018, 0xea1: 0x0018, 0xea2: 0x0018, 0xea3: 0x0018, 0xea4: 0x0018, 0xea5: 0x0018, 0xea6: 0x0018, 0xea7: 0x0018, 0xea8: 0x0018, 0xea9: 0x0018, 0xeaa: 0x3308, 0xeab: 0x3308, 0xeac: 0x3308, 0xead: 0x3308, 0xeae: 0x3018, 0xeaf: 0x3018, 0xeb0: 0x0018, 0xeb1: 0x0018, 0xeb2: 0x0018, 0xeb3: 0x0018, 0xeb4: 0x0018, 0xeb5: 0x0018, 0xeb6: 0xe125, 0xeb7: 0x0018, 0xeb8: 0x29bd, 0xeb9: 0x29dd, 0xeba: 0x29fd, 0xebb: 0x0018, 0xebc: 0x0008, 0xebd: 0x0018, 0xebe: 0x0018, 0xebf: 0x0018, // Block 0x3b, offset 0xec0 0xec0: 0x2b3d, 0xec1: 0x2b5d, 0xec2: 0x2b7d, 0xec3: 0x2b9d, 0xec4: 0x2bbd, 0xec5: 0x2bdd, 0xec6: 0x2bdd, 0xec7: 0x2bdd, 0xec8: 0x2bfd, 0xec9: 0x2bfd, 0xeca: 0x2bfd, 0xecb: 0x2bfd, 0xecc: 0x2c1d, 0xecd: 0x2c1d, 0xece: 0x2c1d, 0xecf: 0x2c3d, 0xed0: 0x2c5d, 0xed1: 0x2c5d, 0xed2: 0x2a7d, 0xed3: 0x2a7d, 0xed4: 0x2c5d, 0xed5: 0x2c5d, 0xed6: 0x2c7d, 0xed7: 0x2c7d, 0xed8: 0x2c5d, 0xed9: 0x2c5d, 0xeda: 0x2a7d, 0xedb: 0x2a7d, 0xedc: 0x2c5d, 0xedd: 0x2c5d, 0xede: 0x2c3d, 0xedf: 0x2c3d, 0xee0: 0x2c9d, 0xee1: 0x2c9d, 0xee2: 0x2cbd, 0xee3: 0x2cbd, 0xee4: 0x0040, 0xee5: 0x2cdd, 0xee6: 0x2cfd, 0xee7: 0x2d1d, 0xee8: 0x2d1d, 0xee9: 0x2d3d, 0xeea: 0x2d5d, 0xeeb: 0x2d7d, 0xeec: 0x2d9d, 0xeed: 0x2dbd, 0xeee: 0x2ddd, 0xeef: 0x2dfd, 0xef0: 0x2e1d, 0xef1: 0x2e3d, 0xef2: 0x2e3d, 0xef3: 0x2e5d, 0xef4: 0x2e7d, 0xef5: 0x2e7d, 0xef6: 0x2e9d, 0xef7: 0x2ebd, 0xef8: 0x2e5d, 0xef9: 0x2edd, 0xefa: 0x2efd, 0xefb: 0x2edd, 0xefc: 0x2e5d, 0xefd: 0x2f1d, 0xefe: 0x2f3d, 0xeff: 0x2f5d, // Block 0x3c, offset 0xf00 0xf00: 0x2f7d, 0xf01: 0x2f9d, 0xf02: 0x2cfd, 0xf03: 0x2cdd, 0xf04: 0x2fbd, 0xf05: 0x2fdd, 0xf06: 0x2ffd, 0xf07: 0x301d, 0xf08: 0x303d, 0xf09: 0x305d, 0xf0a: 0x307d, 0xf0b: 0x309d, 0xf0c: 0x30bd, 0xf0d: 0x30dd, 0xf0e: 0x30fd, 0xf0f: 0x0040, 0xf10: 0x0018, 0xf11: 0x0018, 0xf12: 0x311d, 0xf13: 0x313d, 0xf14: 0x315d, 0xf15: 0x317d, 0xf16: 0x319d, 0xf17: 0x31bd, 0xf18: 0x31dd, 0xf19: 0x31fd, 0xf1a: 0x321d, 0xf1b: 0x323d, 0xf1c: 0x315d, 0xf1d: 0x325d, 0xf1e: 0x327d, 0xf1f: 0x329d, 0xf20: 0x0008, 0xf21: 0x0008, 0xf22: 0x0008, 0xf23: 0x0008, 0xf24: 0x0008, 0xf25: 0x0008, 0xf26: 0x0008, 0xf27: 0x0008, 0xf28: 0x0008, 0xf29: 0x0008, 0xf2a: 0x0008, 0xf2b: 0x0008, 0xf2c: 0x0008, 0xf2d: 0x0008, 0xf2e: 0x0008, 0xf2f: 0x0008, 0xf30: 0x0008, 0xf31: 0x0008, 0xf32: 0x0008, 0xf33: 0x0008, 0xf34: 0x0008, 0xf35: 0x0008, 0xf36: 0x0008, 0xf37: 0x0008, 0xf38: 0x0008, 0xf39: 0x0008, 0xf3a: 0x0008, 0xf3b: 0x0040, 0xf3c: 0x0040, 0xf3d: 0x0040, 0xf3e: 0x0040, 0xf3f: 0x0040, // Block 0x3d, offset 0xf40 0xf40: 0x36a2, 0xf41: 0x36d2, 0xf42: 0x3702, 0xf43: 0x3732, 0xf44: 0x32bd, 0xf45: 0x32dd, 0xf46: 0x32fd, 0xf47: 0x331d, 0xf48: 0x0018, 0xf49: 0x0018, 0xf4a: 0x0018, 0xf4b: 0x0018, 0xf4c: 0x0018, 0xf4d: 0x0018, 0xf4e: 0x0018, 0xf4f: 0x0018, 0xf50: 0x333d, 0xf51: 0x3761, 0xf52: 0x3779, 0xf53: 0x3791, 0xf54: 0x37a9, 0xf55: 0x37c1, 0xf56: 0x37d9, 0xf57: 0x37f1, 0xf58: 0x3809, 0xf59: 0x3821, 0xf5a: 0x3839, 0xf5b: 0x3851, 0xf5c: 0x3869, 0xf5d: 0x3881, 0xf5e: 0x3899, 0xf5f: 0x38b1, 0xf60: 0x335d, 0xf61: 0x337d, 0xf62: 0x339d, 0xf63: 0x33bd, 0xf64: 0x33dd, 0xf65: 0x33dd, 0xf66: 0x33fd, 0xf67: 0x341d, 0xf68: 0x343d, 0xf69: 0x345d, 0xf6a: 0x347d, 0xf6b: 0x349d, 0xf6c: 0x34bd, 0xf6d: 0x34dd, 0xf6e: 0x34fd, 0xf6f: 0x351d, 0xf70: 0x353d, 0xf71: 0x355d, 0xf72: 0x357d, 0xf73: 0x359d, 0xf74: 0x35bd, 0xf75: 0x35dd, 0xf76: 0x35fd, 0xf77: 0x361d, 0xf78: 0x363d, 0xf79: 0x365d, 0xf7a: 0x367d, 0xf7b: 0x369d, 0xf7c: 0x38c9, 0xf7d: 0x3901, 0xf7e: 0x36bd, 0xf7f: 0x0018, // Block 0x3e, offset 0xf80 0xf80: 0x36dd, 0xf81: 0x36fd, 0xf82: 0x371d, 0xf83: 0x373d, 0xf84: 0x375d, 0xf85: 0x377d, 0xf86: 0x379d, 0xf87: 0x37bd, 0xf88: 0x37dd, 0xf89: 0x37fd, 0xf8a: 0x381d, 0xf8b: 0x383d, 0xf8c: 0x385d, 0xf8d: 0x387d, 0xf8e: 0x389d, 0xf8f: 0x38bd, 0xf90: 0x38dd, 0xf91: 0x38fd, 0xf92: 0x391d, 0xf93: 0x393d, 0xf94: 0x395d, 0xf95: 0x397d, 0xf96: 0x399d, 0xf97: 0x39bd, 0xf98: 0x39dd, 0xf99: 0x39fd, 0xf9a: 0x3a1d, 0xf9b: 0x3a3d, 0xf9c: 0x3a5d, 0xf9d: 0x3a7d, 0xf9e: 0x3a9d, 0xf9f: 0x3abd, 0xfa0: 0x3add, 0xfa1: 0x3afd, 0xfa2: 0x3b1d, 0xfa3: 0x3b3d, 0xfa4: 0x3b5d, 0xfa5: 0x3b7d, 0xfa6: 0x127d, 0xfa7: 0x3b9d, 0xfa8: 0x3bbd, 0xfa9: 0x3bdd, 0xfaa: 0x3bfd, 0xfab: 0x3c1d, 0xfac: 0x3c3d, 0xfad: 0x3c5d, 0xfae: 0x239d, 0xfaf: 0x3c7d, 0xfb0: 0x3c9d, 0xfb1: 0x3939, 0xfb2: 0x3951, 0xfb3: 0x3969, 0xfb4: 0x3981, 0xfb5: 0x3999, 0xfb6: 0x39b1, 0xfb7: 0x39c9, 0xfb8: 0x39e1, 0xfb9: 0x39f9, 0xfba: 0x3a11, 0xfbb: 0x3a29, 0xfbc: 0x3a41, 0xfbd: 0x3a59, 0xfbe: 0x3a71, 0xfbf: 0x3a89, // Block 0x3f, offset 0xfc0 0xfc0: 0x3aa1, 0xfc1: 0x3ac9, 0xfc2: 0x3af1, 0xfc3: 0x3b19, 0xfc4: 0x3b41, 0xfc5: 0x3b69, 0xfc6: 0x3b91, 0xfc7: 0x3bb9, 0xfc8: 0x3be1, 0xfc9: 0x3c09, 0xfca: 0x3c39, 0xfcb: 0x3c69, 0xfcc: 0x3c99, 0xfcd: 0x3cbd, 0xfce: 0x3cb1, 0xfcf: 0x3cdd, 0xfd0: 0x3cfd, 0xfd1: 0x3d15, 0xfd2: 0x3d2d, 0xfd3: 0x3d45, 0xfd4: 0x3d5d, 0xfd5: 0x3d5d, 0xfd6: 0x3d45, 0xfd7: 0x3d75, 0xfd8: 0x07bd, 0xfd9: 0x3d8d, 0xfda: 0x3da5, 0xfdb: 0x3dbd, 0xfdc: 0x3dd5, 0xfdd: 0x3ded, 0xfde: 0x3e05, 0xfdf: 0x3e1d, 0xfe0: 0x3e35, 0xfe1: 0x3e4d, 0xfe2: 0x3e65, 0xfe3: 0x3e7d, 0xfe4: 0x3e95, 0xfe5: 0x3e95, 0xfe6: 0x3ead, 0xfe7: 0x3ead, 0xfe8: 0x3ec5, 0xfe9: 0x3ec5, 0xfea: 0x3edd, 0xfeb: 0x3ef5, 0xfec: 0x3f0d, 0xfed: 0x3f25, 0xfee: 0x3f3d, 0xfef: 0x3f3d, 0xff0: 0x3f55, 0xff1: 0x3f55, 0xff2: 0x3f55, 0xff3: 0x3f6d, 0xff4: 0x3f85, 0xff5: 0x3f9d, 0xff6: 0x3fb5, 0xff7: 0x3f9d, 0xff8: 0x3fcd, 0xff9: 0x3fe5, 0xffa: 0x3f6d, 0xffb: 0x3ffd, 0xffc: 0x4015, 0xffd: 0x4015, 0xffe: 0x4015, 0xfff: 0x0040, // Block 0x40, offset 0x1000 0x1000: 0x3cc9, 0x1001: 0x3d31, 0x1002: 0x3d99, 0x1003: 0x3e01, 0x1004: 0x3e51, 0x1005: 0x3eb9, 0x1006: 0x3f09, 0x1007: 0x3f59, 0x1008: 0x3fd9, 0x1009: 0x4041, 0x100a: 0x4091, 0x100b: 0x40e1, 0x100c: 0x4131, 0x100d: 0x4199, 0x100e: 0x4201, 0x100f: 0x4251, 0x1010: 0x42a1, 0x1011: 0x42d9, 0x1012: 0x4329, 0x1013: 0x4391, 0x1014: 0x43f9, 0x1015: 0x4431, 0x1016: 0x44b1, 0x1017: 0x4549, 0x1018: 0x45c9, 0x1019: 0x4619, 0x101a: 0x4699, 0x101b: 0x4719, 0x101c: 0x4781, 0x101d: 0x47d1, 0x101e: 0x4821, 0x101f: 0x4871, 0x1020: 0x48d9, 0x1021: 0x4959, 0x1022: 0x49c1, 0x1023: 0x4a11, 0x1024: 0x4a61, 0x1025: 0x4ab1, 0x1026: 0x4ae9, 0x1027: 0x4b21, 0x1028: 0x4b59, 0x1029: 0x4b91, 0x102a: 0x4be1, 0x102b: 0x4c31, 0x102c: 0x4cb1, 0x102d: 0x4d01, 0x102e: 0x4d69, 0x102f: 0x4de9, 0x1030: 0x4e39, 0x1031: 0x4e71, 0x1032: 0x4ea9, 0x1033: 0x4f29, 0x1034: 0x4f91, 0x1035: 0x5011, 0x1036: 0x5061, 0x1037: 0x50e1, 0x1038: 0x5119, 0x1039: 0x5169, 0x103a: 0x51b9, 0x103b: 0x5209, 0x103c: 0x5259, 0x103d: 0x52a9, 0x103e: 0x5311, 0x103f: 0x5361, // Block 0x41, offset 0x1040 0x1040: 0x5399, 0x1041: 0x53e9, 0x1042: 0x5439, 0x1043: 0x5489, 0x1044: 0x54f1, 0x1045: 0x5541, 0x1046: 0x5591, 0x1047: 0x55e1, 0x1048: 0x5661, 0x1049: 0x56c9, 0x104a: 0x5701, 0x104b: 0x5781, 0x104c: 0x57b9, 0x104d: 0x5821, 0x104e: 0x5889, 0x104f: 0x58d9, 0x1050: 0x5929, 0x1051: 0x5979, 0x1052: 0x59e1, 0x1053: 0x5a19, 0x1054: 0x5a69, 0x1055: 0x5ad1, 0x1056: 0x5b09, 0x1057: 0x5b89, 0x1058: 0x5bd9, 0x1059: 0x5c01, 0x105a: 0x5c29, 0x105b: 0x5c51, 0x105c: 0x5c79, 0x105d: 0x5ca1, 0x105e: 0x5cc9, 0x105f: 0x5cf1, 0x1060: 0x5d19, 0x1061: 0x5d41, 0x1062: 0x5d69, 0x1063: 0x5d99, 0x1064: 0x5dc9, 0x1065: 0x5df9, 0x1066: 0x5e29, 0x1067: 0x5e59, 0x1068: 0x5e89, 0x1069: 0x5eb9, 0x106a: 0x5ee9, 0x106b: 0x5f19, 0x106c: 0x5f49, 0x106d: 0x5f79, 0x106e: 0x5fa9, 0x106f: 0x5fd9, 0x1070: 0x6009, 0x1071: 0x402d, 0x1072: 0x6039, 0x1073: 0x6051, 0x1074: 0x404d, 0x1075: 0x6069, 0x1076: 0x6081, 0x1077: 0x6099, 0x1078: 0x406d, 0x1079: 0x406d, 0x107a: 0x60b1, 0x107b: 0x60c9, 0x107c: 0x6101, 0x107d: 0x6139, 0x107e: 0x6171, 0x107f: 0x61a9, // Block 0x42, offset 0x1080 0x1080: 0x6211, 0x1081: 0x6229, 0x1082: 0x408d, 0x1083: 0x6241, 0x1084: 0x6259, 0x1085: 0x6271, 0x1086: 0x6289, 0x1087: 0x62a1, 0x1088: 0x40ad, 0x1089: 0x62b9, 0x108a: 0x62e1, 0x108b: 0x62f9, 0x108c: 0x40cd, 0x108d: 0x40cd, 0x108e: 0x6311, 0x108f: 0x6329, 0x1090: 0x6341, 0x1091: 0x40ed, 0x1092: 0x410d, 0x1093: 0x412d, 0x1094: 0x414d, 0x1095: 0x416d, 0x1096: 0x6359, 0x1097: 0x6371, 0x1098: 0x6389, 0x1099: 0x63a1, 0x109a: 0x63b9, 0x109b: 0x418d, 0x109c: 0x63d1, 0x109d: 0x63e9, 0x109e: 0x6401, 0x109f: 0x41ad, 0x10a0: 0x41cd, 0x10a1: 0x6419, 0x10a2: 0x41ed, 0x10a3: 0x420d, 0x10a4: 0x422d, 0x10a5: 0x6431, 0x10a6: 0x424d, 0x10a7: 0x6449, 0x10a8: 0x6479, 0x10a9: 0x6211, 0x10aa: 0x426d, 0x10ab: 0x428d, 0x10ac: 0x42ad, 0x10ad: 0x42cd, 0x10ae: 0x64b1, 0x10af: 0x64f1, 0x10b0: 0x6539, 0x10b1: 0x6551, 0x10b2: 0x42ed, 0x10b3: 0x6569, 0x10b4: 0x6581, 0x10b5: 0x6599, 0x10b6: 0x430d, 0x10b7: 0x65b1, 0x10b8: 0x65c9, 0x10b9: 0x65b1, 0x10ba: 0x65e1, 0x10bb: 0x65f9, 0x10bc: 0x432d, 0x10bd: 0x6611, 0x10be: 0x6629, 0x10bf: 0x6611, // Block 0x43, offset 0x10c0 0x10c0: 0x434d, 0x10c1: 0x436d, 0x10c2: 0x0040, 0x10c3: 0x6641, 0x10c4: 0x6659, 0x10c5: 0x6671, 0x10c6: 0x6689, 0x10c7: 0x0040, 0x10c8: 0x66c1, 0x10c9: 0x66d9, 0x10ca: 0x66f1, 0x10cb: 0x6709, 0x10cc: 0x6721, 0x10cd: 0x6739, 0x10ce: 0x6401, 0x10cf: 0x6751, 0x10d0: 0x6769, 0x10d1: 0x6781, 0x10d2: 0x438d, 0x10d3: 0x6799, 0x10d4: 0x6289, 0x10d5: 0x43ad, 0x10d6: 0x43cd, 0x10d7: 0x67b1, 0x10d8: 0x0040, 0x10d9: 0x43ed, 0x10da: 0x67c9, 0x10db: 0x67e1, 0x10dc: 0x67f9, 0x10dd: 0x6811, 0x10de: 0x6829, 0x10df: 0x6859, 0x10e0: 0x6889, 0x10e1: 0x68b1, 0x10e2: 0x68d9, 0x10e3: 0x6901, 0x10e4: 0x6929, 0x10e5: 0x6951, 0x10e6: 0x6979, 0x10e7: 0x69a1, 0x10e8: 0x69c9, 0x10e9: 0x69f1, 0x10ea: 0x6a21, 0x10eb: 0x6a51, 0x10ec: 0x6a81, 0x10ed: 0x6ab1, 0x10ee: 0x6ae1, 0x10ef: 0x6b11, 0x10f0: 0x6b41, 0x10f1: 0x6b71, 0x10f2: 0x6ba1, 0x10f3: 0x6bd1, 0x10f4: 0x6c01, 0x10f5: 0x6c31, 0x10f6: 0x6c61, 0x10f7: 0x6c91, 0x10f8: 0x6cc1, 0x10f9: 0x6cf1, 0x10fa: 0x6d21, 0x10fb: 0x6d51, 0x10fc: 0x6d81, 0x10fd: 0x6db1, 0x10fe: 0x6de1, 0x10ff: 0x440d, // Block 0x44, offset 0x1100 0x1100: 0xe00d, 0x1101: 0x0008, 0x1102: 0xe00d, 0x1103: 0x0008, 0x1104: 0xe00d, 0x1105: 0x0008, 0x1106: 0xe00d, 0x1107: 0x0008, 0x1108: 0xe00d, 0x1109: 0x0008, 0x110a: 0xe00d, 0x110b: 0x0008, 0x110c: 0xe00d, 0x110d: 0x0008, 0x110e: 0xe00d, 0x110f: 0x0008, 0x1110: 0xe00d, 0x1111: 0x0008, 0x1112: 0xe00d, 0x1113: 0x0008, 0x1114: 0xe00d, 0x1115: 0x0008, 0x1116: 0xe00d, 0x1117: 0x0008, 0x1118: 0xe00d, 0x1119: 0x0008, 0x111a: 0xe00d, 0x111b: 0x0008, 0x111c: 0xe00d, 0x111d: 0x0008, 0x111e: 0xe00d, 0x111f: 0x0008, 0x1120: 0xe00d, 0x1121: 0x0008, 0x1122: 0xe00d, 0x1123: 0x0008, 0x1124: 0xe00d, 0x1125: 0x0008, 0x1126: 0xe00d, 0x1127: 0x0008, 0x1128: 0xe00d, 0x1129: 0x0008, 0x112a: 0xe00d, 0x112b: 0x0008, 0x112c: 0xe00d, 0x112d: 0x0008, 0x112e: 0x0008, 0x112f: 0x3308, 0x1130: 0x3318, 0x1131: 0x3318, 0x1132: 0x3318, 0x1133: 0x0018, 0x1134: 0x3308, 0x1135: 0x3308, 0x1136: 0x3308, 0x1137: 0x3308, 0x1138: 0x3308, 0x1139: 0x3308, 0x113a: 0x3308, 0x113b: 0x3308, 0x113c: 0x3308, 0x113d: 0x3308, 0x113e: 0x0018, 0x113f: 0x0008, // Block 0x45, offset 0x1140 0x1140: 0xe00d, 0x1141: 0x0008, 0x1142: 0xe00d, 0x1143: 0x0008, 0x1144: 0xe00d, 0x1145: 0x0008, 0x1146: 0xe00d, 0x1147: 0x0008, 0x1148: 0xe00d, 0x1149: 0x0008, 0x114a: 0xe00d, 0x114b: 0x0008, 0x114c: 0xe00d, 0x114d: 0x0008, 0x114e: 0xe00d, 0x114f: 0x0008, 0x1150: 0xe00d, 0x1151: 0x0008, 0x1152: 0xe00d, 0x1153: 0x0008, 0x1154: 0xe00d, 0x1155: 0x0008, 0x1156: 0xe00d, 0x1157: 0x0008, 0x1158: 0xe00d, 0x1159: 0x0008, 0x115a: 0xe00d, 0x115b: 0x0008, 0x115c: 0x0ea1, 0x115d: 0x6e11, 0x115e: 0x3308, 0x115f: 0x3308, 0x1160: 0x0008, 0x1161: 0x0008, 0x1162: 0x0008, 0x1163: 0x0008, 0x1164: 0x0008, 0x1165: 0x0008, 0x1166: 0x0008, 0x1167: 0x0008, 0x1168: 0x0008, 0x1169: 0x0008, 0x116a: 0x0008, 0x116b: 0x0008, 0x116c: 0x0008, 0x116d: 0x0008, 0x116e: 0x0008, 0x116f: 0x0008, 0x1170: 0x0008, 0x1171: 0x0008, 0x1172: 0x0008, 0x1173: 0x0008, 0x1174: 0x0008, 0x1175: 0x0008, 0x1176: 0x0008, 0x1177: 0x0008, 0x1178: 0x0008, 0x1179: 0x0008, 0x117a: 0x0008, 0x117b: 0x0008, 0x117c: 0x0008, 0x117d: 0x0008, 0x117e: 0x0008, 0x117f: 0x0008, // Block 0x46, offset 0x1180 0x1180: 0x0018, 0x1181: 0x0018, 0x1182: 0x0018, 0x1183: 0x0018, 0x1184: 0x0018, 0x1185: 0x0018, 0x1186: 0x0018, 0x1187: 0x0018, 0x1188: 0x0018, 0x1189: 0x0018, 0x118a: 0x0018, 0x118b: 0x0018, 0x118c: 0x0018, 0x118d: 0x0018, 0x118e: 0x0018, 0x118f: 0x0018, 0x1190: 0x0018, 0x1191: 0x0018, 0x1192: 0x0018, 0x1193: 0x0018, 0x1194: 0x0018, 0x1195: 0x0018, 0x1196: 0x0018, 0x1197: 0x0008, 0x1198: 0x0008, 0x1199: 0x0008, 0x119a: 0x0008, 0x119b: 0x0008, 0x119c: 0x0008, 0x119d: 0x0008, 0x119e: 0x0008, 0x119f: 0x0008, 0x11a0: 0x0018, 0x11a1: 0x0018, 0x11a2: 0xe00d, 0x11a3: 0x0008, 0x11a4: 0xe00d, 0x11a5: 0x0008, 0x11a6: 0xe00d, 0x11a7: 0x0008, 0x11a8: 0xe00d, 0x11a9: 0x0008, 0x11aa: 0xe00d, 0x11ab: 0x0008, 0x11ac: 0xe00d, 0x11ad: 0x0008, 0x11ae: 0xe00d, 0x11af: 0x0008, 0x11b0: 0x0008, 0x11b1: 0x0008, 0x11b2: 0xe00d, 0x11b3: 0x0008, 0x11b4: 0xe00d, 0x11b5: 0x0008, 0x11b6: 0xe00d, 0x11b7: 0x0008, 0x11b8: 0xe00d, 0x11b9: 0x0008, 0x11ba: 0xe00d, 0x11bb: 0x0008, 0x11bc: 0xe00d, 0x11bd: 0x0008, 0x11be: 0xe00d, 0x11bf: 0x0008, // Block 0x47, offset 0x11c0 0x11c0: 0xe00d, 0x11c1: 0x0008, 0x11c2: 0xe00d, 0x11c3: 0x0008, 0x11c4: 0xe00d, 0x11c5: 0x0008, 0x11c6: 0xe00d, 0x11c7: 0x0008, 0x11c8: 0xe00d, 0x11c9: 0x0008, 0x11ca: 0xe00d, 0x11cb: 0x0008, 0x11cc: 0xe00d, 0x11cd: 0x0008, 0x11ce: 0xe00d, 0x11cf: 0x0008, 0x11d0: 0xe00d, 0x11d1: 0x0008, 0x11d2: 0xe00d, 0x11d3: 0x0008, 0x11d4: 0xe00d, 0x11d5: 0x0008, 0x11d6: 0xe00d, 0x11d7: 0x0008, 0x11d8: 0xe00d, 0x11d9: 0x0008, 0x11da: 0xe00d, 0x11db: 0x0008, 0x11dc: 0xe00d, 0x11dd: 0x0008, 0x11de: 0xe00d, 0x11df: 0x0008, 0x11e0: 0xe00d, 0x11e1: 0x0008, 0x11e2: 0xe00d, 0x11e3: 0x0008, 0x11e4: 0xe00d, 0x11e5: 0x0008, 0x11e6: 0xe00d, 0x11e7: 0x0008, 0x11e8: 0xe00d, 0x11e9: 0x0008, 0x11ea: 0xe00d, 0x11eb: 0x0008, 0x11ec: 0xe00d, 0x11ed: 0x0008, 0x11ee: 0xe00d, 0x11ef: 0x0008, 0x11f0: 0xe0fd, 0x11f1: 0x0008, 0x11f2: 0x0008, 0x11f3: 0x0008, 0x11f4: 0x0008, 0x11f5: 0x0008, 0x11f6: 0x0008, 0x11f7: 0x0008, 0x11f8: 0x0008, 0x11f9: 0xe01d, 0x11fa: 0x0008, 0x11fb: 0xe03d, 0x11fc: 0x0008, 0x11fd: 0x442d, 0x11fe: 0xe00d, 0x11ff: 0x0008, // Block 0x48, offset 0x1200 0x1200: 0xe00d, 0x1201: 0x0008, 0x1202: 0xe00d, 0x1203: 0x0008, 0x1204: 0xe00d, 0x1205: 0x0008, 0x1206: 0xe00d, 0x1207: 0x0008, 0x1208: 0x0008, 0x1209: 0x0018, 0x120a: 0x0018, 0x120b: 0xe03d, 0x120c: 0x0008, 0x120d: 0x11d9, 0x120e: 0x0008, 0x120f: 0x0008, 0x1210: 0xe00d, 0x1211: 0x0008, 0x1212: 0xe00d, 0x1213: 0x0008, 0x1214: 0x0008, 0x1215: 0x0008, 0x1216: 0xe00d, 0x1217: 0x0008, 0x1218: 0xe00d, 0x1219: 0x0008, 0x121a: 0xe00d, 0x121b: 0x0008, 0x121c: 0xe00d, 0x121d: 0x0008, 0x121e: 0xe00d, 0x121f: 0x0008, 0x1220: 0xe00d, 0x1221: 0x0008, 0x1222: 0xe00d, 0x1223: 0x0008, 0x1224: 0xe00d, 0x1225: 0x0008, 0x1226: 0xe00d, 0x1227: 0x0008, 0x1228: 0xe00d, 0x1229: 0x0008, 0x122a: 0x6e29, 0x122b: 0x1029, 0x122c: 0x11c1, 0x122d: 0x6e41, 0x122e: 0x1221, 0x122f: 0x0040, 0x1230: 0x6e59, 0x1231: 0x6e71, 0x1232: 0x1239, 0x1233: 0x444d, 0x1234: 0xe00d, 0x1235: 0x0008, 0x1236: 0xe00d, 0x1237: 0x0008, 0x1238: 0x0040, 0x1239: 0x0040, 0x123a: 0x0040, 0x123b: 0x0040, 0x123c: 0x0040, 0x123d: 0x0040, 0x123e: 0x0040, 0x123f: 0x0040, // Block 0x49, offset 0x1240 0x1240: 0x64d5, 0x1241: 0x64f5, 0x1242: 0x6515, 0x1243: 0x6535, 0x1244: 0x6555, 0x1245: 0x6575, 0x1246: 0x6595, 0x1247: 0x65b5, 0x1248: 0x65d5, 0x1249: 0x65f5, 0x124a: 0x6615, 0x124b: 0x6635, 0x124c: 0x6655, 0x124d: 0x6675, 0x124e: 0x0008, 0x124f: 0x0008, 0x1250: 0x6695, 0x1251: 0x0008, 0x1252: 0x66b5, 0x1253: 0x0008, 0x1254: 0x0008, 0x1255: 0x66d5, 0x1256: 0x66f5, 0x1257: 0x6715, 0x1258: 0x6735, 0x1259: 0x6755, 0x125a: 0x6775, 0x125b: 0x6795, 0x125c: 0x67b5, 0x125d: 0x67d5, 0x125e: 0x67f5, 0x125f: 0x0008, 0x1260: 0x6815, 0x1261: 0x0008, 0x1262: 0x6835, 0x1263: 0x0008, 0x1264: 0x0008, 0x1265: 0x6855, 0x1266: 0x6875, 0x1267: 0x0008, 0x1268: 0x0008, 0x1269: 0x0008, 0x126a: 0x6895, 0x126b: 0x68b5, 0x126c: 0x68d5, 0x126d: 0x68f5, 0x126e: 0x6915, 0x126f: 0x6935, 0x1270: 0x6955, 0x1271: 0x6975, 0x1272: 0x6995, 0x1273: 0x69b5, 0x1274: 0x69d5, 0x1275: 0x69f5, 0x1276: 0x6a15, 0x1277: 0x6a35, 0x1278: 0x6a55, 0x1279: 0x6a75, 0x127a: 0x6a95, 0x127b: 0x6ab5, 0x127c: 0x6ad5, 0x127d: 0x6af5, 0x127e: 0x6b15, 0x127f: 0x6b35, // Block 0x4a, offset 0x1280 0x1280: 0x7a95, 0x1281: 0x7ab5, 0x1282: 0x7ad5, 0x1283: 0x7af5, 0x1284: 0x7b15, 0x1285: 0x7b35, 0x1286: 0x7b55, 0x1287: 0x7b75, 0x1288: 0x7b95, 0x1289: 0x7bb5, 0x128a: 0x7bd5, 0x128b: 0x7bf5, 0x128c: 0x7c15, 0x128d: 0x7c35, 0x128e: 0x7c55, 0x128f: 0x6ec9, 0x1290: 0x6ef1, 0x1291: 0x6f19, 0x1292: 0x7c75, 0x1293: 0x7c95, 0x1294: 0x7cb5, 0x1295: 0x6f41, 0x1296: 0x6f69, 0x1297: 0x6f91, 0x1298: 0x7cd5, 0x1299: 0x7cf5, 0x129a: 0x0040, 0x129b: 0x0040, 0x129c: 0x0040, 0x129d: 0x0040, 0x129e: 0x0040, 0x129f: 0x0040, 0x12a0: 0x0040, 0x12a1: 0x0040, 0x12a2: 0x0040, 0x12a3: 0x0040, 0x12a4: 0x0040, 0x12a5: 0x0040, 0x12a6: 0x0040, 0x12a7: 0x0040, 0x12a8: 0x0040, 0x12a9: 0x0040, 0x12aa: 0x0040, 0x12ab: 0x0040, 0x12ac: 0x0040, 0x12ad: 0x0040, 0x12ae: 0x0040, 0x12af: 0x0040, 0x12b0: 0x0040, 0x12b1: 0x0040, 0x12b2: 0x0040, 0x12b3: 0x0040, 0x12b4: 0x0040, 0x12b5: 0x0040, 0x12b6: 0x0040, 0x12b7: 0x0040, 0x12b8: 0x0040, 0x12b9: 0x0040, 0x12ba: 0x0040, 0x12bb: 0x0040, 0x12bc: 0x0040, 0x12bd: 0x0040, 0x12be: 0x0040, 0x12bf: 0x0040, // Block 0x4b, offset 0x12c0 0x12c0: 0x6fb9, 0x12c1: 0x6fd1, 0x12c2: 0x6fe9, 0x12c3: 0x7d15, 0x12c4: 0x7d35, 0x12c5: 0x7001, 0x12c6: 0x7001, 0x12c7: 0x0040, 0x12c8: 0x0040, 0x12c9: 0x0040, 0x12ca: 0x0040, 0x12cb: 0x0040, 0x12cc: 0x0040, 0x12cd: 0x0040, 0x12ce: 0x0040, 0x12cf: 0x0040, 0x12d0: 0x0040, 0x12d1: 0x0040, 0x12d2: 0x0040, 0x12d3: 0x7019, 0x12d4: 0x7041, 0x12d5: 0x7069, 0x12d6: 0x7091, 0x12d7: 0x70b9, 0x12d8: 0x0040, 0x12d9: 0x0040, 0x12da: 0x0040, 0x12db: 0x0040, 0x12dc: 0x0040, 0x12dd: 0x70e1, 0x12de: 0x3308, 0x12df: 0x7109, 0x12e0: 0x7131, 0x12e1: 0x20a9, 0x12e2: 0x20f1, 0x12e3: 0x7149, 0x12e4: 0x7161, 0x12e5: 0x7179, 0x12e6: 0x7191, 0x12e7: 0x71a9, 0x12e8: 0x71c1, 0x12e9: 0x1fb2, 0x12ea: 0x71d9, 0x12eb: 0x7201, 0x12ec: 0x7229, 0x12ed: 0x7261, 0x12ee: 0x7299, 0x12ef: 0x72c1, 0x12f0: 0x72e9, 0x12f1: 0x7311, 0x12f2: 0x7339, 0x12f3: 0x7361, 0x12f4: 0x7389, 0x12f5: 0x73b1, 0x12f6: 0x73d9, 0x12f7: 0x0040, 0x12f8: 0x7401, 0x12f9: 0x7429, 0x12fa: 0x7451, 0x12fb: 0x7479, 0x12fc: 0x74a1, 0x12fd: 0x0040, 0x12fe: 0x74c9, 0x12ff: 0x0040, // Block 0x4c, offset 0x1300 0x1300: 0x74f1, 0x1301: 0x7519, 0x1302: 0x0040, 0x1303: 0x7541, 0x1304: 0x7569, 0x1305: 0x0040, 0x1306: 0x7591, 0x1307: 0x75b9, 0x1308: 0x75e1, 0x1309: 0x7609, 0x130a: 0x7631, 0x130b: 0x7659, 0x130c: 0x7681, 0x130d: 0x76a9, 0x130e: 0x76d1, 0x130f: 0x76f9, 0x1310: 0x7721, 0x1311: 0x7721, 0x1312: 0x7739, 0x1313: 0x7739, 0x1314: 0x7739, 0x1315: 0x7739, 0x1316: 0x7751, 0x1317: 0x7751, 0x1318: 0x7751, 0x1319: 0x7751, 0x131a: 0x7769, 0x131b: 0x7769, 0x131c: 0x7769, 0x131d: 0x7769, 0x131e: 0x7781, 0x131f: 0x7781, 0x1320: 0x7781, 0x1321: 0x7781, 0x1322: 0x7799, 0x1323: 0x7799, 0x1324: 0x7799, 0x1325: 0x7799, 0x1326: 0x77b1, 0x1327: 0x77b1, 0x1328: 0x77b1, 0x1329: 0x77b1, 0x132a: 0x77c9, 0x132b: 0x77c9, 0x132c: 0x77c9, 0x132d: 0x77c9, 0x132e: 0x77e1, 0x132f: 0x77e1, 0x1330: 0x77e1, 0x1331: 0x77e1, 0x1332: 0x77f9, 0x1333: 0x77f9, 0x1334: 0x77f9, 0x1335: 0x77f9, 0x1336: 0x7811, 0x1337: 0x7811, 0x1338: 0x7811, 0x1339: 0x7811, 0x133a: 0x7829, 0x133b: 0x7829, 0x133c: 0x7829, 0x133d: 0x7829, 0x133e: 0x7841, 0x133f: 0x7841, // Block 0x4d, offset 0x1340 0x1340: 0x7841, 0x1341: 0x7841, 0x1342: 0x7859, 0x1343: 0x7859, 0x1344: 0x7871, 0x1345: 0x7871, 0x1346: 0x7889, 0x1347: 0x7889, 0x1348: 0x78a1, 0x1349: 0x78a1, 0x134a: 0x78b9, 0x134b: 0x78b9, 0x134c: 0x78d1, 0x134d: 0x78d1, 0x134e: 0x78e9, 0x134f: 0x78e9, 0x1350: 0x78e9, 0x1351: 0x78e9, 0x1352: 0x7901, 0x1353: 0x7901, 0x1354: 0x7901, 0x1355: 0x7901, 0x1356: 0x7919, 0x1357: 0x7919, 0x1358: 0x7919, 0x1359: 0x7919, 0x135a: 0x7931, 0x135b: 0x7931, 0x135c: 0x7931, 0x135d: 0x7931, 0x135e: 0x7949, 0x135f: 0x7949, 0x1360: 0x7961, 0x1361: 0x7961, 0x1362: 0x7961, 0x1363: 0x7961, 0x1364: 0x7979, 0x1365: 0x7979, 0x1366: 0x7991, 0x1367: 0x7991, 0x1368: 0x7991, 0x1369: 0x7991, 0x136a: 0x79a9, 0x136b: 0x79a9, 0x136c: 0x79a9, 0x136d: 0x79a9, 0x136e: 0x79c1, 0x136f: 0x79c1, 0x1370: 0x79d9, 0x1371: 0x79d9, 0x1372: 0x0818, 0x1373: 0x0818, 0x1374: 0x0818, 0x1375: 0x0818, 0x1376: 0x0818, 0x1377: 0x0818, 0x1378: 0x0818, 0x1379: 0x0818, 0x137a: 0x0818, 0x137b: 0x0818, 0x137c: 0x0818, 0x137d: 0x0818, 0x137e: 0x0818, 0x137f: 0x0818, // Block 0x4e, offset 0x1380 0x1380: 0x0818, 0x1381: 0x0818, 0x1382: 0x0040, 0x1383: 0x0040, 0x1384: 0x0040, 0x1385: 0x0040, 0x1386: 0x0040, 0x1387: 0x0040, 0x1388: 0x0040, 0x1389: 0x0040, 0x138a: 0x0040, 0x138b: 0x0040, 0x138c: 0x0040, 0x138d: 0x0040, 0x138e: 0x0040, 0x138f: 0x0040, 0x1390: 0x0040, 0x1391: 0x0040, 0x1392: 0x0040, 0x1393: 0x79f1, 0x1394: 0x79f1, 0x1395: 0x79f1, 0x1396: 0x79f1, 0x1397: 0x7a09, 0x1398: 0x7a09, 0x1399: 0x7a21, 0x139a: 0x7a21, 0x139b: 0x7a39, 0x139c: 0x7a39, 0x139d: 0x0479, 0x139e: 0x7a51, 0x139f: 0x7a51, 0x13a0: 0x7a69, 0x13a1: 0x7a69, 0x13a2: 0x7a81, 0x13a3: 0x7a81, 0x13a4: 0x7a99, 0x13a5: 0x7a99, 0x13a6: 0x7a99, 0x13a7: 0x7a99, 0x13a8: 0x7ab1, 0x13a9: 0x7ab1, 0x13aa: 0x7ac9, 0x13ab: 0x7ac9, 0x13ac: 0x7af1, 0x13ad: 0x7af1, 0x13ae: 0x7b19, 0x13af: 0x7b19, 0x13b0: 0x7b41, 0x13b1: 0x7b41, 0x13b2: 0x7b69, 0x13b3: 0x7b69, 0x13b4: 0x7b91, 0x13b5: 0x7b91, 0x13b6: 0x7bb9, 0x13b7: 0x7bb9, 0x13b8: 0x7bb9, 0x13b9: 0x7be1, 0x13ba: 0x7be1, 0x13bb: 0x7be1, 0x13bc: 0x7c09, 0x13bd: 0x7c09, 0x13be: 0x7c09, 0x13bf: 0x7c09, // Block 0x4f, offset 0x13c0 0x13c0: 0x85f9, 0x13c1: 0x8621, 0x13c2: 0x8649, 0x13c3: 0x8671, 0x13c4: 0x8699, 0x13c5: 0x86c1, 0x13c6: 0x86e9, 0x13c7: 0x8711, 0x13c8: 0x8739, 0x13c9: 0x8761, 0x13ca: 0x8789, 0x13cb: 0x87b1, 0x13cc: 0x87d9, 0x13cd: 0x8801, 0x13ce: 0x8829, 0x13cf: 0x8851, 0x13d0: 0x8879, 0x13d1: 0x88a1, 0x13d2: 0x88c9, 0x13d3: 0x88f1, 0x13d4: 0x8919, 0x13d5: 0x8941, 0x13d6: 0x8969, 0x13d7: 0x8991, 0x13d8: 0x89b9, 0x13d9: 0x89e1, 0x13da: 0x8a09, 0x13db: 0x8a31, 0x13dc: 0x8a59, 0x13dd: 0x8a81, 0x13de: 0x8aaa, 0x13df: 0x8ada, 0x13e0: 0x8b0a, 0x13e1: 0x8b3a, 0x13e2: 0x8b6a, 0x13e3: 0x8b9a, 0x13e4: 0x8bc9, 0x13e5: 0x8bf1, 0x13e6: 0x7c71, 0x13e7: 0x8c19, 0x13e8: 0x7be1, 0x13e9: 0x7c99, 0x13ea: 0x8c41, 0x13eb: 0x8c69, 0x13ec: 0x7d39, 0x13ed: 0x8c91, 0x13ee: 0x7d61, 0x13ef: 0x7d89, 0x13f0: 0x8cb9, 0x13f1: 0x8ce1, 0x13f2: 0x7e29, 0x13f3: 0x8d09, 0x13f4: 0x7e51, 0x13f5: 0x7e79, 0x13f6: 0x8d31, 0x13f7: 0x8d59, 0x13f8: 0x7ec9, 0x13f9: 0x8d81, 0x13fa: 0x7ef1, 0x13fb: 0x7f19, 0x13fc: 0x83a1, 0x13fd: 0x83c9, 0x13fe: 0x8441, 0x13ff: 0x8469, // Block 0x50, offset 0x1400 0x1400: 0x8491, 0x1401: 0x8531, 0x1402: 0x8559, 0x1403: 0x8581, 0x1404: 0x85a9, 0x1405: 0x8649, 0x1406: 0x8671, 0x1407: 0x8699, 0x1408: 0x8da9, 0x1409: 0x8739, 0x140a: 0x8dd1, 0x140b: 0x8df9, 0x140c: 0x8829, 0x140d: 0x8e21, 0x140e: 0x8851, 0x140f: 0x8879, 0x1410: 0x8a81, 0x1411: 0x8e49, 0x1412: 0x8e71, 0x1413: 0x89b9, 0x1414: 0x8e99, 0x1415: 0x89e1, 0x1416: 0x8a09, 0x1417: 0x7c21, 0x1418: 0x7c49, 0x1419: 0x8ec1, 0x141a: 0x7c71, 0x141b: 0x8ee9, 0x141c: 0x7cc1, 0x141d: 0x7ce9, 0x141e: 0x7d11, 0x141f: 0x7d39, 0x1420: 0x8f11, 0x1421: 0x7db1, 0x1422: 0x7dd9, 0x1423: 0x7e01, 0x1424: 0x7e29, 0x1425: 0x8f39, 0x1426: 0x7ec9, 0x1427: 0x7f41, 0x1428: 0x7f69, 0x1429: 0x7f91, 0x142a: 0x7fb9, 0x142b: 0x7fe1, 0x142c: 0x8031, 0x142d: 0x8059, 0x142e: 0x8081, 0x142f: 0x80a9, 0x1430: 0x80d1, 0x1431: 0x80f9, 0x1432: 0x8f61, 0x1433: 0x8121, 0x1434: 0x8149, 0x1435: 0x8171, 0x1436: 0x8199, 0x1437: 0x81c1, 0x1438: 0x81e9, 0x1439: 0x8239, 0x143a: 0x8261, 0x143b: 0x8289, 0x143c: 0x82b1, 0x143d: 0x82d9, 0x143e: 0x8301, 0x143f: 0x8329, // Block 0x51, offset 0x1440 0x1440: 0x8351, 0x1441: 0x8379, 0x1442: 0x83f1, 0x1443: 0x8419, 0x1444: 0x84b9, 0x1445: 0x84e1, 0x1446: 0x8509, 0x1447: 0x8531, 0x1448: 0x8559, 0x1449: 0x85d1, 0x144a: 0x85f9, 0x144b: 0x8621, 0x144c: 0x8649, 0x144d: 0x8f89, 0x144e: 0x86c1, 0x144f: 0x86e9, 0x1450: 0x8711, 0x1451: 0x8739, 0x1452: 0x87b1, 0x1453: 0x87d9, 0x1454: 0x8801, 0x1455: 0x8829, 0x1456: 0x8fb1, 0x1457: 0x88a1, 0x1458: 0x88c9, 0x1459: 0x8fd9, 0x145a: 0x8941, 0x145b: 0x8969, 0x145c: 0x8991, 0x145d: 0x89b9, 0x145e: 0x9001, 0x145f: 0x7c71, 0x1460: 0x8ee9, 0x1461: 0x7d39, 0x1462: 0x8f11, 0x1463: 0x7e29, 0x1464: 0x8f39, 0x1465: 0x7ec9, 0x1466: 0x9029, 0x1467: 0x80d1, 0x1468: 0x9051, 0x1469: 0x9079, 0x146a: 0x90a1, 0x146b: 0x8531, 0x146c: 0x8559, 0x146d: 0x8649, 0x146e: 0x8829, 0x146f: 0x8fb1, 0x1470: 0x89b9, 0x1471: 0x9001, 0x1472: 0x90c9, 0x1473: 0x9101, 0x1474: 0x9139, 0x1475: 0x9171, 0x1476: 0x9199, 0x1477: 0x91c1, 0x1478: 0x91e9, 0x1479: 0x9211, 0x147a: 0x9239, 0x147b: 0x9261, 0x147c: 0x9289, 0x147d: 0x92b1, 0x147e: 0x92d9, 0x147f: 0x9301, // Block 0x52, offset 0x1480 0x1480: 0x9329, 0x1481: 0x9351, 0x1482: 0x9379, 0x1483: 0x93a1, 0x1484: 0x93c9, 0x1485: 0x93f1, 0x1486: 0x9419, 0x1487: 0x9441, 0x1488: 0x9469, 0x1489: 0x9491, 0x148a: 0x94b9, 0x148b: 0x94e1, 0x148c: 0x9079, 0x148d: 0x9509, 0x148e: 0x9531, 0x148f: 0x9559, 0x1490: 0x9581, 0x1491: 0x9171, 0x1492: 0x9199, 0x1493: 0x91c1, 0x1494: 0x91e9, 0x1495: 0x9211, 0x1496: 0x9239, 0x1497: 0x9261, 0x1498: 0x9289, 0x1499: 0x92b1, 0x149a: 0x92d9, 0x149b: 0x9301, 0x149c: 0x9329, 0x149d: 0x9351, 0x149e: 0x9379, 0x149f: 0x93a1, 0x14a0: 0x93c9, 0x14a1: 0x93f1, 0x14a2: 0x9419, 0x14a3: 0x9441, 0x14a4: 0x9469, 0x14a5: 0x9491, 0x14a6: 0x94b9, 0x14a7: 0x94e1, 0x14a8: 0x9079, 0x14a9: 0x9509, 0x14aa: 0x9531, 0x14ab: 0x9559, 0x14ac: 0x9581, 0x14ad: 0x9491, 0x14ae: 0x94b9, 0x14af: 0x94e1, 0x14b0: 0x9079, 0x14b1: 0x9051, 0x14b2: 0x90a1, 0x14b3: 0x8211, 0x14b4: 0x8059, 0x14b5: 0x8081, 0x14b6: 0x80a9, 0x14b7: 0x9491, 0x14b8: 0x94b9, 0x14b9: 0x94e1, 0x14ba: 0x8211, 0x14bb: 0x8239, 0x14bc: 0x95a9, 0x14bd: 0x95a9, 0x14be: 0x0018, 0x14bf: 0x0018, // Block 0x53, offset 0x14c0 0x14c0: 0x0040, 0x14c1: 0x0040, 0x14c2: 0x0040, 0x14c3: 0x0040, 0x14c4: 0x0040, 0x14c5: 0x0040, 0x14c6: 0x0040, 0x14c7: 0x0040, 0x14c8: 0x0040, 0x14c9: 0x0040, 0x14ca: 0x0040, 0x14cb: 0x0040, 0x14cc: 0x0040, 0x14cd: 0x0040, 0x14ce: 0x0040, 0x14cf: 0x0040, 0x14d0: 0x95d1, 0x14d1: 0x9609, 0x14d2: 0x9609, 0x14d3: 0x9641, 0x14d4: 0x9679, 0x14d5: 0x96b1, 0x14d6: 0x96e9, 0x14d7: 0x9721, 0x14d8: 0x9759, 0x14d9: 0x9759, 0x14da: 0x9791, 0x14db: 0x97c9, 0x14dc: 0x9801, 0x14dd: 0x9839, 0x14de: 0x9871, 0x14df: 0x98a9, 0x14e0: 0x98a9, 0x14e1: 0x98e1, 0x14e2: 0x9919, 0x14e3: 0x9919, 0x14e4: 0x9951, 0x14e5: 0x9951, 0x14e6: 0x9989, 0x14e7: 0x99c1, 0x14e8: 0x99c1, 0x14e9: 0x99f9, 0x14ea: 0x9a31, 0x14eb: 0x9a31, 0x14ec: 0x9a69, 0x14ed: 0x9a69, 0x14ee: 0x9aa1, 0x14ef: 0x9ad9, 0x14f0: 0x9ad9, 0x14f1: 0x9b11, 0x14f2: 0x9b11, 0x14f3: 0x9b49, 0x14f4: 0x9b81, 0x14f5: 0x9bb9, 0x14f6: 0x9bf1, 0x14f7: 0x9bf1, 0x14f8: 0x9c29, 0x14f9: 0x9c61, 0x14fa: 0x9c99, 0x14fb: 0x9cd1, 0x14fc: 0x9d09, 0x14fd: 0x9d09, 0x14fe: 0x9d41, 0x14ff: 0x9d79, // Block 0x54, offset 0x1500 0x1500: 0xa949, 0x1501: 0xa981, 0x1502: 0xa9b9, 0x1503: 0xa8a1, 0x1504: 0x9bb9, 0x1505: 0x9989, 0x1506: 0xa9f1, 0x1507: 0xaa29, 0x1508: 0x0040, 0x1509: 0x0040, 0x150a: 0x0040, 0x150b: 0x0040, 0x150c: 0x0040, 0x150d: 0x0040, 0x150e: 0x0040, 0x150f: 0x0040, 0x1510: 0x0040, 0x1511: 0x0040, 0x1512: 0x0040, 0x1513: 0x0040, 0x1514: 0x0040, 0x1515: 0x0040, 0x1516: 0x0040, 0x1517: 0x0040, 0x1518: 0x0040, 0x1519: 0x0040, 0x151a: 0x0040, 0x151b: 0x0040, 0x151c: 0x0040, 0x151d: 0x0040, 0x151e: 0x0040, 0x151f: 0x0040, 0x1520: 0x0040, 0x1521: 0x0040, 0x1522: 0x0040, 0x1523: 0x0040, 0x1524: 0x0040, 0x1525: 0x0040, 0x1526: 0x0040, 0x1527: 0x0040, 0x1528: 0x0040, 0x1529: 0x0040, 0x152a: 0x0040, 0x152b: 0x0040, 0x152c: 0x0040, 0x152d: 0x0040, 0x152e: 0x0040, 0x152f: 0x0040, 0x1530: 0xaa61, 0x1531: 0xaa99, 0x1532: 0xaad1, 0x1533: 0xab19, 0x1534: 0xab61, 0x1535: 0xaba9, 0x1536: 0xabf1, 0x1537: 0xac39, 0x1538: 0xac81, 0x1539: 0xacc9, 0x153a: 0xad02, 0x153b: 0xae12, 0x153c: 0xae91, 0x153d: 0x0018, 0x153e: 0x0040, 0x153f: 0x0040, // Block 0x55, offset 0x1540 0x1540: 0x33c0, 0x1541: 0x33c0, 0x1542: 0x33c0, 0x1543: 0x33c0, 0x1544: 0x33c0, 0x1545: 0x33c0, 0x1546: 0x33c0, 0x1547: 0x33c0, 0x1548: 0x33c0, 0x1549: 0x33c0, 0x154a: 0x33c0, 0x154b: 0x33c0, 0x154c: 0x33c0, 0x154d: 0x33c0, 0x154e: 0x33c0, 0x154f: 0x33c0, 0x1550: 0xaeda, 0x1551: 0x7d55, 0x1552: 0x0040, 0x1553: 0xaeea, 0x1554: 0x03c2, 0x1555: 0xaefa, 0x1556: 0xaf0a, 0x1557: 0x7d75, 0x1558: 0x7d95, 0x1559: 0x0040, 0x155a: 0x0040, 0x155b: 0x0040, 0x155c: 0x0040, 0x155d: 0x0040, 0x155e: 0x0040, 0x155f: 0x0040, 0x1560: 0x3308, 0x1561: 0x3308, 0x1562: 0x3308, 0x1563: 0x3308, 0x1564: 0x3308, 0x1565: 0x3308, 0x1566: 0x3308, 0x1567: 0x3308, 0x1568: 0x3308, 0x1569: 0x3308, 0x156a: 0x3308, 0x156b: 0x3308, 0x156c: 0x3308, 0x156d: 0x3308, 0x156e: 0x3308, 0x156f: 0x3308, 0x1570: 0x0040, 0x1571: 0x7db5, 0x1572: 0x7dd5, 0x1573: 0xaf1a, 0x1574: 0xaf1a, 0x1575: 0x1fd2, 0x1576: 0x1fe2, 0x1577: 0xaf2a, 0x1578: 0xaf3a, 0x1579: 0x7df5, 0x157a: 0x7e15, 0x157b: 0x7e35, 0x157c: 0x7df5, 0x157d: 0x7e55, 0x157e: 0x7e75, 0x157f: 0x7e55, // Block 0x56, offset 0x1580 0x1580: 0x7e95, 0x1581: 0x7eb5, 0x1582: 0x7ed5, 0x1583: 0x7eb5, 0x1584: 0x7ef5, 0x1585: 0x0018, 0x1586: 0x0018, 0x1587: 0xaf4a, 0x1588: 0xaf5a, 0x1589: 0x7f16, 0x158a: 0x7f36, 0x158b: 0x7f56, 0x158c: 0x7f76, 0x158d: 0xaf1a, 0x158e: 0xaf1a, 0x158f: 0xaf1a, 0x1590: 0xaeda, 0x1591: 0x7f95, 0x1592: 0x0040, 0x1593: 0x0040, 0x1594: 0x03c2, 0x1595: 0xaeea, 0x1596: 0xaf0a, 0x1597: 0xaefa, 0x1598: 0x7fb5, 0x1599: 0x1fd2, 0x159a: 0x1fe2, 0x159b: 0xaf2a, 0x159c: 0xaf3a, 0x159d: 0x7e95, 0x159e: 0x7ef5, 0x159f: 0xaf6a, 0x15a0: 0xaf7a, 0x15a1: 0xaf8a, 0x15a2: 0x1fb2, 0x15a3: 0xaf99, 0x15a4: 0xafaa, 0x15a5: 0xafba, 0x15a6: 0x1fc2, 0x15a7: 0x0040, 0x15a8: 0xafca, 0x15a9: 0xafda, 0x15aa: 0xafea, 0x15ab: 0xaffa, 0x15ac: 0x0040, 0x15ad: 0x0040, 0x15ae: 0x0040, 0x15af: 0x0040, 0x15b0: 0x7fd6, 0x15b1: 0xb009, 0x15b2: 0x7ff6, 0x15b3: 0x0808, 0x15b4: 0x8016, 0x15b5: 0x0040, 0x15b6: 0x8036, 0x15b7: 0xb031, 0x15b8: 0x8056, 0x15b9: 0xb059, 0x15ba: 0x8076, 0x15bb: 0xb081, 0x15bc: 0x8096, 0x15bd: 0xb0a9, 0x15be: 0x80b6, 0x15bf: 0xb0d1, // Block 0x57, offset 0x15c0 0x15c0: 0xb0f9, 0x15c1: 0xb111, 0x15c2: 0xb111, 0x15c3: 0xb129, 0x15c4: 0xb129, 0x15c5: 0xb141, 0x15c6: 0xb141, 0x15c7: 0xb159, 0x15c8: 0xb159, 0x15c9: 0xb171, 0x15ca: 0xb171, 0x15cb: 0xb171, 0x15cc: 0xb171, 0x15cd: 0xb189, 0x15ce: 0xb189, 0x15cf: 0xb1a1, 0x15d0: 0xb1a1, 0x15d1: 0xb1a1, 0x15d2: 0xb1a1, 0x15d3: 0xb1b9, 0x15d4: 0xb1b9, 0x15d5: 0xb1d1, 0x15d6: 0xb1d1, 0x15d7: 0xb1d1, 0x15d8: 0xb1d1, 0x15d9: 0xb1e9, 0x15da: 0xb1e9, 0x15db: 0xb1e9, 0x15dc: 0xb1e9, 0x15dd: 0xb201, 0x15de: 0xb201, 0x15df: 0xb201, 0x15e0: 0xb201, 0x15e1: 0xb219, 0x15e2: 0xb219, 0x15e3: 0xb219, 0x15e4: 0xb219, 0x15e5: 0xb231, 0x15e6: 0xb231, 0x15e7: 0xb231, 0x15e8: 0xb231, 0x15e9: 0xb249, 0x15ea: 0xb249, 0x15eb: 0xb261, 0x15ec: 0xb261, 0x15ed: 0xb279, 0x15ee: 0xb279, 0x15ef: 0xb291, 0x15f0: 0xb291, 0x15f1: 0xb2a9, 0x15f2: 0xb2a9, 0x15f3: 0xb2a9, 0x15f4: 0xb2a9, 0x15f5: 0xb2c1, 0x15f6: 0xb2c1, 0x15f7: 0xb2c1, 0x15f8: 0xb2c1, 0x15f9: 0xb2d9, 0x15fa: 0xb2d9, 0x15fb: 0xb2d9, 0x15fc: 0xb2d9, 0x15fd: 0xb2f1, 0x15fe: 0xb2f1, 0x15ff: 0xb2f1, // Block 0x58, offset 0x1600 0x1600: 0xb2f1, 0x1601: 0xb309, 0x1602: 0xb309, 0x1603: 0xb309, 0x1604: 0xb309, 0x1605: 0xb321, 0x1606: 0xb321, 0x1607: 0xb321, 0x1608: 0xb321, 0x1609: 0xb339, 0x160a: 0xb339, 0x160b: 0xb339, 0x160c: 0xb339, 0x160d: 0xb351, 0x160e: 0xb351, 0x160f: 0xb351, 0x1610: 0xb351, 0x1611: 0xb369, 0x1612: 0xb369, 0x1613: 0xb369, 0x1614: 0xb369, 0x1615: 0xb381, 0x1616: 0xb381, 0x1617: 0xb381, 0x1618: 0xb381, 0x1619: 0xb399, 0x161a: 0xb399, 0x161b: 0xb399, 0x161c: 0xb399, 0x161d: 0xb3b1, 0x161e: 0xb3b1, 0x161f: 0xb3b1, 0x1620: 0xb3b1, 0x1621: 0xb3c9, 0x1622: 0xb3c9, 0x1623: 0xb3c9, 0x1624: 0xb3c9, 0x1625: 0xb3e1, 0x1626: 0xb3e1, 0x1627: 0xb3e1, 0x1628: 0xb3e1, 0x1629: 0xb3f9, 0x162a: 0xb3f9, 0x162b: 0xb3f9, 0x162c: 0xb3f9, 0x162d: 0xb411, 0x162e: 0xb411, 0x162f: 0x7ab1, 0x1630: 0x7ab1, 0x1631: 0xb429, 0x1632: 0xb429, 0x1633: 0xb429, 0x1634: 0xb429, 0x1635: 0xb441, 0x1636: 0xb441, 0x1637: 0xb469, 0x1638: 0xb469, 0x1639: 0xb491, 0x163a: 0xb491, 0x163b: 0xb4b9, 0x163c: 0xb4b9, 0x163d: 0x0040, 0x163e: 0x0040, 0x163f: 0x03c0, // Block 0x59, offset 0x1640 0x1640: 0x0040, 0x1641: 0xaefa, 0x1642: 0xb4e2, 0x1643: 0xaf6a, 0x1644: 0xafda, 0x1645: 0xafea, 0x1646: 0xaf7a, 0x1647: 0xb4f2, 0x1648: 0x1fd2, 0x1649: 0x1fe2, 0x164a: 0xaf8a, 0x164b: 0x1fb2, 0x164c: 0xaeda, 0x164d: 0xaf99, 0x164e: 0x29d1, 0x164f: 0xb502, 0x1650: 0x1f41, 0x1651: 0x00c9, 0x1652: 0x0069, 0x1653: 0x0079, 0x1654: 0x1f51, 0x1655: 0x1f61, 0x1656: 0x1f71, 0x1657: 0x1f81, 0x1658: 0x1f91, 0x1659: 0x1fa1, 0x165a: 0xaeea, 0x165b: 0x03c2, 0x165c: 0xafaa, 0x165d: 0x1fc2, 0x165e: 0xafba, 0x165f: 0xaf0a, 0x1660: 0xaffa, 0x1661: 0x0039, 0x1662: 0x0ee9, 0x1663: 0x1159, 0x1664: 0x0ef9, 0x1665: 0x0f09, 0x1666: 0x1199, 0x1667: 0x0f31, 0x1668: 0x0249, 0x1669: 0x0f41, 0x166a: 0x0259, 0x166b: 0x0f51, 0x166c: 0x0359, 0x166d: 0x0f61, 0x166e: 0x0f71, 0x166f: 0x00d9, 0x1670: 0x0f99, 0x1671: 0x2039, 0x1672: 0x0269, 0x1673: 0x01d9, 0x1674: 0x0fa9, 0x1675: 0x0fb9, 0x1676: 0x1089, 0x1677: 0x0279, 0x1678: 0x0369, 0x1679: 0x0289, 0x167a: 0x13d1, 0x167b: 0xaf4a, 0x167c: 0xafca, 0x167d: 0xaf5a, 0x167e: 0xb512, 0x167f: 0xaf1a, // Block 0x5a, offset 0x1680 0x1680: 0x1caa, 0x1681: 0x0039, 0x1682: 0x0ee9, 0x1683: 0x1159, 0x1684: 0x0ef9, 0x1685: 0x0f09, 0x1686: 0x1199, 0x1687: 0x0f31, 0x1688: 0x0249, 0x1689: 0x0f41, 0x168a: 0x0259, 0x168b: 0x0f51, 0x168c: 0x0359, 0x168d: 0x0f61, 0x168e: 0x0f71, 0x168f: 0x00d9, 0x1690: 0x0f99, 0x1691: 0x2039, 0x1692: 0x0269, 0x1693: 0x01d9, 0x1694: 0x0fa9, 0x1695: 0x0fb9, 0x1696: 0x1089, 0x1697: 0x0279, 0x1698: 0x0369, 0x1699: 0x0289, 0x169a: 0x13d1, 0x169b: 0xaf2a, 0x169c: 0xb522, 0x169d: 0xaf3a, 0x169e: 0xb532, 0x169f: 0x80d5, 0x16a0: 0x80f5, 0x16a1: 0x29d1, 0x16a2: 0x8115, 0x16a3: 0x8115, 0x16a4: 0x8135, 0x16a5: 0x8155, 0x16a6: 0x8175, 0x16a7: 0x8195, 0x16a8: 0x81b5, 0x16a9: 0x81d5, 0x16aa: 0x81f5, 0x16ab: 0x8215, 0x16ac: 0x8235, 0x16ad: 0x8255, 0x16ae: 0x8275, 0x16af: 0x8295, 0x16b0: 0x82b5, 0x16b1: 0x82d5, 0x16b2: 0x82f5, 0x16b3: 0x8315, 0x16b4: 0x8335, 0x16b5: 0x8355, 0x16b6: 0x8375, 0x16b7: 0x8395, 0x16b8: 0x83b5, 0x16b9: 0x83d5, 0x16ba: 0x83f5, 0x16bb: 0x8415, 0x16bc: 0x81b5, 0x16bd: 0x8435, 0x16be: 0x8455, 0x16bf: 0x8215, // Block 0x5b, offset 0x16c0 0x16c0: 0x8475, 0x16c1: 0x8495, 0x16c2: 0x84b5, 0x16c3: 0x84d5, 0x16c4: 0x84f5, 0x16c5: 0x8515, 0x16c6: 0x8535, 0x16c7: 0x8555, 0x16c8: 0x84d5, 0x16c9: 0x8575, 0x16ca: 0x84d5, 0x16cb: 0x8595, 0x16cc: 0x8595, 0x16cd: 0x85b5, 0x16ce: 0x85b5, 0x16cf: 0x85d5, 0x16d0: 0x8515, 0x16d1: 0x85f5, 0x16d2: 0x8615, 0x16d3: 0x85f5, 0x16d4: 0x8635, 0x16d5: 0x8615, 0x16d6: 0x8655, 0x16d7: 0x8655, 0x16d8: 0x8675, 0x16d9: 0x8675, 0x16da: 0x8695, 0x16db: 0x8695, 0x16dc: 0x8615, 0x16dd: 0x8115, 0x16de: 0x86b5, 0x16df: 0x86d5, 0x16e0: 0x0040, 0x16e1: 0x86f5, 0x16e2: 0x8715, 0x16e3: 0x8735, 0x16e4: 0x8755, 0x16e5: 0x8735, 0x16e6: 0x8775, 0x16e7: 0x8795, 0x16e8: 0x87b5, 0x16e9: 0x87b5, 0x16ea: 0x87d5, 0x16eb: 0x87d5, 0x16ec: 0x87f5, 0x16ed: 0x87f5, 0x16ee: 0x87d5, 0x16ef: 0x87d5, 0x16f0: 0x8815, 0x16f1: 0x8835, 0x16f2: 0x8855, 0x16f3: 0x8875, 0x16f4: 0x8895, 0x16f5: 0x88b5, 0x16f6: 0x88b5, 0x16f7: 0x88b5, 0x16f8: 0x88d5, 0x16f9: 0x88d5, 0x16fa: 0x88d5, 0x16fb: 0x88d5, 0x16fc: 0x87b5, 0x16fd: 0x87b5, 0x16fe: 0x87b5, 0x16ff: 0x0040, // Block 0x5c, offset 0x1700 0x1700: 0x0040, 0x1701: 0x0040, 0x1702: 0x8715, 0x1703: 0x86f5, 0x1704: 0x88f5, 0x1705: 0x86f5, 0x1706: 0x8715, 0x1707: 0x86f5, 0x1708: 0x0040, 0x1709: 0x0040, 0x170a: 0x8915, 0x170b: 0x8715, 0x170c: 0x8935, 0x170d: 0x88f5, 0x170e: 0x8935, 0x170f: 0x8715, 0x1710: 0x0040, 0x1711: 0x0040, 0x1712: 0x8955, 0x1713: 0x8975, 0x1714: 0x8875, 0x1715: 0x8935, 0x1716: 0x88f5, 0x1717: 0x8935, 0x1718: 0x0040, 0x1719: 0x0040, 0x171a: 0x8995, 0x171b: 0x89b5, 0x171c: 0x8995, 0x171d: 0x0040, 0x171e: 0x0040, 0x171f: 0x0040, 0x1720: 0xb541, 0x1721: 0xb559, 0x1722: 0xb571, 0x1723: 0x89d6, 0x1724: 0xb589, 0x1725: 0xb5a1, 0x1726: 0x89f5, 0x1727: 0x0040, 0x1728: 0x8a15, 0x1729: 0x8a35, 0x172a: 0x8a55, 0x172b: 0x8a35, 0x172c: 0x8a75, 0x172d: 0x8a95, 0x172e: 0x8ab5, 0x172f: 0x0040, 0x1730: 0x0040, 0x1731: 0x0040, 0x1732: 0x0040, 0x1733: 0x0040, 0x1734: 0x0040, 0x1735: 0x0040, 0x1736: 0x0040, 0x1737: 0x0040, 0x1738: 0x0040, 0x1739: 0x0340, 0x173a: 0x0340, 0x173b: 0x0340, 0x173c: 0x0040, 0x173d: 0x0040, 0x173e: 0x0040, 0x173f: 0x0040, // Block 0x5d, offset 0x1740 0x1740: 0x0a08, 0x1741: 0x0a08, 0x1742: 0x0a08, 0x1743: 0x0a08, 0x1744: 0x0a08, 0x1745: 0x0c08, 0x1746: 0x0808, 0x1747: 0x0c08, 0x1748: 0x0818, 0x1749: 0x0c08, 0x174a: 0x0c08, 0x174b: 0x0808, 0x174c: 0x0808, 0x174d: 0x0908, 0x174e: 0x0c08, 0x174f: 0x0c08, 0x1750: 0x0c08, 0x1751: 0x0c08, 0x1752: 0x0c08, 0x1753: 0x0a08, 0x1754: 0x0a08, 0x1755: 0x0a08, 0x1756: 0x0a08, 0x1757: 0x0908, 0x1758: 0x0a08, 0x1759: 0x0a08, 0x175a: 0x0a08, 0x175b: 0x0a08, 0x175c: 0x0a08, 0x175d: 0x0c08, 0x175e: 0x0a08, 0x175f: 0x0a08, 0x1760: 0x0a08, 0x1761: 0x0c08, 0x1762: 0x0808, 0x1763: 0x0808, 0x1764: 0x0c08, 0x1765: 0x3308, 0x1766: 0x3308, 0x1767: 0x0040, 0x1768: 0x0040, 0x1769: 0x0040, 0x176a: 0x0040, 0x176b: 0x0a18, 0x176c: 0x0a18, 0x176d: 0x0a18, 0x176e: 0x0a18, 0x176f: 0x0c18, 0x1770: 0x0818, 0x1771: 0x0818, 0x1772: 0x0818, 0x1773: 0x0818, 0x1774: 0x0818, 0x1775: 0x0818, 0x1776: 0x0818, 0x1777: 0x0040, 0x1778: 0x0040, 0x1779: 0x0040, 0x177a: 0x0040, 0x177b: 0x0040, 0x177c: 0x0040, 0x177d: 0x0040, 0x177e: 0x0040, 0x177f: 0x0040, // Block 0x5e, offset 0x1780 0x1780: 0x0a08, 0x1781: 0x0c08, 0x1782: 0x0a08, 0x1783: 0x0c08, 0x1784: 0x0c08, 0x1785: 0x0c08, 0x1786: 0x0a08, 0x1787: 0x0a08, 0x1788: 0x0a08, 0x1789: 0x0c08, 0x178a: 0x0a08, 0x178b: 0x0a08, 0x178c: 0x0c08, 0x178d: 0x0a08, 0x178e: 0x0c08, 0x178f: 0x0c08, 0x1790: 0x0a08, 0x1791: 0x0c08, 0x1792: 0x0040, 0x1793: 0x0040, 0x1794: 0x0040, 0x1795: 0x0040, 0x1796: 0x0040, 0x1797: 0x0040, 0x1798: 0x0040, 0x1799: 0x0818, 0x179a: 0x0818, 0x179b: 0x0818, 0x179c: 0x0818, 0x179d: 0x0040, 0x179e: 0x0040, 0x179f: 0x0040, 0x17a0: 0x0040, 0x17a1: 0x0040, 0x17a2: 0x0040, 0x17a3: 0x0040, 0x17a4: 0x0040, 0x17a5: 0x0040, 0x17a6: 0x0040, 0x17a7: 0x0040, 0x17a8: 0x0040, 0x17a9: 0x0c18, 0x17aa: 0x0c18, 0x17ab: 0x0c18, 0x17ac: 0x0c18, 0x17ad: 0x0a18, 0x17ae: 0x0a18, 0x17af: 0x0818, 0x17b0: 0x0040, 0x17b1: 0x0040, 0x17b2: 0x0040, 0x17b3: 0x0040, 0x17b4: 0x0040, 0x17b5: 0x0040, 0x17b6: 0x0040, 0x17b7: 0x0040, 0x17b8: 0x0040, 0x17b9: 0x0040, 0x17ba: 0x0040, 0x17bb: 0x0040, 0x17bc: 0x0040, 0x17bd: 0x0040, 0x17be: 0x0040, 0x17bf: 0x0040, // Block 0x5f, offset 0x17c0 0x17c0: 0x3308, 0x17c1: 0x3308, 0x17c2: 0x3008, 0x17c3: 0x3008, 0x17c4: 0x0040, 0x17c5: 0x0008, 0x17c6: 0x0008, 0x17c7: 0x0008, 0x17c8: 0x0008, 0x17c9: 0x0008, 0x17ca: 0x0008, 0x17cb: 0x0008, 0x17cc: 0x0008, 0x17cd: 0x0040, 0x17ce: 0x0040, 0x17cf: 0x0008, 0x17d0: 0x0008, 0x17d1: 0x0040, 0x17d2: 0x0040, 0x17d3: 0x0008, 0x17d4: 0x0008, 0x17d5: 0x0008, 0x17d6: 0x0008, 0x17d7: 0x0008, 0x17d8: 0x0008, 0x17d9: 0x0008, 0x17da: 0x0008, 0x17db: 0x0008, 0x17dc: 0x0008, 0x17dd: 0x0008, 0x17de: 0x0008, 0x17df: 0x0008, 0x17e0: 0x0008, 0x17e1: 0x0008, 0x17e2: 0x0008, 0x17e3: 0x0008, 0x17e4: 0x0008, 0x17e5: 0x0008, 0x17e6: 0x0008, 0x17e7: 0x0008, 0x17e8: 0x0008, 0x17e9: 0x0040, 0x17ea: 0x0008, 0x17eb: 0x0008, 0x17ec: 0x0008, 0x17ed: 0x0008, 0x17ee: 0x0008, 0x17ef: 0x0008, 0x17f0: 0x0008, 0x17f1: 0x0040, 0x17f2: 0x0008, 0x17f3: 0x0008, 0x17f4: 0x0040, 0x17f5: 0x0008, 0x17f6: 0x0008, 0x17f7: 0x0008, 0x17f8: 0x0008, 0x17f9: 0x0008, 0x17fa: 0x0040, 0x17fb: 0x0040, 0x17fc: 0x3308, 0x17fd: 0x0008, 0x17fe: 0x3008, 0x17ff: 0x3008, // Block 0x60, offset 0x1800 0x1800: 0x3308, 0x1801: 0x3008, 0x1802: 0x3008, 0x1803: 0x3008, 0x1804: 0x3008, 0x1805: 0x0040, 0x1806: 0x0040, 0x1807: 0x3008, 0x1808: 0x3008, 0x1809: 0x0040, 0x180a: 0x0040, 0x180b: 0x3008, 0x180c: 0x3008, 0x180d: 0x3808, 0x180e: 0x0040, 0x180f: 0x0040, 0x1810: 0x0008, 0x1811: 0x0040, 0x1812: 0x0040, 0x1813: 0x0040, 0x1814: 0x0040, 0x1815: 0x0040, 0x1816: 0x0040, 0x1817: 0x3008, 0x1818: 0x0040, 0x1819: 0x0040, 0x181a: 0x0040, 0x181b: 0x0040, 0x181c: 0x0040, 0x181d: 0x0008, 0x181e: 0x0008, 0x181f: 0x0008, 0x1820: 0x0008, 0x1821: 0x0008, 0x1822: 0x3008, 0x1823: 0x3008, 0x1824: 0x0040, 0x1825: 0x0040, 0x1826: 0x3308, 0x1827: 0x3308, 0x1828: 0x3308, 0x1829: 0x3308, 0x182a: 0x3308, 0x182b: 0x3308, 0x182c: 0x3308, 0x182d: 0x0040, 0x182e: 0x0040, 0x182f: 0x0040, 0x1830: 0x3308, 0x1831: 0x3308, 0x1832: 0x3308, 0x1833: 0x3308, 0x1834: 0x3308, 0x1835: 0x0040, 0x1836: 0x0040, 0x1837: 0x0040, 0x1838: 0x0040, 0x1839: 0x0040, 0x183a: 0x0040, 0x183b: 0x0040, 0x183c: 0x0040, 0x183d: 0x0040, 0x183e: 0x0040, 0x183f: 0x0040, // Block 0x61, offset 0x1840 0x1840: 0x0039, 0x1841: 0x0ee9, 0x1842: 0x1159, 0x1843: 0x0ef9, 0x1844: 0x0f09, 0x1845: 0x1199, 0x1846: 0x0f31, 0x1847: 0x0249, 0x1848: 0x0f41, 0x1849: 0x0259, 0x184a: 0x0f51, 0x184b: 0x0359, 0x184c: 0x0f61, 0x184d: 0x0f71, 0x184e: 0x00d9, 0x184f: 0x0f99, 0x1850: 0x2039, 0x1851: 0x0269, 0x1852: 0x01d9, 0x1853: 0x0fa9, 0x1854: 0x0fb9, 0x1855: 0x1089, 0x1856: 0x0279, 0x1857: 0x0369, 0x1858: 0x0289, 0x1859: 0x13d1, 0x185a: 0x0039, 0x185b: 0x0ee9, 0x185c: 0x1159, 0x185d: 0x0ef9, 0x185e: 0x0f09, 0x185f: 0x1199, 0x1860: 0x0f31, 0x1861: 0x0249, 0x1862: 0x0f41, 0x1863: 0x0259, 0x1864: 0x0f51, 0x1865: 0x0359, 0x1866: 0x0f61, 0x1867: 0x0f71, 0x1868: 0x00d9, 0x1869: 0x0f99, 0x186a: 0x2039, 0x186b: 0x0269, 0x186c: 0x01d9, 0x186d: 0x0fa9, 0x186e: 0x0fb9, 0x186f: 0x1089, 0x1870: 0x0279, 0x1871: 0x0369, 0x1872: 0x0289, 0x1873: 0x13d1, 0x1874: 0x0039, 0x1875: 0x0ee9, 0x1876: 0x1159, 0x1877: 0x0ef9, 0x1878: 0x0f09, 0x1879: 0x1199, 0x187a: 0x0f31, 0x187b: 0x0249, 0x187c: 0x0f41, 0x187d: 0x0259, 0x187e: 0x0f51, 0x187f: 0x0359, // Block 0x62, offset 0x1880 0x1880: 0x0f61, 0x1881: 0x0f71, 0x1882: 0x00d9, 0x1883: 0x0f99, 0x1884: 0x2039, 0x1885: 0x0269, 0x1886: 0x01d9, 0x1887: 0x0fa9, 0x1888: 0x0fb9, 0x1889: 0x1089, 0x188a: 0x0279, 0x188b: 0x0369, 0x188c: 0x0289, 0x188d: 0x13d1, 0x188e: 0x0039, 0x188f: 0x0ee9, 0x1890: 0x1159, 0x1891: 0x0ef9, 0x1892: 0x0f09, 0x1893: 0x1199, 0x1894: 0x0f31, 0x1895: 0x0040, 0x1896: 0x0f41, 0x1897: 0x0259, 0x1898: 0x0f51, 0x1899: 0x0359, 0x189a: 0x0f61, 0x189b: 0x0f71, 0x189c: 0x00d9, 0x189d: 0x0f99, 0x189e: 0x2039, 0x189f: 0x0269, 0x18a0: 0x01d9, 0x18a1: 0x0fa9, 0x18a2: 0x0fb9, 0x18a3: 0x1089, 0x18a4: 0x0279, 0x18a5: 0x0369, 0x18a6: 0x0289, 0x18a7: 0x13d1, 0x18a8: 0x0039, 0x18a9: 0x0ee9, 0x18aa: 0x1159, 0x18ab: 0x0ef9, 0x18ac: 0x0f09, 0x18ad: 0x1199, 0x18ae: 0x0f31, 0x18af: 0x0249, 0x18b0: 0x0f41, 0x18b1: 0x0259, 0x18b2: 0x0f51, 0x18b3: 0x0359, 0x18b4: 0x0f61, 0x18b5: 0x0f71, 0x18b6: 0x00d9, 0x18b7: 0x0f99, 0x18b8: 0x2039, 0x18b9: 0x0269, 0x18ba: 0x01d9, 0x18bb: 0x0fa9, 0x18bc: 0x0fb9, 0x18bd: 0x1089, 0x18be: 0x0279, 0x18bf: 0x0369, // Block 0x63, offset 0x18c0 0x18c0: 0x0289, 0x18c1: 0x13d1, 0x18c2: 0x0039, 0x18c3: 0x0ee9, 0x18c4: 0x1159, 0x18c5: 0x0ef9, 0x18c6: 0x0f09, 0x18c7: 0x1199, 0x18c8: 0x0f31, 0x18c9: 0x0249, 0x18ca: 0x0f41, 0x18cb: 0x0259, 0x18cc: 0x0f51, 0x18cd: 0x0359, 0x18ce: 0x0f61, 0x18cf: 0x0f71, 0x18d0: 0x00d9, 0x18d1: 0x0f99, 0x18d2: 0x2039, 0x18d3: 0x0269, 0x18d4: 0x01d9, 0x18d5: 0x0fa9, 0x18d6: 0x0fb9, 0x18d7: 0x1089, 0x18d8: 0x0279, 0x18d9: 0x0369, 0x18da: 0x0289, 0x18db: 0x13d1, 0x18dc: 0x0039, 0x18dd: 0x0040, 0x18de: 0x1159, 0x18df: 0x0ef9, 0x18e0: 0x0040, 0x18e1: 0x0040, 0x18e2: 0x0f31, 0x18e3: 0x0040, 0x18e4: 0x0040, 0x18e5: 0x0259, 0x18e6: 0x0f51, 0x18e7: 0x0040, 0x18e8: 0x0040, 0x18e9: 0x0f71, 0x18ea: 0x00d9, 0x18eb: 0x0f99, 0x18ec: 0x2039, 0x18ed: 0x0040, 0x18ee: 0x01d9, 0x18ef: 0x0fa9, 0x18f0: 0x0fb9, 0x18f1: 0x1089, 0x18f2: 0x0279, 0x18f3: 0x0369, 0x18f4: 0x0289, 0x18f5: 0x13d1, 0x18f6: 0x0039, 0x18f7: 0x0ee9, 0x18f8: 0x1159, 0x18f9: 0x0ef9, 0x18fa: 0x0040, 0x18fb: 0x1199, 0x18fc: 0x0040, 0x18fd: 0x0249, 0x18fe: 0x0f41, 0x18ff: 0x0259, // Block 0x64, offset 0x1900 0x1900: 0x0f51, 0x1901: 0x0359, 0x1902: 0x0f61, 0x1903: 0x0f71, 0x1904: 0x0040, 0x1905: 0x0f99, 0x1906: 0x2039, 0x1907: 0x0269, 0x1908: 0x01d9, 0x1909: 0x0fa9, 0x190a: 0x0fb9, 0x190b: 0x1089, 0x190c: 0x0279, 0x190d: 0x0369, 0x190e: 0x0289, 0x190f: 0x13d1, 0x1910: 0x0039, 0x1911: 0x0ee9, 0x1912: 0x1159, 0x1913: 0x0ef9, 0x1914: 0x0f09, 0x1915: 0x1199, 0x1916: 0x0f31, 0x1917: 0x0249, 0x1918: 0x0f41, 0x1919: 0x0259, 0x191a: 0x0f51, 0x191b: 0x0359, 0x191c: 0x0f61, 0x191d: 0x0f71, 0x191e: 0x00d9, 0x191f: 0x0f99, 0x1920: 0x2039, 0x1921: 0x0269, 0x1922: 0x01d9, 0x1923: 0x0fa9, 0x1924: 0x0fb9, 0x1925: 0x1089, 0x1926: 0x0279, 0x1927: 0x0369, 0x1928: 0x0289, 0x1929: 0x13d1, 0x192a: 0x0039, 0x192b: 0x0ee9, 0x192c: 0x1159, 0x192d: 0x0ef9, 0x192e: 0x0f09, 0x192f: 0x1199, 0x1930: 0x0f31, 0x1931: 0x0249, 0x1932: 0x0f41, 0x1933: 0x0259, 0x1934: 0x0f51, 0x1935: 0x0359, 0x1936: 0x0f61, 0x1937: 0x0f71, 0x1938: 0x00d9, 0x1939: 0x0f99, 0x193a: 0x2039, 0x193b: 0x0269, 0x193c: 0x01d9, 0x193d: 0x0fa9, 0x193e: 0x0fb9, 0x193f: 0x1089, // Block 0x65, offset 0x1940 0x1940: 0x0279, 0x1941: 0x0369, 0x1942: 0x0289, 0x1943: 0x13d1, 0x1944: 0x0039, 0x1945: 0x0ee9, 0x1946: 0x0040, 0x1947: 0x0ef9, 0x1948: 0x0f09, 0x1949: 0x1199, 0x194a: 0x0f31, 0x194b: 0x0040, 0x194c: 0x0040, 0x194d: 0x0259, 0x194e: 0x0f51, 0x194f: 0x0359, 0x1950: 0x0f61, 0x1951: 0x0f71, 0x1952: 0x00d9, 0x1953: 0x0f99, 0x1954: 0x2039, 0x1955: 0x0040, 0x1956: 0x01d9, 0x1957: 0x0fa9, 0x1958: 0x0fb9, 0x1959: 0x1089, 0x195a: 0x0279, 0x195b: 0x0369, 0x195c: 0x0289, 0x195d: 0x0040, 0x195e: 0x0039, 0x195f: 0x0ee9, 0x1960: 0x1159, 0x1961: 0x0ef9, 0x1962: 0x0f09, 0x1963: 0x1199, 0x1964: 0x0f31, 0x1965: 0x0249, 0x1966: 0x0f41, 0x1967: 0x0259, 0x1968: 0x0f51, 0x1969: 0x0359, 0x196a: 0x0f61, 0x196b: 0x0f71, 0x196c: 0x00d9, 0x196d: 0x0f99, 0x196e: 0x2039, 0x196f: 0x0269, 0x1970: 0x01d9, 0x1971: 0x0fa9, 0x1972: 0x0fb9, 0x1973: 0x1089, 0x1974: 0x0279, 0x1975: 0x0369, 0x1976: 0x0289, 0x1977: 0x13d1, 0x1978: 0x0039, 0x1979: 0x0ee9, 0x197a: 0x0040, 0x197b: 0x0ef9, 0x197c: 0x0f09, 0x197d: 0x1199, 0x197e: 0x0f31, 0x197f: 0x0040, // Block 0x66, offset 0x1980 0x1980: 0x0f41, 0x1981: 0x0259, 0x1982: 0x0f51, 0x1983: 0x0359, 0x1984: 0x0f61, 0x1985: 0x0040, 0x1986: 0x00d9, 0x1987: 0x0040, 0x1988: 0x0040, 0x1989: 0x0040, 0x198a: 0x01d9, 0x198b: 0x0fa9, 0x198c: 0x0fb9, 0x198d: 0x1089, 0x198e: 0x0279, 0x198f: 0x0369, 0x1990: 0x0289, 0x1991: 0x0040, 0x1992: 0x0039, 0x1993: 0x0ee9, 0x1994: 0x1159, 0x1995: 0x0ef9, 0x1996: 0x0f09, 0x1997: 0x1199, 0x1998: 0x0f31, 0x1999: 0x0249, 0x199a: 0x0f41, 0x199b: 0x0259, 0x199c: 0x0f51, 0x199d: 0x0359, 0x199e: 0x0f61, 0x199f: 0x0f71, 0x19a0: 0x00d9, 0x19a1: 0x0f99, 0x19a2: 0x2039, 0x19a3: 0x0269, 0x19a4: 0x01d9, 0x19a5: 0x0fa9, 0x19a6: 0x0fb9, 0x19a7: 0x1089, 0x19a8: 0x0279, 0x19a9: 0x0369, 0x19aa: 0x0289, 0x19ab: 0x13d1, 0x19ac: 0x0039, 0x19ad: 0x0ee9, 0x19ae: 0x1159, 0x19af: 0x0ef9, 0x19b0: 0x0f09, 0x19b1: 0x1199, 0x19b2: 0x0f31, 0x19b3: 0x0249, 0x19b4: 0x0f41, 0x19b5: 0x0259, 0x19b6: 0x0f51, 0x19b7: 0x0359, 0x19b8: 0x0f61, 0x19b9: 0x0f71, 0x19ba: 0x00d9, 0x19bb: 0x0f99, 0x19bc: 0x2039, 0x19bd: 0x0269, 0x19be: 0x01d9, 0x19bf: 0x0fa9, // Block 0x67, offset 0x19c0 0x19c0: 0x0fb9, 0x19c1: 0x1089, 0x19c2: 0x0279, 0x19c3: 0x0369, 0x19c4: 0x0289, 0x19c5: 0x13d1, 0x19c6: 0x0039, 0x19c7: 0x0ee9, 0x19c8: 0x1159, 0x19c9: 0x0ef9, 0x19ca: 0x0f09, 0x19cb: 0x1199, 0x19cc: 0x0f31, 0x19cd: 0x0249, 0x19ce: 0x0f41, 0x19cf: 0x0259, 0x19d0: 0x0f51, 0x19d1: 0x0359, 0x19d2: 0x0f61, 0x19d3: 0x0f71, 0x19d4: 0x00d9, 0x19d5: 0x0f99, 0x19d6: 0x2039, 0x19d7: 0x0269, 0x19d8: 0x01d9, 0x19d9: 0x0fa9, 0x19da: 0x0fb9, 0x19db: 0x1089, 0x19dc: 0x0279, 0x19dd: 0x0369, 0x19de: 0x0289, 0x19df: 0x13d1, 0x19e0: 0x0039, 0x19e1: 0x0ee9, 0x19e2: 0x1159, 0x19e3: 0x0ef9, 0x19e4: 0x0f09, 0x19e5: 0x1199, 0x19e6: 0x0f31, 0x19e7: 0x0249, 0x19e8: 0x0f41, 0x19e9: 0x0259, 0x19ea: 0x0f51, 0x19eb: 0x0359, 0x19ec: 0x0f61, 0x19ed: 0x0f71, 0x19ee: 0x00d9, 0x19ef: 0x0f99, 0x19f0: 0x2039, 0x19f1: 0x0269, 0x19f2: 0x01d9, 0x19f3: 0x0fa9, 0x19f4: 0x0fb9, 0x19f5: 0x1089, 0x19f6: 0x0279, 0x19f7: 0x0369, 0x19f8: 0x0289, 0x19f9: 0x13d1, 0x19fa: 0x0039, 0x19fb: 0x0ee9, 0x19fc: 0x1159, 0x19fd: 0x0ef9, 0x19fe: 0x0f09, 0x19ff: 0x1199, // Block 0x68, offset 0x1a00 0x1a00: 0x0f31, 0x1a01: 0x0249, 0x1a02: 0x0f41, 0x1a03: 0x0259, 0x1a04: 0x0f51, 0x1a05: 0x0359, 0x1a06: 0x0f61, 0x1a07: 0x0f71, 0x1a08: 0x00d9, 0x1a09: 0x0f99, 0x1a0a: 0x2039, 0x1a0b: 0x0269, 0x1a0c: 0x01d9, 0x1a0d: 0x0fa9, 0x1a0e: 0x0fb9, 0x1a0f: 0x1089, 0x1a10: 0x0279, 0x1a11: 0x0369, 0x1a12: 0x0289, 0x1a13: 0x13d1, 0x1a14: 0x0039, 0x1a15: 0x0ee9, 0x1a16: 0x1159, 0x1a17: 0x0ef9, 0x1a18: 0x0f09, 0x1a19: 0x1199, 0x1a1a: 0x0f31, 0x1a1b: 0x0249, 0x1a1c: 0x0f41, 0x1a1d: 0x0259, 0x1a1e: 0x0f51, 0x1a1f: 0x0359, 0x1a20: 0x0f61, 0x1a21: 0x0f71, 0x1a22: 0x00d9, 0x1a23: 0x0f99, 0x1a24: 0x2039, 0x1a25: 0x0269, 0x1a26: 0x01d9, 0x1a27: 0x0fa9, 0x1a28: 0x0fb9, 0x1a29: 0x1089, 0x1a2a: 0x0279, 0x1a2b: 0x0369, 0x1a2c: 0x0289, 0x1a2d: 0x13d1, 0x1a2e: 0x0039, 0x1a2f: 0x0ee9, 0x1a30: 0x1159, 0x1a31: 0x0ef9, 0x1a32: 0x0f09, 0x1a33: 0x1199, 0x1a34: 0x0f31, 0x1a35: 0x0249, 0x1a36: 0x0f41, 0x1a37: 0x0259, 0x1a38: 0x0f51, 0x1a39: 0x0359, 0x1a3a: 0x0f61, 0x1a3b: 0x0f71, 0x1a3c: 0x00d9, 0x1a3d: 0x0f99, 0x1a3e: 0x2039, 0x1a3f: 0x0269, // Block 0x69, offset 0x1a40 0x1a40: 0x01d9, 0x1a41: 0x0fa9, 0x1a42: 0x0fb9, 0x1a43: 0x1089, 0x1a44: 0x0279, 0x1a45: 0x0369, 0x1a46: 0x0289, 0x1a47: 0x13d1, 0x1a48: 0x0039, 0x1a49: 0x0ee9, 0x1a4a: 0x1159, 0x1a4b: 0x0ef9, 0x1a4c: 0x0f09, 0x1a4d: 0x1199, 0x1a4e: 0x0f31, 0x1a4f: 0x0249, 0x1a50: 0x0f41, 0x1a51: 0x0259, 0x1a52: 0x0f51, 0x1a53: 0x0359, 0x1a54: 0x0f61, 0x1a55: 0x0f71, 0x1a56: 0x00d9, 0x1a57: 0x0f99, 0x1a58: 0x2039, 0x1a59: 0x0269, 0x1a5a: 0x01d9, 0x1a5b: 0x0fa9, 0x1a5c: 0x0fb9, 0x1a5d: 0x1089, 0x1a5e: 0x0279, 0x1a5f: 0x0369, 0x1a60: 0x0289, 0x1a61: 0x13d1, 0x1a62: 0x0039, 0x1a63: 0x0ee9, 0x1a64: 0x1159, 0x1a65: 0x0ef9, 0x1a66: 0x0f09, 0x1a67: 0x1199, 0x1a68: 0x0f31, 0x1a69: 0x0249, 0x1a6a: 0x0f41, 0x1a6b: 0x0259, 0x1a6c: 0x0f51, 0x1a6d: 0x0359, 0x1a6e: 0x0f61, 0x1a6f: 0x0f71, 0x1a70: 0x00d9, 0x1a71: 0x0f99, 0x1a72: 0x2039, 0x1a73: 0x0269, 0x1a74: 0x01d9, 0x1a75: 0x0fa9, 0x1a76: 0x0fb9, 0x1a77: 0x1089, 0x1a78: 0x0279, 0x1a79: 0x0369, 0x1a7a: 0x0289, 0x1a7b: 0x13d1, 0x1a7c: 0x0039, 0x1a7d: 0x0ee9, 0x1a7e: 0x1159, 0x1a7f: 0x0ef9, // Block 0x6a, offset 0x1a80 0x1a80: 0x0f09, 0x1a81: 0x1199, 0x1a82: 0x0f31, 0x1a83: 0x0249, 0x1a84: 0x0f41, 0x1a85: 0x0259, 0x1a86: 0x0f51, 0x1a87: 0x0359, 0x1a88: 0x0f61, 0x1a89: 0x0f71, 0x1a8a: 0x00d9, 0x1a8b: 0x0f99, 0x1a8c: 0x2039, 0x1a8d: 0x0269, 0x1a8e: 0x01d9, 0x1a8f: 0x0fa9, 0x1a90: 0x0fb9, 0x1a91: 0x1089, 0x1a92: 0x0279, 0x1a93: 0x0369, 0x1a94: 0x0289, 0x1a95: 0x13d1, 0x1a96: 0x0039, 0x1a97: 0x0ee9, 0x1a98: 0x1159, 0x1a99: 0x0ef9, 0x1a9a: 0x0f09, 0x1a9b: 0x1199, 0x1a9c: 0x0f31, 0x1a9d: 0x0249, 0x1a9e: 0x0f41, 0x1a9f: 0x0259, 0x1aa0: 0x0f51, 0x1aa1: 0x0359, 0x1aa2: 0x0f61, 0x1aa3: 0x0f71, 0x1aa4: 0x00d9, 0x1aa5: 0x0f99, 0x1aa6: 0x2039, 0x1aa7: 0x0269, 0x1aa8: 0x01d9, 0x1aa9: 0x0fa9, 0x1aaa: 0x0fb9, 0x1aab: 0x1089, 0x1aac: 0x0279, 0x1aad: 0x0369, 0x1aae: 0x0289, 0x1aaf: 0x13d1, 0x1ab0: 0x0039, 0x1ab1: 0x0ee9, 0x1ab2: 0x1159, 0x1ab3: 0x0ef9, 0x1ab4: 0x0f09, 0x1ab5: 0x1199, 0x1ab6: 0x0f31, 0x1ab7: 0x0249, 0x1ab8: 0x0f41, 0x1ab9: 0x0259, 0x1aba: 0x0f51, 0x1abb: 0x0359, 0x1abc: 0x0f61, 0x1abd: 0x0f71, 0x1abe: 0x00d9, 0x1abf: 0x0f99, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x2039, 0x1ac1: 0x0269, 0x1ac2: 0x01d9, 0x1ac3: 0x0fa9, 0x1ac4: 0x0fb9, 0x1ac5: 0x1089, 0x1ac6: 0x0279, 0x1ac7: 0x0369, 0x1ac8: 0x0289, 0x1ac9: 0x13d1, 0x1aca: 0x0039, 0x1acb: 0x0ee9, 0x1acc: 0x1159, 0x1acd: 0x0ef9, 0x1ace: 0x0f09, 0x1acf: 0x1199, 0x1ad0: 0x0f31, 0x1ad1: 0x0249, 0x1ad2: 0x0f41, 0x1ad3: 0x0259, 0x1ad4: 0x0f51, 0x1ad5: 0x0359, 0x1ad6: 0x0f61, 0x1ad7: 0x0f71, 0x1ad8: 0x00d9, 0x1ad9: 0x0f99, 0x1ada: 0x2039, 0x1adb: 0x0269, 0x1adc: 0x01d9, 0x1add: 0x0fa9, 0x1ade: 0x0fb9, 0x1adf: 0x1089, 0x1ae0: 0x0279, 0x1ae1: 0x0369, 0x1ae2: 0x0289, 0x1ae3: 0x13d1, 0x1ae4: 0xba81, 0x1ae5: 0xba99, 0x1ae6: 0x0040, 0x1ae7: 0x0040, 0x1ae8: 0xbab1, 0x1ae9: 0x1099, 0x1aea: 0x10b1, 0x1aeb: 0x10c9, 0x1aec: 0xbac9, 0x1aed: 0xbae1, 0x1aee: 0xbaf9, 0x1aef: 0x1429, 0x1af0: 0x1a31, 0x1af1: 0xbb11, 0x1af2: 0xbb29, 0x1af3: 0xbb41, 0x1af4: 0xbb59, 0x1af5: 0xbb71, 0x1af6: 0xbb89, 0x1af7: 0x2109, 0x1af8: 0x1111, 0x1af9: 0x1429, 0x1afa: 0xbba1, 0x1afb: 0xbbb9, 0x1afc: 0xbbd1, 0x1afd: 0x10e1, 0x1afe: 0x10f9, 0x1aff: 0xbbe9, // Block 0x6c, offset 0x1b00 0x1b00: 0x2079, 0x1b01: 0xbc01, 0x1b02: 0xbab1, 0x1b03: 0x1099, 0x1b04: 0x10b1, 0x1b05: 0x10c9, 0x1b06: 0xbac9, 0x1b07: 0xbae1, 0x1b08: 0xbaf9, 0x1b09: 0x1429, 0x1b0a: 0x1a31, 0x1b0b: 0xbb11, 0x1b0c: 0xbb29, 0x1b0d: 0xbb41, 0x1b0e: 0xbb59, 0x1b0f: 0xbb71, 0x1b10: 0xbb89, 0x1b11: 0x2109, 0x1b12: 0x1111, 0x1b13: 0xbba1, 0x1b14: 0xbba1, 0x1b15: 0xbbb9, 0x1b16: 0xbbd1, 0x1b17: 0x10e1, 0x1b18: 0x10f9, 0x1b19: 0xbbe9, 0x1b1a: 0x2079, 0x1b1b: 0xbc21, 0x1b1c: 0xbac9, 0x1b1d: 0x1429, 0x1b1e: 0xbb11, 0x1b1f: 0x10e1, 0x1b20: 0x1111, 0x1b21: 0x2109, 0x1b22: 0xbab1, 0x1b23: 0x1099, 0x1b24: 0x10b1, 0x1b25: 0x10c9, 0x1b26: 0xbac9, 0x1b27: 0xbae1, 0x1b28: 0xbaf9, 0x1b29: 0x1429, 0x1b2a: 0x1a31, 0x1b2b: 0xbb11, 0x1b2c: 0xbb29, 0x1b2d: 0xbb41, 0x1b2e: 0xbb59, 0x1b2f: 0xbb71, 0x1b30: 0xbb89, 0x1b31: 0x2109, 0x1b32: 0x1111, 0x1b33: 0x1429, 0x1b34: 0xbba1, 0x1b35: 0xbbb9, 0x1b36: 0xbbd1, 0x1b37: 0x10e1, 0x1b38: 0x10f9, 0x1b39: 0xbbe9, 0x1b3a: 0x2079, 0x1b3b: 0xbc01, 0x1b3c: 0xbab1, 0x1b3d: 0x1099, 0x1b3e: 0x10b1, 0x1b3f: 0x10c9, // Block 0x6d, offset 0x1b40 0x1b40: 0xbac9, 0x1b41: 0xbae1, 0x1b42: 0xbaf9, 0x1b43: 0x1429, 0x1b44: 0x1a31, 0x1b45: 0xbb11, 0x1b46: 0xbb29, 0x1b47: 0xbb41, 0x1b48: 0xbb59, 0x1b49: 0xbb71, 0x1b4a: 0xbb89, 0x1b4b: 0x2109, 0x1b4c: 0x1111, 0x1b4d: 0xbba1, 0x1b4e: 0xbba1, 0x1b4f: 0xbbb9, 0x1b50: 0xbbd1, 0x1b51: 0x10e1, 0x1b52: 0x10f9, 0x1b53: 0xbbe9, 0x1b54: 0x2079, 0x1b55: 0xbc21, 0x1b56: 0xbac9, 0x1b57: 0x1429, 0x1b58: 0xbb11, 0x1b59: 0x10e1, 0x1b5a: 0x1111, 0x1b5b: 0x2109, 0x1b5c: 0xbab1, 0x1b5d: 0x1099, 0x1b5e: 0x10b1, 0x1b5f: 0x10c9, 0x1b60: 0xbac9, 0x1b61: 0xbae1, 0x1b62: 0xbaf9, 0x1b63: 0x1429, 0x1b64: 0x1a31, 0x1b65: 0xbb11, 0x1b66: 0xbb29, 0x1b67: 0xbb41, 0x1b68: 0xbb59, 0x1b69: 0xbb71, 0x1b6a: 0xbb89, 0x1b6b: 0x2109, 0x1b6c: 0x1111, 0x1b6d: 0x1429, 0x1b6e: 0xbba1, 0x1b6f: 0xbbb9, 0x1b70: 0xbbd1, 0x1b71: 0x10e1, 0x1b72: 0x10f9, 0x1b73: 0xbbe9, 0x1b74: 0x2079, 0x1b75: 0xbc01, 0x1b76: 0xbab1, 0x1b77: 0x1099, 0x1b78: 0x10b1, 0x1b79: 0x10c9, 0x1b7a: 0xbac9, 0x1b7b: 0xbae1, 0x1b7c: 0xbaf9, 0x1b7d: 0x1429, 0x1b7e: 0x1a31, 0x1b7f: 0xbb11, // Block 0x6e, offset 0x1b80 0x1b80: 0xbb29, 0x1b81: 0xbb41, 0x1b82: 0xbb59, 0x1b83: 0xbb71, 0x1b84: 0xbb89, 0x1b85: 0x2109, 0x1b86: 0x1111, 0x1b87: 0xbba1, 0x1b88: 0xbba1, 0x1b89: 0xbbb9, 0x1b8a: 0xbbd1, 0x1b8b: 0x10e1, 0x1b8c: 0x10f9, 0x1b8d: 0xbbe9, 0x1b8e: 0x2079, 0x1b8f: 0xbc21, 0x1b90: 0xbac9, 0x1b91: 0x1429, 0x1b92: 0xbb11, 0x1b93: 0x10e1, 0x1b94: 0x1111, 0x1b95: 0x2109, 0x1b96: 0xbab1, 0x1b97: 0x1099, 0x1b98: 0x10b1, 0x1b99: 0x10c9, 0x1b9a: 0xbac9, 0x1b9b: 0xbae1, 0x1b9c: 0xbaf9, 0x1b9d: 0x1429, 0x1b9e: 0x1a31, 0x1b9f: 0xbb11, 0x1ba0: 0xbb29, 0x1ba1: 0xbb41, 0x1ba2: 0xbb59, 0x1ba3: 0xbb71, 0x1ba4: 0xbb89, 0x1ba5: 0x2109, 0x1ba6: 0x1111, 0x1ba7: 0x1429, 0x1ba8: 0xbba1, 0x1ba9: 0xbbb9, 0x1baa: 0xbbd1, 0x1bab: 0x10e1, 0x1bac: 0x10f9, 0x1bad: 0xbbe9, 0x1bae: 0x2079, 0x1baf: 0xbc01, 0x1bb0: 0xbab1, 0x1bb1: 0x1099, 0x1bb2: 0x10b1, 0x1bb3: 0x10c9, 0x1bb4: 0xbac9, 0x1bb5: 0xbae1, 0x1bb6: 0xbaf9, 0x1bb7: 0x1429, 0x1bb8: 0x1a31, 0x1bb9: 0xbb11, 0x1bba: 0xbb29, 0x1bbb: 0xbb41, 0x1bbc: 0xbb59, 0x1bbd: 0xbb71, 0x1bbe: 0xbb89, 0x1bbf: 0x2109, // Block 0x6f, offset 0x1bc0 0x1bc0: 0x1111, 0x1bc1: 0xbba1, 0x1bc2: 0xbba1, 0x1bc3: 0xbbb9, 0x1bc4: 0xbbd1, 0x1bc5: 0x10e1, 0x1bc6: 0x10f9, 0x1bc7: 0xbbe9, 0x1bc8: 0x2079, 0x1bc9: 0xbc21, 0x1bca: 0xbac9, 0x1bcb: 0x1429, 0x1bcc: 0xbb11, 0x1bcd: 0x10e1, 0x1bce: 0x1111, 0x1bcf: 0x2109, 0x1bd0: 0xbab1, 0x1bd1: 0x1099, 0x1bd2: 0x10b1, 0x1bd3: 0x10c9, 0x1bd4: 0xbac9, 0x1bd5: 0xbae1, 0x1bd6: 0xbaf9, 0x1bd7: 0x1429, 0x1bd8: 0x1a31, 0x1bd9: 0xbb11, 0x1bda: 0xbb29, 0x1bdb: 0xbb41, 0x1bdc: 0xbb59, 0x1bdd: 0xbb71, 0x1bde: 0xbb89, 0x1bdf: 0x2109, 0x1be0: 0x1111, 0x1be1: 0x1429, 0x1be2: 0xbba1, 0x1be3: 0xbbb9, 0x1be4: 0xbbd1, 0x1be5: 0x10e1, 0x1be6: 0x10f9, 0x1be7: 0xbbe9, 0x1be8: 0x2079, 0x1be9: 0xbc01, 0x1bea: 0xbab1, 0x1beb: 0x1099, 0x1bec: 0x10b1, 0x1bed: 0x10c9, 0x1bee: 0xbac9, 0x1bef: 0xbae1, 0x1bf0: 0xbaf9, 0x1bf1: 0x1429, 0x1bf2: 0x1a31, 0x1bf3: 0xbb11, 0x1bf4: 0xbb29, 0x1bf5: 0xbb41, 0x1bf6: 0xbb59, 0x1bf7: 0xbb71, 0x1bf8: 0xbb89, 0x1bf9: 0x2109, 0x1bfa: 0x1111, 0x1bfb: 0xbba1, 0x1bfc: 0xbba1, 0x1bfd: 0xbbb9, 0x1bfe: 0xbbd1, 0x1bff: 0x10e1, // Block 0x70, offset 0x1c00 0x1c00: 0x10f9, 0x1c01: 0xbbe9, 0x1c02: 0x2079, 0x1c03: 0xbc21, 0x1c04: 0xbac9, 0x1c05: 0x1429, 0x1c06: 0xbb11, 0x1c07: 0x10e1, 0x1c08: 0x1111, 0x1c09: 0x2109, 0x1c0a: 0xbc41, 0x1c0b: 0xbc41, 0x1c0c: 0x0040, 0x1c0d: 0x0040, 0x1c0e: 0x1f41, 0x1c0f: 0x00c9, 0x1c10: 0x0069, 0x1c11: 0x0079, 0x1c12: 0x1f51, 0x1c13: 0x1f61, 0x1c14: 0x1f71, 0x1c15: 0x1f81, 0x1c16: 0x1f91, 0x1c17: 0x1fa1, 0x1c18: 0x1f41, 0x1c19: 0x00c9, 0x1c1a: 0x0069, 0x1c1b: 0x0079, 0x1c1c: 0x1f51, 0x1c1d: 0x1f61, 0x1c1e: 0x1f71, 0x1c1f: 0x1f81, 0x1c20: 0x1f91, 0x1c21: 0x1fa1, 0x1c22: 0x1f41, 0x1c23: 0x00c9, 0x1c24: 0x0069, 0x1c25: 0x0079, 0x1c26: 0x1f51, 0x1c27: 0x1f61, 0x1c28: 0x1f71, 0x1c29: 0x1f81, 0x1c2a: 0x1f91, 0x1c2b: 0x1fa1, 0x1c2c: 0x1f41, 0x1c2d: 0x00c9, 0x1c2e: 0x0069, 0x1c2f: 0x0079, 0x1c30: 0x1f51, 0x1c31: 0x1f61, 0x1c32: 0x1f71, 0x1c33: 0x1f81, 0x1c34: 0x1f91, 0x1c35: 0x1fa1, 0x1c36: 0x1f41, 0x1c37: 0x00c9, 0x1c38: 0x0069, 0x1c39: 0x0079, 0x1c3a: 0x1f51, 0x1c3b: 0x1f61, 0x1c3c: 0x1f71, 0x1c3d: 0x1f81, 0x1c3e: 0x1f91, 0x1c3f: 0x1fa1, // Block 0x71, offset 0x1c40 0x1c40: 0xe115, 0x1c41: 0xe115, 0x1c42: 0xe135, 0x1c43: 0xe135, 0x1c44: 0xe115, 0x1c45: 0xe115, 0x1c46: 0xe175, 0x1c47: 0xe175, 0x1c48: 0xe115, 0x1c49: 0xe115, 0x1c4a: 0xe135, 0x1c4b: 0xe135, 0x1c4c: 0xe115, 0x1c4d: 0xe115, 0x1c4e: 0xe1f5, 0x1c4f: 0xe1f5, 0x1c50: 0xe115, 0x1c51: 0xe115, 0x1c52: 0xe135, 0x1c53: 0xe135, 0x1c54: 0xe115, 0x1c55: 0xe115, 0x1c56: 0xe175, 0x1c57: 0xe175, 0x1c58: 0xe115, 0x1c59: 0xe115, 0x1c5a: 0xe135, 0x1c5b: 0xe135, 0x1c5c: 0xe115, 0x1c5d: 0xe115, 0x1c5e: 0x8b05, 0x1c5f: 0x8b05, 0x1c60: 0x04b5, 0x1c61: 0x04b5, 0x1c62: 0x0a08, 0x1c63: 0x0a08, 0x1c64: 0x0a08, 0x1c65: 0x0a08, 0x1c66: 0x0a08, 0x1c67: 0x0a08, 0x1c68: 0x0a08, 0x1c69: 0x0a08, 0x1c6a: 0x0a08, 0x1c6b: 0x0a08, 0x1c6c: 0x0a08, 0x1c6d: 0x0a08, 0x1c6e: 0x0a08, 0x1c6f: 0x0a08, 0x1c70: 0x0a08, 0x1c71: 0x0a08, 0x1c72: 0x0a08, 0x1c73: 0x0a08, 0x1c74: 0x0a08, 0x1c75: 0x0a08, 0x1c76: 0x0a08, 0x1c77: 0x0a08, 0x1c78: 0x0a08, 0x1c79: 0x0a08, 0x1c7a: 0x0a08, 0x1c7b: 0x0a08, 0x1c7c: 0x0a08, 0x1c7d: 0x0a08, 0x1c7e: 0x0a08, 0x1c7f: 0x0a08, // Block 0x72, offset 0x1c80 0x1c80: 0xb189, 0x1c81: 0xb1a1, 0x1c82: 0xb201, 0x1c83: 0xb249, 0x1c84: 0x0040, 0x1c85: 0xb411, 0x1c86: 0xb291, 0x1c87: 0xb219, 0x1c88: 0xb309, 0x1c89: 0xb429, 0x1c8a: 0xb399, 0x1c8b: 0xb3b1, 0x1c8c: 0xb3c9, 0x1c8d: 0xb3e1, 0x1c8e: 0xb2a9, 0x1c8f: 0xb339, 0x1c90: 0xb369, 0x1c91: 0xb2d9, 0x1c92: 0xb381, 0x1c93: 0xb279, 0x1c94: 0xb2c1, 0x1c95: 0xb1d1, 0x1c96: 0xb1e9, 0x1c97: 0xb231, 0x1c98: 0xb261, 0x1c99: 0xb2f1, 0x1c9a: 0xb321, 0x1c9b: 0xb351, 0x1c9c: 0xbc59, 0x1c9d: 0x7949, 0x1c9e: 0xbc71, 0x1c9f: 0xbc89, 0x1ca0: 0x0040, 0x1ca1: 0xb1a1, 0x1ca2: 0xb201, 0x1ca3: 0x0040, 0x1ca4: 0xb3f9, 0x1ca5: 0x0040, 0x1ca6: 0x0040, 0x1ca7: 0xb219, 0x1ca8: 0x0040, 0x1ca9: 0xb429, 0x1caa: 0xb399, 0x1cab: 0xb3b1, 0x1cac: 0xb3c9, 0x1cad: 0xb3e1, 0x1cae: 0xb2a9, 0x1caf: 0xb339, 0x1cb0: 0xb369, 0x1cb1: 0xb2d9, 0x1cb2: 0xb381, 0x1cb3: 0x0040, 0x1cb4: 0xb2c1, 0x1cb5: 0xb1d1, 0x1cb6: 0xb1e9, 0x1cb7: 0xb231, 0x1cb8: 0x0040, 0x1cb9: 0xb2f1, 0x1cba: 0x0040, 0x1cbb: 0xb351, 0x1cbc: 0x0040, 0x1cbd: 0x0040, 0x1cbe: 0x0040, 0x1cbf: 0x0040, // Block 0x73, offset 0x1cc0 0x1cc0: 0x0040, 0x1cc1: 0x0040, 0x1cc2: 0xb201, 0x1cc3: 0x0040, 0x1cc4: 0x0040, 0x1cc5: 0x0040, 0x1cc6: 0x0040, 0x1cc7: 0xb219, 0x1cc8: 0x0040, 0x1cc9: 0xb429, 0x1cca: 0x0040, 0x1ccb: 0xb3b1, 0x1ccc: 0x0040, 0x1ccd: 0xb3e1, 0x1cce: 0xb2a9, 0x1ccf: 0xb339, 0x1cd0: 0x0040, 0x1cd1: 0xb2d9, 0x1cd2: 0xb381, 0x1cd3: 0x0040, 0x1cd4: 0xb2c1, 0x1cd5: 0x0040, 0x1cd6: 0x0040, 0x1cd7: 0xb231, 0x1cd8: 0x0040, 0x1cd9: 0xb2f1, 0x1cda: 0x0040, 0x1cdb: 0xb351, 0x1cdc: 0x0040, 0x1cdd: 0x7949, 0x1cde: 0x0040, 0x1cdf: 0xbc89, 0x1ce0: 0x0040, 0x1ce1: 0xb1a1, 0x1ce2: 0xb201, 0x1ce3: 0x0040, 0x1ce4: 0xb3f9, 0x1ce5: 0x0040, 0x1ce6: 0x0040, 0x1ce7: 0xb219, 0x1ce8: 0xb309, 0x1ce9: 0xb429, 0x1cea: 0xb399, 0x1ceb: 0x0040, 0x1cec: 0xb3c9, 0x1ced: 0xb3e1, 0x1cee: 0xb2a9, 0x1cef: 0xb339, 0x1cf0: 0xb369, 0x1cf1: 0xb2d9, 0x1cf2: 0xb381, 0x1cf3: 0x0040, 0x1cf4: 0xb2c1, 0x1cf5: 0xb1d1, 0x1cf6: 0xb1e9, 0x1cf7: 0xb231, 0x1cf8: 0x0040, 0x1cf9: 0xb2f1, 0x1cfa: 0xb321, 0x1cfb: 0xb351, 0x1cfc: 0xbc59, 0x1cfd: 0x0040, 0x1cfe: 0xbc71, 0x1cff: 0x0040, // Block 0x74, offset 0x1d00 0x1d00: 0xb189, 0x1d01: 0xb1a1, 0x1d02: 0xb201, 0x1d03: 0xb249, 0x1d04: 0xb3f9, 0x1d05: 0xb411, 0x1d06: 0xb291, 0x1d07: 0xb219, 0x1d08: 0xb309, 0x1d09: 0xb429, 0x1d0a: 0x0040, 0x1d0b: 0xb3b1, 0x1d0c: 0xb3c9, 0x1d0d: 0xb3e1, 0x1d0e: 0xb2a9, 0x1d0f: 0xb339, 0x1d10: 0xb369, 0x1d11: 0xb2d9, 0x1d12: 0xb381, 0x1d13: 0xb279, 0x1d14: 0xb2c1, 0x1d15: 0xb1d1, 0x1d16: 0xb1e9, 0x1d17: 0xb231, 0x1d18: 0xb261, 0x1d19: 0xb2f1, 0x1d1a: 0xb321, 0x1d1b: 0xb351, 0x1d1c: 0x0040, 0x1d1d: 0x0040, 0x1d1e: 0x0040, 0x1d1f: 0x0040, 0x1d20: 0x0040, 0x1d21: 0xb1a1, 0x1d22: 0xb201, 0x1d23: 0xb249, 0x1d24: 0x0040, 0x1d25: 0xb411, 0x1d26: 0xb291, 0x1d27: 0xb219, 0x1d28: 0xb309, 0x1d29: 0xb429, 0x1d2a: 0x0040, 0x1d2b: 0xb3b1, 0x1d2c: 0xb3c9, 0x1d2d: 0xb3e1, 0x1d2e: 0xb2a9, 0x1d2f: 0xb339, 0x1d30: 0xb369, 0x1d31: 0xb2d9, 0x1d32: 0xb381, 0x1d33: 0xb279, 0x1d34: 0xb2c1, 0x1d35: 0xb1d1, 0x1d36: 0xb1e9, 0x1d37: 0xb231, 0x1d38: 0xb261, 0x1d39: 0xb2f1, 0x1d3a: 0xb321, 0x1d3b: 0xb351, 0x1d3c: 0x0040, 0x1d3d: 0x0040, 0x1d3e: 0x0040, 0x1d3f: 0x0040, // Block 0x75, offset 0x1d40 0x1d40: 0x0040, 0x1d41: 0xbca2, 0x1d42: 0xbcba, 0x1d43: 0xbcd2, 0x1d44: 0xbcea, 0x1d45: 0xbd02, 0x1d46: 0xbd1a, 0x1d47: 0xbd32, 0x1d48: 0xbd4a, 0x1d49: 0xbd62, 0x1d4a: 0xbd7a, 0x1d4b: 0x0018, 0x1d4c: 0x0018, 0x1d4d: 0x0040, 0x1d4e: 0x0040, 0x1d4f: 0x0040, 0x1d50: 0xbd92, 0x1d51: 0xbdb2, 0x1d52: 0xbdd2, 0x1d53: 0xbdf2, 0x1d54: 0xbe12, 0x1d55: 0xbe32, 0x1d56: 0xbe52, 0x1d57: 0xbe72, 0x1d58: 0xbe92, 0x1d59: 0xbeb2, 0x1d5a: 0xbed2, 0x1d5b: 0xbef2, 0x1d5c: 0xbf12, 0x1d5d: 0xbf32, 0x1d5e: 0xbf52, 0x1d5f: 0xbf72, 0x1d60: 0xbf92, 0x1d61: 0xbfb2, 0x1d62: 0xbfd2, 0x1d63: 0xbff2, 0x1d64: 0xc012, 0x1d65: 0xc032, 0x1d66: 0xc052, 0x1d67: 0xc072, 0x1d68: 0xc092, 0x1d69: 0xc0b2, 0x1d6a: 0xc0d1, 0x1d6b: 0x1159, 0x1d6c: 0x0269, 0x1d6d: 0x6671, 0x1d6e: 0xc111, 0x1d6f: 0x0040, 0x1d70: 0x0039, 0x1d71: 0x0ee9, 0x1d72: 0x1159, 0x1d73: 0x0ef9, 0x1d74: 0x0f09, 0x1d75: 0x1199, 0x1d76: 0x0f31, 0x1d77: 0x0249, 0x1d78: 0x0f41, 0x1d79: 0x0259, 0x1d7a: 0x0f51, 0x1d7b: 0x0359, 0x1d7c: 0x0f61, 0x1d7d: 0x0f71, 0x1d7e: 0x00d9, 0x1d7f: 0x0f99, // Block 0x76, offset 0x1d80 0x1d80: 0x2039, 0x1d81: 0x0269, 0x1d82: 0x01d9, 0x1d83: 0x0fa9, 0x1d84: 0x0fb9, 0x1d85: 0x1089, 0x1d86: 0x0279, 0x1d87: 0x0369, 0x1d88: 0x0289, 0x1d89: 0x13d1, 0x1d8a: 0xc129, 0x1d8b: 0x65b1, 0x1d8c: 0xc141, 0x1d8d: 0x1441, 0x1d8e: 0xc159, 0x1d8f: 0xc179, 0x1d90: 0x0018, 0x1d91: 0x0018, 0x1d92: 0x0018, 0x1d93: 0x0018, 0x1d94: 0x0018, 0x1d95: 0x0018, 0x1d96: 0x0018, 0x1d97: 0x0018, 0x1d98: 0x0018, 0x1d99: 0x0018, 0x1d9a: 0x0018, 0x1d9b: 0x0018, 0x1d9c: 0x0018, 0x1d9d: 0x0018, 0x1d9e: 0x0018, 0x1d9f: 0x0018, 0x1da0: 0x0018, 0x1da1: 0x0018, 0x1da2: 0x0018, 0x1da3: 0x0018, 0x1da4: 0x0018, 0x1da5: 0x0018, 0x1da6: 0x0018, 0x1da7: 0x0018, 0x1da8: 0x0018, 0x1da9: 0x0018, 0x1daa: 0xc191, 0x1dab: 0xc1a9, 0x1dac: 0x0040, 0x1dad: 0x0040, 0x1dae: 0x0040, 0x1daf: 0x0040, 0x1db0: 0x0018, 0x1db1: 0x0018, 0x1db2: 0x0018, 0x1db3: 0x0018, 0x1db4: 0x0018, 0x1db5: 0x0018, 0x1db6: 0x0018, 0x1db7: 0x0018, 0x1db8: 0x0018, 0x1db9: 0x0018, 0x1dba: 0x0018, 0x1dbb: 0x0018, 0x1dbc: 0x0018, 0x1dbd: 0x0018, 0x1dbe: 0x0018, 0x1dbf: 0x0018, // Block 0x77, offset 0x1dc0 0x1dc0: 0xc1d9, 0x1dc1: 0xc211, 0x1dc2: 0xc249, 0x1dc3: 0x0040, 0x1dc4: 0x0040, 0x1dc5: 0x0040, 0x1dc6: 0x0040, 0x1dc7: 0x0040, 0x1dc8: 0x0040, 0x1dc9: 0x0040, 0x1dca: 0x0040, 0x1dcb: 0x0040, 0x1dcc: 0x0040, 0x1dcd: 0x0040, 0x1dce: 0x0040, 0x1dcf: 0x0040, 0x1dd0: 0xc269, 0x1dd1: 0xc289, 0x1dd2: 0xc2a9, 0x1dd3: 0xc2c9, 0x1dd4: 0xc2e9, 0x1dd5: 0xc309, 0x1dd6: 0xc329, 0x1dd7: 0xc349, 0x1dd8: 0xc369, 0x1dd9: 0xc389, 0x1dda: 0xc3a9, 0x1ddb: 0xc3c9, 0x1ddc: 0xc3e9, 0x1ddd: 0xc409, 0x1dde: 0xc429, 0x1ddf: 0xc449, 0x1de0: 0xc469, 0x1de1: 0xc489, 0x1de2: 0xc4a9, 0x1de3: 0xc4c9, 0x1de4: 0xc4e9, 0x1de5: 0xc509, 0x1de6: 0xc529, 0x1de7: 0xc549, 0x1de8: 0xc569, 0x1de9: 0xc589, 0x1dea: 0xc5a9, 0x1deb: 0xc5c9, 0x1dec: 0xc5e9, 0x1ded: 0xc609, 0x1dee: 0xc629, 0x1def: 0xc649, 0x1df0: 0xc669, 0x1df1: 0xc689, 0x1df2: 0xc6a9, 0x1df3: 0xc6c9, 0x1df4: 0xc6e9, 0x1df5: 0xc709, 0x1df6: 0xc729, 0x1df7: 0xc749, 0x1df8: 0xc769, 0x1df9: 0xc789, 0x1dfa: 0xc7a9, 0x1dfb: 0xc7c9, 0x1dfc: 0x0040, 0x1dfd: 0x0040, 0x1dfe: 0x0040, 0x1dff: 0x0040, // Block 0x78, offset 0x1e00 0x1e00: 0xcaf9, 0x1e01: 0xcb19, 0x1e02: 0xcb39, 0x1e03: 0x8b1d, 0x1e04: 0xcb59, 0x1e05: 0xcb79, 0x1e06: 0xcb99, 0x1e07: 0xcbb9, 0x1e08: 0xcbd9, 0x1e09: 0xcbf9, 0x1e0a: 0xcc19, 0x1e0b: 0xcc39, 0x1e0c: 0xcc59, 0x1e0d: 0x8b3d, 0x1e0e: 0xcc79, 0x1e0f: 0xcc99, 0x1e10: 0xccb9, 0x1e11: 0xccd9, 0x1e12: 0x8b5d, 0x1e13: 0xccf9, 0x1e14: 0xcd19, 0x1e15: 0xc429, 0x1e16: 0x8b7d, 0x1e17: 0xcd39, 0x1e18: 0xcd59, 0x1e19: 0xcd79, 0x1e1a: 0xcd99, 0x1e1b: 0xcdb9, 0x1e1c: 0x8b9d, 0x1e1d: 0xcdd9, 0x1e1e: 0xcdf9, 0x1e1f: 0xce19, 0x1e20: 0xce39, 0x1e21: 0xce59, 0x1e22: 0xc789, 0x1e23: 0xce79, 0x1e24: 0xce99, 0x1e25: 0xceb9, 0x1e26: 0xced9, 0x1e27: 0xcef9, 0x1e28: 0xcf19, 0x1e29: 0xcf39, 0x1e2a: 0xcf59, 0x1e2b: 0xcf79, 0x1e2c: 0xcf99, 0x1e2d: 0xcfb9, 0x1e2e: 0xcfd9, 0x1e2f: 0xcff9, 0x1e30: 0xd019, 0x1e31: 0xd039, 0x1e32: 0xd039, 0x1e33: 0xd039, 0x1e34: 0x8bbd, 0x1e35: 0xd059, 0x1e36: 0xd079, 0x1e37: 0xd099, 0x1e38: 0x8bdd, 0x1e39: 0xd0b9, 0x1e3a: 0xd0d9, 0x1e3b: 0xd0f9, 0x1e3c: 0xd119, 0x1e3d: 0xd139, 0x1e3e: 0xd159, 0x1e3f: 0xd179, // Block 0x79, offset 0x1e40 0x1e40: 0xd199, 0x1e41: 0xd1b9, 0x1e42: 0xd1d9, 0x1e43: 0xd1f9, 0x1e44: 0xd219, 0x1e45: 0xd239, 0x1e46: 0xd239, 0x1e47: 0xd259, 0x1e48: 0xd279, 0x1e49: 0xd299, 0x1e4a: 0xd2b9, 0x1e4b: 0xd2d9, 0x1e4c: 0xd2f9, 0x1e4d: 0xd319, 0x1e4e: 0xd339, 0x1e4f: 0xd359, 0x1e50: 0xd379, 0x1e51: 0xd399, 0x1e52: 0xd3b9, 0x1e53: 0xd3d9, 0x1e54: 0xd3f9, 0x1e55: 0xd419, 0x1e56: 0xd439, 0x1e57: 0xd459, 0x1e58: 0xd479, 0x1e59: 0x8bfd, 0x1e5a: 0xd499, 0x1e5b: 0xd4b9, 0x1e5c: 0xd4d9, 0x1e5d: 0xc309, 0x1e5e: 0xd4f9, 0x1e5f: 0xd519, 0x1e60: 0x8c1d, 0x1e61: 0x8c3d, 0x1e62: 0xd539, 0x1e63: 0xd559, 0x1e64: 0xd579, 0x1e65: 0xd599, 0x1e66: 0xd5b9, 0x1e67: 0xd5d9, 0x1e68: 0x2040, 0x1e69: 0xd5f9, 0x1e6a: 0xd619, 0x1e6b: 0xd619, 0x1e6c: 0x8c5d, 0x1e6d: 0xd639, 0x1e6e: 0xd659, 0x1e6f: 0xd679, 0x1e70: 0xd699, 0x1e71: 0x8c7d, 0x1e72: 0xd6b9, 0x1e73: 0xd6d9, 0x1e74: 0x2040, 0x1e75: 0xd6f9, 0x1e76: 0xd719, 0x1e77: 0xd739, 0x1e78: 0xd759, 0x1e79: 0xd779, 0x1e7a: 0xd799, 0x1e7b: 0x8c9d, 0x1e7c: 0xd7b9, 0x1e7d: 0x8cbd, 0x1e7e: 0xd7d9, 0x1e7f: 0xd7f9, // Block 0x7a, offset 0x1e80 0x1e80: 0xd819, 0x1e81: 0xd839, 0x1e82: 0xd859, 0x1e83: 0xd879, 0x1e84: 0xd899, 0x1e85: 0xd8b9, 0x1e86: 0xd8d9, 0x1e87: 0xd8f9, 0x1e88: 0xd919, 0x1e89: 0x8cdd, 0x1e8a: 0xd939, 0x1e8b: 0xd959, 0x1e8c: 0xd979, 0x1e8d: 0xd999, 0x1e8e: 0xd9b9, 0x1e8f: 0x8cfd, 0x1e90: 0xd9d9, 0x1e91: 0x8d1d, 0x1e92: 0x8d3d, 0x1e93: 0xd9f9, 0x1e94: 0xda19, 0x1e95: 0xda19, 0x1e96: 0xda39, 0x1e97: 0x8d5d, 0x1e98: 0x8d7d, 0x1e99: 0xda59, 0x1e9a: 0xda79, 0x1e9b: 0xda99, 0x1e9c: 0xdab9, 0x1e9d: 0xdad9, 0x1e9e: 0xdaf9, 0x1e9f: 0xdb19, 0x1ea0: 0xdb39, 0x1ea1: 0xdb59, 0x1ea2: 0xdb79, 0x1ea3: 0xdb99, 0x1ea4: 0x8d9d, 0x1ea5: 0xdbb9, 0x1ea6: 0xdbd9, 0x1ea7: 0xdbf9, 0x1ea8: 0xdc19, 0x1ea9: 0xdbf9, 0x1eaa: 0xdc39, 0x1eab: 0xdc59, 0x1eac: 0xdc79, 0x1ead: 0xdc99, 0x1eae: 0xdcb9, 0x1eaf: 0xdcd9, 0x1eb0: 0xdcf9, 0x1eb1: 0xdd19, 0x1eb2: 0xdd39, 0x1eb3: 0xdd59, 0x1eb4: 0xdd79, 0x1eb5: 0xdd99, 0x1eb6: 0xddb9, 0x1eb7: 0xddd9, 0x1eb8: 0x8dbd, 0x1eb9: 0xddf9, 0x1eba: 0xde19, 0x1ebb: 0xde39, 0x1ebc: 0xde59, 0x1ebd: 0xde79, 0x1ebe: 0x8ddd, 0x1ebf: 0xde99, // Block 0x7b, offset 0x1ec0 0x1ec0: 0xe599, 0x1ec1: 0xe5b9, 0x1ec2: 0xe5d9, 0x1ec3: 0xe5f9, 0x1ec4: 0xe619, 0x1ec5: 0xe639, 0x1ec6: 0x8efd, 0x1ec7: 0xe659, 0x1ec8: 0xe679, 0x1ec9: 0xe699, 0x1eca: 0xe6b9, 0x1ecb: 0xe6d9, 0x1ecc: 0xe6f9, 0x1ecd: 0x8f1d, 0x1ece: 0xe719, 0x1ecf: 0xe739, 0x1ed0: 0x8f3d, 0x1ed1: 0x8f5d, 0x1ed2: 0xe759, 0x1ed3: 0xe779, 0x1ed4: 0xe799, 0x1ed5: 0xe7b9, 0x1ed6: 0xe7d9, 0x1ed7: 0xe7f9, 0x1ed8: 0xe819, 0x1ed9: 0xe839, 0x1eda: 0xe859, 0x1edb: 0x8f7d, 0x1edc: 0xe879, 0x1edd: 0x8f9d, 0x1ede: 0xe899, 0x1edf: 0x2040, 0x1ee0: 0xe8b9, 0x1ee1: 0xe8d9, 0x1ee2: 0xe8f9, 0x1ee3: 0x8fbd, 0x1ee4: 0xe919, 0x1ee5: 0xe939, 0x1ee6: 0x8fdd, 0x1ee7: 0x8ffd, 0x1ee8: 0xe959, 0x1ee9: 0xe979, 0x1eea: 0xe999, 0x1eeb: 0xe9b9, 0x1eec: 0xe9d9, 0x1eed: 0xe9d9, 0x1eee: 0xe9f9, 0x1eef: 0xea19, 0x1ef0: 0xea39, 0x1ef1: 0xea59, 0x1ef2: 0xea79, 0x1ef3: 0xea99, 0x1ef4: 0xeab9, 0x1ef5: 0x901d, 0x1ef6: 0xead9, 0x1ef7: 0x903d, 0x1ef8: 0xeaf9, 0x1ef9: 0x905d, 0x1efa: 0xeb19, 0x1efb: 0x907d, 0x1efc: 0x909d, 0x1efd: 0x90bd, 0x1efe: 0xeb39, 0x1eff: 0xeb59, // Block 0x7c, offset 0x1f00 0x1f00: 0xeb79, 0x1f01: 0x90dd, 0x1f02: 0x90fd, 0x1f03: 0x911d, 0x1f04: 0x913d, 0x1f05: 0xeb99, 0x1f06: 0xebb9, 0x1f07: 0xebb9, 0x1f08: 0xebd9, 0x1f09: 0xebf9, 0x1f0a: 0xec19, 0x1f0b: 0xec39, 0x1f0c: 0xec59, 0x1f0d: 0x915d, 0x1f0e: 0xec79, 0x1f0f: 0xec99, 0x1f10: 0xecb9, 0x1f11: 0xecd9, 0x1f12: 0x917d, 0x1f13: 0xecf9, 0x1f14: 0x919d, 0x1f15: 0x91bd, 0x1f16: 0xed19, 0x1f17: 0xed39, 0x1f18: 0xed59, 0x1f19: 0xed79, 0x1f1a: 0xed99, 0x1f1b: 0xedb9, 0x1f1c: 0x91dd, 0x1f1d: 0x91fd, 0x1f1e: 0x921d, 0x1f1f: 0x2040, 0x1f20: 0xedd9, 0x1f21: 0x923d, 0x1f22: 0xedf9, 0x1f23: 0xee19, 0x1f24: 0xee39, 0x1f25: 0x925d, 0x1f26: 0xee59, 0x1f27: 0xee79, 0x1f28: 0xee99, 0x1f29: 0xeeb9, 0x1f2a: 0xeed9, 0x1f2b: 0x927d, 0x1f2c: 0xeef9, 0x1f2d: 0xef19, 0x1f2e: 0xef39, 0x1f2f: 0xef59, 0x1f30: 0xef79, 0x1f31: 0xef99, 0x1f32: 0x929d, 0x1f33: 0x92bd, 0x1f34: 0xefb9, 0x1f35: 0x92dd, 0x1f36: 0xefd9, 0x1f37: 0x92fd, 0x1f38: 0xeff9, 0x1f39: 0xf019, 0x1f3a: 0xf039, 0x1f3b: 0x931d, 0x1f3c: 0x933d, 0x1f3d: 0xf059, 0x1f3e: 0x935d, 0x1f3f: 0xf079, // Block 0x7d, offset 0x1f40 0x1f40: 0xf6b9, 0x1f41: 0xf6d9, 0x1f42: 0xf6f9, 0x1f43: 0xf719, 0x1f44: 0xf739, 0x1f45: 0x951d, 0x1f46: 0xf759, 0x1f47: 0xf779, 0x1f48: 0xf799, 0x1f49: 0xf7b9, 0x1f4a: 0xf7d9, 0x1f4b: 0x953d, 0x1f4c: 0x955d, 0x1f4d: 0xf7f9, 0x1f4e: 0xf819, 0x1f4f: 0xf839, 0x1f50: 0xf859, 0x1f51: 0xf879, 0x1f52: 0xf899, 0x1f53: 0x957d, 0x1f54: 0xf8b9, 0x1f55: 0xf8d9, 0x1f56: 0xf8f9, 0x1f57: 0xf919, 0x1f58: 0x959d, 0x1f59: 0x95bd, 0x1f5a: 0xf939, 0x1f5b: 0xf959, 0x1f5c: 0xf979, 0x1f5d: 0x95dd, 0x1f5e: 0xf999, 0x1f5f: 0xf9b9, 0x1f60: 0x6815, 0x1f61: 0x95fd, 0x1f62: 0xf9d9, 0x1f63: 0xf9f9, 0x1f64: 0xfa19, 0x1f65: 0x961d, 0x1f66: 0xfa39, 0x1f67: 0xfa59, 0x1f68: 0xfa79, 0x1f69: 0xfa99, 0x1f6a: 0xfab9, 0x1f6b: 0xfad9, 0x1f6c: 0xfaf9, 0x1f6d: 0x963d, 0x1f6e: 0xfb19, 0x1f6f: 0xfb39, 0x1f70: 0xfb59, 0x1f71: 0x965d, 0x1f72: 0xfb79, 0x1f73: 0xfb99, 0x1f74: 0xfbb9, 0x1f75: 0xfbd9, 0x1f76: 0x7b35, 0x1f77: 0x967d, 0x1f78: 0xfbf9, 0x1f79: 0xfc19, 0x1f7a: 0xfc39, 0x1f7b: 0x969d, 0x1f7c: 0xfc59, 0x1f7d: 0x96bd, 0x1f7e: 0xfc79, 0x1f7f: 0xfc79, // Block 0x7e, offset 0x1f80 0x1f80: 0xfc99, 0x1f81: 0x96dd, 0x1f82: 0xfcb9, 0x1f83: 0xfcd9, 0x1f84: 0xfcf9, 0x1f85: 0xfd19, 0x1f86: 0xfd39, 0x1f87: 0xfd59, 0x1f88: 0xfd79, 0x1f89: 0x96fd, 0x1f8a: 0xfd99, 0x1f8b: 0xfdb9, 0x1f8c: 0xfdd9, 0x1f8d: 0xfdf9, 0x1f8e: 0xfe19, 0x1f8f: 0xfe39, 0x1f90: 0x971d, 0x1f91: 0xfe59, 0x1f92: 0x973d, 0x1f93: 0x975d, 0x1f94: 0x977d, 0x1f95: 0xfe79, 0x1f96: 0xfe99, 0x1f97: 0xfeb9, 0x1f98: 0xfed9, 0x1f99: 0xfef9, 0x1f9a: 0xff19, 0x1f9b: 0xff39, 0x1f9c: 0xff59, 0x1f9d: 0x979d, 0x1f9e: 0x0040, 0x1f9f: 0x0040, 0x1fa0: 0x0040, 0x1fa1: 0x0040, 0x1fa2: 0x0040, 0x1fa3: 0x0040, 0x1fa4: 0x0040, 0x1fa5: 0x0040, 0x1fa6: 0x0040, 0x1fa7: 0x0040, 0x1fa8: 0x0040, 0x1fa9: 0x0040, 0x1faa: 0x0040, 0x1fab: 0x0040, 0x1fac: 0x0040, 0x1fad: 0x0040, 0x1fae: 0x0040, 0x1faf: 0x0040, 0x1fb0: 0x0040, 0x1fb1: 0x0040, 0x1fb2: 0x0040, 0x1fb3: 0x0040, 0x1fb4: 0x0040, 0x1fb5: 0x0040, 0x1fb6: 0x0040, 0x1fb7: 0x0040, 0x1fb8: 0x0040, 0x1fb9: 0x0040, 0x1fba: 0x0040, 0x1fbb: 0x0040, 0x1fbc: 0x0040, 0x1fbd: 0x0040, 0x1fbe: 0x0040, 0x1fbf: 0x0040, } // idnaIndex: 36 blocks, 2304 entries, 4608 bytes // Block 0 is the zero block. var idnaIndex = [2304]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x7d, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x04, 0xc7: 0x05, 0xc8: 0x06, 0xc9: 0x7e, 0xca: 0x7f, 0xcb: 0x07, 0xcc: 0x80, 0xcd: 0x08, 0xce: 0x09, 0xcf: 0x0a, 0xd0: 0x81, 0xd1: 0x0b, 0xd2: 0x0c, 0xd3: 0x0d, 0xd4: 0x0e, 0xd5: 0x82, 0xd6: 0x83, 0xd7: 0x84, 0xd8: 0x0f, 0xd9: 0x10, 0xda: 0x85, 0xdb: 0x11, 0xdc: 0x12, 0xdd: 0x86, 0xde: 0x87, 0xdf: 0x88, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xe5: 0x07, 0xe6: 0x07, 0xe7: 0x07, 0xe8: 0x07, 0xe9: 0x08, 0xea: 0x09, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x0a, 0xee: 0x0b, 0xef: 0x0c, 0xf0: 0x1d, 0xf1: 0x1e, 0xf2: 0x1e, 0xf3: 0x20, 0xf4: 0x21, // Block 0x4, offset 0x100 0x120: 0x89, 0x121: 0x13, 0x122: 0x8a, 0x123: 0x8b, 0x124: 0x8c, 0x125: 0x14, 0x126: 0x15, 0x127: 0x16, 0x128: 0x17, 0x129: 0x18, 0x12a: 0x19, 0x12b: 0x1a, 0x12c: 0x1b, 0x12d: 0x1c, 0x12e: 0x1d, 0x12f: 0x8d, 0x130: 0x8e, 0x131: 0x1e, 0x132: 0x1f, 0x133: 0x20, 0x134: 0x8f, 0x135: 0x21, 0x136: 0x90, 0x137: 0x91, 0x138: 0x92, 0x139: 0x93, 0x13a: 0x22, 0x13b: 0x94, 0x13c: 0x95, 0x13d: 0x23, 0x13e: 0x24, 0x13f: 0x96, // Block 0x5, offset 0x140 0x140: 0x97, 0x141: 0x98, 0x142: 0x99, 0x143: 0x9a, 0x144: 0x9b, 0x145: 0x9c, 0x146: 0x9d, 0x147: 0x9e, 0x148: 0x9f, 0x149: 0xa0, 0x14a: 0xa1, 0x14b: 0xa2, 0x14c: 0xa3, 0x14d: 0xa4, 0x14e: 0xa5, 0x14f: 0xa6, 0x150: 0xa7, 0x151: 0x9f, 0x152: 0x9f, 0x153: 0x9f, 0x154: 0x9f, 0x155: 0x9f, 0x156: 0x9f, 0x157: 0x9f, 0x158: 0x9f, 0x159: 0xa8, 0x15a: 0xa9, 0x15b: 0xaa, 0x15c: 0xab, 0x15d: 0xac, 0x15e: 0xad, 0x15f: 0xae, 0x160: 0xaf, 0x161: 0xb0, 0x162: 0xb1, 0x163: 0xb2, 0x164: 0xb3, 0x165: 0xb4, 0x166: 0xb5, 0x167: 0xb6, 0x168: 0xb7, 0x169: 0xb8, 0x16a: 0xb9, 0x16b: 0xba, 0x16c: 0xbb, 0x16d: 0xbc, 0x16e: 0xbd, 0x16f: 0xbe, 0x170: 0xbf, 0x171: 0xc0, 0x172: 0xc1, 0x173: 0xc2, 0x174: 0x25, 0x175: 0x26, 0x176: 0x27, 0x177: 0xc3, 0x178: 0x28, 0x179: 0x28, 0x17a: 0x29, 0x17b: 0x28, 0x17c: 0xc4, 0x17d: 0x2a, 0x17e: 0x2b, 0x17f: 0x2c, // Block 0x6, offset 0x180 0x180: 0x2d, 0x181: 0x2e, 0x182: 0x2f, 0x183: 0xc5, 0x184: 0x30, 0x185: 0x31, 0x186: 0xc6, 0x187: 0x9b, 0x188: 0xc7, 0x189: 0xc8, 0x18a: 0x9b, 0x18b: 0x9b, 0x18c: 0xc9, 0x18d: 0x9b, 0x18e: 0x9b, 0x18f: 0x9b, 0x190: 0xca, 0x191: 0x32, 0x192: 0x33, 0x193: 0x34, 0x194: 0x9b, 0x195: 0x9b, 0x196: 0x9b, 0x197: 0x9b, 0x198: 0x9b, 0x199: 0x9b, 0x19a: 0x9b, 0x19b: 0x9b, 0x19c: 0x9b, 0x19d: 0x9b, 0x19e: 0x9b, 0x19f: 0x9b, 0x1a0: 0x9b, 0x1a1: 0x9b, 0x1a2: 0x9b, 0x1a3: 0x9b, 0x1a4: 0x9b, 0x1a5: 0x9b, 0x1a6: 0x9b, 0x1a7: 0x9b, 0x1a8: 0xcb, 0x1a9: 0xcc, 0x1aa: 0x9b, 0x1ab: 0xcd, 0x1ac: 0x9b, 0x1ad: 0xce, 0x1ae: 0xcf, 0x1af: 0xd0, 0x1b0: 0xd1, 0x1b1: 0x35, 0x1b2: 0x28, 0x1b3: 0x36, 0x1b4: 0xd2, 0x1b5: 0xd3, 0x1b6: 0xd4, 0x1b7: 0xd5, 0x1b8: 0xd6, 0x1b9: 0xd7, 0x1ba: 0xd8, 0x1bb: 0xd9, 0x1bc: 0xda, 0x1bd: 0xdb, 0x1be: 0xdc, 0x1bf: 0x37, // Block 0x7, offset 0x1c0 0x1c0: 0x38, 0x1c1: 0xdd, 0x1c2: 0xde, 0x1c3: 0xdf, 0x1c4: 0xe0, 0x1c5: 0x39, 0x1c6: 0x3a, 0x1c7: 0xe1, 0x1c8: 0xe2, 0x1c9: 0x3b, 0x1ca: 0x3c, 0x1cb: 0x3d, 0x1cc: 0x3e, 0x1cd: 0x3f, 0x1ce: 0x40, 0x1cf: 0x41, 0x1d0: 0x9f, 0x1d1: 0x9f, 0x1d2: 0x9f, 0x1d3: 0x9f, 0x1d4: 0x9f, 0x1d5: 0x9f, 0x1d6: 0x9f, 0x1d7: 0x9f, 0x1d8: 0x9f, 0x1d9: 0x9f, 0x1da: 0x9f, 0x1db: 0x9f, 0x1dc: 0x9f, 0x1dd: 0x9f, 0x1de: 0x9f, 0x1df: 0x9f, 0x1e0: 0x9f, 0x1e1: 0x9f, 0x1e2: 0x9f, 0x1e3: 0x9f, 0x1e4: 0x9f, 0x1e5: 0x9f, 0x1e6: 0x9f, 0x1e7: 0x9f, 0x1e8: 0x9f, 0x1e9: 0x9f, 0x1ea: 0x9f, 0x1eb: 0x9f, 0x1ec: 0x9f, 0x1ed: 0x9f, 0x1ee: 0x9f, 0x1ef: 0x9f, 0x1f0: 0x9f, 0x1f1: 0x9f, 0x1f2: 0x9f, 0x1f3: 0x9f, 0x1f4: 0x9f, 0x1f5: 0x9f, 0x1f6: 0x9f, 0x1f7: 0x9f, 0x1f8: 0x9f, 0x1f9: 0x9f, 0x1fa: 0x9f, 0x1fb: 0x9f, 0x1fc: 0x9f, 0x1fd: 0x9f, 0x1fe: 0x9f, 0x1ff: 0x9f, // Block 0x8, offset 0x200 0x200: 0x9f, 0x201: 0x9f, 0x202: 0x9f, 0x203: 0x9f, 0x204: 0x9f, 0x205: 0x9f, 0x206: 0x9f, 0x207: 0x9f, 0x208: 0x9f, 0x209: 0x9f, 0x20a: 0x9f, 0x20b: 0x9f, 0x20c: 0x9f, 0x20d: 0x9f, 0x20e: 0x9f, 0x20f: 0x9f, 0x210: 0x9f, 0x211: 0x9f, 0x212: 0x9f, 0x213: 0x9f, 0x214: 0x9f, 0x215: 0x9f, 0x216: 0x9f, 0x217: 0x9f, 0x218: 0x9f, 0x219: 0x9f, 0x21a: 0x9f, 0x21b: 0x9f, 0x21c: 0x9f, 0x21d: 0x9f, 0x21e: 0x9f, 0x21f: 0x9f, 0x220: 0x9f, 0x221: 0x9f, 0x222: 0x9f, 0x223: 0x9f, 0x224: 0x9f, 0x225: 0x9f, 0x226: 0x9f, 0x227: 0x9f, 0x228: 0x9f, 0x229: 0x9f, 0x22a: 0x9f, 0x22b: 0x9f, 0x22c: 0x9f, 0x22d: 0x9f, 0x22e: 0x9f, 0x22f: 0x9f, 0x230: 0x9f, 0x231: 0x9f, 0x232: 0x9f, 0x233: 0x9f, 0x234: 0x9f, 0x235: 0x9f, 0x236: 0xb2, 0x237: 0x9b, 0x238: 0x9f, 0x239: 0x9f, 0x23a: 0x9f, 0x23b: 0x9f, 0x23c: 0x9f, 0x23d: 0x9f, 0x23e: 0x9f, 0x23f: 0x9f, // Block 0x9, offset 0x240 0x240: 0x9f, 0x241: 0x9f, 0x242: 0x9f, 0x243: 0x9f, 0x244: 0x9f, 0x245: 0x9f, 0x246: 0x9f, 0x247: 0x9f, 0x248: 0x9f, 0x249: 0x9f, 0x24a: 0x9f, 0x24b: 0x9f, 0x24c: 0x9f, 0x24d: 0x9f, 0x24e: 0x9f, 0x24f: 0x9f, 0x250: 0x9f, 0x251: 0x9f, 0x252: 0x9f, 0x253: 0x9f, 0x254: 0x9f, 0x255: 0x9f, 0x256: 0x9f, 0x257: 0x9f, 0x258: 0x9f, 0x259: 0x9f, 0x25a: 0x9f, 0x25b: 0x9f, 0x25c: 0x9f, 0x25d: 0x9f, 0x25e: 0x9f, 0x25f: 0x9f, 0x260: 0x9f, 0x261: 0x9f, 0x262: 0x9f, 0x263: 0x9f, 0x264: 0x9f, 0x265: 0x9f, 0x266: 0x9f, 0x267: 0x9f, 0x268: 0x9f, 0x269: 0x9f, 0x26a: 0x9f, 0x26b: 0x9f, 0x26c: 0x9f, 0x26d: 0x9f, 0x26e: 0x9f, 0x26f: 0x9f, 0x270: 0x9f, 0x271: 0x9f, 0x272: 0x9f, 0x273: 0x9f, 0x274: 0x9f, 0x275: 0x9f, 0x276: 0x9f, 0x277: 0x9f, 0x278: 0x9f, 0x279: 0x9f, 0x27a: 0x9f, 0x27b: 0x9f, 0x27c: 0x9f, 0x27d: 0x9f, 0x27e: 0x9f, 0x27f: 0x9f, // Block 0xa, offset 0x280 0x280: 0x9f, 0x281: 0x9f, 0x282: 0x9f, 0x283: 0x9f, 0x284: 0x9f, 0x285: 0x9f, 0x286: 0x9f, 0x287: 0x9f, 0x288: 0x9f, 0x289: 0x9f, 0x28a: 0x9f, 0x28b: 0x9f, 0x28c: 0x9f, 0x28d: 0x9f, 0x28e: 0x9f, 0x28f: 0x9f, 0x290: 0x9f, 0x291: 0x9f, 0x292: 0x9f, 0x293: 0x9f, 0x294: 0x9f, 0x295: 0x9f, 0x296: 0x9f, 0x297: 0x9f, 0x298: 0x9f, 0x299: 0x9f, 0x29a: 0x9f, 0x29b: 0x9f, 0x29c: 0x9f, 0x29d: 0x9f, 0x29e: 0x9f, 0x29f: 0x9f, 0x2a0: 0x9f, 0x2a1: 0x9f, 0x2a2: 0x9f, 0x2a3: 0x9f, 0x2a4: 0x9f, 0x2a5: 0x9f, 0x2a6: 0x9f, 0x2a7: 0x9f, 0x2a8: 0x9f, 0x2a9: 0x9f, 0x2aa: 0x9f, 0x2ab: 0x9f, 0x2ac: 0x9f, 0x2ad: 0x9f, 0x2ae: 0x9f, 0x2af: 0x9f, 0x2b0: 0x9f, 0x2b1: 0x9f, 0x2b2: 0x9f, 0x2b3: 0x9f, 0x2b4: 0x9f, 0x2b5: 0x9f, 0x2b6: 0x9f, 0x2b7: 0x9f, 0x2b8: 0x9f, 0x2b9: 0x9f, 0x2ba: 0x9f, 0x2bb: 0x9f, 0x2bc: 0x9f, 0x2bd: 0x9f, 0x2be: 0x9f, 0x2bf: 0xe3, // Block 0xb, offset 0x2c0 0x2c0: 0x9f, 0x2c1: 0x9f, 0x2c2: 0x9f, 0x2c3: 0x9f, 0x2c4: 0x9f, 0x2c5: 0x9f, 0x2c6: 0x9f, 0x2c7: 0x9f, 0x2c8: 0x9f, 0x2c9: 0x9f, 0x2ca: 0x9f, 0x2cb: 0x9f, 0x2cc: 0x9f, 0x2cd: 0x9f, 0x2ce: 0x9f, 0x2cf: 0x9f, 0x2d0: 0x9f, 0x2d1: 0x9f, 0x2d2: 0xe4, 0x2d3: 0xe5, 0x2d4: 0x9f, 0x2d5: 0x9f, 0x2d6: 0x9f, 0x2d7: 0x9f, 0x2d8: 0xe6, 0x2d9: 0x42, 0x2da: 0x43, 0x2db: 0xe7, 0x2dc: 0x44, 0x2dd: 0x45, 0x2de: 0x46, 0x2df: 0xe8, 0x2e0: 0xe9, 0x2e1: 0xea, 0x2e2: 0xeb, 0x2e3: 0xec, 0x2e4: 0xed, 0x2e5: 0xee, 0x2e6: 0xef, 0x2e7: 0xf0, 0x2e8: 0xf1, 0x2e9: 0xf2, 0x2ea: 0xf3, 0x2eb: 0xf4, 0x2ec: 0xf5, 0x2ed: 0xf6, 0x2ee: 0xf7, 0x2ef: 0xf8, 0x2f0: 0x9f, 0x2f1: 0x9f, 0x2f2: 0x9f, 0x2f3: 0x9f, 0x2f4: 0x9f, 0x2f5: 0x9f, 0x2f6: 0x9f, 0x2f7: 0x9f, 0x2f8: 0x9f, 0x2f9: 0x9f, 0x2fa: 0x9f, 0x2fb: 0x9f, 0x2fc: 0x9f, 0x2fd: 0x9f, 0x2fe: 0x9f, 0x2ff: 0x9f, // Block 0xc, offset 0x300 0x300: 0x9f, 0x301: 0x9f, 0x302: 0x9f, 0x303: 0x9f, 0x304: 0x9f, 0x305: 0x9f, 0x306: 0x9f, 0x307: 0x9f, 0x308: 0x9f, 0x309: 0x9f, 0x30a: 0x9f, 0x30b: 0x9f, 0x30c: 0x9f, 0x30d: 0x9f, 0x30e: 0x9f, 0x30f: 0x9f, 0x310: 0x9f, 0x311: 0x9f, 0x312: 0x9f, 0x313: 0x9f, 0x314: 0x9f, 0x315: 0x9f, 0x316: 0x9f, 0x317: 0x9f, 0x318: 0x9f, 0x319: 0x9f, 0x31a: 0x9f, 0x31b: 0x9f, 0x31c: 0x9f, 0x31d: 0x9f, 0x31e: 0xf9, 0x31f: 0xfa, // Block 0xd, offset 0x340 0x340: 0xba, 0x341: 0xba, 0x342: 0xba, 0x343: 0xba, 0x344: 0xba, 0x345: 0xba, 0x346: 0xba, 0x347: 0xba, 0x348: 0xba, 0x349: 0xba, 0x34a: 0xba, 0x34b: 0xba, 0x34c: 0xba, 0x34d: 0xba, 0x34e: 0xba, 0x34f: 0xba, 0x350: 0xba, 0x351: 0xba, 0x352: 0xba, 0x353: 0xba, 0x354: 0xba, 0x355: 0xba, 0x356: 0xba, 0x357: 0xba, 0x358: 0xba, 0x359: 0xba, 0x35a: 0xba, 0x35b: 0xba, 0x35c: 0xba, 0x35d: 0xba, 0x35e: 0xba, 0x35f: 0xba, 0x360: 0xba, 0x361: 0xba, 0x362: 0xba, 0x363: 0xba, 0x364: 0xba, 0x365: 0xba, 0x366: 0xba, 0x367: 0xba, 0x368: 0xba, 0x369: 0xba, 0x36a: 0xba, 0x36b: 0xba, 0x36c: 0xba, 0x36d: 0xba, 0x36e: 0xba, 0x36f: 0xba, 0x370: 0xba, 0x371: 0xba, 0x372: 0xba, 0x373: 0xba, 0x374: 0xba, 0x375: 0xba, 0x376: 0xba, 0x377: 0xba, 0x378: 0xba, 0x379: 0xba, 0x37a: 0xba, 0x37b: 0xba, 0x37c: 0xba, 0x37d: 0xba, 0x37e: 0xba, 0x37f: 0xba, // Block 0xe, offset 0x380 0x380: 0xba, 0x381: 0xba, 0x382: 0xba, 0x383: 0xba, 0x384: 0xba, 0x385: 0xba, 0x386: 0xba, 0x387: 0xba, 0x388: 0xba, 0x389: 0xba, 0x38a: 0xba, 0x38b: 0xba, 0x38c: 0xba, 0x38d: 0xba, 0x38e: 0xba, 0x38f: 0xba, 0x390: 0xba, 0x391: 0xba, 0x392: 0xba, 0x393: 0xba, 0x394: 0xba, 0x395: 0xba, 0x396: 0xba, 0x397: 0xba, 0x398: 0xba, 0x399: 0xba, 0x39a: 0xba, 0x39b: 0xba, 0x39c: 0xba, 0x39d: 0xba, 0x39e: 0xba, 0x39f: 0xba, 0x3a0: 0xba, 0x3a1: 0xba, 0x3a2: 0xba, 0x3a3: 0xba, 0x3a4: 0xfb, 0x3a5: 0xfc, 0x3a6: 0xfd, 0x3a7: 0xfe, 0x3a8: 0x47, 0x3a9: 0xff, 0x3aa: 0x100, 0x3ab: 0x48, 0x3ac: 0x49, 0x3ad: 0x4a, 0x3ae: 0x4b, 0x3af: 0x4c, 0x3b0: 0x101, 0x3b1: 0x4d, 0x3b2: 0x4e, 0x3b3: 0x4f, 0x3b4: 0x50, 0x3b5: 0x51, 0x3b6: 0x102, 0x3b7: 0x52, 0x3b8: 0x53, 0x3b9: 0x54, 0x3ba: 0x55, 0x3bb: 0x56, 0x3bc: 0x57, 0x3bd: 0x58, 0x3be: 0x59, 0x3bf: 0x5a, // Block 0xf, offset 0x3c0 0x3c0: 0x103, 0x3c1: 0x104, 0x3c2: 0x9f, 0x3c3: 0x105, 0x3c4: 0x106, 0x3c5: 0x9b, 0x3c6: 0x107, 0x3c7: 0x108, 0x3c8: 0xba, 0x3c9: 0xba, 0x3ca: 0x109, 0x3cb: 0x10a, 0x3cc: 0x10b, 0x3cd: 0x10c, 0x3ce: 0x10d, 0x3cf: 0x10e, 0x3d0: 0x10f, 0x3d1: 0x9f, 0x3d2: 0x110, 0x3d3: 0x111, 0x3d4: 0x112, 0x3d5: 0x113, 0x3d6: 0xba, 0x3d7: 0xba, 0x3d8: 0x9f, 0x3d9: 0x9f, 0x3da: 0x9f, 0x3db: 0x9f, 0x3dc: 0x114, 0x3dd: 0x115, 0x3de: 0xba, 0x3df: 0xba, 0x3e0: 0x116, 0x3e1: 0x117, 0x3e2: 0x118, 0x3e3: 0x119, 0x3e4: 0x11a, 0x3e5: 0xba, 0x3e6: 0x11b, 0x3e7: 0x11c, 0x3e8: 0x11d, 0x3e9: 0x11e, 0x3ea: 0x11f, 0x3eb: 0x5b, 0x3ec: 0x120, 0x3ed: 0x121, 0x3ee: 0x5c, 0x3ef: 0xba, 0x3f0: 0x122, 0x3f1: 0x123, 0x3f2: 0x124, 0x3f3: 0x125, 0x3f4: 0xba, 0x3f5: 0xba, 0x3f6: 0xba, 0x3f7: 0xba, 0x3f8: 0xba, 0x3f9: 0x126, 0x3fa: 0xba, 0x3fb: 0xba, 0x3fc: 0xba, 0x3fd: 0xba, 0x3fe: 0xba, 0x3ff: 0xba, // Block 0x10, offset 0x400 0x400: 0x127, 0x401: 0x128, 0x402: 0x129, 0x403: 0x12a, 0x404: 0x12b, 0x405: 0x12c, 0x406: 0x12d, 0x407: 0x12e, 0x408: 0x12f, 0x409: 0xba, 0x40a: 0x130, 0x40b: 0x131, 0x40c: 0x5d, 0x40d: 0x5e, 0x40e: 0xba, 0x40f: 0xba, 0x410: 0x132, 0x411: 0x133, 0x412: 0x134, 0x413: 0x135, 0x414: 0xba, 0x415: 0xba, 0x416: 0x136, 0x417: 0x137, 0x418: 0x138, 0x419: 0x139, 0x41a: 0x13a, 0x41b: 0x13b, 0x41c: 0x13c, 0x41d: 0xba, 0x41e: 0xba, 0x41f: 0xba, 0x420: 0xba, 0x421: 0xba, 0x422: 0x13d, 0x423: 0x13e, 0x424: 0xba, 0x425: 0xba, 0x426: 0xba, 0x427: 0xba, 0x428: 0x13f, 0x429: 0x140, 0x42a: 0x141, 0x42b: 0x142, 0x42c: 0xba, 0x42d: 0xba, 0x42e: 0xba, 0x42f: 0xba, 0x430: 0x143, 0x431: 0x144, 0x432: 0x145, 0x433: 0xba, 0x434: 0x146, 0x435: 0x147, 0x436: 0xba, 0x437: 0xba, 0x438: 0xba, 0x439: 0xba, 0x43a: 0xba, 0x43b: 0xba, 0x43c: 0xba, 0x43d: 0xba, 0x43e: 0xba, 0x43f: 0xba, // Block 0x11, offset 0x440 0x440: 0x9f, 0x441: 0x9f, 0x442: 0x9f, 0x443: 0x9f, 0x444: 0x9f, 0x445: 0x9f, 0x446: 0x9f, 0x447: 0x9f, 0x448: 0x9f, 0x449: 0x9f, 0x44a: 0x9f, 0x44b: 0x9f, 0x44c: 0x9f, 0x44d: 0x9f, 0x44e: 0x148, 0x44f: 0xba, 0x450: 0x9b, 0x451: 0x149, 0x452: 0x9f, 0x453: 0x9f, 0x454: 0x9f, 0x455: 0x14a, 0x456: 0xba, 0x457: 0xba, 0x458: 0xba, 0x459: 0xba, 0x45a: 0xba, 0x45b: 0xba, 0x45c: 0xba, 0x45d: 0xba, 0x45e: 0xba, 0x45f: 0xba, 0x460: 0xba, 0x461: 0xba, 0x462: 0xba, 0x463: 0xba, 0x464: 0xba, 0x465: 0xba, 0x466: 0xba, 0x467: 0xba, 0x468: 0xba, 0x469: 0xba, 0x46a: 0xba, 0x46b: 0xba, 0x46c: 0xba, 0x46d: 0xba, 0x46e: 0xba, 0x46f: 0xba, 0x470: 0xba, 0x471: 0xba, 0x472: 0xba, 0x473: 0xba, 0x474: 0xba, 0x475: 0xba, 0x476: 0xba, 0x477: 0xba, 0x478: 0xba, 0x479: 0xba, 0x47a: 0xba, 0x47b: 0xba, 0x47c: 0xba, 0x47d: 0xba, 0x47e: 0xba, 0x47f: 0xba, // Block 0x12, offset 0x480 0x480: 0x9f, 0x481: 0x9f, 0x482: 0x9f, 0x483: 0x9f, 0x484: 0x9f, 0x485: 0x9f, 0x486: 0x9f, 0x487: 0x9f, 0x488: 0x9f, 0x489: 0x9f, 0x48a: 0x9f, 0x48b: 0x9f, 0x48c: 0x9f, 0x48d: 0x9f, 0x48e: 0x9f, 0x48f: 0x9f, 0x490: 0x14b, 0x491: 0xba, 0x492: 0xba, 0x493: 0xba, 0x494: 0xba, 0x495: 0xba, 0x496: 0xba, 0x497: 0xba, 0x498: 0xba, 0x499: 0xba, 0x49a: 0xba, 0x49b: 0xba, 0x49c: 0xba, 0x49d: 0xba, 0x49e: 0xba, 0x49f: 0xba, 0x4a0: 0xba, 0x4a1: 0xba, 0x4a2: 0xba, 0x4a3: 0xba, 0x4a4: 0xba, 0x4a5: 0xba, 0x4a6: 0xba, 0x4a7: 0xba, 0x4a8: 0xba, 0x4a9: 0xba, 0x4aa: 0xba, 0x4ab: 0xba, 0x4ac: 0xba, 0x4ad: 0xba, 0x4ae: 0xba, 0x4af: 0xba, 0x4b0: 0xba, 0x4b1: 0xba, 0x4b2: 0xba, 0x4b3: 0xba, 0x4b4: 0xba, 0x4b5: 0xba, 0x4b6: 0xba, 0x4b7: 0xba, 0x4b8: 0xba, 0x4b9: 0xba, 0x4ba: 0xba, 0x4bb: 0xba, 0x4bc: 0xba, 0x4bd: 0xba, 0x4be: 0xba, 0x4bf: 0xba, // Block 0x13, offset 0x4c0 0x4c0: 0xba, 0x4c1: 0xba, 0x4c2: 0xba, 0x4c3: 0xba, 0x4c4: 0xba, 0x4c5: 0xba, 0x4c6: 0xba, 0x4c7: 0xba, 0x4c8: 0xba, 0x4c9: 0xba, 0x4ca: 0xba, 0x4cb: 0xba, 0x4cc: 0xba, 0x4cd: 0xba, 0x4ce: 0xba, 0x4cf: 0xba, 0x4d0: 0x9f, 0x4d1: 0x9f, 0x4d2: 0x9f, 0x4d3: 0x9f, 0x4d4: 0x9f, 0x4d5: 0x9f, 0x4d6: 0x9f, 0x4d7: 0x9f, 0x4d8: 0x9f, 0x4d9: 0x14c, 0x4da: 0xba, 0x4db: 0xba, 0x4dc: 0xba, 0x4dd: 0xba, 0x4de: 0xba, 0x4df: 0xba, 0x4e0: 0xba, 0x4e1: 0xba, 0x4e2: 0xba, 0x4e3: 0xba, 0x4e4: 0xba, 0x4e5: 0xba, 0x4e6: 0xba, 0x4e7: 0xba, 0x4e8: 0xba, 0x4e9: 0xba, 0x4ea: 0xba, 0x4eb: 0xba, 0x4ec: 0xba, 0x4ed: 0xba, 0x4ee: 0xba, 0x4ef: 0xba, 0x4f0: 0xba, 0x4f1: 0xba, 0x4f2: 0xba, 0x4f3: 0xba, 0x4f4: 0xba, 0x4f5: 0xba, 0x4f6: 0xba, 0x4f7: 0xba, 0x4f8: 0xba, 0x4f9: 0xba, 0x4fa: 0xba, 0x4fb: 0xba, 0x4fc: 0xba, 0x4fd: 0xba, 0x4fe: 0xba, 0x4ff: 0xba, // Block 0x14, offset 0x500 0x500: 0xba, 0x501: 0xba, 0x502: 0xba, 0x503: 0xba, 0x504: 0xba, 0x505: 0xba, 0x506: 0xba, 0x507: 0xba, 0x508: 0xba, 0x509: 0xba, 0x50a: 0xba, 0x50b: 0xba, 0x50c: 0xba, 0x50d: 0xba, 0x50e: 0xba, 0x50f: 0xba, 0x510: 0xba, 0x511: 0xba, 0x512: 0xba, 0x513: 0xba, 0x514: 0xba, 0x515: 0xba, 0x516: 0xba, 0x517: 0xba, 0x518: 0xba, 0x519: 0xba, 0x51a: 0xba, 0x51b: 0xba, 0x51c: 0xba, 0x51d: 0xba, 0x51e: 0xba, 0x51f: 0xba, 0x520: 0x9f, 0x521: 0x9f, 0x522: 0x9f, 0x523: 0x9f, 0x524: 0x9f, 0x525: 0x9f, 0x526: 0x9f, 0x527: 0x9f, 0x528: 0x142, 0x529: 0x14d, 0x52a: 0xba, 0x52b: 0x14e, 0x52c: 0x14f, 0x52d: 0x150, 0x52e: 0x151, 0x52f: 0xba, 0x530: 0xba, 0x531: 0xba, 0x532: 0xba, 0x533: 0xba, 0x534: 0xba, 0x535: 0xba, 0x536: 0xba, 0x537: 0xba, 0x538: 0xba, 0x539: 0xba, 0x53a: 0xba, 0x53b: 0xba, 0x53c: 0x9f, 0x53d: 0x152, 0x53e: 0x153, 0x53f: 0x154, // Block 0x15, offset 0x540 0x540: 0x9f, 0x541: 0x9f, 0x542: 0x9f, 0x543: 0x9f, 0x544: 0x9f, 0x545: 0x9f, 0x546: 0x9f, 0x547: 0x9f, 0x548: 0x9f, 0x549: 0x9f, 0x54a: 0x9f, 0x54b: 0x9f, 0x54c: 0x9f, 0x54d: 0x9f, 0x54e: 0x9f, 0x54f: 0x9f, 0x550: 0x9f, 0x551: 0x9f, 0x552: 0x9f, 0x553: 0x9f, 0x554: 0x9f, 0x555: 0x9f, 0x556: 0x9f, 0x557: 0x9f, 0x558: 0x9f, 0x559: 0x9f, 0x55a: 0x9f, 0x55b: 0x9f, 0x55c: 0x9f, 0x55d: 0x9f, 0x55e: 0x9f, 0x55f: 0x155, 0x560: 0x9f, 0x561: 0x9f, 0x562: 0x9f, 0x563: 0x9f, 0x564: 0x9f, 0x565: 0x9f, 0x566: 0x9f, 0x567: 0x9f, 0x568: 0x9f, 0x569: 0x9f, 0x56a: 0x9f, 0x56b: 0x156, 0x56c: 0xba, 0x56d: 0xba, 0x56e: 0xba, 0x56f: 0xba, 0x570: 0xba, 0x571: 0xba, 0x572: 0xba, 0x573: 0xba, 0x574: 0xba, 0x575: 0xba, 0x576: 0xba, 0x577: 0xba, 0x578: 0xba, 0x579: 0xba, 0x57a: 0xba, 0x57b: 0xba, 0x57c: 0xba, 0x57d: 0xba, 0x57e: 0xba, 0x57f: 0xba, // Block 0x16, offset 0x580 0x580: 0x9f, 0x581: 0x9f, 0x582: 0x9f, 0x583: 0x9f, 0x584: 0x157, 0x585: 0x158, 0x586: 0x9f, 0x587: 0x9f, 0x588: 0x9f, 0x589: 0x9f, 0x58a: 0x9f, 0x58b: 0x159, 0x58c: 0xba, 0x58d: 0xba, 0x58e: 0xba, 0x58f: 0xba, 0x590: 0xba, 0x591: 0xba, 0x592: 0xba, 0x593: 0xba, 0x594: 0xba, 0x595: 0xba, 0x596: 0xba, 0x597: 0xba, 0x598: 0xba, 0x599: 0xba, 0x59a: 0xba, 0x59b: 0xba, 0x59c: 0xba, 0x59d: 0xba, 0x59e: 0xba, 0x59f: 0xba, 0x5a0: 0xba, 0x5a1: 0xba, 0x5a2: 0xba, 0x5a3: 0xba, 0x5a4: 0xba, 0x5a5: 0xba, 0x5a6: 0xba, 0x5a7: 0xba, 0x5a8: 0xba, 0x5a9: 0xba, 0x5aa: 0xba, 0x5ab: 0xba, 0x5ac: 0xba, 0x5ad: 0xba, 0x5ae: 0xba, 0x5af: 0xba, 0x5b0: 0x9f, 0x5b1: 0x15a, 0x5b2: 0x15b, 0x5b3: 0xba, 0x5b4: 0xba, 0x5b5: 0xba, 0x5b6: 0xba, 0x5b7: 0xba, 0x5b8: 0xba, 0x5b9: 0xba, 0x5ba: 0xba, 0x5bb: 0xba, 0x5bc: 0xba, 0x5bd: 0xba, 0x5be: 0xba, 0x5bf: 0xba, // Block 0x17, offset 0x5c0 0x5c0: 0x9b, 0x5c1: 0x9b, 0x5c2: 0x9b, 0x5c3: 0x15c, 0x5c4: 0x15d, 0x5c5: 0x15e, 0x5c6: 0x15f, 0x5c7: 0x160, 0x5c8: 0x9b, 0x5c9: 0x161, 0x5ca: 0xba, 0x5cb: 0xba, 0x5cc: 0x9b, 0x5cd: 0x162, 0x5ce: 0xba, 0x5cf: 0xba, 0x5d0: 0x5f, 0x5d1: 0x60, 0x5d2: 0x61, 0x5d3: 0x62, 0x5d4: 0x63, 0x5d5: 0x64, 0x5d6: 0x65, 0x5d7: 0x66, 0x5d8: 0x67, 0x5d9: 0x68, 0x5da: 0x69, 0x5db: 0x6a, 0x5dc: 0x6b, 0x5dd: 0x6c, 0x5de: 0x6d, 0x5df: 0x6e, 0x5e0: 0x9b, 0x5e1: 0x9b, 0x5e2: 0x9b, 0x5e3: 0x9b, 0x5e4: 0x9b, 0x5e5: 0x9b, 0x5e6: 0x9b, 0x5e7: 0x9b, 0x5e8: 0x163, 0x5e9: 0x164, 0x5ea: 0x165, 0x5eb: 0xba, 0x5ec: 0xba, 0x5ed: 0xba, 0x5ee: 0xba, 0x5ef: 0xba, 0x5f0: 0xba, 0x5f1: 0xba, 0x5f2: 0xba, 0x5f3: 0xba, 0x5f4: 0xba, 0x5f5: 0xba, 0x5f6: 0xba, 0x5f7: 0xba, 0x5f8: 0xba, 0x5f9: 0xba, 0x5fa: 0xba, 0x5fb: 0xba, 0x5fc: 0xba, 0x5fd: 0xba, 0x5fe: 0xba, 0x5ff: 0xba, // Block 0x18, offset 0x600 0x600: 0x166, 0x601: 0xba, 0x602: 0xba, 0x603: 0xba, 0x604: 0xba, 0x605: 0xba, 0x606: 0xba, 0x607: 0xba, 0x608: 0xba, 0x609: 0xba, 0x60a: 0xba, 0x60b: 0xba, 0x60c: 0xba, 0x60d: 0xba, 0x60e: 0xba, 0x60f: 0xba, 0x610: 0xba, 0x611: 0xba, 0x612: 0xba, 0x613: 0xba, 0x614: 0xba, 0x615: 0xba, 0x616: 0xba, 0x617: 0xba, 0x618: 0xba, 0x619: 0xba, 0x61a: 0xba, 0x61b: 0xba, 0x61c: 0xba, 0x61d: 0xba, 0x61e: 0xba, 0x61f: 0xba, 0x620: 0x122, 0x621: 0x122, 0x622: 0x122, 0x623: 0x167, 0x624: 0x6f, 0x625: 0x168, 0x626: 0xba, 0x627: 0xba, 0x628: 0xba, 0x629: 0xba, 0x62a: 0xba, 0x62b: 0xba, 0x62c: 0xba, 0x62d: 0xba, 0x62e: 0xba, 0x62f: 0xba, 0x630: 0xba, 0x631: 0xba, 0x632: 0xba, 0x633: 0xba, 0x634: 0xba, 0x635: 0xba, 0x636: 0xba, 0x637: 0xba, 0x638: 0x70, 0x639: 0x71, 0x63a: 0x72, 0x63b: 0x169, 0x63c: 0xba, 0x63d: 0xba, 0x63e: 0xba, 0x63f: 0xba, // Block 0x19, offset 0x640 0x640: 0x16a, 0x641: 0x9b, 0x642: 0x16b, 0x643: 0x16c, 0x644: 0x73, 0x645: 0x74, 0x646: 0x16d, 0x647: 0x16e, 0x648: 0x75, 0x649: 0x16f, 0x64a: 0xba, 0x64b: 0xba, 0x64c: 0x9b, 0x64d: 0x9b, 0x64e: 0x9b, 0x64f: 0x9b, 0x650: 0x9b, 0x651: 0x9b, 0x652: 0x9b, 0x653: 0x9b, 0x654: 0x9b, 0x655: 0x9b, 0x656: 0x9b, 0x657: 0x9b, 0x658: 0x9b, 0x659: 0x9b, 0x65a: 0x9b, 0x65b: 0x170, 0x65c: 0x9b, 0x65d: 0x171, 0x65e: 0x9b, 0x65f: 0x172, 0x660: 0x173, 0x661: 0x174, 0x662: 0x175, 0x663: 0xba, 0x664: 0x176, 0x665: 0x177, 0x666: 0x178, 0x667: 0x179, 0x668: 0xba, 0x669: 0xba, 0x66a: 0xba, 0x66b: 0xba, 0x66c: 0xba, 0x66d: 0xba, 0x66e: 0xba, 0x66f: 0xba, 0x670: 0xba, 0x671: 0xba, 0x672: 0xba, 0x673: 0xba, 0x674: 0xba, 0x675: 0xba, 0x676: 0xba, 0x677: 0xba, 0x678: 0xba, 0x679: 0xba, 0x67a: 0xba, 0x67b: 0xba, 0x67c: 0xba, 0x67d: 0xba, 0x67e: 0xba, 0x67f: 0xba, // Block 0x1a, offset 0x680 0x680: 0x9f, 0x681: 0x9f, 0x682: 0x9f, 0x683: 0x9f, 0x684: 0x9f, 0x685: 0x9f, 0x686: 0x9f, 0x687: 0x9f, 0x688: 0x9f, 0x689: 0x9f, 0x68a: 0x9f, 0x68b: 0x9f, 0x68c: 0x9f, 0x68d: 0x9f, 0x68e: 0x9f, 0x68f: 0x9f, 0x690: 0x9f, 0x691: 0x9f, 0x692: 0x9f, 0x693: 0x9f, 0x694: 0x9f, 0x695: 0x9f, 0x696: 0x9f, 0x697: 0x9f, 0x698: 0x9f, 0x699: 0x9f, 0x69a: 0x9f, 0x69b: 0x17a, 0x69c: 0x9f, 0x69d: 0x9f, 0x69e: 0x9f, 0x69f: 0x9f, 0x6a0: 0x9f, 0x6a1: 0x9f, 0x6a2: 0x9f, 0x6a3: 0x9f, 0x6a4: 0x9f, 0x6a5: 0x9f, 0x6a6: 0x9f, 0x6a7: 0x9f, 0x6a8: 0x9f, 0x6a9: 0x9f, 0x6aa: 0x9f, 0x6ab: 0x9f, 0x6ac: 0x9f, 0x6ad: 0x9f, 0x6ae: 0x9f, 0x6af: 0x9f, 0x6b0: 0x9f, 0x6b1: 0x9f, 0x6b2: 0x9f, 0x6b3: 0x9f, 0x6b4: 0x9f, 0x6b5: 0x9f, 0x6b6: 0x9f, 0x6b7: 0x9f, 0x6b8: 0x9f, 0x6b9: 0x9f, 0x6ba: 0x9f, 0x6bb: 0x9f, 0x6bc: 0x9f, 0x6bd: 0x9f, 0x6be: 0x9f, 0x6bf: 0x9f, // Block 0x1b, offset 0x6c0 0x6c0: 0x9f, 0x6c1: 0x9f, 0x6c2: 0x9f, 0x6c3: 0x9f, 0x6c4: 0x9f, 0x6c5: 0x9f, 0x6c6: 0x9f, 0x6c7: 0x9f, 0x6c8: 0x9f, 0x6c9: 0x9f, 0x6ca: 0x9f, 0x6cb: 0x9f, 0x6cc: 0x9f, 0x6cd: 0x9f, 0x6ce: 0x9f, 0x6cf: 0x9f, 0x6d0: 0x9f, 0x6d1: 0x9f, 0x6d2: 0x9f, 0x6d3: 0x9f, 0x6d4: 0x9f, 0x6d5: 0x9f, 0x6d6: 0x9f, 0x6d7: 0x9f, 0x6d8: 0x9f, 0x6d9: 0x9f, 0x6da: 0x9f, 0x6db: 0x9f, 0x6dc: 0x17b, 0x6dd: 0x9f, 0x6de: 0x9f, 0x6df: 0x9f, 0x6e0: 0x17c, 0x6e1: 0x9f, 0x6e2: 0x9f, 0x6e3: 0x9f, 0x6e4: 0x9f, 0x6e5: 0x9f, 0x6e6: 0x9f, 0x6e7: 0x9f, 0x6e8: 0x9f, 0x6e9: 0x9f, 0x6ea: 0x9f, 0x6eb: 0x9f, 0x6ec: 0x9f, 0x6ed: 0x9f, 0x6ee: 0x9f, 0x6ef: 0x9f, 0x6f0: 0x9f, 0x6f1: 0x9f, 0x6f2: 0x9f, 0x6f3: 0x9f, 0x6f4: 0x9f, 0x6f5: 0x9f, 0x6f6: 0x9f, 0x6f7: 0x9f, 0x6f8: 0x9f, 0x6f9: 0x9f, 0x6fa: 0x9f, 0x6fb: 0x9f, 0x6fc: 0x9f, 0x6fd: 0x9f, 0x6fe: 0x9f, 0x6ff: 0x9f, // Block 0x1c, offset 0x700 0x700: 0x9f, 0x701: 0x9f, 0x702: 0x9f, 0x703: 0x9f, 0x704: 0x9f, 0x705: 0x9f, 0x706: 0x9f, 0x707: 0x9f, 0x708: 0x9f, 0x709: 0x9f, 0x70a: 0x9f, 0x70b: 0x9f, 0x70c: 0x9f, 0x70d: 0x9f, 0x70e: 0x9f, 0x70f: 0x9f, 0x710: 0x9f, 0x711: 0x9f, 0x712: 0x9f, 0x713: 0x9f, 0x714: 0x9f, 0x715: 0x9f, 0x716: 0x9f, 0x717: 0x9f, 0x718: 0x9f, 0x719: 0x9f, 0x71a: 0x9f, 0x71b: 0x9f, 0x71c: 0x9f, 0x71d: 0x9f, 0x71e: 0x9f, 0x71f: 0x9f, 0x720: 0x9f, 0x721: 0x9f, 0x722: 0x9f, 0x723: 0x9f, 0x724: 0x9f, 0x725: 0x9f, 0x726: 0x9f, 0x727: 0x9f, 0x728: 0x9f, 0x729: 0x9f, 0x72a: 0x9f, 0x72b: 0x9f, 0x72c: 0x9f, 0x72d: 0x9f, 0x72e: 0x9f, 0x72f: 0x9f, 0x730: 0x9f, 0x731: 0x9f, 0x732: 0x9f, 0x733: 0x9f, 0x734: 0x9f, 0x735: 0x9f, 0x736: 0x9f, 0x737: 0x9f, 0x738: 0x9f, 0x739: 0x9f, 0x73a: 0x17d, 0x73b: 0x9f, 0x73c: 0x9f, 0x73d: 0x9f, 0x73e: 0x9f, 0x73f: 0x9f, // Block 0x1d, offset 0x740 0x740: 0x9f, 0x741: 0x9f, 0x742: 0x9f, 0x743: 0x9f, 0x744: 0x9f, 0x745: 0x9f, 0x746: 0x9f, 0x747: 0x9f, 0x748: 0x9f, 0x749: 0x9f, 0x74a: 0x9f, 0x74b: 0x9f, 0x74c: 0x9f, 0x74d: 0x9f, 0x74e: 0x9f, 0x74f: 0x9f, 0x750: 0x9f, 0x751: 0x9f, 0x752: 0x9f, 0x753: 0x9f, 0x754: 0x9f, 0x755: 0x9f, 0x756: 0x9f, 0x757: 0x9f, 0x758: 0x9f, 0x759: 0x9f, 0x75a: 0x9f, 0x75b: 0x9f, 0x75c: 0x9f, 0x75d: 0x9f, 0x75e: 0x9f, 0x75f: 0x9f, 0x760: 0x9f, 0x761: 0x9f, 0x762: 0x9f, 0x763: 0x9f, 0x764: 0x9f, 0x765: 0x9f, 0x766: 0x9f, 0x767: 0x9f, 0x768: 0x9f, 0x769: 0x9f, 0x76a: 0x9f, 0x76b: 0x9f, 0x76c: 0x9f, 0x76d: 0x9f, 0x76e: 0x9f, 0x76f: 0x17e, 0x770: 0xba, 0x771: 0xba, 0x772: 0xba, 0x773: 0xba, 0x774: 0xba, 0x775: 0xba, 0x776: 0xba, 0x777: 0xba, 0x778: 0xba, 0x779: 0xba, 0x77a: 0xba, 0x77b: 0xba, 0x77c: 0xba, 0x77d: 0xba, 0x77e: 0xba, 0x77f: 0xba, // Block 0x1e, offset 0x780 0x780: 0xba, 0x781: 0xba, 0x782: 0xba, 0x783: 0xba, 0x784: 0xba, 0x785: 0xba, 0x786: 0xba, 0x787: 0xba, 0x788: 0xba, 0x789: 0xba, 0x78a: 0xba, 0x78b: 0xba, 0x78c: 0xba, 0x78d: 0xba, 0x78e: 0xba, 0x78f: 0xba, 0x790: 0xba, 0x791: 0xba, 0x792: 0xba, 0x793: 0xba, 0x794: 0xba, 0x795: 0xba, 0x796: 0xba, 0x797: 0xba, 0x798: 0xba, 0x799: 0xba, 0x79a: 0xba, 0x79b: 0xba, 0x79c: 0xba, 0x79d: 0xba, 0x79e: 0xba, 0x79f: 0xba, 0x7a0: 0x76, 0x7a1: 0x77, 0x7a2: 0x78, 0x7a3: 0x17f, 0x7a4: 0x79, 0x7a5: 0x7a, 0x7a6: 0x180, 0x7a7: 0x7b, 0x7a8: 0x7c, 0x7a9: 0xba, 0x7aa: 0xba, 0x7ab: 0xba, 0x7ac: 0xba, 0x7ad: 0xba, 0x7ae: 0xba, 0x7af: 0xba, 0x7b0: 0xba, 0x7b1: 0xba, 0x7b2: 0xba, 0x7b3: 0xba, 0x7b4: 0xba, 0x7b5: 0xba, 0x7b6: 0xba, 0x7b7: 0xba, 0x7b8: 0xba, 0x7b9: 0xba, 0x7ba: 0xba, 0x7bb: 0xba, 0x7bc: 0xba, 0x7bd: 0xba, 0x7be: 0xba, 0x7bf: 0xba, // Block 0x1f, offset 0x7c0 0x7d0: 0x0d, 0x7d1: 0x0e, 0x7d2: 0x0f, 0x7d3: 0x10, 0x7d4: 0x11, 0x7d5: 0x0b, 0x7d6: 0x12, 0x7d7: 0x07, 0x7d8: 0x13, 0x7d9: 0x0b, 0x7da: 0x0b, 0x7db: 0x14, 0x7dc: 0x0b, 0x7dd: 0x15, 0x7de: 0x16, 0x7df: 0x17, 0x7e0: 0x07, 0x7e1: 0x07, 0x7e2: 0x07, 0x7e3: 0x07, 0x7e4: 0x07, 0x7e5: 0x07, 0x7e6: 0x07, 0x7e7: 0x07, 0x7e8: 0x07, 0x7e9: 0x07, 0x7ea: 0x18, 0x7eb: 0x19, 0x7ec: 0x1a, 0x7ed: 0x07, 0x7ee: 0x1b, 0x7ef: 0x1c, 0x7f0: 0x0b, 0x7f1: 0x0b, 0x7f2: 0x0b, 0x7f3: 0x0b, 0x7f4: 0x0b, 0x7f5: 0x0b, 0x7f6: 0x0b, 0x7f7: 0x0b, 0x7f8: 0x0b, 0x7f9: 0x0b, 0x7fa: 0x0b, 0x7fb: 0x0b, 0x7fc: 0x0b, 0x7fd: 0x0b, 0x7fe: 0x0b, 0x7ff: 0x0b, // Block 0x20, offset 0x800 0x800: 0x0b, 0x801: 0x0b, 0x802: 0x0b, 0x803: 0x0b, 0x804: 0x0b, 0x805: 0x0b, 0x806: 0x0b, 0x807: 0x0b, 0x808: 0x0b, 0x809: 0x0b, 0x80a: 0x0b, 0x80b: 0x0b, 0x80c: 0x0b, 0x80d: 0x0b, 0x80e: 0x0b, 0x80f: 0x0b, 0x810: 0x0b, 0x811: 0x0b, 0x812: 0x0b, 0x813: 0x0b, 0x814: 0x0b, 0x815: 0x0b, 0x816: 0x0b, 0x817: 0x0b, 0x818: 0x0b, 0x819: 0x0b, 0x81a: 0x0b, 0x81b: 0x0b, 0x81c: 0x0b, 0x81d: 0x0b, 0x81e: 0x0b, 0x81f: 0x0b, 0x820: 0x0b, 0x821: 0x0b, 0x822: 0x0b, 0x823: 0x0b, 0x824: 0x0b, 0x825: 0x0b, 0x826: 0x0b, 0x827: 0x0b, 0x828: 0x0b, 0x829: 0x0b, 0x82a: 0x0b, 0x82b: 0x0b, 0x82c: 0x0b, 0x82d: 0x0b, 0x82e: 0x0b, 0x82f: 0x0b, 0x830: 0x0b, 0x831: 0x0b, 0x832: 0x0b, 0x833: 0x0b, 0x834: 0x0b, 0x835: 0x0b, 0x836: 0x0b, 0x837: 0x0b, 0x838: 0x0b, 0x839: 0x0b, 0x83a: 0x0b, 0x83b: 0x0b, 0x83c: 0x0b, 0x83d: 0x0b, 0x83e: 0x0b, 0x83f: 0x0b, // Block 0x21, offset 0x840 0x840: 0x181, 0x841: 0x182, 0x842: 0xba, 0x843: 0xba, 0x844: 0x183, 0x845: 0x183, 0x846: 0x183, 0x847: 0x184, 0x848: 0xba, 0x849: 0xba, 0x84a: 0xba, 0x84b: 0xba, 0x84c: 0xba, 0x84d: 0xba, 0x84e: 0xba, 0x84f: 0xba, 0x850: 0xba, 0x851: 0xba, 0x852: 0xba, 0x853: 0xba, 0x854: 0xba, 0x855: 0xba, 0x856: 0xba, 0x857: 0xba, 0x858: 0xba, 0x859: 0xba, 0x85a: 0xba, 0x85b: 0xba, 0x85c: 0xba, 0x85d: 0xba, 0x85e: 0xba, 0x85f: 0xba, 0x860: 0xba, 0x861: 0xba, 0x862: 0xba, 0x863: 0xba, 0x864: 0xba, 0x865: 0xba, 0x866: 0xba, 0x867: 0xba, 0x868: 0xba, 0x869: 0xba, 0x86a: 0xba, 0x86b: 0xba, 0x86c: 0xba, 0x86d: 0xba, 0x86e: 0xba, 0x86f: 0xba, 0x870: 0xba, 0x871: 0xba, 0x872: 0xba, 0x873: 0xba, 0x874: 0xba, 0x875: 0xba, 0x876: 0xba, 0x877: 0xba, 0x878: 0xba, 0x879: 0xba, 0x87a: 0xba, 0x87b: 0xba, 0x87c: 0xba, 0x87d: 0xba, 0x87e: 0xba, 0x87f: 0xba, // Block 0x22, offset 0x880 0x880: 0x0b, 0x881: 0x0b, 0x882: 0x0b, 0x883: 0x0b, 0x884: 0x0b, 0x885: 0x0b, 0x886: 0x0b, 0x887: 0x0b, 0x888: 0x0b, 0x889: 0x0b, 0x88a: 0x0b, 0x88b: 0x0b, 0x88c: 0x0b, 0x88d: 0x0b, 0x88e: 0x0b, 0x88f: 0x0b, 0x890: 0x0b, 0x891: 0x0b, 0x892: 0x0b, 0x893: 0x0b, 0x894: 0x0b, 0x895: 0x0b, 0x896: 0x0b, 0x897: 0x0b, 0x898: 0x0b, 0x899: 0x0b, 0x89a: 0x0b, 0x89b: 0x0b, 0x89c: 0x0b, 0x89d: 0x0b, 0x89e: 0x0b, 0x89f: 0x0b, 0x8a0: 0x1f, 0x8a1: 0x0b, 0x8a2: 0x0b, 0x8a3: 0x0b, 0x8a4: 0x0b, 0x8a5: 0x0b, 0x8a6: 0x0b, 0x8a7: 0x0b, 0x8a8: 0x0b, 0x8a9: 0x0b, 0x8aa: 0x0b, 0x8ab: 0x0b, 0x8ac: 0x0b, 0x8ad: 0x0b, 0x8ae: 0x0b, 0x8af: 0x0b, 0x8b0: 0x0b, 0x8b1: 0x0b, 0x8b2: 0x0b, 0x8b3: 0x0b, 0x8b4: 0x0b, 0x8b5: 0x0b, 0x8b6: 0x0b, 0x8b7: 0x0b, 0x8b8: 0x0b, 0x8b9: 0x0b, 0x8ba: 0x0b, 0x8bb: 0x0b, 0x8bc: 0x0b, 0x8bd: 0x0b, 0x8be: 0x0b, 0x8bf: 0x0b, // Block 0x23, offset 0x8c0 0x8c0: 0x0b, 0x8c1: 0x0b, 0x8c2: 0x0b, 0x8c3: 0x0b, 0x8c4: 0x0b, 0x8c5: 0x0b, 0x8c6: 0x0b, 0x8c7: 0x0b, 0x8c8: 0x0b, 0x8c9: 0x0b, 0x8ca: 0x0b, 0x8cb: 0x0b, 0x8cc: 0x0b, 0x8cd: 0x0b, 0x8ce: 0x0b, 0x8cf: 0x0b, } // idnaSparseOffset: 264 entries, 528 bytes var idnaSparseOffset = []uint16{0x0, 0x8, 0x19, 0x25, 0x27, 0x2c, 0x34, 0x3f, 0x4b, 0x4f, 0x5e, 0x63, 0x6b, 0x77, 0x85, 0x8a, 0x93, 0xa3, 0xb1, 0xbd, 0xc9, 0xda, 0xe4, 0xeb, 0xf8, 0x109, 0x110, 0x11b, 0x12a, 0x138, 0x142, 0x144, 0x149, 0x14c, 0x14f, 0x151, 0x15d, 0x168, 0x170, 0x176, 0x17c, 0x181, 0x186, 0x189, 0x18d, 0x193, 0x198, 0x1a4, 0x1ae, 0x1b4, 0x1c5, 0x1cf, 0x1d2, 0x1da, 0x1dd, 0x1ea, 0x1f2, 0x1f6, 0x1fd, 0x205, 0x215, 0x221, 0x223, 0x22d, 0x239, 0x245, 0x251, 0x259, 0x25e, 0x268, 0x279, 0x27d, 0x288, 0x28c, 0x295, 0x29d, 0x2a3, 0x2a8, 0x2ab, 0x2af, 0x2b5, 0x2b9, 0x2bd, 0x2c3, 0x2ca, 0x2d0, 0x2d8, 0x2df, 0x2ea, 0x2f4, 0x2f8, 0x2fb, 0x301, 0x305, 0x307, 0x30a, 0x30c, 0x30f, 0x319, 0x31c, 0x32b, 0x32f, 0x334, 0x337, 0x33b, 0x340, 0x345, 0x34b, 0x351, 0x360, 0x366, 0x36a, 0x379, 0x37e, 0x386, 0x390, 0x39b, 0x3a3, 0x3b4, 0x3bd, 0x3cd, 0x3da, 0x3e4, 0x3e9, 0x3f6, 0x3fa, 0x3ff, 0x401, 0x405, 0x407, 0x40b, 0x414, 0x41a, 0x41e, 0x42e, 0x438, 0x43d, 0x440, 0x446, 0x44d, 0x452, 0x456, 0x45c, 0x461, 0x46a, 0x46f, 0x475, 0x47c, 0x483, 0x48a, 0x48e, 0x493, 0x496, 0x49b, 0x4a7, 0x4ad, 0x4b2, 0x4b9, 0x4c1, 0x4c6, 0x4ca, 0x4da, 0x4e1, 0x4e5, 0x4e9, 0x4f0, 0x4f2, 0x4f5, 0x4f8, 0x4fc, 0x500, 0x506, 0x50f, 0x51b, 0x522, 0x52b, 0x533, 0x53a, 0x548, 0x555, 0x562, 0x56b, 0x56f, 0x57d, 0x585, 0x590, 0x599, 0x59f, 0x5a7, 0x5b0, 0x5ba, 0x5bd, 0x5c9, 0x5cc, 0x5d1, 0x5de, 0x5e7, 0x5f3, 0x5f6, 0x600, 0x609, 0x615, 0x622, 0x62a, 0x62d, 0x632, 0x635, 0x638, 0x63b, 0x642, 0x649, 0x64d, 0x658, 0x65b, 0x661, 0x666, 0x66a, 0x66d, 0x670, 0x673, 0x676, 0x679, 0x67e, 0x688, 0x68b, 0x68f, 0x69e, 0x6aa, 0x6ae, 0x6b3, 0x6b8, 0x6bc, 0x6c1, 0x6ca, 0x6d5, 0x6db, 0x6e3, 0x6e7, 0x6eb, 0x6f1, 0x6f7, 0x6fc, 0x6ff, 0x70f, 0x716, 0x719, 0x71c, 0x720, 0x726, 0x72b, 0x730, 0x735, 0x738, 0x73d, 0x740, 0x743, 0x747, 0x74b, 0x74e, 0x75e, 0x76f, 0x774, 0x776, 0x778} // idnaSparseValues: 1915 entries, 7660 bytes var idnaSparseValues = [1915]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x07}, {value: 0xe105, lo: 0x80, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0x97}, {value: 0xe105, lo: 0x98, hi: 0x9e}, {value: 0x001f, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbf}, // Block 0x1, offset 0x8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0xe01d, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0335, lo: 0x83, hi: 0x83}, {value: 0x034d, lo: 0x84, hi: 0x84}, {value: 0x0365, lo: 0x85, hi: 0x85}, {value: 0xe00d, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0xe00d, lo: 0x88, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x89}, {value: 0xe00d, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe00d, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0x8d}, {value: 0xe00d, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0xbf}, // Block 0x2, offset 0x19 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0249, lo: 0xb0, hi: 0xb0}, {value: 0x037d, lo: 0xb1, hi: 0xb1}, {value: 0x0259, lo: 0xb2, hi: 0xb2}, {value: 0x0269, lo: 0xb3, hi: 0xb3}, {value: 0x034d, lo: 0xb4, hi: 0xb4}, {value: 0x0395, lo: 0xb5, hi: 0xb5}, {value: 0xe1bd, lo: 0xb6, hi: 0xb6}, {value: 0x0279, lo: 0xb7, hi: 0xb7}, {value: 0x0289, lo: 0xb8, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbf}, // Block 0x3, offset 0x25 {value: 0x0000, lo: 0x01}, {value: 0x3308, lo: 0x80, hi: 0xbf}, // Block 0x4, offset 0x27 {value: 0x0000, lo: 0x04}, {value: 0x03f5, lo: 0x80, hi: 0x8f}, {value: 0xe105, lo: 0x90, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x5, offset 0x2c {value: 0x0000, lo: 0x07}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x0545, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x0008, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x6, offset 0x34 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0401, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x88}, {value: 0x0018, lo: 0x89, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x7, offset 0x3f {value: 0x0000, lo: 0x0b}, {value: 0x0818, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x82}, {value: 0x0818, lo: 0x83, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x85}, {value: 0x0818, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x8, offset 0x4b {value: 0x0000, lo: 0x03}, {value: 0x0a08, lo: 0x80, hi: 0x87}, {value: 0x0c08, lo: 0x88, hi: 0x99}, {value: 0x0a08, lo: 0x9a, hi: 0xbf}, // Block 0x9, offset 0x4f {value: 0x0000, lo: 0x0e}, {value: 0x3308, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0c08, lo: 0x8d, hi: 0x8d}, {value: 0x0a08, lo: 0x8e, hi: 0x98}, {value: 0x0c08, lo: 0x99, hi: 0x9b}, {value: 0x0a08, lo: 0x9c, hi: 0xaa}, {value: 0x0c08, lo: 0xab, hi: 0xac}, {value: 0x0a08, lo: 0xad, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb4}, {value: 0x0a08, lo: 0xb5, hi: 0xb7}, {value: 0x0c08, lo: 0xb8, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbf}, // Block 0xa, offset 0x5e {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xb, offset 0x63 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0xc, offset 0x6b {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x99}, {value: 0x0808, lo: 0x9a, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa3}, {value: 0x0808, lo: 0xa4, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa7}, {value: 0x0808, lo: 0xa8, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0818, lo: 0xb0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd, offset 0x77 {value: 0x0000, lo: 0x0d}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0a08, lo: 0xa0, hi: 0xa9}, {value: 0x0c08, lo: 0xaa, hi: 0xac}, {value: 0x0808, lo: 0xad, hi: 0xad}, {value: 0x0c08, lo: 0xae, hi: 0xae}, {value: 0x0a08, lo: 0xaf, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb2}, {value: 0x0a08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0a08, lo: 0xb6, hi: 0xb8}, {value: 0x0c08, lo: 0xb9, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0xe, offset 0x85 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa1}, {value: 0x0840, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xbf}, // Block 0xf, offset 0x8a {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x10, offset 0x93 {value: 0x0000, lo: 0x0f}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x85}, {value: 0x3008, lo: 0x86, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8c}, {value: 0x3b08, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x11, offset 0xa3 {value: 0x0000, lo: 0x0d}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x12, offset 0xb1 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xba}, {value: 0x3b08, lo: 0xbb, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x13, offset 0xbd {value: 0x0000, lo: 0x0b}, {value: 0x0040, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x14, offset 0xc9 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x89}, {value: 0x3b08, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x3008, lo: 0x98, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x15, offset 0xda {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb2}, {value: 0x08f1, lo: 0xb3, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb9}, {value: 0x3b08, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x16, offset 0xe4 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0xbf}, // Block 0x17, offset 0xeb {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0961, lo: 0x9c, hi: 0x9c}, {value: 0x0999, lo: 0x9d, hi: 0x9d}, {value: 0x0008, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x18, offset 0xf8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe03d, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x19, offset 0x109 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0x1a, offset 0x110 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x1b, offset 0x11b {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x3008, lo: 0xa2, hi: 0xa4}, {value: 0x0008, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xbf}, // Block 0x1c, offset 0x12a {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x8c}, {value: 0x3308, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x3008, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x1d, offset 0x138 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x86}, {value: 0x055d, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8c}, {value: 0x055d, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0xe105, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0x1e, offset 0x142 {value: 0x0000, lo: 0x01}, {value: 0x0018, lo: 0x80, hi: 0xbf}, // Block 0x1f, offset 0x144 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa0}, {value: 0x2018, lo: 0xa1, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x20, offset 0x149 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa7}, {value: 0x2018, lo: 0xa8, hi: 0xbf}, // Block 0x21, offset 0x14c {value: 0x0000, lo: 0x02}, {value: 0x2018, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0xbf}, // Block 0x22, offset 0x14f {value: 0x0000, lo: 0x01}, {value: 0x0008, lo: 0x80, hi: 0xbf}, // Block 0x23, offset 0x151 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x24, offset 0x15d {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x25, offset 0x168 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x26, offset 0x170 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x27, offset 0x176 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x28, offset 0x17c {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x29, offset 0x181 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x2a, offset 0x186 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x2b, offset 0x189 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xbf}, // Block 0x2c, offset 0x18d {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2d, offset 0x193 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x2e, offset 0x198 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x3b08, lo: 0x94, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x2f, offset 0x1a4 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x30, offset 0x1ae {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xb3}, {value: 0x3340, lo: 0xb4, hi: 0xb5}, {value: 0x3008, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x31, offset 0x1b4 {value: 0x0000, lo: 0x10}, {value: 0x3008, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x91}, {value: 0x3b08, lo: 0x92, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0x96}, {value: 0x0008, lo: 0x97, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x32, offset 0x1c5 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x86}, {value: 0x0218, lo: 0x87, hi: 0x87}, {value: 0x0018, lo: 0x88, hi: 0x8a}, {value: 0x33c0, lo: 0x8b, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0208, lo: 0xa0, hi: 0xbf}, // Block 0x33, offset 0x1cf {value: 0x0000, lo: 0x02}, {value: 0x0208, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x34, offset 0x1d2 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0208, lo: 0x87, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xa9}, {value: 0x0208, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x35, offset 0x1da {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x36, offset 0x1dd {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x37, offset 0x1ea {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x38, offset 0x1f2 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x39, offset 0x1f6 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0028, lo: 0x9a, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xbf}, // Block 0x3a, offset 0x1fd {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x3308, lo: 0x97, hi: 0x98}, {value: 0x3008, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x3b, offset 0x205 {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x94}, {value: 0x3008, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xac}, {value: 0x3008, lo: 0xad, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3c, offset 0x215 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xbd}, {value: 0x3318, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x3d, offset 0x221 {value: 0x0000, lo: 0x01}, {value: 0x0040, lo: 0x80, hi: 0xbf}, // Block 0x3e, offset 0x223 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3008, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x3f, offset 0x22d {value: 0x0000, lo: 0x0b}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x3808, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x40, offset 0x239 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3808, lo: 0xaa, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xbf}, // Block 0x41, offset 0x245 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3008, lo: 0xaa, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3808, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x42, offset 0x251 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbf}, // Block 0x43, offset 0x259 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x44, offset 0x25e {value: 0x0000, lo: 0x09}, {value: 0x0e29, lo: 0x80, hi: 0x80}, {value: 0x0e41, lo: 0x81, hi: 0x81}, {value: 0x0e59, lo: 0x82, hi: 0x82}, {value: 0x0e71, lo: 0x83, hi: 0x83}, {value: 0x0e89, lo: 0x84, hi: 0x85}, {value: 0x0ea1, lo: 0x86, hi: 0x86}, {value: 0x0eb9, lo: 0x87, hi: 0x87}, {value: 0x057d, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0x45, offset 0x268 {value: 0x0000, lo: 0x10}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x92}, {value: 0x0018, lo: 0x93, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa8}, {value: 0x0008, lo: 0xa9, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x46, offset 0x279 {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0x47, offset 0x27d {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x87}, {value: 0xe045, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0xe045, lo: 0x98, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0xe045, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbf}, // Block 0x48, offset 0x288 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x3318, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0x49, offset 0x28c {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x24c1, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x4a, offset 0x295 {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x24f1, lo: 0xac, hi: 0xac}, {value: 0x2529, lo: 0xad, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xae}, {value: 0x2579, lo: 0xaf, hi: 0xaf}, {value: 0x25b1, lo: 0xb0, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x4b, offset 0x29d {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x9f}, {value: 0x0080, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xad}, {value: 0x0080, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x4c, offset 0x2a3 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa8}, {value: 0x09c5, lo: 0xa9, hi: 0xa9}, {value: 0x09e5, lo: 0xaa, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xbf}, // Block 0x4d, offset 0x2a8 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0x4e, offset 0x2ab {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x28c1, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x4f, offset 0x2af {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0e66, lo: 0xb4, hi: 0xb4}, {value: 0x292a, lo: 0xb5, hi: 0xb5}, {value: 0x0e86, lo: 0xb6, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x50, offset 0x2b5 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x9b}, {value: 0x2941, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0xbf}, // Block 0x51, offset 0x2b9 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x52, offset 0x2bd {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0018, lo: 0xbd, hi: 0xbf}, // Block 0x53, offset 0x2c3 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x92}, {value: 0x0040, lo: 0x93, hi: 0xab}, {value: 0x0018, lo: 0xac, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x54, offset 0x2ca {value: 0x0000, lo: 0x05}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x03f5, lo: 0x90, hi: 0x9f}, {value: 0x0ea5, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x55, offset 0x2d0 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x56, offset 0x2d8 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xae}, {value: 0xe075, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0x57, offset 0x2df {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x58, offset 0x2ea {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xbf}, // Block 0x59, offset 0x2f4 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x5a, offset 0x2f8 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0x5b, offset 0x2fb {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9e}, {value: 0x0edd, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x5c, offset 0x301 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb2}, {value: 0x0efd, lo: 0xb3, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x5d, offset 0x305 {value: 0x0020, lo: 0x01}, {value: 0x0f1d, lo: 0x80, hi: 0xbf}, // Block 0x5e, offset 0x307 {value: 0x0020, lo: 0x02}, {value: 0x171d, lo: 0x80, hi: 0x8f}, {value: 0x18fd, lo: 0x90, hi: 0xbf}, // Block 0x5f, offset 0x30a {value: 0x0020, lo: 0x01}, {value: 0x1efd, lo: 0x80, hi: 0xbf}, // Block 0x60, offset 0x30c {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x61, offset 0x30f {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9a}, {value: 0x29e2, lo: 0x9b, hi: 0x9b}, {value: 0x2a0a, lo: 0x9c, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9e}, {value: 0x2a31, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x62, offset 0x319 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbe}, {value: 0x2a69, lo: 0xbf, hi: 0xbf}, // Block 0x63, offset 0x31c {value: 0x0000, lo: 0x0e}, {value: 0x0040, lo: 0x80, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x2a1d, lo: 0xb1, hi: 0xb1}, {value: 0x2a3d, lo: 0xb2, hi: 0xb2}, {value: 0x2a5d, lo: 0xb3, hi: 0xb3}, {value: 0x2a7d, lo: 0xb4, hi: 0xb4}, {value: 0x2a5d, lo: 0xb5, hi: 0xb5}, {value: 0x2a9d, lo: 0xb6, hi: 0xb6}, {value: 0x2abd, lo: 0xb7, hi: 0xb7}, {value: 0x2add, lo: 0xb8, hi: 0xb9}, {value: 0x2afd, lo: 0xba, hi: 0xbb}, {value: 0x2b1d, lo: 0xbc, hi: 0xbd}, {value: 0x2afd, lo: 0xbe, hi: 0xbf}, // Block 0x64, offset 0x32b {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x65, offset 0x32f {value: 0x0030, lo: 0x04}, {value: 0x2aa2, lo: 0x80, hi: 0x9d}, {value: 0x305a, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x30a2, lo: 0xa0, hi: 0xbf}, // Block 0x66, offset 0x334 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0x67, offset 0x337 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x68, offset 0x33b {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x69, offset 0x340 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x6a, offset 0x345 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb1}, {value: 0x0018, lo: 0xb2, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6b, offset 0x34b {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0xb6}, {value: 0x0008, lo: 0xb7, hi: 0xb7}, {value: 0x2009, lo: 0xb8, hi: 0xb8}, {value: 0x6e89, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xbf}, // Block 0x6c, offset 0x351 {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x3308, lo: 0x8b, hi: 0x8b}, {value: 0x0008, lo: 0x8c, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x6d, offset 0x360 {value: 0x0000, lo: 0x05}, {value: 0x0208, lo: 0x80, hi: 0xb1}, {value: 0x0108, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6e, offset 0x366 {value: 0x0000, lo: 0x03}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xbf}, // Block 0x6f, offset 0x36a {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0008, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x70, offset 0x379 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x71, offset 0x37e {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x91}, {value: 0x3008, lo: 0x92, hi: 0x92}, {value: 0x3808, lo: 0x93, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x72, offset 0x386 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb9}, {value: 0x3008, lo: 0xba, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x73, offset 0x390 {value: 0x0000, lo: 0x0a}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x74, offset 0x39b {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x75, offset 0x3a3 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8c}, {value: 0x3008, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbd}, {value: 0x0008, lo: 0xbe, hi: 0xbf}, // Block 0x76, offset 0x3b4 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x77, offset 0x3bd {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x9a}, {value: 0x0008, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3b08, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x78, offset 0x3cd {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x90}, {value: 0x0008, lo: 0x91, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x79, offset 0x3da {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x4465, lo: 0x9c, hi: 0x9c}, {value: 0x447d, lo: 0x9d, hi: 0x9d}, {value: 0x2971, lo: 0x9e, hi: 0x9e}, {value: 0xe06d, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xaf}, {value: 0x4495, lo: 0xb0, hi: 0xbf}, // Block 0x7a, offset 0x3e4 {value: 0x0000, lo: 0x04}, {value: 0x44b5, lo: 0x80, hi: 0x8f}, {value: 0x44d5, lo: 0x90, hi: 0x9f}, {value: 0x44f5, lo: 0xa0, hi: 0xaf}, {value: 0x44d5, lo: 0xb0, hi: 0xbf}, // Block 0x7b, offset 0x3e9 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3b08, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x7c, offset 0x3f6 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x7d, offset 0x3fa {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x7e, offset 0x3ff {value: 0x0020, lo: 0x01}, {value: 0x4515, lo: 0x80, hi: 0xbf}, // Block 0x7f, offset 0x401 {value: 0x0020, lo: 0x03}, {value: 0x4d15, lo: 0x80, hi: 0x94}, {value: 0x4ad5, lo: 0x95, hi: 0x95}, {value: 0x4fb5, lo: 0x96, hi: 0xbf}, // Block 0x80, offset 0x405 {value: 0x0020, lo: 0x01}, {value: 0x54f5, lo: 0x80, hi: 0xbf}, // Block 0x81, offset 0x407 {value: 0x0020, lo: 0x03}, {value: 0x5cf5, lo: 0x80, hi: 0x84}, {value: 0x5655, lo: 0x85, hi: 0x85}, {value: 0x5d95, lo: 0x86, hi: 0xbf}, // Block 0x82, offset 0x40b {value: 0x0020, lo: 0x08}, {value: 0x6b55, lo: 0x80, hi: 0x8f}, {value: 0x6d15, lo: 0x90, hi: 0x90}, {value: 0x6d55, lo: 0x91, hi: 0xab}, {value: 0x6ea1, lo: 0xac, hi: 0xac}, {value: 0x70b5, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x70d5, lo: 0xb0, hi: 0xbf}, // Block 0x83, offset 0x414 {value: 0x0020, lo: 0x05}, {value: 0x72d5, lo: 0x80, hi: 0xad}, {value: 0x6535, lo: 0xae, hi: 0xae}, {value: 0x7895, lo: 0xaf, hi: 0xb5}, {value: 0x6f55, lo: 0xb6, hi: 0xb6}, {value: 0x7975, lo: 0xb7, hi: 0xbf}, // Block 0x84, offset 0x41a {value: 0x0028, lo: 0x03}, {value: 0x7c21, lo: 0x80, hi: 0x82}, {value: 0x7be1, lo: 0x83, hi: 0x83}, {value: 0x7c99, lo: 0x84, hi: 0xbf}, // Block 0x85, offset 0x41e {value: 0x0038, lo: 0x0f}, {value: 0x9db1, lo: 0x80, hi: 0x83}, {value: 0x9e59, lo: 0x84, hi: 0x85}, {value: 0x9e91, lo: 0x86, hi: 0x87}, {value: 0x9ec9, lo: 0x88, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0xa089, lo: 0x92, hi: 0x97}, {value: 0xa1a1, lo: 0x98, hi: 0x9c}, {value: 0xa281, lo: 0x9d, hi: 0xb3}, {value: 0x9d41, lo: 0xb4, hi: 0xb4}, {value: 0x9db1, lo: 0xb5, hi: 0xb5}, {value: 0xa789, lo: 0xb6, hi: 0xbb}, {value: 0xa869, lo: 0xbc, hi: 0xbc}, {value: 0xa7f9, lo: 0xbd, hi: 0xbd}, {value: 0xa8d9, lo: 0xbe, hi: 0xbf}, // Block 0x86, offset 0x42e {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0008, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x87, offset 0x438 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x88, offset 0x43d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x89, offset 0x440 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x8a, offset 0x446 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x8b, offset 0x44d {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x8c, offset 0x452 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x8d, offset 0x456 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x8e, offset 0x45c {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xbf}, // Block 0x8f, offset 0x461 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x90, offset 0x46a {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x91, offset 0x46f {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x92, offset 0x475 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x97}, {value: 0x8ad5, lo: 0x98, hi: 0x9f}, {value: 0x8aed, lo: 0xa0, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xbf}, // Block 0x93, offset 0x47c {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x8aed, lo: 0xb0, hi: 0xb7}, {value: 0x8ad5, lo: 0xb8, hi: 0xbf}, // Block 0x94, offset 0x483 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x95, offset 0x48a {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x96, offset 0x48e {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xae}, {value: 0x0018, lo: 0xaf, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x97, offset 0x493 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x98, offset 0x496 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xbf}, // Block 0x99, offset 0x49b {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0808, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0808, lo: 0x8a, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbb}, {value: 0x0808, lo: 0xbc, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x0808, lo: 0xbf, hi: 0xbf}, // Block 0x9a, offset 0x4a7 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0818, lo: 0x97, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0818, lo: 0xb7, hi: 0xbf}, // Block 0x9b, offset 0x4ad {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa6}, {value: 0x0818, lo: 0xa7, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x9c, offset 0x4b2 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x0818, lo: 0xbb, hi: 0xbf}, // Block 0x9d, offset 0x4b9 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0818, lo: 0x96, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0818, lo: 0xbf, hi: 0xbf}, // Block 0x9e, offset 0x4c1 {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbb}, {value: 0x0818, lo: 0xbc, hi: 0xbd}, {value: 0x0808, lo: 0xbe, hi: 0xbf}, // Block 0x9f, offset 0x4c6 {value: 0x0000, lo: 0x03}, {value: 0x0818, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x0818, lo: 0x92, hi: 0xbf}, // Block 0xa0, offset 0x4ca {value: 0x0000, lo: 0x0f}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x94}, {value: 0x0808, lo: 0x95, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x98}, {value: 0x0808, lo: 0x99, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xa1, offset 0x4da {value: 0x0000, lo: 0x06}, {value: 0x0818, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0818, lo: 0x90, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xbc}, {value: 0x0818, lo: 0xbd, hi: 0xbf}, // Block 0xa2, offset 0x4e1 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xa3, offset 0x4e5 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb8}, {value: 0x0018, lo: 0xb9, hi: 0xbf}, // Block 0xa4, offset 0x4e9 {value: 0x0000, lo: 0x06}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0818, lo: 0x98, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb7}, {value: 0x0818, lo: 0xb8, hi: 0xbf}, // Block 0xa5, offset 0x4f0 {value: 0x0000, lo: 0x01}, {value: 0x0808, lo: 0x80, hi: 0xbf}, // Block 0xa6, offset 0x4f2 {value: 0x0000, lo: 0x02}, {value: 0x0808, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xa7, offset 0x4f5 {value: 0x0000, lo: 0x02}, {value: 0x03dd, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xa8, offset 0x4f8 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xbf}, // Block 0xa9, offset 0x4fc {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0818, lo: 0xa0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xaa, offset 0x500 {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xab, offset 0x506 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x91}, {value: 0x0018, lo: 0x92, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xac, offset 0x50f {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbc}, {value: 0x0340, lo: 0xbd, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0xad, offset 0x51b {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xae, offset 0x522 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb2}, {value: 0x3b08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xbf}, // Block 0xaf, offset 0x52b {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xb0, offset 0x533 {value: 0x0000, lo: 0x06}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xbe}, {value: 0x3008, lo: 0xbf, hi: 0xbf}, // Block 0xb1, offset 0x53a {value: 0x0000, lo: 0x0d}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xb2, offset 0x548 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3808, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xb3, offset 0x555 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xb4, offset 0x562 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x3308, lo: 0x9f, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa9}, {value: 0x3b08, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb5, offset 0x56b {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xb6, offset 0x56f {value: 0x0000, lo: 0x0d}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xb7, offset 0x57d {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xb8, offset 0x585 {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x85}, {value: 0x0018, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xb9, offset 0x590 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xba, offset 0x599 {value: 0x0000, lo: 0x05}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9b}, {value: 0x3308, lo: 0x9c, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xbb, offset 0x59f {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbc, offset 0x5a7 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xbd, offset 0x5b0 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb5}, {value: 0x3808, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0xbe, offset 0x5ba {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0xbf, offset 0x5bd {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0xc0, offset 0x5c9 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xbf}, // Block 0xc1, offset 0x5cc {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0xc2, offset 0x5d1 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xc3, offset 0x5de {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x3b08, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0xbf}, // Block 0xc4, offset 0x5e7 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x98}, {value: 0x3b08, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xbf}, // Block 0xc5, offset 0x5f3 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xc6, offset 0x5f6 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xc7, offset 0x600 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xbf}, // Block 0xc8, offset 0x609 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xa9}, {value: 0x3308, lo: 0xaa, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xc9, offset 0x615 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xca, offset 0x622 {value: 0x0000, lo: 0x07}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xcb, offset 0x62a {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xcc, offset 0x62d {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xcd, offset 0x632 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0xbf}, // Block 0xce, offset 0x635 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xbf}, // Block 0xcf, offset 0x638 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0xbf}, // Block 0xd0, offset 0x63b {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xd1, offset 0x642 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xd2, offset 0x649 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0xd3, offset 0x64d {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0xd4, offset 0x658 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0xd5, offset 0x65b {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd6, offset 0x661 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xd7, offset 0x666 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xbf}, // Block 0xd8, offset 0x66a {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xd9, offset 0x66d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xda, offset 0x670 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xdb, offset 0x673 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xdc, offset 0x676 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xdd, offset 0x679 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0xde, offset 0x67e {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x03c0, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xbf}, // Block 0xdf, offset 0x688 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xe0, offset 0x68b {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xbf}, // Block 0xe1, offset 0x68f {value: 0x0000, lo: 0x0e}, {value: 0x0018, lo: 0x80, hi: 0x9d}, {value: 0xb5b9, lo: 0x9e, hi: 0x9e}, {value: 0xb601, lo: 0x9f, hi: 0x9f}, {value: 0xb649, lo: 0xa0, hi: 0xa0}, {value: 0xb6b1, lo: 0xa1, hi: 0xa1}, {value: 0xb719, lo: 0xa2, hi: 0xa2}, {value: 0xb781, lo: 0xa3, hi: 0xa3}, {value: 0xb7e9, lo: 0xa4, hi: 0xa4}, {value: 0x3018, lo: 0xa5, hi: 0xa6}, {value: 0x3318, lo: 0xa7, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xac}, {value: 0x3018, lo: 0xad, hi: 0xb2}, {value: 0x0340, lo: 0xb3, hi: 0xba}, {value: 0x3318, lo: 0xbb, hi: 0xbf}, // Block 0xe2, offset 0x69e {value: 0x0000, lo: 0x0b}, {value: 0x3318, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0x84}, {value: 0x3318, lo: 0x85, hi: 0x8b}, {value: 0x0018, lo: 0x8c, hi: 0xa9}, {value: 0x3318, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xba}, {value: 0xb851, lo: 0xbb, hi: 0xbb}, {value: 0xb899, lo: 0xbc, hi: 0xbc}, {value: 0xb8e1, lo: 0xbd, hi: 0xbd}, {value: 0xb949, lo: 0xbe, hi: 0xbe}, {value: 0xb9b1, lo: 0xbf, hi: 0xbf}, // Block 0xe3, offset 0x6aa {value: 0x0000, lo: 0x03}, {value: 0xba19, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xbf}, // Block 0xe4, offset 0x6ae {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x3318, lo: 0x82, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0xbf}, // Block 0xe5, offset 0x6b3 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xe6, offset 0x6b8 {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0xe7, offset 0x6bc {value: 0x0000, lo: 0x04}, {value: 0x3308, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0xe8, offset 0x6c1 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x3308, lo: 0xa1, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xe9, offset 0x6ca {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0xea, offset 0x6d5 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x86}, {value: 0x0818, lo: 0x87, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xeb, offset 0x6db {value: 0x0000, lo: 0x07}, {value: 0x0a08, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xec, offset 0x6e3 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xed, offset 0x6e7 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0xee, offset 0x6eb {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0xef, offset 0x6f1 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xf0, offset 0x6f7 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8f}, {value: 0xc1c1, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xf1, offset 0x6fc {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xbf}, // Block 0xf2, offset 0x6ff {value: 0x0000, lo: 0x0f}, {value: 0xc7e9, lo: 0x80, hi: 0x80}, {value: 0xc839, lo: 0x81, hi: 0x81}, {value: 0xc889, lo: 0x82, hi: 0x82}, {value: 0xc8d9, lo: 0x83, hi: 0x83}, {value: 0xc929, lo: 0x84, hi: 0x84}, {value: 0xc979, lo: 0x85, hi: 0x85}, {value: 0xc9c9, lo: 0x86, hi: 0x86}, {value: 0xca19, lo: 0x87, hi: 0x87}, {value: 0xca69, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0xcab9, lo: 0x90, hi: 0x90}, {value: 0xcad9, lo: 0x91, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xbf}, // Block 0xf3, offset 0x70f {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xf4, offset 0x716 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0xf5, offset 0x719 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0xbf}, // Block 0xf6, offset 0x71c {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0xf7, offset 0x720 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0xf8, offset 0x726 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0xf9, offset 0x72b {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xfa, offset 0x730 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0xfb, offset 0x735 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xbf}, // Block 0xfc, offset 0x738 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0xfd, offset 0x73d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xfe, offset 0x740 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xff, offset 0x743 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x100, offset 0x747 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x101, offset 0x74b {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x102, offset 0x74e {value: 0x0020, lo: 0x0f}, {value: 0xdeb9, lo: 0x80, hi: 0x89}, {value: 0x8dfd, lo: 0x8a, hi: 0x8a}, {value: 0xdff9, lo: 0x8b, hi: 0x9c}, {value: 0x8e1d, lo: 0x9d, hi: 0x9d}, {value: 0xe239, lo: 0x9e, hi: 0xa2}, {value: 0x8e3d, lo: 0xa3, hi: 0xa3}, {value: 0xe2d9, lo: 0xa4, hi: 0xab}, {value: 0x7ed5, lo: 0xac, hi: 0xac}, {value: 0xe3d9, lo: 0xad, hi: 0xaf}, {value: 0x8e5d, lo: 0xb0, hi: 0xb0}, {value: 0xe439, lo: 0xb1, hi: 0xb6}, {value: 0x8e7d, lo: 0xb7, hi: 0xb9}, {value: 0xe4f9, lo: 0xba, hi: 0xba}, {value: 0x8edd, lo: 0xbb, hi: 0xbb}, {value: 0xe519, lo: 0xbc, hi: 0xbf}, // Block 0x103, offset 0x75e {value: 0x0020, lo: 0x10}, {value: 0x937d, lo: 0x80, hi: 0x80}, {value: 0xf099, lo: 0x81, hi: 0x86}, {value: 0x939d, lo: 0x87, hi: 0x8a}, {value: 0xd9f9, lo: 0x8b, hi: 0x8b}, {value: 0xf159, lo: 0x8c, hi: 0x96}, {value: 0x941d, lo: 0x97, hi: 0x97}, {value: 0xf2b9, lo: 0x98, hi: 0xa3}, {value: 0x943d, lo: 0xa4, hi: 0xa6}, {value: 0xf439, lo: 0xa7, hi: 0xaa}, {value: 0x949d, lo: 0xab, hi: 0xab}, {value: 0xf4b9, lo: 0xac, hi: 0xac}, {value: 0x94bd, lo: 0xad, hi: 0xad}, {value: 0xf4d9, lo: 0xae, hi: 0xaf}, {value: 0x94dd, lo: 0xb0, hi: 0xb1}, {value: 0xf519, lo: 0xb2, hi: 0xbe}, {value: 0x2040, lo: 0xbf, hi: 0xbf}, // Block 0x104, offset 0x76f {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0340, lo: 0x81, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x9f}, {value: 0x0340, lo: 0xa0, hi: 0xbf}, // Block 0x105, offset 0x774 {value: 0x0000, lo: 0x01}, {value: 0x0340, lo: 0x80, hi: 0xbf}, // Block 0x106, offset 0x776 {value: 0x0000, lo: 0x01}, {value: 0x33c0, lo: 0x80, hi: 0xbf}, // Block 0x107, offset 0x778 {value: 0x0000, lo: 0x02}, {value: 0x33c0, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, } // Total table size 42114 bytes (41KiB); checksum: 355A58A4 ================================================ FILE: vendor/golang.org/x/net/idna/tables11.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // +build go1.13 package idna // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "11.0.0" var mappings string = "" + // Size: 8175 bytes "\x00\x01 \x03 ̈\x01a\x03 ̄\x012\x013\x03 ́\x03 ̧\x011\x01o\x051⁄4\x051⁄2" + "\x053⁄4\x03i̇\x03l·\x03ʼn\x01s\x03dž\x03ⱥ\x03ⱦ\x01h\x01j\x01r\x01w\x01y" + "\x03 ̆\x03 ̇\x03 ̊\x03 ̨\x03 ̃\x03 ̋\x01l\x01x\x04̈́\x03 ι\x01;\x05 ̈́" + "\x04եւ\x04اٴ\x04وٴ\x04ۇٴ\x04يٴ\x06क़\x06ख़\x06ग़\x06ज़\x06ड़\x06ढ़\x06फ़" + "\x06य़\x06ড়\x06ঢ়\x06য়\x06ਲ਼\x06ਸ਼\x06ਖ਼\x06ਗ਼\x06ਜ਼\x06ਫ਼\x06ଡ଼\x06ଢ଼" + "\x06ํา\x06ໍາ\x06ຫນ\x06ຫມ\x06གྷ\x06ཌྷ\x06དྷ\x06བྷ\x06ཛྷ\x06ཀྵ\x06ཱི\x06ཱུ" + "\x06ྲྀ\x09ྲཱྀ\x06ླྀ\x09ླཱྀ\x06ཱྀ\x06ྒྷ\x06ྜྷ\x06ྡྷ\x06ྦྷ\x06ྫྷ\x06ྐྵ\x02" + "в\x02д\x02о\x02с\x02т\x02ъ\x02ѣ\x02æ\x01b\x01d\x01e\x02ǝ\x01g\x01i\x01k" + "\x01m\x01n\x02ȣ\x01p\x01t\x01u\x02ɐ\x02ɑ\x02ə\x02ɛ\x02ɜ\x02ŋ\x02ɔ\x02ɯ" + "\x01v\x02β\x02γ\x02δ\x02φ\x02χ\x02ρ\x02н\x02ɒ\x01c\x02ɕ\x02ð\x01f\x02ɟ" + "\x02ɡ\x02ɥ\x02ɨ\x02ɩ\x02ɪ\x02ʝ\x02ɭ\x02ʟ\x02ɱ\x02ɰ\x02ɲ\x02ɳ\x02ɴ\x02ɵ" + "\x02ɸ\x02ʂ\x02ʃ\x02ƫ\x02ʉ\x02ʊ\x02ʋ\x02ʌ\x01z\x02ʐ\x02ʑ\x02ʒ\x02θ\x02ss" + "\x02ά\x02έ\x02ή\x02ί\x02ό\x02ύ\x02ώ\x05ἀι\x05ἁι\x05ἂι\x05ἃι\x05ἄι\x05ἅι" + "\x05ἆι\x05ἇι\x05ἠι\x05ἡι\x05ἢι\x05ἣι\x05ἤι\x05ἥι\x05ἦι\x05ἧι\x05ὠι\x05ὡι" + "\x05ὢι\x05ὣι\x05ὤι\x05ὥι\x05ὦι\x05ὧι\x05ὰι\x04αι\x04άι\x05ᾶι\x02ι\x05 ̈͂" + "\x05ὴι\x04ηι\x04ήι\x05ῆι\x05 ̓̀\x05 ̓́\x05 ̓͂\x02ΐ\x05 ̔̀\x05 ̔́\x05 ̔͂" + "\x02ΰ\x05 ̈̀\x01`\x05ὼι\x04ωι\x04ώι\x05ῶι\x06′′\x09′′′\x06‵‵\x09‵‵‵\x02!" + "!\x02??\x02?!\x02!?\x0c′′′′\x010\x014\x015\x016\x017\x018\x019\x01+\x01=" + "\x01(\x01)\x02rs\x02ħ\x02no\x01q\x02sm\x02tm\x02ω\x02å\x02א\x02ב\x02ג" + "\x02ד\x02π\x051⁄7\x051⁄9\x061⁄10\x051⁄3\x052⁄3\x051⁄5\x052⁄5\x053⁄5\x054" + "⁄5\x051⁄6\x055⁄6\x051⁄8\x053⁄8\x055⁄8\x057⁄8\x041⁄\x02ii\x02iv\x02vi" + "\x04viii\x02ix\x02xi\x050⁄3\x06∫∫\x09∫∫∫\x06∮∮\x09∮∮∮\x0210\x0211\x0212" + "\x0213\x0214\x0215\x0216\x0217\x0218\x0219\x0220\x04(10)\x04(11)\x04(12)" + "\x04(13)\x04(14)\x04(15)\x04(16)\x04(17)\x04(18)\x04(19)\x04(20)\x0c∫∫∫∫" + "\x02==\x05⫝̸\x02ɫ\x02ɽ\x02ȿ\x02ɀ\x01.\x04 ゙\x04 ゚\x06より\x06コト\x05(ᄀ)\x05" + "(ᄂ)\x05(ᄃ)\x05(ᄅ)\x05(ᄆ)\x05(ᄇ)\x05(ᄉ)\x05(ᄋ)\x05(ᄌ)\x05(ᄎ)\x05(ᄏ)\x05(ᄐ" + ")\x05(ᄑ)\x05(ᄒ)\x05(가)\x05(나)\x05(다)\x05(라)\x05(마)\x05(바)\x05(사)\x05(아)" + "\x05(자)\x05(차)\x05(카)\x05(타)\x05(파)\x05(하)\x05(주)\x08(오전)\x08(오후)\x05(一)" + "\x05(二)\x05(三)\x05(四)\x05(五)\x05(六)\x05(七)\x05(八)\x05(九)\x05(十)\x05(月)" + "\x05(火)\x05(水)\x05(木)\x05(金)\x05(土)\x05(日)\x05(株)\x05(有)\x05(社)\x05(名)" + "\x05(特)\x05(財)\x05(祝)\x05(労)\x05(代)\x05(呼)\x05(学)\x05(監)\x05(企)\x05(資)" + "\x05(協)\x05(祭)\x05(休)\x05(自)\x05(至)\x0221\x0222\x0223\x0224\x0225\x0226" + "\x0227\x0228\x0229\x0230\x0231\x0232\x0233\x0234\x0235\x06참고\x06주의\x0236" + "\x0237\x0238\x0239\x0240\x0241\x0242\x0243\x0244\x0245\x0246\x0247\x0248" + "\x0249\x0250\x041月\x042月\x043月\x044月\x045月\x046月\x047月\x048月\x049月\x0510" + "月\x0511月\x0512月\x02hg\x02ev\x0cアパート\x0cアルファ\x0cアンペア\x09アール\x0cイニング\x09" + "インチ\x09ウォン\x0fエスクード\x0cエーカー\x09オンス\x09オーム\x09カイリ\x0cカラット\x0cカロリー\x09ガロ" + "ン\x09ガンマ\x06ギガ\x09ギニー\x0cキュリー\x0cギルダー\x06キロ\x0fキログラム\x12キロメートル\x0fキロワッ" + "ト\x09グラム\x0fグラムトン\x0fクルゼイロ\x0cクローネ\x09ケース\x09コルナ\x09コーポ\x0cサイクル\x0fサンチ" + "ーム\x0cシリング\x09センチ\x09セント\x09ダース\x06デシ\x06ドル\x06トン\x06ナノ\x09ノット\x09ハイツ" + "\x0fパーセント\x09パーツ\x0cバーレル\x0fピアストル\x09ピクル\x06ピコ\x06ビル\x0fファラッド\x0cフィート" + "\x0fブッシェル\x09フラン\x0fヘクタール\x06ペソ\x09ペニヒ\x09ヘルツ\x09ペンス\x09ページ\x09ベータ\x0cポイ" + "ント\x09ボルト\x06ホン\x09ポンド\x09ホール\x09ホーン\x0cマイクロ\x09マイル\x09マッハ\x09マルク\x0fマ" + "ンション\x0cミクロン\x06ミリ\x0fミリバール\x06メガ\x0cメガトン\x0cメートル\x09ヤード\x09ヤール\x09ユアン" + "\x0cリットル\x06リラ\x09ルピー\x0cルーブル\x06レム\x0fレントゲン\x09ワット\x040点\x041点\x042点" + "\x043点\x044点\x045点\x046点\x047点\x048点\x049点\x0510点\x0511点\x0512点\x0513点" + "\x0514点\x0515点\x0516点\x0517点\x0518点\x0519点\x0520点\x0521点\x0522点\x0523点" + "\x0524点\x02da\x02au\x02ov\x02pc\x02dm\x02iu\x06平成\x06昭和\x06大正\x06明治\x0c株" + "式会社\x02pa\x02na\x02ma\x02ka\x02kb\x02mb\x02gb\x04kcal\x02pf\x02nf\x02m" + "g\x02kg\x02hz\x02ml\x02dl\x02kl\x02fm\x02nm\x02mm\x02cm\x02km\x02m2\x02m" + "3\x05m∕s\x06m∕s2\x07rad∕s\x08rad∕s2\x02ps\x02ns\x02ms\x02pv\x02nv\x02mv" + "\x02kv\x02pw\x02nw\x02mw\x02kw\x02bq\x02cc\x02cd\x06c∕kg\x02db\x02gy\x02" + "ha\x02hp\x02in\x02kk\x02kt\x02lm\x02ln\x02lx\x02ph\x02pr\x02sr\x02sv\x02" + "wb\x05v∕m\x05a∕m\x041日\x042日\x043日\x044日\x045日\x046日\x047日\x048日\x049日" + "\x0510日\x0511日\x0512日\x0513日\x0514日\x0515日\x0516日\x0517日\x0518日\x0519日" + "\x0520日\x0521日\x0522日\x0523日\x0524日\x0525日\x0526日\x0527日\x0528日\x0529日" + "\x0530日\x0531日\x02ь\x02ɦ\x02ɬ\x02ʞ\x02ʇ\x02œ\x04𤋮\x04𢡊\x04𢡄\x04𣏕\x04𥉉" + "\x04𥳐\x04𧻓\x02ff\x02fi\x02fl\x02st\x04մն\x04մե\x04մի\x04վն\x04մխ\x04יִ" + "\x04ײַ\x02ע\x02ה\x02כ\x02ל\x02ם\x02ר\x02ת\x04שׁ\x04שׂ\x06שּׁ\x06שּׂ\x04א" + "ַ\x04אָ\x04אּ\x04בּ\x04גּ\x04דּ\x04הּ\x04וּ\x04זּ\x04טּ\x04יּ\x04ךּ\x04" + "כּ\x04לּ\x04מּ\x04נּ\x04סּ\x04ףּ\x04פּ\x04צּ\x04קּ\x04רּ\x04שּ\x04תּ" + "\x04וֹ\x04בֿ\x04כֿ\x04פֿ\x04אל\x02ٱ\x02ٻ\x02پ\x02ڀ\x02ٺ\x02ٿ\x02ٹ\x02ڤ" + "\x02ڦ\x02ڄ\x02ڃ\x02چ\x02ڇ\x02ڍ\x02ڌ\x02ڎ\x02ڈ\x02ژ\x02ڑ\x02ک\x02گ\x02ڳ" + "\x02ڱ\x02ں\x02ڻ\x02ۀ\x02ہ\x02ھ\x02ے\x02ۓ\x02ڭ\x02ۇ\x02ۆ\x02ۈ\x02ۋ\x02ۅ" + "\x02ۉ\x02ې\x02ى\x04ئا\x04ئە\x04ئو\x04ئۇ\x04ئۆ\x04ئۈ\x04ئې\x04ئى\x02ی\x04" + "ئج\x04ئح\x04ئم\x04ئي\x04بج\x04بح\x04بخ\x04بم\x04بى\x04بي\x04تج\x04تح" + "\x04تخ\x04تم\x04تى\x04تي\x04ثج\x04ثم\x04ثى\x04ثي\x04جح\x04جم\x04حج\x04حم" + "\x04خج\x04خح\x04خم\x04سج\x04سح\x04سخ\x04سم\x04صح\x04صم\x04ضج\x04ضح\x04ضخ" + "\x04ضم\x04طح\x04طم\x04ظم\x04عج\x04عم\x04غج\x04غم\x04فج\x04فح\x04فخ\x04فم" + "\x04فى\x04في\x04قح\x04قم\x04قى\x04قي\x04كا\x04كج\x04كح\x04كخ\x04كل\x04كم" + "\x04كى\x04كي\x04لج\x04لح\x04لخ\x04لم\x04لى\x04لي\x04مج\x04مح\x04مخ\x04مم" + "\x04مى\x04مي\x04نج\x04نح\x04نخ\x04نم\x04نى\x04ني\x04هج\x04هم\x04هى\x04هي" + "\x04يج\x04يح\x04يخ\x04يم\x04يى\x04يي\x04ذٰ\x04رٰ\x04ىٰ\x05 ٌّ\x05 ٍّ\x05" + " َّ\x05 ُّ\x05 ِّ\x05 ّٰ\x04ئر\x04ئز\x04ئن\x04بر\x04بز\x04بن\x04تر\x04تز" + "\x04تن\x04ثر\x04ثز\x04ثن\x04ما\x04نر\x04نز\x04نن\x04ير\x04يز\x04ين\x04ئخ" + "\x04ئه\x04به\x04ته\x04صخ\x04له\x04نه\x04هٰ\x04يه\x04ثه\x04سه\x04شم\x04شه" + "\x06ـَّ\x06ـُّ\x06ـِّ\x04طى\x04طي\x04عى\x04عي\x04غى\x04غي\x04سى\x04سي" + "\x04شى\x04شي\x04حى\x04حي\x04جى\x04جي\x04خى\x04خي\x04صى\x04صي\x04ضى\x04ضي" + "\x04شج\x04شح\x04شخ\x04شر\x04سر\x04صر\x04ضر\x04اً\x06تجم\x06تحج\x06تحم" + "\x06تخم\x06تمج\x06تمح\x06تمخ\x06جمح\x06حمي\x06حمى\x06سحج\x06سجح\x06سجى" + "\x06سمح\x06سمج\x06سمم\x06صحح\x06صمم\x06شحم\x06شجي\x06شمخ\x06شمم\x06ضحى" + "\x06ضخم\x06طمح\x06طمم\x06طمي\x06عجم\x06عمم\x06عمى\x06غمم\x06غمي\x06غمى" + "\x06فخم\x06قمح\x06قمم\x06لحم\x06لحي\x06لحى\x06لجج\x06لخم\x06لمح\x06محج" + "\x06محم\x06محي\x06مجح\x06مجم\x06مخج\x06مخم\x06مجخ\x06همج\x06همم\x06نحم" + "\x06نحى\x06نجم\x06نجى\x06نمي\x06نمى\x06يمم\x06بخي\x06تجي\x06تجى\x06تخي" + "\x06تخى\x06تمي\x06تمى\x06جمي\x06جحى\x06جمى\x06سخى\x06صحي\x06شحي\x06ضحي" + "\x06لجي\x06لمي\x06يحي\x06يجي\x06يمي\x06ممي\x06قمي\x06نحي\x06عمي\x06كمي" + "\x06نجح\x06مخي\x06لجم\x06كمم\x06جحي\x06حجي\x06مجي\x06فمي\x06بحي\x06سخي" + "\x06نجي\x06صلے\x06قلے\x08الله\x08اكبر\x08محمد\x08صلعم\x08رسول\x08عليه" + "\x08وسلم\x06صلى!صلى الله عليه وسلم\x0fجل جلاله\x08ریال\x01,\x01:\x01!" + "\x01?\x01_\x01{\x01}\x01[\x01]\x01#\x01&\x01*\x01-\x01<\x01>\x01\\\x01$" + "\x01%\x01@\x04ـً\x04ـَ\x04ـُ\x04ـِ\x04ـّ\x04ـْ\x02ء\x02آ\x02أ\x02ؤ\x02إ" + "\x02ئ\x02ا\x02ب\x02ة\x02ت\x02ث\x02ج\x02ح\x02خ\x02د\x02ذ\x02ر\x02ز\x02س" + "\x02ش\x02ص\x02ض\x02ط\x02ظ\x02ع\x02غ\x02ف\x02ق\x02ك\x02ل\x02م\x02ن\x02ه" + "\x02و\x02ي\x04لآ\x04لأ\x04لإ\x04لا\x01\x22\x01'\x01/\x01^\x01|\x01~\x02¢" + "\x02£\x02¬\x02¦\x02¥\x08𝅗𝅥\x08𝅘𝅥\x0c𝅘𝅥𝅮\x0c𝅘𝅥𝅯\x0c𝅘𝅥𝅰\x0c𝅘𝅥𝅱\x0c𝅘𝅥𝅲\x08𝆹" + "𝅥\x08𝆺𝅥\x0c𝆹𝅥𝅮\x0c𝆺𝅥𝅮\x0c𝆹𝅥𝅯\x0c𝆺𝅥𝅯\x02ı\x02ȷ\x02α\x02ε\x02ζ\x02η\x02" + "κ\x02λ\x02μ\x02ν\x02ξ\x02ο\x02σ\x02τ\x02υ\x02ψ\x03∇\x03∂\x02ϝ\x02ٮ\x02ڡ" + "\x02ٯ\x020,\x021,\x022,\x023,\x024,\x025,\x026,\x027,\x028,\x029,\x03(a)" + "\x03(b)\x03(c)\x03(d)\x03(e)\x03(f)\x03(g)\x03(h)\x03(i)\x03(j)\x03(k)" + "\x03(l)\x03(m)\x03(n)\x03(o)\x03(p)\x03(q)\x03(r)\x03(s)\x03(t)\x03(u)" + "\x03(v)\x03(w)\x03(x)\x03(y)\x03(z)\x07〔s〕\x02wz\x02hv\x02sd\x03ppv\x02w" + "c\x02mc\x02md\x02dj\x06ほか\x06ココ\x03サ\x03手\x03字\x03双\x03デ\x03二\x03多\x03解" + "\x03天\x03交\x03映\x03無\x03料\x03前\x03後\x03再\x03新\x03初\x03終\x03生\x03販\x03声" + "\x03吹\x03演\x03投\x03捕\x03一\x03三\x03遊\x03左\x03中\x03右\x03指\x03走\x03打\x03禁" + "\x03空\x03合\x03満\x03有\x03月\x03申\x03割\x03営\x03配\x09〔本〕\x09〔三〕\x09〔二〕\x09〔安" + "〕\x09〔点〕\x09〔打〕\x09〔盗〕\x09〔勝〕\x09〔敗〕\x03得\x03可\x03丽\x03丸\x03乁\x03你\x03" + "侮\x03侻\x03倂\x03偺\x03備\x03僧\x03像\x03㒞\x03免\x03兔\x03兤\x03具\x03㒹\x03內\x03" + "冗\x03冤\x03仌\x03冬\x03况\x03凵\x03刃\x03㓟\x03刻\x03剆\x03剷\x03㔕\x03勇\x03勉\x03" + "勤\x03勺\x03包\x03匆\x03北\x03卉\x03卑\x03博\x03即\x03卽\x03卿\x03灰\x03及\x03叟\x03" + "叫\x03叱\x03吆\x03咞\x03吸\x03呈\x03周\x03咢\x03哶\x03唐\x03啓\x03啣\x03善\x03喙\x03" + "喫\x03喳\x03嗂\x03圖\x03嘆\x03圗\x03噑\x03噴\x03切\x03壮\x03城\x03埴\x03堍\x03型\x03" + "堲\x03報\x03墬\x03売\x03壷\x03夆\x03夢\x03奢\x03姬\x03娛\x03娧\x03姘\x03婦\x03㛮\x03" + "嬈\x03嬾\x03寃\x03寘\x03寧\x03寳\x03寿\x03将\x03尢\x03㞁\x03屠\x03屮\x03峀\x03岍\x03" + "嵃\x03嵮\x03嵫\x03嵼\x03巡\x03巢\x03㠯\x03巽\x03帨\x03帽\x03幩\x03㡢\x03㡼\x03庰\x03" + "庳\x03庶\x03廊\x03廾\x03舁\x03弢\x03㣇\x03形\x03彫\x03㣣\x03徚\x03忍\x03志\x03忹\x03" + "悁\x03㤺\x03㤜\x03悔\x03惇\x03慈\x03慌\x03慎\x03慺\x03憎\x03憲\x03憤\x03憯\x03懞\x03" + "懲\x03懶\x03成\x03戛\x03扝\x03抱\x03拔\x03捐\x03挽\x03拼\x03捨\x03掃\x03揤\x03搢\x03" + "揅\x03掩\x03㨮\x03摩\x03摾\x03撝\x03摷\x03㩬\x03敏\x03敬\x03旣\x03書\x03晉\x03㬙\x03" + "暑\x03㬈\x03㫤\x03冒\x03冕\x03最\x03暜\x03肭\x03䏙\x03朗\x03望\x03朡\x03杞\x03杓\x03" + "㭉\x03柺\x03枅\x03桒\x03梅\x03梎\x03栟\x03椔\x03㮝\x03楂\x03榣\x03槪\x03檨\x03櫛\x03" + "㰘\x03次\x03歔\x03㱎\x03歲\x03殟\x03殺\x03殻\x03汎\x03沿\x03泍\x03汧\x03洖\x03派\x03" + "海\x03流\x03浩\x03浸\x03涅\x03洴\x03港\x03湮\x03㴳\x03滋\x03滇\x03淹\x03潮\x03濆\x03" + "瀹\x03瀞\x03瀛\x03㶖\x03灊\x03災\x03灷\x03炭\x03煅\x03熜\x03爨\x03爵\x03牐\x03犀\x03" + "犕\x03獺\x03王\x03㺬\x03玥\x03㺸\x03瑇\x03瑜\x03瑱\x03璅\x03瓊\x03㼛\x03甤\x03甾\x03" + "異\x03瘐\x03㿼\x03䀈\x03直\x03眞\x03真\x03睊\x03䀹\x03瞋\x03䁆\x03䂖\x03硎\x03碌\x03" + "磌\x03䃣\x03祖\x03福\x03秫\x03䄯\x03穀\x03穊\x03穏\x03䈂\x03篆\x03築\x03䈧\x03糒\x03" + "䊠\x03糨\x03糣\x03紀\x03絣\x03䌁\x03緇\x03縂\x03繅\x03䌴\x03䍙\x03罺\x03羕\x03翺\x03" + "者\x03聠\x03聰\x03䏕\x03育\x03脃\x03䐋\x03脾\x03媵\x03舄\x03辞\x03䑫\x03芑\x03芋\x03" + "芝\x03劳\x03花\x03芳\x03芽\x03苦\x03若\x03茝\x03荣\x03莭\x03茣\x03莽\x03菧\x03著\x03" + "荓\x03菊\x03菌\x03菜\x03䔫\x03蓱\x03蓳\x03蔖\x03蕤\x03䕝\x03䕡\x03䕫\x03虐\x03虜\x03" + "虧\x03虩\x03蚩\x03蚈\x03蜎\x03蛢\x03蝹\x03蜨\x03蝫\x03螆\x03蟡\x03蠁\x03䗹\x03衠\x03" + "衣\x03裗\x03裞\x03䘵\x03裺\x03㒻\x03䚾\x03䛇\x03誠\x03諭\x03變\x03豕\x03貫\x03賁\x03" + "贛\x03起\x03跋\x03趼\x03跰\x03軔\x03輸\x03邔\x03郱\x03鄑\x03鄛\x03鈸\x03鋗\x03鋘\x03" + "鉼\x03鏹\x03鐕\x03開\x03䦕\x03閷\x03䧦\x03雃\x03嶲\x03霣\x03䩮\x03䩶\x03韠\x03䪲\x03" + "頋\x03頩\x03飢\x03䬳\x03餩\x03馧\x03駂\x03駾\x03䯎\x03鬒\x03鱀\x03鳽\x03䳎\x03䳭\x03" + "鵧\x03䳸\x03麻\x03䵖\x03黹\x03黾\x03鼅\x03鼏\x03鼖\x03鼻" var xorData string = "" + // Size: 4855 bytes "\x02\x0c\x09\x02\xb0\xec\x02\xad\xd8\x02\xad\xd9\x02\x06\x07\x02\x0f\x12" + "\x02\x0f\x1f\x02\x0f\x1d\x02\x01\x13\x02\x0f\x16\x02\x0f\x0b\x02\x0f3" + "\x02\x0f7\x02\x0f?\x02\x0f/\x02\x0f*\x02\x0c&\x02\x0c*\x02\x0c;\x02\x0c9" + "\x02\x0c%\x02\xab\xed\x02\xab\xe2\x02\xab\xe3\x02\xa9\xe0\x02\xa9\xe1" + "\x02\xa9\xe6\x02\xa3\xcb\x02\xa3\xc8\x02\xa3\xc9\x02\x01#\x02\x01\x08" + "\x02\x0e>\x02\x0e'\x02\x0f\x03\x02\x03\x0d\x02\x03\x09\x02\x03\x17\x02" + "\x03\x0e\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07" + "\x0d\x02\x02\x0c\x02\x0c0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\x22" + "\x02\x01)\x02\x01\x0a\x02\x01\x0c\x02\x02\x06\x02\x02\x02\x02\x03\x10" + "\x03\x037 \x03\x0b+\x03\x02\x01\x04\x02\x01\x02\x02\x019\x02\x03\x1c\x02" + "\x02$\x03\x80p$\x02\x03:\x02\x03\x0a\x03\xc1r.\x03\xc1r,\x03\xc1r\x02" + "\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xc1s<\x03\xc1s*" + "\x03\xc2L$\x03\xc2L;\x02\x09)\x02\x0a\x19\x03\x83\xab\xe3\x03\x83\xab" + "\xf2\x03 4\xe0\x03\x81\xab\xea\x03\x81\xab\xf3\x03 4\xef\x03\x96\xe1\xcd" + "\x03\x84\xe5\xc3\x02\x0d\x11\x03\x8b\xec\xcb\x03\x94\xec\xcf\x03\x9a\xec" + "\xc2\x03\x8b\xec\xdb\x03\x94\xec\xdf\x03\x9a\xec\xd2\x03\x01\x0c!\x03" + "\x01\x0c#\x03ʠ\x9d\x03ʣ\x9c\x03ʢ\x9f\x03ʥ\x9e\x03ʤ\x91\x03ʧ\x90\x03ʦ\x93" + "\x03ʩ\x92\x03ʨ\x95\x03\xca\xf3\xb5\x03\xca\xf0\xb4\x03\xca\xf1\xb7\x03" + "\xca\xf6\xb6\x03\xca\xf7\x89\x03\xca\xf4\x88\x03\xca\xf5\x8b\x03\xca\xfa" + "\x8a\x03\xca\xfb\x8d\x03\xca\xf8\x8c\x03\xca\xf9\x8f\x03\xca\xfe\x8e\x03" + "\xca\xff\x81\x03\xca\xfc\x80\x03\xca\xfd\x83\x03\xca\xe2\x82\x03\xca\xe3" + "\x85\x03\xca\xe0\x84\x03\xca\xe1\x87\x03\xca\xe6\x86\x03\xca\xe7\x99\x03" + "\xca\xe4\x98\x03\xca\xe5\x9b\x03\xca\xea\x9a\x03\xca\xeb\x9d\x03\xca\xe8" + "\x9c\x03ؓ\x89\x03ߔ\x8b\x02\x010\x03\x03\x04\x1e\x03\x04\x15\x12\x03\x0b" + "\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06\x05" + "\x1d\x03\x06\x06\x00\x03\x06\x06\x0a\x03\x06\x06'\x03\x06\x062\x03\x0786" + "\x03\x079/\x03\x079 \x03\x07:\x0e\x03\x07:\x1b\x03\x07:%\x03\x07;/\x03" + "\x07;%\x03\x074\x11\x03\x076\x09\x03\x077*\x03\x070\x01\x03\x070\x0f\x03" + "\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-\x03" + "\x073\x14\x03\x073>\x03\x07'\x09\x03\x07 \x00\x03\x07\x1f\x0b\x03\x07" + "\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03\x07" + "\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\x0c&\x03\x07\x0c\x08\x03\x07" + "\x0c\x13\x03\x07\x0d\x02\x03\x07\x0d\x1c\x03\x07\x0b5\x03\x07\x0b\x0a" + "\x03\x07\x0b\x01\x03\x07\x0b\x0f\x03\x07\x05\x00\x03\x07\x05\x09\x03\x07" + "\x05\x0b\x03\x07\x07\x01\x03\x07\x07\x08\x03\x07\x00<\x03\x07\x00+\x03" + "\x07\x01)\x03\x07\x01\x1b\x03\x07\x01\x08\x03\x07\x03?\x03\x0445\x03\x04" + "4\x08\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03\x04+ " + "\x03\x04+<\x03\x04*&\x03\x04*\x22\x03\x04&8\x03\x04!\x01\x03\x04!\x22" + "\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04\x03" + "\x04\x12\x0a\x03\x04\x0d\x1d\x03\x04\x0d\x07\x03\x04\x0d \x03\x05<>\x03" + "\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1d\x03\x054\x02\x03\x054" + "\x07\x03\x0571\x03\x053\x1a\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03\x05)" + ":\x03\x05)<\x03\x05)\x0c\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$\x1e" + "\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\x226\x03" + "\x05\x22\x0c\x03\x05\x22\x1c\x03\x05\x19\x0a\x03\x05\x1b\x09\x03\x05\x1b" + "\x0c\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\x0c\x03\x05\x0c\x05\x03" + "\x05\x0e\x0f\x03\x05\x01\x0e\x03\x05\x00(\x03\x05\x030\x03\x05\x03\x06" + "\x03\x0a==\x03\x0a=1\x03\x0a=,\x03\x0a=\x0c\x03\x0a??\x03\x0a<\x08\x03" + "\x0a9!\x03\x0a9)\x03\x0a97\x03\x0a99\x03\x0a6\x0a\x03\x0a6\x1c\x03\x0a6" + "\x17\x03\x0a7'\x03\x0a78\x03\x0a73\x03\x0a'\x01\x03\x0a'&\x03\x0a\x1f" + "\x0e\x03\x0a\x1f\x03\x03\x0a\x1f3\x03\x0a\x1b/\x03\x0a\x18\x19\x03\x0a" + "\x19\x01\x03\x0a\x16\x14\x03\x0a\x0e\x22\x03\x0a\x0f\x10\x03\x0a\x0f\x02" + "\x03\x0a\x0f \x03\x0a\x0c\x04\x03\x0a\x0b>\x03\x0a\x0b+\x03\x0a\x08/\x03" + "\x0a\x046\x03\x0a\x05\x14\x03\x0a\x00\x04\x03\x0a\x00\x10\x03\x0a\x00" + "\x14\x03\x0b<3\x03\x0b;*\x03\x0b9\x22\x03\x0b9)\x03\x0b97\x03\x0b+\x10" + "\x03\x0b((\x03\x0b&5\x03\x0b$\x1c\x03\x0b$\x12\x03\x0b%\x04\x03\x0b#<" + "\x03\x0b#0\x03\x0b#\x0d\x03\x0b#\x19\x03\x0b!:\x03\x0b!\x1f\x03\x0b!\x00" + "\x03\x0b\x1e5\x03\x0b\x1c\x1d\x03\x0b\x1d-\x03\x0b\x1d(\x03\x0b\x18.\x03" + "\x0b\x18 \x03\x0b\x18\x16\x03\x0b\x14\x13\x03\x0b\x15$\x03\x0b\x15\x22" + "\x03\x0b\x12\x1b\x03\x0b\x12\x10\x03\x0b\x132\x03\x0b\x13=\x03\x0b\x12" + "\x18\x03\x0b\x0c&\x03\x0b\x061\x03\x0b\x06:\x03\x0b\x05#\x03\x0b\x05<" + "\x03\x0b\x04\x0b\x03\x0b\x04\x04\x03\x0b\x04\x1b\x03\x0b\x042\x03\x0b" + "\x041\x03\x0b\x03\x03\x03\x0b\x03\x1d\x03\x0b\x03/\x03\x0b\x03+\x03\x0b" + "\x02\x1b\x03\x0b\x02\x00\x03\x0b\x01\x1e\x03\x0b\x01\x08\x03\x0b\x015" + "\x03\x06\x0d9\x03\x06\x0d=\x03\x06\x0d?\x03\x02\x001\x03\x02\x003\x03" + "\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1b\x03\x02\x004\x03\x02\x00<\x03" + "\x02\x02\x0a\x03\x02\x02\x0e\x03\x02\x01\x1a\x03\x02\x01\x07\x03\x02\x01" + "\x05\x03\x02\x01\x0b\x03\x02\x01%\x03\x02\x01\x0c\x03\x02\x01\x04\x03" + "\x02\x01\x1c\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03" + "\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02" + "\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022" + "\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01" + "\x11\x03\x02\x01\x1e\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0f\x03" + "\x02\x01\x08\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\x0d\x03\x02\x03" + "\x13\x03\x02\x03\x1d\x03\x02\x03\x1f\x03\x02\x00\x03\x03\x02\x00\x0d\x03" + "\x02\x00\x01\x03\x02\x00\x1b\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00" + "\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1f\x03\x07>\x1d\x03\x06\x1d\x0e" + "\x03\x07>\x1c\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>" + "\x02\x03\x06\x224\x03\x06\x1a.\x03\x07<%\x03\x06\x1c\x0b\x03\x0609\x03" + "\x05\x1f\x01\x03\x04'\x08\x03\x93\xfd\xf5\x03\x02\x0d \x03\x02\x0d#\x03" + "\x02\x0d!\x03\x02\x0d&\x03\x02\x0d\x22\x03\x02\x0d/\x03\x02\x0d,\x03\x02" + "\x0d$\x03\x02\x0d'\x03\x02\x0d%\x03\x02\x0d;\x03\x02\x0d=\x03\x02\x0d?" + "\x03\x099.\x03\x08\x0b7\x03\x08\x02\x14\x03\x08\x14\x0d\x03\x08.:\x03" + "\x089'\x03\x0f\x0b\x18\x03\x0f\x1c1\x03\x0f\x17&\x03\x0f9\x1f\x03\x0f0" + "\x0c\x03\x0e\x0a9\x03\x0e\x056\x03\x0e\x1c#\x03\x0f\x13\x0e\x03\x072\x00" + "\x03\x070\x0d\x03\x072\x0b\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0f(\x03" + "\x072\x05\x03\x06\x0f,\x03\x073\x15\x03\x06\x07\x08\x03\x05\x16\x02\x03" + "\x04\x0b \x03\x05:8\x03\x05\x16%\x03\x0a\x0d\x1f\x03\x06\x16\x10\x03\x05" + "\x1d5\x03\x05*;\x03\x05\x16\x1b\x03\x04.-\x03\x06\x1a\x19\x03\x04\x03," + "\x03\x0b87\x03\x04/\x0a\x03\x06\x00,\x03\x04-\x01\x03\x04\x1e-\x03\x06/(" + "\x03\x0a\x0b5\x03\x06\x0e7\x03\x06\x07.\x03\x0597\x03\x0a*%\x03\x0760" + "\x03\x06\x0c;\x03\x05'\x00\x03\x072.\x03\x072\x08\x03\x06=\x01\x03\x06" + "\x05\x1b\x03\x06\x06\x12\x03\x06$=\x03\x06'\x0d\x03\x04\x11\x0f\x03\x076" + ",\x03\x06\x07;\x03\x06.,\x03\x86\xf9\xea\x03\x8f\xff\xeb\x02\x092\x02" + "\x095\x02\x094\x02\x09;\x02\x09>\x02\x098\x02\x09*\x02\x09/\x02\x09,\x02" + "\x09%\x02\x09&\x02\x09#\x02\x09 \x02\x08!\x02\x08%\x02\x08$\x02\x08+\x02" + "\x08.\x02\x08*\x02\x08&\x02\x088\x02\x08>\x02\x084\x02\x086\x02\x080\x02" + "\x08\x10\x02\x08\x17\x02\x08\x12\x02\x08\x1d\x02\x08\x1f\x02\x08\x13\x02" + "\x08\x15\x02\x08\x14\x02\x08\x0c\x03\x8b\xfd\xd0\x03\x81\xec\xc6\x03\x87" + "\xe0\x8a\x03-2\xe3\x03\x80\xef\xe4\x03-2\xea\x03\x88\xe6\xeb\x03\x8e\xe6" + "\xe8\x03\x84\xe6\xe9\x03\x97\xe6\xee\x03-2\xf9\x03-2\xf6\x03\x8e\xe3\xad" + "\x03\x80\xe3\x92\x03\x88\xe3\x90\x03\x8e\xe3\x90\x03\x80\xe3\x97\x03\x88" + "\xe3\x95\x03\x88\xfe\xcb\x03\x8e\xfe\xca\x03\x84\xfe\xcd\x03\x91\xef\xc9" + "\x03-2\xc1\x03-2\xc0\x03-2\xcb\x03\x88@\x09\x03\x8e@\x08\x03\x8f\xe0\xf5" + "\x03\x8e\xe6\xf9\x03\x8e\xe0\xfa\x03\x93\xff\xf4\x03\x84\xee\xd3\x03\x0b" + "(\x04\x023 \x021;\x02\x01*\x03\x0b#\x10\x03\x0b 0\x03\x0b!\x10\x03\x0b!0" + "\x03\x07\x15\x08\x03\x09?5\x03\x07\x1f\x08\x03\x07\x17\x0b\x03\x09\x1f" + "\x15\x03\x0b\x1c7\x03\x0a+#\x03\x06\x1a\x1b\x03\x06\x1a\x14\x03\x0a\x01" + "\x18\x03\x06#\x1b\x03\x0a2\x0c\x03\x0a\x01\x04\x03\x09#;\x03\x08='\x03" + "\x08\x1a\x0a\x03\x07\x03\x0a\x111\x03\x09\x1b\x09\x03\x073.\x03\x07\x01\x00" + "\x03\x09/,\x03\x07#>\x03\x07\x048\x03\x0a\x1f\x22\x03\x098>\x03\x09\x11" + "\x00\x03\x08/\x17\x03\x06'\x22\x03\x0b\x1a+\x03\x0a\x22\x19\x03\x0a/1" + "\x03\x0974\x03\x09\x0f\x22\x03\x08,\x22\x03\x08?\x14\x03\x07$5\x03\x07<3" + "\x03\x07=*\x03\x07\x13\x18\x03\x068\x0a\x03\x06\x09\x16\x03\x06\x13\x00" + "\x03\x08\x067\x03\x08\x01\x03\x03\x08\x12\x1d\x03\x07+7\x03\x06(;\x03" + "\x06\x1c?\x03\x07\x0e\x17\x03\x0a\x06\x1d\x03\x0a\x19\x07\x03\x08\x14$" + "\x03\x07$;\x03\x08,$\x03\x08\x06\x0d\x03\x07\x16\x0a\x03\x06>>\x03\x0a" + "\x06\x12\x03\x0a\x14)\x03\x09\x0d\x1f\x03\x09\x12\x17\x03\x09\x19\x01" + "\x03\x08\x11 \x03\x08\x1d'\x03\x06<\x1a\x03\x0a.\x00\x03\x07'\x18\x03" + "\x0a\x22\x08\x03\x08\x0d\x0a\x03\x08\x13)\x03\x07*)\x03\x06<,\x03\x07" + "\x0b\x1a\x03\x09.\x14\x03\x09\x0d\x1e\x03\x07\x0e#\x03\x0b\x1d'\x03\x0a" + "\x0a8\x03\x09%2\x03\x08+&\x03\x080\x12\x03\x0a)4\x03\x08\x06\x1f\x03\x0b" + "\x1b\x1a\x03\x0a\x1b\x0f\x03\x0b\x1d*\x03\x09\x16$\x03\x090\x11\x03\x08" + "\x11\x08\x03\x0a*(\x03\x0a\x042\x03\x089,\x03\x074'\x03\x07\x0f\x05\x03" + "\x09\x0b\x0a\x03\x07\x1b\x01\x03\x09\x17:\x03\x09.\x0d\x03\x07.\x11\x03" + "\x09+\x15\x03\x080\x13\x03\x0b\x1f\x19\x03\x0a \x11\x03\x0a\x220\x03\x09" + "\x07;\x03\x08\x16\x1c\x03\x07,\x13\x03\x07\x0e/\x03\x06\x221\x03\x0a." + "\x0a\x03\x0a7\x02\x03\x0a\x032\x03\x0a\x1d.\x03\x091\x06\x03\x09\x19:" + "\x03\x08\x02/\x03\x060+\x03\x06\x0f-\x03\x06\x1c\x1f\x03\x06\x1d\x07\x03" + "\x0a,\x11\x03\x09=\x0d\x03\x09\x0b;\x03\x07\x1b/\x03\x0a\x1f:\x03\x09 " + "\x1f\x03\x09.\x10\x03\x094\x0b\x03\x09\x1a1\x03\x08#\x1a\x03\x084\x1d" + "\x03\x08\x01\x1f\x03\x08\x11\x22\x03\x07'8\x03\x07\x1a>\x03\x0757\x03" + "\x06&9\x03\x06+\x11\x03\x0a.\x0b\x03\x0a,>\x03\x0a4#\x03\x08%\x17\x03" + "\x07\x05\x22\x03\x07\x0c\x0b\x03\x0a\x1d+\x03\x0a\x19\x16\x03\x09+\x1f" + "\x03\x09\x08\x0b\x03\x08\x16\x18\x03\x08+\x12\x03\x0b\x1d\x0c\x03\x0a=" + "\x10\x03\x0a\x09\x0d\x03\x0a\x10\x11\x03\x09&0\x03\x08(\x1f\x03\x087\x07" + "\x03\x08\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06," + "\x03\x0b\x18>\x03\x08\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\x09%\x18\x03" + "\x0b\x1c<\x03\x0a%!\x03\x0a\x09\x12\x03\x0a\x16\x02\x03\x090'\x03\x09" + "\x0e=\x03\x08 \x0e\x03\x08>\x03\x03\x074>\x03\x06&?\x03\x06\x19\x09\x03" + "\x06?(\x03\x0a-\x0e\x03\x09:3\x03\x098:\x03\x09\x12\x0b\x03\x09\x1d\x17" + "\x03\x087\x05\x03\x082\x14\x03\x08\x06%\x03\x08\x13\x1f\x03\x06\x06\x0e" + "\x03\x0a\x22<\x03\x09/<\x03\x06>+\x03\x0a'?\x03\x0a\x13\x0c\x03\x09\x10<" + "\x03\x07\x1b=\x03\x0a\x19\x13\x03\x09\x22\x1d\x03\x09\x07\x0d\x03\x08)" + "\x1c\x03\x06=\x1a\x03\x0a/4\x03\x0a7\x11\x03\x0a\x16:\x03\x09?3\x03\x09:" + "/\x03\x09\x05\x0a\x03\x09\x14\x06\x03\x087\x22\x03\x080\x07\x03\x08\x1a" + "\x1f\x03\x07\x04(\x03\x07\x04\x09\x03\x06 %\x03\x06<\x08\x03\x0a+\x14" + "\x03\x09\x1d\x16\x03\x0a70\x03\x08 >\x03\x0857\x03\x070\x0a\x03\x06=\x12" + "\x03\x06\x16%\x03\x06\x1d,\x03\x099#\x03\x09\x10>\x03\x07 \x1e\x03\x08" + "\x0c<\x03\x08\x0b\x18\x03\x08\x15+\x03\x08,:\x03\x08%\x22\x03\x07\x0a$" + "\x03\x0b\x1c=\x03\x07+\x08\x03\x0a/\x05\x03\x0a \x07\x03\x0a\x12'\x03" + "\x09#\x11\x03\x08\x1b\x15\x03\x0a\x06\x01\x03\x09\x1c\x1b\x03\x0922\x03" + "\x07\x14<\x03\x07\x09\x04\x03\x061\x04\x03\x07\x0e\x01\x03\x0a\x13\x18" + "\x03\x0a-\x0c\x03\x0a?\x0d\x03\x0a\x09\x0a\x03\x091&\x03\x0a/\x0b\x03" + "\x08$<\x03\x083\x1d\x03\x08\x0c$\x03\x08\x0d\x07\x03\x08\x0d?\x03\x08" + "\x0e\x14\x03\x065\x0a\x03\x08\x1a#\x03\x08\x16#\x03\x0702\x03\x07\x03" + "\x1a\x03\x06(\x1d\x03\x06+\x1b\x03\x06\x0b\x05\x03\x06\x0b\x17\x03\x06" + "\x0c\x04\x03\x06\x1e\x19\x03\x06+0\x03\x062\x18\x03\x0b\x16\x1e\x03\x0a+" + "\x16\x03\x0a-?\x03\x0a#:\x03\x0a#\x10\x03\x0a%$\x03\x0a>+\x03\x0a01\x03" + "\x0a1\x10\x03\x0a\x099\x03\x0a\x0a\x12\x03\x0a\x19\x1f\x03\x0a\x19\x12" + "\x03\x09*)\x03\x09-\x16\x03\x09.1\x03\x09.2\x03\x09<\x0e\x03\x09> \x03" + "\x093\x12\x03\x09\x0b\x01\x03\x09\x1c2\x03\x09\x11\x1c\x03\x09\x15%\x03" + "\x08,&\x03\x08!\x22\x03\x089(\x03\x08\x0b\x1a\x03\x08\x0d2\x03\x08\x0c" + "\x04\x03\x08\x0c\x06\x03\x08\x0c\x1f\x03\x08\x0c\x0c\x03\x08\x0f\x1f\x03" + "\x08\x0f\x1d\x03\x08\x00\x14\x03\x08\x03\x14\x03\x08\x06\x16\x03\x08\x1e" + "#\x03\x08\x11\x11\x03\x08\x10\x18\x03\x08\x14(\x03\x07)\x1e\x03\x07.1" + "\x03\x07 $\x03\x07 '\x03\x078\x08\x03\x07\x0d0\x03\x07\x0f7\x03\x07\x05#" + "\x03\x07\x05\x1a\x03\x07\x1a7\x03\x07\x1d-\x03\x07\x17\x10\x03\x06)\x1f" + "\x03\x062\x0b\x03\x066\x16\x03\x06\x09\x11\x03\x09(\x1e\x03\x07!5\x03" + "\x0b\x11\x16\x03\x0a/\x04\x03\x0a,\x1a\x03\x0b\x173\x03\x0a,1\x03\x0a/5" + "\x03\x0a\x221\x03\x0a\x22\x0d\x03\x0a?%\x03\x0a<,\x03\x0a?#\x03\x0a>\x19" + "\x03\x0a\x08&\x03\x0a\x0b\x0e\x03\x0a\x0c:\x03\x0a\x0c+\x03\x0a\x03\x22" + "\x03\x0a\x06)\x03\x0a\x11\x10\x03\x0a\x11\x1a\x03\x0a\x17-\x03\x0a\x14(" + "\x03\x09)\x1e\x03\x09/\x09\x03\x09.\x00\x03\x09,\x07\x03\x09/*\x03\x09-9" + "\x03\x09\x228\x03\x09%\x09\x03\x09:\x12\x03\x09;\x1d\x03\x09?\x06\x03" + "\x093%\x03\x096\x05\x03\x096\x08\x03\x097\x02\x03\x09\x07,\x03\x09\x04," + "\x03\x09\x1f\x16\x03\x09\x11\x03\x03\x09\x11\x12\x03\x09\x168\x03\x08*" + "\x05\x03\x08/2\x03\x084:\x03\x08\x22+\x03\x08 0\x03\x08&\x0a\x03\x08;" + "\x10\x03\x08>$\x03\x08>\x18\x03\x0829\x03\x082:\x03\x081,\x03\x081<\x03" + "\x081\x1c\x03\x087#\x03\x087*\x03\x08\x09'\x03\x08\x00\x1d\x03\x08\x05-" + "\x03\x08\x1f4\x03\x08\x1d\x04\x03\x08\x16\x0f\x03\x07*7\x03\x07'!\x03" + "\x07%\x1b\x03\x077\x0c\x03\x07\x0c1\x03\x07\x0c.\x03\x07\x00\x06\x03\x07" + "\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03" + "\x07\x06\x06\x03\x07\x05\x0a\x03\x07\x1f\x09\x03\x07\x17:\x03\x06*1\x03" + "\x06-\x1d\x03\x06\x223\x03\x062:\x03\x060$\x03\x066\x1e\x03\x064\x12\x03" + "\x0645\x03\x06\x0b\x00\x03\x06\x0b7\x03\x06\x07\x1f\x03\x06\x15\x12\x03" + "\x0c\x05\x0f\x03\x0b+\x0b\x03\x0b+-\x03\x06\x16\x1b\x03\x06\x15\x17\x03" + "\x89\xca\xea\x03\x89\xca\xe8\x03\x0c8\x10\x03\x0c8\x01\x03\x0c8\x0f\x03" + "\x0d8%\x03\x0d8!\x03\x0c8-\x03\x0c8/\x03\x0c8+\x03\x0c87\x03\x0c85\x03" + "\x0c9\x09\x03\x0c9\x0d\x03\x0c9\x0f\x03\x0c9\x0b\x03\xcfu\x0c\x03\xcfu" + "\x0f\x03\xcfu\x0e\x03\xcfu\x09\x03\x0c9\x10\x03\x0d9\x0c\x03\xcf`;\x03" + "\xcf`>\x03\xcf`9\x03\xcf`8\x03\xcf`7\x03\xcf`*\x03\xcf`-\x03\xcf`,\x03" + "\x0d\x1b\x1a\x03\x0d\x1b&\x03\x0c=.\x03\x0c=%\x03\x0c>\x1e\x03\x0c>\x14" + "\x03\x0c?\x06\x03\x0c?\x0b\x03\x0c?\x0c\x03\x0c?\x0d\x03\x0c?\x02\x03" + "\x0c>\x0f\x03\x0c>\x08\x03\x0c>\x09\x03\x0c>,\x03\x0c>\x0c\x03\x0c?\x13" + "\x03\x0c?\x16\x03\x0c?\x15\x03\x0c?\x1c\x03\x0c?\x1f\x03\x0c?\x1d\x03" + "\x0c?\x1a\x03\x0c?\x17\x03\x0c?\x08\x03\x0c?\x09\x03\x0c?\x0e\x03\x0c?" + "\x04\x03\x0c?\x05\x03\x0c" + "\x03\x0c=2\x03\x0c=6\x03\x0c<\x07\x03\x0c<\x05\x03\x0e:!\x03\x0e:#\x03" + "\x0e8\x09\x03\x0e:&\x03\x0e8\x0b\x03\x0e:$\x03\x0e:,\x03\x0e8\x1a\x03" + "\x0e8\x1e\x03\x0e:*\x03\x0e:7\x03\x0e:5\x03\x0e:;\x03\x0e:\x15\x03\x0e:<" + "\x03\x0e:4\x03\x0e:'\x03\x0e:-\x03\x0e:%\x03\x0e:?\x03\x0e:=\x03\x0e:)" + "\x03\x0e:/\x03\xcfs'\x03\x0d=\x0f\x03\x0d+*\x03\x0d99\x03\x0d9;\x03\x0d9" + "?\x03\x0d)\x0d\x03\x0d(%\x02\x01\x18\x02\x01(\x02\x01\x1e\x03\x0f$!\x03" + "\x0f87\x03\x0f4\x0e\x03\x0f5\x1d\x03\x06'\x03\x03\x0f\x08\x18\x03\x0f" + "\x0d\x1b\x03\x0e2=\x03\x0e;\x08\x03\x0e:\x0b\x03\x0e\x06$\x03\x0e\x0d)" + "\x03\x0e\x16\x1f\x03\x0e\x16\x1b\x03\x0d$\x0a\x03\x05,\x1d\x03\x0d. \x03" + "\x0d.#\x03\x0c(/\x03\x09%\x02\x03\x0d90\x03\x0d\x0e4\x03\x0d\x0d\x0f\x03" + "\x0c#\x00\x03\x0c,\x1e\x03\x0c2\x0e\x03\x0c\x01\x17\x03\x0c\x09:\x03\x0e" + "\x173\x03\x0c\x08\x03\x03\x0c\x11\x07\x03\x0c\x10\x18\x03\x0c\x1f\x1c" + "\x03\x0c\x19\x0e\x03\x0c\x1a\x1f\x03\x0f0>\x03\x0b->\x03\x0b<+\x03\x0b8" + "\x13\x03\x0b\x043\x03\x0b\x14\x03\x03\x0b\x16%\x03\x0d\x22&\x03\x0b\x1a" + "\x1a\x03\x0b\x1a\x04\x03\x0a%9\x03\x0a&2\x03\x0a&0\x03\x0a!\x1a\x03\x0a!" + "7\x03\x0a5\x10\x03\x0a=4\x03\x0a?\x0e\x03\x0a>\x10\x03\x0a\x00 \x03\x0a" + "\x0f:\x03\x0a\x0f9\x03\x0a\x0b\x0a\x03\x0a\x17%\x03\x0a\x1b-\x03\x09-" + "\x1a\x03\x09,4\x03\x09.,\x03\x09)\x09\x03\x096!\x03\x091\x1f\x03\x093" + "\x16\x03\x0c+\x1f\x03\x098 \x03\x098=\x03\x0c(\x1a\x03\x0c(\x16\x03\x09" + "\x0a+\x03\x09\x16\x12\x03\x09\x13\x0e\x03\x09\x153\x03\x08)!\x03\x09\x1a" + "\x01\x03\x09\x18\x01\x03\x08%#\x03\x08>\x22\x03\x08\x05%\x03\x08\x02*" + "\x03\x08\x15;\x03\x08\x1b7\x03\x0f\x07\x1d\x03\x0f\x04\x03\x03\x070\x0c" + "\x03\x07;\x0b\x03\x07\x08\x17\x03\x07\x12\x06\x03\x06/-\x03\x0671\x03" + "\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1e\x03\x05,\x17\x03\x05 \x1d\x03" + "\x05\x22\x05\x03\x050\x1d" // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // idnaTrie. Total size: 29404 bytes (28.71 KiB). Checksum: 848c45acb5f7991c. type idnaTrie struct{} func newIdnaTrie(i int) *idnaTrie { return &idnaTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *idnaTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 125: return uint16(idnaValues[n<<6+uint32(b)]) default: n -= 125 return uint16(idnaSparse.lookup(n, b)) } } // idnaValues: 127 blocks, 8128 entries, 16256 bytes // The third block is the zero block. var idnaValues = [8128]uint16{ // Block 0x0, offset 0x0 0x00: 0x0080, 0x01: 0x0080, 0x02: 0x0080, 0x03: 0x0080, 0x04: 0x0080, 0x05: 0x0080, 0x06: 0x0080, 0x07: 0x0080, 0x08: 0x0080, 0x09: 0x0080, 0x0a: 0x0080, 0x0b: 0x0080, 0x0c: 0x0080, 0x0d: 0x0080, 0x0e: 0x0080, 0x0f: 0x0080, 0x10: 0x0080, 0x11: 0x0080, 0x12: 0x0080, 0x13: 0x0080, 0x14: 0x0080, 0x15: 0x0080, 0x16: 0x0080, 0x17: 0x0080, 0x18: 0x0080, 0x19: 0x0080, 0x1a: 0x0080, 0x1b: 0x0080, 0x1c: 0x0080, 0x1d: 0x0080, 0x1e: 0x0080, 0x1f: 0x0080, 0x20: 0x0080, 0x21: 0x0080, 0x22: 0x0080, 0x23: 0x0080, 0x24: 0x0080, 0x25: 0x0080, 0x26: 0x0080, 0x27: 0x0080, 0x28: 0x0080, 0x29: 0x0080, 0x2a: 0x0080, 0x2b: 0x0080, 0x2c: 0x0080, 0x2d: 0x0008, 0x2e: 0x0008, 0x2f: 0x0080, 0x30: 0x0008, 0x31: 0x0008, 0x32: 0x0008, 0x33: 0x0008, 0x34: 0x0008, 0x35: 0x0008, 0x36: 0x0008, 0x37: 0x0008, 0x38: 0x0008, 0x39: 0x0008, 0x3a: 0x0080, 0x3b: 0x0080, 0x3c: 0x0080, 0x3d: 0x0080, 0x3e: 0x0080, 0x3f: 0x0080, // Block 0x1, offset 0x40 0x40: 0x0080, 0x41: 0xe105, 0x42: 0xe105, 0x43: 0xe105, 0x44: 0xe105, 0x45: 0xe105, 0x46: 0xe105, 0x47: 0xe105, 0x48: 0xe105, 0x49: 0xe105, 0x4a: 0xe105, 0x4b: 0xe105, 0x4c: 0xe105, 0x4d: 0xe105, 0x4e: 0xe105, 0x4f: 0xe105, 0x50: 0xe105, 0x51: 0xe105, 0x52: 0xe105, 0x53: 0xe105, 0x54: 0xe105, 0x55: 0xe105, 0x56: 0xe105, 0x57: 0xe105, 0x58: 0xe105, 0x59: 0xe105, 0x5a: 0xe105, 0x5b: 0x0080, 0x5c: 0x0080, 0x5d: 0x0080, 0x5e: 0x0080, 0x5f: 0x0080, 0x60: 0x0080, 0x61: 0x0008, 0x62: 0x0008, 0x63: 0x0008, 0x64: 0x0008, 0x65: 0x0008, 0x66: 0x0008, 0x67: 0x0008, 0x68: 0x0008, 0x69: 0x0008, 0x6a: 0x0008, 0x6b: 0x0008, 0x6c: 0x0008, 0x6d: 0x0008, 0x6e: 0x0008, 0x6f: 0x0008, 0x70: 0x0008, 0x71: 0x0008, 0x72: 0x0008, 0x73: 0x0008, 0x74: 0x0008, 0x75: 0x0008, 0x76: 0x0008, 0x77: 0x0008, 0x78: 0x0008, 0x79: 0x0008, 0x7a: 0x0008, 0x7b: 0x0080, 0x7c: 0x0080, 0x7d: 0x0080, 0x7e: 0x0080, 0x7f: 0x0080, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x0040, 0xc1: 0x0040, 0xc2: 0x0040, 0xc3: 0x0040, 0xc4: 0x0040, 0xc5: 0x0040, 0xc6: 0x0040, 0xc7: 0x0040, 0xc8: 0x0040, 0xc9: 0x0040, 0xca: 0x0040, 0xcb: 0x0040, 0xcc: 0x0040, 0xcd: 0x0040, 0xce: 0x0040, 0xcf: 0x0040, 0xd0: 0x0040, 0xd1: 0x0040, 0xd2: 0x0040, 0xd3: 0x0040, 0xd4: 0x0040, 0xd5: 0x0040, 0xd6: 0x0040, 0xd7: 0x0040, 0xd8: 0x0040, 0xd9: 0x0040, 0xda: 0x0040, 0xdb: 0x0040, 0xdc: 0x0040, 0xdd: 0x0040, 0xde: 0x0040, 0xdf: 0x0040, 0xe0: 0x000a, 0xe1: 0x0018, 0xe2: 0x0018, 0xe3: 0x0018, 0xe4: 0x0018, 0xe5: 0x0018, 0xe6: 0x0018, 0xe7: 0x0018, 0xe8: 0x001a, 0xe9: 0x0018, 0xea: 0x0039, 0xeb: 0x0018, 0xec: 0x0018, 0xed: 0x03c0, 0xee: 0x0018, 0xef: 0x004a, 0xf0: 0x0018, 0xf1: 0x0018, 0xf2: 0x0069, 0xf3: 0x0079, 0xf4: 0x008a, 0xf5: 0x0005, 0xf6: 0x0018, 0xf7: 0x0008, 0xf8: 0x00aa, 0xf9: 0x00c9, 0xfa: 0x00d9, 0xfb: 0x0018, 0xfc: 0x00e9, 0xfd: 0x0119, 0xfe: 0x0149, 0xff: 0x0018, // Block 0x4, offset 0x100 0x100: 0xe00d, 0x101: 0x0008, 0x102: 0xe00d, 0x103: 0x0008, 0x104: 0xe00d, 0x105: 0x0008, 0x106: 0xe00d, 0x107: 0x0008, 0x108: 0xe00d, 0x109: 0x0008, 0x10a: 0xe00d, 0x10b: 0x0008, 0x10c: 0xe00d, 0x10d: 0x0008, 0x10e: 0xe00d, 0x10f: 0x0008, 0x110: 0xe00d, 0x111: 0x0008, 0x112: 0xe00d, 0x113: 0x0008, 0x114: 0xe00d, 0x115: 0x0008, 0x116: 0xe00d, 0x117: 0x0008, 0x118: 0xe00d, 0x119: 0x0008, 0x11a: 0xe00d, 0x11b: 0x0008, 0x11c: 0xe00d, 0x11d: 0x0008, 0x11e: 0xe00d, 0x11f: 0x0008, 0x120: 0xe00d, 0x121: 0x0008, 0x122: 0xe00d, 0x123: 0x0008, 0x124: 0xe00d, 0x125: 0x0008, 0x126: 0xe00d, 0x127: 0x0008, 0x128: 0xe00d, 0x129: 0x0008, 0x12a: 0xe00d, 0x12b: 0x0008, 0x12c: 0xe00d, 0x12d: 0x0008, 0x12e: 0xe00d, 0x12f: 0x0008, 0x130: 0x0179, 0x131: 0x0008, 0x132: 0x0035, 0x133: 0x004d, 0x134: 0xe00d, 0x135: 0x0008, 0x136: 0xe00d, 0x137: 0x0008, 0x138: 0x0008, 0x139: 0xe01d, 0x13a: 0x0008, 0x13b: 0xe03d, 0x13c: 0x0008, 0x13d: 0xe01d, 0x13e: 0x0008, 0x13f: 0x0199, // Block 0x5, offset 0x140 0x140: 0x0199, 0x141: 0xe01d, 0x142: 0x0008, 0x143: 0xe03d, 0x144: 0x0008, 0x145: 0xe01d, 0x146: 0x0008, 0x147: 0xe07d, 0x148: 0x0008, 0x149: 0x01b9, 0x14a: 0xe00d, 0x14b: 0x0008, 0x14c: 0xe00d, 0x14d: 0x0008, 0x14e: 0xe00d, 0x14f: 0x0008, 0x150: 0xe00d, 0x151: 0x0008, 0x152: 0xe00d, 0x153: 0x0008, 0x154: 0xe00d, 0x155: 0x0008, 0x156: 0xe00d, 0x157: 0x0008, 0x158: 0xe00d, 0x159: 0x0008, 0x15a: 0xe00d, 0x15b: 0x0008, 0x15c: 0xe00d, 0x15d: 0x0008, 0x15e: 0xe00d, 0x15f: 0x0008, 0x160: 0xe00d, 0x161: 0x0008, 0x162: 0xe00d, 0x163: 0x0008, 0x164: 0xe00d, 0x165: 0x0008, 0x166: 0xe00d, 0x167: 0x0008, 0x168: 0xe00d, 0x169: 0x0008, 0x16a: 0xe00d, 0x16b: 0x0008, 0x16c: 0xe00d, 0x16d: 0x0008, 0x16e: 0xe00d, 0x16f: 0x0008, 0x170: 0xe00d, 0x171: 0x0008, 0x172: 0xe00d, 0x173: 0x0008, 0x174: 0xe00d, 0x175: 0x0008, 0x176: 0xe00d, 0x177: 0x0008, 0x178: 0x0065, 0x179: 0xe01d, 0x17a: 0x0008, 0x17b: 0xe03d, 0x17c: 0x0008, 0x17d: 0xe01d, 0x17e: 0x0008, 0x17f: 0x01d9, // Block 0x6, offset 0x180 0x180: 0x0008, 0x181: 0x007d, 0x182: 0xe00d, 0x183: 0x0008, 0x184: 0xe00d, 0x185: 0x0008, 0x186: 0x007d, 0x187: 0xe07d, 0x188: 0x0008, 0x189: 0x0095, 0x18a: 0x00ad, 0x18b: 0xe03d, 0x18c: 0x0008, 0x18d: 0x0008, 0x18e: 0x00c5, 0x18f: 0x00dd, 0x190: 0x00f5, 0x191: 0xe01d, 0x192: 0x0008, 0x193: 0x010d, 0x194: 0x0125, 0x195: 0x0008, 0x196: 0x013d, 0x197: 0x013d, 0x198: 0xe00d, 0x199: 0x0008, 0x19a: 0x0008, 0x19b: 0x0008, 0x19c: 0x010d, 0x19d: 0x0155, 0x19e: 0x0008, 0x19f: 0x016d, 0x1a0: 0xe00d, 0x1a1: 0x0008, 0x1a2: 0xe00d, 0x1a3: 0x0008, 0x1a4: 0xe00d, 0x1a5: 0x0008, 0x1a6: 0x0185, 0x1a7: 0xe07d, 0x1a8: 0x0008, 0x1a9: 0x019d, 0x1aa: 0x0008, 0x1ab: 0x0008, 0x1ac: 0xe00d, 0x1ad: 0x0008, 0x1ae: 0x0185, 0x1af: 0xe0fd, 0x1b0: 0x0008, 0x1b1: 0x01b5, 0x1b2: 0x01cd, 0x1b3: 0xe03d, 0x1b4: 0x0008, 0x1b5: 0xe01d, 0x1b6: 0x0008, 0x1b7: 0x01e5, 0x1b8: 0xe00d, 0x1b9: 0x0008, 0x1ba: 0x0008, 0x1bb: 0x0008, 0x1bc: 0xe00d, 0x1bd: 0x0008, 0x1be: 0x0008, 0x1bf: 0x0008, // Block 0x7, offset 0x1c0 0x1c0: 0x0008, 0x1c1: 0x0008, 0x1c2: 0x0008, 0x1c3: 0x0008, 0x1c4: 0x01e9, 0x1c5: 0x01e9, 0x1c6: 0x01e9, 0x1c7: 0x01fd, 0x1c8: 0x0215, 0x1c9: 0x022d, 0x1ca: 0x0245, 0x1cb: 0x025d, 0x1cc: 0x0275, 0x1cd: 0xe01d, 0x1ce: 0x0008, 0x1cf: 0xe0fd, 0x1d0: 0x0008, 0x1d1: 0xe01d, 0x1d2: 0x0008, 0x1d3: 0xe03d, 0x1d4: 0x0008, 0x1d5: 0xe01d, 0x1d6: 0x0008, 0x1d7: 0xe07d, 0x1d8: 0x0008, 0x1d9: 0xe01d, 0x1da: 0x0008, 0x1db: 0xe03d, 0x1dc: 0x0008, 0x1dd: 0x0008, 0x1de: 0xe00d, 0x1df: 0x0008, 0x1e0: 0xe00d, 0x1e1: 0x0008, 0x1e2: 0xe00d, 0x1e3: 0x0008, 0x1e4: 0xe00d, 0x1e5: 0x0008, 0x1e6: 0xe00d, 0x1e7: 0x0008, 0x1e8: 0xe00d, 0x1e9: 0x0008, 0x1ea: 0xe00d, 0x1eb: 0x0008, 0x1ec: 0xe00d, 0x1ed: 0x0008, 0x1ee: 0xe00d, 0x1ef: 0x0008, 0x1f0: 0x0008, 0x1f1: 0x028d, 0x1f2: 0x02a5, 0x1f3: 0x02bd, 0x1f4: 0xe00d, 0x1f5: 0x0008, 0x1f6: 0x02d5, 0x1f7: 0x02ed, 0x1f8: 0xe00d, 0x1f9: 0x0008, 0x1fa: 0xe00d, 0x1fb: 0x0008, 0x1fc: 0xe00d, 0x1fd: 0x0008, 0x1fe: 0xe00d, 0x1ff: 0x0008, // Block 0x8, offset 0x200 0x200: 0xe00d, 0x201: 0x0008, 0x202: 0xe00d, 0x203: 0x0008, 0x204: 0xe00d, 0x205: 0x0008, 0x206: 0xe00d, 0x207: 0x0008, 0x208: 0xe00d, 0x209: 0x0008, 0x20a: 0xe00d, 0x20b: 0x0008, 0x20c: 0xe00d, 0x20d: 0x0008, 0x20e: 0xe00d, 0x20f: 0x0008, 0x210: 0xe00d, 0x211: 0x0008, 0x212: 0xe00d, 0x213: 0x0008, 0x214: 0xe00d, 0x215: 0x0008, 0x216: 0xe00d, 0x217: 0x0008, 0x218: 0xe00d, 0x219: 0x0008, 0x21a: 0xe00d, 0x21b: 0x0008, 0x21c: 0xe00d, 0x21d: 0x0008, 0x21e: 0xe00d, 0x21f: 0x0008, 0x220: 0x0305, 0x221: 0x0008, 0x222: 0xe00d, 0x223: 0x0008, 0x224: 0xe00d, 0x225: 0x0008, 0x226: 0xe00d, 0x227: 0x0008, 0x228: 0xe00d, 0x229: 0x0008, 0x22a: 0xe00d, 0x22b: 0x0008, 0x22c: 0xe00d, 0x22d: 0x0008, 0x22e: 0xe00d, 0x22f: 0x0008, 0x230: 0xe00d, 0x231: 0x0008, 0x232: 0xe00d, 0x233: 0x0008, 0x234: 0x0008, 0x235: 0x0008, 0x236: 0x0008, 0x237: 0x0008, 0x238: 0x0008, 0x239: 0x0008, 0x23a: 0x0209, 0x23b: 0xe03d, 0x23c: 0x0008, 0x23d: 0x031d, 0x23e: 0x0229, 0x23f: 0x0008, // Block 0x9, offset 0x240 0x240: 0x0008, 0x241: 0x0008, 0x242: 0x0018, 0x243: 0x0018, 0x244: 0x0018, 0x245: 0x0018, 0x246: 0x0008, 0x247: 0x0008, 0x248: 0x0008, 0x249: 0x0008, 0x24a: 0x0008, 0x24b: 0x0008, 0x24c: 0x0008, 0x24d: 0x0008, 0x24e: 0x0008, 0x24f: 0x0008, 0x250: 0x0008, 0x251: 0x0008, 0x252: 0x0018, 0x253: 0x0018, 0x254: 0x0018, 0x255: 0x0018, 0x256: 0x0018, 0x257: 0x0018, 0x258: 0x029a, 0x259: 0x02ba, 0x25a: 0x02da, 0x25b: 0x02fa, 0x25c: 0x031a, 0x25d: 0x033a, 0x25e: 0x0018, 0x25f: 0x0018, 0x260: 0x03ad, 0x261: 0x0359, 0x262: 0x01d9, 0x263: 0x0369, 0x264: 0x03c5, 0x265: 0x0018, 0x266: 0x0018, 0x267: 0x0018, 0x268: 0x0018, 0x269: 0x0018, 0x26a: 0x0018, 0x26b: 0x0018, 0x26c: 0x0008, 0x26d: 0x0018, 0x26e: 0x0008, 0x26f: 0x0018, 0x270: 0x0018, 0x271: 0x0018, 0x272: 0x0018, 0x273: 0x0018, 0x274: 0x0018, 0x275: 0x0018, 0x276: 0x0018, 0x277: 0x0018, 0x278: 0x0018, 0x279: 0x0018, 0x27a: 0x0018, 0x27b: 0x0018, 0x27c: 0x0018, 0x27d: 0x0018, 0x27e: 0x0018, 0x27f: 0x0018, // Block 0xa, offset 0x280 0x280: 0x03dd, 0x281: 0x03dd, 0x282: 0x3308, 0x283: 0x03f5, 0x284: 0x0379, 0x285: 0x040d, 0x286: 0x3308, 0x287: 0x3308, 0x288: 0x3308, 0x289: 0x3308, 0x28a: 0x3308, 0x28b: 0x3308, 0x28c: 0x3308, 0x28d: 0x3308, 0x28e: 0x3308, 0x28f: 0x33c0, 0x290: 0x3308, 0x291: 0x3308, 0x292: 0x3308, 0x293: 0x3308, 0x294: 0x3308, 0x295: 0x3308, 0x296: 0x3308, 0x297: 0x3308, 0x298: 0x3308, 0x299: 0x3308, 0x29a: 0x3308, 0x29b: 0x3308, 0x29c: 0x3308, 0x29d: 0x3308, 0x29e: 0x3308, 0x29f: 0x3308, 0x2a0: 0x3308, 0x2a1: 0x3308, 0x2a2: 0x3308, 0x2a3: 0x3308, 0x2a4: 0x3308, 0x2a5: 0x3308, 0x2a6: 0x3308, 0x2a7: 0x3308, 0x2a8: 0x3308, 0x2a9: 0x3308, 0x2aa: 0x3308, 0x2ab: 0x3308, 0x2ac: 0x3308, 0x2ad: 0x3308, 0x2ae: 0x3308, 0x2af: 0x3308, 0x2b0: 0xe00d, 0x2b1: 0x0008, 0x2b2: 0xe00d, 0x2b3: 0x0008, 0x2b4: 0x0425, 0x2b5: 0x0008, 0x2b6: 0xe00d, 0x2b7: 0x0008, 0x2b8: 0x0040, 0x2b9: 0x0040, 0x2ba: 0x03a2, 0x2bb: 0x0008, 0x2bc: 0x0008, 0x2bd: 0x0008, 0x2be: 0x03c2, 0x2bf: 0x043d, // Block 0xb, offset 0x2c0 0x2c0: 0x0040, 0x2c1: 0x0040, 0x2c2: 0x0040, 0x2c3: 0x0040, 0x2c4: 0x008a, 0x2c5: 0x03d2, 0x2c6: 0xe155, 0x2c7: 0x0455, 0x2c8: 0xe12d, 0x2c9: 0xe13d, 0x2ca: 0xe12d, 0x2cb: 0x0040, 0x2cc: 0x03dd, 0x2cd: 0x0040, 0x2ce: 0x046d, 0x2cf: 0x0485, 0x2d0: 0x0008, 0x2d1: 0xe105, 0x2d2: 0xe105, 0x2d3: 0xe105, 0x2d4: 0xe105, 0x2d5: 0xe105, 0x2d6: 0xe105, 0x2d7: 0xe105, 0x2d8: 0xe105, 0x2d9: 0xe105, 0x2da: 0xe105, 0x2db: 0xe105, 0x2dc: 0xe105, 0x2dd: 0xe105, 0x2de: 0xe105, 0x2df: 0xe105, 0x2e0: 0x049d, 0x2e1: 0x049d, 0x2e2: 0x0040, 0x2e3: 0x049d, 0x2e4: 0x049d, 0x2e5: 0x049d, 0x2e6: 0x049d, 0x2e7: 0x049d, 0x2e8: 0x049d, 0x2e9: 0x049d, 0x2ea: 0x049d, 0x2eb: 0x049d, 0x2ec: 0x0008, 0x2ed: 0x0008, 0x2ee: 0x0008, 0x2ef: 0x0008, 0x2f0: 0x0008, 0x2f1: 0x0008, 0x2f2: 0x0008, 0x2f3: 0x0008, 0x2f4: 0x0008, 0x2f5: 0x0008, 0x2f6: 0x0008, 0x2f7: 0x0008, 0x2f8: 0x0008, 0x2f9: 0x0008, 0x2fa: 0x0008, 0x2fb: 0x0008, 0x2fc: 0x0008, 0x2fd: 0x0008, 0x2fe: 0x0008, 0x2ff: 0x0008, // Block 0xc, offset 0x300 0x300: 0x0008, 0x301: 0x0008, 0x302: 0xe00f, 0x303: 0x0008, 0x304: 0x0008, 0x305: 0x0008, 0x306: 0x0008, 0x307: 0x0008, 0x308: 0x0008, 0x309: 0x0008, 0x30a: 0x0008, 0x30b: 0x0008, 0x30c: 0x0008, 0x30d: 0x0008, 0x30e: 0x0008, 0x30f: 0xe0c5, 0x310: 0x04b5, 0x311: 0x04cd, 0x312: 0xe0bd, 0x313: 0xe0f5, 0x314: 0xe0fd, 0x315: 0xe09d, 0x316: 0xe0b5, 0x317: 0x0008, 0x318: 0xe00d, 0x319: 0x0008, 0x31a: 0xe00d, 0x31b: 0x0008, 0x31c: 0xe00d, 0x31d: 0x0008, 0x31e: 0xe00d, 0x31f: 0x0008, 0x320: 0xe00d, 0x321: 0x0008, 0x322: 0xe00d, 0x323: 0x0008, 0x324: 0xe00d, 0x325: 0x0008, 0x326: 0xe00d, 0x327: 0x0008, 0x328: 0xe00d, 0x329: 0x0008, 0x32a: 0xe00d, 0x32b: 0x0008, 0x32c: 0xe00d, 0x32d: 0x0008, 0x32e: 0xe00d, 0x32f: 0x0008, 0x330: 0x04e5, 0x331: 0xe185, 0x332: 0xe18d, 0x333: 0x0008, 0x334: 0x04fd, 0x335: 0x03dd, 0x336: 0x0018, 0x337: 0xe07d, 0x338: 0x0008, 0x339: 0xe1d5, 0x33a: 0xe00d, 0x33b: 0x0008, 0x33c: 0x0008, 0x33d: 0x0515, 0x33e: 0x052d, 0x33f: 0x052d, // Block 0xd, offset 0x340 0x340: 0x0008, 0x341: 0x0008, 0x342: 0x0008, 0x343: 0x0008, 0x344: 0x0008, 0x345: 0x0008, 0x346: 0x0008, 0x347: 0x0008, 0x348: 0x0008, 0x349: 0x0008, 0x34a: 0x0008, 0x34b: 0x0008, 0x34c: 0x0008, 0x34d: 0x0008, 0x34e: 0x0008, 0x34f: 0x0008, 0x350: 0x0008, 0x351: 0x0008, 0x352: 0x0008, 0x353: 0x0008, 0x354: 0x0008, 0x355: 0x0008, 0x356: 0x0008, 0x357: 0x0008, 0x358: 0x0008, 0x359: 0x0008, 0x35a: 0x0008, 0x35b: 0x0008, 0x35c: 0x0008, 0x35d: 0x0008, 0x35e: 0x0008, 0x35f: 0x0008, 0x360: 0xe00d, 0x361: 0x0008, 0x362: 0xe00d, 0x363: 0x0008, 0x364: 0xe00d, 0x365: 0x0008, 0x366: 0xe00d, 0x367: 0x0008, 0x368: 0xe00d, 0x369: 0x0008, 0x36a: 0xe00d, 0x36b: 0x0008, 0x36c: 0xe00d, 0x36d: 0x0008, 0x36e: 0xe00d, 0x36f: 0x0008, 0x370: 0xe00d, 0x371: 0x0008, 0x372: 0xe00d, 0x373: 0x0008, 0x374: 0xe00d, 0x375: 0x0008, 0x376: 0xe00d, 0x377: 0x0008, 0x378: 0xe00d, 0x379: 0x0008, 0x37a: 0xe00d, 0x37b: 0x0008, 0x37c: 0xe00d, 0x37d: 0x0008, 0x37e: 0xe00d, 0x37f: 0x0008, // Block 0xe, offset 0x380 0x380: 0xe00d, 0x381: 0x0008, 0x382: 0x0018, 0x383: 0x3308, 0x384: 0x3308, 0x385: 0x3308, 0x386: 0x3308, 0x387: 0x3308, 0x388: 0x3318, 0x389: 0x3318, 0x38a: 0xe00d, 0x38b: 0x0008, 0x38c: 0xe00d, 0x38d: 0x0008, 0x38e: 0xe00d, 0x38f: 0x0008, 0x390: 0xe00d, 0x391: 0x0008, 0x392: 0xe00d, 0x393: 0x0008, 0x394: 0xe00d, 0x395: 0x0008, 0x396: 0xe00d, 0x397: 0x0008, 0x398: 0xe00d, 0x399: 0x0008, 0x39a: 0xe00d, 0x39b: 0x0008, 0x39c: 0xe00d, 0x39d: 0x0008, 0x39e: 0xe00d, 0x39f: 0x0008, 0x3a0: 0xe00d, 0x3a1: 0x0008, 0x3a2: 0xe00d, 0x3a3: 0x0008, 0x3a4: 0xe00d, 0x3a5: 0x0008, 0x3a6: 0xe00d, 0x3a7: 0x0008, 0x3a8: 0xe00d, 0x3a9: 0x0008, 0x3aa: 0xe00d, 0x3ab: 0x0008, 0x3ac: 0xe00d, 0x3ad: 0x0008, 0x3ae: 0xe00d, 0x3af: 0x0008, 0x3b0: 0xe00d, 0x3b1: 0x0008, 0x3b2: 0xe00d, 0x3b3: 0x0008, 0x3b4: 0xe00d, 0x3b5: 0x0008, 0x3b6: 0xe00d, 0x3b7: 0x0008, 0x3b8: 0xe00d, 0x3b9: 0x0008, 0x3ba: 0xe00d, 0x3bb: 0x0008, 0x3bc: 0xe00d, 0x3bd: 0x0008, 0x3be: 0xe00d, 0x3bf: 0x0008, // Block 0xf, offset 0x3c0 0x3c0: 0x0040, 0x3c1: 0xe01d, 0x3c2: 0x0008, 0x3c3: 0xe03d, 0x3c4: 0x0008, 0x3c5: 0xe01d, 0x3c6: 0x0008, 0x3c7: 0xe07d, 0x3c8: 0x0008, 0x3c9: 0xe01d, 0x3ca: 0x0008, 0x3cb: 0xe03d, 0x3cc: 0x0008, 0x3cd: 0xe01d, 0x3ce: 0x0008, 0x3cf: 0x0008, 0x3d0: 0xe00d, 0x3d1: 0x0008, 0x3d2: 0xe00d, 0x3d3: 0x0008, 0x3d4: 0xe00d, 0x3d5: 0x0008, 0x3d6: 0xe00d, 0x3d7: 0x0008, 0x3d8: 0xe00d, 0x3d9: 0x0008, 0x3da: 0xe00d, 0x3db: 0x0008, 0x3dc: 0xe00d, 0x3dd: 0x0008, 0x3de: 0xe00d, 0x3df: 0x0008, 0x3e0: 0xe00d, 0x3e1: 0x0008, 0x3e2: 0xe00d, 0x3e3: 0x0008, 0x3e4: 0xe00d, 0x3e5: 0x0008, 0x3e6: 0xe00d, 0x3e7: 0x0008, 0x3e8: 0xe00d, 0x3e9: 0x0008, 0x3ea: 0xe00d, 0x3eb: 0x0008, 0x3ec: 0xe00d, 0x3ed: 0x0008, 0x3ee: 0xe00d, 0x3ef: 0x0008, 0x3f0: 0xe00d, 0x3f1: 0x0008, 0x3f2: 0xe00d, 0x3f3: 0x0008, 0x3f4: 0xe00d, 0x3f5: 0x0008, 0x3f6: 0xe00d, 0x3f7: 0x0008, 0x3f8: 0xe00d, 0x3f9: 0x0008, 0x3fa: 0xe00d, 0x3fb: 0x0008, 0x3fc: 0xe00d, 0x3fd: 0x0008, 0x3fe: 0xe00d, 0x3ff: 0x0008, // Block 0x10, offset 0x400 0x400: 0xe00d, 0x401: 0x0008, 0x402: 0xe00d, 0x403: 0x0008, 0x404: 0xe00d, 0x405: 0x0008, 0x406: 0xe00d, 0x407: 0x0008, 0x408: 0xe00d, 0x409: 0x0008, 0x40a: 0xe00d, 0x40b: 0x0008, 0x40c: 0xe00d, 0x40d: 0x0008, 0x40e: 0xe00d, 0x40f: 0x0008, 0x410: 0xe00d, 0x411: 0x0008, 0x412: 0xe00d, 0x413: 0x0008, 0x414: 0xe00d, 0x415: 0x0008, 0x416: 0xe00d, 0x417: 0x0008, 0x418: 0xe00d, 0x419: 0x0008, 0x41a: 0xe00d, 0x41b: 0x0008, 0x41c: 0xe00d, 0x41d: 0x0008, 0x41e: 0xe00d, 0x41f: 0x0008, 0x420: 0xe00d, 0x421: 0x0008, 0x422: 0xe00d, 0x423: 0x0008, 0x424: 0xe00d, 0x425: 0x0008, 0x426: 0xe00d, 0x427: 0x0008, 0x428: 0xe00d, 0x429: 0x0008, 0x42a: 0xe00d, 0x42b: 0x0008, 0x42c: 0xe00d, 0x42d: 0x0008, 0x42e: 0xe00d, 0x42f: 0x0008, 0x430: 0x0040, 0x431: 0x03f5, 0x432: 0x03f5, 0x433: 0x03f5, 0x434: 0x03f5, 0x435: 0x03f5, 0x436: 0x03f5, 0x437: 0x03f5, 0x438: 0x03f5, 0x439: 0x03f5, 0x43a: 0x03f5, 0x43b: 0x03f5, 0x43c: 0x03f5, 0x43d: 0x03f5, 0x43e: 0x03f5, 0x43f: 0x03f5, // Block 0x11, offset 0x440 0x440: 0x0840, 0x441: 0x0840, 0x442: 0x0840, 0x443: 0x0840, 0x444: 0x0840, 0x445: 0x0840, 0x446: 0x0018, 0x447: 0x0018, 0x448: 0x0818, 0x449: 0x0018, 0x44a: 0x0018, 0x44b: 0x0818, 0x44c: 0x0018, 0x44d: 0x0818, 0x44e: 0x0018, 0x44f: 0x0018, 0x450: 0x3308, 0x451: 0x3308, 0x452: 0x3308, 0x453: 0x3308, 0x454: 0x3308, 0x455: 0x3308, 0x456: 0x3308, 0x457: 0x3308, 0x458: 0x3308, 0x459: 0x3308, 0x45a: 0x3308, 0x45b: 0x0818, 0x45c: 0x0b40, 0x45d: 0x0040, 0x45e: 0x0818, 0x45f: 0x0818, 0x460: 0x0a08, 0x461: 0x0808, 0x462: 0x0c08, 0x463: 0x0c08, 0x464: 0x0c08, 0x465: 0x0c08, 0x466: 0x0a08, 0x467: 0x0c08, 0x468: 0x0a08, 0x469: 0x0c08, 0x46a: 0x0a08, 0x46b: 0x0a08, 0x46c: 0x0a08, 0x46d: 0x0a08, 0x46e: 0x0a08, 0x46f: 0x0c08, 0x470: 0x0c08, 0x471: 0x0c08, 0x472: 0x0c08, 0x473: 0x0a08, 0x474: 0x0a08, 0x475: 0x0a08, 0x476: 0x0a08, 0x477: 0x0a08, 0x478: 0x0a08, 0x479: 0x0a08, 0x47a: 0x0a08, 0x47b: 0x0a08, 0x47c: 0x0a08, 0x47d: 0x0a08, 0x47e: 0x0a08, 0x47f: 0x0a08, // Block 0x12, offset 0x480 0x480: 0x0818, 0x481: 0x0a08, 0x482: 0x0a08, 0x483: 0x0a08, 0x484: 0x0a08, 0x485: 0x0a08, 0x486: 0x0a08, 0x487: 0x0a08, 0x488: 0x0c08, 0x489: 0x0a08, 0x48a: 0x0a08, 0x48b: 0x3308, 0x48c: 0x3308, 0x48d: 0x3308, 0x48e: 0x3308, 0x48f: 0x3308, 0x490: 0x3308, 0x491: 0x3308, 0x492: 0x3308, 0x493: 0x3308, 0x494: 0x3308, 0x495: 0x3308, 0x496: 0x3308, 0x497: 0x3308, 0x498: 0x3308, 0x499: 0x3308, 0x49a: 0x3308, 0x49b: 0x3308, 0x49c: 0x3308, 0x49d: 0x3308, 0x49e: 0x3308, 0x49f: 0x3308, 0x4a0: 0x0808, 0x4a1: 0x0808, 0x4a2: 0x0808, 0x4a3: 0x0808, 0x4a4: 0x0808, 0x4a5: 0x0808, 0x4a6: 0x0808, 0x4a7: 0x0808, 0x4a8: 0x0808, 0x4a9: 0x0808, 0x4aa: 0x0018, 0x4ab: 0x0818, 0x4ac: 0x0818, 0x4ad: 0x0818, 0x4ae: 0x0a08, 0x4af: 0x0a08, 0x4b0: 0x3308, 0x4b1: 0x0c08, 0x4b2: 0x0c08, 0x4b3: 0x0c08, 0x4b4: 0x0808, 0x4b5: 0x0429, 0x4b6: 0x0451, 0x4b7: 0x0479, 0x4b8: 0x04a1, 0x4b9: 0x0a08, 0x4ba: 0x0a08, 0x4bb: 0x0a08, 0x4bc: 0x0a08, 0x4bd: 0x0a08, 0x4be: 0x0a08, 0x4bf: 0x0a08, // Block 0x13, offset 0x4c0 0x4c0: 0x0c08, 0x4c1: 0x0a08, 0x4c2: 0x0a08, 0x4c3: 0x0c08, 0x4c4: 0x0c08, 0x4c5: 0x0c08, 0x4c6: 0x0c08, 0x4c7: 0x0c08, 0x4c8: 0x0c08, 0x4c9: 0x0c08, 0x4ca: 0x0c08, 0x4cb: 0x0c08, 0x4cc: 0x0a08, 0x4cd: 0x0c08, 0x4ce: 0x0a08, 0x4cf: 0x0c08, 0x4d0: 0x0a08, 0x4d1: 0x0a08, 0x4d2: 0x0c08, 0x4d3: 0x0c08, 0x4d4: 0x0818, 0x4d5: 0x0c08, 0x4d6: 0x3308, 0x4d7: 0x3308, 0x4d8: 0x3308, 0x4d9: 0x3308, 0x4da: 0x3308, 0x4db: 0x3308, 0x4dc: 0x3308, 0x4dd: 0x0840, 0x4de: 0x0018, 0x4df: 0x3308, 0x4e0: 0x3308, 0x4e1: 0x3308, 0x4e2: 0x3308, 0x4e3: 0x3308, 0x4e4: 0x3308, 0x4e5: 0x0808, 0x4e6: 0x0808, 0x4e7: 0x3308, 0x4e8: 0x3308, 0x4e9: 0x0018, 0x4ea: 0x3308, 0x4eb: 0x3308, 0x4ec: 0x3308, 0x4ed: 0x3308, 0x4ee: 0x0c08, 0x4ef: 0x0c08, 0x4f0: 0x0008, 0x4f1: 0x0008, 0x4f2: 0x0008, 0x4f3: 0x0008, 0x4f4: 0x0008, 0x4f5: 0x0008, 0x4f6: 0x0008, 0x4f7: 0x0008, 0x4f8: 0x0008, 0x4f9: 0x0008, 0x4fa: 0x0a08, 0x4fb: 0x0a08, 0x4fc: 0x0a08, 0x4fd: 0x0808, 0x4fe: 0x0808, 0x4ff: 0x0a08, // Block 0x14, offset 0x500 0x500: 0x0818, 0x501: 0x0818, 0x502: 0x0818, 0x503: 0x0818, 0x504: 0x0818, 0x505: 0x0818, 0x506: 0x0818, 0x507: 0x0818, 0x508: 0x0818, 0x509: 0x0818, 0x50a: 0x0818, 0x50b: 0x0818, 0x50c: 0x0818, 0x50d: 0x0818, 0x50e: 0x0040, 0x50f: 0x0b40, 0x510: 0x0c08, 0x511: 0x3308, 0x512: 0x0a08, 0x513: 0x0a08, 0x514: 0x0a08, 0x515: 0x0c08, 0x516: 0x0c08, 0x517: 0x0c08, 0x518: 0x0c08, 0x519: 0x0c08, 0x51a: 0x0a08, 0x51b: 0x0a08, 0x51c: 0x0a08, 0x51d: 0x0a08, 0x51e: 0x0c08, 0x51f: 0x0a08, 0x520: 0x0a08, 0x521: 0x0a08, 0x522: 0x0a08, 0x523: 0x0a08, 0x524: 0x0a08, 0x525: 0x0a08, 0x526: 0x0a08, 0x527: 0x0a08, 0x528: 0x0c08, 0x529: 0x0a08, 0x52a: 0x0c08, 0x52b: 0x0a08, 0x52c: 0x0c08, 0x52d: 0x0a08, 0x52e: 0x0a08, 0x52f: 0x0c08, 0x530: 0x3308, 0x531: 0x3308, 0x532: 0x3308, 0x533: 0x3308, 0x534: 0x3308, 0x535: 0x3308, 0x536: 0x3308, 0x537: 0x3308, 0x538: 0x3308, 0x539: 0x3308, 0x53a: 0x3308, 0x53b: 0x3308, 0x53c: 0x3308, 0x53d: 0x3308, 0x53e: 0x3308, 0x53f: 0x3308, // Block 0x15, offset 0x540 0x540: 0x0c08, 0x541: 0x0a08, 0x542: 0x0a08, 0x543: 0x0a08, 0x544: 0x0a08, 0x545: 0x0a08, 0x546: 0x0c08, 0x547: 0x0c08, 0x548: 0x0a08, 0x549: 0x0c08, 0x54a: 0x0a08, 0x54b: 0x0a08, 0x54c: 0x0a08, 0x54d: 0x0a08, 0x54e: 0x0a08, 0x54f: 0x0a08, 0x550: 0x0a08, 0x551: 0x0a08, 0x552: 0x0a08, 0x553: 0x0a08, 0x554: 0x0c08, 0x555: 0x0a08, 0x556: 0x0808, 0x557: 0x0808, 0x558: 0x0808, 0x559: 0x3308, 0x55a: 0x3308, 0x55b: 0x3308, 0x55c: 0x0040, 0x55d: 0x0040, 0x55e: 0x0818, 0x55f: 0x0040, 0x560: 0x0a08, 0x561: 0x0808, 0x562: 0x0a08, 0x563: 0x0a08, 0x564: 0x0a08, 0x565: 0x0a08, 0x566: 0x0808, 0x567: 0x0c08, 0x568: 0x0a08, 0x569: 0x0c08, 0x56a: 0x0c08, 0x56b: 0x0040, 0x56c: 0x0040, 0x56d: 0x0040, 0x56e: 0x0040, 0x56f: 0x0040, 0x570: 0x0040, 0x571: 0x0040, 0x572: 0x0040, 0x573: 0x0040, 0x574: 0x0040, 0x575: 0x0040, 0x576: 0x0040, 0x577: 0x0040, 0x578: 0x0040, 0x579: 0x0040, 0x57a: 0x0040, 0x57b: 0x0040, 0x57c: 0x0040, 0x57d: 0x0040, 0x57e: 0x0040, 0x57f: 0x0040, // Block 0x16, offset 0x580 0x580: 0x3008, 0x581: 0x3308, 0x582: 0x3308, 0x583: 0x3308, 0x584: 0x3308, 0x585: 0x3308, 0x586: 0x3308, 0x587: 0x3308, 0x588: 0x3308, 0x589: 0x3008, 0x58a: 0x3008, 0x58b: 0x3008, 0x58c: 0x3008, 0x58d: 0x3b08, 0x58e: 0x3008, 0x58f: 0x3008, 0x590: 0x0008, 0x591: 0x3308, 0x592: 0x3308, 0x593: 0x3308, 0x594: 0x3308, 0x595: 0x3308, 0x596: 0x3308, 0x597: 0x3308, 0x598: 0x04c9, 0x599: 0x0501, 0x59a: 0x0539, 0x59b: 0x0571, 0x59c: 0x05a9, 0x59d: 0x05e1, 0x59e: 0x0619, 0x59f: 0x0651, 0x5a0: 0x0008, 0x5a1: 0x0008, 0x5a2: 0x3308, 0x5a3: 0x3308, 0x5a4: 0x0018, 0x5a5: 0x0018, 0x5a6: 0x0008, 0x5a7: 0x0008, 0x5a8: 0x0008, 0x5a9: 0x0008, 0x5aa: 0x0008, 0x5ab: 0x0008, 0x5ac: 0x0008, 0x5ad: 0x0008, 0x5ae: 0x0008, 0x5af: 0x0008, 0x5b0: 0x0018, 0x5b1: 0x0008, 0x5b2: 0x0008, 0x5b3: 0x0008, 0x5b4: 0x0008, 0x5b5: 0x0008, 0x5b6: 0x0008, 0x5b7: 0x0008, 0x5b8: 0x0008, 0x5b9: 0x0008, 0x5ba: 0x0008, 0x5bb: 0x0008, 0x5bc: 0x0008, 0x5bd: 0x0008, 0x5be: 0x0008, 0x5bf: 0x0008, // Block 0x17, offset 0x5c0 0x5c0: 0x0008, 0x5c1: 0x3308, 0x5c2: 0x3008, 0x5c3: 0x3008, 0x5c4: 0x0040, 0x5c5: 0x0008, 0x5c6: 0x0008, 0x5c7: 0x0008, 0x5c8: 0x0008, 0x5c9: 0x0008, 0x5ca: 0x0008, 0x5cb: 0x0008, 0x5cc: 0x0008, 0x5cd: 0x0040, 0x5ce: 0x0040, 0x5cf: 0x0008, 0x5d0: 0x0008, 0x5d1: 0x0040, 0x5d2: 0x0040, 0x5d3: 0x0008, 0x5d4: 0x0008, 0x5d5: 0x0008, 0x5d6: 0x0008, 0x5d7: 0x0008, 0x5d8: 0x0008, 0x5d9: 0x0008, 0x5da: 0x0008, 0x5db: 0x0008, 0x5dc: 0x0008, 0x5dd: 0x0008, 0x5de: 0x0008, 0x5df: 0x0008, 0x5e0: 0x0008, 0x5e1: 0x0008, 0x5e2: 0x0008, 0x5e3: 0x0008, 0x5e4: 0x0008, 0x5e5: 0x0008, 0x5e6: 0x0008, 0x5e7: 0x0008, 0x5e8: 0x0008, 0x5e9: 0x0040, 0x5ea: 0x0008, 0x5eb: 0x0008, 0x5ec: 0x0008, 0x5ed: 0x0008, 0x5ee: 0x0008, 0x5ef: 0x0008, 0x5f0: 0x0008, 0x5f1: 0x0040, 0x5f2: 0x0008, 0x5f3: 0x0040, 0x5f4: 0x0040, 0x5f5: 0x0040, 0x5f6: 0x0008, 0x5f7: 0x0008, 0x5f8: 0x0008, 0x5f9: 0x0008, 0x5fa: 0x0040, 0x5fb: 0x0040, 0x5fc: 0x3308, 0x5fd: 0x0008, 0x5fe: 0x3008, 0x5ff: 0x3008, // Block 0x18, offset 0x600 0x600: 0x3008, 0x601: 0x3308, 0x602: 0x3308, 0x603: 0x3308, 0x604: 0x3308, 0x605: 0x0040, 0x606: 0x0040, 0x607: 0x3008, 0x608: 0x3008, 0x609: 0x0040, 0x60a: 0x0040, 0x60b: 0x3008, 0x60c: 0x3008, 0x60d: 0x3b08, 0x60e: 0x0008, 0x60f: 0x0040, 0x610: 0x0040, 0x611: 0x0040, 0x612: 0x0040, 0x613: 0x0040, 0x614: 0x0040, 0x615: 0x0040, 0x616: 0x0040, 0x617: 0x3008, 0x618: 0x0040, 0x619: 0x0040, 0x61a: 0x0040, 0x61b: 0x0040, 0x61c: 0x0689, 0x61d: 0x06c1, 0x61e: 0x0040, 0x61f: 0x06f9, 0x620: 0x0008, 0x621: 0x0008, 0x622: 0x3308, 0x623: 0x3308, 0x624: 0x0040, 0x625: 0x0040, 0x626: 0x0008, 0x627: 0x0008, 0x628: 0x0008, 0x629: 0x0008, 0x62a: 0x0008, 0x62b: 0x0008, 0x62c: 0x0008, 0x62d: 0x0008, 0x62e: 0x0008, 0x62f: 0x0008, 0x630: 0x0008, 0x631: 0x0008, 0x632: 0x0018, 0x633: 0x0018, 0x634: 0x0018, 0x635: 0x0018, 0x636: 0x0018, 0x637: 0x0018, 0x638: 0x0018, 0x639: 0x0018, 0x63a: 0x0018, 0x63b: 0x0018, 0x63c: 0x0008, 0x63d: 0x0018, 0x63e: 0x3308, 0x63f: 0x0040, // Block 0x19, offset 0x640 0x640: 0x0040, 0x641: 0x3308, 0x642: 0x3308, 0x643: 0x3008, 0x644: 0x0040, 0x645: 0x0008, 0x646: 0x0008, 0x647: 0x0008, 0x648: 0x0008, 0x649: 0x0008, 0x64a: 0x0008, 0x64b: 0x0040, 0x64c: 0x0040, 0x64d: 0x0040, 0x64e: 0x0040, 0x64f: 0x0008, 0x650: 0x0008, 0x651: 0x0040, 0x652: 0x0040, 0x653: 0x0008, 0x654: 0x0008, 0x655: 0x0008, 0x656: 0x0008, 0x657: 0x0008, 0x658: 0x0008, 0x659: 0x0008, 0x65a: 0x0008, 0x65b: 0x0008, 0x65c: 0x0008, 0x65d: 0x0008, 0x65e: 0x0008, 0x65f: 0x0008, 0x660: 0x0008, 0x661: 0x0008, 0x662: 0x0008, 0x663: 0x0008, 0x664: 0x0008, 0x665: 0x0008, 0x666: 0x0008, 0x667: 0x0008, 0x668: 0x0008, 0x669: 0x0040, 0x66a: 0x0008, 0x66b: 0x0008, 0x66c: 0x0008, 0x66d: 0x0008, 0x66e: 0x0008, 0x66f: 0x0008, 0x670: 0x0008, 0x671: 0x0040, 0x672: 0x0008, 0x673: 0x0731, 0x674: 0x0040, 0x675: 0x0008, 0x676: 0x0769, 0x677: 0x0040, 0x678: 0x0008, 0x679: 0x0008, 0x67a: 0x0040, 0x67b: 0x0040, 0x67c: 0x3308, 0x67d: 0x0040, 0x67e: 0x3008, 0x67f: 0x3008, // Block 0x1a, offset 0x680 0x680: 0x3008, 0x681: 0x3308, 0x682: 0x3308, 0x683: 0x0040, 0x684: 0x0040, 0x685: 0x0040, 0x686: 0x0040, 0x687: 0x3308, 0x688: 0x3308, 0x689: 0x0040, 0x68a: 0x0040, 0x68b: 0x3308, 0x68c: 0x3308, 0x68d: 0x3b08, 0x68e: 0x0040, 0x68f: 0x0040, 0x690: 0x0040, 0x691: 0x3308, 0x692: 0x0040, 0x693: 0x0040, 0x694: 0x0040, 0x695: 0x0040, 0x696: 0x0040, 0x697: 0x0040, 0x698: 0x0040, 0x699: 0x07a1, 0x69a: 0x07d9, 0x69b: 0x0811, 0x69c: 0x0008, 0x69d: 0x0040, 0x69e: 0x0849, 0x69f: 0x0040, 0x6a0: 0x0040, 0x6a1: 0x0040, 0x6a2: 0x0040, 0x6a3: 0x0040, 0x6a4: 0x0040, 0x6a5: 0x0040, 0x6a6: 0x0008, 0x6a7: 0x0008, 0x6a8: 0x0008, 0x6a9: 0x0008, 0x6aa: 0x0008, 0x6ab: 0x0008, 0x6ac: 0x0008, 0x6ad: 0x0008, 0x6ae: 0x0008, 0x6af: 0x0008, 0x6b0: 0x3308, 0x6b1: 0x3308, 0x6b2: 0x0008, 0x6b3: 0x0008, 0x6b4: 0x0008, 0x6b5: 0x3308, 0x6b6: 0x0018, 0x6b7: 0x0040, 0x6b8: 0x0040, 0x6b9: 0x0040, 0x6ba: 0x0040, 0x6bb: 0x0040, 0x6bc: 0x0040, 0x6bd: 0x0040, 0x6be: 0x0040, 0x6bf: 0x0040, // Block 0x1b, offset 0x6c0 0x6c0: 0x0040, 0x6c1: 0x3308, 0x6c2: 0x3308, 0x6c3: 0x3008, 0x6c4: 0x0040, 0x6c5: 0x0008, 0x6c6: 0x0008, 0x6c7: 0x0008, 0x6c8: 0x0008, 0x6c9: 0x0008, 0x6ca: 0x0008, 0x6cb: 0x0008, 0x6cc: 0x0008, 0x6cd: 0x0008, 0x6ce: 0x0040, 0x6cf: 0x0008, 0x6d0: 0x0008, 0x6d1: 0x0008, 0x6d2: 0x0040, 0x6d3: 0x0008, 0x6d4: 0x0008, 0x6d5: 0x0008, 0x6d6: 0x0008, 0x6d7: 0x0008, 0x6d8: 0x0008, 0x6d9: 0x0008, 0x6da: 0x0008, 0x6db: 0x0008, 0x6dc: 0x0008, 0x6dd: 0x0008, 0x6de: 0x0008, 0x6df: 0x0008, 0x6e0: 0x0008, 0x6e1: 0x0008, 0x6e2: 0x0008, 0x6e3: 0x0008, 0x6e4: 0x0008, 0x6e5: 0x0008, 0x6e6: 0x0008, 0x6e7: 0x0008, 0x6e8: 0x0008, 0x6e9: 0x0040, 0x6ea: 0x0008, 0x6eb: 0x0008, 0x6ec: 0x0008, 0x6ed: 0x0008, 0x6ee: 0x0008, 0x6ef: 0x0008, 0x6f0: 0x0008, 0x6f1: 0x0040, 0x6f2: 0x0008, 0x6f3: 0x0008, 0x6f4: 0x0040, 0x6f5: 0x0008, 0x6f6: 0x0008, 0x6f7: 0x0008, 0x6f8: 0x0008, 0x6f9: 0x0008, 0x6fa: 0x0040, 0x6fb: 0x0040, 0x6fc: 0x3308, 0x6fd: 0x0008, 0x6fe: 0x3008, 0x6ff: 0x3008, // Block 0x1c, offset 0x700 0x700: 0x3008, 0x701: 0x3308, 0x702: 0x3308, 0x703: 0x3308, 0x704: 0x3308, 0x705: 0x3308, 0x706: 0x0040, 0x707: 0x3308, 0x708: 0x3308, 0x709: 0x3008, 0x70a: 0x0040, 0x70b: 0x3008, 0x70c: 0x3008, 0x70d: 0x3b08, 0x70e: 0x0040, 0x70f: 0x0040, 0x710: 0x0008, 0x711: 0x0040, 0x712: 0x0040, 0x713: 0x0040, 0x714: 0x0040, 0x715: 0x0040, 0x716: 0x0040, 0x717: 0x0040, 0x718: 0x0040, 0x719: 0x0040, 0x71a: 0x0040, 0x71b: 0x0040, 0x71c: 0x0040, 0x71d: 0x0040, 0x71e: 0x0040, 0x71f: 0x0040, 0x720: 0x0008, 0x721: 0x0008, 0x722: 0x3308, 0x723: 0x3308, 0x724: 0x0040, 0x725: 0x0040, 0x726: 0x0008, 0x727: 0x0008, 0x728: 0x0008, 0x729: 0x0008, 0x72a: 0x0008, 0x72b: 0x0008, 0x72c: 0x0008, 0x72d: 0x0008, 0x72e: 0x0008, 0x72f: 0x0008, 0x730: 0x0018, 0x731: 0x0018, 0x732: 0x0040, 0x733: 0x0040, 0x734: 0x0040, 0x735: 0x0040, 0x736: 0x0040, 0x737: 0x0040, 0x738: 0x0040, 0x739: 0x0008, 0x73a: 0x3308, 0x73b: 0x3308, 0x73c: 0x3308, 0x73d: 0x3308, 0x73e: 0x3308, 0x73f: 0x3308, // Block 0x1d, offset 0x740 0x740: 0x0040, 0x741: 0x3308, 0x742: 0x3008, 0x743: 0x3008, 0x744: 0x0040, 0x745: 0x0008, 0x746: 0x0008, 0x747: 0x0008, 0x748: 0x0008, 0x749: 0x0008, 0x74a: 0x0008, 0x74b: 0x0008, 0x74c: 0x0008, 0x74d: 0x0040, 0x74e: 0x0040, 0x74f: 0x0008, 0x750: 0x0008, 0x751: 0x0040, 0x752: 0x0040, 0x753: 0x0008, 0x754: 0x0008, 0x755: 0x0008, 0x756: 0x0008, 0x757: 0x0008, 0x758: 0x0008, 0x759: 0x0008, 0x75a: 0x0008, 0x75b: 0x0008, 0x75c: 0x0008, 0x75d: 0x0008, 0x75e: 0x0008, 0x75f: 0x0008, 0x760: 0x0008, 0x761: 0x0008, 0x762: 0x0008, 0x763: 0x0008, 0x764: 0x0008, 0x765: 0x0008, 0x766: 0x0008, 0x767: 0x0008, 0x768: 0x0008, 0x769: 0x0040, 0x76a: 0x0008, 0x76b: 0x0008, 0x76c: 0x0008, 0x76d: 0x0008, 0x76e: 0x0008, 0x76f: 0x0008, 0x770: 0x0008, 0x771: 0x0040, 0x772: 0x0008, 0x773: 0x0008, 0x774: 0x0040, 0x775: 0x0008, 0x776: 0x0008, 0x777: 0x0008, 0x778: 0x0008, 0x779: 0x0008, 0x77a: 0x0040, 0x77b: 0x0040, 0x77c: 0x3308, 0x77d: 0x0008, 0x77e: 0x3008, 0x77f: 0x3308, // Block 0x1e, offset 0x780 0x780: 0x3008, 0x781: 0x3308, 0x782: 0x3308, 0x783: 0x3308, 0x784: 0x3308, 0x785: 0x0040, 0x786: 0x0040, 0x787: 0x3008, 0x788: 0x3008, 0x789: 0x0040, 0x78a: 0x0040, 0x78b: 0x3008, 0x78c: 0x3008, 0x78d: 0x3b08, 0x78e: 0x0040, 0x78f: 0x0040, 0x790: 0x0040, 0x791: 0x0040, 0x792: 0x0040, 0x793: 0x0040, 0x794: 0x0040, 0x795: 0x0040, 0x796: 0x3308, 0x797: 0x3008, 0x798: 0x0040, 0x799: 0x0040, 0x79a: 0x0040, 0x79b: 0x0040, 0x79c: 0x0881, 0x79d: 0x08b9, 0x79e: 0x0040, 0x79f: 0x0008, 0x7a0: 0x0008, 0x7a1: 0x0008, 0x7a2: 0x3308, 0x7a3: 0x3308, 0x7a4: 0x0040, 0x7a5: 0x0040, 0x7a6: 0x0008, 0x7a7: 0x0008, 0x7a8: 0x0008, 0x7a9: 0x0008, 0x7aa: 0x0008, 0x7ab: 0x0008, 0x7ac: 0x0008, 0x7ad: 0x0008, 0x7ae: 0x0008, 0x7af: 0x0008, 0x7b0: 0x0018, 0x7b1: 0x0008, 0x7b2: 0x0018, 0x7b3: 0x0018, 0x7b4: 0x0018, 0x7b5: 0x0018, 0x7b6: 0x0018, 0x7b7: 0x0018, 0x7b8: 0x0040, 0x7b9: 0x0040, 0x7ba: 0x0040, 0x7bb: 0x0040, 0x7bc: 0x0040, 0x7bd: 0x0040, 0x7be: 0x0040, 0x7bf: 0x0040, // Block 0x1f, offset 0x7c0 0x7c0: 0x0040, 0x7c1: 0x0040, 0x7c2: 0x3308, 0x7c3: 0x0008, 0x7c4: 0x0040, 0x7c5: 0x0008, 0x7c6: 0x0008, 0x7c7: 0x0008, 0x7c8: 0x0008, 0x7c9: 0x0008, 0x7ca: 0x0008, 0x7cb: 0x0040, 0x7cc: 0x0040, 0x7cd: 0x0040, 0x7ce: 0x0008, 0x7cf: 0x0008, 0x7d0: 0x0008, 0x7d1: 0x0040, 0x7d2: 0x0008, 0x7d3: 0x0008, 0x7d4: 0x0008, 0x7d5: 0x0008, 0x7d6: 0x0040, 0x7d7: 0x0040, 0x7d8: 0x0040, 0x7d9: 0x0008, 0x7da: 0x0008, 0x7db: 0x0040, 0x7dc: 0x0008, 0x7dd: 0x0040, 0x7de: 0x0008, 0x7df: 0x0008, 0x7e0: 0x0040, 0x7e1: 0x0040, 0x7e2: 0x0040, 0x7e3: 0x0008, 0x7e4: 0x0008, 0x7e5: 0x0040, 0x7e6: 0x0040, 0x7e7: 0x0040, 0x7e8: 0x0008, 0x7e9: 0x0008, 0x7ea: 0x0008, 0x7eb: 0x0040, 0x7ec: 0x0040, 0x7ed: 0x0040, 0x7ee: 0x0008, 0x7ef: 0x0008, 0x7f0: 0x0008, 0x7f1: 0x0008, 0x7f2: 0x0008, 0x7f3: 0x0008, 0x7f4: 0x0008, 0x7f5: 0x0008, 0x7f6: 0x0008, 0x7f7: 0x0008, 0x7f8: 0x0008, 0x7f9: 0x0008, 0x7fa: 0x0040, 0x7fb: 0x0040, 0x7fc: 0x0040, 0x7fd: 0x0040, 0x7fe: 0x3008, 0x7ff: 0x3008, // Block 0x20, offset 0x800 0x800: 0x3308, 0x801: 0x3008, 0x802: 0x3008, 0x803: 0x3008, 0x804: 0x3008, 0x805: 0x0040, 0x806: 0x3308, 0x807: 0x3308, 0x808: 0x3308, 0x809: 0x0040, 0x80a: 0x3308, 0x80b: 0x3308, 0x80c: 0x3308, 0x80d: 0x3b08, 0x80e: 0x0040, 0x80f: 0x0040, 0x810: 0x0040, 0x811: 0x0040, 0x812: 0x0040, 0x813: 0x0040, 0x814: 0x0040, 0x815: 0x3308, 0x816: 0x3308, 0x817: 0x0040, 0x818: 0x0008, 0x819: 0x0008, 0x81a: 0x0008, 0x81b: 0x0040, 0x81c: 0x0040, 0x81d: 0x0040, 0x81e: 0x0040, 0x81f: 0x0040, 0x820: 0x0008, 0x821: 0x0008, 0x822: 0x3308, 0x823: 0x3308, 0x824: 0x0040, 0x825: 0x0040, 0x826: 0x0008, 0x827: 0x0008, 0x828: 0x0008, 0x829: 0x0008, 0x82a: 0x0008, 0x82b: 0x0008, 0x82c: 0x0008, 0x82d: 0x0008, 0x82e: 0x0008, 0x82f: 0x0008, 0x830: 0x0040, 0x831: 0x0040, 0x832: 0x0040, 0x833: 0x0040, 0x834: 0x0040, 0x835: 0x0040, 0x836: 0x0040, 0x837: 0x0040, 0x838: 0x0018, 0x839: 0x0018, 0x83a: 0x0018, 0x83b: 0x0018, 0x83c: 0x0018, 0x83d: 0x0018, 0x83e: 0x0018, 0x83f: 0x0018, // Block 0x21, offset 0x840 0x840: 0x0008, 0x841: 0x3308, 0x842: 0x3008, 0x843: 0x3008, 0x844: 0x0018, 0x845: 0x0008, 0x846: 0x0008, 0x847: 0x0008, 0x848: 0x0008, 0x849: 0x0008, 0x84a: 0x0008, 0x84b: 0x0008, 0x84c: 0x0008, 0x84d: 0x0040, 0x84e: 0x0008, 0x84f: 0x0008, 0x850: 0x0008, 0x851: 0x0040, 0x852: 0x0008, 0x853: 0x0008, 0x854: 0x0008, 0x855: 0x0008, 0x856: 0x0008, 0x857: 0x0008, 0x858: 0x0008, 0x859: 0x0008, 0x85a: 0x0008, 0x85b: 0x0008, 0x85c: 0x0008, 0x85d: 0x0008, 0x85e: 0x0008, 0x85f: 0x0008, 0x860: 0x0008, 0x861: 0x0008, 0x862: 0x0008, 0x863: 0x0008, 0x864: 0x0008, 0x865: 0x0008, 0x866: 0x0008, 0x867: 0x0008, 0x868: 0x0008, 0x869: 0x0040, 0x86a: 0x0008, 0x86b: 0x0008, 0x86c: 0x0008, 0x86d: 0x0008, 0x86e: 0x0008, 0x86f: 0x0008, 0x870: 0x0008, 0x871: 0x0008, 0x872: 0x0008, 0x873: 0x0008, 0x874: 0x0040, 0x875: 0x0008, 0x876: 0x0008, 0x877: 0x0008, 0x878: 0x0008, 0x879: 0x0008, 0x87a: 0x0040, 0x87b: 0x0040, 0x87c: 0x3308, 0x87d: 0x0008, 0x87e: 0x3008, 0x87f: 0x3308, // Block 0x22, offset 0x880 0x880: 0x3008, 0x881: 0x3008, 0x882: 0x3008, 0x883: 0x3008, 0x884: 0x3008, 0x885: 0x0040, 0x886: 0x3308, 0x887: 0x3008, 0x888: 0x3008, 0x889: 0x0040, 0x88a: 0x3008, 0x88b: 0x3008, 0x88c: 0x3308, 0x88d: 0x3b08, 0x88e: 0x0040, 0x88f: 0x0040, 0x890: 0x0040, 0x891: 0x0040, 0x892: 0x0040, 0x893: 0x0040, 0x894: 0x0040, 0x895: 0x3008, 0x896: 0x3008, 0x897: 0x0040, 0x898: 0x0040, 0x899: 0x0040, 0x89a: 0x0040, 0x89b: 0x0040, 0x89c: 0x0040, 0x89d: 0x0040, 0x89e: 0x0008, 0x89f: 0x0040, 0x8a0: 0x0008, 0x8a1: 0x0008, 0x8a2: 0x3308, 0x8a3: 0x3308, 0x8a4: 0x0040, 0x8a5: 0x0040, 0x8a6: 0x0008, 0x8a7: 0x0008, 0x8a8: 0x0008, 0x8a9: 0x0008, 0x8aa: 0x0008, 0x8ab: 0x0008, 0x8ac: 0x0008, 0x8ad: 0x0008, 0x8ae: 0x0008, 0x8af: 0x0008, 0x8b0: 0x0040, 0x8b1: 0x0008, 0x8b2: 0x0008, 0x8b3: 0x0040, 0x8b4: 0x0040, 0x8b5: 0x0040, 0x8b6: 0x0040, 0x8b7: 0x0040, 0x8b8: 0x0040, 0x8b9: 0x0040, 0x8ba: 0x0040, 0x8bb: 0x0040, 0x8bc: 0x0040, 0x8bd: 0x0040, 0x8be: 0x0040, 0x8bf: 0x0040, // Block 0x23, offset 0x8c0 0x8c0: 0x3008, 0x8c1: 0x3308, 0x8c2: 0x3308, 0x8c3: 0x3308, 0x8c4: 0x3308, 0x8c5: 0x0040, 0x8c6: 0x3008, 0x8c7: 0x3008, 0x8c8: 0x3008, 0x8c9: 0x0040, 0x8ca: 0x3008, 0x8cb: 0x3008, 0x8cc: 0x3008, 0x8cd: 0x3b08, 0x8ce: 0x0008, 0x8cf: 0x0018, 0x8d0: 0x0040, 0x8d1: 0x0040, 0x8d2: 0x0040, 0x8d3: 0x0040, 0x8d4: 0x0008, 0x8d5: 0x0008, 0x8d6: 0x0008, 0x8d7: 0x3008, 0x8d8: 0x0018, 0x8d9: 0x0018, 0x8da: 0x0018, 0x8db: 0x0018, 0x8dc: 0x0018, 0x8dd: 0x0018, 0x8de: 0x0018, 0x8df: 0x0008, 0x8e0: 0x0008, 0x8e1: 0x0008, 0x8e2: 0x3308, 0x8e3: 0x3308, 0x8e4: 0x0040, 0x8e5: 0x0040, 0x8e6: 0x0008, 0x8e7: 0x0008, 0x8e8: 0x0008, 0x8e9: 0x0008, 0x8ea: 0x0008, 0x8eb: 0x0008, 0x8ec: 0x0008, 0x8ed: 0x0008, 0x8ee: 0x0008, 0x8ef: 0x0008, 0x8f0: 0x0018, 0x8f1: 0x0018, 0x8f2: 0x0018, 0x8f3: 0x0018, 0x8f4: 0x0018, 0x8f5: 0x0018, 0x8f6: 0x0018, 0x8f7: 0x0018, 0x8f8: 0x0018, 0x8f9: 0x0018, 0x8fa: 0x0008, 0x8fb: 0x0008, 0x8fc: 0x0008, 0x8fd: 0x0008, 0x8fe: 0x0008, 0x8ff: 0x0008, // Block 0x24, offset 0x900 0x900: 0x0040, 0x901: 0x0008, 0x902: 0x0008, 0x903: 0x0040, 0x904: 0x0008, 0x905: 0x0040, 0x906: 0x0040, 0x907: 0x0008, 0x908: 0x0008, 0x909: 0x0040, 0x90a: 0x0008, 0x90b: 0x0040, 0x90c: 0x0040, 0x90d: 0x0008, 0x90e: 0x0040, 0x90f: 0x0040, 0x910: 0x0040, 0x911: 0x0040, 0x912: 0x0040, 0x913: 0x0040, 0x914: 0x0008, 0x915: 0x0008, 0x916: 0x0008, 0x917: 0x0008, 0x918: 0x0040, 0x919: 0x0008, 0x91a: 0x0008, 0x91b: 0x0008, 0x91c: 0x0008, 0x91d: 0x0008, 0x91e: 0x0008, 0x91f: 0x0008, 0x920: 0x0040, 0x921: 0x0008, 0x922: 0x0008, 0x923: 0x0008, 0x924: 0x0040, 0x925: 0x0008, 0x926: 0x0040, 0x927: 0x0008, 0x928: 0x0040, 0x929: 0x0040, 0x92a: 0x0008, 0x92b: 0x0008, 0x92c: 0x0040, 0x92d: 0x0008, 0x92e: 0x0008, 0x92f: 0x0008, 0x930: 0x0008, 0x931: 0x3308, 0x932: 0x0008, 0x933: 0x0929, 0x934: 0x3308, 0x935: 0x3308, 0x936: 0x3308, 0x937: 0x3308, 0x938: 0x3308, 0x939: 0x3308, 0x93a: 0x0040, 0x93b: 0x3308, 0x93c: 0x3308, 0x93d: 0x0008, 0x93e: 0x0040, 0x93f: 0x0040, // Block 0x25, offset 0x940 0x940: 0x0008, 0x941: 0x0008, 0x942: 0x0008, 0x943: 0x09d1, 0x944: 0x0008, 0x945: 0x0008, 0x946: 0x0008, 0x947: 0x0008, 0x948: 0x0040, 0x949: 0x0008, 0x94a: 0x0008, 0x94b: 0x0008, 0x94c: 0x0008, 0x94d: 0x0a09, 0x94e: 0x0008, 0x94f: 0x0008, 0x950: 0x0008, 0x951: 0x0008, 0x952: 0x0a41, 0x953: 0x0008, 0x954: 0x0008, 0x955: 0x0008, 0x956: 0x0008, 0x957: 0x0a79, 0x958: 0x0008, 0x959: 0x0008, 0x95a: 0x0008, 0x95b: 0x0008, 0x95c: 0x0ab1, 0x95d: 0x0008, 0x95e: 0x0008, 0x95f: 0x0008, 0x960: 0x0008, 0x961: 0x0008, 0x962: 0x0008, 0x963: 0x0008, 0x964: 0x0008, 0x965: 0x0008, 0x966: 0x0008, 0x967: 0x0008, 0x968: 0x0008, 0x969: 0x0ae9, 0x96a: 0x0008, 0x96b: 0x0008, 0x96c: 0x0008, 0x96d: 0x0040, 0x96e: 0x0040, 0x96f: 0x0040, 0x970: 0x0040, 0x971: 0x3308, 0x972: 0x3308, 0x973: 0x0b21, 0x974: 0x3308, 0x975: 0x0b59, 0x976: 0x0b91, 0x977: 0x0bc9, 0x978: 0x0c19, 0x979: 0x0c51, 0x97a: 0x3308, 0x97b: 0x3308, 0x97c: 0x3308, 0x97d: 0x3308, 0x97e: 0x3308, 0x97f: 0x3008, // Block 0x26, offset 0x980 0x980: 0x3308, 0x981: 0x0ca1, 0x982: 0x3308, 0x983: 0x3308, 0x984: 0x3b08, 0x985: 0x0018, 0x986: 0x3308, 0x987: 0x3308, 0x988: 0x0008, 0x989: 0x0008, 0x98a: 0x0008, 0x98b: 0x0008, 0x98c: 0x0008, 0x98d: 0x3308, 0x98e: 0x3308, 0x98f: 0x3308, 0x990: 0x3308, 0x991: 0x3308, 0x992: 0x3308, 0x993: 0x0cd9, 0x994: 0x3308, 0x995: 0x3308, 0x996: 0x3308, 0x997: 0x3308, 0x998: 0x0040, 0x999: 0x3308, 0x99a: 0x3308, 0x99b: 0x3308, 0x99c: 0x3308, 0x99d: 0x0d11, 0x99e: 0x3308, 0x99f: 0x3308, 0x9a0: 0x3308, 0x9a1: 0x3308, 0x9a2: 0x0d49, 0x9a3: 0x3308, 0x9a4: 0x3308, 0x9a5: 0x3308, 0x9a6: 0x3308, 0x9a7: 0x0d81, 0x9a8: 0x3308, 0x9a9: 0x3308, 0x9aa: 0x3308, 0x9ab: 0x3308, 0x9ac: 0x0db9, 0x9ad: 0x3308, 0x9ae: 0x3308, 0x9af: 0x3308, 0x9b0: 0x3308, 0x9b1: 0x3308, 0x9b2: 0x3308, 0x9b3: 0x3308, 0x9b4: 0x3308, 0x9b5: 0x3308, 0x9b6: 0x3308, 0x9b7: 0x3308, 0x9b8: 0x3308, 0x9b9: 0x0df1, 0x9ba: 0x3308, 0x9bb: 0x3308, 0x9bc: 0x3308, 0x9bd: 0x0040, 0x9be: 0x0018, 0x9bf: 0x0018, // Block 0x27, offset 0x9c0 0x9c0: 0x0008, 0x9c1: 0x0008, 0x9c2: 0x0008, 0x9c3: 0x0008, 0x9c4: 0x0008, 0x9c5: 0x0008, 0x9c6: 0x0008, 0x9c7: 0x0008, 0x9c8: 0x0008, 0x9c9: 0x0008, 0x9ca: 0x0008, 0x9cb: 0x0008, 0x9cc: 0x0008, 0x9cd: 0x0008, 0x9ce: 0x0008, 0x9cf: 0x0008, 0x9d0: 0x0008, 0x9d1: 0x0008, 0x9d2: 0x0008, 0x9d3: 0x0008, 0x9d4: 0x0008, 0x9d5: 0x0008, 0x9d6: 0x0008, 0x9d7: 0x0008, 0x9d8: 0x0008, 0x9d9: 0x0008, 0x9da: 0x0008, 0x9db: 0x0008, 0x9dc: 0x0008, 0x9dd: 0x0008, 0x9de: 0x0008, 0x9df: 0x0008, 0x9e0: 0x0008, 0x9e1: 0x0008, 0x9e2: 0x0008, 0x9e3: 0x0008, 0x9e4: 0x0008, 0x9e5: 0x0008, 0x9e6: 0x0008, 0x9e7: 0x0008, 0x9e8: 0x0008, 0x9e9: 0x0008, 0x9ea: 0x0008, 0x9eb: 0x0008, 0x9ec: 0x0039, 0x9ed: 0x0ed1, 0x9ee: 0x0ee9, 0x9ef: 0x0008, 0x9f0: 0x0ef9, 0x9f1: 0x0f09, 0x9f2: 0x0f19, 0x9f3: 0x0f31, 0x9f4: 0x0249, 0x9f5: 0x0f41, 0x9f6: 0x0259, 0x9f7: 0x0f51, 0x9f8: 0x0359, 0x9f9: 0x0f61, 0x9fa: 0x0f71, 0x9fb: 0x0008, 0x9fc: 0x00d9, 0x9fd: 0x0f81, 0x9fe: 0x0f99, 0x9ff: 0x0269, // Block 0x28, offset 0xa00 0xa00: 0x0fa9, 0xa01: 0x0fb9, 0xa02: 0x0279, 0xa03: 0x0039, 0xa04: 0x0fc9, 0xa05: 0x0fe1, 0xa06: 0x059d, 0xa07: 0x0ee9, 0xa08: 0x0ef9, 0xa09: 0x0f09, 0xa0a: 0x0ff9, 0xa0b: 0x1011, 0xa0c: 0x1029, 0xa0d: 0x0f31, 0xa0e: 0x0008, 0xa0f: 0x0f51, 0xa10: 0x0f61, 0xa11: 0x1041, 0xa12: 0x00d9, 0xa13: 0x1059, 0xa14: 0x05b5, 0xa15: 0x05b5, 0xa16: 0x0f99, 0xa17: 0x0fa9, 0xa18: 0x0fb9, 0xa19: 0x059d, 0xa1a: 0x1071, 0xa1b: 0x1089, 0xa1c: 0x05cd, 0xa1d: 0x1099, 0xa1e: 0x10b1, 0xa1f: 0x10c9, 0xa20: 0x10e1, 0xa21: 0x10f9, 0xa22: 0x0f41, 0xa23: 0x0269, 0xa24: 0x0fb9, 0xa25: 0x1089, 0xa26: 0x1099, 0xa27: 0x10b1, 0xa28: 0x1111, 0xa29: 0x10e1, 0xa2a: 0x10f9, 0xa2b: 0x0008, 0xa2c: 0x0008, 0xa2d: 0x0008, 0xa2e: 0x0008, 0xa2f: 0x0008, 0xa30: 0x0008, 0xa31: 0x0008, 0xa32: 0x0008, 0xa33: 0x0008, 0xa34: 0x0008, 0xa35: 0x0008, 0xa36: 0x0008, 0xa37: 0x0008, 0xa38: 0x1129, 0xa39: 0x0008, 0xa3a: 0x0008, 0xa3b: 0x0008, 0xa3c: 0x0008, 0xa3d: 0x0008, 0xa3e: 0x0008, 0xa3f: 0x0008, // Block 0x29, offset 0xa40 0xa40: 0x0008, 0xa41: 0x0008, 0xa42: 0x0008, 0xa43: 0x0008, 0xa44: 0x0008, 0xa45: 0x0008, 0xa46: 0x0008, 0xa47: 0x0008, 0xa48: 0x0008, 0xa49: 0x0008, 0xa4a: 0x0008, 0xa4b: 0x0008, 0xa4c: 0x0008, 0xa4d: 0x0008, 0xa4e: 0x0008, 0xa4f: 0x0008, 0xa50: 0x0008, 0xa51: 0x0008, 0xa52: 0x0008, 0xa53: 0x0008, 0xa54: 0x0008, 0xa55: 0x0008, 0xa56: 0x0008, 0xa57: 0x0008, 0xa58: 0x0008, 0xa59: 0x0008, 0xa5a: 0x0008, 0xa5b: 0x1141, 0xa5c: 0x1159, 0xa5d: 0x1169, 0xa5e: 0x1181, 0xa5f: 0x1029, 0xa60: 0x1199, 0xa61: 0x11a9, 0xa62: 0x11c1, 0xa63: 0x11d9, 0xa64: 0x11f1, 0xa65: 0x1209, 0xa66: 0x1221, 0xa67: 0x05e5, 0xa68: 0x1239, 0xa69: 0x1251, 0xa6a: 0xe17d, 0xa6b: 0x1269, 0xa6c: 0x1281, 0xa6d: 0x1299, 0xa6e: 0x12b1, 0xa6f: 0x12c9, 0xa70: 0x12e1, 0xa71: 0x12f9, 0xa72: 0x1311, 0xa73: 0x1329, 0xa74: 0x1341, 0xa75: 0x1359, 0xa76: 0x1371, 0xa77: 0x1389, 0xa78: 0x05fd, 0xa79: 0x13a1, 0xa7a: 0x13b9, 0xa7b: 0x13d1, 0xa7c: 0x13e1, 0xa7d: 0x13f9, 0xa7e: 0x1411, 0xa7f: 0x1429, // Block 0x2a, offset 0xa80 0xa80: 0xe00d, 0xa81: 0x0008, 0xa82: 0xe00d, 0xa83: 0x0008, 0xa84: 0xe00d, 0xa85: 0x0008, 0xa86: 0xe00d, 0xa87: 0x0008, 0xa88: 0xe00d, 0xa89: 0x0008, 0xa8a: 0xe00d, 0xa8b: 0x0008, 0xa8c: 0xe00d, 0xa8d: 0x0008, 0xa8e: 0xe00d, 0xa8f: 0x0008, 0xa90: 0xe00d, 0xa91: 0x0008, 0xa92: 0xe00d, 0xa93: 0x0008, 0xa94: 0xe00d, 0xa95: 0x0008, 0xa96: 0xe00d, 0xa97: 0x0008, 0xa98: 0xe00d, 0xa99: 0x0008, 0xa9a: 0xe00d, 0xa9b: 0x0008, 0xa9c: 0xe00d, 0xa9d: 0x0008, 0xa9e: 0xe00d, 0xa9f: 0x0008, 0xaa0: 0xe00d, 0xaa1: 0x0008, 0xaa2: 0xe00d, 0xaa3: 0x0008, 0xaa4: 0xe00d, 0xaa5: 0x0008, 0xaa6: 0xe00d, 0xaa7: 0x0008, 0xaa8: 0xe00d, 0xaa9: 0x0008, 0xaaa: 0xe00d, 0xaab: 0x0008, 0xaac: 0xe00d, 0xaad: 0x0008, 0xaae: 0xe00d, 0xaaf: 0x0008, 0xab0: 0xe00d, 0xab1: 0x0008, 0xab2: 0xe00d, 0xab3: 0x0008, 0xab4: 0xe00d, 0xab5: 0x0008, 0xab6: 0xe00d, 0xab7: 0x0008, 0xab8: 0xe00d, 0xab9: 0x0008, 0xaba: 0xe00d, 0xabb: 0x0008, 0xabc: 0xe00d, 0xabd: 0x0008, 0xabe: 0xe00d, 0xabf: 0x0008, // Block 0x2b, offset 0xac0 0xac0: 0xe00d, 0xac1: 0x0008, 0xac2: 0xe00d, 0xac3: 0x0008, 0xac4: 0xe00d, 0xac5: 0x0008, 0xac6: 0xe00d, 0xac7: 0x0008, 0xac8: 0xe00d, 0xac9: 0x0008, 0xaca: 0xe00d, 0xacb: 0x0008, 0xacc: 0xe00d, 0xacd: 0x0008, 0xace: 0xe00d, 0xacf: 0x0008, 0xad0: 0xe00d, 0xad1: 0x0008, 0xad2: 0xe00d, 0xad3: 0x0008, 0xad4: 0xe00d, 0xad5: 0x0008, 0xad6: 0x0008, 0xad7: 0x0008, 0xad8: 0x0008, 0xad9: 0x0008, 0xada: 0x0615, 0xadb: 0x0635, 0xadc: 0x0008, 0xadd: 0x0008, 0xade: 0x1441, 0xadf: 0x0008, 0xae0: 0xe00d, 0xae1: 0x0008, 0xae2: 0xe00d, 0xae3: 0x0008, 0xae4: 0xe00d, 0xae5: 0x0008, 0xae6: 0xe00d, 0xae7: 0x0008, 0xae8: 0xe00d, 0xae9: 0x0008, 0xaea: 0xe00d, 0xaeb: 0x0008, 0xaec: 0xe00d, 0xaed: 0x0008, 0xaee: 0xe00d, 0xaef: 0x0008, 0xaf0: 0xe00d, 0xaf1: 0x0008, 0xaf2: 0xe00d, 0xaf3: 0x0008, 0xaf4: 0xe00d, 0xaf5: 0x0008, 0xaf6: 0xe00d, 0xaf7: 0x0008, 0xaf8: 0xe00d, 0xaf9: 0x0008, 0xafa: 0xe00d, 0xafb: 0x0008, 0xafc: 0xe00d, 0xafd: 0x0008, 0xafe: 0xe00d, 0xaff: 0x0008, // Block 0x2c, offset 0xb00 0xb00: 0x0008, 0xb01: 0x0008, 0xb02: 0x0008, 0xb03: 0x0008, 0xb04: 0x0008, 0xb05: 0x0008, 0xb06: 0x0040, 0xb07: 0x0040, 0xb08: 0xe045, 0xb09: 0xe045, 0xb0a: 0xe045, 0xb0b: 0xe045, 0xb0c: 0xe045, 0xb0d: 0xe045, 0xb0e: 0x0040, 0xb0f: 0x0040, 0xb10: 0x0008, 0xb11: 0x0008, 0xb12: 0x0008, 0xb13: 0x0008, 0xb14: 0x0008, 0xb15: 0x0008, 0xb16: 0x0008, 0xb17: 0x0008, 0xb18: 0x0040, 0xb19: 0xe045, 0xb1a: 0x0040, 0xb1b: 0xe045, 0xb1c: 0x0040, 0xb1d: 0xe045, 0xb1e: 0x0040, 0xb1f: 0xe045, 0xb20: 0x0008, 0xb21: 0x0008, 0xb22: 0x0008, 0xb23: 0x0008, 0xb24: 0x0008, 0xb25: 0x0008, 0xb26: 0x0008, 0xb27: 0x0008, 0xb28: 0xe045, 0xb29: 0xe045, 0xb2a: 0xe045, 0xb2b: 0xe045, 0xb2c: 0xe045, 0xb2d: 0xe045, 0xb2e: 0xe045, 0xb2f: 0xe045, 0xb30: 0x0008, 0xb31: 0x1459, 0xb32: 0x0008, 0xb33: 0x1471, 0xb34: 0x0008, 0xb35: 0x1489, 0xb36: 0x0008, 0xb37: 0x14a1, 0xb38: 0x0008, 0xb39: 0x14b9, 0xb3a: 0x0008, 0xb3b: 0x14d1, 0xb3c: 0x0008, 0xb3d: 0x14e9, 0xb3e: 0x0040, 0xb3f: 0x0040, // Block 0x2d, offset 0xb40 0xb40: 0x1501, 0xb41: 0x1531, 0xb42: 0x1561, 0xb43: 0x1591, 0xb44: 0x15c1, 0xb45: 0x15f1, 0xb46: 0x1621, 0xb47: 0x1651, 0xb48: 0x1501, 0xb49: 0x1531, 0xb4a: 0x1561, 0xb4b: 0x1591, 0xb4c: 0x15c1, 0xb4d: 0x15f1, 0xb4e: 0x1621, 0xb4f: 0x1651, 0xb50: 0x1681, 0xb51: 0x16b1, 0xb52: 0x16e1, 0xb53: 0x1711, 0xb54: 0x1741, 0xb55: 0x1771, 0xb56: 0x17a1, 0xb57: 0x17d1, 0xb58: 0x1681, 0xb59: 0x16b1, 0xb5a: 0x16e1, 0xb5b: 0x1711, 0xb5c: 0x1741, 0xb5d: 0x1771, 0xb5e: 0x17a1, 0xb5f: 0x17d1, 0xb60: 0x1801, 0xb61: 0x1831, 0xb62: 0x1861, 0xb63: 0x1891, 0xb64: 0x18c1, 0xb65: 0x18f1, 0xb66: 0x1921, 0xb67: 0x1951, 0xb68: 0x1801, 0xb69: 0x1831, 0xb6a: 0x1861, 0xb6b: 0x1891, 0xb6c: 0x18c1, 0xb6d: 0x18f1, 0xb6e: 0x1921, 0xb6f: 0x1951, 0xb70: 0x0008, 0xb71: 0x0008, 0xb72: 0x1981, 0xb73: 0x19b1, 0xb74: 0x19d9, 0xb75: 0x0040, 0xb76: 0x0008, 0xb77: 0x1a01, 0xb78: 0xe045, 0xb79: 0xe045, 0xb7a: 0x064d, 0xb7b: 0x1459, 0xb7c: 0x19b1, 0xb7d: 0x0666, 0xb7e: 0x1a31, 0xb7f: 0x0686, // Block 0x2e, offset 0xb80 0xb80: 0x06a6, 0xb81: 0x1a4a, 0xb82: 0x1a79, 0xb83: 0x1aa9, 0xb84: 0x1ad1, 0xb85: 0x0040, 0xb86: 0x0008, 0xb87: 0x1af9, 0xb88: 0x06c5, 0xb89: 0x1471, 0xb8a: 0x06dd, 0xb8b: 0x1489, 0xb8c: 0x1aa9, 0xb8d: 0x1b2a, 0xb8e: 0x1b5a, 0xb8f: 0x1b8a, 0xb90: 0x0008, 0xb91: 0x0008, 0xb92: 0x0008, 0xb93: 0x1bb9, 0xb94: 0x0040, 0xb95: 0x0040, 0xb96: 0x0008, 0xb97: 0x0008, 0xb98: 0xe045, 0xb99: 0xe045, 0xb9a: 0x06f5, 0xb9b: 0x14a1, 0xb9c: 0x0040, 0xb9d: 0x1bd2, 0xb9e: 0x1c02, 0xb9f: 0x1c32, 0xba0: 0x0008, 0xba1: 0x0008, 0xba2: 0x0008, 0xba3: 0x1c61, 0xba4: 0x0008, 0xba5: 0x0008, 0xba6: 0x0008, 0xba7: 0x0008, 0xba8: 0xe045, 0xba9: 0xe045, 0xbaa: 0x070d, 0xbab: 0x14d1, 0xbac: 0xe04d, 0xbad: 0x1c7a, 0xbae: 0x03d2, 0xbaf: 0x1caa, 0xbb0: 0x0040, 0xbb1: 0x0040, 0xbb2: 0x1cb9, 0xbb3: 0x1ce9, 0xbb4: 0x1d11, 0xbb5: 0x0040, 0xbb6: 0x0008, 0xbb7: 0x1d39, 0xbb8: 0x0725, 0xbb9: 0x14b9, 0xbba: 0x0515, 0xbbb: 0x14e9, 0xbbc: 0x1ce9, 0xbbd: 0x073e, 0xbbe: 0x075e, 0xbbf: 0x0040, // Block 0x2f, offset 0xbc0 0xbc0: 0x000a, 0xbc1: 0x000a, 0xbc2: 0x000a, 0xbc3: 0x000a, 0xbc4: 0x000a, 0xbc5: 0x000a, 0xbc6: 0x000a, 0xbc7: 0x000a, 0xbc8: 0x000a, 0xbc9: 0x000a, 0xbca: 0x000a, 0xbcb: 0x03c0, 0xbcc: 0x0003, 0xbcd: 0x0003, 0xbce: 0x0340, 0xbcf: 0x0b40, 0xbd0: 0x0018, 0xbd1: 0xe00d, 0xbd2: 0x0018, 0xbd3: 0x0018, 0xbd4: 0x0018, 0xbd5: 0x0018, 0xbd6: 0x0018, 0xbd7: 0x077e, 0xbd8: 0x0018, 0xbd9: 0x0018, 0xbda: 0x0018, 0xbdb: 0x0018, 0xbdc: 0x0018, 0xbdd: 0x0018, 0xbde: 0x0018, 0xbdf: 0x0018, 0xbe0: 0x0018, 0xbe1: 0x0018, 0xbe2: 0x0018, 0xbe3: 0x0018, 0xbe4: 0x0040, 0xbe5: 0x0040, 0xbe6: 0x0040, 0xbe7: 0x0018, 0xbe8: 0x0040, 0xbe9: 0x0040, 0xbea: 0x0340, 0xbeb: 0x0340, 0xbec: 0x0340, 0xbed: 0x0340, 0xbee: 0x0340, 0xbef: 0x000a, 0xbf0: 0x0018, 0xbf1: 0x0018, 0xbf2: 0x0018, 0xbf3: 0x1d69, 0xbf4: 0x1da1, 0xbf5: 0x0018, 0xbf6: 0x1df1, 0xbf7: 0x1e29, 0xbf8: 0x0018, 0xbf9: 0x0018, 0xbfa: 0x0018, 0xbfb: 0x0018, 0xbfc: 0x1e7a, 0xbfd: 0x0018, 0xbfe: 0x079e, 0xbff: 0x0018, // Block 0x30, offset 0xc00 0xc00: 0x0018, 0xc01: 0x0018, 0xc02: 0x0018, 0xc03: 0x0018, 0xc04: 0x0018, 0xc05: 0x0018, 0xc06: 0x0018, 0xc07: 0x1e92, 0xc08: 0x1eaa, 0xc09: 0x1ec2, 0xc0a: 0x0018, 0xc0b: 0x0018, 0xc0c: 0x0018, 0xc0d: 0x0018, 0xc0e: 0x0018, 0xc0f: 0x0018, 0xc10: 0x0018, 0xc11: 0x0018, 0xc12: 0x0018, 0xc13: 0x0018, 0xc14: 0x0018, 0xc15: 0x0018, 0xc16: 0x0018, 0xc17: 0x1ed9, 0xc18: 0x0018, 0xc19: 0x0018, 0xc1a: 0x0018, 0xc1b: 0x0018, 0xc1c: 0x0018, 0xc1d: 0x0018, 0xc1e: 0x0018, 0xc1f: 0x000a, 0xc20: 0x03c0, 0xc21: 0x0340, 0xc22: 0x0340, 0xc23: 0x0340, 0xc24: 0x03c0, 0xc25: 0x0040, 0xc26: 0x0040, 0xc27: 0x0040, 0xc28: 0x0040, 0xc29: 0x0040, 0xc2a: 0x0340, 0xc2b: 0x0340, 0xc2c: 0x0340, 0xc2d: 0x0340, 0xc2e: 0x0340, 0xc2f: 0x0340, 0xc30: 0x1f41, 0xc31: 0x0f41, 0xc32: 0x0040, 0xc33: 0x0040, 0xc34: 0x1f51, 0xc35: 0x1f61, 0xc36: 0x1f71, 0xc37: 0x1f81, 0xc38: 0x1f91, 0xc39: 0x1fa1, 0xc3a: 0x1fb2, 0xc3b: 0x07bd, 0xc3c: 0x1fc2, 0xc3d: 0x1fd2, 0xc3e: 0x1fe2, 0xc3f: 0x0f71, // Block 0x31, offset 0xc40 0xc40: 0x1f41, 0xc41: 0x00c9, 0xc42: 0x0069, 0xc43: 0x0079, 0xc44: 0x1f51, 0xc45: 0x1f61, 0xc46: 0x1f71, 0xc47: 0x1f81, 0xc48: 0x1f91, 0xc49: 0x1fa1, 0xc4a: 0x1fb2, 0xc4b: 0x07d5, 0xc4c: 0x1fc2, 0xc4d: 0x1fd2, 0xc4e: 0x1fe2, 0xc4f: 0x0040, 0xc50: 0x0039, 0xc51: 0x0f09, 0xc52: 0x00d9, 0xc53: 0x0369, 0xc54: 0x0ff9, 0xc55: 0x0249, 0xc56: 0x0f51, 0xc57: 0x0359, 0xc58: 0x0f61, 0xc59: 0x0f71, 0xc5a: 0x0f99, 0xc5b: 0x01d9, 0xc5c: 0x0fa9, 0xc5d: 0x0040, 0xc5e: 0x0040, 0xc5f: 0x0040, 0xc60: 0x0018, 0xc61: 0x0018, 0xc62: 0x0018, 0xc63: 0x0018, 0xc64: 0x0018, 0xc65: 0x0018, 0xc66: 0x0018, 0xc67: 0x0018, 0xc68: 0x1ff1, 0xc69: 0x0018, 0xc6a: 0x0018, 0xc6b: 0x0018, 0xc6c: 0x0018, 0xc6d: 0x0018, 0xc6e: 0x0018, 0xc6f: 0x0018, 0xc70: 0x0018, 0xc71: 0x0018, 0xc72: 0x0018, 0xc73: 0x0018, 0xc74: 0x0018, 0xc75: 0x0018, 0xc76: 0x0018, 0xc77: 0x0018, 0xc78: 0x0018, 0xc79: 0x0018, 0xc7a: 0x0018, 0xc7b: 0x0018, 0xc7c: 0x0018, 0xc7d: 0x0018, 0xc7e: 0x0018, 0xc7f: 0x0018, // Block 0x32, offset 0xc80 0xc80: 0x07ee, 0xc81: 0x080e, 0xc82: 0x1159, 0xc83: 0x082d, 0xc84: 0x0018, 0xc85: 0x084e, 0xc86: 0x086e, 0xc87: 0x1011, 0xc88: 0x0018, 0xc89: 0x088d, 0xc8a: 0x0f31, 0xc8b: 0x0249, 0xc8c: 0x0249, 0xc8d: 0x0249, 0xc8e: 0x0249, 0xc8f: 0x2009, 0xc90: 0x0f41, 0xc91: 0x0f41, 0xc92: 0x0359, 0xc93: 0x0359, 0xc94: 0x0018, 0xc95: 0x0f71, 0xc96: 0x2021, 0xc97: 0x0018, 0xc98: 0x0018, 0xc99: 0x0f99, 0xc9a: 0x2039, 0xc9b: 0x0269, 0xc9c: 0x0269, 0xc9d: 0x0269, 0xc9e: 0x0018, 0xc9f: 0x0018, 0xca0: 0x2049, 0xca1: 0x08ad, 0xca2: 0x2061, 0xca3: 0x0018, 0xca4: 0x13d1, 0xca5: 0x0018, 0xca6: 0x2079, 0xca7: 0x0018, 0xca8: 0x13d1, 0xca9: 0x0018, 0xcaa: 0x0f51, 0xcab: 0x2091, 0xcac: 0x0ee9, 0xcad: 0x1159, 0xcae: 0x0018, 0xcaf: 0x0f09, 0xcb0: 0x0f09, 0xcb1: 0x1199, 0xcb2: 0x0040, 0xcb3: 0x0f61, 0xcb4: 0x00d9, 0xcb5: 0x20a9, 0xcb6: 0x20c1, 0xcb7: 0x20d9, 0xcb8: 0x20f1, 0xcb9: 0x0f41, 0xcba: 0x0018, 0xcbb: 0x08cd, 0xcbc: 0x2109, 0xcbd: 0x10b1, 0xcbe: 0x10b1, 0xcbf: 0x2109, // Block 0x33, offset 0xcc0 0xcc0: 0x08ed, 0xcc1: 0x0018, 0xcc2: 0x0018, 0xcc3: 0x0018, 0xcc4: 0x0018, 0xcc5: 0x0ef9, 0xcc6: 0x0ef9, 0xcc7: 0x0f09, 0xcc8: 0x0f41, 0xcc9: 0x0259, 0xcca: 0x0018, 0xccb: 0x0018, 0xccc: 0x0018, 0xccd: 0x0018, 0xcce: 0x0008, 0xccf: 0x0018, 0xcd0: 0x2121, 0xcd1: 0x2151, 0xcd2: 0x2181, 0xcd3: 0x21b9, 0xcd4: 0x21e9, 0xcd5: 0x2219, 0xcd6: 0x2249, 0xcd7: 0x2279, 0xcd8: 0x22a9, 0xcd9: 0x22d9, 0xcda: 0x2309, 0xcdb: 0x2339, 0xcdc: 0x2369, 0xcdd: 0x2399, 0xcde: 0x23c9, 0xcdf: 0x23f9, 0xce0: 0x0f41, 0xce1: 0x2421, 0xce2: 0x0905, 0xce3: 0x2439, 0xce4: 0x1089, 0xce5: 0x2451, 0xce6: 0x0925, 0xce7: 0x2469, 0xce8: 0x2491, 0xce9: 0x0369, 0xcea: 0x24a9, 0xceb: 0x0945, 0xcec: 0x0359, 0xced: 0x1159, 0xcee: 0x0ef9, 0xcef: 0x0f61, 0xcf0: 0x0f41, 0xcf1: 0x2421, 0xcf2: 0x0965, 0xcf3: 0x2439, 0xcf4: 0x1089, 0xcf5: 0x2451, 0xcf6: 0x0985, 0xcf7: 0x2469, 0xcf8: 0x2491, 0xcf9: 0x0369, 0xcfa: 0x24a9, 0xcfb: 0x09a5, 0xcfc: 0x0359, 0xcfd: 0x1159, 0xcfe: 0x0ef9, 0xcff: 0x0f61, // Block 0x34, offset 0xd00 0xd00: 0x0018, 0xd01: 0x0018, 0xd02: 0x0018, 0xd03: 0x0018, 0xd04: 0x0018, 0xd05: 0x0018, 0xd06: 0x0018, 0xd07: 0x0018, 0xd08: 0x0018, 0xd09: 0x0018, 0xd0a: 0x0018, 0xd0b: 0x0040, 0xd0c: 0x0040, 0xd0d: 0x0040, 0xd0e: 0x0040, 0xd0f: 0x0040, 0xd10: 0x0040, 0xd11: 0x0040, 0xd12: 0x0040, 0xd13: 0x0040, 0xd14: 0x0040, 0xd15: 0x0040, 0xd16: 0x0040, 0xd17: 0x0040, 0xd18: 0x0040, 0xd19: 0x0040, 0xd1a: 0x0040, 0xd1b: 0x0040, 0xd1c: 0x0040, 0xd1d: 0x0040, 0xd1e: 0x0040, 0xd1f: 0x0040, 0xd20: 0x00c9, 0xd21: 0x0069, 0xd22: 0x0079, 0xd23: 0x1f51, 0xd24: 0x1f61, 0xd25: 0x1f71, 0xd26: 0x1f81, 0xd27: 0x1f91, 0xd28: 0x1fa1, 0xd29: 0x2601, 0xd2a: 0x2619, 0xd2b: 0x2631, 0xd2c: 0x2649, 0xd2d: 0x2661, 0xd2e: 0x2679, 0xd2f: 0x2691, 0xd30: 0x26a9, 0xd31: 0x26c1, 0xd32: 0x26d9, 0xd33: 0x26f1, 0xd34: 0x0a06, 0xd35: 0x0a26, 0xd36: 0x0a46, 0xd37: 0x0a66, 0xd38: 0x0a86, 0xd39: 0x0aa6, 0xd3a: 0x0ac6, 0xd3b: 0x0ae6, 0xd3c: 0x0b06, 0xd3d: 0x270a, 0xd3e: 0x2732, 0xd3f: 0x275a, // Block 0x35, offset 0xd40 0xd40: 0x2782, 0xd41: 0x27aa, 0xd42: 0x27d2, 0xd43: 0x27fa, 0xd44: 0x2822, 0xd45: 0x284a, 0xd46: 0x2872, 0xd47: 0x289a, 0xd48: 0x0040, 0xd49: 0x0040, 0xd4a: 0x0040, 0xd4b: 0x0040, 0xd4c: 0x0040, 0xd4d: 0x0040, 0xd4e: 0x0040, 0xd4f: 0x0040, 0xd50: 0x0040, 0xd51: 0x0040, 0xd52: 0x0040, 0xd53: 0x0040, 0xd54: 0x0040, 0xd55: 0x0040, 0xd56: 0x0040, 0xd57: 0x0040, 0xd58: 0x0040, 0xd59: 0x0040, 0xd5a: 0x0040, 0xd5b: 0x0040, 0xd5c: 0x0b26, 0xd5d: 0x0b46, 0xd5e: 0x0b66, 0xd5f: 0x0b86, 0xd60: 0x0ba6, 0xd61: 0x0bc6, 0xd62: 0x0be6, 0xd63: 0x0c06, 0xd64: 0x0c26, 0xd65: 0x0c46, 0xd66: 0x0c66, 0xd67: 0x0c86, 0xd68: 0x0ca6, 0xd69: 0x0cc6, 0xd6a: 0x0ce6, 0xd6b: 0x0d06, 0xd6c: 0x0d26, 0xd6d: 0x0d46, 0xd6e: 0x0d66, 0xd6f: 0x0d86, 0xd70: 0x0da6, 0xd71: 0x0dc6, 0xd72: 0x0de6, 0xd73: 0x0e06, 0xd74: 0x0e26, 0xd75: 0x0e46, 0xd76: 0x0039, 0xd77: 0x0ee9, 0xd78: 0x1159, 0xd79: 0x0ef9, 0xd7a: 0x0f09, 0xd7b: 0x1199, 0xd7c: 0x0f31, 0xd7d: 0x0249, 0xd7e: 0x0f41, 0xd7f: 0x0259, // Block 0x36, offset 0xd80 0xd80: 0x0f51, 0xd81: 0x0359, 0xd82: 0x0f61, 0xd83: 0x0f71, 0xd84: 0x00d9, 0xd85: 0x0f99, 0xd86: 0x2039, 0xd87: 0x0269, 0xd88: 0x01d9, 0xd89: 0x0fa9, 0xd8a: 0x0fb9, 0xd8b: 0x1089, 0xd8c: 0x0279, 0xd8d: 0x0369, 0xd8e: 0x0289, 0xd8f: 0x13d1, 0xd90: 0x0039, 0xd91: 0x0ee9, 0xd92: 0x1159, 0xd93: 0x0ef9, 0xd94: 0x0f09, 0xd95: 0x1199, 0xd96: 0x0f31, 0xd97: 0x0249, 0xd98: 0x0f41, 0xd99: 0x0259, 0xd9a: 0x0f51, 0xd9b: 0x0359, 0xd9c: 0x0f61, 0xd9d: 0x0f71, 0xd9e: 0x00d9, 0xd9f: 0x0f99, 0xda0: 0x2039, 0xda1: 0x0269, 0xda2: 0x01d9, 0xda3: 0x0fa9, 0xda4: 0x0fb9, 0xda5: 0x1089, 0xda6: 0x0279, 0xda7: 0x0369, 0xda8: 0x0289, 0xda9: 0x13d1, 0xdaa: 0x1f41, 0xdab: 0x0018, 0xdac: 0x0018, 0xdad: 0x0018, 0xdae: 0x0018, 0xdaf: 0x0018, 0xdb0: 0x0018, 0xdb1: 0x0018, 0xdb2: 0x0018, 0xdb3: 0x0018, 0xdb4: 0x0018, 0xdb5: 0x0018, 0xdb6: 0x0018, 0xdb7: 0x0018, 0xdb8: 0x0018, 0xdb9: 0x0018, 0xdba: 0x0018, 0xdbb: 0x0018, 0xdbc: 0x0018, 0xdbd: 0x0018, 0xdbe: 0x0018, 0xdbf: 0x0018, // Block 0x37, offset 0xdc0 0xdc0: 0x0008, 0xdc1: 0x0008, 0xdc2: 0x0008, 0xdc3: 0x0008, 0xdc4: 0x0008, 0xdc5: 0x0008, 0xdc6: 0x0008, 0xdc7: 0x0008, 0xdc8: 0x0008, 0xdc9: 0x0008, 0xdca: 0x0008, 0xdcb: 0x0008, 0xdcc: 0x0008, 0xdcd: 0x0008, 0xdce: 0x0008, 0xdcf: 0x0008, 0xdd0: 0x0008, 0xdd1: 0x0008, 0xdd2: 0x0008, 0xdd3: 0x0008, 0xdd4: 0x0008, 0xdd5: 0x0008, 0xdd6: 0x0008, 0xdd7: 0x0008, 0xdd8: 0x0008, 0xdd9: 0x0008, 0xdda: 0x0008, 0xddb: 0x0008, 0xddc: 0x0008, 0xddd: 0x0008, 0xdde: 0x0008, 0xddf: 0x0040, 0xde0: 0xe00d, 0xde1: 0x0008, 0xde2: 0x2971, 0xde3: 0x0ebd, 0xde4: 0x2989, 0xde5: 0x0008, 0xde6: 0x0008, 0xde7: 0xe07d, 0xde8: 0x0008, 0xde9: 0xe01d, 0xdea: 0x0008, 0xdeb: 0xe03d, 0xdec: 0x0008, 0xded: 0x0fe1, 0xdee: 0x1281, 0xdef: 0x0fc9, 0xdf0: 0x1141, 0xdf1: 0x0008, 0xdf2: 0xe00d, 0xdf3: 0x0008, 0xdf4: 0x0008, 0xdf5: 0xe01d, 0xdf6: 0x0008, 0xdf7: 0x0008, 0xdf8: 0x0008, 0xdf9: 0x0008, 0xdfa: 0x0008, 0xdfb: 0x0008, 0xdfc: 0x0259, 0xdfd: 0x1089, 0xdfe: 0x29a1, 0xdff: 0x29b9, // Block 0x38, offset 0xe00 0xe00: 0xe00d, 0xe01: 0x0008, 0xe02: 0xe00d, 0xe03: 0x0008, 0xe04: 0xe00d, 0xe05: 0x0008, 0xe06: 0xe00d, 0xe07: 0x0008, 0xe08: 0xe00d, 0xe09: 0x0008, 0xe0a: 0xe00d, 0xe0b: 0x0008, 0xe0c: 0xe00d, 0xe0d: 0x0008, 0xe0e: 0xe00d, 0xe0f: 0x0008, 0xe10: 0xe00d, 0xe11: 0x0008, 0xe12: 0xe00d, 0xe13: 0x0008, 0xe14: 0xe00d, 0xe15: 0x0008, 0xe16: 0xe00d, 0xe17: 0x0008, 0xe18: 0xe00d, 0xe19: 0x0008, 0xe1a: 0xe00d, 0xe1b: 0x0008, 0xe1c: 0xe00d, 0xe1d: 0x0008, 0xe1e: 0xe00d, 0xe1f: 0x0008, 0xe20: 0xe00d, 0xe21: 0x0008, 0xe22: 0xe00d, 0xe23: 0x0008, 0xe24: 0x0008, 0xe25: 0x0018, 0xe26: 0x0018, 0xe27: 0x0018, 0xe28: 0x0018, 0xe29: 0x0018, 0xe2a: 0x0018, 0xe2b: 0xe03d, 0xe2c: 0x0008, 0xe2d: 0xe01d, 0xe2e: 0x0008, 0xe2f: 0x3308, 0xe30: 0x3308, 0xe31: 0x3308, 0xe32: 0xe00d, 0xe33: 0x0008, 0xe34: 0x0040, 0xe35: 0x0040, 0xe36: 0x0040, 0xe37: 0x0040, 0xe38: 0x0040, 0xe39: 0x0018, 0xe3a: 0x0018, 0xe3b: 0x0018, 0xe3c: 0x0018, 0xe3d: 0x0018, 0xe3e: 0x0018, 0xe3f: 0x0018, // Block 0x39, offset 0xe40 0xe40: 0x26fd, 0xe41: 0x271d, 0xe42: 0x273d, 0xe43: 0x275d, 0xe44: 0x277d, 0xe45: 0x279d, 0xe46: 0x27bd, 0xe47: 0x27dd, 0xe48: 0x27fd, 0xe49: 0x281d, 0xe4a: 0x283d, 0xe4b: 0x285d, 0xe4c: 0x287d, 0xe4d: 0x289d, 0xe4e: 0x28bd, 0xe4f: 0x28dd, 0xe50: 0x28fd, 0xe51: 0x291d, 0xe52: 0x293d, 0xe53: 0x295d, 0xe54: 0x297d, 0xe55: 0x299d, 0xe56: 0x0040, 0xe57: 0x0040, 0xe58: 0x0040, 0xe59: 0x0040, 0xe5a: 0x0040, 0xe5b: 0x0040, 0xe5c: 0x0040, 0xe5d: 0x0040, 0xe5e: 0x0040, 0xe5f: 0x0040, 0xe60: 0x0040, 0xe61: 0x0040, 0xe62: 0x0040, 0xe63: 0x0040, 0xe64: 0x0040, 0xe65: 0x0040, 0xe66: 0x0040, 0xe67: 0x0040, 0xe68: 0x0040, 0xe69: 0x0040, 0xe6a: 0x0040, 0xe6b: 0x0040, 0xe6c: 0x0040, 0xe6d: 0x0040, 0xe6e: 0x0040, 0xe6f: 0x0040, 0xe70: 0x0040, 0xe71: 0x0040, 0xe72: 0x0040, 0xe73: 0x0040, 0xe74: 0x0040, 0xe75: 0x0040, 0xe76: 0x0040, 0xe77: 0x0040, 0xe78: 0x0040, 0xe79: 0x0040, 0xe7a: 0x0040, 0xe7b: 0x0040, 0xe7c: 0x0040, 0xe7d: 0x0040, 0xe7e: 0x0040, 0xe7f: 0x0040, // Block 0x3a, offset 0xe80 0xe80: 0x000a, 0xe81: 0x0018, 0xe82: 0x29d1, 0xe83: 0x0018, 0xe84: 0x0018, 0xe85: 0x0008, 0xe86: 0x0008, 0xe87: 0x0008, 0xe88: 0x0018, 0xe89: 0x0018, 0xe8a: 0x0018, 0xe8b: 0x0018, 0xe8c: 0x0018, 0xe8d: 0x0018, 0xe8e: 0x0018, 0xe8f: 0x0018, 0xe90: 0x0018, 0xe91: 0x0018, 0xe92: 0x0018, 0xe93: 0x0018, 0xe94: 0x0018, 0xe95: 0x0018, 0xe96: 0x0018, 0xe97: 0x0018, 0xe98: 0x0018, 0xe99: 0x0018, 0xe9a: 0x0018, 0xe9b: 0x0018, 0xe9c: 0x0018, 0xe9d: 0x0018, 0xe9e: 0x0018, 0xe9f: 0x0018, 0xea0: 0x0018, 0xea1: 0x0018, 0xea2: 0x0018, 0xea3: 0x0018, 0xea4: 0x0018, 0xea5: 0x0018, 0xea6: 0x0018, 0xea7: 0x0018, 0xea8: 0x0018, 0xea9: 0x0018, 0xeaa: 0x3308, 0xeab: 0x3308, 0xeac: 0x3308, 0xead: 0x3308, 0xeae: 0x3018, 0xeaf: 0x3018, 0xeb0: 0x0018, 0xeb1: 0x0018, 0xeb2: 0x0018, 0xeb3: 0x0018, 0xeb4: 0x0018, 0xeb5: 0x0018, 0xeb6: 0xe125, 0xeb7: 0x0018, 0xeb8: 0x29bd, 0xeb9: 0x29dd, 0xeba: 0x29fd, 0xebb: 0x0018, 0xebc: 0x0008, 0xebd: 0x0018, 0xebe: 0x0018, 0xebf: 0x0018, // Block 0x3b, offset 0xec0 0xec0: 0x2b3d, 0xec1: 0x2b5d, 0xec2: 0x2b7d, 0xec3: 0x2b9d, 0xec4: 0x2bbd, 0xec5: 0x2bdd, 0xec6: 0x2bdd, 0xec7: 0x2bdd, 0xec8: 0x2bfd, 0xec9: 0x2bfd, 0xeca: 0x2bfd, 0xecb: 0x2bfd, 0xecc: 0x2c1d, 0xecd: 0x2c1d, 0xece: 0x2c1d, 0xecf: 0x2c3d, 0xed0: 0x2c5d, 0xed1: 0x2c5d, 0xed2: 0x2a7d, 0xed3: 0x2a7d, 0xed4: 0x2c5d, 0xed5: 0x2c5d, 0xed6: 0x2c7d, 0xed7: 0x2c7d, 0xed8: 0x2c5d, 0xed9: 0x2c5d, 0xeda: 0x2a7d, 0xedb: 0x2a7d, 0xedc: 0x2c5d, 0xedd: 0x2c5d, 0xede: 0x2c3d, 0xedf: 0x2c3d, 0xee0: 0x2c9d, 0xee1: 0x2c9d, 0xee2: 0x2cbd, 0xee3: 0x2cbd, 0xee4: 0x0040, 0xee5: 0x2cdd, 0xee6: 0x2cfd, 0xee7: 0x2d1d, 0xee8: 0x2d1d, 0xee9: 0x2d3d, 0xeea: 0x2d5d, 0xeeb: 0x2d7d, 0xeec: 0x2d9d, 0xeed: 0x2dbd, 0xeee: 0x2ddd, 0xeef: 0x2dfd, 0xef0: 0x2e1d, 0xef1: 0x2e3d, 0xef2: 0x2e3d, 0xef3: 0x2e5d, 0xef4: 0x2e7d, 0xef5: 0x2e7d, 0xef6: 0x2e9d, 0xef7: 0x2ebd, 0xef8: 0x2e5d, 0xef9: 0x2edd, 0xefa: 0x2efd, 0xefb: 0x2edd, 0xefc: 0x2e5d, 0xefd: 0x2f1d, 0xefe: 0x2f3d, 0xeff: 0x2f5d, // Block 0x3c, offset 0xf00 0xf00: 0x2f7d, 0xf01: 0x2f9d, 0xf02: 0x2cfd, 0xf03: 0x2cdd, 0xf04: 0x2fbd, 0xf05: 0x2fdd, 0xf06: 0x2ffd, 0xf07: 0x301d, 0xf08: 0x303d, 0xf09: 0x305d, 0xf0a: 0x307d, 0xf0b: 0x309d, 0xf0c: 0x30bd, 0xf0d: 0x30dd, 0xf0e: 0x30fd, 0xf0f: 0x0040, 0xf10: 0x0018, 0xf11: 0x0018, 0xf12: 0x311d, 0xf13: 0x313d, 0xf14: 0x315d, 0xf15: 0x317d, 0xf16: 0x319d, 0xf17: 0x31bd, 0xf18: 0x31dd, 0xf19: 0x31fd, 0xf1a: 0x321d, 0xf1b: 0x323d, 0xf1c: 0x315d, 0xf1d: 0x325d, 0xf1e: 0x327d, 0xf1f: 0x329d, 0xf20: 0x0008, 0xf21: 0x0008, 0xf22: 0x0008, 0xf23: 0x0008, 0xf24: 0x0008, 0xf25: 0x0008, 0xf26: 0x0008, 0xf27: 0x0008, 0xf28: 0x0008, 0xf29: 0x0008, 0xf2a: 0x0008, 0xf2b: 0x0008, 0xf2c: 0x0008, 0xf2d: 0x0008, 0xf2e: 0x0008, 0xf2f: 0x0008, 0xf30: 0x0008, 0xf31: 0x0008, 0xf32: 0x0008, 0xf33: 0x0008, 0xf34: 0x0008, 0xf35: 0x0008, 0xf36: 0x0008, 0xf37: 0x0008, 0xf38: 0x0008, 0xf39: 0x0008, 0xf3a: 0x0008, 0xf3b: 0x0040, 0xf3c: 0x0040, 0xf3d: 0x0040, 0xf3e: 0x0040, 0xf3f: 0x0040, // Block 0x3d, offset 0xf40 0xf40: 0x36a2, 0xf41: 0x36d2, 0xf42: 0x3702, 0xf43: 0x3732, 0xf44: 0x32bd, 0xf45: 0x32dd, 0xf46: 0x32fd, 0xf47: 0x331d, 0xf48: 0x0018, 0xf49: 0x0018, 0xf4a: 0x0018, 0xf4b: 0x0018, 0xf4c: 0x0018, 0xf4d: 0x0018, 0xf4e: 0x0018, 0xf4f: 0x0018, 0xf50: 0x333d, 0xf51: 0x3761, 0xf52: 0x3779, 0xf53: 0x3791, 0xf54: 0x37a9, 0xf55: 0x37c1, 0xf56: 0x37d9, 0xf57: 0x37f1, 0xf58: 0x3809, 0xf59: 0x3821, 0xf5a: 0x3839, 0xf5b: 0x3851, 0xf5c: 0x3869, 0xf5d: 0x3881, 0xf5e: 0x3899, 0xf5f: 0x38b1, 0xf60: 0x335d, 0xf61: 0x337d, 0xf62: 0x339d, 0xf63: 0x33bd, 0xf64: 0x33dd, 0xf65: 0x33dd, 0xf66: 0x33fd, 0xf67: 0x341d, 0xf68: 0x343d, 0xf69: 0x345d, 0xf6a: 0x347d, 0xf6b: 0x349d, 0xf6c: 0x34bd, 0xf6d: 0x34dd, 0xf6e: 0x34fd, 0xf6f: 0x351d, 0xf70: 0x353d, 0xf71: 0x355d, 0xf72: 0x357d, 0xf73: 0x359d, 0xf74: 0x35bd, 0xf75: 0x35dd, 0xf76: 0x35fd, 0xf77: 0x361d, 0xf78: 0x363d, 0xf79: 0x365d, 0xf7a: 0x367d, 0xf7b: 0x369d, 0xf7c: 0x38c9, 0xf7d: 0x3901, 0xf7e: 0x36bd, 0xf7f: 0x0018, // Block 0x3e, offset 0xf80 0xf80: 0x36dd, 0xf81: 0x36fd, 0xf82: 0x371d, 0xf83: 0x373d, 0xf84: 0x375d, 0xf85: 0x377d, 0xf86: 0x379d, 0xf87: 0x37bd, 0xf88: 0x37dd, 0xf89: 0x37fd, 0xf8a: 0x381d, 0xf8b: 0x383d, 0xf8c: 0x385d, 0xf8d: 0x387d, 0xf8e: 0x389d, 0xf8f: 0x38bd, 0xf90: 0x38dd, 0xf91: 0x38fd, 0xf92: 0x391d, 0xf93: 0x393d, 0xf94: 0x395d, 0xf95: 0x397d, 0xf96: 0x399d, 0xf97: 0x39bd, 0xf98: 0x39dd, 0xf99: 0x39fd, 0xf9a: 0x3a1d, 0xf9b: 0x3a3d, 0xf9c: 0x3a5d, 0xf9d: 0x3a7d, 0xf9e: 0x3a9d, 0xf9f: 0x3abd, 0xfa0: 0x3add, 0xfa1: 0x3afd, 0xfa2: 0x3b1d, 0xfa3: 0x3b3d, 0xfa4: 0x3b5d, 0xfa5: 0x3b7d, 0xfa6: 0x127d, 0xfa7: 0x3b9d, 0xfa8: 0x3bbd, 0xfa9: 0x3bdd, 0xfaa: 0x3bfd, 0xfab: 0x3c1d, 0xfac: 0x3c3d, 0xfad: 0x3c5d, 0xfae: 0x239d, 0xfaf: 0x3c7d, 0xfb0: 0x3c9d, 0xfb1: 0x3939, 0xfb2: 0x3951, 0xfb3: 0x3969, 0xfb4: 0x3981, 0xfb5: 0x3999, 0xfb6: 0x39b1, 0xfb7: 0x39c9, 0xfb8: 0x39e1, 0xfb9: 0x39f9, 0xfba: 0x3a11, 0xfbb: 0x3a29, 0xfbc: 0x3a41, 0xfbd: 0x3a59, 0xfbe: 0x3a71, 0xfbf: 0x3a89, // Block 0x3f, offset 0xfc0 0xfc0: 0x3aa1, 0xfc1: 0x3ac9, 0xfc2: 0x3af1, 0xfc3: 0x3b19, 0xfc4: 0x3b41, 0xfc5: 0x3b69, 0xfc6: 0x3b91, 0xfc7: 0x3bb9, 0xfc8: 0x3be1, 0xfc9: 0x3c09, 0xfca: 0x3c39, 0xfcb: 0x3c69, 0xfcc: 0x3c99, 0xfcd: 0x3cbd, 0xfce: 0x3cb1, 0xfcf: 0x3cdd, 0xfd0: 0x3cfd, 0xfd1: 0x3d15, 0xfd2: 0x3d2d, 0xfd3: 0x3d45, 0xfd4: 0x3d5d, 0xfd5: 0x3d5d, 0xfd6: 0x3d45, 0xfd7: 0x3d75, 0xfd8: 0x07bd, 0xfd9: 0x3d8d, 0xfda: 0x3da5, 0xfdb: 0x3dbd, 0xfdc: 0x3dd5, 0xfdd: 0x3ded, 0xfde: 0x3e05, 0xfdf: 0x3e1d, 0xfe0: 0x3e35, 0xfe1: 0x3e4d, 0xfe2: 0x3e65, 0xfe3: 0x3e7d, 0xfe4: 0x3e95, 0xfe5: 0x3e95, 0xfe6: 0x3ead, 0xfe7: 0x3ead, 0xfe8: 0x3ec5, 0xfe9: 0x3ec5, 0xfea: 0x3edd, 0xfeb: 0x3ef5, 0xfec: 0x3f0d, 0xfed: 0x3f25, 0xfee: 0x3f3d, 0xfef: 0x3f3d, 0xff0: 0x3f55, 0xff1: 0x3f55, 0xff2: 0x3f55, 0xff3: 0x3f6d, 0xff4: 0x3f85, 0xff5: 0x3f9d, 0xff6: 0x3fb5, 0xff7: 0x3f9d, 0xff8: 0x3fcd, 0xff9: 0x3fe5, 0xffa: 0x3f6d, 0xffb: 0x3ffd, 0xffc: 0x4015, 0xffd: 0x4015, 0xffe: 0x4015, 0xfff: 0x0040, // Block 0x40, offset 0x1000 0x1000: 0x3cc9, 0x1001: 0x3d31, 0x1002: 0x3d99, 0x1003: 0x3e01, 0x1004: 0x3e51, 0x1005: 0x3eb9, 0x1006: 0x3f09, 0x1007: 0x3f59, 0x1008: 0x3fd9, 0x1009: 0x4041, 0x100a: 0x4091, 0x100b: 0x40e1, 0x100c: 0x4131, 0x100d: 0x4199, 0x100e: 0x4201, 0x100f: 0x4251, 0x1010: 0x42a1, 0x1011: 0x42d9, 0x1012: 0x4329, 0x1013: 0x4391, 0x1014: 0x43f9, 0x1015: 0x4431, 0x1016: 0x44b1, 0x1017: 0x4549, 0x1018: 0x45c9, 0x1019: 0x4619, 0x101a: 0x4699, 0x101b: 0x4719, 0x101c: 0x4781, 0x101d: 0x47d1, 0x101e: 0x4821, 0x101f: 0x4871, 0x1020: 0x48d9, 0x1021: 0x4959, 0x1022: 0x49c1, 0x1023: 0x4a11, 0x1024: 0x4a61, 0x1025: 0x4ab1, 0x1026: 0x4ae9, 0x1027: 0x4b21, 0x1028: 0x4b59, 0x1029: 0x4b91, 0x102a: 0x4be1, 0x102b: 0x4c31, 0x102c: 0x4cb1, 0x102d: 0x4d01, 0x102e: 0x4d69, 0x102f: 0x4de9, 0x1030: 0x4e39, 0x1031: 0x4e71, 0x1032: 0x4ea9, 0x1033: 0x4f29, 0x1034: 0x4f91, 0x1035: 0x5011, 0x1036: 0x5061, 0x1037: 0x50e1, 0x1038: 0x5119, 0x1039: 0x5169, 0x103a: 0x51b9, 0x103b: 0x5209, 0x103c: 0x5259, 0x103d: 0x52a9, 0x103e: 0x5311, 0x103f: 0x5361, // Block 0x41, offset 0x1040 0x1040: 0x5399, 0x1041: 0x53e9, 0x1042: 0x5439, 0x1043: 0x5489, 0x1044: 0x54f1, 0x1045: 0x5541, 0x1046: 0x5591, 0x1047: 0x55e1, 0x1048: 0x5661, 0x1049: 0x56c9, 0x104a: 0x5701, 0x104b: 0x5781, 0x104c: 0x57b9, 0x104d: 0x5821, 0x104e: 0x5889, 0x104f: 0x58d9, 0x1050: 0x5929, 0x1051: 0x5979, 0x1052: 0x59e1, 0x1053: 0x5a19, 0x1054: 0x5a69, 0x1055: 0x5ad1, 0x1056: 0x5b09, 0x1057: 0x5b89, 0x1058: 0x5bd9, 0x1059: 0x5c01, 0x105a: 0x5c29, 0x105b: 0x5c51, 0x105c: 0x5c79, 0x105d: 0x5ca1, 0x105e: 0x5cc9, 0x105f: 0x5cf1, 0x1060: 0x5d19, 0x1061: 0x5d41, 0x1062: 0x5d69, 0x1063: 0x5d99, 0x1064: 0x5dc9, 0x1065: 0x5df9, 0x1066: 0x5e29, 0x1067: 0x5e59, 0x1068: 0x5e89, 0x1069: 0x5eb9, 0x106a: 0x5ee9, 0x106b: 0x5f19, 0x106c: 0x5f49, 0x106d: 0x5f79, 0x106e: 0x5fa9, 0x106f: 0x5fd9, 0x1070: 0x6009, 0x1071: 0x402d, 0x1072: 0x6039, 0x1073: 0x6051, 0x1074: 0x404d, 0x1075: 0x6069, 0x1076: 0x6081, 0x1077: 0x6099, 0x1078: 0x406d, 0x1079: 0x406d, 0x107a: 0x60b1, 0x107b: 0x60c9, 0x107c: 0x6101, 0x107d: 0x6139, 0x107e: 0x6171, 0x107f: 0x61a9, // Block 0x42, offset 0x1080 0x1080: 0x6211, 0x1081: 0x6229, 0x1082: 0x408d, 0x1083: 0x6241, 0x1084: 0x6259, 0x1085: 0x6271, 0x1086: 0x6289, 0x1087: 0x62a1, 0x1088: 0x40ad, 0x1089: 0x62b9, 0x108a: 0x62e1, 0x108b: 0x62f9, 0x108c: 0x40cd, 0x108d: 0x40cd, 0x108e: 0x6311, 0x108f: 0x6329, 0x1090: 0x6341, 0x1091: 0x40ed, 0x1092: 0x410d, 0x1093: 0x412d, 0x1094: 0x414d, 0x1095: 0x416d, 0x1096: 0x6359, 0x1097: 0x6371, 0x1098: 0x6389, 0x1099: 0x63a1, 0x109a: 0x63b9, 0x109b: 0x418d, 0x109c: 0x63d1, 0x109d: 0x63e9, 0x109e: 0x6401, 0x109f: 0x41ad, 0x10a0: 0x41cd, 0x10a1: 0x6419, 0x10a2: 0x41ed, 0x10a3: 0x420d, 0x10a4: 0x422d, 0x10a5: 0x6431, 0x10a6: 0x424d, 0x10a7: 0x6449, 0x10a8: 0x6479, 0x10a9: 0x6211, 0x10aa: 0x426d, 0x10ab: 0x428d, 0x10ac: 0x42ad, 0x10ad: 0x42cd, 0x10ae: 0x64b1, 0x10af: 0x64f1, 0x10b0: 0x6539, 0x10b1: 0x6551, 0x10b2: 0x42ed, 0x10b3: 0x6569, 0x10b4: 0x6581, 0x10b5: 0x6599, 0x10b6: 0x430d, 0x10b7: 0x65b1, 0x10b8: 0x65c9, 0x10b9: 0x65b1, 0x10ba: 0x65e1, 0x10bb: 0x65f9, 0x10bc: 0x432d, 0x10bd: 0x6611, 0x10be: 0x6629, 0x10bf: 0x6611, // Block 0x43, offset 0x10c0 0x10c0: 0x434d, 0x10c1: 0x436d, 0x10c2: 0x0040, 0x10c3: 0x6641, 0x10c4: 0x6659, 0x10c5: 0x6671, 0x10c6: 0x6689, 0x10c7: 0x0040, 0x10c8: 0x66c1, 0x10c9: 0x66d9, 0x10ca: 0x66f1, 0x10cb: 0x6709, 0x10cc: 0x6721, 0x10cd: 0x6739, 0x10ce: 0x6401, 0x10cf: 0x6751, 0x10d0: 0x6769, 0x10d1: 0x6781, 0x10d2: 0x438d, 0x10d3: 0x6799, 0x10d4: 0x6289, 0x10d5: 0x43ad, 0x10d6: 0x43cd, 0x10d7: 0x67b1, 0x10d8: 0x0040, 0x10d9: 0x43ed, 0x10da: 0x67c9, 0x10db: 0x67e1, 0x10dc: 0x67f9, 0x10dd: 0x6811, 0x10de: 0x6829, 0x10df: 0x6859, 0x10e0: 0x6889, 0x10e1: 0x68b1, 0x10e2: 0x68d9, 0x10e3: 0x6901, 0x10e4: 0x6929, 0x10e5: 0x6951, 0x10e6: 0x6979, 0x10e7: 0x69a1, 0x10e8: 0x69c9, 0x10e9: 0x69f1, 0x10ea: 0x6a21, 0x10eb: 0x6a51, 0x10ec: 0x6a81, 0x10ed: 0x6ab1, 0x10ee: 0x6ae1, 0x10ef: 0x6b11, 0x10f0: 0x6b41, 0x10f1: 0x6b71, 0x10f2: 0x6ba1, 0x10f3: 0x6bd1, 0x10f4: 0x6c01, 0x10f5: 0x6c31, 0x10f6: 0x6c61, 0x10f7: 0x6c91, 0x10f8: 0x6cc1, 0x10f9: 0x6cf1, 0x10fa: 0x6d21, 0x10fb: 0x6d51, 0x10fc: 0x6d81, 0x10fd: 0x6db1, 0x10fe: 0x6de1, 0x10ff: 0x440d, // Block 0x44, offset 0x1100 0x1100: 0xe00d, 0x1101: 0x0008, 0x1102: 0xe00d, 0x1103: 0x0008, 0x1104: 0xe00d, 0x1105: 0x0008, 0x1106: 0xe00d, 0x1107: 0x0008, 0x1108: 0xe00d, 0x1109: 0x0008, 0x110a: 0xe00d, 0x110b: 0x0008, 0x110c: 0xe00d, 0x110d: 0x0008, 0x110e: 0xe00d, 0x110f: 0x0008, 0x1110: 0xe00d, 0x1111: 0x0008, 0x1112: 0xe00d, 0x1113: 0x0008, 0x1114: 0xe00d, 0x1115: 0x0008, 0x1116: 0xe00d, 0x1117: 0x0008, 0x1118: 0xe00d, 0x1119: 0x0008, 0x111a: 0xe00d, 0x111b: 0x0008, 0x111c: 0xe00d, 0x111d: 0x0008, 0x111e: 0xe00d, 0x111f: 0x0008, 0x1120: 0xe00d, 0x1121: 0x0008, 0x1122: 0xe00d, 0x1123: 0x0008, 0x1124: 0xe00d, 0x1125: 0x0008, 0x1126: 0xe00d, 0x1127: 0x0008, 0x1128: 0xe00d, 0x1129: 0x0008, 0x112a: 0xe00d, 0x112b: 0x0008, 0x112c: 0xe00d, 0x112d: 0x0008, 0x112e: 0x0008, 0x112f: 0x3308, 0x1130: 0x3318, 0x1131: 0x3318, 0x1132: 0x3318, 0x1133: 0x0018, 0x1134: 0x3308, 0x1135: 0x3308, 0x1136: 0x3308, 0x1137: 0x3308, 0x1138: 0x3308, 0x1139: 0x3308, 0x113a: 0x3308, 0x113b: 0x3308, 0x113c: 0x3308, 0x113d: 0x3308, 0x113e: 0x0018, 0x113f: 0x0008, // Block 0x45, offset 0x1140 0x1140: 0xe00d, 0x1141: 0x0008, 0x1142: 0xe00d, 0x1143: 0x0008, 0x1144: 0xe00d, 0x1145: 0x0008, 0x1146: 0xe00d, 0x1147: 0x0008, 0x1148: 0xe00d, 0x1149: 0x0008, 0x114a: 0xe00d, 0x114b: 0x0008, 0x114c: 0xe00d, 0x114d: 0x0008, 0x114e: 0xe00d, 0x114f: 0x0008, 0x1150: 0xe00d, 0x1151: 0x0008, 0x1152: 0xe00d, 0x1153: 0x0008, 0x1154: 0xe00d, 0x1155: 0x0008, 0x1156: 0xe00d, 0x1157: 0x0008, 0x1158: 0xe00d, 0x1159: 0x0008, 0x115a: 0xe00d, 0x115b: 0x0008, 0x115c: 0x0ea1, 0x115d: 0x6e11, 0x115e: 0x3308, 0x115f: 0x3308, 0x1160: 0x0008, 0x1161: 0x0008, 0x1162: 0x0008, 0x1163: 0x0008, 0x1164: 0x0008, 0x1165: 0x0008, 0x1166: 0x0008, 0x1167: 0x0008, 0x1168: 0x0008, 0x1169: 0x0008, 0x116a: 0x0008, 0x116b: 0x0008, 0x116c: 0x0008, 0x116d: 0x0008, 0x116e: 0x0008, 0x116f: 0x0008, 0x1170: 0x0008, 0x1171: 0x0008, 0x1172: 0x0008, 0x1173: 0x0008, 0x1174: 0x0008, 0x1175: 0x0008, 0x1176: 0x0008, 0x1177: 0x0008, 0x1178: 0x0008, 0x1179: 0x0008, 0x117a: 0x0008, 0x117b: 0x0008, 0x117c: 0x0008, 0x117d: 0x0008, 0x117e: 0x0008, 0x117f: 0x0008, // Block 0x46, offset 0x1180 0x1180: 0x0018, 0x1181: 0x0018, 0x1182: 0x0018, 0x1183: 0x0018, 0x1184: 0x0018, 0x1185: 0x0018, 0x1186: 0x0018, 0x1187: 0x0018, 0x1188: 0x0018, 0x1189: 0x0018, 0x118a: 0x0018, 0x118b: 0x0018, 0x118c: 0x0018, 0x118d: 0x0018, 0x118e: 0x0018, 0x118f: 0x0018, 0x1190: 0x0018, 0x1191: 0x0018, 0x1192: 0x0018, 0x1193: 0x0018, 0x1194: 0x0018, 0x1195: 0x0018, 0x1196: 0x0018, 0x1197: 0x0008, 0x1198: 0x0008, 0x1199: 0x0008, 0x119a: 0x0008, 0x119b: 0x0008, 0x119c: 0x0008, 0x119d: 0x0008, 0x119e: 0x0008, 0x119f: 0x0008, 0x11a0: 0x0018, 0x11a1: 0x0018, 0x11a2: 0xe00d, 0x11a3: 0x0008, 0x11a4: 0xe00d, 0x11a5: 0x0008, 0x11a6: 0xe00d, 0x11a7: 0x0008, 0x11a8: 0xe00d, 0x11a9: 0x0008, 0x11aa: 0xe00d, 0x11ab: 0x0008, 0x11ac: 0xe00d, 0x11ad: 0x0008, 0x11ae: 0xe00d, 0x11af: 0x0008, 0x11b0: 0x0008, 0x11b1: 0x0008, 0x11b2: 0xe00d, 0x11b3: 0x0008, 0x11b4: 0xe00d, 0x11b5: 0x0008, 0x11b6: 0xe00d, 0x11b7: 0x0008, 0x11b8: 0xe00d, 0x11b9: 0x0008, 0x11ba: 0xe00d, 0x11bb: 0x0008, 0x11bc: 0xe00d, 0x11bd: 0x0008, 0x11be: 0xe00d, 0x11bf: 0x0008, // Block 0x47, offset 0x11c0 0x11c0: 0xe00d, 0x11c1: 0x0008, 0x11c2: 0xe00d, 0x11c3: 0x0008, 0x11c4: 0xe00d, 0x11c5: 0x0008, 0x11c6: 0xe00d, 0x11c7: 0x0008, 0x11c8: 0xe00d, 0x11c9: 0x0008, 0x11ca: 0xe00d, 0x11cb: 0x0008, 0x11cc: 0xe00d, 0x11cd: 0x0008, 0x11ce: 0xe00d, 0x11cf: 0x0008, 0x11d0: 0xe00d, 0x11d1: 0x0008, 0x11d2: 0xe00d, 0x11d3: 0x0008, 0x11d4: 0xe00d, 0x11d5: 0x0008, 0x11d6: 0xe00d, 0x11d7: 0x0008, 0x11d8: 0xe00d, 0x11d9: 0x0008, 0x11da: 0xe00d, 0x11db: 0x0008, 0x11dc: 0xe00d, 0x11dd: 0x0008, 0x11de: 0xe00d, 0x11df: 0x0008, 0x11e0: 0xe00d, 0x11e1: 0x0008, 0x11e2: 0xe00d, 0x11e3: 0x0008, 0x11e4: 0xe00d, 0x11e5: 0x0008, 0x11e6: 0xe00d, 0x11e7: 0x0008, 0x11e8: 0xe00d, 0x11e9: 0x0008, 0x11ea: 0xe00d, 0x11eb: 0x0008, 0x11ec: 0xe00d, 0x11ed: 0x0008, 0x11ee: 0xe00d, 0x11ef: 0x0008, 0x11f0: 0xe0fd, 0x11f1: 0x0008, 0x11f2: 0x0008, 0x11f3: 0x0008, 0x11f4: 0x0008, 0x11f5: 0x0008, 0x11f6: 0x0008, 0x11f7: 0x0008, 0x11f8: 0x0008, 0x11f9: 0xe01d, 0x11fa: 0x0008, 0x11fb: 0xe03d, 0x11fc: 0x0008, 0x11fd: 0x442d, 0x11fe: 0xe00d, 0x11ff: 0x0008, // Block 0x48, offset 0x1200 0x1200: 0xe00d, 0x1201: 0x0008, 0x1202: 0xe00d, 0x1203: 0x0008, 0x1204: 0xe00d, 0x1205: 0x0008, 0x1206: 0xe00d, 0x1207: 0x0008, 0x1208: 0x0008, 0x1209: 0x0018, 0x120a: 0x0018, 0x120b: 0xe03d, 0x120c: 0x0008, 0x120d: 0x11d9, 0x120e: 0x0008, 0x120f: 0x0008, 0x1210: 0xe00d, 0x1211: 0x0008, 0x1212: 0xe00d, 0x1213: 0x0008, 0x1214: 0x0008, 0x1215: 0x0008, 0x1216: 0xe00d, 0x1217: 0x0008, 0x1218: 0xe00d, 0x1219: 0x0008, 0x121a: 0xe00d, 0x121b: 0x0008, 0x121c: 0xe00d, 0x121d: 0x0008, 0x121e: 0xe00d, 0x121f: 0x0008, 0x1220: 0xe00d, 0x1221: 0x0008, 0x1222: 0xe00d, 0x1223: 0x0008, 0x1224: 0xe00d, 0x1225: 0x0008, 0x1226: 0xe00d, 0x1227: 0x0008, 0x1228: 0xe00d, 0x1229: 0x0008, 0x122a: 0x6e29, 0x122b: 0x1029, 0x122c: 0x11c1, 0x122d: 0x6e41, 0x122e: 0x1221, 0x122f: 0x0008, 0x1230: 0x6e59, 0x1231: 0x6e71, 0x1232: 0x1239, 0x1233: 0x444d, 0x1234: 0xe00d, 0x1235: 0x0008, 0x1236: 0xe00d, 0x1237: 0x0008, 0x1238: 0x0040, 0x1239: 0x0008, 0x123a: 0x0040, 0x123b: 0x0040, 0x123c: 0x0040, 0x123d: 0x0040, 0x123e: 0x0040, 0x123f: 0x0040, // Block 0x49, offset 0x1240 0x1240: 0x64d5, 0x1241: 0x64f5, 0x1242: 0x6515, 0x1243: 0x6535, 0x1244: 0x6555, 0x1245: 0x6575, 0x1246: 0x6595, 0x1247: 0x65b5, 0x1248: 0x65d5, 0x1249: 0x65f5, 0x124a: 0x6615, 0x124b: 0x6635, 0x124c: 0x6655, 0x124d: 0x6675, 0x124e: 0x0008, 0x124f: 0x0008, 0x1250: 0x6695, 0x1251: 0x0008, 0x1252: 0x66b5, 0x1253: 0x0008, 0x1254: 0x0008, 0x1255: 0x66d5, 0x1256: 0x66f5, 0x1257: 0x6715, 0x1258: 0x6735, 0x1259: 0x6755, 0x125a: 0x6775, 0x125b: 0x6795, 0x125c: 0x67b5, 0x125d: 0x67d5, 0x125e: 0x67f5, 0x125f: 0x0008, 0x1260: 0x6815, 0x1261: 0x0008, 0x1262: 0x6835, 0x1263: 0x0008, 0x1264: 0x0008, 0x1265: 0x6855, 0x1266: 0x6875, 0x1267: 0x0008, 0x1268: 0x0008, 0x1269: 0x0008, 0x126a: 0x6895, 0x126b: 0x68b5, 0x126c: 0x68d5, 0x126d: 0x68f5, 0x126e: 0x6915, 0x126f: 0x6935, 0x1270: 0x6955, 0x1271: 0x6975, 0x1272: 0x6995, 0x1273: 0x69b5, 0x1274: 0x69d5, 0x1275: 0x69f5, 0x1276: 0x6a15, 0x1277: 0x6a35, 0x1278: 0x6a55, 0x1279: 0x6a75, 0x127a: 0x6a95, 0x127b: 0x6ab5, 0x127c: 0x6ad5, 0x127d: 0x6af5, 0x127e: 0x6b15, 0x127f: 0x6b35, // Block 0x4a, offset 0x1280 0x1280: 0x7a95, 0x1281: 0x7ab5, 0x1282: 0x7ad5, 0x1283: 0x7af5, 0x1284: 0x7b15, 0x1285: 0x7b35, 0x1286: 0x7b55, 0x1287: 0x7b75, 0x1288: 0x7b95, 0x1289: 0x7bb5, 0x128a: 0x7bd5, 0x128b: 0x7bf5, 0x128c: 0x7c15, 0x128d: 0x7c35, 0x128e: 0x7c55, 0x128f: 0x6ec9, 0x1290: 0x6ef1, 0x1291: 0x6f19, 0x1292: 0x7c75, 0x1293: 0x7c95, 0x1294: 0x7cb5, 0x1295: 0x6f41, 0x1296: 0x6f69, 0x1297: 0x6f91, 0x1298: 0x7cd5, 0x1299: 0x7cf5, 0x129a: 0x0040, 0x129b: 0x0040, 0x129c: 0x0040, 0x129d: 0x0040, 0x129e: 0x0040, 0x129f: 0x0040, 0x12a0: 0x0040, 0x12a1: 0x0040, 0x12a2: 0x0040, 0x12a3: 0x0040, 0x12a4: 0x0040, 0x12a5: 0x0040, 0x12a6: 0x0040, 0x12a7: 0x0040, 0x12a8: 0x0040, 0x12a9: 0x0040, 0x12aa: 0x0040, 0x12ab: 0x0040, 0x12ac: 0x0040, 0x12ad: 0x0040, 0x12ae: 0x0040, 0x12af: 0x0040, 0x12b0: 0x0040, 0x12b1: 0x0040, 0x12b2: 0x0040, 0x12b3: 0x0040, 0x12b4: 0x0040, 0x12b5: 0x0040, 0x12b6: 0x0040, 0x12b7: 0x0040, 0x12b8: 0x0040, 0x12b9: 0x0040, 0x12ba: 0x0040, 0x12bb: 0x0040, 0x12bc: 0x0040, 0x12bd: 0x0040, 0x12be: 0x0040, 0x12bf: 0x0040, // Block 0x4b, offset 0x12c0 0x12c0: 0x6fb9, 0x12c1: 0x6fd1, 0x12c2: 0x6fe9, 0x12c3: 0x7d15, 0x12c4: 0x7d35, 0x12c5: 0x7001, 0x12c6: 0x7001, 0x12c7: 0x0040, 0x12c8: 0x0040, 0x12c9: 0x0040, 0x12ca: 0x0040, 0x12cb: 0x0040, 0x12cc: 0x0040, 0x12cd: 0x0040, 0x12ce: 0x0040, 0x12cf: 0x0040, 0x12d0: 0x0040, 0x12d1: 0x0040, 0x12d2: 0x0040, 0x12d3: 0x7019, 0x12d4: 0x7041, 0x12d5: 0x7069, 0x12d6: 0x7091, 0x12d7: 0x70b9, 0x12d8: 0x0040, 0x12d9: 0x0040, 0x12da: 0x0040, 0x12db: 0x0040, 0x12dc: 0x0040, 0x12dd: 0x70e1, 0x12de: 0x3308, 0x12df: 0x7109, 0x12e0: 0x7131, 0x12e1: 0x20a9, 0x12e2: 0x20f1, 0x12e3: 0x7149, 0x12e4: 0x7161, 0x12e5: 0x7179, 0x12e6: 0x7191, 0x12e7: 0x71a9, 0x12e8: 0x71c1, 0x12e9: 0x1fb2, 0x12ea: 0x71d9, 0x12eb: 0x7201, 0x12ec: 0x7229, 0x12ed: 0x7261, 0x12ee: 0x7299, 0x12ef: 0x72c1, 0x12f0: 0x72e9, 0x12f1: 0x7311, 0x12f2: 0x7339, 0x12f3: 0x7361, 0x12f4: 0x7389, 0x12f5: 0x73b1, 0x12f6: 0x73d9, 0x12f7: 0x0040, 0x12f8: 0x7401, 0x12f9: 0x7429, 0x12fa: 0x7451, 0x12fb: 0x7479, 0x12fc: 0x74a1, 0x12fd: 0x0040, 0x12fe: 0x74c9, 0x12ff: 0x0040, // Block 0x4c, offset 0x1300 0x1300: 0x74f1, 0x1301: 0x7519, 0x1302: 0x0040, 0x1303: 0x7541, 0x1304: 0x7569, 0x1305: 0x0040, 0x1306: 0x7591, 0x1307: 0x75b9, 0x1308: 0x75e1, 0x1309: 0x7609, 0x130a: 0x7631, 0x130b: 0x7659, 0x130c: 0x7681, 0x130d: 0x76a9, 0x130e: 0x76d1, 0x130f: 0x76f9, 0x1310: 0x7721, 0x1311: 0x7721, 0x1312: 0x7739, 0x1313: 0x7739, 0x1314: 0x7739, 0x1315: 0x7739, 0x1316: 0x7751, 0x1317: 0x7751, 0x1318: 0x7751, 0x1319: 0x7751, 0x131a: 0x7769, 0x131b: 0x7769, 0x131c: 0x7769, 0x131d: 0x7769, 0x131e: 0x7781, 0x131f: 0x7781, 0x1320: 0x7781, 0x1321: 0x7781, 0x1322: 0x7799, 0x1323: 0x7799, 0x1324: 0x7799, 0x1325: 0x7799, 0x1326: 0x77b1, 0x1327: 0x77b1, 0x1328: 0x77b1, 0x1329: 0x77b1, 0x132a: 0x77c9, 0x132b: 0x77c9, 0x132c: 0x77c9, 0x132d: 0x77c9, 0x132e: 0x77e1, 0x132f: 0x77e1, 0x1330: 0x77e1, 0x1331: 0x77e1, 0x1332: 0x77f9, 0x1333: 0x77f9, 0x1334: 0x77f9, 0x1335: 0x77f9, 0x1336: 0x7811, 0x1337: 0x7811, 0x1338: 0x7811, 0x1339: 0x7811, 0x133a: 0x7829, 0x133b: 0x7829, 0x133c: 0x7829, 0x133d: 0x7829, 0x133e: 0x7841, 0x133f: 0x7841, // Block 0x4d, offset 0x1340 0x1340: 0x7841, 0x1341: 0x7841, 0x1342: 0x7859, 0x1343: 0x7859, 0x1344: 0x7871, 0x1345: 0x7871, 0x1346: 0x7889, 0x1347: 0x7889, 0x1348: 0x78a1, 0x1349: 0x78a1, 0x134a: 0x78b9, 0x134b: 0x78b9, 0x134c: 0x78d1, 0x134d: 0x78d1, 0x134e: 0x78e9, 0x134f: 0x78e9, 0x1350: 0x78e9, 0x1351: 0x78e9, 0x1352: 0x7901, 0x1353: 0x7901, 0x1354: 0x7901, 0x1355: 0x7901, 0x1356: 0x7919, 0x1357: 0x7919, 0x1358: 0x7919, 0x1359: 0x7919, 0x135a: 0x7931, 0x135b: 0x7931, 0x135c: 0x7931, 0x135d: 0x7931, 0x135e: 0x7949, 0x135f: 0x7949, 0x1360: 0x7961, 0x1361: 0x7961, 0x1362: 0x7961, 0x1363: 0x7961, 0x1364: 0x7979, 0x1365: 0x7979, 0x1366: 0x7991, 0x1367: 0x7991, 0x1368: 0x7991, 0x1369: 0x7991, 0x136a: 0x79a9, 0x136b: 0x79a9, 0x136c: 0x79a9, 0x136d: 0x79a9, 0x136e: 0x79c1, 0x136f: 0x79c1, 0x1370: 0x79d9, 0x1371: 0x79d9, 0x1372: 0x0818, 0x1373: 0x0818, 0x1374: 0x0818, 0x1375: 0x0818, 0x1376: 0x0818, 0x1377: 0x0818, 0x1378: 0x0818, 0x1379: 0x0818, 0x137a: 0x0818, 0x137b: 0x0818, 0x137c: 0x0818, 0x137d: 0x0818, 0x137e: 0x0818, 0x137f: 0x0818, // Block 0x4e, offset 0x1380 0x1380: 0x0818, 0x1381: 0x0818, 0x1382: 0x0040, 0x1383: 0x0040, 0x1384: 0x0040, 0x1385: 0x0040, 0x1386: 0x0040, 0x1387: 0x0040, 0x1388: 0x0040, 0x1389: 0x0040, 0x138a: 0x0040, 0x138b: 0x0040, 0x138c: 0x0040, 0x138d: 0x0040, 0x138e: 0x0040, 0x138f: 0x0040, 0x1390: 0x0040, 0x1391: 0x0040, 0x1392: 0x0040, 0x1393: 0x79f1, 0x1394: 0x79f1, 0x1395: 0x79f1, 0x1396: 0x79f1, 0x1397: 0x7a09, 0x1398: 0x7a09, 0x1399: 0x7a21, 0x139a: 0x7a21, 0x139b: 0x7a39, 0x139c: 0x7a39, 0x139d: 0x0479, 0x139e: 0x7a51, 0x139f: 0x7a51, 0x13a0: 0x7a69, 0x13a1: 0x7a69, 0x13a2: 0x7a81, 0x13a3: 0x7a81, 0x13a4: 0x7a99, 0x13a5: 0x7a99, 0x13a6: 0x7a99, 0x13a7: 0x7a99, 0x13a8: 0x7ab1, 0x13a9: 0x7ab1, 0x13aa: 0x7ac9, 0x13ab: 0x7ac9, 0x13ac: 0x7af1, 0x13ad: 0x7af1, 0x13ae: 0x7b19, 0x13af: 0x7b19, 0x13b0: 0x7b41, 0x13b1: 0x7b41, 0x13b2: 0x7b69, 0x13b3: 0x7b69, 0x13b4: 0x7b91, 0x13b5: 0x7b91, 0x13b6: 0x7bb9, 0x13b7: 0x7bb9, 0x13b8: 0x7bb9, 0x13b9: 0x7be1, 0x13ba: 0x7be1, 0x13bb: 0x7be1, 0x13bc: 0x7c09, 0x13bd: 0x7c09, 0x13be: 0x7c09, 0x13bf: 0x7c09, // Block 0x4f, offset 0x13c0 0x13c0: 0x85f9, 0x13c1: 0x8621, 0x13c2: 0x8649, 0x13c3: 0x8671, 0x13c4: 0x8699, 0x13c5: 0x86c1, 0x13c6: 0x86e9, 0x13c7: 0x8711, 0x13c8: 0x8739, 0x13c9: 0x8761, 0x13ca: 0x8789, 0x13cb: 0x87b1, 0x13cc: 0x87d9, 0x13cd: 0x8801, 0x13ce: 0x8829, 0x13cf: 0x8851, 0x13d0: 0x8879, 0x13d1: 0x88a1, 0x13d2: 0x88c9, 0x13d3: 0x88f1, 0x13d4: 0x8919, 0x13d5: 0x8941, 0x13d6: 0x8969, 0x13d7: 0x8991, 0x13d8: 0x89b9, 0x13d9: 0x89e1, 0x13da: 0x8a09, 0x13db: 0x8a31, 0x13dc: 0x8a59, 0x13dd: 0x8a81, 0x13de: 0x8aaa, 0x13df: 0x8ada, 0x13e0: 0x8b0a, 0x13e1: 0x8b3a, 0x13e2: 0x8b6a, 0x13e3: 0x8b9a, 0x13e4: 0x8bc9, 0x13e5: 0x8bf1, 0x13e6: 0x7c71, 0x13e7: 0x8c19, 0x13e8: 0x7be1, 0x13e9: 0x7c99, 0x13ea: 0x8c41, 0x13eb: 0x8c69, 0x13ec: 0x7d39, 0x13ed: 0x8c91, 0x13ee: 0x7d61, 0x13ef: 0x7d89, 0x13f0: 0x8cb9, 0x13f1: 0x8ce1, 0x13f2: 0x7e29, 0x13f3: 0x8d09, 0x13f4: 0x7e51, 0x13f5: 0x7e79, 0x13f6: 0x8d31, 0x13f7: 0x8d59, 0x13f8: 0x7ec9, 0x13f9: 0x8d81, 0x13fa: 0x7ef1, 0x13fb: 0x7f19, 0x13fc: 0x83a1, 0x13fd: 0x83c9, 0x13fe: 0x8441, 0x13ff: 0x8469, // Block 0x50, offset 0x1400 0x1400: 0x8491, 0x1401: 0x8531, 0x1402: 0x8559, 0x1403: 0x8581, 0x1404: 0x85a9, 0x1405: 0x8649, 0x1406: 0x8671, 0x1407: 0x8699, 0x1408: 0x8da9, 0x1409: 0x8739, 0x140a: 0x8dd1, 0x140b: 0x8df9, 0x140c: 0x8829, 0x140d: 0x8e21, 0x140e: 0x8851, 0x140f: 0x8879, 0x1410: 0x8a81, 0x1411: 0x8e49, 0x1412: 0x8e71, 0x1413: 0x89b9, 0x1414: 0x8e99, 0x1415: 0x89e1, 0x1416: 0x8a09, 0x1417: 0x7c21, 0x1418: 0x7c49, 0x1419: 0x8ec1, 0x141a: 0x7c71, 0x141b: 0x8ee9, 0x141c: 0x7cc1, 0x141d: 0x7ce9, 0x141e: 0x7d11, 0x141f: 0x7d39, 0x1420: 0x8f11, 0x1421: 0x7db1, 0x1422: 0x7dd9, 0x1423: 0x7e01, 0x1424: 0x7e29, 0x1425: 0x8f39, 0x1426: 0x7ec9, 0x1427: 0x7f41, 0x1428: 0x7f69, 0x1429: 0x7f91, 0x142a: 0x7fb9, 0x142b: 0x7fe1, 0x142c: 0x8031, 0x142d: 0x8059, 0x142e: 0x8081, 0x142f: 0x80a9, 0x1430: 0x80d1, 0x1431: 0x80f9, 0x1432: 0x8f61, 0x1433: 0x8121, 0x1434: 0x8149, 0x1435: 0x8171, 0x1436: 0x8199, 0x1437: 0x81c1, 0x1438: 0x81e9, 0x1439: 0x8239, 0x143a: 0x8261, 0x143b: 0x8289, 0x143c: 0x82b1, 0x143d: 0x82d9, 0x143e: 0x8301, 0x143f: 0x8329, // Block 0x51, offset 0x1440 0x1440: 0x8351, 0x1441: 0x8379, 0x1442: 0x83f1, 0x1443: 0x8419, 0x1444: 0x84b9, 0x1445: 0x84e1, 0x1446: 0x8509, 0x1447: 0x8531, 0x1448: 0x8559, 0x1449: 0x85d1, 0x144a: 0x85f9, 0x144b: 0x8621, 0x144c: 0x8649, 0x144d: 0x8f89, 0x144e: 0x86c1, 0x144f: 0x86e9, 0x1450: 0x8711, 0x1451: 0x8739, 0x1452: 0x87b1, 0x1453: 0x87d9, 0x1454: 0x8801, 0x1455: 0x8829, 0x1456: 0x8fb1, 0x1457: 0x88a1, 0x1458: 0x88c9, 0x1459: 0x8fd9, 0x145a: 0x8941, 0x145b: 0x8969, 0x145c: 0x8991, 0x145d: 0x89b9, 0x145e: 0x9001, 0x145f: 0x7c71, 0x1460: 0x8ee9, 0x1461: 0x7d39, 0x1462: 0x8f11, 0x1463: 0x7e29, 0x1464: 0x8f39, 0x1465: 0x7ec9, 0x1466: 0x9029, 0x1467: 0x80d1, 0x1468: 0x9051, 0x1469: 0x9079, 0x146a: 0x90a1, 0x146b: 0x8531, 0x146c: 0x8559, 0x146d: 0x8649, 0x146e: 0x8829, 0x146f: 0x8fb1, 0x1470: 0x89b9, 0x1471: 0x9001, 0x1472: 0x90c9, 0x1473: 0x9101, 0x1474: 0x9139, 0x1475: 0x9171, 0x1476: 0x9199, 0x1477: 0x91c1, 0x1478: 0x91e9, 0x1479: 0x9211, 0x147a: 0x9239, 0x147b: 0x9261, 0x147c: 0x9289, 0x147d: 0x92b1, 0x147e: 0x92d9, 0x147f: 0x9301, // Block 0x52, offset 0x1480 0x1480: 0x9329, 0x1481: 0x9351, 0x1482: 0x9379, 0x1483: 0x93a1, 0x1484: 0x93c9, 0x1485: 0x93f1, 0x1486: 0x9419, 0x1487: 0x9441, 0x1488: 0x9469, 0x1489: 0x9491, 0x148a: 0x94b9, 0x148b: 0x94e1, 0x148c: 0x9079, 0x148d: 0x9509, 0x148e: 0x9531, 0x148f: 0x9559, 0x1490: 0x9581, 0x1491: 0x9171, 0x1492: 0x9199, 0x1493: 0x91c1, 0x1494: 0x91e9, 0x1495: 0x9211, 0x1496: 0x9239, 0x1497: 0x9261, 0x1498: 0x9289, 0x1499: 0x92b1, 0x149a: 0x92d9, 0x149b: 0x9301, 0x149c: 0x9329, 0x149d: 0x9351, 0x149e: 0x9379, 0x149f: 0x93a1, 0x14a0: 0x93c9, 0x14a1: 0x93f1, 0x14a2: 0x9419, 0x14a3: 0x9441, 0x14a4: 0x9469, 0x14a5: 0x9491, 0x14a6: 0x94b9, 0x14a7: 0x94e1, 0x14a8: 0x9079, 0x14a9: 0x9509, 0x14aa: 0x9531, 0x14ab: 0x9559, 0x14ac: 0x9581, 0x14ad: 0x9491, 0x14ae: 0x94b9, 0x14af: 0x94e1, 0x14b0: 0x9079, 0x14b1: 0x9051, 0x14b2: 0x90a1, 0x14b3: 0x8211, 0x14b4: 0x8059, 0x14b5: 0x8081, 0x14b6: 0x80a9, 0x14b7: 0x9491, 0x14b8: 0x94b9, 0x14b9: 0x94e1, 0x14ba: 0x8211, 0x14bb: 0x8239, 0x14bc: 0x95a9, 0x14bd: 0x95a9, 0x14be: 0x0018, 0x14bf: 0x0018, // Block 0x53, offset 0x14c0 0x14c0: 0x0040, 0x14c1: 0x0040, 0x14c2: 0x0040, 0x14c3: 0x0040, 0x14c4: 0x0040, 0x14c5: 0x0040, 0x14c6: 0x0040, 0x14c7: 0x0040, 0x14c8: 0x0040, 0x14c9: 0x0040, 0x14ca: 0x0040, 0x14cb: 0x0040, 0x14cc: 0x0040, 0x14cd: 0x0040, 0x14ce: 0x0040, 0x14cf: 0x0040, 0x14d0: 0x95d1, 0x14d1: 0x9609, 0x14d2: 0x9609, 0x14d3: 0x9641, 0x14d4: 0x9679, 0x14d5: 0x96b1, 0x14d6: 0x96e9, 0x14d7: 0x9721, 0x14d8: 0x9759, 0x14d9: 0x9759, 0x14da: 0x9791, 0x14db: 0x97c9, 0x14dc: 0x9801, 0x14dd: 0x9839, 0x14de: 0x9871, 0x14df: 0x98a9, 0x14e0: 0x98a9, 0x14e1: 0x98e1, 0x14e2: 0x9919, 0x14e3: 0x9919, 0x14e4: 0x9951, 0x14e5: 0x9951, 0x14e6: 0x9989, 0x14e7: 0x99c1, 0x14e8: 0x99c1, 0x14e9: 0x99f9, 0x14ea: 0x9a31, 0x14eb: 0x9a31, 0x14ec: 0x9a69, 0x14ed: 0x9a69, 0x14ee: 0x9aa1, 0x14ef: 0x9ad9, 0x14f0: 0x9ad9, 0x14f1: 0x9b11, 0x14f2: 0x9b11, 0x14f3: 0x9b49, 0x14f4: 0x9b81, 0x14f5: 0x9bb9, 0x14f6: 0x9bf1, 0x14f7: 0x9bf1, 0x14f8: 0x9c29, 0x14f9: 0x9c61, 0x14fa: 0x9c99, 0x14fb: 0x9cd1, 0x14fc: 0x9d09, 0x14fd: 0x9d09, 0x14fe: 0x9d41, 0x14ff: 0x9d79, // Block 0x54, offset 0x1500 0x1500: 0xa949, 0x1501: 0xa981, 0x1502: 0xa9b9, 0x1503: 0xa8a1, 0x1504: 0x9bb9, 0x1505: 0x9989, 0x1506: 0xa9f1, 0x1507: 0xaa29, 0x1508: 0x0040, 0x1509: 0x0040, 0x150a: 0x0040, 0x150b: 0x0040, 0x150c: 0x0040, 0x150d: 0x0040, 0x150e: 0x0040, 0x150f: 0x0040, 0x1510: 0x0040, 0x1511: 0x0040, 0x1512: 0x0040, 0x1513: 0x0040, 0x1514: 0x0040, 0x1515: 0x0040, 0x1516: 0x0040, 0x1517: 0x0040, 0x1518: 0x0040, 0x1519: 0x0040, 0x151a: 0x0040, 0x151b: 0x0040, 0x151c: 0x0040, 0x151d: 0x0040, 0x151e: 0x0040, 0x151f: 0x0040, 0x1520: 0x0040, 0x1521: 0x0040, 0x1522: 0x0040, 0x1523: 0x0040, 0x1524: 0x0040, 0x1525: 0x0040, 0x1526: 0x0040, 0x1527: 0x0040, 0x1528: 0x0040, 0x1529: 0x0040, 0x152a: 0x0040, 0x152b: 0x0040, 0x152c: 0x0040, 0x152d: 0x0040, 0x152e: 0x0040, 0x152f: 0x0040, 0x1530: 0xaa61, 0x1531: 0xaa99, 0x1532: 0xaad1, 0x1533: 0xab19, 0x1534: 0xab61, 0x1535: 0xaba9, 0x1536: 0xabf1, 0x1537: 0xac39, 0x1538: 0xac81, 0x1539: 0xacc9, 0x153a: 0xad02, 0x153b: 0xae12, 0x153c: 0xae91, 0x153d: 0x0018, 0x153e: 0x0040, 0x153f: 0x0040, // Block 0x55, offset 0x1540 0x1540: 0x33c0, 0x1541: 0x33c0, 0x1542: 0x33c0, 0x1543: 0x33c0, 0x1544: 0x33c0, 0x1545: 0x33c0, 0x1546: 0x33c0, 0x1547: 0x33c0, 0x1548: 0x33c0, 0x1549: 0x33c0, 0x154a: 0x33c0, 0x154b: 0x33c0, 0x154c: 0x33c0, 0x154d: 0x33c0, 0x154e: 0x33c0, 0x154f: 0x33c0, 0x1550: 0xaeda, 0x1551: 0x7d55, 0x1552: 0x0040, 0x1553: 0xaeea, 0x1554: 0x03c2, 0x1555: 0xaefa, 0x1556: 0xaf0a, 0x1557: 0x7d75, 0x1558: 0x7d95, 0x1559: 0x0040, 0x155a: 0x0040, 0x155b: 0x0040, 0x155c: 0x0040, 0x155d: 0x0040, 0x155e: 0x0040, 0x155f: 0x0040, 0x1560: 0x3308, 0x1561: 0x3308, 0x1562: 0x3308, 0x1563: 0x3308, 0x1564: 0x3308, 0x1565: 0x3308, 0x1566: 0x3308, 0x1567: 0x3308, 0x1568: 0x3308, 0x1569: 0x3308, 0x156a: 0x3308, 0x156b: 0x3308, 0x156c: 0x3308, 0x156d: 0x3308, 0x156e: 0x3308, 0x156f: 0x3308, 0x1570: 0x0040, 0x1571: 0x7db5, 0x1572: 0x7dd5, 0x1573: 0xaf1a, 0x1574: 0xaf1a, 0x1575: 0x1fd2, 0x1576: 0x1fe2, 0x1577: 0xaf2a, 0x1578: 0xaf3a, 0x1579: 0x7df5, 0x157a: 0x7e15, 0x157b: 0x7e35, 0x157c: 0x7df5, 0x157d: 0x7e55, 0x157e: 0x7e75, 0x157f: 0x7e55, // Block 0x56, offset 0x1580 0x1580: 0x7e95, 0x1581: 0x7eb5, 0x1582: 0x7ed5, 0x1583: 0x7eb5, 0x1584: 0x7ef5, 0x1585: 0x0018, 0x1586: 0x0018, 0x1587: 0xaf4a, 0x1588: 0xaf5a, 0x1589: 0x7f16, 0x158a: 0x7f36, 0x158b: 0x7f56, 0x158c: 0x7f76, 0x158d: 0xaf1a, 0x158e: 0xaf1a, 0x158f: 0xaf1a, 0x1590: 0xaeda, 0x1591: 0x7f95, 0x1592: 0x0040, 0x1593: 0x0040, 0x1594: 0x03c2, 0x1595: 0xaeea, 0x1596: 0xaf0a, 0x1597: 0xaefa, 0x1598: 0x7fb5, 0x1599: 0x1fd2, 0x159a: 0x1fe2, 0x159b: 0xaf2a, 0x159c: 0xaf3a, 0x159d: 0x7e95, 0x159e: 0x7ef5, 0x159f: 0xaf6a, 0x15a0: 0xaf7a, 0x15a1: 0xaf8a, 0x15a2: 0x1fb2, 0x15a3: 0xaf99, 0x15a4: 0xafaa, 0x15a5: 0xafba, 0x15a6: 0x1fc2, 0x15a7: 0x0040, 0x15a8: 0xafca, 0x15a9: 0xafda, 0x15aa: 0xafea, 0x15ab: 0xaffa, 0x15ac: 0x0040, 0x15ad: 0x0040, 0x15ae: 0x0040, 0x15af: 0x0040, 0x15b0: 0x7fd6, 0x15b1: 0xb009, 0x15b2: 0x7ff6, 0x15b3: 0x0808, 0x15b4: 0x8016, 0x15b5: 0x0040, 0x15b6: 0x8036, 0x15b7: 0xb031, 0x15b8: 0x8056, 0x15b9: 0xb059, 0x15ba: 0x8076, 0x15bb: 0xb081, 0x15bc: 0x8096, 0x15bd: 0xb0a9, 0x15be: 0x80b6, 0x15bf: 0xb0d1, // Block 0x57, offset 0x15c0 0x15c0: 0xb0f9, 0x15c1: 0xb111, 0x15c2: 0xb111, 0x15c3: 0xb129, 0x15c4: 0xb129, 0x15c5: 0xb141, 0x15c6: 0xb141, 0x15c7: 0xb159, 0x15c8: 0xb159, 0x15c9: 0xb171, 0x15ca: 0xb171, 0x15cb: 0xb171, 0x15cc: 0xb171, 0x15cd: 0xb189, 0x15ce: 0xb189, 0x15cf: 0xb1a1, 0x15d0: 0xb1a1, 0x15d1: 0xb1a1, 0x15d2: 0xb1a1, 0x15d3: 0xb1b9, 0x15d4: 0xb1b9, 0x15d5: 0xb1d1, 0x15d6: 0xb1d1, 0x15d7: 0xb1d1, 0x15d8: 0xb1d1, 0x15d9: 0xb1e9, 0x15da: 0xb1e9, 0x15db: 0xb1e9, 0x15dc: 0xb1e9, 0x15dd: 0xb201, 0x15de: 0xb201, 0x15df: 0xb201, 0x15e0: 0xb201, 0x15e1: 0xb219, 0x15e2: 0xb219, 0x15e3: 0xb219, 0x15e4: 0xb219, 0x15e5: 0xb231, 0x15e6: 0xb231, 0x15e7: 0xb231, 0x15e8: 0xb231, 0x15e9: 0xb249, 0x15ea: 0xb249, 0x15eb: 0xb261, 0x15ec: 0xb261, 0x15ed: 0xb279, 0x15ee: 0xb279, 0x15ef: 0xb291, 0x15f0: 0xb291, 0x15f1: 0xb2a9, 0x15f2: 0xb2a9, 0x15f3: 0xb2a9, 0x15f4: 0xb2a9, 0x15f5: 0xb2c1, 0x15f6: 0xb2c1, 0x15f7: 0xb2c1, 0x15f8: 0xb2c1, 0x15f9: 0xb2d9, 0x15fa: 0xb2d9, 0x15fb: 0xb2d9, 0x15fc: 0xb2d9, 0x15fd: 0xb2f1, 0x15fe: 0xb2f1, 0x15ff: 0xb2f1, // Block 0x58, offset 0x1600 0x1600: 0xb2f1, 0x1601: 0xb309, 0x1602: 0xb309, 0x1603: 0xb309, 0x1604: 0xb309, 0x1605: 0xb321, 0x1606: 0xb321, 0x1607: 0xb321, 0x1608: 0xb321, 0x1609: 0xb339, 0x160a: 0xb339, 0x160b: 0xb339, 0x160c: 0xb339, 0x160d: 0xb351, 0x160e: 0xb351, 0x160f: 0xb351, 0x1610: 0xb351, 0x1611: 0xb369, 0x1612: 0xb369, 0x1613: 0xb369, 0x1614: 0xb369, 0x1615: 0xb381, 0x1616: 0xb381, 0x1617: 0xb381, 0x1618: 0xb381, 0x1619: 0xb399, 0x161a: 0xb399, 0x161b: 0xb399, 0x161c: 0xb399, 0x161d: 0xb3b1, 0x161e: 0xb3b1, 0x161f: 0xb3b1, 0x1620: 0xb3b1, 0x1621: 0xb3c9, 0x1622: 0xb3c9, 0x1623: 0xb3c9, 0x1624: 0xb3c9, 0x1625: 0xb3e1, 0x1626: 0xb3e1, 0x1627: 0xb3e1, 0x1628: 0xb3e1, 0x1629: 0xb3f9, 0x162a: 0xb3f9, 0x162b: 0xb3f9, 0x162c: 0xb3f9, 0x162d: 0xb411, 0x162e: 0xb411, 0x162f: 0x7ab1, 0x1630: 0x7ab1, 0x1631: 0xb429, 0x1632: 0xb429, 0x1633: 0xb429, 0x1634: 0xb429, 0x1635: 0xb441, 0x1636: 0xb441, 0x1637: 0xb469, 0x1638: 0xb469, 0x1639: 0xb491, 0x163a: 0xb491, 0x163b: 0xb4b9, 0x163c: 0xb4b9, 0x163d: 0x0040, 0x163e: 0x0040, 0x163f: 0x03c0, // Block 0x59, offset 0x1640 0x1640: 0x0040, 0x1641: 0xaefa, 0x1642: 0xb4e2, 0x1643: 0xaf6a, 0x1644: 0xafda, 0x1645: 0xafea, 0x1646: 0xaf7a, 0x1647: 0xb4f2, 0x1648: 0x1fd2, 0x1649: 0x1fe2, 0x164a: 0xaf8a, 0x164b: 0x1fb2, 0x164c: 0xaeda, 0x164d: 0xaf99, 0x164e: 0x29d1, 0x164f: 0xb502, 0x1650: 0x1f41, 0x1651: 0x00c9, 0x1652: 0x0069, 0x1653: 0x0079, 0x1654: 0x1f51, 0x1655: 0x1f61, 0x1656: 0x1f71, 0x1657: 0x1f81, 0x1658: 0x1f91, 0x1659: 0x1fa1, 0x165a: 0xaeea, 0x165b: 0x03c2, 0x165c: 0xafaa, 0x165d: 0x1fc2, 0x165e: 0xafba, 0x165f: 0xaf0a, 0x1660: 0xaffa, 0x1661: 0x0039, 0x1662: 0x0ee9, 0x1663: 0x1159, 0x1664: 0x0ef9, 0x1665: 0x0f09, 0x1666: 0x1199, 0x1667: 0x0f31, 0x1668: 0x0249, 0x1669: 0x0f41, 0x166a: 0x0259, 0x166b: 0x0f51, 0x166c: 0x0359, 0x166d: 0x0f61, 0x166e: 0x0f71, 0x166f: 0x00d9, 0x1670: 0x0f99, 0x1671: 0x2039, 0x1672: 0x0269, 0x1673: 0x01d9, 0x1674: 0x0fa9, 0x1675: 0x0fb9, 0x1676: 0x1089, 0x1677: 0x0279, 0x1678: 0x0369, 0x1679: 0x0289, 0x167a: 0x13d1, 0x167b: 0xaf4a, 0x167c: 0xafca, 0x167d: 0xaf5a, 0x167e: 0xb512, 0x167f: 0xaf1a, // Block 0x5a, offset 0x1680 0x1680: 0x1caa, 0x1681: 0x0039, 0x1682: 0x0ee9, 0x1683: 0x1159, 0x1684: 0x0ef9, 0x1685: 0x0f09, 0x1686: 0x1199, 0x1687: 0x0f31, 0x1688: 0x0249, 0x1689: 0x0f41, 0x168a: 0x0259, 0x168b: 0x0f51, 0x168c: 0x0359, 0x168d: 0x0f61, 0x168e: 0x0f71, 0x168f: 0x00d9, 0x1690: 0x0f99, 0x1691: 0x2039, 0x1692: 0x0269, 0x1693: 0x01d9, 0x1694: 0x0fa9, 0x1695: 0x0fb9, 0x1696: 0x1089, 0x1697: 0x0279, 0x1698: 0x0369, 0x1699: 0x0289, 0x169a: 0x13d1, 0x169b: 0xaf2a, 0x169c: 0xb522, 0x169d: 0xaf3a, 0x169e: 0xb532, 0x169f: 0x80d5, 0x16a0: 0x80f5, 0x16a1: 0x29d1, 0x16a2: 0x8115, 0x16a3: 0x8115, 0x16a4: 0x8135, 0x16a5: 0x8155, 0x16a6: 0x8175, 0x16a7: 0x8195, 0x16a8: 0x81b5, 0x16a9: 0x81d5, 0x16aa: 0x81f5, 0x16ab: 0x8215, 0x16ac: 0x8235, 0x16ad: 0x8255, 0x16ae: 0x8275, 0x16af: 0x8295, 0x16b0: 0x82b5, 0x16b1: 0x82d5, 0x16b2: 0x82f5, 0x16b3: 0x8315, 0x16b4: 0x8335, 0x16b5: 0x8355, 0x16b6: 0x8375, 0x16b7: 0x8395, 0x16b8: 0x83b5, 0x16b9: 0x83d5, 0x16ba: 0x83f5, 0x16bb: 0x8415, 0x16bc: 0x81b5, 0x16bd: 0x8435, 0x16be: 0x8455, 0x16bf: 0x8215, // Block 0x5b, offset 0x16c0 0x16c0: 0x8475, 0x16c1: 0x8495, 0x16c2: 0x84b5, 0x16c3: 0x84d5, 0x16c4: 0x84f5, 0x16c5: 0x8515, 0x16c6: 0x8535, 0x16c7: 0x8555, 0x16c8: 0x84d5, 0x16c9: 0x8575, 0x16ca: 0x84d5, 0x16cb: 0x8595, 0x16cc: 0x8595, 0x16cd: 0x85b5, 0x16ce: 0x85b5, 0x16cf: 0x85d5, 0x16d0: 0x8515, 0x16d1: 0x85f5, 0x16d2: 0x8615, 0x16d3: 0x85f5, 0x16d4: 0x8635, 0x16d5: 0x8615, 0x16d6: 0x8655, 0x16d7: 0x8655, 0x16d8: 0x8675, 0x16d9: 0x8675, 0x16da: 0x8695, 0x16db: 0x8695, 0x16dc: 0x8615, 0x16dd: 0x8115, 0x16de: 0x86b5, 0x16df: 0x86d5, 0x16e0: 0x0040, 0x16e1: 0x86f5, 0x16e2: 0x8715, 0x16e3: 0x8735, 0x16e4: 0x8755, 0x16e5: 0x8735, 0x16e6: 0x8775, 0x16e7: 0x8795, 0x16e8: 0x87b5, 0x16e9: 0x87b5, 0x16ea: 0x87d5, 0x16eb: 0x87d5, 0x16ec: 0x87f5, 0x16ed: 0x87f5, 0x16ee: 0x87d5, 0x16ef: 0x87d5, 0x16f0: 0x8815, 0x16f1: 0x8835, 0x16f2: 0x8855, 0x16f3: 0x8875, 0x16f4: 0x8895, 0x16f5: 0x88b5, 0x16f6: 0x88b5, 0x16f7: 0x88b5, 0x16f8: 0x88d5, 0x16f9: 0x88d5, 0x16fa: 0x88d5, 0x16fb: 0x88d5, 0x16fc: 0x87b5, 0x16fd: 0x87b5, 0x16fe: 0x87b5, 0x16ff: 0x0040, // Block 0x5c, offset 0x1700 0x1700: 0x0040, 0x1701: 0x0040, 0x1702: 0x8715, 0x1703: 0x86f5, 0x1704: 0x88f5, 0x1705: 0x86f5, 0x1706: 0x8715, 0x1707: 0x86f5, 0x1708: 0x0040, 0x1709: 0x0040, 0x170a: 0x8915, 0x170b: 0x8715, 0x170c: 0x8935, 0x170d: 0x88f5, 0x170e: 0x8935, 0x170f: 0x8715, 0x1710: 0x0040, 0x1711: 0x0040, 0x1712: 0x8955, 0x1713: 0x8975, 0x1714: 0x8875, 0x1715: 0x8935, 0x1716: 0x88f5, 0x1717: 0x8935, 0x1718: 0x0040, 0x1719: 0x0040, 0x171a: 0x8995, 0x171b: 0x89b5, 0x171c: 0x8995, 0x171d: 0x0040, 0x171e: 0x0040, 0x171f: 0x0040, 0x1720: 0xb541, 0x1721: 0xb559, 0x1722: 0xb571, 0x1723: 0x89d6, 0x1724: 0xb589, 0x1725: 0xb5a1, 0x1726: 0x89f5, 0x1727: 0x0040, 0x1728: 0x8a15, 0x1729: 0x8a35, 0x172a: 0x8a55, 0x172b: 0x8a35, 0x172c: 0x8a75, 0x172d: 0x8a95, 0x172e: 0x8ab5, 0x172f: 0x0040, 0x1730: 0x0040, 0x1731: 0x0040, 0x1732: 0x0040, 0x1733: 0x0040, 0x1734: 0x0040, 0x1735: 0x0040, 0x1736: 0x0040, 0x1737: 0x0040, 0x1738: 0x0040, 0x1739: 0x0340, 0x173a: 0x0340, 0x173b: 0x0340, 0x173c: 0x0040, 0x173d: 0x0040, 0x173e: 0x0040, 0x173f: 0x0040, // Block 0x5d, offset 0x1740 0x1740: 0x0a08, 0x1741: 0x0a08, 0x1742: 0x0a08, 0x1743: 0x0a08, 0x1744: 0x0a08, 0x1745: 0x0c08, 0x1746: 0x0808, 0x1747: 0x0c08, 0x1748: 0x0818, 0x1749: 0x0c08, 0x174a: 0x0c08, 0x174b: 0x0808, 0x174c: 0x0808, 0x174d: 0x0908, 0x174e: 0x0c08, 0x174f: 0x0c08, 0x1750: 0x0c08, 0x1751: 0x0c08, 0x1752: 0x0c08, 0x1753: 0x0a08, 0x1754: 0x0a08, 0x1755: 0x0a08, 0x1756: 0x0a08, 0x1757: 0x0908, 0x1758: 0x0a08, 0x1759: 0x0a08, 0x175a: 0x0a08, 0x175b: 0x0a08, 0x175c: 0x0a08, 0x175d: 0x0c08, 0x175e: 0x0a08, 0x175f: 0x0a08, 0x1760: 0x0a08, 0x1761: 0x0c08, 0x1762: 0x0808, 0x1763: 0x0808, 0x1764: 0x0c08, 0x1765: 0x3308, 0x1766: 0x3308, 0x1767: 0x0040, 0x1768: 0x0040, 0x1769: 0x0040, 0x176a: 0x0040, 0x176b: 0x0a18, 0x176c: 0x0a18, 0x176d: 0x0a18, 0x176e: 0x0a18, 0x176f: 0x0c18, 0x1770: 0x0818, 0x1771: 0x0818, 0x1772: 0x0818, 0x1773: 0x0818, 0x1774: 0x0818, 0x1775: 0x0818, 0x1776: 0x0818, 0x1777: 0x0040, 0x1778: 0x0040, 0x1779: 0x0040, 0x177a: 0x0040, 0x177b: 0x0040, 0x177c: 0x0040, 0x177d: 0x0040, 0x177e: 0x0040, 0x177f: 0x0040, // Block 0x5e, offset 0x1780 0x1780: 0x0a08, 0x1781: 0x0c08, 0x1782: 0x0a08, 0x1783: 0x0c08, 0x1784: 0x0c08, 0x1785: 0x0c08, 0x1786: 0x0a08, 0x1787: 0x0a08, 0x1788: 0x0a08, 0x1789: 0x0c08, 0x178a: 0x0a08, 0x178b: 0x0a08, 0x178c: 0x0c08, 0x178d: 0x0a08, 0x178e: 0x0c08, 0x178f: 0x0c08, 0x1790: 0x0a08, 0x1791: 0x0c08, 0x1792: 0x0040, 0x1793: 0x0040, 0x1794: 0x0040, 0x1795: 0x0040, 0x1796: 0x0040, 0x1797: 0x0040, 0x1798: 0x0040, 0x1799: 0x0818, 0x179a: 0x0818, 0x179b: 0x0818, 0x179c: 0x0818, 0x179d: 0x0040, 0x179e: 0x0040, 0x179f: 0x0040, 0x17a0: 0x0040, 0x17a1: 0x0040, 0x17a2: 0x0040, 0x17a3: 0x0040, 0x17a4: 0x0040, 0x17a5: 0x0040, 0x17a6: 0x0040, 0x17a7: 0x0040, 0x17a8: 0x0040, 0x17a9: 0x0c18, 0x17aa: 0x0c18, 0x17ab: 0x0c18, 0x17ac: 0x0c18, 0x17ad: 0x0a18, 0x17ae: 0x0a18, 0x17af: 0x0818, 0x17b0: 0x0040, 0x17b1: 0x0040, 0x17b2: 0x0040, 0x17b3: 0x0040, 0x17b4: 0x0040, 0x17b5: 0x0040, 0x17b6: 0x0040, 0x17b7: 0x0040, 0x17b8: 0x0040, 0x17b9: 0x0040, 0x17ba: 0x0040, 0x17bb: 0x0040, 0x17bc: 0x0040, 0x17bd: 0x0040, 0x17be: 0x0040, 0x17bf: 0x0040, // Block 0x5f, offset 0x17c0 0x17c0: 0x3308, 0x17c1: 0x3308, 0x17c2: 0x3008, 0x17c3: 0x3008, 0x17c4: 0x0040, 0x17c5: 0x0008, 0x17c6: 0x0008, 0x17c7: 0x0008, 0x17c8: 0x0008, 0x17c9: 0x0008, 0x17ca: 0x0008, 0x17cb: 0x0008, 0x17cc: 0x0008, 0x17cd: 0x0040, 0x17ce: 0x0040, 0x17cf: 0x0008, 0x17d0: 0x0008, 0x17d1: 0x0040, 0x17d2: 0x0040, 0x17d3: 0x0008, 0x17d4: 0x0008, 0x17d5: 0x0008, 0x17d6: 0x0008, 0x17d7: 0x0008, 0x17d8: 0x0008, 0x17d9: 0x0008, 0x17da: 0x0008, 0x17db: 0x0008, 0x17dc: 0x0008, 0x17dd: 0x0008, 0x17de: 0x0008, 0x17df: 0x0008, 0x17e0: 0x0008, 0x17e1: 0x0008, 0x17e2: 0x0008, 0x17e3: 0x0008, 0x17e4: 0x0008, 0x17e5: 0x0008, 0x17e6: 0x0008, 0x17e7: 0x0008, 0x17e8: 0x0008, 0x17e9: 0x0040, 0x17ea: 0x0008, 0x17eb: 0x0008, 0x17ec: 0x0008, 0x17ed: 0x0008, 0x17ee: 0x0008, 0x17ef: 0x0008, 0x17f0: 0x0008, 0x17f1: 0x0040, 0x17f2: 0x0008, 0x17f3: 0x0008, 0x17f4: 0x0040, 0x17f5: 0x0008, 0x17f6: 0x0008, 0x17f7: 0x0008, 0x17f8: 0x0008, 0x17f9: 0x0008, 0x17fa: 0x0040, 0x17fb: 0x3308, 0x17fc: 0x3308, 0x17fd: 0x0008, 0x17fe: 0x3008, 0x17ff: 0x3008, // Block 0x60, offset 0x1800 0x1800: 0x3308, 0x1801: 0x3008, 0x1802: 0x3008, 0x1803: 0x3008, 0x1804: 0x3008, 0x1805: 0x0040, 0x1806: 0x0040, 0x1807: 0x3008, 0x1808: 0x3008, 0x1809: 0x0040, 0x180a: 0x0040, 0x180b: 0x3008, 0x180c: 0x3008, 0x180d: 0x3808, 0x180e: 0x0040, 0x180f: 0x0040, 0x1810: 0x0008, 0x1811: 0x0040, 0x1812: 0x0040, 0x1813: 0x0040, 0x1814: 0x0040, 0x1815: 0x0040, 0x1816: 0x0040, 0x1817: 0x3008, 0x1818: 0x0040, 0x1819: 0x0040, 0x181a: 0x0040, 0x181b: 0x0040, 0x181c: 0x0040, 0x181d: 0x0008, 0x181e: 0x0008, 0x181f: 0x0008, 0x1820: 0x0008, 0x1821: 0x0008, 0x1822: 0x3008, 0x1823: 0x3008, 0x1824: 0x0040, 0x1825: 0x0040, 0x1826: 0x3308, 0x1827: 0x3308, 0x1828: 0x3308, 0x1829: 0x3308, 0x182a: 0x3308, 0x182b: 0x3308, 0x182c: 0x3308, 0x182d: 0x0040, 0x182e: 0x0040, 0x182f: 0x0040, 0x1830: 0x3308, 0x1831: 0x3308, 0x1832: 0x3308, 0x1833: 0x3308, 0x1834: 0x3308, 0x1835: 0x0040, 0x1836: 0x0040, 0x1837: 0x0040, 0x1838: 0x0040, 0x1839: 0x0040, 0x183a: 0x0040, 0x183b: 0x0040, 0x183c: 0x0040, 0x183d: 0x0040, 0x183e: 0x0040, 0x183f: 0x0040, // Block 0x61, offset 0x1840 0x1840: 0x0039, 0x1841: 0x0ee9, 0x1842: 0x1159, 0x1843: 0x0ef9, 0x1844: 0x0f09, 0x1845: 0x1199, 0x1846: 0x0f31, 0x1847: 0x0249, 0x1848: 0x0f41, 0x1849: 0x0259, 0x184a: 0x0f51, 0x184b: 0x0359, 0x184c: 0x0f61, 0x184d: 0x0f71, 0x184e: 0x00d9, 0x184f: 0x0f99, 0x1850: 0x2039, 0x1851: 0x0269, 0x1852: 0x01d9, 0x1853: 0x0fa9, 0x1854: 0x0fb9, 0x1855: 0x1089, 0x1856: 0x0279, 0x1857: 0x0369, 0x1858: 0x0289, 0x1859: 0x13d1, 0x185a: 0x0039, 0x185b: 0x0ee9, 0x185c: 0x1159, 0x185d: 0x0ef9, 0x185e: 0x0f09, 0x185f: 0x1199, 0x1860: 0x0f31, 0x1861: 0x0249, 0x1862: 0x0f41, 0x1863: 0x0259, 0x1864: 0x0f51, 0x1865: 0x0359, 0x1866: 0x0f61, 0x1867: 0x0f71, 0x1868: 0x00d9, 0x1869: 0x0f99, 0x186a: 0x2039, 0x186b: 0x0269, 0x186c: 0x01d9, 0x186d: 0x0fa9, 0x186e: 0x0fb9, 0x186f: 0x1089, 0x1870: 0x0279, 0x1871: 0x0369, 0x1872: 0x0289, 0x1873: 0x13d1, 0x1874: 0x0039, 0x1875: 0x0ee9, 0x1876: 0x1159, 0x1877: 0x0ef9, 0x1878: 0x0f09, 0x1879: 0x1199, 0x187a: 0x0f31, 0x187b: 0x0249, 0x187c: 0x0f41, 0x187d: 0x0259, 0x187e: 0x0f51, 0x187f: 0x0359, // Block 0x62, offset 0x1880 0x1880: 0x0f61, 0x1881: 0x0f71, 0x1882: 0x00d9, 0x1883: 0x0f99, 0x1884: 0x2039, 0x1885: 0x0269, 0x1886: 0x01d9, 0x1887: 0x0fa9, 0x1888: 0x0fb9, 0x1889: 0x1089, 0x188a: 0x0279, 0x188b: 0x0369, 0x188c: 0x0289, 0x188d: 0x13d1, 0x188e: 0x0039, 0x188f: 0x0ee9, 0x1890: 0x1159, 0x1891: 0x0ef9, 0x1892: 0x0f09, 0x1893: 0x1199, 0x1894: 0x0f31, 0x1895: 0x0040, 0x1896: 0x0f41, 0x1897: 0x0259, 0x1898: 0x0f51, 0x1899: 0x0359, 0x189a: 0x0f61, 0x189b: 0x0f71, 0x189c: 0x00d9, 0x189d: 0x0f99, 0x189e: 0x2039, 0x189f: 0x0269, 0x18a0: 0x01d9, 0x18a1: 0x0fa9, 0x18a2: 0x0fb9, 0x18a3: 0x1089, 0x18a4: 0x0279, 0x18a5: 0x0369, 0x18a6: 0x0289, 0x18a7: 0x13d1, 0x18a8: 0x0039, 0x18a9: 0x0ee9, 0x18aa: 0x1159, 0x18ab: 0x0ef9, 0x18ac: 0x0f09, 0x18ad: 0x1199, 0x18ae: 0x0f31, 0x18af: 0x0249, 0x18b0: 0x0f41, 0x18b1: 0x0259, 0x18b2: 0x0f51, 0x18b3: 0x0359, 0x18b4: 0x0f61, 0x18b5: 0x0f71, 0x18b6: 0x00d9, 0x18b7: 0x0f99, 0x18b8: 0x2039, 0x18b9: 0x0269, 0x18ba: 0x01d9, 0x18bb: 0x0fa9, 0x18bc: 0x0fb9, 0x18bd: 0x1089, 0x18be: 0x0279, 0x18bf: 0x0369, // Block 0x63, offset 0x18c0 0x18c0: 0x0289, 0x18c1: 0x13d1, 0x18c2: 0x0039, 0x18c3: 0x0ee9, 0x18c4: 0x1159, 0x18c5: 0x0ef9, 0x18c6: 0x0f09, 0x18c7: 0x1199, 0x18c8: 0x0f31, 0x18c9: 0x0249, 0x18ca: 0x0f41, 0x18cb: 0x0259, 0x18cc: 0x0f51, 0x18cd: 0x0359, 0x18ce: 0x0f61, 0x18cf: 0x0f71, 0x18d0: 0x00d9, 0x18d1: 0x0f99, 0x18d2: 0x2039, 0x18d3: 0x0269, 0x18d4: 0x01d9, 0x18d5: 0x0fa9, 0x18d6: 0x0fb9, 0x18d7: 0x1089, 0x18d8: 0x0279, 0x18d9: 0x0369, 0x18da: 0x0289, 0x18db: 0x13d1, 0x18dc: 0x0039, 0x18dd: 0x0040, 0x18de: 0x1159, 0x18df: 0x0ef9, 0x18e0: 0x0040, 0x18e1: 0x0040, 0x18e2: 0x0f31, 0x18e3: 0x0040, 0x18e4: 0x0040, 0x18e5: 0x0259, 0x18e6: 0x0f51, 0x18e7: 0x0040, 0x18e8: 0x0040, 0x18e9: 0x0f71, 0x18ea: 0x00d9, 0x18eb: 0x0f99, 0x18ec: 0x2039, 0x18ed: 0x0040, 0x18ee: 0x01d9, 0x18ef: 0x0fa9, 0x18f0: 0x0fb9, 0x18f1: 0x1089, 0x18f2: 0x0279, 0x18f3: 0x0369, 0x18f4: 0x0289, 0x18f5: 0x13d1, 0x18f6: 0x0039, 0x18f7: 0x0ee9, 0x18f8: 0x1159, 0x18f9: 0x0ef9, 0x18fa: 0x0040, 0x18fb: 0x1199, 0x18fc: 0x0040, 0x18fd: 0x0249, 0x18fe: 0x0f41, 0x18ff: 0x0259, // Block 0x64, offset 0x1900 0x1900: 0x0f51, 0x1901: 0x0359, 0x1902: 0x0f61, 0x1903: 0x0f71, 0x1904: 0x0040, 0x1905: 0x0f99, 0x1906: 0x2039, 0x1907: 0x0269, 0x1908: 0x01d9, 0x1909: 0x0fa9, 0x190a: 0x0fb9, 0x190b: 0x1089, 0x190c: 0x0279, 0x190d: 0x0369, 0x190e: 0x0289, 0x190f: 0x13d1, 0x1910: 0x0039, 0x1911: 0x0ee9, 0x1912: 0x1159, 0x1913: 0x0ef9, 0x1914: 0x0f09, 0x1915: 0x1199, 0x1916: 0x0f31, 0x1917: 0x0249, 0x1918: 0x0f41, 0x1919: 0x0259, 0x191a: 0x0f51, 0x191b: 0x0359, 0x191c: 0x0f61, 0x191d: 0x0f71, 0x191e: 0x00d9, 0x191f: 0x0f99, 0x1920: 0x2039, 0x1921: 0x0269, 0x1922: 0x01d9, 0x1923: 0x0fa9, 0x1924: 0x0fb9, 0x1925: 0x1089, 0x1926: 0x0279, 0x1927: 0x0369, 0x1928: 0x0289, 0x1929: 0x13d1, 0x192a: 0x0039, 0x192b: 0x0ee9, 0x192c: 0x1159, 0x192d: 0x0ef9, 0x192e: 0x0f09, 0x192f: 0x1199, 0x1930: 0x0f31, 0x1931: 0x0249, 0x1932: 0x0f41, 0x1933: 0x0259, 0x1934: 0x0f51, 0x1935: 0x0359, 0x1936: 0x0f61, 0x1937: 0x0f71, 0x1938: 0x00d9, 0x1939: 0x0f99, 0x193a: 0x2039, 0x193b: 0x0269, 0x193c: 0x01d9, 0x193d: 0x0fa9, 0x193e: 0x0fb9, 0x193f: 0x1089, // Block 0x65, offset 0x1940 0x1940: 0x0279, 0x1941: 0x0369, 0x1942: 0x0289, 0x1943: 0x13d1, 0x1944: 0x0039, 0x1945: 0x0ee9, 0x1946: 0x0040, 0x1947: 0x0ef9, 0x1948: 0x0f09, 0x1949: 0x1199, 0x194a: 0x0f31, 0x194b: 0x0040, 0x194c: 0x0040, 0x194d: 0x0259, 0x194e: 0x0f51, 0x194f: 0x0359, 0x1950: 0x0f61, 0x1951: 0x0f71, 0x1952: 0x00d9, 0x1953: 0x0f99, 0x1954: 0x2039, 0x1955: 0x0040, 0x1956: 0x01d9, 0x1957: 0x0fa9, 0x1958: 0x0fb9, 0x1959: 0x1089, 0x195a: 0x0279, 0x195b: 0x0369, 0x195c: 0x0289, 0x195d: 0x0040, 0x195e: 0x0039, 0x195f: 0x0ee9, 0x1960: 0x1159, 0x1961: 0x0ef9, 0x1962: 0x0f09, 0x1963: 0x1199, 0x1964: 0x0f31, 0x1965: 0x0249, 0x1966: 0x0f41, 0x1967: 0x0259, 0x1968: 0x0f51, 0x1969: 0x0359, 0x196a: 0x0f61, 0x196b: 0x0f71, 0x196c: 0x00d9, 0x196d: 0x0f99, 0x196e: 0x2039, 0x196f: 0x0269, 0x1970: 0x01d9, 0x1971: 0x0fa9, 0x1972: 0x0fb9, 0x1973: 0x1089, 0x1974: 0x0279, 0x1975: 0x0369, 0x1976: 0x0289, 0x1977: 0x13d1, 0x1978: 0x0039, 0x1979: 0x0ee9, 0x197a: 0x0040, 0x197b: 0x0ef9, 0x197c: 0x0f09, 0x197d: 0x1199, 0x197e: 0x0f31, 0x197f: 0x0040, // Block 0x66, offset 0x1980 0x1980: 0x0f41, 0x1981: 0x0259, 0x1982: 0x0f51, 0x1983: 0x0359, 0x1984: 0x0f61, 0x1985: 0x0040, 0x1986: 0x00d9, 0x1987: 0x0040, 0x1988: 0x0040, 0x1989: 0x0040, 0x198a: 0x01d9, 0x198b: 0x0fa9, 0x198c: 0x0fb9, 0x198d: 0x1089, 0x198e: 0x0279, 0x198f: 0x0369, 0x1990: 0x0289, 0x1991: 0x0040, 0x1992: 0x0039, 0x1993: 0x0ee9, 0x1994: 0x1159, 0x1995: 0x0ef9, 0x1996: 0x0f09, 0x1997: 0x1199, 0x1998: 0x0f31, 0x1999: 0x0249, 0x199a: 0x0f41, 0x199b: 0x0259, 0x199c: 0x0f51, 0x199d: 0x0359, 0x199e: 0x0f61, 0x199f: 0x0f71, 0x19a0: 0x00d9, 0x19a1: 0x0f99, 0x19a2: 0x2039, 0x19a3: 0x0269, 0x19a4: 0x01d9, 0x19a5: 0x0fa9, 0x19a6: 0x0fb9, 0x19a7: 0x1089, 0x19a8: 0x0279, 0x19a9: 0x0369, 0x19aa: 0x0289, 0x19ab: 0x13d1, 0x19ac: 0x0039, 0x19ad: 0x0ee9, 0x19ae: 0x1159, 0x19af: 0x0ef9, 0x19b0: 0x0f09, 0x19b1: 0x1199, 0x19b2: 0x0f31, 0x19b3: 0x0249, 0x19b4: 0x0f41, 0x19b5: 0x0259, 0x19b6: 0x0f51, 0x19b7: 0x0359, 0x19b8: 0x0f61, 0x19b9: 0x0f71, 0x19ba: 0x00d9, 0x19bb: 0x0f99, 0x19bc: 0x2039, 0x19bd: 0x0269, 0x19be: 0x01d9, 0x19bf: 0x0fa9, // Block 0x67, offset 0x19c0 0x19c0: 0x0fb9, 0x19c1: 0x1089, 0x19c2: 0x0279, 0x19c3: 0x0369, 0x19c4: 0x0289, 0x19c5: 0x13d1, 0x19c6: 0x0039, 0x19c7: 0x0ee9, 0x19c8: 0x1159, 0x19c9: 0x0ef9, 0x19ca: 0x0f09, 0x19cb: 0x1199, 0x19cc: 0x0f31, 0x19cd: 0x0249, 0x19ce: 0x0f41, 0x19cf: 0x0259, 0x19d0: 0x0f51, 0x19d1: 0x0359, 0x19d2: 0x0f61, 0x19d3: 0x0f71, 0x19d4: 0x00d9, 0x19d5: 0x0f99, 0x19d6: 0x2039, 0x19d7: 0x0269, 0x19d8: 0x01d9, 0x19d9: 0x0fa9, 0x19da: 0x0fb9, 0x19db: 0x1089, 0x19dc: 0x0279, 0x19dd: 0x0369, 0x19de: 0x0289, 0x19df: 0x13d1, 0x19e0: 0x0039, 0x19e1: 0x0ee9, 0x19e2: 0x1159, 0x19e3: 0x0ef9, 0x19e4: 0x0f09, 0x19e5: 0x1199, 0x19e6: 0x0f31, 0x19e7: 0x0249, 0x19e8: 0x0f41, 0x19e9: 0x0259, 0x19ea: 0x0f51, 0x19eb: 0x0359, 0x19ec: 0x0f61, 0x19ed: 0x0f71, 0x19ee: 0x00d9, 0x19ef: 0x0f99, 0x19f0: 0x2039, 0x19f1: 0x0269, 0x19f2: 0x01d9, 0x19f3: 0x0fa9, 0x19f4: 0x0fb9, 0x19f5: 0x1089, 0x19f6: 0x0279, 0x19f7: 0x0369, 0x19f8: 0x0289, 0x19f9: 0x13d1, 0x19fa: 0x0039, 0x19fb: 0x0ee9, 0x19fc: 0x1159, 0x19fd: 0x0ef9, 0x19fe: 0x0f09, 0x19ff: 0x1199, // Block 0x68, offset 0x1a00 0x1a00: 0x0f31, 0x1a01: 0x0249, 0x1a02: 0x0f41, 0x1a03: 0x0259, 0x1a04: 0x0f51, 0x1a05: 0x0359, 0x1a06: 0x0f61, 0x1a07: 0x0f71, 0x1a08: 0x00d9, 0x1a09: 0x0f99, 0x1a0a: 0x2039, 0x1a0b: 0x0269, 0x1a0c: 0x01d9, 0x1a0d: 0x0fa9, 0x1a0e: 0x0fb9, 0x1a0f: 0x1089, 0x1a10: 0x0279, 0x1a11: 0x0369, 0x1a12: 0x0289, 0x1a13: 0x13d1, 0x1a14: 0x0039, 0x1a15: 0x0ee9, 0x1a16: 0x1159, 0x1a17: 0x0ef9, 0x1a18: 0x0f09, 0x1a19: 0x1199, 0x1a1a: 0x0f31, 0x1a1b: 0x0249, 0x1a1c: 0x0f41, 0x1a1d: 0x0259, 0x1a1e: 0x0f51, 0x1a1f: 0x0359, 0x1a20: 0x0f61, 0x1a21: 0x0f71, 0x1a22: 0x00d9, 0x1a23: 0x0f99, 0x1a24: 0x2039, 0x1a25: 0x0269, 0x1a26: 0x01d9, 0x1a27: 0x0fa9, 0x1a28: 0x0fb9, 0x1a29: 0x1089, 0x1a2a: 0x0279, 0x1a2b: 0x0369, 0x1a2c: 0x0289, 0x1a2d: 0x13d1, 0x1a2e: 0x0039, 0x1a2f: 0x0ee9, 0x1a30: 0x1159, 0x1a31: 0x0ef9, 0x1a32: 0x0f09, 0x1a33: 0x1199, 0x1a34: 0x0f31, 0x1a35: 0x0249, 0x1a36: 0x0f41, 0x1a37: 0x0259, 0x1a38: 0x0f51, 0x1a39: 0x0359, 0x1a3a: 0x0f61, 0x1a3b: 0x0f71, 0x1a3c: 0x00d9, 0x1a3d: 0x0f99, 0x1a3e: 0x2039, 0x1a3f: 0x0269, // Block 0x69, offset 0x1a40 0x1a40: 0x01d9, 0x1a41: 0x0fa9, 0x1a42: 0x0fb9, 0x1a43: 0x1089, 0x1a44: 0x0279, 0x1a45: 0x0369, 0x1a46: 0x0289, 0x1a47: 0x13d1, 0x1a48: 0x0039, 0x1a49: 0x0ee9, 0x1a4a: 0x1159, 0x1a4b: 0x0ef9, 0x1a4c: 0x0f09, 0x1a4d: 0x1199, 0x1a4e: 0x0f31, 0x1a4f: 0x0249, 0x1a50: 0x0f41, 0x1a51: 0x0259, 0x1a52: 0x0f51, 0x1a53: 0x0359, 0x1a54: 0x0f61, 0x1a55: 0x0f71, 0x1a56: 0x00d9, 0x1a57: 0x0f99, 0x1a58: 0x2039, 0x1a59: 0x0269, 0x1a5a: 0x01d9, 0x1a5b: 0x0fa9, 0x1a5c: 0x0fb9, 0x1a5d: 0x1089, 0x1a5e: 0x0279, 0x1a5f: 0x0369, 0x1a60: 0x0289, 0x1a61: 0x13d1, 0x1a62: 0x0039, 0x1a63: 0x0ee9, 0x1a64: 0x1159, 0x1a65: 0x0ef9, 0x1a66: 0x0f09, 0x1a67: 0x1199, 0x1a68: 0x0f31, 0x1a69: 0x0249, 0x1a6a: 0x0f41, 0x1a6b: 0x0259, 0x1a6c: 0x0f51, 0x1a6d: 0x0359, 0x1a6e: 0x0f61, 0x1a6f: 0x0f71, 0x1a70: 0x00d9, 0x1a71: 0x0f99, 0x1a72: 0x2039, 0x1a73: 0x0269, 0x1a74: 0x01d9, 0x1a75: 0x0fa9, 0x1a76: 0x0fb9, 0x1a77: 0x1089, 0x1a78: 0x0279, 0x1a79: 0x0369, 0x1a7a: 0x0289, 0x1a7b: 0x13d1, 0x1a7c: 0x0039, 0x1a7d: 0x0ee9, 0x1a7e: 0x1159, 0x1a7f: 0x0ef9, // Block 0x6a, offset 0x1a80 0x1a80: 0x0f09, 0x1a81: 0x1199, 0x1a82: 0x0f31, 0x1a83: 0x0249, 0x1a84: 0x0f41, 0x1a85: 0x0259, 0x1a86: 0x0f51, 0x1a87: 0x0359, 0x1a88: 0x0f61, 0x1a89: 0x0f71, 0x1a8a: 0x00d9, 0x1a8b: 0x0f99, 0x1a8c: 0x2039, 0x1a8d: 0x0269, 0x1a8e: 0x01d9, 0x1a8f: 0x0fa9, 0x1a90: 0x0fb9, 0x1a91: 0x1089, 0x1a92: 0x0279, 0x1a93: 0x0369, 0x1a94: 0x0289, 0x1a95: 0x13d1, 0x1a96: 0x0039, 0x1a97: 0x0ee9, 0x1a98: 0x1159, 0x1a99: 0x0ef9, 0x1a9a: 0x0f09, 0x1a9b: 0x1199, 0x1a9c: 0x0f31, 0x1a9d: 0x0249, 0x1a9e: 0x0f41, 0x1a9f: 0x0259, 0x1aa0: 0x0f51, 0x1aa1: 0x0359, 0x1aa2: 0x0f61, 0x1aa3: 0x0f71, 0x1aa4: 0x00d9, 0x1aa5: 0x0f99, 0x1aa6: 0x2039, 0x1aa7: 0x0269, 0x1aa8: 0x01d9, 0x1aa9: 0x0fa9, 0x1aaa: 0x0fb9, 0x1aab: 0x1089, 0x1aac: 0x0279, 0x1aad: 0x0369, 0x1aae: 0x0289, 0x1aaf: 0x13d1, 0x1ab0: 0x0039, 0x1ab1: 0x0ee9, 0x1ab2: 0x1159, 0x1ab3: 0x0ef9, 0x1ab4: 0x0f09, 0x1ab5: 0x1199, 0x1ab6: 0x0f31, 0x1ab7: 0x0249, 0x1ab8: 0x0f41, 0x1ab9: 0x0259, 0x1aba: 0x0f51, 0x1abb: 0x0359, 0x1abc: 0x0f61, 0x1abd: 0x0f71, 0x1abe: 0x00d9, 0x1abf: 0x0f99, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x2039, 0x1ac1: 0x0269, 0x1ac2: 0x01d9, 0x1ac3: 0x0fa9, 0x1ac4: 0x0fb9, 0x1ac5: 0x1089, 0x1ac6: 0x0279, 0x1ac7: 0x0369, 0x1ac8: 0x0289, 0x1ac9: 0x13d1, 0x1aca: 0x0039, 0x1acb: 0x0ee9, 0x1acc: 0x1159, 0x1acd: 0x0ef9, 0x1ace: 0x0f09, 0x1acf: 0x1199, 0x1ad0: 0x0f31, 0x1ad1: 0x0249, 0x1ad2: 0x0f41, 0x1ad3: 0x0259, 0x1ad4: 0x0f51, 0x1ad5: 0x0359, 0x1ad6: 0x0f61, 0x1ad7: 0x0f71, 0x1ad8: 0x00d9, 0x1ad9: 0x0f99, 0x1ada: 0x2039, 0x1adb: 0x0269, 0x1adc: 0x01d9, 0x1add: 0x0fa9, 0x1ade: 0x0fb9, 0x1adf: 0x1089, 0x1ae0: 0x0279, 0x1ae1: 0x0369, 0x1ae2: 0x0289, 0x1ae3: 0x13d1, 0x1ae4: 0xba81, 0x1ae5: 0xba99, 0x1ae6: 0x0040, 0x1ae7: 0x0040, 0x1ae8: 0xbab1, 0x1ae9: 0x1099, 0x1aea: 0x10b1, 0x1aeb: 0x10c9, 0x1aec: 0xbac9, 0x1aed: 0xbae1, 0x1aee: 0xbaf9, 0x1aef: 0x1429, 0x1af0: 0x1a31, 0x1af1: 0xbb11, 0x1af2: 0xbb29, 0x1af3: 0xbb41, 0x1af4: 0xbb59, 0x1af5: 0xbb71, 0x1af6: 0xbb89, 0x1af7: 0x2109, 0x1af8: 0x1111, 0x1af9: 0x1429, 0x1afa: 0xbba1, 0x1afb: 0xbbb9, 0x1afc: 0xbbd1, 0x1afd: 0x10e1, 0x1afe: 0x10f9, 0x1aff: 0xbbe9, // Block 0x6c, offset 0x1b00 0x1b00: 0x2079, 0x1b01: 0xbc01, 0x1b02: 0xbab1, 0x1b03: 0x1099, 0x1b04: 0x10b1, 0x1b05: 0x10c9, 0x1b06: 0xbac9, 0x1b07: 0xbae1, 0x1b08: 0xbaf9, 0x1b09: 0x1429, 0x1b0a: 0x1a31, 0x1b0b: 0xbb11, 0x1b0c: 0xbb29, 0x1b0d: 0xbb41, 0x1b0e: 0xbb59, 0x1b0f: 0xbb71, 0x1b10: 0xbb89, 0x1b11: 0x2109, 0x1b12: 0x1111, 0x1b13: 0xbba1, 0x1b14: 0xbba1, 0x1b15: 0xbbb9, 0x1b16: 0xbbd1, 0x1b17: 0x10e1, 0x1b18: 0x10f9, 0x1b19: 0xbbe9, 0x1b1a: 0x2079, 0x1b1b: 0xbc21, 0x1b1c: 0xbac9, 0x1b1d: 0x1429, 0x1b1e: 0xbb11, 0x1b1f: 0x10e1, 0x1b20: 0x1111, 0x1b21: 0x2109, 0x1b22: 0xbab1, 0x1b23: 0x1099, 0x1b24: 0x10b1, 0x1b25: 0x10c9, 0x1b26: 0xbac9, 0x1b27: 0xbae1, 0x1b28: 0xbaf9, 0x1b29: 0x1429, 0x1b2a: 0x1a31, 0x1b2b: 0xbb11, 0x1b2c: 0xbb29, 0x1b2d: 0xbb41, 0x1b2e: 0xbb59, 0x1b2f: 0xbb71, 0x1b30: 0xbb89, 0x1b31: 0x2109, 0x1b32: 0x1111, 0x1b33: 0x1429, 0x1b34: 0xbba1, 0x1b35: 0xbbb9, 0x1b36: 0xbbd1, 0x1b37: 0x10e1, 0x1b38: 0x10f9, 0x1b39: 0xbbe9, 0x1b3a: 0x2079, 0x1b3b: 0xbc01, 0x1b3c: 0xbab1, 0x1b3d: 0x1099, 0x1b3e: 0x10b1, 0x1b3f: 0x10c9, // Block 0x6d, offset 0x1b40 0x1b40: 0xbac9, 0x1b41: 0xbae1, 0x1b42: 0xbaf9, 0x1b43: 0x1429, 0x1b44: 0x1a31, 0x1b45: 0xbb11, 0x1b46: 0xbb29, 0x1b47: 0xbb41, 0x1b48: 0xbb59, 0x1b49: 0xbb71, 0x1b4a: 0xbb89, 0x1b4b: 0x2109, 0x1b4c: 0x1111, 0x1b4d: 0xbba1, 0x1b4e: 0xbba1, 0x1b4f: 0xbbb9, 0x1b50: 0xbbd1, 0x1b51: 0x10e1, 0x1b52: 0x10f9, 0x1b53: 0xbbe9, 0x1b54: 0x2079, 0x1b55: 0xbc21, 0x1b56: 0xbac9, 0x1b57: 0x1429, 0x1b58: 0xbb11, 0x1b59: 0x10e1, 0x1b5a: 0x1111, 0x1b5b: 0x2109, 0x1b5c: 0xbab1, 0x1b5d: 0x1099, 0x1b5e: 0x10b1, 0x1b5f: 0x10c9, 0x1b60: 0xbac9, 0x1b61: 0xbae1, 0x1b62: 0xbaf9, 0x1b63: 0x1429, 0x1b64: 0x1a31, 0x1b65: 0xbb11, 0x1b66: 0xbb29, 0x1b67: 0xbb41, 0x1b68: 0xbb59, 0x1b69: 0xbb71, 0x1b6a: 0xbb89, 0x1b6b: 0x2109, 0x1b6c: 0x1111, 0x1b6d: 0x1429, 0x1b6e: 0xbba1, 0x1b6f: 0xbbb9, 0x1b70: 0xbbd1, 0x1b71: 0x10e1, 0x1b72: 0x10f9, 0x1b73: 0xbbe9, 0x1b74: 0x2079, 0x1b75: 0xbc01, 0x1b76: 0xbab1, 0x1b77: 0x1099, 0x1b78: 0x10b1, 0x1b79: 0x10c9, 0x1b7a: 0xbac9, 0x1b7b: 0xbae1, 0x1b7c: 0xbaf9, 0x1b7d: 0x1429, 0x1b7e: 0x1a31, 0x1b7f: 0xbb11, // Block 0x6e, offset 0x1b80 0x1b80: 0xbb29, 0x1b81: 0xbb41, 0x1b82: 0xbb59, 0x1b83: 0xbb71, 0x1b84: 0xbb89, 0x1b85: 0x2109, 0x1b86: 0x1111, 0x1b87: 0xbba1, 0x1b88: 0xbba1, 0x1b89: 0xbbb9, 0x1b8a: 0xbbd1, 0x1b8b: 0x10e1, 0x1b8c: 0x10f9, 0x1b8d: 0xbbe9, 0x1b8e: 0x2079, 0x1b8f: 0xbc21, 0x1b90: 0xbac9, 0x1b91: 0x1429, 0x1b92: 0xbb11, 0x1b93: 0x10e1, 0x1b94: 0x1111, 0x1b95: 0x2109, 0x1b96: 0xbab1, 0x1b97: 0x1099, 0x1b98: 0x10b1, 0x1b99: 0x10c9, 0x1b9a: 0xbac9, 0x1b9b: 0xbae1, 0x1b9c: 0xbaf9, 0x1b9d: 0x1429, 0x1b9e: 0x1a31, 0x1b9f: 0xbb11, 0x1ba0: 0xbb29, 0x1ba1: 0xbb41, 0x1ba2: 0xbb59, 0x1ba3: 0xbb71, 0x1ba4: 0xbb89, 0x1ba5: 0x2109, 0x1ba6: 0x1111, 0x1ba7: 0x1429, 0x1ba8: 0xbba1, 0x1ba9: 0xbbb9, 0x1baa: 0xbbd1, 0x1bab: 0x10e1, 0x1bac: 0x10f9, 0x1bad: 0xbbe9, 0x1bae: 0x2079, 0x1baf: 0xbc01, 0x1bb0: 0xbab1, 0x1bb1: 0x1099, 0x1bb2: 0x10b1, 0x1bb3: 0x10c9, 0x1bb4: 0xbac9, 0x1bb5: 0xbae1, 0x1bb6: 0xbaf9, 0x1bb7: 0x1429, 0x1bb8: 0x1a31, 0x1bb9: 0xbb11, 0x1bba: 0xbb29, 0x1bbb: 0xbb41, 0x1bbc: 0xbb59, 0x1bbd: 0xbb71, 0x1bbe: 0xbb89, 0x1bbf: 0x2109, // Block 0x6f, offset 0x1bc0 0x1bc0: 0x1111, 0x1bc1: 0xbba1, 0x1bc2: 0xbba1, 0x1bc3: 0xbbb9, 0x1bc4: 0xbbd1, 0x1bc5: 0x10e1, 0x1bc6: 0x10f9, 0x1bc7: 0xbbe9, 0x1bc8: 0x2079, 0x1bc9: 0xbc21, 0x1bca: 0xbac9, 0x1bcb: 0x1429, 0x1bcc: 0xbb11, 0x1bcd: 0x10e1, 0x1bce: 0x1111, 0x1bcf: 0x2109, 0x1bd0: 0xbab1, 0x1bd1: 0x1099, 0x1bd2: 0x10b1, 0x1bd3: 0x10c9, 0x1bd4: 0xbac9, 0x1bd5: 0xbae1, 0x1bd6: 0xbaf9, 0x1bd7: 0x1429, 0x1bd8: 0x1a31, 0x1bd9: 0xbb11, 0x1bda: 0xbb29, 0x1bdb: 0xbb41, 0x1bdc: 0xbb59, 0x1bdd: 0xbb71, 0x1bde: 0xbb89, 0x1bdf: 0x2109, 0x1be0: 0x1111, 0x1be1: 0x1429, 0x1be2: 0xbba1, 0x1be3: 0xbbb9, 0x1be4: 0xbbd1, 0x1be5: 0x10e1, 0x1be6: 0x10f9, 0x1be7: 0xbbe9, 0x1be8: 0x2079, 0x1be9: 0xbc01, 0x1bea: 0xbab1, 0x1beb: 0x1099, 0x1bec: 0x10b1, 0x1bed: 0x10c9, 0x1bee: 0xbac9, 0x1bef: 0xbae1, 0x1bf0: 0xbaf9, 0x1bf1: 0x1429, 0x1bf2: 0x1a31, 0x1bf3: 0xbb11, 0x1bf4: 0xbb29, 0x1bf5: 0xbb41, 0x1bf6: 0xbb59, 0x1bf7: 0xbb71, 0x1bf8: 0xbb89, 0x1bf9: 0x2109, 0x1bfa: 0x1111, 0x1bfb: 0xbba1, 0x1bfc: 0xbba1, 0x1bfd: 0xbbb9, 0x1bfe: 0xbbd1, 0x1bff: 0x10e1, // Block 0x70, offset 0x1c00 0x1c00: 0x10f9, 0x1c01: 0xbbe9, 0x1c02: 0x2079, 0x1c03: 0xbc21, 0x1c04: 0xbac9, 0x1c05: 0x1429, 0x1c06: 0xbb11, 0x1c07: 0x10e1, 0x1c08: 0x1111, 0x1c09: 0x2109, 0x1c0a: 0xbc41, 0x1c0b: 0xbc41, 0x1c0c: 0x0040, 0x1c0d: 0x0040, 0x1c0e: 0x1f41, 0x1c0f: 0x00c9, 0x1c10: 0x0069, 0x1c11: 0x0079, 0x1c12: 0x1f51, 0x1c13: 0x1f61, 0x1c14: 0x1f71, 0x1c15: 0x1f81, 0x1c16: 0x1f91, 0x1c17: 0x1fa1, 0x1c18: 0x1f41, 0x1c19: 0x00c9, 0x1c1a: 0x0069, 0x1c1b: 0x0079, 0x1c1c: 0x1f51, 0x1c1d: 0x1f61, 0x1c1e: 0x1f71, 0x1c1f: 0x1f81, 0x1c20: 0x1f91, 0x1c21: 0x1fa1, 0x1c22: 0x1f41, 0x1c23: 0x00c9, 0x1c24: 0x0069, 0x1c25: 0x0079, 0x1c26: 0x1f51, 0x1c27: 0x1f61, 0x1c28: 0x1f71, 0x1c29: 0x1f81, 0x1c2a: 0x1f91, 0x1c2b: 0x1fa1, 0x1c2c: 0x1f41, 0x1c2d: 0x00c9, 0x1c2e: 0x0069, 0x1c2f: 0x0079, 0x1c30: 0x1f51, 0x1c31: 0x1f61, 0x1c32: 0x1f71, 0x1c33: 0x1f81, 0x1c34: 0x1f91, 0x1c35: 0x1fa1, 0x1c36: 0x1f41, 0x1c37: 0x00c9, 0x1c38: 0x0069, 0x1c39: 0x0079, 0x1c3a: 0x1f51, 0x1c3b: 0x1f61, 0x1c3c: 0x1f71, 0x1c3d: 0x1f81, 0x1c3e: 0x1f91, 0x1c3f: 0x1fa1, // Block 0x71, offset 0x1c40 0x1c40: 0xe115, 0x1c41: 0xe115, 0x1c42: 0xe135, 0x1c43: 0xe135, 0x1c44: 0xe115, 0x1c45: 0xe115, 0x1c46: 0xe175, 0x1c47: 0xe175, 0x1c48: 0xe115, 0x1c49: 0xe115, 0x1c4a: 0xe135, 0x1c4b: 0xe135, 0x1c4c: 0xe115, 0x1c4d: 0xe115, 0x1c4e: 0xe1f5, 0x1c4f: 0xe1f5, 0x1c50: 0xe115, 0x1c51: 0xe115, 0x1c52: 0xe135, 0x1c53: 0xe135, 0x1c54: 0xe115, 0x1c55: 0xe115, 0x1c56: 0xe175, 0x1c57: 0xe175, 0x1c58: 0xe115, 0x1c59: 0xe115, 0x1c5a: 0xe135, 0x1c5b: 0xe135, 0x1c5c: 0xe115, 0x1c5d: 0xe115, 0x1c5e: 0x8b05, 0x1c5f: 0x8b05, 0x1c60: 0x04b5, 0x1c61: 0x04b5, 0x1c62: 0x0a08, 0x1c63: 0x0a08, 0x1c64: 0x0a08, 0x1c65: 0x0a08, 0x1c66: 0x0a08, 0x1c67: 0x0a08, 0x1c68: 0x0a08, 0x1c69: 0x0a08, 0x1c6a: 0x0a08, 0x1c6b: 0x0a08, 0x1c6c: 0x0a08, 0x1c6d: 0x0a08, 0x1c6e: 0x0a08, 0x1c6f: 0x0a08, 0x1c70: 0x0a08, 0x1c71: 0x0a08, 0x1c72: 0x0a08, 0x1c73: 0x0a08, 0x1c74: 0x0a08, 0x1c75: 0x0a08, 0x1c76: 0x0a08, 0x1c77: 0x0a08, 0x1c78: 0x0a08, 0x1c79: 0x0a08, 0x1c7a: 0x0a08, 0x1c7b: 0x0a08, 0x1c7c: 0x0a08, 0x1c7d: 0x0a08, 0x1c7e: 0x0a08, 0x1c7f: 0x0a08, // Block 0x72, offset 0x1c80 0x1c80: 0xb189, 0x1c81: 0xb1a1, 0x1c82: 0xb201, 0x1c83: 0xb249, 0x1c84: 0x0040, 0x1c85: 0xb411, 0x1c86: 0xb291, 0x1c87: 0xb219, 0x1c88: 0xb309, 0x1c89: 0xb429, 0x1c8a: 0xb399, 0x1c8b: 0xb3b1, 0x1c8c: 0xb3c9, 0x1c8d: 0xb3e1, 0x1c8e: 0xb2a9, 0x1c8f: 0xb339, 0x1c90: 0xb369, 0x1c91: 0xb2d9, 0x1c92: 0xb381, 0x1c93: 0xb279, 0x1c94: 0xb2c1, 0x1c95: 0xb1d1, 0x1c96: 0xb1e9, 0x1c97: 0xb231, 0x1c98: 0xb261, 0x1c99: 0xb2f1, 0x1c9a: 0xb321, 0x1c9b: 0xb351, 0x1c9c: 0xbc59, 0x1c9d: 0x7949, 0x1c9e: 0xbc71, 0x1c9f: 0xbc89, 0x1ca0: 0x0040, 0x1ca1: 0xb1a1, 0x1ca2: 0xb201, 0x1ca3: 0x0040, 0x1ca4: 0xb3f9, 0x1ca5: 0x0040, 0x1ca6: 0x0040, 0x1ca7: 0xb219, 0x1ca8: 0x0040, 0x1ca9: 0xb429, 0x1caa: 0xb399, 0x1cab: 0xb3b1, 0x1cac: 0xb3c9, 0x1cad: 0xb3e1, 0x1cae: 0xb2a9, 0x1caf: 0xb339, 0x1cb0: 0xb369, 0x1cb1: 0xb2d9, 0x1cb2: 0xb381, 0x1cb3: 0x0040, 0x1cb4: 0xb2c1, 0x1cb5: 0xb1d1, 0x1cb6: 0xb1e9, 0x1cb7: 0xb231, 0x1cb8: 0x0040, 0x1cb9: 0xb2f1, 0x1cba: 0x0040, 0x1cbb: 0xb351, 0x1cbc: 0x0040, 0x1cbd: 0x0040, 0x1cbe: 0x0040, 0x1cbf: 0x0040, // Block 0x73, offset 0x1cc0 0x1cc0: 0x0040, 0x1cc1: 0x0040, 0x1cc2: 0xb201, 0x1cc3: 0x0040, 0x1cc4: 0x0040, 0x1cc5: 0x0040, 0x1cc6: 0x0040, 0x1cc7: 0xb219, 0x1cc8: 0x0040, 0x1cc9: 0xb429, 0x1cca: 0x0040, 0x1ccb: 0xb3b1, 0x1ccc: 0x0040, 0x1ccd: 0xb3e1, 0x1cce: 0xb2a9, 0x1ccf: 0xb339, 0x1cd0: 0x0040, 0x1cd1: 0xb2d9, 0x1cd2: 0xb381, 0x1cd3: 0x0040, 0x1cd4: 0xb2c1, 0x1cd5: 0x0040, 0x1cd6: 0x0040, 0x1cd7: 0xb231, 0x1cd8: 0x0040, 0x1cd9: 0xb2f1, 0x1cda: 0x0040, 0x1cdb: 0xb351, 0x1cdc: 0x0040, 0x1cdd: 0x7949, 0x1cde: 0x0040, 0x1cdf: 0xbc89, 0x1ce0: 0x0040, 0x1ce1: 0xb1a1, 0x1ce2: 0xb201, 0x1ce3: 0x0040, 0x1ce4: 0xb3f9, 0x1ce5: 0x0040, 0x1ce6: 0x0040, 0x1ce7: 0xb219, 0x1ce8: 0xb309, 0x1ce9: 0xb429, 0x1cea: 0xb399, 0x1ceb: 0x0040, 0x1cec: 0xb3c9, 0x1ced: 0xb3e1, 0x1cee: 0xb2a9, 0x1cef: 0xb339, 0x1cf0: 0xb369, 0x1cf1: 0xb2d9, 0x1cf2: 0xb381, 0x1cf3: 0x0040, 0x1cf4: 0xb2c1, 0x1cf5: 0xb1d1, 0x1cf6: 0xb1e9, 0x1cf7: 0xb231, 0x1cf8: 0x0040, 0x1cf9: 0xb2f1, 0x1cfa: 0xb321, 0x1cfb: 0xb351, 0x1cfc: 0xbc59, 0x1cfd: 0x0040, 0x1cfe: 0xbc71, 0x1cff: 0x0040, // Block 0x74, offset 0x1d00 0x1d00: 0xb189, 0x1d01: 0xb1a1, 0x1d02: 0xb201, 0x1d03: 0xb249, 0x1d04: 0xb3f9, 0x1d05: 0xb411, 0x1d06: 0xb291, 0x1d07: 0xb219, 0x1d08: 0xb309, 0x1d09: 0xb429, 0x1d0a: 0x0040, 0x1d0b: 0xb3b1, 0x1d0c: 0xb3c9, 0x1d0d: 0xb3e1, 0x1d0e: 0xb2a9, 0x1d0f: 0xb339, 0x1d10: 0xb369, 0x1d11: 0xb2d9, 0x1d12: 0xb381, 0x1d13: 0xb279, 0x1d14: 0xb2c1, 0x1d15: 0xb1d1, 0x1d16: 0xb1e9, 0x1d17: 0xb231, 0x1d18: 0xb261, 0x1d19: 0xb2f1, 0x1d1a: 0xb321, 0x1d1b: 0xb351, 0x1d1c: 0x0040, 0x1d1d: 0x0040, 0x1d1e: 0x0040, 0x1d1f: 0x0040, 0x1d20: 0x0040, 0x1d21: 0xb1a1, 0x1d22: 0xb201, 0x1d23: 0xb249, 0x1d24: 0x0040, 0x1d25: 0xb411, 0x1d26: 0xb291, 0x1d27: 0xb219, 0x1d28: 0xb309, 0x1d29: 0xb429, 0x1d2a: 0x0040, 0x1d2b: 0xb3b1, 0x1d2c: 0xb3c9, 0x1d2d: 0xb3e1, 0x1d2e: 0xb2a9, 0x1d2f: 0xb339, 0x1d30: 0xb369, 0x1d31: 0xb2d9, 0x1d32: 0xb381, 0x1d33: 0xb279, 0x1d34: 0xb2c1, 0x1d35: 0xb1d1, 0x1d36: 0xb1e9, 0x1d37: 0xb231, 0x1d38: 0xb261, 0x1d39: 0xb2f1, 0x1d3a: 0xb321, 0x1d3b: 0xb351, 0x1d3c: 0x0040, 0x1d3d: 0x0040, 0x1d3e: 0x0040, 0x1d3f: 0x0040, // Block 0x75, offset 0x1d40 0x1d40: 0x0040, 0x1d41: 0xbca2, 0x1d42: 0xbcba, 0x1d43: 0xbcd2, 0x1d44: 0xbcea, 0x1d45: 0xbd02, 0x1d46: 0xbd1a, 0x1d47: 0xbd32, 0x1d48: 0xbd4a, 0x1d49: 0xbd62, 0x1d4a: 0xbd7a, 0x1d4b: 0x0018, 0x1d4c: 0x0018, 0x1d4d: 0x0040, 0x1d4e: 0x0040, 0x1d4f: 0x0040, 0x1d50: 0xbd92, 0x1d51: 0xbdb2, 0x1d52: 0xbdd2, 0x1d53: 0xbdf2, 0x1d54: 0xbe12, 0x1d55: 0xbe32, 0x1d56: 0xbe52, 0x1d57: 0xbe72, 0x1d58: 0xbe92, 0x1d59: 0xbeb2, 0x1d5a: 0xbed2, 0x1d5b: 0xbef2, 0x1d5c: 0xbf12, 0x1d5d: 0xbf32, 0x1d5e: 0xbf52, 0x1d5f: 0xbf72, 0x1d60: 0xbf92, 0x1d61: 0xbfb2, 0x1d62: 0xbfd2, 0x1d63: 0xbff2, 0x1d64: 0xc012, 0x1d65: 0xc032, 0x1d66: 0xc052, 0x1d67: 0xc072, 0x1d68: 0xc092, 0x1d69: 0xc0b2, 0x1d6a: 0xc0d1, 0x1d6b: 0x1159, 0x1d6c: 0x0269, 0x1d6d: 0x6671, 0x1d6e: 0xc111, 0x1d6f: 0x0018, 0x1d70: 0x0039, 0x1d71: 0x0ee9, 0x1d72: 0x1159, 0x1d73: 0x0ef9, 0x1d74: 0x0f09, 0x1d75: 0x1199, 0x1d76: 0x0f31, 0x1d77: 0x0249, 0x1d78: 0x0f41, 0x1d79: 0x0259, 0x1d7a: 0x0f51, 0x1d7b: 0x0359, 0x1d7c: 0x0f61, 0x1d7d: 0x0f71, 0x1d7e: 0x00d9, 0x1d7f: 0x0f99, // Block 0x76, offset 0x1d80 0x1d80: 0x2039, 0x1d81: 0x0269, 0x1d82: 0x01d9, 0x1d83: 0x0fa9, 0x1d84: 0x0fb9, 0x1d85: 0x1089, 0x1d86: 0x0279, 0x1d87: 0x0369, 0x1d88: 0x0289, 0x1d89: 0x13d1, 0x1d8a: 0xc129, 0x1d8b: 0x65b1, 0x1d8c: 0xc141, 0x1d8d: 0x1441, 0x1d8e: 0xc159, 0x1d8f: 0xc179, 0x1d90: 0x0018, 0x1d91: 0x0018, 0x1d92: 0x0018, 0x1d93: 0x0018, 0x1d94: 0x0018, 0x1d95: 0x0018, 0x1d96: 0x0018, 0x1d97: 0x0018, 0x1d98: 0x0018, 0x1d99: 0x0018, 0x1d9a: 0x0018, 0x1d9b: 0x0018, 0x1d9c: 0x0018, 0x1d9d: 0x0018, 0x1d9e: 0x0018, 0x1d9f: 0x0018, 0x1da0: 0x0018, 0x1da1: 0x0018, 0x1da2: 0x0018, 0x1da3: 0x0018, 0x1da4: 0x0018, 0x1da5: 0x0018, 0x1da6: 0x0018, 0x1da7: 0x0018, 0x1da8: 0x0018, 0x1da9: 0x0018, 0x1daa: 0xc191, 0x1dab: 0xc1a9, 0x1dac: 0x0040, 0x1dad: 0x0040, 0x1dae: 0x0040, 0x1daf: 0x0040, 0x1db0: 0x0018, 0x1db1: 0x0018, 0x1db2: 0x0018, 0x1db3: 0x0018, 0x1db4: 0x0018, 0x1db5: 0x0018, 0x1db6: 0x0018, 0x1db7: 0x0018, 0x1db8: 0x0018, 0x1db9: 0x0018, 0x1dba: 0x0018, 0x1dbb: 0x0018, 0x1dbc: 0x0018, 0x1dbd: 0x0018, 0x1dbe: 0x0018, 0x1dbf: 0x0018, // Block 0x77, offset 0x1dc0 0x1dc0: 0xc1d9, 0x1dc1: 0xc211, 0x1dc2: 0xc249, 0x1dc3: 0x0040, 0x1dc4: 0x0040, 0x1dc5: 0x0040, 0x1dc6: 0x0040, 0x1dc7: 0x0040, 0x1dc8: 0x0040, 0x1dc9: 0x0040, 0x1dca: 0x0040, 0x1dcb: 0x0040, 0x1dcc: 0x0040, 0x1dcd: 0x0040, 0x1dce: 0x0040, 0x1dcf: 0x0040, 0x1dd0: 0xc269, 0x1dd1: 0xc289, 0x1dd2: 0xc2a9, 0x1dd3: 0xc2c9, 0x1dd4: 0xc2e9, 0x1dd5: 0xc309, 0x1dd6: 0xc329, 0x1dd7: 0xc349, 0x1dd8: 0xc369, 0x1dd9: 0xc389, 0x1dda: 0xc3a9, 0x1ddb: 0xc3c9, 0x1ddc: 0xc3e9, 0x1ddd: 0xc409, 0x1dde: 0xc429, 0x1ddf: 0xc449, 0x1de0: 0xc469, 0x1de1: 0xc489, 0x1de2: 0xc4a9, 0x1de3: 0xc4c9, 0x1de4: 0xc4e9, 0x1de5: 0xc509, 0x1de6: 0xc529, 0x1de7: 0xc549, 0x1de8: 0xc569, 0x1de9: 0xc589, 0x1dea: 0xc5a9, 0x1deb: 0xc5c9, 0x1dec: 0xc5e9, 0x1ded: 0xc609, 0x1dee: 0xc629, 0x1def: 0xc649, 0x1df0: 0xc669, 0x1df1: 0xc689, 0x1df2: 0xc6a9, 0x1df3: 0xc6c9, 0x1df4: 0xc6e9, 0x1df5: 0xc709, 0x1df6: 0xc729, 0x1df7: 0xc749, 0x1df8: 0xc769, 0x1df9: 0xc789, 0x1dfa: 0xc7a9, 0x1dfb: 0xc7c9, 0x1dfc: 0x0040, 0x1dfd: 0x0040, 0x1dfe: 0x0040, 0x1dff: 0x0040, // Block 0x78, offset 0x1e00 0x1e00: 0xcaf9, 0x1e01: 0xcb19, 0x1e02: 0xcb39, 0x1e03: 0x8b1d, 0x1e04: 0xcb59, 0x1e05: 0xcb79, 0x1e06: 0xcb99, 0x1e07: 0xcbb9, 0x1e08: 0xcbd9, 0x1e09: 0xcbf9, 0x1e0a: 0xcc19, 0x1e0b: 0xcc39, 0x1e0c: 0xcc59, 0x1e0d: 0x8b3d, 0x1e0e: 0xcc79, 0x1e0f: 0xcc99, 0x1e10: 0xccb9, 0x1e11: 0xccd9, 0x1e12: 0x8b5d, 0x1e13: 0xccf9, 0x1e14: 0xcd19, 0x1e15: 0xc429, 0x1e16: 0x8b7d, 0x1e17: 0xcd39, 0x1e18: 0xcd59, 0x1e19: 0xcd79, 0x1e1a: 0xcd99, 0x1e1b: 0xcdb9, 0x1e1c: 0x8b9d, 0x1e1d: 0xcdd9, 0x1e1e: 0xcdf9, 0x1e1f: 0xce19, 0x1e20: 0xce39, 0x1e21: 0xce59, 0x1e22: 0xc789, 0x1e23: 0xce79, 0x1e24: 0xce99, 0x1e25: 0xceb9, 0x1e26: 0xced9, 0x1e27: 0xcef9, 0x1e28: 0xcf19, 0x1e29: 0xcf39, 0x1e2a: 0xcf59, 0x1e2b: 0xcf79, 0x1e2c: 0xcf99, 0x1e2d: 0xcfb9, 0x1e2e: 0xcfd9, 0x1e2f: 0xcff9, 0x1e30: 0xd019, 0x1e31: 0xd039, 0x1e32: 0xd039, 0x1e33: 0xd039, 0x1e34: 0x8bbd, 0x1e35: 0xd059, 0x1e36: 0xd079, 0x1e37: 0xd099, 0x1e38: 0x8bdd, 0x1e39: 0xd0b9, 0x1e3a: 0xd0d9, 0x1e3b: 0xd0f9, 0x1e3c: 0xd119, 0x1e3d: 0xd139, 0x1e3e: 0xd159, 0x1e3f: 0xd179, // Block 0x79, offset 0x1e40 0x1e40: 0xd199, 0x1e41: 0xd1b9, 0x1e42: 0xd1d9, 0x1e43: 0xd1f9, 0x1e44: 0xd219, 0x1e45: 0xd239, 0x1e46: 0xd239, 0x1e47: 0xd259, 0x1e48: 0xd279, 0x1e49: 0xd299, 0x1e4a: 0xd2b9, 0x1e4b: 0xd2d9, 0x1e4c: 0xd2f9, 0x1e4d: 0xd319, 0x1e4e: 0xd339, 0x1e4f: 0xd359, 0x1e50: 0xd379, 0x1e51: 0xd399, 0x1e52: 0xd3b9, 0x1e53: 0xd3d9, 0x1e54: 0xd3f9, 0x1e55: 0xd419, 0x1e56: 0xd439, 0x1e57: 0xd459, 0x1e58: 0xd479, 0x1e59: 0x8bfd, 0x1e5a: 0xd499, 0x1e5b: 0xd4b9, 0x1e5c: 0xd4d9, 0x1e5d: 0xc309, 0x1e5e: 0xd4f9, 0x1e5f: 0xd519, 0x1e60: 0x8c1d, 0x1e61: 0x8c3d, 0x1e62: 0xd539, 0x1e63: 0xd559, 0x1e64: 0xd579, 0x1e65: 0xd599, 0x1e66: 0xd5b9, 0x1e67: 0xd5d9, 0x1e68: 0x2040, 0x1e69: 0xd5f9, 0x1e6a: 0xd619, 0x1e6b: 0xd619, 0x1e6c: 0x8c5d, 0x1e6d: 0xd639, 0x1e6e: 0xd659, 0x1e6f: 0xd679, 0x1e70: 0xd699, 0x1e71: 0x8c7d, 0x1e72: 0xd6b9, 0x1e73: 0xd6d9, 0x1e74: 0x2040, 0x1e75: 0xd6f9, 0x1e76: 0xd719, 0x1e77: 0xd739, 0x1e78: 0xd759, 0x1e79: 0xd779, 0x1e7a: 0xd799, 0x1e7b: 0x8c9d, 0x1e7c: 0xd7b9, 0x1e7d: 0x8cbd, 0x1e7e: 0xd7d9, 0x1e7f: 0xd7f9, // Block 0x7a, offset 0x1e80 0x1e80: 0xd819, 0x1e81: 0xd839, 0x1e82: 0xd859, 0x1e83: 0xd879, 0x1e84: 0xd899, 0x1e85: 0xd8b9, 0x1e86: 0xd8d9, 0x1e87: 0xd8f9, 0x1e88: 0xd919, 0x1e89: 0x8cdd, 0x1e8a: 0xd939, 0x1e8b: 0xd959, 0x1e8c: 0xd979, 0x1e8d: 0xd999, 0x1e8e: 0xd9b9, 0x1e8f: 0x8cfd, 0x1e90: 0xd9d9, 0x1e91: 0x8d1d, 0x1e92: 0x8d3d, 0x1e93: 0xd9f9, 0x1e94: 0xda19, 0x1e95: 0xda19, 0x1e96: 0xda39, 0x1e97: 0x8d5d, 0x1e98: 0x8d7d, 0x1e99: 0xda59, 0x1e9a: 0xda79, 0x1e9b: 0xda99, 0x1e9c: 0xdab9, 0x1e9d: 0xdad9, 0x1e9e: 0xdaf9, 0x1e9f: 0xdb19, 0x1ea0: 0xdb39, 0x1ea1: 0xdb59, 0x1ea2: 0xdb79, 0x1ea3: 0xdb99, 0x1ea4: 0x8d9d, 0x1ea5: 0xdbb9, 0x1ea6: 0xdbd9, 0x1ea7: 0xdbf9, 0x1ea8: 0xdc19, 0x1ea9: 0xdbf9, 0x1eaa: 0xdc39, 0x1eab: 0xdc59, 0x1eac: 0xdc79, 0x1ead: 0xdc99, 0x1eae: 0xdcb9, 0x1eaf: 0xdcd9, 0x1eb0: 0xdcf9, 0x1eb1: 0xdd19, 0x1eb2: 0xdd39, 0x1eb3: 0xdd59, 0x1eb4: 0xdd79, 0x1eb5: 0xdd99, 0x1eb6: 0xddb9, 0x1eb7: 0xddd9, 0x1eb8: 0x8dbd, 0x1eb9: 0xddf9, 0x1eba: 0xde19, 0x1ebb: 0xde39, 0x1ebc: 0xde59, 0x1ebd: 0xde79, 0x1ebe: 0x8ddd, 0x1ebf: 0xde99, // Block 0x7b, offset 0x1ec0 0x1ec0: 0xe599, 0x1ec1: 0xe5b9, 0x1ec2: 0xe5d9, 0x1ec3: 0xe5f9, 0x1ec4: 0xe619, 0x1ec5: 0xe639, 0x1ec6: 0x8efd, 0x1ec7: 0xe659, 0x1ec8: 0xe679, 0x1ec9: 0xe699, 0x1eca: 0xe6b9, 0x1ecb: 0xe6d9, 0x1ecc: 0xe6f9, 0x1ecd: 0x8f1d, 0x1ece: 0xe719, 0x1ecf: 0xe739, 0x1ed0: 0x8f3d, 0x1ed1: 0x8f5d, 0x1ed2: 0xe759, 0x1ed3: 0xe779, 0x1ed4: 0xe799, 0x1ed5: 0xe7b9, 0x1ed6: 0xe7d9, 0x1ed7: 0xe7f9, 0x1ed8: 0xe819, 0x1ed9: 0xe839, 0x1eda: 0xe859, 0x1edb: 0x8f7d, 0x1edc: 0xe879, 0x1edd: 0x8f9d, 0x1ede: 0xe899, 0x1edf: 0x2040, 0x1ee0: 0xe8b9, 0x1ee1: 0xe8d9, 0x1ee2: 0xe8f9, 0x1ee3: 0x8fbd, 0x1ee4: 0xe919, 0x1ee5: 0xe939, 0x1ee6: 0x8fdd, 0x1ee7: 0x8ffd, 0x1ee8: 0xe959, 0x1ee9: 0xe979, 0x1eea: 0xe999, 0x1eeb: 0xe9b9, 0x1eec: 0xe9d9, 0x1eed: 0xe9d9, 0x1eee: 0xe9f9, 0x1eef: 0xea19, 0x1ef0: 0xea39, 0x1ef1: 0xea59, 0x1ef2: 0xea79, 0x1ef3: 0xea99, 0x1ef4: 0xeab9, 0x1ef5: 0x901d, 0x1ef6: 0xead9, 0x1ef7: 0x903d, 0x1ef8: 0xeaf9, 0x1ef9: 0x905d, 0x1efa: 0xeb19, 0x1efb: 0x907d, 0x1efc: 0x909d, 0x1efd: 0x90bd, 0x1efe: 0xeb39, 0x1eff: 0xeb59, // Block 0x7c, offset 0x1f00 0x1f00: 0xeb79, 0x1f01: 0x90dd, 0x1f02: 0x90fd, 0x1f03: 0x911d, 0x1f04: 0x913d, 0x1f05: 0xeb99, 0x1f06: 0xebb9, 0x1f07: 0xebb9, 0x1f08: 0xebd9, 0x1f09: 0xebf9, 0x1f0a: 0xec19, 0x1f0b: 0xec39, 0x1f0c: 0xec59, 0x1f0d: 0x915d, 0x1f0e: 0xec79, 0x1f0f: 0xec99, 0x1f10: 0xecb9, 0x1f11: 0xecd9, 0x1f12: 0x917d, 0x1f13: 0xecf9, 0x1f14: 0x919d, 0x1f15: 0x91bd, 0x1f16: 0xed19, 0x1f17: 0xed39, 0x1f18: 0xed59, 0x1f19: 0xed79, 0x1f1a: 0xed99, 0x1f1b: 0xedb9, 0x1f1c: 0x91dd, 0x1f1d: 0x91fd, 0x1f1e: 0x921d, 0x1f1f: 0x2040, 0x1f20: 0xedd9, 0x1f21: 0x923d, 0x1f22: 0xedf9, 0x1f23: 0xee19, 0x1f24: 0xee39, 0x1f25: 0x925d, 0x1f26: 0xee59, 0x1f27: 0xee79, 0x1f28: 0xee99, 0x1f29: 0xeeb9, 0x1f2a: 0xeed9, 0x1f2b: 0x927d, 0x1f2c: 0xeef9, 0x1f2d: 0xef19, 0x1f2e: 0xef39, 0x1f2f: 0xef59, 0x1f30: 0xef79, 0x1f31: 0xef99, 0x1f32: 0x929d, 0x1f33: 0x92bd, 0x1f34: 0xefb9, 0x1f35: 0x92dd, 0x1f36: 0xefd9, 0x1f37: 0x92fd, 0x1f38: 0xeff9, 0x1f39: 0xf019, 0x1f3a: 0xf039, 0x1f3b: 0x931d, 0x1f3c: 0x933d, 0x1f3d: 0xf059, 0x1f3e: 0x935d, 0x1f3f: 0xf079, // Block 0x7d, offset 0x1f40 0x1f40: 0xf6b9, 0x1f41: 0xf6d9, 0x1f42: 0xf6f9, 0x1f43: 0xf719, 0x1f44: 0xf739, 0x1f45: 0x951d, 0x1f46: 0xf759, 0x1f47: 0xf779, 0x1f48: 0xf799, 0x1f49: 0xf7b9, 0x1f4a: 0xf7d9, 0x1f4b: 0x953d, 0x1f4c: 0x955d, 0x1f4d: 0xf7f9, 0x1f4e: 0xf819, 0x1f4f: 0xf839, 0x1f50: 0xf859, 0x1f51: 0xf879, 0x1f52: 0xf899, 0x1f53: 0x957d, 0x1f54: 0xf8b9, 0x1f55: 0xf8d9, 0x1f56: 0xf8f9, 0x1f57: 0xf919, 0x1f58: 0x959d, 0x1f59: 0x95bd, 0x1f5a: 0xf939, 0x1f5b: 0xf959, 0x1f5c: 0xf979, 0x1f5d: 0x95dd, 0x1f5e: 0xf999, 0x1f5f: 0xf9b9, 0x1f60: 0x6815, 0x1f61: 0x95fd, 0x1f62: 0xf9d9, 0x1f63: 0xf9f9, 0x1f64: 0xfa19, 0x1f65: 0x961d, 0x1f66: 0xfa39, 0x1f67: 0xfa59, 0x1f68: 0xfa79, 0x1f69: 0xfa99, 0x1f6a: 0xfab9, 0x1f6b: 0xfad9, 0x1f6c: 0xfaf9, 0x1f6d: 0x963d, 0x1f6e: 0xfb19, 0x1f6f: 0xfb39, 0x1f70: 0xfb59, 0x1f71: 0x965d, 0x1f72: 0xfb79, 0x1f73: 0xfb99, 0x1f74: 0xfbb9, 0x1f75: 0xfbd9, 0x1f76: 0x7b35, 0x1f77: 0x967d, 0x1f78: 0xfbf9, 0x1f79: 0xfc19, 0x1f7a: 0xfc39, 0x1f7b: 0x969d, 0x1f7c: 0xfc59, 0x1f7d: 0x96bd, 0x1f7e: 0xfc79, 0x1f7f: 0xfc79, // Block 0x7e, offset 0x1f80 0x1f80: 0xfc99, 0x1f81: 0x96dd, 0x1f82: 0xfcb9, 0x1f83: 0xfcd9, 0x1f84: 0xfcf9, 0x1f85: 0xfd19, 0x1f86: 0xfd39, 0x1f87: 0xfd59, 0x1f88: 0xfd79, 0x1f89: 0x96fd, 0x1f8a: 0xfd99, 0x1f8b: 0xfdb9, 0x1f8c: 0xfdd9, 0x1f8d: 0xfdf9, 0x1f8e: 0xfe19, 0x1f8f: 0xfe39, 0x1f90: 0x971d, 0x1f91: 0xfe59, 0x1f92: 0x973d, 0x1f93: 0x975d, 0x1f94: 0x977d, 0x1f95: 0xfe79, 0x1f96: 0xfe99, 0x1f97: 0xfeb9, 0x1f98: 0xfed9, 0x1f99: 0xfef9, 0x1f9a: 0xff19, 0x1f9b: 0xff39, 0x1f9c: 0xff59, 0x1f9d: 0x979d, 0x1f9e: 0x0040, 0x1f9f: 0x0040, 0x1fa0: 0x0040, 0x1fa1: 0x0040, 0x1fa2: 0x0040, 0x1fa3: 0x0040, 0x1fa4: 0x0040, 0x1fa5: 0x0040, 0x1fa6: 0x0040, 0x1fa7: 0x0040, 0x1fa8: 0x0040, 0x1fa9: 0x0040, 0x1faa: 0x0040, 0x1fab: 0x0040, 0x1fac: 0x0040, 0x1fad: 0x0040, 0x1fae: 0x0040, 0x1faf: 0x0040, 0x1fb0: 0x0040, 0x1fb1: 0x0040, 0x1fb2: 0x0040, 0x1fb3: 0x0040, 0x1fb4: 0x0040, 0x1fb5: 0x0040, 0x1fb6: 0x0040, 0x1fb7: 0x0040, 0x1fb8: 0x0040, 0x1fb9: 0x0040, 0x1fba: 0x0040, 0x1fbb: 0x0040, 0x1fbc: 0x0040, 0x1fbd: 0x0040, 0x1fbe: 0x0040, 0x1fbf: 0x0040, } // idnaIndex: 36 blocks, 2304 entries, 4608 bytes // Block 0 is the zero block. var idnaIndex = [2304]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x7d, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x04, 0xc7: 0x05, 0xc8: 0x06, 0xc9: 0x7e, 0xca: 0x7f, 0xcb: 0x07, 0xcc: 0x80, 0xcd: 0x08, 0xce: 0x09, 0xcf: 0x0a, 0xd0: 0x81, 0xd1: 0x0b, 0xd2: 0x0c, 0xd3: 0x0d, 0xd4: 0x0e, 0xd5: 0x82, 0xd6: 0x83, 0xd7: 0x84, 0xd8: 0x0f, 0xd9: 0x10, 0xda: 0x85, 0xdb: 0x11, 0xdc: 0x12, 0xdd: 0x86, 0xde: 0x87, 0xdf: 0x88, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xe5: 0x07, 0xe6: 0x07, 0xe7: 0x07, 0xe8: 0x07, 0xe9: 0x08, 0xea: 0x09, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x0a, 0xee: 0x0b, 0xef: 0x0c, 0xf0: 0x1d, 0xf1: 0x1e, 0xf2: 0x1e, 0xf3: 0x20, 0xf4: 0x21, // Block 0x4, offset 0x100 0x120: 0x89, 0x121: 0x13, 0x122: 0x8a, 0x123: 0x8b, 0x124: 0x8c, 0x125: 0x14, 0x126: 0x15, 0x127: 0x16, 0x128: 0x17, 0x129: 0x18, 0x12a: 0x19, 0x12b: 0x1a, 0x12c: 0x1b, 0x12d: 0x1c, 0x12e: 0x1d, 0x12f: 0x8d, 0x130: 0x8e, 0x131: 0x1e, 0x132: 0x1f, 0x133: 0x20, 0x134: 0x8f, 0x135: 0x21, 0x136: 0x90, 0x137: 0x91, 0x138: 0x92, 0x139: 0x93, 0x13a: 0x22, 0x13b: 0x94, 0x13c: 0x95, 0x13d: 0x23, 0x13e: 0x24, 0x13f: 0x96, // Block 0x5, offset 0x140 0x140: 0x97, 0x141: 0x98, 0x142: 0x99, 0x143: 0x9a, 0x144: 0x9b, 0x145: 0x9c, 0x146: 0x9d, 0x147: 0x9e, 0x148: 0x9f, 0x149: 0xa0, 0x14a: 0xa1, 0x14b: 0xa2, 0x14c: 0xa3, 0x14d: 0xa4, 0x14e: 0xa5, 0x14f: 0xa6, 0x150: 0xa7, 0x151: 0x9f, 0x152: 0x9f, 0x153: 0x9f, 0x154: 0x9f, 0x155: 0x9f, 0x156: 0x9f, 0x157: 0x9f, 0x158: 0x9f, 0x159: 0xa8, 0x15a: 0xa9, 0x15b: 0xaa, 0x15c: 0xab, 0x15d: 0xac, 0x15e: 0xad, 0x15f: 0xae, 0x160: 0xaf, 0x161: 0xb0, 0x162: 0xb1, 0x163: 0xb2, 0x164: 0xb3, 0x165: 0xb4, 0x166: 0xb5, 0x167: 0xb6, 0x168: 0xb7, 0x169: 0xb8, 0x16a: 0xb9, 0x16b: 0xba, 0x16c: 0xbb, 0x16d: 0xbc, 0x16e: 0xbd, 0x16f: 0xbe, 0x170: 0xbf, 0x171: 0xc0, 0x172: 0xc1, 0x173: 0xc2, 0x174: 0x25, 0x175: 0x26, 0x176: 0x27, 0x177: 0xc3, 0x178: 0x28, 0x179: 0x28, 0x17a: 0x29, 0x17b: 0x28, 0x17c: 0xc4, 0x17d: 0x2a, 0x17e: 0x2b, 0x17f: 0x2c, // Block 0x6, offset 0x180 0x180: 0x2d, 0x181: 0x2e, 0x182: 0x2f, 0x183: 0xc5, 0x184: 0x30, 0x185: 0x31, 0x186: 0xc6, 0x187: 0x9b, 0x188: 0xc7, 0x189: 0xc8, 0x18a: 0x9b, 0x18b: 0x9b, 0x18c: 0xc9, 0x18d: 0x9b, 0x18e: 0x9b, 0x18f: 0x9b, 0x190: 0xca, 0x191: 0x32, 0x192: 0x33, 0x193: 0x34, 0x194: 0x9b, 0x195: 0x9b, 0x196: 0x9b, 0x197: 0x9b, 0x198: 0x9b, 0x199: 0x9b, 0x19a: 0x9b, 0x19b: 0x9b, 0x19c: 0x9b, 0x19d: 0x9b, 0x19e: 0x9b, 0x19f: 0x9b, 0x1a0: 0x9b, 0x1a1: 0x9b, 0x1a2: 0x9b, 0x1a3: 0x9b, 0x1a4: 0x9b, 0x1a5: 0x9b, 0x1a6: 0x9b, 0x1a7: 0x9b, 0x1a8: 0xcb, 0x1a9: 0xcc, 0x1aa: 0x9b, 0x1ab: 0xcd, 0x1ac: 0x9b, 0x1ad: 0xce, 0x1ae: 0xcf, 0x1af: 0xd0, 0x1b0: 0xd1, 0x1b1: 0x35, 0x1b2: 0x28, 0x1b3: 0x36, 0x1b4: 0xd2, 0x1b5: 0xd3, 0x1b6: 0xd4, 0x1b7: 0xd5, 0x1b8: 0xd6, 0x1b9: 0xd7, 0x1ba: 0xd8, 0x1bb: 0xd9, 0x1bc: 0xda, 0x1bd: 0xdb, 0x1be: 0xdc, 0x1bf: 0x37, // Block 0x7, offset 0x1c0 0x1c0: 0x38, 0x1c1: 0xdd, 0x1c2: 0xde, 0x1c3: 0xdf, 0x1c4: 0xe0, 0x1c5: 0x39, 0x1c6: 0x3a, 0x1c7: 0xe1, 0x1c8: 0xe2, 0x1c9: 0x3b, 0x1ca: 0x3c, 0x1cb: 0x3d, 0x1cc: 0x3e, 0x1cd: 0x3f, 0x1ce: 0x40, 0x1cf: 0x41, 0x1d0: 0x9f, 0x1d1: 0x9f, 0x1d2: 0x9f, 0x1d3: 0x9f, 0x1d4: 0x9f, 0x1d5: 0x9f, 0x1d6: 0x9f, 0x1d7: 0x9f, 0x1d8: 0x9f, 0x1d9: 0x9f, 0x1da: 0x9f, 0x1db: 0x9f, 0x1dc: 0x9f, 0x1dd: 0x9f, 0x1de: 0x9f, 0x1df: 0x9f, 0x1e0: 0x9f, 0x1e1: 0x9f, 0x1e2: 0x9f, 0x1e3: 0x9f, 0x1e4: 0x9f, 0x1e5: 0x9f, 0x1e6: 0x9f, 0x1e7: 0x9f, 0x1e8: 0x9f, 0x1e9: 0x9f, 0x1ea: 0x9f, 0x1eb: 0x9f, 0x1ec: 0x9f, 0x1ed: 0x9f, 0x1ee: 0x9f, 0x1ef: 0x9f, 0x1f0: 0x9f, 0x1f1: 0x9f, 0x1f2: 0x9f, 0x1f3: 0x9f, 0x1f4: 0x9f, 0x1f5: 0x9f, 0x1f6: 0x9f, 0x1f7: 0x9f, 0x1f8: 0x9f, 0x1f9: 0x9f, 0x1fa: 0x9f, 0x1fb: 0x9f, 0x1fc: 0x9f, 0x1fd: 0x9f, 0x1fe: 0x9f, 0x1ff: 0x9f, // Block 0x8, offset 0x200 0x200: 0x9f, 0x201: 0x9f, 0x202: 0x9f, 0x203: 0x9f, 0x204: 0x9f, 0x205: 0x9f, 0x206: 0x9f, 0x207: 0x9f, 0x208: 0x9f, 0x209: 0x9f, 0x20a: 0x9f, 0x20b: 0x9f, 0x20c: 0x9f, 0x20d: 0x9f, 0x20e: 0x9f, 0x20f: 0x9f, 0x210: 0x9f, 0x211: 0x9f, 0x212: 0x9f, 0x213: 0x9f, 0x214: 0x9f, 0x215: 0x9f, 0x216: 0x9f, 0x217: 0x9f, 0x218: 0x9f, 0x219: 0x9f, 0x21a: 0x9f, 0x21b: 0x9f, 0x21c: 0x9f, 0x21d: 0x9f, 0x21e: 0x9f, 0x21f: 0x9f, 0x220: 0x9f, 0x221: 0x9f, 0x222: 0x9f, 0x223: 0x9f, 0x224: 0x9f, 0x225: 0x9f, 0x226: 0x9f, 0x227: 0x9f, 0x228: 0x9f, 0x229: 0x9f, 0x22a: 0x9f, 0x22b: 0x9f, 0x22c: 0x9f, 0x22d: 0x9f, 0x22e: 0x9f, 0x22f: 0x9f, 0x230: 0x9f, 0x231: 0x9f, 0x232: 0x9f, 0x233: 0x9f, 0x234: 0x9f, 0x235: 0x9f, 0x236: 0xb2, 0x237: 0x9b, 0x238: 0x9f, 0x239: 0x9f, 0x23a: 0x9f, 0x23b: 0x9f, 0x23c: 0x9f, 0x23d: 0x9f, 0x23e: 0x9f, 0x23f: 0x9f, // Block 0x9, offset 0x240 0x240: 0x9f, 0x241: 0x9f, 0x242: 0x9f, 0x243: 0x9f, 0x244: 0x9f, 0x245: 0x9f, 0x246: 0x9f, 0x247: 0x9f, 0x248: 0x9f, 0x249: 0x9f, 0x24a: 0x9f, 0x24b: 0x9f, 0x24c: 0x9f, 0x24d: 0x9f, 0x24e: 0x9f, 0x24f: 0x9f, 0x250: 0x9f, 0x251: 0x9f, 0x252: 0x9f, 0x253: 0x9f, 0x254: 0x9f, 0x255: 0x9f, 0x256: 0x9f, 0x257: 0x9f, 0x258: 0x9f, 0x259: 0x9f, 0x25a: 0x9f, 0x25b: 0x9f, 0x25c: 0x9f, 0x25d: 0x9f, 0x25e: 0x9f, 0x25f: 0x9f, 0x260: 0x9f, 0x261: 0x9f, 0x262: 0x9f, 0x263: 0x9f, 0x264: 0x9f, 0x265: 0x9f, 0x266: 0x9f, 0x267: 0x9f, 0x268: 0x9f, 0x269: 0x9f, 0x26a: 0x9f, 0x26b: 0x9f, 0x26c: 0x9f, 0x26d: 0x9f, 0x26e: 0x9f, 0x26f: 0x9f, 0x270: 0x9f, 0x271: 0x9f, 0x272: 0x9f, 0x273: 0x9f, 0x274: 0x9f, 0x275: 0x9f, 0x276: 0x9f, 0x277: 0x9f, 0x278: 0x9f, 0x279: 0x9f, 0x27a: 0x9f, 0x27b: 0x9f, 0x27c: 0x9f, 0x27d: 0x9f, 0x27e: 0x9f, 0x27f: 0x9f, // Block 0xa, offset 0x280 0x280: 0x9f, 0x281: 0x9f, 0x282: 0x9f, 0x283: 0x9f, 0x284: 0x9f, 0x285: 0x9f, 0x286: 0x9f, 0x287: 0x9f, 0x288: 0x9f, 0x289: 0x9f, 0x28a: 0x9f, 0x28b: 0x9f, 0x28c: 0x9f, 0x28d: 0x9f, 0x28e: 0x9f, 0x28f: 0x9f, 0x290: 0x9f, 0x291: 0x9f, 0x292: 0x9f, 0x293: 0x9f, 0x294: 0x9f, 0x295: 0x9f, 0x296: 0x9f, 0x297: 0x9f, 0x298: 0x9f, 0x299: 0x9f, 0x29a: 0x9f, 0x29b: 0x9f, 0x29c: 0x9f, 0x29d: 0x9f, 0x29e: 0x9f, 0x29f: 0x9f, 0x2a0: 0x9f, 0x2a1: 0x9f, 0x2a2: 0x9f, 0x2a3: 0x9f, 0x2a4: 0x9f, 0x2a5: 0x9f, 0x2a6: 0x9f, 0x2a7: 0x9f, 0x2a8: 0x9f, 0x2a9: 0x9f, 0x2aa: 0x9f, 0x2ab: 0x9f, 0x2ac: 0x9f, 0x2ad: 0x9f, 0x2ae: 0x9f, 0x2af: 0x9f, 0x2b0: 0x9f, 0x2b1: 0x9f, 0x2b2: 0x9f, 0x2b3: 0x9f, 0x2b4: 0x9f, 0x2b5: 0x9f, 0x2b6: 0x9f, 0x2b7: 0x9f, 0x2b8: 0x9f, 0x2b9: 0x9f, 0x2ba: 0x9f, 0x2bb: 0x9f, 0x2bc: 0x9f, 0x2bd: 0x9f, 0x2be: 0x9f, 0x2bf: 0xe3, // Block 0xb, offset 0x2c0 0x2c0: 0x9f, 0x2c1: 0x9f, 0x2c2: 0x9f, 0x2c3: 0x9f, 0x2c4: 0x9f, 0x2c5: 0x9f, 0x2c6: 0x9f, 0x2c7: 0x9f, 0x2c8: 0x9f, 0x2c9: 0x9f, 0x2ca: 0x9f, 0x2cb: 0x9f, 0x2cc: 0x9f, 0x2cd: 0x9f, 0x2ce: 0x9f, 0x2cf: 0x9f, 0x2d0: 0x9f, 0x2d1: 0x9f, 0x2d2: 0xe4, 0x2d3: 0xe5, 0x2d4: 0x9f, 0x2d5: 0x9f, 0x2d6: 0x9f, 0x2d7: 0x9f, 0x2d8: 0xe6, 0x2d9: 0x42, 0x2da: 0x43, 0x2db: 0xe7, 0x2dc: 0x44, 0x2dd: 0x45, 0x2de: 0x46, 0x2df: 0xe8, 0x2e0: 0xe9, 0x2e1: 0xea, 0x2e2: 0xeb, 0x2e3: 0xec, 0x2e4: 0xed, 0x2e5: 0xee, 0x2e6: 0xef, 0x2e7: 0xf0, 0x2e8: 0xf1, 0x2e9: 0xf2, 0x2ea: 0xf3, 0x2eb: 0xf4, 0x2ec: 0xf5, 0x2ed: 0xf6, 0x2ee: 0xf7, 0x2ef: 0xf8, 0x2f0: 0x9f, 0x2f1: 0x9f, 0x2f2: 0x9f, 0x2f3: 0x9f, 0x2f4: 0x9f, 0x2f5: 0x9f, 0x2f6: 0x9f, 0x2f7: 0x9f, 0x2f8: 0x9f, 0x2f9: 0x9f, 0x2fa: 0x9f, 0x2fb: 0x9f, 0x2fc: 0x9f, 0x2fd: 0x9f, 0x2fe: 0x9f, 0x2ff: 0x9f, // Block 0xc, offset 0x300 0x300: 0x9f, 0x301: 0x9f, 0x302: 0x9f, 0x303: 0x9f, 0x304: 0x9f, 0x305: 0x9f, 0x306: 0x9f, 0x307: 0x9f, 0x308: 0x9f, 0x309: 0x9f, 0x30a: 0x9f, 0x30b: 0x9f, 0x30c: 0x9f, 0x30d: 0x9f, 0x30e: 0x9f, 0x30f: 0x9f, 0x310: 0x9f, 0x311: 0x9f, 0x312: 0x9f, 0x313: 0x9f, 0x314: 0x9f, 0x315: 0x9f, 0x316: 0x9f, 0x317: 0x9f, 0x318: 0x9f, 0x319: 0x9f, 0x31a: 0x9f, 0x31b: 0x9f, 0x31c: 0x9f, 0x31d: 0x9f, 0x31e: 0xf9, 0x31f: 0xfa, // Block 0xd, offset 0x340 0x340: 0xba, 0x341: 0xba, 0x342: 0xba, 0x343: 0xba, 0x344: 0xba, 0x345: 0xba, 0x346: 0xba, 0x347: 0xba, 0x348: 0xba, 0x349: 0xba, 0x34a: 0xba, 0x34b: 0xba, 0x34c: 0xba, 0x34d: 0xba, 0x34e: 0xba, 0x34f: 0xba, 0x350: 0xba, 0x351: 0xba, 0x352: 0xba, 0x353: 0xba, 0x354: 0xba, 0x355: 0xba, 0x356: 0xba, 0x357: 0xba, 0x358: 0xba, 0x359: 0xba, 0x35a: 0xba, 0x35b: 0xba, 0x35c: 0xba, 0x35d: 0xba, 0x35e: 0xba, 0x35f: 0xba, 0x360: 0xba, 0x361: 0xba, 0x362: 0xba, 0x363: 0xba, 0x364: 0xba, 0x365: 0xba, 0x366: 0xba, 0x367: 0xba, 0x368: 0xba, 0x369: 0xba, 0x36a: 0xba, 0x36b: 0xba, 0x36c: 0xba, 0x36d: 0xba, 0x36e: 0xba, 0x36f: 0xba, 0x370: 0xba, 0x371: 0xba, 0x372: 0xba, 0x373: 0xba, 0x374: 0xba, 0x375: 0xba, 0x376: 0xba, 0x377: 0xba, 0x378: 0xba, 0x379: 0xba, 0x37a: 0xba, 0x37b: 0xba, 0x37c: 0xba, 0x37d: 0xba, 0x37e: 0xba, 0x37f: 0xba, // Block 0xe, offset 0x380 0x380: 0xba, 0x381: 0xba, 0x382: 0xba, 0x383: 0xba, 0x384: 0xba, 0x385: 0xba, 0x386: 0xba, 0x387: 0xba, 0x388: 0xba, 0x389: 0xba, 0x38a: 0xba, 0x38b: 0xba, 0x38c: 0xba, 0x38d: 0xba, 0x38e: 0xba, 0x38f: 0xba, 0x390: 0xba, 0x391: 0xba, 0x392: 0xba, 0x393: 0xba, 0x394: 0xba, 0x395: 0xba, 0x396: 0xba, 0x397: 0xba, 0x398: 0xba, 0x399: 0xba, 0x39a: 0xba, 0x39b: 0xba, 0x39c: 0xba, 0x39d: 0xba, 0x39e: 0xba, 0x39f: 0xba, 0x3a0: 0xba, 0x3a1: 0xba, 0x3a2: 0xba, 0x3a3: 0xba, 0x3a4: 0xfb, 0x3a5: 0xfc, 0x3a6: 0xfd, 0x3a7: 0xfe, 0x3a8: 0x47, 0x3a9: 0xff, 0x3aa: 0x100, 0x3ab: 0x48, 0x3ac: 0x49, 0x3ad: 0x4a, 0x3ae: 0x4b, 0x3af: 0x4c, 0x3b0: 0x101, 0x3b1: 0x4d, 0x3b2: 0x4e, 0x3b3: 0x4f, 0x3b4: 0x50, 0x3b5: 0x51, 0x3b6: 0x102, 0x3b7: 0x52, 0x3b8: 0x53, 0x3b9: 0x54, 0x3ba: 0x55, 0x3bb: 0x56, 0x3bc: 0x57, 0x3bd: 0x58, 0x3be: 0x59, 0x3bf: 0x5a, // Block 0xf, offset 0x3c0 0x3c0: 0x103, 0x3c1: 0x104, 0x3c2: 0x9f, 0x3c3: 0x105, 0x3c4: 0x106, 0x3c5: 0x9b, 0x3c6: 0x107, 0x3c7: 0x108, 0x3c8: 0xba, 0x3c9: 0xba, 0x3ca: 0x109, 0x3cb: 0x10a, 0x3cc: 0x10b, 0x3cd: 0x10c, 0x3ce: 0x10d, 0x3cf: 0x10e, 0x3d0: 0x10f, 0x3d1: 0x9f, 0x3d2: 0x110, 0x3d3: 0x111, 0x3d4: 0x112, 0x3d5: 0x113, 0x3d6: 0xba, 0x3d7: 0xba, 0x3d8: 0x9f, 0x3d9: 0x9f, 0x3da: 0x9f, 0x3db: 0x9f, 0x3dc: 0x114, 0x3dd: 0x115, 0x3de: 0xba, 0x3df: 0xba, 0x3e0: 0x116, 0x3e1: 0x117, 0x3e2: 0x118, 0x3e3: 0x119, 0x3e4: 0x11a, 0x3e5: 0xba, 0x3e6: 0x11b, 0x3e7: 0x11c, 0x3e8: 0x11d, 0x3e9: 0x11e, 0x3ea: 0x11f, 0x3eb: 0x5b, 0x3ec: 0x120, 0x3ed: 0x121, 0x3ee: 0x5c, 0x3ef: 0xba, 0x3f0: 0x122, 0x3f1: 0x123, 0x3f2: 0x124, 0x3f3: 0x125, 0x3f4: 0x126, 0x3f5: 0xba, 0x3f6: 0xba, 0x3f7: 0xba, 0x3f8: 0xba, 0x3f9: 0x127, 0x3fa: 0xba, 0x3fb: 0xba, 0x3fc: 0x128, 0x3fd: 0x129, 0x3fe: 0xba, 0x3ff: 0xba, // Block 0x10, offset 0x400 0x400: 0x12a, 0x401: 0x12b, 0x402: 0x12c, 0x403: 0x12d, 0x404: 0x12e, 0x405: 0x12f, 0x406: 0x130, 0x407: 0x131, 0x408: 0x132, 0x409: 0xba, 0x40a: 0x133, 0x40b: 0x134, 0x40c: 0x5d, 0x40d: 0x5e, 0x40e: 0xba, 0x40f: 0xba, 0x410: 0x135, 0x411: 0x136, 0x412: 0x137, 0x413: 0x138, 0x414: 0xba, 0x415: 0xba, 0x416: 0x139, 0x417: 0x13a, 0x418: 0x13b, 0x419: 0x13c, 0x41a: 0x13d, 0x41b: 0x13e, 0x41c: 0x13f, 0x41d: 0xba, 0x41e: 0xba, 0x41f: 0xba, 0x420: 0x140, 0x421: 0xba, 0x422: 0x141, 0x423: 0x142, 0x424: 0xba, 0x425: 0xba, 0x426: 0xba, 0x427: 0xba, 0x428: 0x143, 0x429: 0x144, 0x42a: 0x145, 0x42b: 0x146, 0x42c: 0xba, 0x42d: 0xba, 0x42e: 0xba, 0x42f: 0xba, 0x430: 0x147, 0x431: 0x148, 0x432: 0x149, 0x433: 0xba, 0x434: 0x14a, 0x435: 0x14b, 0x436: 0x14c, 0x437: 0xba, 0x438: 0xba, 0x439: 0xba, 0x43a: 0xba, 0x43b: 0x14d, 0x43c: 0xba, 0x43d: 0xba, 0x43e: 0xba, 0x43f: 0xba, // Block 0x11, offset 0x440 0x440: 0x9f, 0x441: 0x9f, 0x442: 0x9f, 0x443: 0x9f, 0x444: 0x9f, 0x445: 0x9f, 0x446: 0x9f, 0x447: 0x9f, 0x448: 0x9f, 0x449: 0x9f, 0x44a: 0x9f, 0x44b: 0x9f, 0x44c: 0x9f, 0x44d: 0x9f, 0x44e: 0x14e, 0x44f: 0xba, 0x450: 0x9b, 0x451: 0x14f, 0x452: 0x9f, 0x453: 0x9f, 0x454: 0x9f, 0x455: 0x150, 0x456: 0xba, 0x457: 0xba, 0x458: 0xba, 0x459: 0xba, 0x45a: 0xba, 0x45b: 0xba, 0x45c: 0xba, 0x45d: 0xba, 0x45e: 0xba, 0x45f: 0xba, 0x460: 0xba, 0x461: 0xba, 0x462: 0xba, 0x463: 0xba, 0x464: 0xba, 0x465: 0xba, 0x466: 0xba, 0x467: 0xba, 0x468: 0xba, 0x469: 0xba, 0x46a: 0xba, 0x46b: 0xba, 0x46c: 0xba, 0x46d: 0xba, 0x46e: 0xba, 0x46f: 0xba, 0x470: 0xba, 0x471: 0xba, 0x472: 0xba, 0x473: 0xba, 0x474: 0xba, 0x475: 0xba, 0x476: 0xba, 0x477: 0xba, 0x478: 0xba, 0x479: 0xba, 0x47a: 0xba, 0x47b: 0xba, 0x47c: 0xba, 0x47d: 0xba, 0x47e: 0xba, 0x47f: 0xba, // Block 0x12, offset 0x480 0x480: 0x9f, 0x481: 0x9f, 0x482: 0x9f, 0x483: 0x9f, 0x484: 0x9f, 0x485: 0x9f, 0x486: 0x9f, 0x487: 0x9f, 0x488: 0x9f, 0x489: 0x9f, 0x48a: 0x9f, 0x48b: 0x9f, 0x48c: 0x9f, 0x48d: 0x9f, 0x48e: 0x9f, 0x48f: 0x9f, 0x490: 0x151, 0x491: 0xba, 0x492: 0xba, 0x493: 0xba, 0x494: 0xba, 0x495: 0xba, 0x496: 0xba, 0x497: 0xba, 0x498: 0xba, 0x499: 0xba, 0x49a: 0xba, 0x49b: 0xba, 0x49c: 0xba, 0x49d: 0xba, 0x49e: 0xba, 0x49f: 0xba, 0x4a0: 0xba, 0x4a1: 0xba, 0x4a2: 0xba, 0x4a3: 0xba, 0x4a4: 0xba, 0x4a5: 0xba, 0x4a6: 0xba, 0x4a7: 0xba, 0x4a8: 0xba, 0x4a9: 0xba, 0x4aa: 0xba, 0x4ab: 0xba, 0x4ac: 0xba, 0x4ad: 0xba, 0x4ae: 0xba, 0x4af: 0xba, 0x4b0: 0xba, 0x4b1: 0xba, 0x4b2: 0xba, 0x4b3: 0xba, 0x4b4: 0xba, 0x4b5: 0xba, 0x4b6: 0xba, 0x4b7: 0xba, 0x4b8: 0xba, 0x4b9: 0xba, 0x4ba: 0xba, 0x4bb: 0xba, 0x4bc: 0xba, 0x4bd: 0xba, 0x4be: 0xba, 0x4bf: 0xba, // Block 0x13, offset 0x4c0 0x4c0: 0xba, 0x4c1: 0xba, 0x4c2: 0xba, 0x4c3: 0xba, 0x4c4: 0xba, 0x4c5: 0xba, 0x4c6: 0xba, 0x4c7: 0xba, 0x4c8: 0xba, 0x4c9: 0xba, 0x4ca: 0xba, 0x4cb: 0xba, 0x4cc: 0xba, 0x4cd: 0xba, 0x4ce: 0xba, 0x4cf: 0xba, 0x4d0: 0x9f, 0x4d1: 0x9f, 0x4d2: 0x9f, 0x4d3: 0x9f, 0x4d4: 0x9f, 0x4d5: 0x9f, 0x4d6: 0x9f, 0x4d7: 0x9f, 0x4d8: 0x9f, 0x4d9: 0x152, 0x4da: 0xba, 0x4db: 0xba, 0x4dc: 0xba, 0x4dd: 0xba, 0x4de: 0xba, 0x4df: 0xba, 0x4e0: 0xba, 0x4e1: 0xba, 0x4e2: 0xba, 0x4e3: 0xba, 0x4e4: 0xba, 0x4e5: 0xba, 0x4e6: 0xba, 0x4e7: 0xba, 0x4e8: 0xba, 0x4e9: 0xba, 0x4ea: 0xba, 0x4eb: 0xba, 0x4ec: 0xba, 0x4ed: 0xba, 0x4ee: 0xba, 0x4ef: 0xba, 0x4f0: 0xba, 0x4f1: 0xba, 0x4f2: 0xba, 0x4f3: 0xba, 0x4f4: 0xba, 0x4f5: 0xba, 0x4f6: 0xba, 0x4f7: 0xba, 0x4f8: 0xba, 0x4f9: 0xba, 0x4fa: 0xba, 0x4fb: 0xba, 0x4fc: 0xba, 0x4fd: 0xba, 0x4fe: 0xba, 0x4ff: 0xba, // Block 0x14, offset 0x500 0x500: 0xba, 0x501: 0xba, 0x502: 0xba, 0x503: 0xba, 0x504: 0xba, 0x505: 0xba, 0x506: 0xba, 0x507: 0xba, 0x508: 0xba, 0x509: 0xba, 0x50a: 0xba, 0x50b: 0xba, 0x50c: 0xba, 0x50d: 0xba, 0x50e: 0xba, 0x50f: 0xba, 0x510: 0xba, 0x511: 0xba, 0x512: 0xba, 0x513: 0xba, 0x514: 0xba, 0x515: 0xba, 0x516: 0xba, 0x517: 0xba, 0x518: 0xba, 0x519: 0xba, 0x51a: 0xba, 0x51b: 0xba, 0x51c: 0xba, 0x51d: 0xba, 0x51e: 0xba, 0x51f: 0xba, 0x520: 0x9f, 0x521: 0x9f, 0x522: 0x9f, 0x523: 0x9f, 0x524: 0x9f, 0x525: 0x9f, 0x526: 0x9f, 0x527: 0x9f, 0x528: 0x146, 0x529: 0x153, 0x52a: 0xba, 0x52b: 0x154, 0x52c: 0x155, 0x52d: 0x156, 0x52e: 0x157, 0x52f: 0xba, 0x530: 0xba, 0x531: 0xba, 0x532: 0xba, 0x533: 0xba, 0x534: 0xba, 0x535: 0xba, 0x536: 0xba, 0x537: 0xba, 0x538: 0xba, 0x539: 0x158, 0x53a: 0x159, 0x53b: 0xba, 0x53c: 0x9f, 0x53d: 0x15a, 0x53e: 0x15b, 0x53f: 0x15c, // Block 0x15, offset 0x540 0x540: 0x9f, 0x541: 0x9f, 0x542: 0x9f, 0x543: 0x9f, 0x544: 0x9f, 0x545: 0x9f, 0x546: 0x9f, 0x547: 0x9f, 0x548: 0x9f, 0x549: 0x9f, 0x54a: 0x9f, 0x54b: 0x9f, 0x54c: 0x9f, 0x54d: 0x9f, 0x54e: 0x9f, 0x54f: 0x9f, 0x550: 0x9f, 0x551: 0x9f, 0x552: 0x9f, 0x553: 0x9f, 0x554: 0x9f, 0x555: 0x9f, 0x556: 0x9f, 0x557: 0x9f, 0x558: 0x9f, 0x559: 0x9f, 0x55a: 0x9f, 0x55b: 0x9f, 0x55c: 0x9f, 0x55d: 0x9f, 0x55e: 0x9f, 0x55f: 0x15d, 0x560: 0x9f, 0x561: 0x9f, 0x562: 0x9f, 0x563: 0x9f, 0x564: 0x9f, 0x565: 0x9f, 0x566: 0x9f, 0x567: 0x9f, 0x568: 0x9f, 0x569: 0x9f, 0x56a: 0x9f, 0x56b: 0x15e, 0x56c: 0xba, 0x56d: 0xba, 0x56e: 0xba, 0x56f: 0xba, 0x570: 0xba, 0x571: 0xba, 0x572: 0xba, 0x573: 0xba, 0x574: 0xba, 0x575: 0xba, 0x576: 0xba, 0x577: 0xba, 0x578: 0xba, 0x579: 0xba, 0x57a: 0xba, 0x57b: 0xba, 0x57c: 0xba, 0x57d: 0xba, 0x57e: 0xba, 0x57f: 0xba, // Block 0x16, offset 0x580 0x580: 0x9f, 0x581: 0x9f, 0x582: 0x9f, 0x583: 0x9f, 0x584: 0x15f, 0x585: 0x160, 0x586: 0x9f, 0x587: 0x9f, 0x588: 0x9f, 0x589: 0x9f, 0x58a: 0x9f, 0x58b: 0x161, 0x58c: 0xba, 0x58d: 0xba, 0x58e: 0xba, 0x58f: 0xba, 0x590: 0xba, 0x591: 0xba, 0x592: 0xba, 0x593: 0xba, 0x594: 0xba, 0x595: 0xba, 0x596: 0xba, 0x597: 0xba, 0x598: 0xba, 0x599: 0xba, 0x59a: 0xba, 0x59b: 0xba, 0x59c: 0xba, 0x59d: 0xba, 0x59e: 0xba, 0x59f: 0xba, 0x5a0: 0xba, 0x5a1: 0xba, 0x5a2: 0xba, 0x5a3: 0xba, 0x5a4: 0xba, 0x5a5: 0xba, 0x5a6: 0xba, 0x5a7: 0xba, 0x5a8: 0xba, 0x5a9: 0xba, 0x5aa: 0xba, 0x5ab: 0xba, 0x5ac: 0xba, 0x5ad: 0xba, 0x5ae: 0xba, 0x5af: 0xba, 0x5b0: 0x9f, 0x5b1: 0x162, 0x5b2: 0x163, 0x5b3: 0xba, 0x5b4: 0xba, 0x5b5: 0xba, 0x5b6: 0xba, 0x5b7: 0xba, 0x5b8: 0xba, 0x5b9: 0xba, 0x5ba: 0xba, 0x5bb: 0xba, 0x5bc: 0xba, 0x5bd: 0xba, 0x5be: 0xba, 0x5bf: 0xba, // Block 0x17, offset 0x5c0 0x5c0: 0x9b, 0x5c1: 0x9b, 0x5c2: 0x9b, 0x5c3: 0x164, 0x5c4: 0x165, 0x5c5: 0x166, 0x5c6: 0x167, 0x5c7: 0x168, 0x5c8: 0x9b, 0x5c9: 0x169, 0x5ca: 0xba, 0x5cb: 0x16a, 0x5cc: 0x9b, 0x5cd: 0x16b, 0x5ce: 0xba, 0x5cf: 0xba, 0x5d0: 0x5f, 0x5d1: 0x60, 0x5d2: 0x61, 0x5d3: 0x62, 0x5d4: 0x63, 0x5d5: 0x64, 0x5d6: 0x65, 0x5d7: 0x66, 0x5d8: 0x67, 0x5d9: 0x68, 0x5da: 0x69, 0x5db: 0x6a, 0x5dc: 0x6b, 0x5dd: 0x6c, 0x5de: 0x6d, 0x5df: 0x6e, 0x5e0: 0x9b, 0x5e1: 0x9b, 0x5e2: 0x9b, 0x5e3: 0x9b, 0x5e4: 0x9b, 0x5e5: 0x9b, 0x5e6: 0x9b, 0x5e7: 0x9b, 0x5e8: 0x16c, 0x5e9: 0x16d, 0x5ea: 0x16e, 0x5eb: 0xba, 0x5ec: 0xba, 0x5ed: 0xba, 0x5ee: 0xba, 0x5ef: 0xba, 0x5f0: 0xba, 0x5f1: 0xba, 0x5f2: 0xba, 0x5f3: 0xba, 0x5f4: 0xba, 0x5f5: 0xba, 0x5f6: 0xba, 0x5f7: 0xba, 0x5f8: 0xba, 0x5f9: 0xba, 0x5fa: 0xba, 0x5fb: 0xba, 0x5fc: 0xba, 0x5fd: 0xba, 0x5fe: 0xba, 0x5ff: 0xba, // Block 0x18, offset 0x600 0x600: 0x16f, 0x601: 0xba, 0x602: 0xba, 0x603: 0xba, 0x604: 0xba, 0x605: 0xba, 0x606: 0xba, 0x607: 0xba, 0x608: 0xba, 0x609: 0xba, 0x60a: 0xba, 0x60b: 0xba, 0x60c: 0xba, 0x60d: 0xba, 0x60e: 0xba, 0x60f: 0xba, 0x610: 0xba, 0x611: 0xba, 0x612: 0xba, 0x613: 0xba, 0x614: 0xba, 0x615: 0xba, 0x616: 0xba, 0x617: 0xba, 0x618: 0xba, 0x619: 0xba, 0x61a: 0xba, 0x61b: 0xba, 0x61c: 0xba, 0x61d: 0xba, 0x61e: 0xba, 0x61f: 0xba, 0x620: 0x122, 0x621: 0x122, 0x622: 0x122, 0x623: 0x170, 0x624: 0x6f, 0x625: 0x171, 0x626: 0xba, 0x627: 0xba, 0x628: 0xba, 0x629: 0xba, 0x62a: 0xba, 0x62b: 0xba, 0x62c: 0xba, 0x62d: 0xba, 0x62e: 0xba, 0x62f: 0xba, 0x630: 0xba, 0x631: 0x172, 0x632: 0x173, 0x633: 0xba, 0x634: 0xba, 0x635: 0xba, 0x636: 0xba, 0x637: 0xba, 0x638: 0x70, 0x639: 0x71, 0x63a: 0x72, 0x63b: 0x174, 0x63c: 0xba, 0x63d: 0xba, 0x63e: 0xba, 0x63f: 0xba, // Block 0x19, offset 0x640 0x640: 0x175, 0x641: 0x9b, 0x642: 0x176, 0x643: 0x177, 0x644: 0x73, 0x645: 0x74, 0x646: 0x178, 0x647: 0x179, 0x648: 0x75, 0x649: 0x17a, 0x64a: 0xba, 0x64b: 0xba, 0x64c: 0x9b, 0x64d: 0x9b, 0x64e: 0x9b, 0x64f: 0x9b, 0x650: 0x9b, 0x651: 0x9b, 0x652: 0x9b, 0x653: 0x9b, 0x654: 0x9b, 0x655: 0x9b, 0x656: 0x9b, 0x657: 0x9b, 0x658: 0x9b, 0x659: 0x9b, 0x65a: 0x9b, 0x65b: 0x17b, 0x65c: 0x9b, 0x65d: 0x17c, 0x65e: 0x9b, 0x65f: 0x17d, 0x660: 0x17e, 0x661: 0x17f, 0x662: 0x180, 0x663: 0xba, 0x664: 0x181, 0x665: 0x182, 0x666: 0x183, 0x667: 0x184, 0x668: 0xba, 0x669: 0x185, 0x66a: 0xba, 0x66b: 0xba, 0x66c: 0xba, 0x66d: 0xba, 0x66e: 0xba, 0x66f: 0xba, 0x670: 0xba, 0x671: 0xba, 0x672: 0xba, 0x673: 0xba, 0x674: 0xba, 0x675: 0xba, 0x676: 0xba, 0x677: 0xba, 0x678: 0xba, 0x679: 0xba, 0x67a: 0xba, 0x67b: 0xba, 0x67c: 0xba, 0x67d: 0xba, 0x67e: 0xba, 0x67f: 0xba, // Block 0x1a, offset 0x680 0x680: 0x9f, 0x681: 0x9f, 0x682: 0x9f, 0x683: 0x9f, 0x684: 0x9f, 0x685: 0x9f, 0x686: 0x9f, 0x687: 0x9f, 0x688: 0x9f, 0x689: 0x9f, 0x68a: 0x9f, 0x68b: 0x9f, 0x68c: 0x9f, 0x68d: 0x9f, 0x68e: 0x9f, 0x68f: 0x9f, 0x690: 0x9f, 0x691: 0x9f, 0x692: 0x9f, 0x693: 0x9f, 0x694: 0x9f, 0x695: 0x9f, 0x696: 0x9f, 0x697: 0x9f, 0x698: 0x9f, 0x699: 0x9f, 0x69a: 0x9f, 0x69b: 0x186, 0x69c: 0x9f, 0x69d: 0x9f, 0x69e: 0x9f, 0x69f: 0x9f, 0x6a0: 0x9f, 0x6a1: 0x9f, 0x6a2: 0x9f, 0x6a3: 0x9f, 0x6a4: 0x9f, 0x6a5: 0x9f, 0x6a6: 0x9f, 0x6a7: 0x9f, 0x6a8: 0x9f, 0x6a9: 0x9f, 0x6aa: 0x9f, 0x6ab: 0x9f, 0x6ac: 0x9f, 0x6ad: 0x9f, 0x6ae: 0x9f, 0x6af: 0x9f, 0x6b0: 0x9f, 0x6b1: 0x9f, 0x6b2: 0x9f, 0x6b3: 0x9f, 0x6b4: 0x9f, 0x6b5: 0x9f, 0x6b6: 0x9f, 0x6b7: 0x9f, 0x6b8: 0x9f, 0x6b9: 0x9f, 0x6ba: 0x9f, 0x6bb: 0x9f, 0x6bc: 0x9f, 0x6bd: 0x9f, 0x6be: 0x9f, 0x6bf: 0x9f, // Block 0x1b, offset 0x6c0 0x6c0: 0x9f, 0x6c1: 0x9f, 0x6c2: 0x9f, 0x6c3: 0x9f, 0x6c4: 0x9f, 0x6c5: 0x9f, 0x6c6: 0x9f, 0x6c7: 0x9f, 0x6c8: 0x9f, 0x6c9: 0x9f, 0x6ca: 0x9f, 0x6cb: 0x9f, 0x6cc: 0x9f, 0x6cd: 0x9f, 0x6ce: 0x9f, 0x6cf: 0x9f, 0x6d0: 0x9f, 0x6d1: 0x9f, 0x6d2: 0x9f, 0x6d3: 0x9f, 0x6d4: 0x9f, 0x6d5: 0x9f, 0x6d6: 0x9f, 0x6d7: 0x9f, 0x6d8: 0x9f, 0x6d9: 0x9f, 0x6da: 0x9f, 0x6db: 0x9f, 0x6dc: 0x187, 0x6dd: 0x9f, 0x6de: 0x9f, 0x6df: 0x9f, 0x6e0: 0x188, 0x6e1: 0x9f, 0x6e2: 0x9f, 0x6e3: 0x9f, 0x6e4: 0x9f, 0x6e5: 0x9f, 0x6e6: 0x9f, 0x6e7: 0x9f, 0x6e8: 0x9f, 0x6e9: 0x9f, 0x6ea: 0x9f, 0x6eb: 0x9f, 0x6ec: 0x9f, 0x6ed: 0x9f, 0x6ee: 0x9f, 0x6ef: 0x9f, 0x6f0: 0x9f, 0x6f1: 0x9f, 0x6f2: 0x9f, 0x6f3: 0x9f, 0x6f4: 0x9f, 0x6f5: 0x9f, 0x6f6: 0x9f, 0x6f7: 0x9f, 0x6f8: 0x9f, 0x6f9: 0x9f, 0x6fa: 0x9f, 0x6fb: 0x9f, 0x6fc: 0x9f, 0x6fd: 0x9f, 0x6fe: 0x9f, 0x6ff: 0x9f, // Block 0x1c, offset 0x700 0x700: 0x9f, 0x701: 0x9f, 0x702: 0x9f, 0x703: 0x9f, 0x704: 0x9f, 0x705: 0x9f, 0x706: 0x9f, 0x707: 0x9f, 0x708: 0x9f, 0x709: 0x9f, 0x70a: 0x9f, 0x70b: 0x9f, 0x70c: 0x9f, 0x70d: 0x9f, 0x70e: 0x9f, 0x70f: 0x9f, 0x710: 0x9f, 0x711: 0x9f, 0x712: 0x9f, 0x713: 0x9f, 0x714: 0x9f, 0x715: 0x9f, 0x716: 0x9f, 0x717: 0x9f, 0x718: 0x9f, 0x719: 0x9f, 0x71a: 0x9f, 0x71b: 0x9f, 0x71c: 0x9f, 0x71d: 0x9f, 0x71e: 0x9f, 0x71f: 0x9f, 0x720: 0x9f, 0x721: 0x9f, 0x722: 0x9f, 0x723: 0x9f, 0x724: 0x9f, 0x725: 0x9f, 0x726: 0x9f, 0x727: 0x9f, 0x728: 0x9f, 0x729: 0x9f, 0x72a: 0x9f, 0x72b: 0x9f, 0x72c: 0x9f, 0x72d: 0x9f, 0x72e: 0x9f, 0x72f: 0x9f, 0x730: 0x9f, 0x731: 0x9f, 0x732: 0x9f, 0x733: 0x9f, 0x734: 0x9f, 0x735: 0x9f, 0x736: 0x9f, 0x737: 0x9f, 0x738: 0x9f, 0x739: 0x9f, 0x73a: 0x189, 0x73b: 0x9f, 0x73c: 0x9f, 0x73d: 0x9f, 0x73e: 0x9f, 0x73f: 0x9f, // Block 0x1d, offset 0x740 0x740: 0x9f, 0x741: 0x9f, 0x742: 0x9f, 0x743: 0x9f, 0x744: 0x9f, 0x745: 0x9f, 0x746: 0x9f, 0x747: 0x9f, 0x748: 0x9f, 0x749: 0x9f, 0x74a: 0x9f, 0x74b: 0x9f, 0x74c: 0x9f, 0x74d: 0x9f, 0x74e: 0x9f, 0x74f: 0x9f, 0x750: 0x9f, 0x751: 0x9f, 0x752: 0x9f, 0x753: 0x9f, 0x754: 0x9f, 0x755: 0x9f, 0x756: 0x9f, 0x757: 0x9f, 0x758: 0x9f, 0x759: 0x9f, 0x75a: 0x9f, 0x75b: 0x9f, 0x75c: 0x9f, 0x75d: 0x9f, 0x75e: 0x9f, 0x75f: 0x9f, 0x760: 0x9f, 0x761: 0x9f, 0x762: 0x9f, 0x763: 0x9f, 0x764: 0x9f, 0x765: 0x9f, 0x766: 0x9f, 0x767: 0x9f, 0x768: 0x9f, 0x769: 0x9f, 0x76a: 0x9f, 0x76b: 0x9f, 0x76c: 0x9f, 0x76d: 0x9f, 0x76e: 0x9f, 0x76f: 0x18a, 0x770: 0xba, 0x771: 0xba, 0x772: 0xba, 0x773: 0xba, 0x774: 0xba, 0x775: 0xba, 0x776: 0xba, 0x777: 0xba, 0x778: 0xba, 0x779: 0xba, 0x77a: 0xba, 0x77b: 0xba, 0x77c: 0xba, 0x77d: 0xba, 0x77e: 0xba, 0x77f: 0xba, // Block 0x1e, offset 0x780 0x780: 0xba, 0x781: 0xba, 0x782: 0xba, 0x783: 0xba, 0x784: 0xba, 0x785: 0xba, 0x786: 0xba, 0x787: 0xba, 0x788: 0xba, 0x789: 0xba, 0x78a: 0xba, 0x78b: 0xba, 0x78c: 0xba, 0x78d: 0xba, 0x78e: 0xba, 0x78f: 0xba, 0x790: 0xba, 0x791: 0xba, 0x792: 0xba, 0x793: 0xba, 0x794: 0xba, 0x795: 0xba, 0x796: 0xba, 0x797: 0xba, 0x798: 0xba, 0x799: 0xba, 0x79a: 0xba, 0x79b: 0xba, 0x79c: 0xba, 0x79d: 0xba, 0x79e: 0xba, 0x79f: 0xba, 0x7a0: 0x76, 0x7a1: 0x77, 0x7a2: 0x78, 0x7a3: 0x18b, 0x7a4: 0x79, 0x7a5: 0x7a, 0x7a6: 0x18c, 0x7a7: 0x7b, 0x7a8: 0x7c, 0x7a9: 0xba, 0x7aa: 0xba, 0x7ab: 0xba, 0x7ac: 0xba, 0x7ad: 0xba, 0x7ae: 0xba, 0x7af: 0xba, 0x7b0: 0xba, 0x7b1: 0xba, 0x7b2: 0xba, 0x7b3: 0xba, 0x7b4: 0xba, 0x7b5: 0xba, 0x7b6: 0xba, 0x7b7: 0xba, 0x7b8: 0xba, 0x7b9: 0xba, 0x7ba: 0xba, 0x7bb: 0xba, 0x7bc: 0xba, 0x7bd: 0xba, 0x7be: 0xba, 0x7bf: 0xba, // Block 0x1f, offset 0x7c0 0x7d0: 0x0d, 0x7d1: 0x0e, 0x7d2: 0x0f, 0x7d3: 0x10, 0x7d4: 0x11, 0x7d5: 0x0b, 0x7d6: 0x12, 0x7d7: 0x07, 0x7d8: 0x13, 0x7d9: 0x0b, 0x7da: 0x0b, 0x7db: 0x14, 0x7dc: 0x0b, 0x7dd: 0x15, 0x7de: 0x16, 0x7df: 0x17, 0x7e0: 0x07, 0x7e1: 0x07, 0x7e2: 0x07, 0x7e3: 0x07, 0x7e4: 0x07, 0x7e5: 0x07, 0x7e6: 0x07, 0x7e7: 0x07, 0x7e8: 0x07, 0x7e9: 0x07, 0x7ea: 0x18, 0x7eb: 0x19, 0x7ec: 0x1a, 0x7ed: 0x07, 0x7ee: 0x1b, 0x7ef: 0x1c, 0x7f0: 0x0b, 0x7f1: 0x0b, 0x7f2: 0x0b, 0x7f3: 0x0b, 0x7f4: 0x0b, 0x7f5: 0x0b, 0x7f6: 0x0b, 0x7f7: 0x0b, 0x7f8: 0x0b, 0x7f9: 0x0b, 0x7fa: 0x0b, 0x7fb: 0x0b, 0x7fc: 0x0b, 0x7fd: 0x0b, 0x7fe: 0x0b, 0x7ff: 0x0b, // Block 0x20, offset 0x800 0x800: 0x0b, 0x801: 0x0b, 0x802: 0x0b, 0x803: 0x0b, 0x804: 0x0b, 0x805: 0x0b, 0x806: 0x0b, 0x807: 0x0b, 0x808: 0x0b, 0x809: 0x0b, 0x80a: 0x0b, 0x80b: 0x0b, 0x80c: 0x0b, 0x80d: 0x0b, 0x80e: 0x0b, 0x80f: 0x0b, 0x810: 0x0b, 0x811: 0x0b, 0x812: 0x0b, 0x813: 0x0b, 0x814: 0x0b, 0x815: 0x0b, 0x816: 0x0b, 0x817: 0x0b, 0x818: 0x0b, 0x819: 0x0b, 0x81a: 0x0b, 0x81b: 0x0b, 0x81c: 0x0b, 0x81d: 0x0b, 0x81e: 0x0b, 0x81f: 0x0b, 0x820: 0x0b, 0x821: 0x0b, 0x822: 0x0b, 0x823: 0x0b, 0x824: 0x0b, 0x825: 0x0b, 0x826: 0x0b, 0x827: 0x0b, 0x828: 0x0b, 0x829: 0x0b, 0x82a: 0x0b, 0x82b: 0x0b, 0x82c: 0x0b, 0x82d: 0x0b, 0x82e: 0x0b, 0x82f: 0x0b, 0x830: 0x0b, 0x831: 0x0b, 0x832: 0x0b, 0x833: 0x0b, 0x834: 0x0b, 0x835: 0x0b, 0x836: 0x0b, 0x837: 0x0b, 0x838: 0x0b, 0x839: 0x0b, 0x83a: 0x0b, 0x83b: 0x0b, 0x83c: 0x0b, 0x83d: 0x0b, 0x83e: 0x0b, 0x83f: 0x0b, // Block 0x21, offset 0x840 0x840: 0x18d, 0x841: 0x18e, 0x842: 0xba, 0x843: 0xba, 0x844: 0x18f, 0x845: 0x18f, 0x846: 0x18f, 0x847: 0x190, 0x848: 0xba, 0x849: 0xba, 0x84a: 0xba, 0x84b: 0xba, 0x84c: 0xba, 0x84d: 0xba, 0x84e: 0xba, 0x84f: 0xba, 0x850: 0xba, 0x851: 0xba, 0x852: 0xba, 0x853: 0xba, 0x854: 0xba, 0x855: 0xba, 0x856: 0xba, 0x857: 0xba, 0x858: 0xba, 0x859: 0xba, 0x85a: 0xba, 0x85b: 0xba, 0x85c: 0xba, 0x85d: 0xba, 0x85e: 0xba, 0x85f: 0xba, 0x860: 0xba, 0x861: 0xba, 0x862: 0xba, 0x863: 0xba, 0x864: 0xba, 0x865: 0xba, 0x866: 0xba, 0x867: 0xba, 0x868: 0xba, 0x869: 0xba, 0x86a: 0xba, 0x86b: 0xba, 0x86c: 0xba, 0x86d: 0xba, 0x86e: 0xba, 0x86f: 0xba, 0x870: 0xba, 0x871: 0xba, 0x872: 0xba, 0x873: 0xba, 0x874: 0xba, 0x875: 0xba, 0x876: 0xba, 0x877: 0xba, 0x878: 0xba, 0x879: 0xba, 0x87a: 0xba, 0x87b: 0xba, 0x87c: 0xba, 0x87d: 0xba, 0x87e: 0xba, 0x87f: 0xba, // Block 0x22, offset 0x880 0x880: 0x0b, 0x881: 0x0b, 0x882: 0x0b, 0x883: 0x0b, 0x884: 0x0b, 0x885: 0x0b, 0x886: 0x0b, 0x887: 0x0b, 0x888: 0x0b, 0x889: 0x0b, 0x88a: 0x0b, 0x88b: 0x0b, 0x88c: 0x0b, 0x88d: 0x0b, 0x88e: 0x0b, 0x88f: 0x0b, 0x890: 0x0b, 0x891: 0x0b, 0x892: 0x0b, 0x893: 0x0b, 0x894: 0x0b, 0x895: 0x0b, 0x896: 0x0b, 0x897: 0x0b, 0x898: 0x0b, 0x899: 0x0b, 0x89a: 0x0b, 0x89b: 0x0b, 0x89c: 0x0b, 0x89d: 0x0b, 0x89e: 0x0b, 0x89f: 0x0b, 0x8a0: 0x1f, 0x8a1: 0x0b, 0x8a2: 0x0b, 0x8a3: 0x0b, 0x8a4: 0x0b, 0x8a5: 0x0b, 0x8a6: 0x0b, 0x8a7: 0x0b, 0x8a8: 0x0b, 0x8a9: 0x0b, 0x8aa: 0x0b, 0x8ab: 0x0b, 0x8ac: 0x0b, 0x8ad: 0x0b, 0x8ae: 0x0b, 0x8af: 0x0b, 0x8b0: 0x0b, 0x8b1: 0x0b, 0x8b2: 0x0b, 0x8b3: 0x0b, 0x8b4: 0x0b, 0x8b5: 0x0b, 0x8b6: 0x0b, 0x8b7: 0x0b, 0x8b8: 0x0b, 0x8b9: 0x0b, 0x8ba: 0x0b, 0x8bb: 0x0b, 0x8bc: 0x0b, 0x8bd: 0x0b, 0x8be: 0x0b, 0x8bf: 0x0b, // Block 0x23, offset 0x8c0 0x8c0: 0x0b, 0x8c1: 0x0b, 0x8c2: 0x0b, 0x8c3: 0x0b, 0x8c4: 0x0b, 0x8c5: 0x0b, 0x8c6: 0x0b, 0x8c7: 0x0b, 0x8c8: 0x0b, 0x8c9: 0x0b, 0x8ca: 0x0b, 0x8cb: 0x0b, 0x8cc: 0x0b, 0x8cd: 0x0b, 0x8ce: 0x0b, 0x8cf: 0x0b, } // idnaSparseOffset: 276 entries, 552 bytes var idnaSparseOffset = []uint16{0x0, 0x8, 0x19, 0x25, 0x27, 0x2c, 0x33, 0x3e, 0x4a, 0x4e, 0x5d, 0x62, 0x6c, 0x78, 0x86, 0x8b, 0x94, 0xa4, 0xb2, 0xbe, 0xca, 0xdb, 0xe5, 0xec, 0xf9, 0x10a, 0x111, 0x11c, 0x12b, 0x139, 0x143, 0x145, 0x14a, 0x14d, 0x150, 0x152, 0x15e, 0x169, 0x171, 0x177, 0x17d, 0x182, 0x187, 0x18a, 0x18e, 0x194, 0x199, 0x1a5, 0x1af, 0x1b5, 0x1c6, 0x1d0, 0x1d3, 0x1db, 0x1de, 0x1eb, 0x1f3, 0x1f7, 0x1fe, 0x206, 0x216, 0x222, 0x224, 0x22e, 0x23a, 0x246, 0x252, 0x25a, 0x25f, 0x269, 0x27a, 0x27e, 0x289, 0x28d, 0x296, 0x29e, 0x2a4, 0x2a9, 0x2ac, 0x2b0, 0x2b6, 0x2ba, 0x2be, 0x2c2, 0x2c7, 0x2cd, 0x2d5, 0x2dc, 0x2e7, 0x2f1, 0x2f5, 0x2f8, 0x2fe, 0x302, 0x304, 0x307, 0x309, 0x30c, 0x316, 0x319, 0x328, 0x32c, 0x331, 0x334, 0x338, 0x33d, 0x342, 0x348, 0x34e, 0x35d, 0x363, 0x367, 0x376, 0x37b, 0x383, 0x38d, 0x398, 0x3a0, 0x3b1, 0x3ba, 0x3ca, 0x3d7, 0x3e1, 0x3e6, 0x3f3, 0x3f7, 0x3fc, 0x3fe, 0x402, 0x404, 0x408, 0x411, 0x417, 0x41b, 0x42b, 0x435, 0x43a, 0x43d, 0x443, 0x44a, 0x44f, 0x453, 0x459, 0x45e, 0x467, 0x46c, 0x472, 0x479, 0x480, 0x487, 0x48b, 0x490, 0x493, 0x498, 0x4a4, 0x4aa, 0x4af, 0x4b6, 0x4be, 0x4c3, 0x4c7, 0x4d7, 0x4de, 0x4e2, 0x4e6, 0x4ed, 0x4ef, 0x4f2, 0x4f5, 0x4f9, 0x502, 0x506, 0x50e, 0x516, 0x51c, 0x525, 0x531, 0x538, 0x541, 0x54b, 0x552, 0x560, 0x56d, 0x57a, 0x583, 0x587, 0x596, 0x59e, 0x5a9, 0x5b2, 0x5b8, 0x5c0, 0x5c9, 0x5d3, 0x5d6, 0x5e2, 0x5eb, 0x5ee, 0x5f3, 0x5fe, 0x607, 0x613, 0x616, 0x620, 0x629, 0x635, 0x642, 0x64f, 0x65d, 0x664, 0x667, 0x66c, 0x66f, 0x672, 0x675, 0x67c, 0x683, 0x687, 0x692, 0x695, 0x698, 0x69b, 0x6a1, 0x6a6, 0x6aa, 0x6ad, 0x6b0, 0x6b3, 0x6b6, 0x6b9, 0x6be, 0x6c8, 0x6cb, 0x6cf, 0x6de, 0x6ea, 0x6ee, 0x6f3, 0x6f7, 0x6fc, 0x700, 0x705, 0x70e, 0x719, 0x71f, 0x727, 0x72a, 0x72d, 0x731, 0x735, 0x73b, 0x741, 0x746, 0x749, 0x759, 0x760, 0x763, 0x766, 0x76a, 0x770, 0x775, 0x77a, 0x782, 0x787, 0x78b, 0x78f, 0x792, 0x795, 0x799, 0x79d, 0x7a0, 0x7b0, 0x7c1, 0x7c6, 0x7c8, 0x7ca} // idnaSparseValues: 1997 entries, 7988 bytes var idnaSparseValues = [1997]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x07}, {value: 0xe105, lo: 0x80, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0x97}, {value: 0xe105, lo: 0x98, hi: 0x9e}, {value: 0x001f, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbf}, // Block 0x1, offset 0x8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0xe01d, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0335, lo: 0x83, hi: 0x83}, {value: 0x034d, lo: 0x84, hi: 0x84}, {value: 0x0365, lo: 0x85, hi: 0x85}, {value: 0xe00d, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0xe00d, lo: 0x88, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x89}, {value: 0xe00d, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe00d, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0x8d}, {value: 0xe00d, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0xbf}, // Block 0x2, offset 0x19 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0249, lo: 0xb0, hi: 0xb0}, {value: 0x037d, lo: 0xb1, hi: 0xb1}, {value: 0x0259, lo: 0xb2, hi: 0xb2}, {value: 0x0269, lo: 0xb3, hi: 0xb3}, {value: 0x034d, lo: 0xb4, hi: 0xb4}, {value: 0x0395, lo: 0xb5, hi: 0xb5}, {value: 0xe1bd, lo: 0xb6, hi: 0xb6}, {value: 0x0279, lo: 0xb7, hi: 0xb7}, {value: 0x0289, lo: 0xb8, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbf}, // Block 0x3, offset 0x25 {value: 0x0000, lo: 0x01}, {value: 0x3308, lo: 0x80, hi: 0xbf}, // Block 0x4, offset 0x27 {value: 0x0000, lo: 0x04}, {value: 0x03f5, lo: 0x80, hi: 0x8f}, {value: 0xe105, lo: 0x90, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x5, offset 0x2c {value: 0x0000, lo: 0x06}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x0545, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x0008, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x6, offset 0x33 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0401, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0018, lo: 0x89, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x7, offset 0x3e {value: 0x0000, lo: 0x0b}, {value: 0x0818, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x82}, {value: 0x0818, lo: 0x83, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x85}, {value: 0x0818, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xae}, {value: 0x0808, lo: 0xaf, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x8, offset 0x4a {value: 0x0000, lo: 0x03}, {value: 0x0a08, lo: 0x80, hi: 0x87}, {value: 0x0c08, lo: 0x88, hi: 0x99}, {value: 0x0a08, lo: 0x9a, hi: 0xbf}, // Block 0x9, offset 0x4e {value: 0x0000, lo: 0x0e}, {value: 0x3308, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0c08, lo: 0x8d, hi: 0x8d}, {value: 0x0a08, lo: 0x8e, hi: 0x98}, {value: 0x0c08, lo: 0x99, hi: 0x9b}, {value: 0x0a08, lo: 0x9c, hi: 0xaa}, {value: 0x0c08, lo: 0xab, hi: 0xac}, {value: 0x0a08, lo: 0xad, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb4}, {value: 0x0a08, lo: 0xb5, hi: 0xb7}, {value: 0x0c08, lo: 0xb8, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbf}, // Block 0xa, offset 0x5d {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xb, offset 0x62 {value: 0x0000, lo: 0x09}, {value: 0x0808, lo: 0x80, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbf}, // Block 0xc, offset 0x6c {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x99}, {value: 0x0808, lo: 0x9a, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa3}, {value: 0x0808, lo: 0xa4, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa7}, {value: 0x0808, lo: 0xa8, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0818, lo: 0xb0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd, offset 0x78 {value: 0x0000, lo: 0x0d}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0a08, lo: 0xa0, hi: 0xa9}, {value: 0x0c08, lo: 0xaa, hi: 0xac}, {value: 0x0808, lo: 0xad, hi: 0xad}, {value: 0x0c08, lo: 0xae, hi: 0xae}, {value: 0x0a08, lo: 0xaf, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb2}, {value: 0x0a08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0a08, lo: 0xb6, hi: 0xb8}, {value: 0x0c08, lo: 0xb9, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0xe, offset 0x86 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0xa1}, {value: 0x0840, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xbf}, // Block 0xf, offset 0x8b {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x10, offset 0x94 {value: 0x0000, lo: 0x0f}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x85}, {value: 0x3008, lo: 0x86, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8c}, {value: 0x3b08, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x11, offset 0xa4 {value: 0x0000, lo: 0x0d}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x12, offset 0xb2 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xba}, {value: 0x3b08, lo: 0xbb, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x13, offset 0xbe {value: 0x0000, lo: 0x0b}, {value: 0x0040, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x14, offset 0xca {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x89}, {value: 0x3b08, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x3008, lo: 0x98, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x15, offset 0xdb {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb2}, {value: 0x08f1, lo: 0xb3, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb9}, {value: 0x3b08, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x16, offset 0xe5 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0xbf}, // Block 0x17, offset 0xec {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0961, lo: 0x9c, hi: 0x9c}, {value: 0x0999, lo: 0x9d, hi: 0x9d}, {value: 0x0008, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x18, offset 0xf9 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe03d, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x19, offset 0x10a {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0x1a, offset 0x111 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x1b, offset 0x11c {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x3008, lo: 0xa2, hi: 0xa4}, {value: 0x0008, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xbf}, // Block 0x1c, offset 0x12b {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x8c}, {value: 0x3308, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x3008, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x1d, offset 0x139 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x86}, {value: 0x055d, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8c}, {value: 0x055d, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0xe105, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0x1e, offset 0x143 {value: 0x0000, lo: 0x01}, {value: 0x0018, lo: 0x80, hi: 0xbf}, // Block 0x1f, offset 0x145 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa0}, {value: 0x2018, lo: 0xa1, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x20, offset 0x14a {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa7}, {value: 0x2018, lo: 0xa8, hi: 0xbf}, // Block 0x21, offset 0x14d {value: 0x0000, lo: 0x02}, {value: 0x2018, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0xbf}, // Block 0x22, offset 0x150 {value: 0x0000, lo: 0x01}, {value: 0x0008, lo: 0x80, hi: 0xbf}, // Block 0x23, offset 0x152 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x24, offset 0x15e {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x25, offset 0x169 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x26, offset 0x171 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x27, offset 0x177 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x28, offset 0x17d {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x29, offset 0x182 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x2a, offset 0x187 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x2b, offset 0x18a {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xbf}, // Block 0x2c, offset 0x18e {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2d, offset 0x194 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x2e, offset 0x199 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x3b08, lo: 0x94, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x2f, offset 0x1a5 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x30, offset 0x1af {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xb3}, {value: 0x3340, lo: 0xb4, hi: 0xb5}, {value: 0x3008, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x31, offset 0x1b5 {value: 0x0000, lo: 0x10}, {value: 0x3008, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x91}, {value: 0x3b08, lo: 0x92, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0x96}, {value: 0x0008, lo: 0x97, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x32, offset 0x1c6 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x86}, {value: 0x0218, lo: 0x87, hi: 0x87}, {value: 0x0018, lo: 0x88, hi: 0x8a}, {value: 0x33c0, lo: 0x8b, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0208, lo: 0xa0, hi: 0xbf}, // Block 0x33, offset 0x1d0 {value: 0x0000, lo: 0x02}, {value: 0x0208, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x34, offset 0x1d3 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0208, lo: 0x87, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xa9}, {value: 0x0208, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x35, offset 0x1db {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x36, offset 0x1de {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x37, offset 0x1eb {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x38, offset 0x1f3 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x39, offset 0x1f7 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0028, lo: 0x9a, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xbf}, // Block 0x3a, offset 0x1fe {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x3308, lo: 0x97, hi: 0x98}, {value: 0x3008, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x3b, offset 0x206 {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x94}, {value: 0x3008, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xac}, {value: 0x3008, lo: 0xad, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3c, offset 0x216 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xbd}, {value: 0x3318, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x3d, offset 0x222 {value: 0x0000, lo: 0x01}, {value: 0x0040, lo: 0x80, hi: 0xbf}, // Block 0x3e, offset 0x224 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3008, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x3f, offset 0x22e {value: 0x0000, lo: 0x0b}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x3808, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x40, offset 0x23a {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3808, lo: 0xaa, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xbf}, // Block 0x41, offset 0x246 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3008, lo: 0xaa, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3808, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x42, offset 0x252 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbf}, // Block 0x43, offset 0x25a {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x44, offset 0x25f {value: 0x0000, lo: 0x09}, {value: 0x0e29, lo: 0x80, hi: 0x80}, {value: 0x0e41, lo: 0x81, hi: 0x81}, {value: 0x0e59, lo: 0x82, hi: 0x82}, {value: 0x0e71, lo: 0x83, hi: 0x83}, {value: 0x0e89, lo: 0x84, hi: 0x85}, {value: 0x0ea1, lo: 0x86, hi: 0x86}, {value: 0x0eb9, lo: 0x87, hi: 0x87}, {value: 0x057d, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0x45, offset 0x269 {value: 0x0000, lo: 0x10}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x92}, {value: 0x0018, lo: 0x93, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa8}, {value: 0x0008, lo: 0xa9, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x46, offset 0x27a {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0x47, offset 0x27e {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x87}, {value: 0xe045, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0xe045, lo: 0x98, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0xe045, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbf}, // Block 0x48, offset 0x289 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x3318, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0x49, offset 0x28d {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x24c1, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x4a, offset 0x296 {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x24f1, lo: 0xac, hi: 0xac}, {value: 0x2529, lo: 0xad, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xae}, {value: 0x2579, lo: 0xaf, hi: 0xaf}, {value: 0x25b1, lo: 0xb0, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x4b, offset 0x29e {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x9f}, {value: 0x0080, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xad}, {value: 0x0080, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x4c, offset 0x2a4 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa8}, {value: 0x09c5, lo: 0xa9, hi: 0xa9}, {value: 0x09e5, lo: 0xaa, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xbf}, // Block 0x4d, offset 0x2a9 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0x4e, offset 0x2ac {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x28c1, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x4f, offset 0x2b0 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0e66, lo: 0xb4, hi: 0xb4}, {value: 0x292a, lo: 0xb5, hi: 0xb5}, {value: 0x0e86, lo: 0xb6, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x50, offset 0x2b6 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x9b}, {value: 0x2941, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0xbf}, // Block 0x51, offset 0x2ba {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x52, offset 0x2be {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0xbf}, // Block 0x53, offset 0x2c2 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x54, offset 0x2c7 {value: 0x0000, lo: 0x05}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x03f5, lo: 0x90, hi: 0x9f}, {value: 0x0ea5, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x55, offset 0x2cd {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x56, offset 0x2d5 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xae}, {value: 0xe075, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0x57, offset 0x2dc {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x58, offset 0x2e7 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xbf}, // Block 0x59, offset 0x2f1 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x5a, offset 0x2f5 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0xbf}, // Block 0x5b, offset 0x2f8 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9e}, {value: 0x0edd, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x5c, offset 0x2fe {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb2}, {value: 0x0efd, lo: 0xb3, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x5d, offset 0x302 {value: 0x0020, lo: 0x01}, {value: 0x0f1d, lo: 0x80, hi: 0xbf}, // Block 0x5e, offset 0x304 {value: 0x0020, lo: 0x02}, {value: 0x171d, lo: 0x80, hi: 0x8f}, {value: 0x18fd, lo: 0x90, hi: 0xbf}, // Block 0x5f, offset 0x307 {value: 0x0020, lo: 0x01}, {value: 0x1efd, lo: 0x80, hi: 0xbf}, // Block 0x60, offset 0x309 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x61, offset 0x30c {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9a}, {value: 0x29e2, lo: 0x9b, hi: 0x9b}, {value: 0x2a0a, lo: 0x9c, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9e}, {value: 0x2a31, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x62, offset 0x316 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbe}, {value: 0x2a69, lo: 0xbf, hi: 0xbf}, // Block 0x63, offset 0x319 {value: 0x0000, lo: 0x0e}, {value: 0x0040, lo: 0x80, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb0}, {value: 0x2a1d, lo: 0xb1, hi: 0xb1}, {value: 0x2a3d, lo: 0xb2, hi: 0xb2}, {value: 0x2a5d, lo: 0xb3, hi: 0xb3}, {value: 0x2a7d, lo: 0xb4, hi: 0xb4}, {value: 0x2a5d, lo: 0xb5, hi: 0xb5}, {value: 0x2a9d, lo: 0xb6, hi: 0xb6}, {value: 0x2abd, lo: 0xb7, hi: 0xb7}, {value: 0x2add, lo: 0xb8, hi: 0xb9}, {value: 0x2afd, lo: 0xba, hi: 0xbb}, {value: 0x2b1d, lo: 0xbc, hi: 0xbd}, {value: 0x2afd, lo: 0xbe, hi: 0xbf}, // Block 0x64, offset 0x328 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x65, offset 0x32c {value: 0x0030, lo: 0x04}, {value: 0x2aa2, lo: 0x80, hi: 0x9d}, {value: 0x305a, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x30a2, lo: 0xa0, hi: 0xbf}, // Block 0x66, offset 0x331 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x67, offset 0x334 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x68, offset 0x338 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x69, offset 0x33d {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x6a, offset 0x342 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb1}, {value: 0x0018, lo: 0xb2, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6b, offset 0x348 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0xb6}, {value: 0x0008, lo: 0xb7, hi: 0xb7}, {value: 0x2009, lo: 0xb8, hi: 0xb8}, {value: 0x6e89, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xbf}, // Block 0x6c, offset 0x34e {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x3308, lo: 0x8b, hi: 0x8b}, {value: 0x0008, lo: 0x8c, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x6d, offset 0x35d {value: 0x0000, lo: 0x05}, {value: 0x0208, lo: 0x80, hi: 0xb1}, {value: 0x0108, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6e, offset 0x363 {value: 0x0000, lo: 0x03}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xbf}, // Block 0x6f, offset 0x367 {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0008, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x70, offset 0x376 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x71, offset 0x37b {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x91}, {value: 0x3008, lo: 0x92, hi: 0x92}, {value: 0x3808, lo: 0x93, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x72, offset 0x383 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb9}, {value: 0x3008, lo: 0xba, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x73, offset 0x38d {value: 0x0000, lo: 0x0a}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x74, offset 0x398 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x75, offset 0x3a0 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8c}, {value: 0x3008, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbd}, {value: 0x0008, lo: 0xbe, hi: 0xbf}, // Block 0x76, offset 0x3b1 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x77, offset 0x3ba {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x9a}, {value: 0x0008, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3b08, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x78, offset 0x3ca {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x90}, {value: 0x0008, lo: 0x91, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x79, offset 0x3d7 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x4465, lo: 0x9c, hi: 0x9c}, {value: 0x447d, lo: 0x9d, hi: 0x9d}, {value: 0x2971, lo: 0x9e, hi: 0x9e}, {value: 0xe06d, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xaf}, {value: 0x4495, lo: 0xb0, hi: 0xbf}, // Block 0x7a, offset 0x3e1 {value: 0x0000, lo: 0x04}, {value: 0x44b5, lo: 0x80, hi: 0x8f}, {value: 0x44d5, lo: 0x90, hi: 0x9f}, {value: 0x44f5, lo: 0xa0, hi: 0xaf}, {value: 0x44d5, lo: 0xb0, hi: 0xbf}, // Block 0x7b, offset 0x3e6 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3b08, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x7c, offset 0x3f3 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x7d, offset 0x3f7 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x7e, offset 0x3fc {value: 0x0020, lo: 0x01}, {value: 0x4515, lo: 0x80, hi: 0xbf}, // Block 0x7f, offset 0x3fe {value: 0x0020, lo: 0x03}, {value: 0x4d15, lo: 0x80, hi: 0x94}, {value: 0x4ad5, lo: 0x95, hi: 0x95}, {value: 0x4fb5, lo: 0x96, hi: 0xbf}, // Block 0x80, offset 0x402 {value: 0x0020, lo: 0x01}, {value: 0x54f5, lo: 0x80, hi: 0xbf}, // Block 0x81, offset 0x404 {value: 0x0020, lo: 0x03}, {value: 0x5cf5, lo: 0x80, hi: 0x84}, {value: 0x5655, lo: 0x85, hi: 0x85}, {value: 0x5d95, lo: 0x86, hi: 0xbf}, // Block 0x82, offset 0x408 {value: 0x0020, lo: 0x08}, {value: 0x6b55, lo: 0x80, hi: 0x8f}, {value: 0x6d15, lo: 0x90, hi: 0x90}, {value: 0x6d55, lo: 0x91, hi: 0xab}, {value: 0x6ea1, lo: 0xac, hi: 0xac}, {value: 0x70b5, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x70d5, lo: 0xb0, hi: 0xbf}, // Block 0x83, offset 0x411 {value: 0x0020, lo: 0x05}, {value: 0x72d5, lo: 0x80, hi: 0xad}, {value: 0x6535, lo: 0xae, hi: 0xae}, {value: 0x7895, lo: 0xaf, hi: 0xb5}, {value: 0x6f55, lo: 0xb6, hi: 0xb6}, {value: 0x7975, lo: 0xb7, hi: 0xbf}, // Block 0x84, offset 0x417 {value: 0x0028, lo: 0x03}, {value: 0x7c21, lo: 0x80, hi: 0x82}, {value: 0x7be1, lo: 0x83, hi: 0x83}, {value: 0x7c99, lo: 0x84, hi: 0xbf}, // Block 0x85, offset 0x41b {value: 0x0038, lo: 0x0f}, {value: 0x9db1, lo: 0x80, hi: 0x83}, {value: 0x9e59, lo: 0x84, hi: 0x85}, {value: 0x9e91, lo: 0x86, hi: 0x87}, {value: 0x9ec9, lo: 0x88, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0xa089, lo: 0x92, hi: 0x97}, {value: 0xa1a1, lo: 0x98, hi: 0x9c}, {value: 0xa281, lo: 0x9d, hi: 0xb3}, {value: 0x9d41, lo: 0xb4, hi: 0xb4}, {value: 0x9db1, lo: 0xb5, hi: 0xb5}, {value: 0xa789, lo: 0xb6, hi: 0xbb}, {value: 0xa869, lo: 0xbc, hi: 0xbc}, {value: 0xa7f9, lo: 0xbd, hi: 0xbd}, {value: 0xa8d9, lo: 0xbe, hi: 0xbf}, // Block 0x86, offset 0x42b {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0008, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x87, offset 0x435 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x88, offset 0x43a {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x89, offset 0x43d {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x8a, offset 0x443 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x8b, offset 0x44a {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x8c, offset 0x44f {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x8d, offset 0x453 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x8e, offset 0x459 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xbf}, // Block 0x8f, offset 0x45e {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x90, offset 0x467 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x91, offset 0x46c {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x92, offset 0x472 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x97}, {value: 0x8ad5, lo: 0x98, hi: 0x9f}, {value: 0x8aed, lo: 0xa0, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xbf}, // Block 0x93, offset 0x479 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x8aed, lo: 0xb0, hi: 0xb7}, {value: 0x8ad5, lo: 0xb8, hi: 0xbf}, // Block 0x94, offset 0x480 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x95, offset 0x487 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x96, offset 0x48b {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xae}, {value: 0x0018, lo: 0xaf, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x97, offset 0x490 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x98, offset 0x493 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xbf}, // Block 0x99, offset 0x498 {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0808, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0808, lo: 0x8a, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbb}, {value: 0x0808, lo: 0xbc, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x0808, lo: 0xbf, hi: 0xbf}, // Block 0x9a, offset 0x4a4 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0818, lo: 0x97, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0818, lo: 0xb7, hi: 0xbf}, // Block 0x9b, offset 0x4aa {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa6}, {value: 0x0818, lo: 0xa7, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x9c, offset 0x4af {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x0818, lo: 0xbb, hi: 0xbf}, // Block 0x9d, offset 0x4b6 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0818, lo: 0x96, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0818, lo: 0xbf, hi: 0xbf}, // Block 0x9e, offset 0x4be {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbb}, {value: 0x0818, lo: 0xbc, hi: 0xbd}, {value: 0x0808, lo: 0xbe, hi: 0xbf}, // Block 0x9f, offset 0x4c3 {value: 0x0000, lo: 0x03}, {value: 0x0818, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x0818, lo: 0x92, hi: 0xbf}, // Block 0xa0, offset 0x4c7 {value: 0x0000, lo: 0x0f}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x94}, {value: 0x0808, lo: 0x95, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x98}, {value: 0x0808, lo: 0x99, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xa1, offset 0x4d7 {value: 0x0000, lo: 0x06}, {value: 0x0818, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0818, lo: 0x90, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xbc}, {value: 0x0818, lo: 0xbd, hi: 0xbf}, // Block 0xa2, offset 0x4de {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xa3, offset 0x4e2 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb8}, {value: 0x0018, lo: 0xb9, hi: 0xbf}, // Block 0xa4, offset 0x4e6 {value: 0x0000, lo: 0x06}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0818, lo: 0x98, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb7}, {value: 0x0818, lo: 0xb8, hi: 0xbf}, // Block 0xa5, offset 0x4ed {value: 0x0000, lo: 0x01}, {value: 0x0808, lo: 0x80, hi: 0xbf}, // Block 0xa6, offset 0x4ef {value: 0x0000, lo: 0x02}, {value: 0x0808, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xa7, offset 0x4f2 {value: 0x0000, lo: 0x02}, {value: 0x03dd, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xa8, offset 0x4f5 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xbf}, // Block 0xa9, offset 0x4f9 {value: 0x0000, lo: 0x08}, {value: 0x0908, lo: 0x80, hi: 0x80}, {value: 0x0a08, lo: 0x81, hi: 0xa1}, {value: 0x0c08, lo: 0xa2, hi: 0xa2}, {value: 0x0a08, lo: 0xa3, hi: 0xa3}, {value: 0x3308, lo: 0xa4, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xaa, offset 0x502 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0818, lo: 0xa0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xab, offset 0x506 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0xa6}, {value: 0x0808, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0a08, lo: 0xb0, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb3}, {value: 0x0a08, lo: 0xb4, hi: 0xbf}, // Block 0xac, offset 0x50e {value: 0x0000, lo: 0x07}, {value: 0x0a08, lo: 0x80, hi: 0x84}, {value: 0x0808, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x90}, {value: 0x0a18, lo: 0x91, hi: 0x93}, {value: 0x0c18, lo: 0x94, hi: 0x94}, {value: 0x0818, lo: 0x95, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xad, offset 0x516 {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xae, offset 0x51c {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x91}, {value: 0x0018, lo: 0x92, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xaf, offset 0x525 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0xb0, offset 0x531 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb1, offset 0x538 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb2}, {value: 0x3b08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xbf}, // Block 0xb2, offset 0x541 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xb3, offset 0x54b {value: 0x0000, lo: 0x06}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xbe}, {value: 0x3008, lo: 0xbf, hi: 0xbf}, // Block 0xb4, offset 0x552 {value: 0x0000, lo: 0x0d}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xb5, offset 0x560 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3808, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xb6, offset 0x56d {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xb7, offset 0x57a {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x3308, lo: 0x9f, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa9}, {value: 0x3b08, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb8, offset 0x583 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xb9, offset 0x587 {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xba, offset 0x596 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xbb, offset 0x59e {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x85}, {value: 0x0018, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xbc, offset 0x5a9 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbd, offset 0x5b2 {value: 0x0000, lo: 0x05}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9b}, {value: 0x3308, lo: 0x9c, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xbe, offset 0x5b8 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbf, offset 0x5c0 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xc0, offset 0x5c9 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb5}, {value: 0x3808, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0xc1, offset 0x5d3 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0xc2, offset 0x5d6 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0xc3, offset 0x5e2 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xc4, offset 0x5eb {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xbf}, // Block 0xc5, offset 0x5ee {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0xc6, offset 0x5f3 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0xc7, offset 0x5fe {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x3b08, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0xbf}, // Block 0xc8, offset 0x607 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x98}, {value: 0x3b08, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xbf}, // Block 0xc9, offset 0x613 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xca, offset 0x616 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xcb, offset 0x620 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xbf}, // Block 0xcc, offset 0x629 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xa9}, {value: 0x3308, lo: 0xaa, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xcd, offset 0x635 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xce, offset 0x642 {value: 0x0000, lo: 0x0c}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xbf}, // Block 0xcf, offset 0x64f {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x3008, lo: 0x93, hi: 0x94}, {value: 0x3308, lo: 0x95, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x96}, {value: 0x3b08, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xbf}, // Block 0xd0, offset 0x65d {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xd1, offset 0x664 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xd2, offset 0x667 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xd3, offset 0x66c {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0xbf}, // Block 0xd4, offset 0x66f {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xbf}, // Block 0xd5, offset 0x672 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0xbf}, // Block 0xd6, offset 0x675 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xd7, offset 0x67c {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xd8, offset 0x683 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0xd9, offset 0x687 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0xda, offset 0x692 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0xdb, offset 0x695 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0xdc, offset 0x698 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0xdd, offset 0x69b {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xde, offset 0x6a1 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xdf, offset 0x6a6 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xbf}, // Block 0xe0, offset 0x6aa {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xe1, offset 0x6ad {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xe2, offset 0x6b0 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xe3, offset 0x6b3 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xe4, offset 0x6b6 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0xe5, offset 0x6b9 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0xe6, offset 0x6be {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x03c0, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xbf}, // Block 0xe7, offset 0x6c8 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xe8, offset 0x6cb {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xbf}, // Block 0xe9, offset 0x6cf {value: 0x0000, lo: 0x0e}, {value: 0x0018, lo: 0x80, hi: 0x9d}, {value: 0xb5b9, lo: 0x9e, hi: 0x9e}, {value: 0xb601, lo: 0x9f, hi: 0x9f}, {value: 0xb649, lo: 0xa0, hi: 0xa0}, {value: 0xb6b1, lo: 0xa1, hi: 0xa1}, {value: 0xb719, lo: 0xa2, hi: 0xa2}, {value: 0xb781, lo: 0xa3, hi: 0xa3}, {value: 0xb7e9, lo: 0xa4, hi: 0xa4}, {value: 0x3018, lo: 0xa5, hi: 0xa6}, {value: 0x3318, lo: 0xa7, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xac}, {value: 0x3018, lo: 0xad, hi: 0xb2}, {value: 0x0340, lo: 0xb3, hi: 0xba}, {value: 0x3318, lo: 0xbb, hi: 0xbf}, // Block 0xea, offset 0x6de {value: 0x0000, lo: 0x0b}, {value: 0x3318, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0x84}, {value: 0x3318, lo: 0x85, hi: 0x8b}, {value: 0x0018, lo: 0x8c, hi: 0xa9}, {value: 0x3318, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xba}, {value: 0xb851, lo: 0xbb, hi: 0xbb}, {value: 0xb899, lo: 0xbc, hi: 0xbc}, {value: 0xb8e1, lo: 0xbd, hi: 0xbd}, {value: 0xb949, lo: 0xbe, hi: 0xbe}, {value: 0xb9b1, lo: 0xbf, hi: 0xbf}, // Block 0xeb, offset 0x6ea {value: 0x0000, lo: 0x03}, {value: 0xba19, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xbf}, // Block 0xec, offset 0x6ee {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x3318, lo: 0x82, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0xbf}, // Block 0xed, offset 0x6f3 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0xee, offset 0x6f7 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xef, offset 0x6fc {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0xf0, offset 0x700 {value: 0x0000, lo: 0x04}, {value: 0x3308, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0xf1, offset 0x705 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x3308, lo: 0xa1, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xf2, offset 0x70e {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0xf3, offset 0x719 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x86}, {value: 0x0818, lo: 0x87, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xf4, offset 0x71f {value: 0x0000, lo: 0x07}, {value: 0x0a08, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xf5, offset 0x727 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xb0}, {value: 0x0818, lo: 0xb1, hi: 0xbf}, // Block 0xf6, offset 0x72a {value: 0x0000, lo: 0x02}, {value: 0x0818, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xf7, offset 0x72d {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xf8, offset 0x731 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0xf9, offset 0x735 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0xfa, offset 0x73b {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xfb, offset 0x741 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8f}, {value: 0xc1c1, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xfc, offset 0x746 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xbf}, // Block 0xfd, offset 0x749 {value: 0x0000, lo: 0x0f}, {value: 0xc7e9, lo: 0x80, hi: 0x80}, {value: 0xc839, lo: 0x81, hi: 0x81}, {value: 0xc889, lo: 0x82, hi: 0x82}, {value: 0xc8d9, lo: 0x83, hi: 0x83}, {value: 0xc929, lo: 0x84, hi: 0x84}, {value: 0xc979, lo: 0x85, hi: 0x85}, {value: 0xc9c9, lo: 0x86, hi: 0x86}, {value: 0xca19, lo: 0x87, hi: 0x87}, {value: 0xca69, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0xcab9, lo: 0x90, hi: 0x90}, {value: 0xcad9, lo: 0x91, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xbf}, // Block 0xfe, offset 0x759 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xff, offset 0x760 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x100, offset 0x763 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0xbf}, // Block 0x101, offset 0x766 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x102, offset 0x76a {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x103, offset 0x770 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0x104, offset 0x775 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x105, offset 0x77a {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb2}, {value: 0x0018, lo: 0xb3, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x106, offset 0x782 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa2}, {value: 0x0040, lo: 0xa3, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x107, offset 0x787 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x108, offset 0x78b {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0x109, offset 0x78f {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0x10a, offset 0x792 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x10b, offset 0x795 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x10c, offset 0x799 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x10d, offset 0x79d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x10e, offset 0x7a0 {value: 0x0020, lo: 0x0f}, {value: 0xdeb9, lo: 0x80, hi: 0x89}, {value: 0x8dfd, lo: 0x8a, hi: 0x8a}, {value: 0xdff9, lo: 0x8b, hi: 0x9c}, {value: 0x8e1d, lo: 0x9d, hi: 0x9d}, {value: 0xe239, lo: 0x9e, hi: 0xa2}, {value: 0x8e3d, lo: 0xa3, hi: 0xa3}, {value: 0xe2d9, lo: 0xa4, hi: 0xab}, {value: 0x7ed5, lo: 0xac, hi: 0xac}, {value: 0xe3d9, lo: 0xad, hi: 0xaf}, {value: 0x8e5d, lo: 0xb0, hi: 0xb0}, {value: 0xe439, lo: 0xb1, hi: 0xb6}, {value: 0x8e7d, lo: 0xb7, hi: 0xb9}, {value: 0xe4f9, lo: 0xba, hi: 0xba}, {value: 0x8edd, lo: 0xbb, hi: 0xbb}, {value: 0xe519, lo: 0xbc, hi: 0xbf}, // Block 0x10f, offset 0x7b0 {value: 0x0020, lo: 0x10}, {value: 0x937d, lo: 0x80, hi: 0x80}, {value: 0xf099, lo: 0x81, hi: 0x86}, {value: 0x939d, lo: 0x87, hi: 0x8a}, {value: 0xd9f9, lo: 0x8b, hi: 0x8b}, {value: 0xf159, lo: 0x8c, hi: 0x96}, {value: 0x941d, lo: 0x97, hi: 0x97}, {value: 0xf2b9, lo: 0x98, hi: 0xa3}, {value: 0x943d, lo: 0xa4, hi: 0xa6}, {value: 0xf439, lo: 0xa7, hi: 0xaa}, {value: 0x949d, lo: 0xab, hi: 0xab}, {value: 0xf4b9, lo: 0xac, hi: 0xac}, {value: 0x94bd, lo: 0xad, hi: 0xad}, {value: 0xf4d9, lo: 0xae, hi: 0xaf}, {value: 0x94dd, lo: 0xb0, hi: 0xb1}, {value: 0xf519, lo: 0xb2, hi: 0xbe}, {value: 0x2040, lo: 0xbf, hi: 0xbf}, // Block 0x110, offset 0x7c1 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0340, lo: 0x81, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x9f}, {value: 0x0340, lo: 0xa0, hi: 0xbf}, // Block 0x111, offset 0x7c6 {value: 0x0000, lo: 0x01}, {value: 0x0340, lo: 0x80, hi: 0xbf}, // Block 0x112, offset 0x7c8 {value: 0x0000, lo: 0x01}, {value: 0x33c0, lo: 0x80, hi: 0xbf}, // Block 0x113, offset 0x7ca {value: 0x0000, lo: 0x02}, {value: 0x33c0, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, } // Total table size 42466 bytes (41KiB); checksum: 355A58A4 ================================================ FILE: vendor/golang.org/x/net/idna/tables9.0.0.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // +build !go1.10 package idna // UnicodeVersion is the Unicode version from which the tables in this package are derived. const UnicodeVersion = "9.0.0" var mappings string = "" + // Size: 8175 bytes "\x00\x01 \x03 ̈\x01a\x03 ̄\x012\x013\x03 ́\x03 ̧\x011\x01o\x051⁄4\x051⁄2" + "\x053⁄4\x03i̇\x03l·\x03ʼn\x01s\x03dž\x03ⱥ\x03ⱦ\x01h\x01j\x01r\x01w\x01y" + "\x03 ̆\x03 ̇\x03 ̊\x03 ̨\x03 ̃\x03 ̋\x01l\x01x\x04̈́\x03 ι\x01;\x05 ̈́" + "\x04եւ\x04اٴ\x04وٴ\x04ۇٴ\x04يٴ\x06क़\x06ख़\x06ग़\x06ज़\x06ड़\x06ढ़\x06फ़" + "\x06य़\x06ড়\x06ঢ়\x06য়\x06ਲ਼\x06ਸ਼\x06ਖ਼\x06ਗ਼\x06ਜ਼\x06ਫ਼\x06ଡ଼\x06ଢ଼" + "\x06ํา\x06ໍາ\x06ຫນ\x06ຫມ\x06གྷ\x06ཌྷ\x06དྷ\x06བྷ\x06ཛྷ\x06ཀྵ\x06ཱི\x06ཱུ" + "\x06ྲྀ\x09ྲཱྀ\x06ླྀ\x09ླཱྀ\x06ཱྀ\x06ྒྷ\x06ྜྷ\x06ྡྷ\x06ྦྷ\x06ྫྷ\x06ྐྵ\x02" + "в\x02д\x02о\x02с\x02т\x02ъ\x02ѣ\x02æ\x01b\x01d\x01e\x02ǝ\x01g\x01i\x01k" + "\x01m\x01n\x02ȣ\x01p\x01t\x01u\x02ɐ\x02ɑ\x02ə\x02ɛ\x02ɜ\x02ŋ\x02ɔ\x02ɯ" + "\x01v\x02β\x02γ\x02δ\x02φ\x02χ\x02ρ\x02н\x02ɒ\x01c\x02ɕ\x02ð\x01f\x02ɟ" + "\x02ɡ\x02ɥ\x02ɨ\x02ɩ\x02ɪ\x02ʝ\x02ɭ\x02ʟ\x02ɱ\x02ɰ\x02ɲ\x02ɳ\x02ɴ\x02ɵ" + "\x02ɸ\x02ʂ\x02ʃ\x02ƫ\x02ʉ\x02ʊ\x02ʋ\x02ʌ\x01z\x02ʐ\x02ʑ\x02ʒ\x02θ\x02ss" + "\x02ά\x02έ\x02ή\x02ί\x02ό\x02ύ\x02ώ\x05ἀι\x05ἁι\x05ἂι\x05ἃι\x05ἄι\x05ἅι" + "\x05ἆι\x05ἇι\x05ἠι\x05ἡι\x05ἢι\x05ἣι\x05ἤι\x05ἥι\x05ἦι\x05ἧι\x05ὠι\x05ὡι" + "\x05ὢι\x05ὣι\x05ὤι\x05ὥι\x05ὦι\x05ὧι\x05ὰι\x04αι\x04άι\x05ᾶι\x02ι\x05 ̈͂" + "\x05ὴι\x04ηι\x04ήι\x05ῆι\x05 ̓̀\x05 ̓́\x05 ̓͂\x02ΐ\x05 ̔̀\x05 ̔́\x05 ̔͂" + "\x02ΰ\x05 ̈̀\x01`\x05ὼι\x04ωι\x04ώι\x05ῶι\x06′′\x09′′′\x06‵‵\x09‵‵‵\x02!" + "!\x02??\x02?!\x02!?\x0c′′′′\x010\x014\x015\x016\x017\x018\x019\x01+\x01=" + "\x01(\x01)\x02rs\x02ħ\x02no\x01q\x02sm\x02tm\x02ω\x02å\x02א\x02ב\x02ג" + "\x02ד\x02π\x051⁄7\x051⁄9\x061⁄10\x051⁄3\x052⁄3\x051⁄5\x052⁄5\x053⁄5\x054" + "⁄5\x051⁄6\x055⁄6\x051⁄8\x053⁄8\x055⁄8\x057⁄8\x041⁄\x02ii\x02iv\x02vi" + "\x04viii\x02ix\x02xi\x050⁄3\x06∫∫\x09∫∫∫\x06∮∮\x09∮∮∮\x0210\x0211\x0212" + "\x0213\x0214\x0215\x0216\x0217\x0218\x0219\x0220\x04(10)\x04(11)\x04(12)" + "\x04(13)\x04(14)\x04(15)\x04(16)\x04(17)\x04(18)\x04(19)\x04(20)\x0c∫∫∫∫" + "\x02==\x05⫝̸\x02ɫ\x02ɽ\x02ȿ\x02ɀ\x01.\x04 ゙\x04 ゚\x06より\x06コト\x05(ᄀ)\x05" + "(ᄂ)\x05(ᄃ)\x05(ᄅ)\x05(ᄆ)\x05(ᄇ)\x05(ᄉ)\x05(ᄋ)\x05(ᄌ)\x05(ᄎ)\x05(ᄏ)\x05(ᄐ" + ")\x05(ᄑ)\x05(ᄒ)\x05(가)\x05(나)\x05(다)\x05(라)\x05(마)\x05(바)\x05(사)\x05(아)" + "\x05(자)\x05(차)\x05(카)\x05(타)\x05(파)\x05(하)\x05(주)\x08(오전)\x08(오후)\x05(一)" + "\x05(二)\x05(三)\x05(四)\x05(五)\x05(六)\x05(七)\x05(八)\x05(九)\x05(十)\x05(月)" + "\x05(火)\x05(水)\x05(木)\x05(金)\x05(土)\x05(日)\x05(株)\x05(有)\x05(社)\x05(名)" + "\x05(特)\x05(財)\x05(祝)\x05(労)\x05(代)\x05(呼)\x05(学)\x05(監)\x05(企)\x05(資)" + "\x05(協)\x05(祭)\x05(休)\x05(自)\x05(至)\x0221\x0222\x0223\x0224\x0225\x0226" + "\x0227\x0228\x0229\x0230\x0231\x0232\x0233\x0234\x0235\x06참고\x06주의\x0236" + "\x0237\x0238\x0239\x0240\x0241\x0242\x0243\x0244\x0245\x0246\x0247\x0248" + "\x0249\x0250\x041月\x042月\x043月\x044月\x045月\x046月\x047月\x048月\x049月\x0510" + "月\x0511月\x0512月\x02hg\x02ev\x0cアパート\x0cアルファ\x0cアンペア\x09アール\x0cイニング\x09" + "インチ\x09ウォン\x0fエスクード\x0cエーカー\x09オンス\x09オーム\x09カイリ\x0cカラット\x0cカロリー\x09ガロ" + "ン\x09ガンマ\x06ギガ\x09ギニー\x0cキュリー\x0cギルダー\x06キロ\x0fキログラム\x12キロメートル\x0fキロワッ" + "ト\x09グラム\x0fグラムトン\x0fクルゼイロ\x0cクローネ\x09ケース\x09コルナ\x09コーポ\x0cサイクル\x0fサンチ" + "ーム\x0cシリング\x09センチ\x09セント\x09ダース\x06デシ\x06ドル\x06トン\x06ナノ\x09ノット\x09ハイツ" + "\x0fパーセント\x09パーツ\x0cバーレル\x0fピアストル\x09ピクル\x06ピコ\x06ビル\x0fファラッド\x0cフィート" + "\x0fブッシェル\x09フラン\x0fヘクタール\x06ペソ\x09ペニヒ\x09ヘルツ\x09ペンス\x09ページ\x09ベータ\x0cポイ" + "ント\x09ボルト\x06ホン\x09ポンド\x09ホール\x09ホーン\x0cマイクロ\x09マイル\x09マッハ\x09マルク\x0fマ" + "ンション\x0cミクロン\x06ミリ\x0fミリバール\x06メガ\x0cメガトン\x0cメートル\x09ヤード\x09ヤール\x09ユアン" + "\x0cリットル\x06リラ\x09ルピー\x0cルーブル\x06レム\x0fレントゲン\x09ワット\x040点\x041点\x042点" + "\x043点\x044点\x045点\x046点\x047点\x048点\x049点\x0510点\x0511点\x0512点\x0513点" + "\x0514点\x0515点\x0516点\x0517点\x0518点\x0519点\x0520点\x0521点\x0522点\x0523点" + "\x0524点\x02da\x02au\x02ov\x02pc\x02dm\x02iu\x06平成\x06昭和\x06大正\x06明治\x0c株" + "式会社\x02pa\x02na\x02ma\x02ka\x02kb\x02mb\x02gb\x04kcal\x02pf\x02nf\x02m" + "g\x02kg\x02hz\x02ml\x02dl\x02kl\x02fm\x02nm\x02mm\x02cm\x02km\x02m2\x02m" + "3\x05m∕s\x06m∕s2\x07rad∕s\x08rad∕s2\x02ps\x02ns\x02ms\x02pv\x02nv\x02mv" + "\x02kv\x02pw\x02nw\x02mw\x02kw\x02bq\x02cc\x02cd\x06c∕kg\x02db\x02gy\x02" + "ha\x02hp\x02in\x02kk\x02kt\x02lm\x02ln\x02lx\x02ph\x02pr\x02sr\x02sv\x02" + "wb\x05v∕m\x05a∕m\x041日\x042日\x043日\x044日\x045日\x046日\x047日\x048日\x049日" + "\x0510日\x0511日\x0512日\x0513日\x0514日\x0515日\x0516日\x0517日\x0518日\x0519日" + "\x0520日\x0521日\x0522日\x0523日\x0524日\x0525日\x0526日\x0527日\x0528日\x0529日" + "\x0530日\x0531日\x02ь\x02ɦ\x02ɬ\x02ʞ\x02ʇ\x02œ\x04𤋮\x04𢡊\x04𢡄\x04𣏕\x04𥉉" + "\x04𥳐\x04𧻓\x02ff\x02fi\x02fl\x02st\x04մն\x04մե\x04մի\x04վն\x04մխ\x04יִ" + "\x04ײַ\x02ע\x02ה\x02כ\x02ל\x02ם\x02ר\x02ת\x04שׁ\x04שׂ\x06שּׁ\x06שּׂ\x04א" + "ַ\x04אָ\x04אּ\x04בּ\x04גּ\x04דּ\x04הּ\x04וּ\x04זּ\x04טּ\x04יּ\x04ךּ\x04" + "כּ\x04לּ\x04מּ\x04נּ\x04סּ\x04ףּ\x04פּ\x04צּ\x04קּ\x04רּ\x04שּ\x04תּ" + "\x04וֹ\x04בֿ\x04כֿ\x04פֿ\x04אל\x02ٱ\x02ٻ\x02پ\x02ڀ\x02ٺ\x02ٿ\x02ٹ\x02ڤ" + "\x02ڦ\x02ڄ\x02ڃ\x02چ\x02ڇ\x02ڍ\x02ڌ\x02ڎ\x02ڈ\x02ژ\x02ڑ\x02ک\x02گ\x02ڳ" + "\x02ڱ\x02ں\x02ڻ\x02ۀ\x02ہ\x02ھ\x02ے\x02ۓ\x02ڭ\x02ۇ\x02ۆ\x02ۈ\x02ۋ\x02ۅ" + "\x02ۉ\x02ې\x02ى\x04ئا\x04ئە\x04ئو\x04ئۇ\x04ئۆ\x04ئۈ\x04ئې\x04ئى\x02ی\x04" + "ئج\x04ئح\x04ئم\x04ئي\x04بج\x04بح\x04بخ\x04بم\x04بى\x04بي\x04تج\x04تح" + "\x04تخ\x04تم\x04تى\x04تي\x04ثج\x04ثم\x04ثى\x04ثي\x04جح\x04جم\x04حج\x04حم" + "\x04خج\x04خح\x04خم\x04سج\x04سح\x04سخ\x04سم\x04صح\x04صم\x04ضج\x04ضح\x04ضخ" + "\x04ضم\x04طح\x04طم\x04ظم\x04عج\x04عم\x04غج\x04غم\x04فج\x04فح\x04فخ\x04فم" + "\x04فى\x04في\x04قح\x04قم\x04قى\x04قي\x04كا\x04كج\x04كح\x04كخ\x04كل\x04كم" + "\x04كى\x04كي\x04لج\x04لح\x04لخ\x04لم\x04لى\x04لي\x04مج\x04مح\x04مخ\x04مم" + "\x04مى\x04مي\x04نج\x04نح\x04نخ\x04نم\x04نى\x04ني\x04هج\x04هم\x04هى\x04هي" + "\x04يج\x04يح\x04يخ\x04يم\x04يى\x04يي\x04ذٰ\x04رٰ\x04ىٰ\x05 ٌّ\x05 ٍّ\x05" + " َّ\x05 ُّ\x05 ِّ\x05 ّٰ\x04ئر\x04ئز\x04ئن\x04بر\x04بز\x04بن\x04تر\x04تز" + "\x04تن\x04ثر\x04ثز\x04ثن\x04ما\x04نر\x04نز\x04نن\x04ير\x04يز\x04ين\x04ئخ" + "\x04ئه\x04به\x04ته\x04صخ\x04له\x04نه\x04هٰ\x04يه\x04ثه\x04سه\x04شم\x04شه" + "\x06ـَّ\x06ـُّ\x06ـِّ\x04طى\x04طي\x04عى\x04عي\x04غى\x04غي\x04سى\x04سي" + "\x04شى\x04شي\x04حى\x04حي\x04جى\x04جي\x04خى\x04خي\x04صى\x04صي\x04ضى\x04ضي" + "\x04شج\x04شح\x04شخ\x04شر\x04سر\x04صر\x04ضر\x04اً\x06تجم\x06تحج\x06تحم" + "\x06تخم\x06تمج\x06تمح\x06تمخ\x06جمح\x06حمي\x06حمى\x06سحج\x06سجح\x06سجى" + "\x06سمح\x06سمج\x06سمم\x06صحح\x06صمم\x06شحم\x06شجي\x06شمخ\x06شمم\x06ضحى" + "\x06ضخم\x06طمح\x06طمم\x06طمي\x06عجم\x06عمم\x06عمى\x06غمم\x06غمي\x06غمى" + "\x06فخم\x06قمح\x06قمم\x06لحم\x06لحي\x06لحى\x06لجج\x06لخم\x06لمح\x06محج" + "\x06محم\x06محي\x06مجح\x06مجم\x06مخج\x06مخم\x06مجخ\x06همج\x06همم\x06نحم" + "\x06نحى\x06نجم\x06نجى\x06نمي\x06نمى\x06يمم\x06بخي\x06تجي\x06تجى\x06تخي" + "\x06تخى\x06تمي\x06تمى\x06جمي\x06جحى\x06جمى\x06سخى\x06صحي\x06شحي\x06ضحي" + "\x06لجي\x06لمي\x06يحي\x06يجي\x06يمي\x06ممي\x06قمي\x06نحي\x06عمي\x06كمي" + "\x06نجح\x06مخي\x06لجم\x06كمم\x06جحي\x06حجي\x06مجي\x06فمي\x06بحي\x06سخي" + "\x06نجي\x06صلے\x06قلے\x08الله\x08اكبر\x08محمد\x08صلعم\x08رسول\x08عليه" + "\x08وسلم\x06صلى!صلى الله عليه وسلم\x0fجل جلاله\x08ریال\x01,\x01:\x01!" + "\x01?\x01_\x01{\x01}\x01[\x01]\x01#\x01&\x01*\x01-\x01<\x01>\x01\\\x01$" + "\x01%\x01@\x04ـً\x04ـَ\x04ـُ\x04ـِ\x04ـّ\x04ـْ\x02ء\x02آ\x02أ\x02ؤ\x02إ" + "\x02ئ\x02ا\x02ب\x02ة\x02ت\x02ث\x02ج\x02ح\x02خ\x02د\x02ذ\x02ر\x02ز\x02س" + "\x02ش\x02ص\x02ض\x02ط\x02ظ\x02ع\x02غ\x02ف\x02ق\x02ك\x02ل\x02م\x02ن\x02ه" + "\x02و\x02ي\x04لآ\x04لأ\x04لإ\x04لا\x01\x22\x01'\x01/\x01^\x01|\x01~\x02¢" + "\x02£\x02¬\x02¦\x02¥\x08𝅗𝅥\x08𝅘𝅥\x0c𝅘𝅥𝅮\x0c𝅘𝅥𝅯\x0c𝅘𝅥𝅰\x0c𝅘𝅥𝅱\x0c𝅘𝅥𝅲\x08𝆹" + "𝅥\x08𝆺𝅥\x0c𝆹𝅥𝅮\x0c𝆺𝅥𝅮\x0c𝆹𝅥𝅯\x0c𝆺𝅥𝅯\x02ı\x02ȷ\x02α\x02ε\x02ζ\x02η\x02" + "κ\x02λ\x02μ\x02ν\x02ξ\x02ο\x02σ\x02τ\x02υ\x02ψ\x03∇\x03∂\x02ϝ\x02ٮ\x02ڡ" + "\x02ٯ\x020,\x021,\x022,\x023,\x024,\x025,\x026,\x027,\x028,\x029,\x03(a)" + "\x03(b)\x03(c)\x03(d)\x03(e)\x03(f)\x03(g)\x03(h)\x03(i)\x03(j)\x03(k)" + "\x03(l)\x03(m)\x03(n)\x03(o)\x03(p)\x03(q)\x03(r)\x03(s)\x03(t)\x03(u)" + "\x03(v)\x03(w)\x03(x)\x03(y)\x03(z)\x07〔s〕\x02wz\x02hv\x02sd\x03ppv\x02w" + "c\x02mc\x02md\x02dj\x06ほか\x06ココ\x03サ\x03手\x03字\x03双\x03デ\x03二\x03多\x03解" + "\x03天\x03交\x03映\x03無\x03料\x03前\x03後\x03再\x03新\x03初\x03終\x03生\x03販\x03声" + "\x03吹\x03演\x03投\x03捕\x03一\x03三\x03遊\x03左\x03中\x03右\x03指\x03走\x03打\x03禁" + "\x03空\x03合\x03満\x03有\x03月\x03申\x03割\x03営\x03配\x09〔本〕\x09〔三〕\x09〔二〕\x09〔安" + "〕\x09〔点〕\x09〔打〕\x09〔盗〕\x09〔勝〕\x09〔敗〕\x03得\x03可\x03丽\x03丸\x03乁\x03你\x03" + "侮\x03侻\x03倂\x03偺\x03備\x03僧\x03像\x03㒞\x03免\x03兔\x03兤\x03具\x03㒹\x03內\x03" + "冗\x03冤\x03仌\x03冬\x03况\x03凵\x03刃\x03㓟\x03刻\x03剆\x03剷\x03㔕\x03勇\x03勉\x03" + "勤\x03勺\x03包\x03匆\x03北\x03卉\x03卑\x03博\x03即\x03卽\x03卿\x03灰\x03及\x03叟\x03" + "叫\x03叱\x03吆\x03咞\x03吸\x03呈\x03周\x03咢\x03哶\x03唐\x03啓\x03啣\x03善\x03喙\x03" + "喫\x03喳\x03嗂\x03圖\x03嘆\x03圗\x03噑\x03噴\x03切\x03壮\x03城\x03埴\x03堍\x03型\x03" + "堲\x03報\x03墬\x03売\x03壷\x03夆\x03夢\x03奢\x03姬\x03娛\x03娧\x03姘\x03婦\x03㛮\x03" + "嬈\x03嬾\x03寃\x03寘\x03寧\x03寳\x03寿\x03将\x03尢\x03㞁\x03屠\x03屮\x03峀\x03岍\x03" + "嵃\x03嵮\x03嵫\x03嵼\x03巡\x03巢\x03㠯\x03巽\x03帨\x03帽\x03幩\x03㡢\x03㡼\x03庰\x03" + "庳\x03庶\x03廊\x03廾\x03舁\x03弢\x03㣇\x03形\x03彫\x03㣣\x03徚\x03忍\x03志\x03忹\x03" + "悁\x03㤺\x03㤜\x03悔\x03惇\x03慈\x03慌\x03慎\x03慺\x03憎\x03憲\x03憤\x03憯\x03懞\x03" + "懲\x03懶\x03成\x03戛\x03扝\x03抱\x03拔\x03捐\x03挽\x03拼\x03捨\x03掃\x03揤\x03搢\x03" + "揅\x03掩\x03㨮\x03摩\x03摾\x03撝\x03摷\x03㩬\x03敏\x03敬\x03旣\x03書\x03晉\x03㬙\x03" + "暑\x03㬈\x03㫤\x03冒\x03冕\x03最\x03暜\x03肭\x03䏙\x03朗\x03望\x03朡\x03杞\x03杓\x03" + "㭉\x03柺\x03枅\x03桒\x03梅\x03梎\x03栟\x03椔\x03㮝\x03楂\x03榣\x03槪\x03檨\x03櫛\x03" + "㰘\x03次\x03歔\x03㱎\x03歲\x03殟\x03殺\x03殻\x03汎\x03沿\x03泍\x03汧\x03洖\x03派\x03" + "海\x03流\x03浩\x03浸\x03涅\x03洴\x03港\x03湮\x03㴳\x03滋\x03滇\x03淹\x03潮\x03濆\x03" + "瀹\x03瀞\x03瀛\x03㶖\x03灊\x03災\x03灷\x03炭\x03煅\x03熜\x03爨\x03爵\x03牐\x03犀\x03" + "犕\x03獺\x03王\x03㺬\x03玥\x03㺸\x03瑇\x03瑜\x03瑱\x03璅\x03瓊\x03㼛\x03甤\x03甾\x03" + "異\x03瘐\x03㿼\x03䀈\x03直\x03眞\x03真\x03睊\x03䀹\x03瞋\x03䁆\x03䂖\x03硎\x03碌\x03" + "磌\x03䃣\x03祖\x03福\x03秫\x03䄯\x03穀\x03穊\x03穏\x03䈂\x03篆\x03築\x03䈧\x03糒\x03" + "䊠\x03糨\x03糣\x03紀\x03絣\x03䌁\x03緇\x03縂\x03繅\x03䌴\x03䍙\x03罺\x03羕\x03翺\x03" + "者\x03聠\x03聰\x03䏕\x03育\x03脃\x03䐋\x03脾\x03媵\x03舄\x03辞\x03䑫\x03芑\x03芋\x03" + "芝\x03劳\x03花\x03芳\x03芽\x03苦\x03若\x03茝\x03荣\x03莭\x03茣\x03莽\x03菧\x03著\x03" + "荓\x03菊\x03菌\x03菜\x03䔫\x03蓱\x03蓳\x03蔖\x03蕤\x03䕝\x03䕡\x03䕫\x03虐\x03虜\x03" + "虧\x03虩\x03蚩\x03蚈\x03蜎\x03蛢\x03蝹\x03蜨\x03蝫\x03螆\x03蟡\x03蠁\x03䗹\x03衠\x03" + "衣\x03裗\x03裞\x03䘵\x03裺\x03㒻\x03䚾\x03䛇\x03誠\x03諭\x03變\x03豕\x03貫\x03賁\x03" + "贛\x03起\x03跋\x03趼\x03跰\x03軔\x03輸\x03邔\x03郱\x03鄑\x03鄛\x03鈸\x03鋗\x03鋘\x03" + "鉼\x03鏹\x03鐕\x03開\x03䦕\x03閷\x03䧦\x03雃\x03嶲\x03霣\x03䩮\x03䩶\x03韠\x03䪲\x03" + "頋\x03頩\x03飢\x03䬳\x03餩\x03馧\x03駂\x03駾\x03䯎\x03鬒\x03鱀\x03鳽\x03䳎\x03䳭\x03" + "鵧\x03䳸\x03麻\x03䵖\x03黹\x03黾\x03鼅\x03鼏\x03鼖\x03鼻" var xorData string = "" + // Size: 4855 bytes "\x02\x0c\x09\x02\xb0\xec\x02\xad\xd8\x02\xad\xd9\x02\x06\x07\x02\x0f\x12" + "\x02\x0f\x1f\x02\x0f\x1d\x02\x01\x13\x02\x0f\x16\x02\x0f\x0b\x02\x0f3" + "\x02\x0f7\x02\x0f?\x02\x0f/\x02\x0f*\x02\x0c&\x02\x0c*\x02\x0c;\x02\x0c9" + "\x02\x0c%\x02\xab\xed\x02\xab\xe2\x02\xab\xe3\x02\xa9\xe0\x02\xa9\xe1" + "\x02\xa9\xe6\x02\xa3\xcb\x02\xa3\xc8\x02\xa3\xc9\x02\x01#\x02\x01\x08" + "\x02\x0e>\x02\x0e'\x02\x0f\x03\x02\x03\x0d\x02\x03\x09\x02\x03\x17\x02" + "\x03\x0e\x02\x02\x03\x02\x011\x02\x01\x00\x02\x01\x10\x02\x03<\x02\x07" + "\x0d\x02\x02\x0c\x02\x0c0\x02\x01\x03\x02\x01\x01\x02\x01 \x02\x01\x22" + "\x02\x01)\x02\x01\x0a\x02\x01\x0c\x02\x02\x06\x02\x02\x02\x02\x03\x10" + "\x03\x037 \x03\x0b+\x03\x02\x01\x04\x02\x01\x02\x02\x019\x02\x03\x1c\x02" + "\x02$\x03\x80p$\x02\x03:\x02\x03\x0a\x03\xc1r.\x03\xc1r,\x03\xc1r\x02" + "\x02\x02:\x02\x02>\x02\x02,\x02\x02\x10\x02\x02\x00\x03\xc1s<\x03\xc1s*" + "\x03\xc2L$\x03\xc2L;\x02\x09)\x02\x0a\x19\x03\x83\xab\xe3\x03\x83\xab" + "\xf2\x03 4\xe0\x03\x81\xab\xea\x03\x81\xab\xf3\x03 4\xef\x03\x96\xe1\xcd" + "\x03\x84\xe5\xc3\x02\x0d\x11\x03\x8b\xec\xcb\x03\x94\xec\xcf\x03\x9a\xec" + "\xc2\x03\x8b\xec\xdb\x03\x94\xec\xdf\x03\x9a\xec\xd2\x03\x01\x0c!\x03" + "\x01\x0c#\x03ʠ\x9d\x03ʣ\x9c\x03ʢ\x9f\x03ʥ\x9e\x03ʤ\x91\x03ʧ\x90\x03ʦ\x93" + "\x03ʩ\x92\x03ʨ\x95\x03\xca\xf3\xb5\x03\xca\xf0\xb4\x03\xca\xf1\xb7\x03" + "\xca\xf6\xb6\x03\xca\xf7\x89\x03\xca\xf4\x88\x03\xca\xf5\x8b\x03\xca\xfa" + "\x8a\x03\xca\xfb\x8d\x03\xca\xf8\x8c\x03\xca\xf9\x8f\x03\xca\xfe\x8e\x03" + "\xca\xff\x81\x03\xca\xfc\x80\x03\xca\xfd\x83\x03\xca\xe2\x82\x03\xca\xe3" + "\x85\x03\xca\xe0\x84\x03\xca\xe1\x87\x03\xca\xe6\x86\x03\xca\xe7\x99\x03" + "\xca\xe4\x98\x03\xca\xe5\x9b\x03\xca\xea\x9a\x03\xca\xeb\x9d\x03\xca\xe8" + "\x9c\x03ؓ\x89\x03ߔ\x8b\x02\x010\x03\x03\x04\x1e\x03\x04\x15\x12\x03\x0b" + "\x05,\x03\x06\x04\x00\x03\x06\x04)\x03\x06\x044\x03\x06\x04<\x03\x06\x05" + "\x1d\x03\x06\x06\x00\x03\x06\x06\x0a\x03\x06\x06'\x03\x06\x062\x03\x0786" + "\x03\x079/\x03\x079 \x03\x07:\x0e\x03\x07:\x1b\x03\x07:%\x03\x07;/\x03" + "\x07;%\x03\x074\x11\x03\x076\x09\x03\x077*\x03\x070\x01\x03\x070\x0f\x03" + "\x070.\x03\x071\x16\x03\x071\x04\x03\x0710\x03\x072\x18\x03\x072-\x03" + "\x073\x14\x03\x073>\x03\x07'\x09\x03\x07 \x00\x03\x07\x1f\x0b\x03\x07" + "\x18#\x03\x07\x18(\x03\x07\x186\x03\x07\x18\x03\x03\x07\x19\x16\x03\x07" + "\x116\x03\x07\x12'\x03\x07\x13\x10\x03\x07\x0c&\x03\x07\x0c\x08\x03\x07" + "\x0c\x13\x03\x07\x0d\x02\x03\x07\x0d\x1c\x03\x07\x0b5\x03\x07\x0b\x0a" + "\x03\x07\x0b\x01\x03\x07\x0b\x0f\x03\x07\x05\x00\x03\x07\x05\x09\x03\x07" + "\x05\x0b\x03\x07\x07\x01\x03\x07\x07\x08\x03\x07\x00<\x03\x07\x00+\x03" + "\x07\x01)\x03\x07\x01\x1b\x03\x07\x01\x08\x03\x07\x03?\x03\x0445\x03\x04" + "4\x08\x03\x0454\x03\x04)/\x03\x04)5\x03\x04+\x05\x03\x04+\x14\x03\x04+ " + "\x03\x04+<\x03\x04*&\x03\x04*\x22\x03\x04&8\x03\x04!\x01\x03\x04!\x22" + "\x03\x04\x11+\x03\x04\x10.\x03\x04\x104\x03\x04\x13=\x03\x04\x12\x04\x03" + "\x04\x12\x0a\x03\x04\x0d\x1d\x03\x04\x0d\x07\x03\x04\x0d \x03\x05<>\x03" + "\x055<\x03\x055!\x03\x055#\x03\x055&\x03\x054\x1d\x03\x054\x02\x03\x054" + "\x07\x03\x0571\x03\x053\x1a\x03\x053\x16\x03\x05.<\x03\x05.\x07\x03\x05)" + ":\x03\x05)<\x03\x05)\x0c\x03\x05)\x15\x03\x05+-\x03\x05+5\x03\x05$\x1e" + "\x03\x05$\x14\x03\x05'\x04\x03\x05'\x14\x03\x05&\x02\x03\x05\x226\x03" + "\x05\x22\x0c\x03\x05\x22\x1c\x03\x05\x19\x0a\x03\x05\x1b\x09\x03\x05\x1b" + "\x0c\x03\x05\x14\x07\x03\x05\x16?\x03\x05\x16\x0c\x03\x05\x0c\x05\x03" + "\x05\x0e\x0f\x03\x05\x01\x0e\x03\x05\x00(\x03\x05\x030\x03\x05\x03\x06" + "\x03\x0a==\x03\x0a=1\x03\x0a=,\x03\x0a=\x0c\x03\x0a??\x03\x0a<\x08\x03" + "\x0a9!\x03\x0a9)\x03\x0a97\x03\x0a99\x03\x0a6\x0a\x03\x0a6\x1c\x03\x0a6" + "\x17\x03\x0a7'\x03\x0a78\x03\x0a73\x03\x0a'\x01\x03\x0a'&\x03\x0a\x1f" + "\x0e\x03\x0a\x1f\x03\x03\x0a\x1f3\x03\x0a\x1b/\x03\x0a\x18\x19\x03\x0a" + "\x19\x01\x03\x0a\x16\x14\x03\x0a\x0e\x22\x03\x0a\x0f\x10\x03\x0a\x0f\x02" + "\x03\x0a\x0f \x03\x0a\x0c\x04\x03\x0a\x0b>\x03\x0a\x0b+\x03\x0a\x08/\x03" + "\x0a\x046\x03\x0a\x05\x14\x03\x0a\x00\x04\x03\x0a\x00\x10\x03\x0a\x00" + "\x14\x03\x0b<3\x03\x0b;*\x03\x0b9\x22\x03\x0b9)\x03\x0b97\x03\x0b+\x10" + "\x03\x0b((\x03\x0b&5\x03\x0b$\x1c\x03\x0b$\x12\x03\x0b%\x04\x03\x0b#<" + "\x03\x0b#0\x03\x0b#\x0d\x03\x0b#\x19\x03\x0b!:\x03\x0b!\x1f\x03\x0b!\x00" + "\x03\x0b\x1e5\x03\x0b\x1c\x1d\x03\x0b\x1d-\x03\x0b\x1d(\x03\x0b\x18.\x03" + "\x0b\x18 \x03\x0b\x18\x16\x03\x0b\x14\x13\x03\x0b\x15$\x03\x0b\x15\x22" + "\x03\x0b\x12\x1b\x03\x0b\x12\x10\x03\x0b\x132\x03\x0b\x13=\x03\x0b\x12" + "\x18\x03\x0b\x0c&\x03\x0b\x061\x03\x0b\x06:\x03\x0b\x05#\x03\x0b\x05<" + "\x03\x0b\x04\x0b\x03\x0b\x04\x04\x03\x0b\x04\x1b\x03\x0b\x042\x03\x0b" + "\x041\x03\x0b\x03\x03\x03\x0b\x03\x1d\x03\x0b\x03/\x03\x0b\x03+\x03\x0b" + "\x02\x1b\x03\x0b\x02\x00\x03\x0b\x01\x1e\x03\x0b\x01\x08\x03\x0b\x015" + "\x03\x06\x0d9\x03\x06\x0d=\x03\x06\x0d?\x03\x02\x001\x03\x02\x003\x03" + "\x02\x02\x19\x03\x02\x006\x03\x02\x02\x1b\x03\x02\x004\x03\x02\x00<\x03" + "\x02\x02\x0a\x03\x02\x02\x0e\x03\x02\x01\x1a\x03\x02\x01\x07\x03\x02\x01" + "\x05\x03\x02\x01\x0b\x03\x02\x01%\x03\x02\x01\x0c\x03\x02\x01\x04\x03" + "\x02\x01\x1c\x03\x02\x00.\x03\x02\x002\x03\x02\x00>\x03\x02\x00\x12\x03" + "\x02\x00\x16\x03\x02\x011\x03\x02\x013\x03\x02\x02 \x03\x02\x02%\x03\x02" + "\x02$\x03\x02\x028\x03\x02\x02;\x03\x02\x024\x03\x02\x012\x03\x02\x022" + "\x03\x02\x02/\x03\x02\x01,\x03\x02\x01\x13\x03\x02\x01\x16\x03\x02\x01" + "\x11\x03\x02\x01\x1e\x03\x02\x01\x15\x03\x02\x01\x17\x03\x02\x01\x0f\x03" + "\x02\x01\x08\x03\x02\x00?\x03\x02\x03\x07\x03\x02\x03\x0d\x03\x02\x03" + "\x13\x03\x02\x03\x1d\x03\x02\x03\x1f\x03\x02\x00\x03\x03\x02\x00\x0d\x03" + "\x02\x00\x01\x03\x02\x00\x1b\x03\x02\x00\x19\x03\x02\x00\x18\x03\x02\x00" + "\x13\x03\x02\x00/\x03\x07>\x12\x03\x07<\x1f\x03\x07>\x1d\x03\x06\x1d\x0e" + "\x03\x07>\x1c\x03\x07>:\x03\x07>\x13\x03\x04\x12+\x03\x07?\x03\x03\x07>" + "\x02\x03\x06\x224\x03\x06\x1a.\x03\x07<%\x03\x06\x1c\x0b\x03\x0609\x03" + "\x05\x1f\x01\x03\x04'\x08\x03\x93\xfd\xf5\x03\x02\x0d \x03\x02\x0d#\x03" + "\x02\x0d!\x03\x02\x0d&\x03\x02\x0d\x22\x03\x02\x0d/\x03\x02\x0d,\x03\x02" + "\x0d$\x03\x02\x0d'\x03\x02\x0d%\x03\x02\x0d;\x03\x02\x0d=\x03\x02\x0d?" + "\x03\x099.\x03\x08\x0b7\x03\x08\x02\x14\x03\x08\x14\x0d\x03\x08.:\x03" + "\x089'\x03\x0f\x0b\x18\x03\x0f\x1c1\x03\x0f\x17&\x03\x0f9\x1f\x03\x0f0" + "\x0c\x03\x0e\x0a9\x03\x0e\x056\x03\x0e\x1c#\x03\x0f\x13\x0e\x03\x072\x00" + "\x03\x070\x0d\x03\x072\x0b\x03\x06\x11\x18\x03\x070\x10\x03\x06\x0f(\x03" + "\x072\x05\x03\x06\x0f,\x03\x073\x15\x03\x06\x07\x08\x03\x05\x16\x02\x03" + "\x04\x0b \x03\x05:8\x03\x05\x16%\x03\x0a\x0d\x1f\x03\x06\x16\x10\x03\x05" + "\x1d5\x03\x05*;\x03\x05\x16\x1b\x03\x04.-\x03\x06\x1a\x19\x03\x04\x03," + "\x03\x0b87\x03\x04/\x0a\x03\x06\x00,\x03\x04-\x01\x03\x04\x1e-\x03\x06/(" + "\x03\x0a\x0b5\x03\x06\x0e7\x03\x06\x07.\x03\x0597\x03\x0a*%\x03\x0760" + "\x03\x06\x0c;\x03\x05'\x00\x03\x072.\x03\x072\x08\x03\x06=\x01\x03\x06" + "\x05\x1b\x03\x06\x06\x12\x03\x06$=\x03\x06'\x0d\x03\x04\x11\x0f\x03\x076" + ",\x03\x06\x07;\x03\x06.,\x03\x86\xf9\xea\x03\x8f\xff\xeb\x02\x092\x02" + "\x095\x02\x094\x02\x09;\x02\x09>\x02\x098\x02\x09*\x02\x09/\x02\x09,\x02" + "\x09%\x02\x09&\x02\x09#\x02\x09 \x02\x08!\x02\x08%\x02\x08$\x02\x08+\x02" + "\x08.\x02\x08*\x02\x08&\x02\x088\x02\x08>\x02\x084\x02\x086\x02\x080\x02" + "\x08\x10\x02\x08\x17\x02\x08\x12\x02\x08\x1d\x02\x08\x1f\x02\x08\x13\x02" + "\x08\x15\x02\x08\x14\x02\x08\x0c\x03\x8b\xfd\xd0\x03\x81\xec\xc6\x03\x87" + "\xe0\x8a\x03-2\xe3\x03\x80\xef\xe4\x03-2\xea\x03\x88\xe6\xeb\x03\x8e\xe6" + "\xe8\x03\x84\xe6\xe9\x03\x97\xe6\xee\x03-2\xf9\x03-2\xf6\x03\x8e\xe3\xad" + "\x03\x80\xe3\x92\x03\x88\xe3\x90\x03\x8e\xe3\x90\x03\x80\xe3\x97\x03\x88" + "\xe3\x95\x03\x88\xfe\xcb\x03\x8e\xfe\xca\x03\x84\xfe\xcd\x03\x91\xef\xc9" + "\x03-2\xc1\x03-2\xc0\x03-2\xcb\x03\x88@\x09\x03\x8e@\x08\x03\x8f\xe0\xf5" + "\x03\x8e\xe6\xf9\x03\x8e\xe0\xfa\x03\x93\xff\xf4\x03\x84\xee\xd3\x03\x0b" + "(\x04\x023 \x021;\x02\x01*\x03\x0b#\x10\x03\x0b 0\x03\x0b!\x10\x03\x0b!0" + "\x03\x07\x15\x08\x03\x09?5\x03\x07\x1f\x08\x03\x07\x17\x0b\x03\x09\x1f" + "\x15\x03\x0b\x1c7\x03\x0a+#\x03\x06\x1a\x1b\x03\x06\x1a\x14\x03\x0a\x01" + "\x18\x03\x06#\x1b\x03\x0a2\x0c\x03\x0a\x01\x04\x03\x09#;\x03\x08='\x03" + "\x08\x1a\x0a\x03\x07\x03\x0a\x111\x03\x09\x1b\x09\x03\x073.\x03\x07\x01\x00" + "\x03\x09/,\x03\x07#>\x03\x07\x048\x03\x0a\x1f\x22\x03\x098>\x03\x09\x11" + "\x00\x03\x08/\x17\x03\x06'\x22\x03\x0b\x1a+\x03\x0a\x22\x19\x03\x0a/1" + "\x03\x0974\x03\x09\x0f\x22\x03\x08,\x22\x03\x08?\x14\x03\x07$5\x03\x07<3" + "\x03\x07=*\x03\x07\x13\x18\x03\x068\x0a\x03\x06\x09\x16\x03\x06\x13\x00" + "\x03\x08\x067\x03\x08\x01\x03\x03\x08\x12\x1d\x03\x07+7\x03\x06(;\x03" + "\x06\x1c?\x03\x07\x0e\x17\x03\x0a\x06\x1d\x03\x0a\x19\x07\x03\x08\x14$" + "\x03\x07$;\x03\x08,$\x03\x08\x06\x0d\x03\x07\x16\x0a\x03\x06>>\x03\x0a" + "\x06\x12\x03\x0a\x14)\x03\x09\x0d\x1f\x03\x09\x12\x17\x03\x09\x19\x01" + "\x03\x08\x11 \x03\x08\x1d'\x03\x06<\x1a\x03\x0a.\x00\x03\x07'\x18\x03" + "\x0a\x22\x08\x03\x08\x0d\x0a\x03\x08\x13)\x03\x07*)\x03\x06<,\x03\x07" + "\x0b\x1a\x03\x09.\x14\x03\x09\x0d\x1e\x03\x07\x0e#\x03\x0b\x1d'\x03\x0a" + "\x0a8\x03\x09%2\x03\x08+&\x03\x080\x12\x03\x0a)4\x03\x08\x06\x1f\x03\x0b" + "\x1b\x1a\x03\x0a\x1b\x0f\x03\x0b\x1d*\x03\x09\x16$\x03\x090\x11\x03\x08" + "\x11\x08\x03\x0a*(\x03\x0a\x042\x03\x089,\x03\x074'\x03\x07\x0f\x05\x03" + "\x09\x0b\x0a\x03\x07\x1b\x01\x03\x09\x17:\x03\x09.\x0d\x03\x07.\x11\x03" + "\x09+\x15\x03\x080\x13\x03\x0b\x1f\x19\x03\x0a \x11\x03\x0a\x220\x03\x09" + "\x07;\x03\x08\x16\x1c\x03\x07,\x13\x03\x07\x0e/\x03\x06\x221\x03\x0a." + "\x0a\x03\x0a7\x02\x03\x0a\x032\x03\x0a\x1d.\x03\x091\x06\x03\x09\x19:" + "\x03\x08\x02/\x03\x060+\x03\x06\x0f-\x03\x06\x1c\x1f\x03\x06\x1d\x07\x03" + "\x0a,\x11\x03\x09=\x0d\x03\x09\x0b;\x03\x07\x1b/\x03\x0a\x1f:\x03\x09 " + "\x1f\x03\x09.\x10\x03\x094\x0b\x03\x09\x1a1\x03\x08#\x1a\x03\x084\x1d" + "\x03\x08\x01\x1f\x03\x08\x11\x22\x03\x07'8\x03\x07\x1a>\x03\x0757\x03" + "\x06&9\x03\x06+\x11\x03\x0a.\x0b\x03\x0a,>\x03\x0a4#\x03\x08%\x17\x03" + "\x07\x05\x22\x03\x07\x0c\x0b\x03\x0a\x1d+\x03\x0a\x19\x16\x03\x09+\x1f" + "\x03\x09\x08\x0b\x03\x08\x16\x18\x03\x08+\x12\x03\x0b\x1d\x0c\x03\x0a=" + "\x10\x03\x0a\x09\x0d\x03\x0a\x10\x11\x03\x09&0\x03\x08(\x1f\x03\x087\x07" + "\x03\x08\x185\x03\x07'6\x03\x06.\x05\x03\x06=\x04\x03\x06;;\x03\x06\x06," + "\x03\x0b\x18>\x03\x08\x00\x18\x03\x06 \x03\x03\x06<\x00\x03\x09%\x18\x03" + "\x0b\x1c<\x03\x0a%!\x03\x0a\x09\x12\x03\x0a\x16\x02\x03\x090'\x03\x09" + "\x0e=\x03\x08 \x0e\x03\x08>\x03\x03\x074>\x03\x06&?\x03\x06\x19\x09\x03" + "\x06?(\x03\x0a-\x0e\x03\x09:3\x03\x098:\x03\x09\x12\x0b\x03\x09\x1d\x17" + "\x03\x087\x05\x03\x082\x14\x03\x08\x06%\x03\x08\x13\x1f\x03\x06\x06\x0e" + "\x03\x0a\x22<\x03\x09/<\x03\x06>+\x03\x0a'?\x03\x0a\x13\x0c\x03\x09\x10<" + "\x03\x07\x1b=\x03\x0a\x19\x13\x03\x09\x22\x1d\x03\x09\x07\x0d\x03\x08)" + "\x1c\x03\x06=\x1a\x03\x0a/4\x03\x0a7\x11\x03\x0a\x16:\x03\x09?3\x03\x09:" + "/\x03\x09\x05\x0a\x03\x09\x14\x06\x03\x087\x22\x03\x080\x07\x03\x08\x1a" + "\x1f\x03\x07\x04(\x03\x07\x04\x09\x03\x06 %\x03\x06<\x08\x03\x0a+\x14" + "\x03\x09\x1d\x16\x03\x0a70\x03\x08 >\x03\x0857\x03\x070\x0a\x03\x06=\x12" + "\x03\x06\x16%\x03\x06\x1d,\x03\x099#\x03\x09\x10>\x03\x07 \x1e\x03\x08" + "\x0c<\x03\x08\x0b\x18\x03\x08\x15+\x03\x08,:\x03\x08%\x22\x03\x07\x0a$" + "\x03\x0b\x1c=\x03\x07+\x08\x03\x0a/\x05\x03\x0a \x07\x03\x0a\x12'\x03" + "\x09#\x11\x03\x08\x1b\x15\x03\x0a\x06\x01\x03\x09\x1c\x1b\x03\x0922\x03" + "\x07\x14<\x03\x07\x09\x04\x03\x061\x04\x03\x07\x0e\x01\x03\x0a\x13\x18" + "\x03\x0a-\x0c\x03\x0a?\x0d\x03\x0a\x09\x0a\x03\x091&\x03\x0a/\x0b\x03" + "\x08$<\x03\x083\x1d\x03\x08\x0c$\x03\x08\x0d\x07\x03\x08\x0d?\x03\x08" + "\x0e\x14\x03\x065\x0a\x03\x08\x1a#\x03\x08\x16#\x03\x0702\x03\x07\x03" + "\x1a\x03\x06(\x1d\x03\x06+\x1b\x03\x06\x0b\x05\x03\x06\x0b\x17\x03\x06" + "\x0c\x04\x03\x06\x1e\x19\x03\x06+0\x03\x062\x18\x03\x0b\x16\x1e\x03\x0a+" + "\x16\x03\x0a-?\x03\x0a#:\x03\x0a#\x10\x03\x0a%$\x03\x0a>+\x03\x0a01\x03" + "\x0a1\x10\x03\x0a\x099\x03\x0a\x0a\x12\x03\x0a\x19\x1f\x03\x0a\x19\x12" + "\x03\x09*)\x03\x09-\x16\x03\x09.1\x03\x09.2\x03\x09<\x0e\x03\x09> \x03" + "\x093\x12\x03\x09\x0b\x01\x03\x09\x1c2\x03\x09\x11\x1c\x03\x09\x15%\x03" + "\x08,&\x03\x08!\x22\x03\x089(\x03\x08\x0b\x1a\x03\x08\x0d2\x03\x08\x0c" + "\x04\x03\x08\x0c\x06\x03\x08\x0c\x1f\x03\x08\x0c\x0c\x03\x08\x0f\x1f\x03" + "\x08\x0f\x1d\x03\x08\x00\x14\x03\x08\x03\x14\x03\x08\x06\x16\x03\x08\x1e" + "#\x03\x08\x11\x11\x03\x08\x10\x18\x03\x08\x14(\x03\x07)\x1e\x03\x07.1" + "\x03\x07 $\x03\x07 '\x03\x078\x08\x03\x07\x0d0\x03\x07\x0f7\x03\x07\x05#" + "\x03\x07\x05\x1a\x03\x07\x1a7\x03\x07\x1d-\x03\x07\x17\x10\x03\x06)\x1f" + "\x03\x062\x0b\x03\x066\x16\x03\x06\x09\x11\x03\x09(\x1e\x03\x07!5\x03" + "\x0b\x11\x16\x03\x0a/\x04\x03\x0a,\x1a\x03\x0b\x173\x03\x0a,1\x03\x0a/5" + "\x03\x0a\x221\x03\x0a\x22\x0d\x03\x0a?%\x03\x0a<,\x03\x0a?#\x03\x0a>\x19" + "\x03\x0a\x08&\x03\x0a\x0b\x0e\x03\x0a\x0c:\x03\x0a\x0c+\x03\x0a\x03\x22" + "\x03\x0a\x06)\x03\x0a\x11\x10\x03\x0a\x11\x1a\x03\x0a\x17-\x03\x0a\x14(" + "\x03\x09)\x1e\x03\x09/\x09\x03\x09.\x00\x03\x09,\x07\x03\x09/*\x03\x09-9" + "\x03\x09\x228\x03\x09%\x09\x03\x09:\x12\x03\x09;\x1d\x03\x09?\x06\x03" + "\x093%\x03\x096\x05\x03\x096\x08\x03\x097\x02\x03\x09\x07,\x03\x09\x04," + "\x03\x09\x1f\x16\x03\x09\x11\x03\x03\x09\x11\x12\x03\x09\x168\x03\x08*" + "\x05\x03\x08/2\x03\x084:\x03\x08\x22+\x03\x08 0\x03\x08&\x0a\x03\x08;" + "\x10\x03\x08>$\x03\x08>\x18\x03\x0829\x03\x082:\x03\x081,\x03\x081<\x03" + "\x081\x1c\x03\x087#\x03\x087*\x03\x08\x09'\x03\x08\x00\x1d\x03\x08\x05-" + "\x03\x08\x1f4\x03\x08\x1d\x04\x03\x08\x16\x0f\x03\x07*7\x03\x07'!\x03" + "\x07%\x1b\x03\x077\x0c\x03\x07\x0c1\x03\x07\x0c.\x03\x07\x00\x06\x03\x07" + "\x01\x02\x03\x07\x010\x03\x07\x06=\x03\x07\x01\x03\x03\x07\x01\x13\x03" + "\x07\x06\x06\x03\x07\x05\x0a\x03\x07\x1f\x09\x03\x07\x17:\x03\x06*1\x03" + "\x06-\x1d\x03\x06\x223\x03\x062:\x03\x060$\x03\x066\x1e\x03\x064\x12\x03" + "\x0645\x03\x06\x0b\x00\x03\x06\x0b7\x03\x06\x07\x1f\x03\x06\x15\x12\x03" + "\x0c\x05\x0f\x03\x0b+\x0b\x03\x0b+-\x03\x06\x16\x1b\x03\x06\x15\x17\x03" + "\x89\xca\xea\x03\x89\xca\xe8\x03\x0c8\x10\x03\x0c8\x01\x03\x0c8\x0f\x03" + "\x0d8%\x03\x0d8!\x03\x0c8-\x03\x0c8/\x03\x0c8+\x03\x0c87\x03\x0c85\x03" + "\x0c9\x09\x03\x0c9\x0d\x03\x0c9\x0f\x03\x0c9\x0b\x03\xcfu\x0c\x03\xcfu" + "\x0f\x03\xcfu\x0e\x03\xcfu\x09\x03\x0c9\x10\x03\x0d9\x0c\x03\xcf`;\x03" + "\xcf`>\x03\xcf`9\x03\xcf`8\x03\xcf`7\x03\xcf`*\x03\xcf`-\x03\xcf`,\x03" + "\x0d\x1b\x1a\x03\x0d\x1b&\x03\x0c=.\x03\x0c=%\x03\x0c>\x1e\x03\x0c>\x14" + "\x03\x0c?\x06\x03\x0c?\x0b\x03\x0c?\x0c\x03\x0c?\x0d\x03\x0c?\x02\x03" + "\x0c>\x0f\x03\x0c>\x08\x03\x0c>\x09\x03\x0c>,\x03\x0c>\x0c\x03\x0c?\x13" + "\x03\x0c?\x16\x03\x0c?\x15\x03\x0c?\x1c\x03\x0c?\x1f\x03\x0c?\x1d\x03" + "\x0c?\x1a\x03\x0c?\x17\x03\x0c?\x08\x03\x0c?\x09\x03\x0c?\x0e\x03\x0c?" + "\x04\x03\x0c?\x05\x03\x0c" + "\x03\x0c=2\x03\x0c=6\x03\x0c<\x07\x03\x0c<\x05\x03\x0e:!\x03\x0e:#\x03" + "\x0e8\x09\x03\x0e:&\x03\x0e8\x0b\x03\x0e:$\x03\x0e:,\x03\x0e8\x1a\x03" + "\x0e8\x1e\x03\x0e:*\x03\x0e:7\x03\x0e:5\x03\x0e:;\x03\x0e:\x15\x03\x0e:<" + "\x03\x0e:4\x03\x0e:'\x03\x0e:-\x03\x0e:%\x03\x0e:?\x03\x0e:=\x03\x0e:)" + "\x03\x0e:/\x03\xcfs'\x03\x0d=\x0f\x03\x0d+*\x03\x0d99\x03\x0d9;\x03\x0d9" + "?\x03\x0d)\x0d\x03\x0d(%\x02\x01\x18\x02\x01(\x02\x01\x1e\x03\x0f$!\x03" + "\x0f87\x03\x0f4\x0e\x03\x0f5\x1d\x03\x06'\x03\x03\x0f\x08\x18\x03\x0f" + "\x0d\x1b\x03\x0e2=\x03\x0e;\x08\x03\x0e:\x0b\x03\x0e\x06$\x03\x0e\x0d)" + "\x03\x0e\x16\x1f\x03\x0e\x16\x1b\x03\x0d$\x0a\x03\x05,\x1d\x03\x0d. \x03" + "\x0d.#\x03\x0c(/\x03\x09%\x02\x03\x0d90\x03\x0d\x0e4\x03\x0d\x0d\x0f\x03" + "\x0c#\x00\x03\x0c,\x1e\x03\x0c2\x0e\x03\x0c\x01\x17\x03\x0c\x09:\x03\x0e" + "\x173\x03\x0c\x08\x03\x03\x0c\x11\x07\x03\x0c\x10\x18\x03\x0c\x1f\x1c" + "\x03\x0c\x19\x0e\x03\x0c\x1a\x1f\x03\x0f0>\x03\x0b->\x03\x0b<+\x03\x0b8" + "\x13\x03\x0b\x043\x03\x0b\x14\x03\x03\x0b\x16%\x03\x0d\x22&\x03\x0b\x1a" + "\x1a\x03\x0b\x1a\x04\x03\x0a%9\x03\x0a&2\x03\x0a&0\x03\x0a!\x1a\x03\x0a!" + "7\x03\x0a5\x10\x03\x0a=4\x03\x0a?\x0e\x03\x0a>\x10\x03\x0a\x00 \x03\x0a" + "\x0f:\x03\x0a\x0f9\x03\x0a\x0b\x0a\x03\x0a\x17%\x03\x0a\x1b-\x03\x09-" + "\x1a\x03\x09,4\x03\x09.,\x03\x09)\x09\x03\x096!\x03\x091\x1f\x03\x093" + "\x16\x03\x0c+\x1f\x03\x098 \x03\x098=\x03\x0c(\x1a\x03\x0c(\x16\x03\x09" + "\x0a+\x03\x09\x16\x12\x03\x09\x13\x0e\x03\x09\x153\x03\x08)!\x03\x09\x1a" + "\x01\x03\x09\x18\x01\x03\x08%#\x03\x08>\x22\x03\x08\x05%\x03\x08\x02*" + "\x03\x08\x15;\x03\x08\x1b7\x03\x0f\x07\x1d\x03\x0f\x04\x03\x03\x070\x0c" + "\x03\x07;\x0b\x03\x07\x08\x17\x03\x07\x12\x06\x03\x06/-\x03\x0671\x03" + "\x065+\x03\x06>7\x03\x06\x049\x03\x05+\x1e\x03\x05,\x17\x03\x05 \x1d\x03" + "\x05\x22\x05\x03\x050\x1d" // lookup returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookup(s []byte) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupUnsafe(s []byte) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // lookupString returns the trie value for the first UTF-8 encoding in s and // the width in bytes of this encoding. The size will be 0 if s does not // hold enough bytes to complete the encoding. len(s) must be greater than 0. func (t *idnaTrie) lookupString(s string) (v uint16, sz int) { c0 := s[0] switch { case c0 < 0x80: // is ASCII return idnaValues[c0], 1 case c0 < 0xC2: return 0, 1 // Illegal UTF-8: not a starter, not ASCII. case c0 < 0xE0: // 2-byte UTF-8 if len(s) < 2 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c1), 2 case c0 < 0xF0: // 3-byte UTF-8 if len(s) < 3 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c2), 3 case c0 < 0xF8: // 4-byte UTF-8 if len(s) < 4 { return 0, 0 } i := idnaIndex[c0] c1 := s[1] if c1 < 0x80 || 0xC0 <= c1 { return 0, 1 // Illegal UTF-8: not a continuation byte. } o := uint32(i)<<6 + uint32(c1) i = idnaIndex[o] c2 := s[2] if c2 < 0x80 || 0xC0 <= c2 { return 0, 2 // Illegal UTF-8: not a continuation byte. } o = uint32(i)<<6 + uint32(c2) i = idnaIndex[o] c3 := s[3] if c3 < 0x80 || 0xC0 <= c3 { return 0, 3 // Illegal UTF-8: not a continuation byte. } return t.lookupValue(uint32(i), c3), 4 } // Illegal rune return 0, 1 } // lookupStringUnsafe returns the trie value for the first UTF-8 encoding in s. // s must start with a full and valid UTF-8 encoded rune. func (t *idnaTrie) lookupStringUnsafe(s string) uint16 { c0 := s[0] if c0 < 0x80 { // is ASCII return idnaValues[c0] } i := idnaIndex[c0] if c0 < 0xE0 { // 2-byte UTF-8 return t.lookupValue(uint32(i), s[1]) } i = idnaIndex[uint32(i)<<6+uint32(s[1])] if c0 < 0xF0 { // 3-byte UTF-8 return t.lookupValue(uint32(i), s[2]) } i = idnaIndex[uint32(i)<<6+uint32(s[2])] if c0 < 0xF8 { // 4-byte UTF-8 return t.lookupValue(uint32(i), s[3]) } return 0 } // idnaTrie. Total size: 28600 bytes (27.93 KiB). Checksum: 95575047b5d8fff. type idnaTrie struct{} func newIdnaTrie(i int) *idnaTrie { return &idnaTrie{} } // lookupValue determines the type of block n and looks up the value for b. func (t *idnaTrie) lookupValue(n uint32, b byte) uint16 { switch { case n < 124: return uint16(idnaValues[n<<6+uint32(b)]) default: n -= 124 return uint16(idnaSparse.lookup(n, b)) } } // idnaValues: 126 blocks, 8064 entries, 16128 bytes // The third block is the zero block. var idnaValues = [8064]uint16{ // Block 0x0, offset 0x0 0x00: 0x0080, 0x01: 0x0080, 0x02: 0x0080, 0x03: 0x0080, 0x04: 0x0080, 0x05: 0x0080, 0x06: 0x0080, 0x07: 0x0080, 0x08: 0x0080, 0x09: 0x0080, 0x0a: 0x0080, 0x0b: 0x0080, 0x0c: 0x0080, 0x0d: 0x0080, 0x0e: 0x0080, 0x0f: 0x0080, 0x10: 0x0080, 0x11: 0x0080, 0x12: 0x0080, 0x13: 0x0080, 0x14: 0x0080, 0x15: 0x0080, 0x16: 0x0080, 0x17: 0x0080, 0x18: 0x0080, 0x19: 0x0080, 0x1a: 0x0080, 0x1b: 0x0080, 0x1c: 0x0080, 0x1d: 0x0080, 0x1e: 0x0080, 0x1f: 0x0080, 0x20: 0x0080, 0x21: 0x0080, 0x22: 0x0080, 0x23: 0x0080, 0x24: 0x0080, 0x25: 0x0080, 0x26: 0x0080, 0x27: 0x0080, 0x28: 0x0080, 0x29: 0x0080, 0x2a: 0x0080, 0x2b: 0x0080, 0x2c: 0x0080, 0x2d: 0x0008, 0x2e: 0x0008, 0x2f: 0x0080, 0x30: 0x0008, 0x31: 0x0008, 0x32: 0x0008, 0x33: 0x0008, 0x34: 0x0008, 0x35: 0x0008, 0x36: 0x0008, 0x37: 0x0008, 0x38: 0x0008, 0x39: 0x0008, 0x3a: 0x0080, 0x3b: 0x0080, 0x3c: 0x0080, 0x3d: 0x0080, 0x3e: 0x0080, 0x3f: 0x0080, // Block 0x1, offset 0x40 0x40: 0x0080, 0x41: 0xe105, 0x42: 0xe105, 0x43: 0xe105, 0x44: 0xe105, 0x45: 0xe105, 0x46: 0xe105, 0x47: 0xe105, 0x48: 0xe105, 0x49: 0xe105, 0x4a: 0xe105, 0x4b: 0xe105, 0x4c: 0xe105, 0x4d: 0xe105, 0x4e: 0xe105, 0x4f: 0xe105, 0x50: 0xe105, 0x51: 0xe105, 0x52: 0xe105, 0x53: 0xe105, 0x54: 0xe105, 0x55: 0xe105, 0x56: 0xe105, 0x57: 0xe105, 0x58: 0xe105, 0x59: 0xe105, 0x5a: 0xe105, 0x5b: 0x0080, 0x5c: 0x0080, 0x5d: 0x0080, 0x5e: 0x0080, 0x5f: 0x0080, 0x60: 0x0080, 0x61: 0x0008, 0x62: 0x0008, 0x63: 0x0008, 0x64: 0x0008, 0x65: 0x0008, 0x66: 0x0008, 0x67: 0x0008, 0x68: 0x0008, 0x69: 0x0008, 0x6a: 0x0008, 0x6b: 0x0008, 0x6c: 0x0008, 0x6d: 0x0008, 0x6e: 0x0008, 0x6f: 0x0008, 0x70: 0x0008, 0x71: 0x0008, 0x72: 0x0008, 0x73: 0x0008, 0x74: 0x0008, 0x75: 0x0008, 0x76: 0x0008, 0x77: 0x0008, 0x78: 0x0008, 0x79: 0x0008, 0x7a: 0x0008, 0x7b: 0x0080, 0x7c: 0x0080, 0x7d: 0x0080, 0x7e: 0x0080, 0x7f: 0x0080, // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc0: 0x0040, 0xc1: 0x0040, 0xc2: 0x0040, 0xc3: 0x0040, 0xc4: 0x0040, 0xc5: 0x0040, 0xc6: 0x0040, 0xc7: 0x0040, 0xc8: 0x0040, 0xc9: 0x0040, 0xca: 0x0040, 0xcb: 0x0040, 0xcc: 0x0040, 0xcd: 0x0040, 0xce: 0x0040, 0xcf: 0x0040, 0xd0: 0x0040, 0xd1: 0x0040, 0xd2: 0x0040, 0xd3: 0x0040, 0xd4: 0x0040, 0xd5: 0x0040, 0xd6: 0x0040, 0xd7: 0x0040, 0xd8: 0x0040, 0xd9: 0x0040, 0xda: 0x0040, 0xdb: 0x0040, 0xdc: 0x0040, 0xdd: 0x0040, 0xde: 0x0040, 0xdf: 0x0040, 0xe0: 0x000a, 0xe1: 0x0018, 0xe2: 0x0018, 0xe3: 0x0018, 0xe4: 0x0018, 0xe5: 0x0018, 0xe6: 0x0018, 0xe7: 0x0018, 0xe8: 0x001a, 0xe9: 0x0018, 0xea: 0x0039, 0xeb: 0x0018, 0xec: 0x0018, 0xed: 0x03c0, 0xee: 0x0018, 0xef: 0x004a, 0xf0: 0x0018, 0xf1: 0x0018, 0xf2: 0x0069, 0xf3: 0x0079, 0xf4: 0x008a, 0xf5: 0x0005, 0xf6: 0x0018, 0xf7: 0x0008, 0xf8: 0x00aa, 0xf9: 0x00c9, 0xfa: 0x00d9, 0xfb: 0x0018, 0xfc: 0x00e9, 0xfd: 0x0119, 0xfe: 0x0149, 0xff: 0x0018, // Block 0x4, offset 0x100 0x100: 0xe00d, 0x101: 0x0008, 0x102: 0xe00d, 0x103: 0x0008, 0x104: 0xe00d, 0x105: 0x0008, 0x106: 0xe00d, 0x107: 0x0008, 0x108: 0xe00d, 0x109: 0x0008, 0x10a: 0xe00d, 0x10b: 0x0008, 0x10c: 0xe00d, 0x10d: 0x0008, 0x10e: 0xe00d, 0x10f: 0x0008, 0x110: 0xe00d, 0x111: 0x0008, 0x112: 0xe00d, 0x113: 0x0008, 0x114: 0xe00d, 0x115: 0x0008, 0x116: 0xe00d, 0x117: 0x0008, 0x118: 0xe00d, 0x119: 0x0008, 0x11a: 0xe00d, 0x11b: 0x0008, 0x11c: 0xe00d, 0x11d: 0x0008, 0x11e: 0xe00d, 0x11f: 0x0008, 0x120: 0xe00d, 0x121: 0x0008, 0x122: 0xe00d, 0x123: 0x0008, 0x124: 0xe00d, 0x125: 0x0008, 0x126: 0xe00d, 0x127: 0x0008, 0x128: 0xe00d, 0x129: 0x0008, 0x12a: 0xe00d, 0x12b: 0x0008, 0x12c: 0xe00d, 0x12d: 0x0008, 0x12e: 0xe00d, 0x12f: 0x0008, 0x130: 0x0179, 0x131: 0x0008, 0x132: 0x0035, 0x133: 0x004d, 0x134: 0xe00d, 0x135: 0x0008, 0x136: 0xe00d, 0x137: 0x0008, 0x138: 0x0008, 0x139: 0xe01d, 0x13a: 0x0008, 0x13b: 0xe03d, 0x13c: 0x0008, 0x13d: 0xe01d, 0x13e: 0x0008, 0x13f: 0x0199, // Block 0x5, offset 0x140 0x140: 0x0199, 0x141: 0xe01d, 0x142: 0x0008, 0x143: 0xe03d, 0x144: 0x0008, 0x145: 0xe01d, 0x146: 0x0008, 0x147: 0xe07d, 0x148: 0x0008, 0x149: 0x01b9, 0x14a: 0xe00d, 0x14b: 0x0008, 0x14c: 0xe00d, 0x14d: 0x0008, 0x14e: 0xe00d, 0x14f: 0x0008, 0x150: 0xe00d, 0x151: 0x0008, 0x152: 0xe00d, 0x153: 0x0008, 0x154: 0xe00d, 0x155: 0x0008, 0x156: 0xe00d, 0x157: 0x0008, 0x158: 0xe00d, 0x159: 0x0008, 0x15a: 0xe00d, 0x15b: 0x0008, 0x15c: 0xe00d, 0x15d: 0x0008, 0x15e: 0xe00d, 0x15f: 0x0008, 0x160: 0xe00d, 0x161: 0x0008, 0x162: 0xe00d, 0x163: 0x0008, 0x164: 0xe00d, 0x165: 0x0008, 0x166: 0xe00d, 0x167: 0x0008, 0x168: 0xe00d, 0x169: 0x0008, 0x16a: 0xe00d, 0x16b: 0x0008, 0x16c: 0xe00d, 0x16d: 0x0008, 0x16e: 0xe00d, 0x16f: 0x0008, 0x170: 0xe00d, 0x171: 0x0008, 0x172: 0xe00d, 0x173: 0x0008, 0x174: 0xe00d, 0x175: 0x0008, 0x176: 0xe00d, 0x177: 0x0008, 0x178: 0x0065, 0x179: 0xe01d, 0x17a: 0x0008, 0x17b: 0xe03d, 0x17c: 0x0008, 0x17d: 0xe01d, 0x17e: 0x0008, 0x17f: 0x01d9, // Block 0x6, offset 0x180 0x180: 0x0008, 0x181: 0x007d, 0x182: 0xe00d, 0x183: 0x0008, 0x184: 0xe00d, 0x185: 0x0008, 0x186: 0x007d, 0x187: 0xe07d, 0x188: 0x0008, 0x189: 0x0095, 0x18a: 0x00ad, 0x18b: 0xe03d, 0x18c: 0x0008, 0x18d: 0x0008, 0x18e: 0x00c5, 0x18f: 0x00dd, 0x190: 0x00f5, 0x191: 0xe01d, 0x192: 0x0008, 0x193: 0x010d, 0x194: 0x0125, 0x195: 0x0008, 0x196: 0x013d, 0x197: 0x013d, 0x198: 0xe00d, 0x199: 0x0008, 0x19a: 0x0008, 0x19b: 0x0008, 0x19c: 0x010d, 0x19d: 0x0155, 0x19e: 0x0008, 0x19f: 0x016d, 0x1a0: 0xe00d, 0x1a1: 0x0008, 0x1a2: 0xe00d, 0x1a3: 0x0008, 0x1a4: 0xe00d, 0x1a5: 0x0008, 0x1a6: 0x0185, 0x1a7: 0xe07d, 0x1a8: 0x0008, 0x1a9: 0x019d, 0x1aa: 0x0008, 0x1ab: 0x0008, 0x1ac: 0xe00d, 0x1ad: 0x0008, 0x1ae: 0x0185, 0x1af: 0xe0fd, 0x1b0: 0x0008, 0x1b1: 0x01b5, 0x1b2: 0x01cd, 0x1b3: 0xe03d, 0x1b4: 0x0008, 0x1b5: 0xe01d, 0x1b6: 0x0008, 0x1b7: 0x01e5, 0x1b8: 0xe00d, 0x1b9: 0x0008, 0x1ba: 0x0008, 0x1bb: 0x0008, 0x1bc: 0xe00d, 0x1bd: 0x0008, 0x1be: 0x0008, 0x1bf: 0x0008, // Block 0x7, offset 0x1c0 0x1c0: 0x0008, 0x1c1: 0x0008, 0x1c2: 0x0008, 0x1c3: 0x0008, 0x1c4: 0x01e9, 0x1c5: 0x01e9, 0x1c6: 0x01e9, 0x1c7: 0x01fd, 0x1c8: 0x0215, 0x1c9: 0x022d, 0x1ca: 0x0245, 0x1cb: 0x025d, 0x1cc: 0x0275, 0x1cd: 0xe01d, 0x1ce: 0x0008, 0x1cf: 0xe0fd, 0x1d0: 0x0008, 0x1d1: 0xe01d, 0x1d2: 0x0008, 0x1d3: 0xe03d, 0x1d4: 0x0008, 0x1d5: 0xe01d, 0x1d6: 0x0008, 0x1d7: 0xe07d, 0x1d8: 0x0008, 0x1d9: 0xe01d, 0x1da: 0x0008, 0x1db: 0xe03d, 0x1dc: 0x0008, 0x1dd: 0x0008, 0x1de: 0xe00d, 0x1df: 0x0008, 0x1e0: 0xe00d, 0x1e1: 0x0008, 0x1e2: 0xe00d, 0x1e3: 0x0008, 0x1e4: 0xe00d, 0x1e5: 0x0008, 0x1e6: 0xe00d, 0x1e7: 0x0008, 0x1e8: 0xe00d, 0x1e9: 0x0008, 0x1ea: 0xe00d, 0x1eb: 0x0008, 0x1ec: 0xe00d, 0x1ed: 0x0008, 0x1ee: 0xe00d, 0x1ef: 0x0008, 0x1f0: 0x0008, 0x1f1: 0x028d, 0x1f2: 0x02a5, 0x1f3: 0x02bd, 0x1f4: 0xe00d, 0x1f5: 0x0008, 0x1f6: 0x02d5, 0x1f7: 0x02ed, 0x1f8: 0xe00d, 0x1f9: 0x0008, 0x1fa: 0xe00d, 0x1fb: 0x0008, 0x1fc: 0xe00d, 0x1fd: 0x0008, 0x1fe: 0xe00d, 0x1ff: 0x0008, // Block 0x8, offset 0x200 0x200: 0xe00d, 0x201: 0x0008, 0x202: 0xe00d, 0x203: 0x0008, 0x204: 0xe00d, 0x205: 0x0008, 0x206: 0xe00d, 0x207: 0x0008, 0x208: 0xe00d, 0x209: 0x0008, 0x20a: 0xe00d, 0x20b: 0x0008, 0x20c: 0xe00d, 0x20d: 0x0008, 0x20e: 0xe00d, 0x20f: 0x0008, 0x210: 0xe00d, 0x211: 0x0008, 0x212: 0xe00d, 0x213: 0x0008, 0x214: 0xe00d, 0x215: 0x0008, 0x216: 0xe00d, 0x217: 0x0008, 0x218: 0xe00d, 0x219: 0x0008, 0x21a: 0xe00d, 0x21b: 0x0008, 0x21c: 0xe00d, 0x21d: 0x0008, 0x21e: 0xe00d, 0x21f: 0x0008, 0x220: 0x0305, 0x221: 0x0008, 0x222: 0xe00d, 0x223: 0x0008, 0x224: 0xe00d, 0x225: 0x0008, 0x226: 0xe00d, 0x227: 0x0008, 0x228: 0xe00d, 0x229: 0x0008, 0x22a: 0xe00d, 0x22b: 0x0008, 0x22c: 0xe00d, 0x22d: 0x0008, 0x22e: 0xe00d, 0x22f: 0x0008, 0x230: 0xe00d, 0x231: 0x0008, 0x232: 0xe00d, 0x233: 0x0008, 0x234: 0x0008, 0x235: 0x0008, 0x236: 0x0008, 0x237: 0x0008, 0x238: 0x0008, 0x239: 0x0008, 0x23a: 0x0209, 0x23b: 0xe03d, 0x23c: 0x0008, 0x23d: 0x031d, 0x23e: 0x0229, 0x23f: 0x0008, // Block 0x9, offset 0x240 0x240: 0x0008, 0x241: 0x0008, 0x242: 0x0018, 0x243: 0x0018, 0x244: 0x0018, 0x245: 0x0018, 0x246: 0x0008, 0x247: 0x0008, 0x248: 0x0008, 0x249: 0x0008, 0x24a: 0x0008, 0x24b: 0x0008, 0x24c: 0x0008, 0x24d: 0x0008, 0x24e: 0x0008, 0x24f: 0x0008, 0x250: 0x0008, 0x251: 0x0008, 0x252: 0x0018, 0x253: 0x0018, 0x254: 0x0018, 0x255: 0x0018, 0x256: 0x0018, 0x257: 0x0018, 0x258: 0x029a, 0x259: 0x02ba, 0x25a: 0x02da, 0x25b: 0x02fa, 0x25c: 0x031a, 0x25d: 0x033a, 0x25e: 0x0018, 0x25f: 0x0018, 0x260: 0x03ad, 0x261: 0x0359, 0x262: 0x01d9, 0x263: 0x0369, 0x264: 0x03c5, 0x265: 0x0018, 0x266: 0x0018, 0x267: 0x0018, 0x268: 0x0018, 0x269: 0x0018, 0x26a: 0x0018, 0x26b: 0x0018, 0x26c: 0x0008, 0x26d: 0x0018, 0x26e: 0x0008, 0x26f: 0x0018, 0x270: 0x0018, 0x271: 0x0018, 0x272: 0x0018, 0x273: 0x0018, 0x274: 0x0018, 0x275: 0x0018, 0x276: 0x0018, 0x277: 0x0018, 0x278: 0x0018, 0x279: 0x0018, 0x27a: 0x0018, 0x27b: 0x0018, 0x27c: 0x0018, 0x27d: 0x0018, 0x27e: 0x0018, 0x27f: 0x0018, // Block 0xa, offset 0x280 0x280: 0x03dd, 0x281: 0x03dd, 0x282: 0x3308, 0x283: 0x03f5, 0x284: 0x0379, 0x285: 0x040d, 0x286: 0x3308, 0x287: 0x3308, 0x288: 0x3308, 0x289: 0x3308, 0x28a: 0x3308, 0x28b: 0x3308, 0x28c: 0x3308, 0x28d: 0x3308, 0x28e: 0x3308, 0x28f: 0x33c0, 0x290: 0x3308, 0x291: 0x3308, 0x292: 0x3308, 0x293: 0x3308, 0x294: 0x3308, 0x295: 0x3308, 0x296: 0x3308, 0x297: 0x3308, 0x298: 0x3308, 0x299: 0x3308, 0x29a: 0x3308, 0x29b: 0x3308, 0x29c: 0x3308, 0x29d: 0x3308, 0x29e: 0x3308, 0x29f: 0x3308, 0x2a0: 0x3308, 0x2a1: 0x3308, 0x2a2: 0x3308, 0x2a3: 0x3308, 0x2a4: 0x3308, 0x2a5: 0x3308, 0x2a6: 0x3308, 0x2a7: 0x3308, 0x2a8: 0x3308, 0x2a9: 0x3308, 0x2aa: 0x3308, 0x2ab: 0x3308, 0x2ac: 0x3308, 0x2ad: 0x3308, 0x2ae: 0x3308, 0x2af: 0x3308, 0x2b0: 0xe00d, 0x2b1: 0x0008, 0x2b2: 0xe00d, 0x2b3: 0x0008, 0x2b4: 0x0425, 0x2b5: 0x0008, 0x2b6: 0xe00d, 0x2b7: 0x0008, 0x2b8: 0x0040, 0x2b9: 0x0040, 0x2ba: 0x03a2, 0x2bb: 0x0008, 0x2bc: 0x0008, 0x2bd: 0x0008, 0x2be: 0x03c2, 0x2bf: 0x043d, // Block 0xb, offset 0x2c0 0x2c0: 0x0040, 0x2c1: 0x0040, 0x2c2: 0x0040, 0x2c3: 0x0040, 0x2c4: 0x008a, 0x2c5: 0x03d2, 0x2c6: 0xe155, 0x2c7: 0x0455, 0x2c8: 0xe12d, 0x2c9: 0xe13d, 0x2ca: 0xe12d, 0x2cb: 0x0040, 0x2cc: 0x03dd, 0x2cd: 0x0040, 0x2ce: 0x046d, 0x2cf: 0x0485, 0x2d0: 0x0008, 0x2d1: 0xe105, 0x2d2: 0xe105, 0x2d3: 0xe105, 0x2d4: 0xe105, 0x2d5: 0xe105, 0x2d6: 0xe105, 0x2d7: 0xe105, 0x2d8: 0xe105, 0x2d9: 0xe105, 0x2da: 0xe105, 0x2db: 0xe105, 0x2dc: 0xe105, 0x2dd: 0xe105, 0x2de: 0xe105, 0x2df: 0xe105, 0x2e0: 0x049d, 0x2e1: 0x049d, 0x2e2: 0x0040, 0x2e3: 0x049d, 0x2e4: 0x049d, 0x2e5: 0x049d, 0x2e6: 0x049d, 0x2e7: 0x049d, 0x2e8: 0x049d, 0x2e9: 0x049d, 0x2ea: 0x049d, 0x2eb: 0x049d, 0x2ec: 0x0008, 0x2ed: 0x0008, 0x2ee: 0x0008, 0x2ef: 0x0008, 0x2f0: 0x0008, 0x2f1: 0x0008, 0x2f2: 0x0008, 0x2f3: 0x0008, 0x2f4: 0x0008, 0x2f5: 0x0008, 0x2f6: 0x0008, 0x2f7: 0x0008, 0x2f8: 0x0008, 0x2f9: 0x0008, 0x2fa: 0x0008, 0x2fb: 0x0008, 0x2fc: 0x0008, 0x2fd: 0x0008, 0x2fe: 0x0008, 0x2ff: 0x0008, // Block 0xc, offset 0x300 0x300: 0x0008, 0x301: 0x0008, 0x302: 0xe00f, 0x303: 0x0008, 0x304: 0x0008, 0x305: 0x0008, 0x306: 0x0008, 0x307: 0x0008, 0x308: 0x0008, 0x309: 0x0008, 0x30a: 0x0008, 0x30b: 0x0008, 0x30c: 0x0008, 0x30d: 0x0008, 0x30e: 0x0008, 0x30f: 0xe0c5, 0x310: 0x04b5, 0x311: 0x04cd, 0x312: 0xe0bd, 0x313: 0xe0f5, 0x314: 0xe0fd, 0x315: 0xe09d, 0x316: 0xe0b5, 0x317: 0x0008, 0x318: 0xe00d, 0x319: 0x0008, 0x31a: 0xe00d, 0x31b: 0x0008, 0x31c: 0xe00d, 0x31d: 0x0008, 0x31e: 0xe00d, 0x31f: 0x0008, 0x320: 0xe00d, 0x321: 0x0008, 0x322: 0xe00d, 0x323: 0x0008, 0x324: 0xe00d, 0x325: 0x0008, 0x326: 0xe00d, 0x327: 0x0008, 0x328: 0xe00d, 0x329: 0x0008, 0x32a: 0xe00d, 0x32b: 0x0008, 0x32c: 0xe00d, 0x32d: 0x0008, 0x32e: 0xe00d, 0x32f: 0x0008, 0x330: 0x04e5, 0x331: 0xe185, 0x332: 0xe18d, 0x333: 0x0008, 0x334: 0x04fd, 0x335: 0x03dd, 0x336: 0x0018, 0x337: 0xe07d, 0x338: 0x0008, 0x339: 0xe1d5, 0x33a: 0xe00d, 0x33b: 0x0008, 0x33c: 0x0008, 0x33d: 0x0515, 0x33e: 0x052d, 0x33f: 0x052d, // Block 0xd, offset 0x340 0x340: 0x0008, 0x341: 0x0008, 0x342: 0x0008, 0x343: 0x0008, 0x344: 0x0008, 0x345: 0x0008, 0x346: 0x0008, 0x347: 0x0008, 0x348: 0x0008, 0x349: 0x0008, 0x34a: 0x0008, 0x34b: 0x0008, 0x34c: 0x0008, 0x34d: 0x0008, 0x34e: 0x0008, 0x34f: 0x0008, 0x350: 0x0008, 0x351: 0x0008, 0x352: 0x0008, 0x353: 0x0008, 0x354: 0x0008, 0x355: 0x0008, 0x356: 0x0008, 0x357: 0x0008, 0x358: 0x0008, 0x359: 0x0008, 0x35a: 0x0008, 0x35b: 0x0008, 0x35c: 0x0008, 0x35d: 0x0008, 0x35e: 0x0008, 0x35f: 0x0008, 0x360: 0xe00d, 0x361: 0x0008, 0x362: 0xe00d, 0x363: 0x0008, 0x364: 0xe00d, 0x365: 0x0008, 0x366: 0xe00d, 0x367: 0x0008, 0x368: 0xe00d, 0x369: 0x0008, 0x36a: 0xe00d, 0x36b: 0x0008, 0x36c: 0xe00d, 0x36d: 0x0008, 0x36e: 0xe00d, 0x36f: 0x0008, 0x370: 0xe00d, 0x371: 0x0008, 0x372: 0xe00d, 0x373: 0x0008, 0x374: 0xe00d, 0x375: 0x0008, 0x376: 0xe00d, 0x377: 0x0008, 0x378: 0xe00d, 0x379: 0x0008, 0x37a: 0xe00d, 0x37b: 0x0008, 0x37c: 0xe00d, 0x37d: 0x0008, 0x37e: 0xe00d, 0x37f: 0x0008, // Block 0xe, offset 0x380 0x380: 0xe00d, 0x381: 0x0008, 0x382: 0x0018, 0x383: 0x3308, 0x384: 0x3308, 0x385: 0x3308, 0x386: 0x3308, 0x387: 0x3308, 0x388: 0x3318, 0x389: 0x3318, 0x38a: 0xe00d, 0x38b: 0x0008, 0x38c: 0xe00d, 0x38d: 0x0008, 0x38e: 0xe00d, 0x38f: 0x0008, 0x390: 0xe00d, 0x391: 0x0008, 0x392: 0xe00d, 0x393: 0x0008, 0x394: 0xe00d, 0x395: 0x0008, 0x396: 0xe00d, 0x397: 0x0008, 0x398: 0xe00d, 0x399: 0x0008, 0x39a: 0xe00d, 0x39b: 0x0008, 0x39c: 0xe00d, 0x39d: 0x0008, 0x39e: 0xe00d, 0x39f: 0x0008, 0x3a0: 0xe00d, 0x3a1: 0x0008, 0x3a2: 0xe00d, 0x3a3: 0x0008, 0x3a4: 0xe00d, 0x3a5: 0x0008, 0x3a6: 0xe00d, 0x3a7: 0x0008, 0x3a8: 0xe00d, 0x3a9: 0x0008, 0x3aa: 0xe00d, 0x3ab: 0x0008, 0x3ac: 0xe00d, 0x3ad: 0x0008, 0x3ae: 0xe00d, 0x3af: 0x0008, 0x3b0: 0xe00d, 0x3b1: 0x0008, 0x3b2: 0xe00d, 0x3b3: 0x0008, 0x3b4: 0xe00d, 0x3b5: 0x0008, 0x3b6: 0xe00d, 0x3b7: 0x0008, 0x3b8: 0xe00d, 0x3b9: 0x0008, 0x3ba: 0xe00d, 0x3bb: 0x0008, 0x3bc: 0xe00d, 0x3bd: 0x0008, 0x3be: 0xe00d, 0x3bf: 0x0008, // Block 0xf, offset 0x3c0 0x3c0: 0x0040, 0x3c1: 0xe01d, 0x3c2: 0x0008, 0x3c3: 0xe03d, 0x3c4: 0x0008, 0x3c5: 0xe01d, 0x3c6: 0x0008, 0x3c7: 0xe07d, 0x3c8: 0x0008, 0x3c9: 0xe01d, 0x3ca: 0x0008, 0x3cb: 0xe03d, 0x3cc: 0x0008, 0x3cd: 0xe01d, 0x3ce: 0x0008, 0x3cf: 0x0008, 0x3d0: 0xe00d, 0x3d1: 0x0008, 0x3d2: 0xe00d, 0x3d3: 0x0008, 0x3d4: 0xe00d, 0x3d5: 0x0008, 0x3d6: 0xe00d, 0x3d7: 0x0008, 0x3d8: 0xe00d, 0x3d9: 0x0008, 0x3da: 0xe00d, 0x3db: 0x0008, 0x3dc: 0xe00d, 0x3dd: 0x0008, 0x3de: 0xe00d, 0x3df: 0x0008, 0x3e0: 0xe00d, 0x3e1: 0x0008, 0x3e2: 0xe00d, 0x3e3: 0x0008, 0x3e4: 0xe00d, 0x3e5: 0x0008, 0x3e6: 0xe00d, 0x3e7: 0x0008, 0x3e8: 0xe00d, 0x3e9: 0x0008, 0x3ea: 0xe00d, 0x3eb: 0x0008, 0x3ec: 0xe00d, 0x3ed: 0x0008, 0x3ee: 0xe00d, 0x3ef: 0x0008, 0x3f0: 0xe00d, 0x3f1: 0x0008, 0x3f2: 0xe00d, 0x3f3: 0x0008, 0x3f4: 0xe00d, 0x3f5: 0x0008, 0x3f6: 0xe00d, 0x3f7: 0x0008, 0x3f8: 0xe00d, 0x3f9: 0x0008, 0x3fa: 0xe00d, 0x3fb: 0x0008, 0x3fc: 0xe00d, 0x3fd: 0x0008, 0x3fe: 0xe00d, 0x3ff: 0x0008, // Block 0x10, offset 0x400 0x400: 0xe00d, 0x401: 0x0008, 0x402: 0xe00d, 0x403: 0x0008, 0x404: 0xe00d, 0x405: 0x0008, 0x406: 0xe00d, 0x407: 0x0008, 0x408: 0xe00d, 0x409: 0x0008, 0x40a: 0xe00d, 0x40b: 0x0008, 0x40c: 0xe00d, 0x40d: 0x0008, 0x40e: 0xe00d, 0x40f: 0x0008, 0x410: 0xe00d, 0x411: 0x0008, 0x412: 0xe00d, 0x413: 0x0008, 0x414: 0xe00d, 0x415: 0x0008, 0x416: 0xe00d, 0x417: 0x0008, 0x418: 0xe00d, 0x419: 0x0008, 0x41a: 0xe00d, 0x41b: 0x0008, 0x41c: 0xe00d, 0x41d: 0x0008, 0x41e: 0xe00d, 0x41f: 0x0008, 0x420: 0xe00d, 0x421: 0x0008, 0x422: 0xe00d, 0x423: 0x0008, 0x424: 0xe00d, 0x425: 0x0008, 0x426: 0xe00d, 0x427: 0x0008, 0x428: 0xe00d, 0x429: 0x0008, 0x42a: 0xe00d, 0x42b: 0x0008, 0x42c: 0xe00d, 0x42d: 0x0008, 0x42e: 0xe00d, 0x42f: 0x0008, 0x430: 0x0040, 0x431: 0x03f5, 0x432: 0x03f5, 0x433: 0x03f5, 0x434: 0x03f5, 0x435: 0x03f5, 0x436: 0x03f5, 0x437: 0x03f5, 0x438: 0x03f5, 0x439: 0x03f5, 0x43a: 0x03f5, 0x43b: 0x03f5, 0x43c: 0x03f5, 0x43d: 0x03f5, 0x43e: 0x03f5, 0x43f: 0x03f5, // Block 0x11, offset 0x440 0x440: 0x0840, 0x441: 0x0840, 0x442: 0x0840, 0x443: 0x0840, 0x444: 0x0840, 0x445: 0x0840, 0x446: 0x0018, 0x447: 0x0018, 0x448: 0x0818, 0x449: 0x0018, 0x44a: 0x0018, 0x44b: 0x0818, 0x44c: 0x0018, 0x44d: 0x0818, 0x44e: 0x0018, 0x44f: 0x0018, 0x450: 0x3308, 0x451: 0x3308, 0x452: 0x3308, 0x453: 0x3308, 0x454: 0x3308, 0x455: 0x3308, 0x456: 0x3308, 0x457: 0x3308, 0x458: 0x3308, 0x459: 0x3308, 0x45a: 0x3308, 0x45b: 0x0818, 0x45c: 0x0b40, 0x45d: 0x0040, 0x45e: 0x0818, 0x45f: 0x0818, 0x460: 0x0a08, 0x461: 0x0808, 0x462: 0x0c08, 0x463: 0x0c08, 0x464: 0x0c08, 0x465: 0x0c08, 0x466: 0x0a08, 0x467: 0x0c08, 0x468: 0x0a08, 0x469: 0x0c08, 0x46a: 0x0a08, 0x46b: 0x0a08, 0x46c: 0x0a08, 0x46d: 0x0a08, 0x46e: 0x0a08, 0x46f: 0x0c08, 0x470: 0x0c08, 0x471: 0x0c08, 0x472: 0x0c08, 0x473: 0x0a08, 0x474: 0x0a08, 0x475: 0x0a08, 0x476: 0x0a08, 0x477: 0x0a08, 0x478: 0x0a08, 0x479: 0x0a08, 0x47a: 0x0a08, 0x47b: 0x0a08, 0x47c: 0x0a08, 0x47d: 0x0a08, 0x47e: 0x0a08, 0x47f: 0x0a08, // Block 0x12, offset 0x480 0x480: 0x0818, 0x481: 0x0a08, 0x482: 0x0a08, 0x483: 0x0a08, 0x484: 0x0a08, 0x485: 0x0a08, 0x486: 0x0a08, 0x487: 0x0a08, 0x488: 0x0c08, 0x489: 0x0a08, 0x48a: 0x0a08, 0x48b: 0x3308, 0x48c: 0x3308, 0x48d: 0x3308, 0x48e: 0x3308, 0x48f: 0x3308, 0x490: 0x3308, 0x491: 0x3308, 0x492: 0x3308, 0x493: 0x3308, 0x494: 0x3308, 0x495: 0x3308, 0x496: 0x3308, 0x497: 0x3308, 0x498: 0x3308, 0x499: 0x3308, 0x49a: 0x3308, 0x49b: 0x3308, 0x49c: 0x3308, 0x49d: 0x3308, 0x49e: 0x3308, 0x49f: 0x3308, 0x4a0: 0x0808, 0x4a1: 0x0808, 0x4a2: 0x0808, 0x4a3: 0x0808, 0x4a4: 0x0808, 0x4a5: 0x0808, 0x4a6: 0x0808, 0x4a7: 0x0808, 0x4a8: 0x0808, 0x4a9: 0x0808, 0x4aa: 0x0018, 0x4ab: 0x0818, 0x4ac: 0x0818, 0x4ad: 0x0818, 0x4ae: 0x0a08, 0x4af: 0x0a08, 0x4b0: 0x3308, 0x4b1: 0x0c08, 0x4b2: 0x0c08, 0x4b3: 0x0c08, 0x4b4: 0x0808, 0x4b5: 0x0429, 0x4b6: 0x0451, 0x4b7: 0x0479, 0x4b8: 0x04a1, 0x4b9: 0x0a08, 0x4ba: 0x0a08, 0x4bb: 0x0a08, 0x4bc: 0x0a08, 0x4bd: 0x0a08, 0x4be: 0x0a08, 0x4bf: 0x0a08, // Block 0x13, offset 0x4c0 0x4c0: 0x0c08, 0x4c1: 0x0a08, 0x4c2: 0x0a08, 0x4c3: 0x0c08, 0x4c4: 0x0c08, 0x4c5: 0x0c08, 0x4c6: 0x0c08, 0x4c7: 0x0c08, 0x4c8: 0x0c08, 0x4c9: 0x0c08, 0x4ca: 0x0c08, 0x4cb: 0x0c08, 0x4cc: 0x0a08, 0x4cd: 0x0c08, 0x4ce: 0x0a08, 0x4cf: 0x0c08, 0x4d0: 0x0a08, 0x4d1: 0x0a08, 0x4d2: 0x0c08, 0x4d3: 0x0c08, 0x4d4: 0x0818, 0x4d5: 0x0c08, 0x4d6: 0x3308, 0x4d7: 0x3308, 0x4d8: 0x3308, 0x4d9: 0x3308, 0x4da: 0x3308, 0x4db: 0x3308, 0x4dc: 0x3308, 0x4dd: 0x0840, 0x4de: 0x0018, 0x4df: 0x3308, 0x4e0: 0x3308, 0x4e1: 0x3308, 0x4e2: 0x3308, 0x4e3: 0x3308, 0x4e4: 0x3308, 0x4e5: 0x0808, 0x4e6: 0x0808, 0x4e7: 0x3308, 0x4e8: 0x3308, 0x4e9: 0x0018, 0x4ea: 0x3308, 0x4eb: 0x3308, 0x4ec: 0x3308, 0x4ed: 0x3308, 0x4ee: 0x0c08, 0x4ef: 0x0c08, 0x4f0: 0x0008, 0x4f1: 0x0008, 0x4f2: 0x0008, 0x4f3: 0x0008, 0x4f4: 0x0008, 0x4f5: 0x0008, 0x4f6: 0x0008, 0x4f7: 0x0008, 0x4f8: 0x0008, 0x4f9: 0x0008, 0x4fa: 0x0a08, 0x4fb: 0x0a08, 0x4fc: 0x0a08, 0x4fd: 0x0808, 0x4fe: 0x0808, 0x4ff: 0x0a08, // Block 0x14, offset 0x500 0x500: 0x0818, 0x501: 0x0818, 0x502: 0x0818, 0x503: 0x0818, 0x504: 0x0818, 0x505: 0x0818, 0x506: 0x0818, 0x507: 0x0818, 0x508: 0x0818, 0x509: 0x0818, 0x50a: 0x0818, 0x50b: 0x0818, 0x50c: 0x0818, 0x50d: 0x0818, 0x50e: 0x0040, 0x50f: 0x0b40, 0x510: 0x0c08, 0x511: 0x3308, 0x512: 0x0a08, 0x513: 0x0a08, 0x514: 0x0a08, 0x515: 0x0c08, 0x516: 0x0c08, 0x517: 0x0c08, 0x518: 0x0c08, 0x519: 0x0c08, 0x51a: 0x0a08, 0x51b: 0x0a08, 0x51c: 0x0a08, 0x51d: 0x0a08, 0x51e: 0x0c08, 0x51f: 0x0a08, 0x520: 0x0a08, 0x521: 0x0a08, 0x522: 0x0a08, 0x523: 0x0a08, 0x524: 0x0a08, 0x525: 0x0a08, 0x526: 0x0a08, 0x527: 0x0a08, 0x528: 0x0c08, 0x529: 0x0a08, 0x52a: 0x0c08, 0x52b: 0x0a08, 0x52c: 0x0c08, 0x52d: 0x0a08, 0x52e: 0x0a08, 0x52f: 0x0c08, 0x530: 0x3308, 0x531: 0x3308, 0x532: 0x3308, 0x533: 0x3308, 0x534: 0x3308, 0x535: 0x3308, 0x536: 0x3308, 0x537: 0x3308, 0x538: 0x3308, 0x539: 0x3308, 0x53a: 0x3308, 0x53b: 0x3308, 0x53c: 0x3308, 0x53d: 0x3308, 0x53e: 0x3308, 0x53f: 0x3308, // Block 0x15, offset 0x540 0x540: 0x3008, 0x541: 0x3308, 0x542: 0x3308, 0x543: 0x3308, 0x544: 0x3308, 0x545: 0x3308, 0x546: 0x3308, 0x547: 0x3308, 0x548: 0x3308, 0x549: 0x3008, 0x54a: 0x3008, 0x54b: 0x3008, 0x54c: 0x3008, 0x54d: 0x3b08, 0x54e: 0x3008, 0x54f: 0x3008, 0x550: 0x0008, 0x551: 0x3308, 0x552: 0x3308, 0x553: 0x3308, 0x554: 0x3308, 0x555: 0x3308, 0x556: 0x3308, 0x557: 0x3308, 0x558: 0x04c9, 0x559: 0x0501, 0x55a: 0x0539, 0x55b: 0x0571, 0x55c: 0x05a9, 0x55d: 0x05e1, 0x55e: 0x0619, 0x55f: 0x0651, 0x560: 0x0008, 0x561: 0x0008, 0x562: 0x3308, 0x563: 0x3308, 0x564: 0x0018, 0x565: 0x0018, 0x566: 0x0008, 0x567: 0x0008, 0x568: 0x0008, 0x569: 0x0008, 0x56a: 0x0008, 0x56b: 0x0008, 0x56c: 0x0008, 0x56d: 0x0008, 0x56e: 0x0008, 0x56f: 0x0008, 0x570: 0x0018, 0x571: 0x0008, 0x572: 0x0008, 0x573: 0x0008, 0x574: 0x0008, 0x575: 0x0008, 0x576: 0x0008, 0x577: 0x0008, 0x578: 0x0008, 0x579: 0x0008, 0x57a: 0x0008, 0x57b: 0x0008, 0x57c: 0x0008, 0x57d: 0x0008, 0x57e: 0x0008, 0x57f: 0x0008, // Block 0x16, offset 0x580 0x580: 0x0008, 0x581: 0x3308, 0x582: 0x3008, 0x583: 0x3008, 0x584: 0x0040, 0x585: 0x0008, 0x586: 0x0008, 0x587: 0x0008, 0x588: 0x0008, 0x589: 0x0008, 0x58a: 0x0008, 0x58b: 0x0008, 0x58c: 0x0008, 0x58d: 0x0040, 0x58e: 0x0040, 0x58f: 0x0008, 0x590: 0x0008, 0x591: 0x0040, 0x592: 0x0040, 0x593: 0x0008, 0x594: 0x0008, 0x595: 0x0008, 0x596: 0x0008, 0x597: 0x0008, 0x598: 0x0008, 0x599: 0x0008, 0x59a: 0x0008, 0x59b: 0x0008, 0x59c: 0x0008, 0x59d: 0x0008, 0x59e: 0x0008, 0x59f: 0x0008, 0x5a0: 0x0008, 0x5a1: 0x0008, 0x5a2: 0x0008, 0x5a3: 0x0008, 0x5a4: 0x0008, 0x5a5: 0x0008, 0x5a6: 0x0008, 0x5a7: 0x0008, 0x5a8: 0x0008, 0x5a9: 0x0040, 0x5aa: 0x0008, 0x5ab: 0x0008, 0x5ac: 0x0008, 0x5ad: 0x0008, 0x5ae: 0x0008, 0x5af: 0x0008, 0x5b0: 0x0008, 0x5b1: 0x0040, 0x5b2: 0x0008, 0x5b3: 0x0040, 0x5b4: 0x0040, 0x5b5: 0x0040, 0x5b6: 0x0008, 0x5b7: 0x0008, 0x5b8: 0x0008, 0x5b9: 0x0008, 0x5ba: 0x0040, 0x5bb: 0x0040, 0x5bc: 0x3308, 0x5bd: 0x0008, 0x5be: 0x3008, 0x5bf: 0x3008, // Block 0x17, offset 0x5c0 0x5c0: 0x3008, 0x5c1: 0x3308, 0x5c2: 0x3308, 0x5c3: 0x3308, 0x5c4: 0x3308, 0x5c5: 0x0040, 0x5c6: 0x0040, 0x5c7: 0x3008, 0x5c8: 0x3008, 0x5c9: 0x0040, 0x5ca: 0x0040, 0x5cb: 0x3008, 0x5cc: 0x3008, 0x5cd: 0x3b08, 0x5ce: 0x0008, 0x5cf: 0x0040, 0x5d0: 0x0040, 0x5d1: 0x0040, 0x5d2: 0x0040, 0x5d3: 0x0040, 0x5d4: 0x0040, 0x5d5: 0x0040, 0x5d6: 0x0040, 0x5d7: 0x3008, 0x5d8: 0x0040, 0x5d9: 0x0040, 0x5da: 0x0040, 0x5db: 0x0040, 0x5dc: 0x0689, 0x5dd: 0x06c1, 0x5de: 0x0040, 0x5df: 0x06f9, 0x5e0: 0x0008, 0x5e1: 0x0008, 0x5e2: 0x3308, 0x5e3: 0x3308, 0x5e4: 0x0040, 0x5e5: 0x0040, 0x5e6: 0x0008, 0x5e7: 0x0008, 0x5e8: 0x0008, 0x5e9: 0x0008, 0x5ea: 0x0008, 0x5eb: 0x0008, 0x5ec: 0x0008, 0x5ed: 0x0008, 0x5ee: 0x0008, 0x5ef: 0x0008, 0x5f0: 0x0008, 0x5f1: 0x0008, 0x5f2: 0x0018, 0x5f3: 0x0018, 0x5f4: 0x0018, 0x5f5: 0x0018, 0x5f6: 0x0018, 0x5f7: 0x0018, 0x5f8: 0x0018, 0x5f9: 0x0018, 0x5fa: 0x0018, 0x5fb: 0x0018, 0x5fc: 0x0040, 0x5fd: 0x0040, 0x5fe: 0x0040, 0x5ff: 0x0040, // Block 0x18, offset 0x600 0x600: 0x0040, 0x601: 0x3308, 0x602: 0x3308, 0x603: 0x3008, 0x604: 0x0040, 0x605: 0x0008, 0x606: 0x0008, 0x607: 0x0008, 0x608: 0x0008, 0x609: 0x0008, 0x60a: 0x0008, 0x60b: 0x0040, 0x60c: 0x0040, 0x60d: 0x0040, 0x60e: 0x0040, 0x60f: 0x0008, 0x610: 0x0008, 0x611: 0x0040, 0x612: 0x0040, 0x613: 0x0008, 0x614: 0x0008, 0x615: 0x0008, 0x616: 0x0008, 0x617: 0x0008, 0x618: 0x0008, 0x619: 0x0008, 0x61a: 0x0008, 0x61b: 0x0008, 0x61c: 0x0008, 0x61d: 0x0008, 0x61e: 0x0008, 0x61f: 0x0008, 0x620: 0x0008, 0x621: 0x0008, 0x622: 0x0008, 0x623: 0x0008, 0x624: 0x0008, 0x625: 0x0008, 0x626: 0x0008, 0x627: 0x0008, 0x628: 0x0008, 0x629: 0x0040, 0x62a: 0x0008, 0x62b: 0x0008, 0x62c: 0x0008, 0x62d: 0x0008, 0x62e: 0x0008, 0x62f: 0x0008, 0x630: 0x0008, 0x631: 0x0040, 0x632: 0x0008, 0x633: 0x0731, 0x634: 0x0040, 0x635: 0x0008, 0x636: 0x0769, 0x637: 0x0040, 0x638: 0x0008, 0x639: 0x0008, 0x63a: 0x0040, 0x63b: 0x0040, 0x63c: 0x3308, 0x63d: 0x0040, 0x63e: 0x3008, 0x63f: 0x3008, // Block 0x19, offset 0x640 0x640: 0x3008, 0x641: 0x3308, 0x642: 0x3308, 0x643: 0x0040, 0x644: 0x0040, 0x645: 0x0040, 0x646: 0x0040, 0x647: 0x3308, 0x648: 0x3308, 0x649: 0x0040, 0x64a: 0x0040, 0x64b: 0x3308, 0x64c: 0x3308, 0x64d: 0x3b08, 0x64e: 0x0040, 0x64f: 0x0040, 0x650: 0x0040, 0x651: 0x3308, 0x652: 0x0040, 0x653: 0x0040, 0x654: 0x0040, 0x655: 0x0040, 0x656: 0x0040, 0x657: 0x0040, 0x658: 0x0040, 0x659: 0x07a1, 0x65a: 0x07d9, 0x65b: 0x0811, 0x65c: 0x0008, 0x65d: 0x0040, 0x65e: 0x0849, 0x65f: 0x0040, 0x660: 0x0040, 0x661: 0x0040, 0x662: 0x0040, 0x663: 0x0040, 0x664: 0x0040, 0x665: 0x0040, 0x666: 0x0008, 0x667: 0x0008, 0x668: 0x0008, 0x669: 0x0008, 0x66a: 0x0008, 0x66b: 0x0008, 0x66c: 0x0008, 0x66d: 0x0008, 0x66e: 0x0008, 0x66f: 0x0008, 0x670: 0x3308, 0x671: 0x3308, 0x672: 0x0008, 0x673: 0x0008, 0x674: 0x0008, 0x675: 0x3308, 0x676: 0x0040, 0x677: 0x0040, 0x678: 0x0040, 0x679: 0x0040, 0x67a: 0x0040, 0x67b: 0x0040, 0x67c: 0x0040, 0x67d: 0x0040, 0x67e: 0x0040, 0x67f: 0x0040, // Block 0x1a, offset 0x680 0x680: 0x0040, 0x681: 0x3308, 0x682: 0x3308, 0x683: 0x3008, 0x684: 0x0040, 0x685: 0x0008, 0x686: 0x0008, 0x687: 0x0008, 0x688: 0x0008, 0x689: 0x0008, 0x68a: 0x0008, 0x68b: 0x0008, 0x68c: 0x0008, 0x68d: 0x0008, 0x68e: 0x0040, 0x68f: 0x0008, 0x690: 0x0008, 0x691: 0x0008, 0x692: 0x0040, 0x693: 0x0008, 0x694: 0x0008, 0x695: 0x0008, 0x696: 0x0008, 0x697: 0x0008, 0x698: 0x0008, 0x699: 0x0008, 0x69a: 0x0008, 0x69b: 0x0008, 0x69c: 0x0008, 0x69d: 0x0008, 0x69e: 0x0008, 0x69f: 0x0008, 0x6a0: 0x0008, 0x6a1: 0x0008, 0x6a2: 0x0008, 0x6a3: 0x0008, 0x6a4: 0x0008, 0x6a5: 0x0008, 0x6a6: 0x0008, 0x6a7: 0x0008, 0x6a8: 0x0008, 0x6a9: 0x0040, 0x6aa: 0x0008, 0x6ab: 0x0008, 0x6ac: 0x0008, 0x6ad: 0x0008, 0x6ae: 0x0008, 0x6af: 0x0008, 0x6b0: 0x0008, 0x6b1: 0x0040, 0x6b2: 0x0008, 0x6b3: 0x0008, 0x6b4: 0x0040, 0x6b5: 0x0008, 0x6b6: 0x0008, 0x6b7: 0x0008, 0x6b8: 0x0008, 0x6b9: 0x0008, 0x6ba: 0x0040, 0x6bb: 0x0040, 0x6bc: 0x3308, 0x6bd: 0x0008, 0x6be: 0x3008, 0x6bf: 0x3008, // Block 0x1b, offset 0x6c0 0x6c0: 0x3008, 0x6c1: 0x3308, 0x6c2: 0x3308, 0x6c3: 0x3308, 0x6c4: 0x3308, 0x6c5: 0x3308, 0x6c6: 0x0040, 0x6c7: 0x3308, 0x6c8: 0x3308, 0x6c9: 0x3008, 0x6ca: 0x0040, 0x6cb: 0x3008, 0x6cc: 0x3008, 0x6cd: 0x3b08, 0x6ce: 0x0040, 0x6cf: 0x0040, 0x6d0: 0x0008, 0x6d1: 0x0040, 0x6d2: 0x0040, 0x6d3: 0x0040, 0x6d4: 0x0040, 0x6d5: 0x0040, 0x6d6: 0x0040, 0x6d7: 0x0040, 0x6d8: 0x0040, 0x6d9: 0x0040, 0x6da: 0x0040, 0x6db: 0x0040, 0x6dc: 0x0040, 0x6dd: 0x0040, 0x6de: 0x0040, 0x6df: 0x0040, 0x6e0: 0x0008, 0x6e1: 0x0008, 0x6e2: 0x3308, 0x6e3: 0x3308, 0x6e4: 0x0040, 0x6e5: 0x0040, 0x6e6: 0x0008, 0x6e7: 0x0008, 0x6e8: 0x0008, 0x6e9: 0x0008, 0x6ea: 0x0008, 0x6eb: 0x0008, 0x6ec: 0x0008, 0x6ed: 0x0008, 0x6ee: 0x0008, 0x6ef: 0x0008, 0x6f0: 0x0018, 0x6f1: 0x0018, 0x6f2: 0x0040, 0x6f3: 0x0040, 0x6f4: 0x0040, 0x6f5: 0x0040, 0x6f6: 0x0040, 0x6f7: 0x0040, 0x6f8: 0x0040, 0x6f9: 0x0008, 0x6fa: 0x0040, 0x6fb: 0x0040, 0x6fc: 0x0040, 0x6fd: 0x0040, 0x6fe: 0x0040, 0x6ff: 0x0040, // Block 0x1c, offset 0x700 0x700: 0x0040, 0x701: 0x3308, 0x702: 0x3008, 0x703: 0x3008, 0x704: 0x0040, 0x705: 0x0008, 0x706: 0x0008, 0x707: 0x0008, 0x708: 0x0008, 0x709: 0x0008, 0x70a: 0x0008, 0x70b: 0x0008, 0x70c: 0x0008, 0x70d: 0x0040, 0x70e: 0x0040, 0x70f: 0x0008, 0x710: 0x0008, 0x711: 0x0040, 0x712: 0x0040, 0x713: 0x0008, 0x714: 0x0008, 0x715: 0x0008, 0x716: 0x0008, 0x717: 0x0008, 0x718: 0x0008, 0x719: 0x0008, 0x71a: 0x0008, 0x71b: 0x0008, 0x71c: 0x0008, 0x71d: 0x0008, 0x71e: 0x0008, 0x71f: 0x0008, 0x720: 0x0008, 0x721: 0x0008, 0x722: 0x0008, 0x723: 0x0008, 0x724: 0x0008, 0x725: 0x0008, 0x726: 0x0008, 0x727: 0x0008, 0x728: 0x0008, 0x729: 0x0040, 0x72a: 0x0008, 0x72b: 0x0008, 0x72c: 0x0008, 0x72d: 0x0008, 0x72e: 0x0008, 0x72f: 0x0008, 0x730: 0x0008, 0x731: 0x0040, 0x732: 0x0008, 0x733: 0x0008, 0x734: 0x0040, 0x735: 0x0008, 0x736: 0x0008, 0x737: 0x0008, 0x738: 0x0008, 0x739: 0x0008, 0x73a: 0x0040, 0x73b: 0x0040, 0x73c: 0x3308, 0x73d: 0x0008, 0x73e: 0x3008, 0x73f: 0x3308, // Block 0x1d, offset 0x740 0x740: 0x3008, 0x741: 0x3308, 0x742: 0x3308, 0x743: 0x3308, 0x744: 0x3308, 0x745: 0x0040, 0x746: 0x0040, 0x747: 0x3008, 0x748: 0x3008, 0x749: 0x0040, 0x74a: 0x0040, 0x74b: 0x3008, 0x74c: 0x3008, 0x74d: 0x3b08, 0x74e: 0x0040, 0x74f: 0x0040, 0x750: 0x0040, 0x751: 0x0040, 0x752: 0x0040, 0x753: 0x0040, 0x754: 0x0040, 0x755: 0x0040, 0x756: 0x3308, 0x757: 0x3008, 0x758: 0x0040, 0x759: 0x0040, 0x75a: 0x0040, 0x75b: 0x0040, 0x75c: 0x0881, 0x75d: 0x08b9, 0x75e: 0x0040, 0x75f: 0x0008, 0x760: 0x0008, 0x761: 0x0008, 0x762: 0x3308, 0x763: 0x3308, 0x764: 0x0040, 0x765: 0x0040, 0x766: 0x0008, 0x767: 0x0008, 0x768: 0x0008, 0x769: 0x0008, 0x76a: 0x0008, 0x76b: 0x0008, 0x76c: 0x0008, 0x76d: 0x0008, 0x76e: 0x0008, 0x76f: 0x0008, 0x770: 0x0018, 0x771: 0x0008, 0x772: 0x0018, 0x773: 0x0018, 0x774: 0x0018, 0x775: 0x0018, 0x776: 0x0018, 0x777: 0x0018, 0x778: 0x0040, 0x779: 0x0040, 0x77a: 0x0040, 0x77b: 0x0040, 0x77c: 0x0040, 0x77d: 0x0040, 0x77e: 0x0040, 0x77f: 0x0040, // Block 0x1e, offset 0x780 0x780: 0x0040, 0x781: 0x0040, 0x782: 0x3308, 0x783: 0x0008, 0x784: 0x0040, 0x785: 0x0008, 0x786: 0x0008, 0x787: 0x0008, 0x788: 0x0008, 0x789: 0x0008, 0x78a: 0x0008, 0x78b: 0x0040, 0x78c: 0x0040, 0x78d: 0x0040, 0x78e: 0x0008, 0x78f: 0x0008, 0x790: 0x0008, 0x791: 0x0040, 0x792: 0x0008, 0x793: 0x0008, 0x794: 0x0008, 0x795: 0x0008, 0x796: 0x0040, 0x797: 0x0040, 0x798: 0x0040, 0x799: 0x0008, 0x79a: 0x0008, 0x79b: 0x0040, 0x79c: 0x0008, 0x79d: 0x0040, 0x79e: 0x0008, 0x79f: 0x0008, 0x7a0: 0x0040, 0x7a1: 0x0040, 0x7a2: 0x0040, 0x7a3: 0x0008, 0x7a4: 0x0008, 0x7a5: 0x0040, 0x7a6: 0x0040, 0x7a7: 0x0040, 0x7a8: 0x0008, 0x7a9: 0x0008, 0x7aa: 0x0008, 0x7ab: 0x0040, 0x7ac: 0x0040, 0x7ad: 0x0040, 0x7ae: 0x0008, 0x7af: 0x0008, 0x7b0: 0x0008, 0x7b1: 0x0008, 0x7b2: 0x0008, 0x7b3: 0x0008, 0x7b4: 0x0008, 0x7b5: 0x0008, 0x7b6: 0x0008, 0x7b7: 0x0008, 0x7b8: 0x0008, 0x7b9: 0x0008, 0x7ba: 0x0040, 0x7bb: 0x0040, 0x7bc: 0x0040, 0x7bd: 0x0040, 0x7be: 0x3008, 0x7bf: 0x3008, // Block 0x1f, offset 0x7c0 0x7c0: 0x3308, 0x7c1: 0x3008, 0x7c2: 0x3008, 0x7c3: 0x3008, 0x7c4: 0x3008, 0x7c5: 0x0040, 0x7c6: 0x3308, 0x7c7: 0x3308, 0x7c8: 0x3308, 0x7c9: 0x0040, 0x7ca: 0x3308, 0x7cb: 0x3308, 0x7cc: 0x3308, 0x7cd: 0x3b08, 0x7ce: 0x0040, 0x7cf: 0x0040, 0x7d0: 0x0040, 0x7d1: 0x0040, 0x7d2: 0x0040, 0x7d3: 0x0040, 0x7d4: 0x0040, 0x7d5: 0x3308, 0x7d6: 0x3308, 0x7d7: 0x0040, 0x7d8: 0x0008, 0x7d9: 0x0008, 0x7da: 0x0008, 0x7db: 0x0040, 0x7dc: 0x0040, 0x7dd: 0x0040, 0x7de: 0x0040, 0x7df: 0x0040, 0x7e0: 0x0008, 0x7e1: 0x0008, 0x7e2: 0x3308, 0x7e3: 0x3308, 0x7e4: 0x0040, 0x7e5: 0x0040, 0x7e6: 0x0008, 0x7e7: 0x0008, 0x7e8: 0x0008, 0x7e9: 0x0008, 0x7ea: 0x0008, 0x7eb: 0x0008, 0x7ec: 0x0008, 0x7ed: 0x0008, 0x7ee: 0x0008, 0x7ef: 0x0008, 0x7f0: 0x0040, 0x7f1: 0x0040, 0x7f2: 0x0040, 0x7f3: 0x0040, 0x7f4: 0x0040, 0x7f5: 0x0040, 0x7f6: 0x0040, 0x7f7: 0x0040, 0x7f8: 0x0018, 0x7f9: 0x0018, 0x7fa: 0x0018, 0x7fb: 0x0018, 0x7fc: 0x0018, 0x7fd: 0x0018, 0x7fe: 0x0018, 0x7ff: 0x0018, // Block 0x20, offset 0x800 0x800: 0x0008, 0x801: 0x3308, 0x802: 0x3008, 0x803: 0x3008, 0x804: 0x0040, 0x805: 0x0008, 0x806: 0x0008, 0x807: 0x0008, 0x808: 0x0008, 0x809: 0x0008, 0x80a: 0x0008, 0x80b: 0x0008, 0x80c: 0x0008, 0x80d: 0x0040, 0x80e: 0x0008, 0x80f: 0x0008, 0x810: 0x0008, 0x811: 0x0040, 0x812: 0x0008, 0x813: 0x0008, 0x814: 0x0008, 0x815: 0x0008, 0x816: 0x0008, 0x817: 0x0008, 0x818: 0x0008, 0x819: 0x0008, 0x81a: 0x0008, 0x81b: 0x0008, 0x81c: 0x0008, 0x81d: 0x0008, 0x81e: 0x0008, 0x81f: 0x0008, 0x820: 0x0008, 0x821: 0x0008, 0x822: 0x0008, 0x823: 0x0008, 0x824: 0x0008, 0x825: 0x0008, 0x826: 0x0008, 0x827: 0x0008, 0x828: 0x0008, 0x829: 0x0040, 0x82a: 0x0008, 0x82b: 0x0008, 0x82c: 0x0008, 0x82d: 0x0008, 0x82e: 0x0008, 0x82f: 0x0008, 0x830: 0x0008, 0x831: 0x0008, 0x832: 0x0008, 0x833: 0x0008, 0x834: 0x0040, 0x835: 0x0008, 0x836: 0x0008, 0x837: 0x0008, 0x838: 0x0008, 0x839: 0x0008, 0x83a: 0x0040, 0x83b: 0x0040, 0x83c: 0x3308, 0x83d: 0x0008, 0x83e: 0x3008, 0x83f: 0x3308, // Block 0x21, offset 0x840 0x840: 0x3008, 0x841: 0x3008, 0x842: 0x3008, 0x843: 0x3008, 0x844: 0x3008, 0x845: 0x0040, 0x846: 0x3308, 0x847: 0x3008, 0x848: 0x3008, 0x849: 0x0040, 0x84a: 0x3008, 0x84b: 0x3008, 0x84c: 0x3308, 0x84d: 0x3b08, 0x84e: 0x0040, 0x84f: 0x0040, 0x850: 0x0040, 0x851: 0x0040, 0x852: 0x0040, 0x853: 0x0040, 0x854: 0x0040, 0x855: 0x3008, 0x856: 0x3008, 0x857: 0x0040, 0x858: 0x0040, 0x859: 0x0040, 0x85a: 0x0040, 0x85b: 0x0040, 0x85c: 0x0040, 0x85d: 0x0040, 0x85e: 0x0008, 0x85f: 0x0040, 0x860: 0x0008, 0x861: 0x0008, 0x862: 0x3308, 0x863: 0x3308, 0x864: 0x0040, 0x865: 0x0040, 0x866: 0x0008, 0x867: 0x0008, 0x868: 0x0008, 0x869: 0x0008, 0x86a: 0x0008, 0x86b: 0x0008, 0x86c: 0x0008, 0x86d: 0x0008, 0x86e: 0x0008, 0x86f: 0x0008, 0x870: 0x0040, 0x871: 0x0008, 0x872: 0x0008, 0x873: 0x0040, 0x874: 0x0040, 0x875: 0x0040, 0x876: 0x0040, 0x877: 0x0040, 0x878: 0x0040, 0x879: 0x0040, 0x87a: 0x0040, 0x87b: 0x0040, 0x87c: 0x0040, 0x87d: 0x0040, 0x87e: 0x0040, 0x87f: 0x0040, // Block 0x22, offset 0x880 0x880: 0x3008, 0x881: 0x3308, 0x882: 0x3308, 0x883: 0x3308, 0x884: 0x3308, 0x885: 0x0040, 0x886: 0x3008, 0x887: 0x3008, 0x888: 0x3008, 0x889: 0x0040, 0x88a: 0x3008, 0x88b: 0x3008, 0x88c: 0x3008, 0x88d: 0x3b08, 0x88e: 0x0008, 0x88f: 0x0018, 0x890: 0x0040, 0x891: 0x0040, 0x892: 0x0040, 0x893: 0x0040, 0x894: 0x0008, 0x895: 0x0008, 0x896: 0x0008, 0x897: 0x3008, 0x898: 0x0018, 0x899: 0x0018, 0x89a: 0x0018, 0x89b: 0x0018, 0x89c: 0x0018, 0x89d: 0x0018, 0x89e: 0x0018, 0x89f: 0x0008, 0x8a0: 0x0008, 0x8a1: 0x0008, 0x8a2: 0x3308, 0x8a3: 0x3308, 0x8a4: 0x0040, 0x8a5: 0x0040, 0x8a6: 0x0008, 0x8a7: 0x0008, 0x8a8: 0x0008, 0x8a9: 0x0008, 0x8aa: 0x0008, 0x8ab: 0x0008, 0x8ac: 0x0008, 0x8ad: 0x0008, 0x8ae: 0x0008, 0x8af: 0x0008, 0x8b0: 0x0018, 0x8b1: 0x0018, 0x8b2: 0x0018, 0x8b3: 0x0018, 0x8b4: 0x0018, 0x8b5: 0x0018, 0x8b6: 0x0018, 0x8b7: 0x0018, 0x8b8: 0x0018, 0x8b9: 0x0018, 0x8ba: 0x0008, 0x8bb: 0x0008, 0x8bc: 0x0008, 0x8bd: 0x0008, 0x8be: 0x0008, 0x8bf: 0x0008, // Block 0x23, offset 0x8c0 0x8c0: 0x0040, 0x8c1: 0x0008, 0x8c2: 0x0008, 0x8c3: 0x0040, 0x8c4: 0x0008, 0x8c5: 0x0040, 0x8c6: 0x0040, 0x8c7: 0x0008, 0x8c8: 0x0008, 0x8c9: 0x0040, 0x8ca: 0x0008, 0x8cb: 0x0040, 0x8cc: 0x0040, 0x8cd: 0x0008, 0x8ce: 0x0040, 0x8cf: 0x0040, 0x8d0: 0x0040, 0x8d1: 0x0040, 0x8d2: 0x0040, 0x8d3: 0x0040, 0x8d4: 0x0008, 0x8d5: 0x0008, 0x8d6: 0x0008, 0x8d7: 0x0008, 0x8d8: 0x0040, 0x8d9: 0x0008, 0x8da: 0x0008, 0x8db: 0x0008, 0x8dc: 0x0008, 0x8dd: 0x0008, 0x8de: 0x0008, 0x8df: 0x0008, 0x8e0: 0x0040, 0x8e1: 0x0008, 0x8e2: 0x0008, 0x8e3: 0x0008, 0x8e4: 0x0040, 0x8e5: 0x0008, 0x8e6: 0x0040, 0x8e7: 0x0008, 0x8e8: 0x0040, 0x8e9: 0x0040, 0x8ea: 0x0008, 0x8eb: 0x0008, 0x8ec: 0x0040, 0x8ed: 0x0008, 0x8ee: 0x0008, 0x8ef: 0x0008, 0x8f0: 0x0008, 0x8f1: 0x3308, 0x8f2: 0x0008, 0x8f3: 0x0929, 0x8f4: 0x3308, 0x8f5: 0x3308, 0x8f6: 0x3308, 0x8f7: 0x3308, 0x8f8: 0x3308, 0x8f9: 0x3308, 0x8fa: 0x0040, 0x8fb: 0x3308, 0x8fc: 0x3308, 0x8fd: 0x0008, 0x8fe: 0x0040, 0x8ff: 0x0040, // Block 0x24, offset 0x900 0x900: 0x0008, 0x901: 0x0008, 0x902: 0x0008, 0x903: 0x09d1, 0x904: 0x0008, 0x905: 0x0008, 0x906: 0x0008, 0x907: 0x0008, 0x908: 0x0040, 0x909: 0x0008, 0x90a: 0x0008, 0x90b: 0x0008, 0x90c: 0x0008, 0x90d: 0x0a09, 0x90e: 0x0008, 0x90f: 0x0008, 0x910: 0x0008, 0x911: 0x0008, 0x912: 0x0a41, 0x913: 0x0008, 0x914: 0x0008, 0x915: 0x0008, 0x916: 0x0008, 0x917: 0x0a79, 0x918: 0x0008, 0x919: 0x0008, 0x91a: 0x0008, 0x91b: 0x0008, 0x91c: 0x0ab1, 0x91d: 0x0008, 0x91e: 0x0008, 0x91f: 0x0008, 0x920: 0x0008, 0x921: 0x0008, 0x922: 0x0008, 0x923: 0x0008, 0x924: 0x0008, 0x925: 0x0008, 0x926: 0x0008, 0x927: 0x0008, 0x928: 0x0008, 0x929: 0x0ae9, 0x92a: 0x0008, 0x92b: 0x0008, 0x92c: 0x0008, 0x92d: 0x0040, 0x92e: 0x0040, 0x92f: 0x0040, 0x930: 0x0040, 0x931: 0x3308, 0x932: 0x3308, 0x933: 0x0b21, 0x934: 0x3308, 0x935: 0x0b59, 0x936: 0x0b91, 0x937: 0x0bc9, 0x938: 0x0c19, 0x939: 0x0c51, 0x93a: 0x3308, 0x93b: 0x3308, 0x93c: 0x3308, 0x93d: 0x3308, 0x93e: 0x3308, 0x93f: 0x3008, // Block 0x25, offset 0x940 0x940: 0x3308, 0x941: 0x0ca1, 0x942: 0x3308, 0x943: 0x3308, 0x944: 0x3b08, 0x945: 0x0018, 0x946: 0x3308, 0x947: 0x3308, 0x948: 0x0008, 0x949: 0x0008, 0x94a: 0x0008, 0x94b: 0x0008, 0x94c: 0x0008, 0x94d: 0x3308, 0x94e: 0x3308, 0x94f: 0x3308, 0x950: 0x3308, 0x951: 0x3308, 0x952: 0x3308, 0x953: 0x0cd9, 0x954: 0x3308, 0x955: 0x3308, 0x956: 0x3308, 0x957: 0x3308, 0x958: 0x0040, 0x959: 0x3308, 0x95a: 0x3308, 0x95b: 0x3308, 0x95c: 0x3308, 0x95d: 0x0d11, 0x95e: 0x3308, 0x95f: 0x3308, 0x960: 0x3308, 0x961: 0x3308, 0x962: 0x0d49, 0x963: 0x3308, 0x964: 0x3308, 0x965: 0x3308, 0x966: 0x3308, 0x967: 0x0d81, 0x968: 0x3308, 0x969: 0x3308, 0x96a: 0x3308, 0x96b: 0x3308, 0x96c: 0x0db9, 0x96d: 0x3308, 0x96e: 0x3308, 0x96f: 0x3308, 0x970: 0x3308, 0x971: 0x3308, 0x972: 0x3308, 0x973: 0x3308, 0x974: 0x3308, 0x975: 0x3308, 0x976: 0x3308, 0x977: 0x3308, 0x978: 0x3308, 0x979: 0x0df1, 0x97a: 0x3308, 0x97b: 0x3308, 0x97c: 0x3308, 0x97d: 0x0040, 0x97e: 0x0018, 0x97f: 0x0018, // Block 0x26, offset 0x980 0x980: 0x0008, 0x981: 0x0008, 0x982: 0x0008, 0x983: 0x0008, 0x984: 0x0008, 0x985: 0x0008, 0x986: 0x0008, 0x987: 0x0008, 0x988: 0x0008, 0x989: 0x0008, 0x98a: 0x0008, 0x98b: 0x0008, 0x98c: 0x0008, 0x98d: 0x0008, 0x98e: 0x0008, 0x98f: 0x0008, 0x990: 0x0008, 0x991: 0x0008, 0x992: 0x0008, 0x993: 0x0008, 0x994: 0x0008, 0x995: 0x0008, 0x996: 0x0008, 0x997: 0x0008, 0x998: 0x0008, 0x999: 0x0008, 0x99a: 0x0008, 0x99b: 0x0008, 0x99c: 0x0008, 0x99d: 0x0008, 0x99e: 0x0008, 0x99f: 0x0008, 0x9a0: 0x0008, 0x9a1: 0x0008, 0x9a2: 0x0008, 0x9a3: 0x0008, 0x9a4: 0x0008, 0x9a5: 0x0008, 0x9a6: 0x0008, 0x9a7: 0x0008, 0x9a8: 0x0008, 0x9a9: 0x0008, 0x9aa: 0x0008, 0x9ab: 0x0008, 0x9ac: 0x0039, 0x9ad: 0x0ed1, 0x9ae: 0x0ee9, 0x9af: 0x0008, 0x9b0: 0x0ef9, 0x9b1: 0x0f09, 0x9b2: 0x0f19, 0x9b3: 0x0f31, 0x9b4: 0x0249, 0x9b5: 0x0f41, 0x9b6: 0x0259, 0x9b7: 0x0f51, 0x9b8: 0x0359, 0x9b9: 0x0f61, 0x9ba: 0x0f71, 0x9bb: 0x0008, 0x9bc: 0x00d9, 0x9bd: 0x0f81, 0x9be: 0x0f99, 0x9bf: 0x0269, // Block 0x27, offset 0x9c0 0x9c0: 0x0fa9, 0x9c1: 0x0fb9, 0x9c2: 0x0279, 0x9c3: 0x0039, 0x9c4: 0x0fc9, 0x9c5: 0x0fe1, 0x9c6: 0x059d, 0x9c7: 0x0ee9, 0x9c8: 0x0ef9, 0x9c9: 0x0f09, 0x9ca: 0x0ff9, 0x9cb: 0x1011, 0x9cc: 0x1029, 0x9cd: 0x0f31, 0x9ce: 0x0008, 0x9cf: 0x0f51, 0x9d0: 0x0f61, 0x9d1: 0x1041, 0x9d2: 0x00d9, 0x9d3: 0x1059, 0x9d4: 0x05b5, 0x9d5: 0x05b5, 0x9d6: 0x0f99, 0x9d7: 0x0fa9, 0x9d8: 0x0fb9, 0x9d9: 0x059d, 0x9da: 0x1071, 0x9db: 0x1089, 0x9dc: 0x05cd, 0x9dd: 0x1099, 0x9de: 0x10b1, 0x9df: 0x10c9, 0x9e0: 0x10e1, 0x9e1: 0x10f9, 0x9e2: 0x0f41, 0x9e3: 0x0269, 0x9e4: 0x0fb9, 0x9e5: 0x1089, 0x9e6: 0x1099, 0x9e7: 0x10b1, 0x9e8: 0x1111, 0x9e9: 0x10e1, 0x9ea: 0x10f9, 0x9eb: 0x0008, 0x9ec: 0x0008, 0x9ed: 0x0008, 0x9ee: 0x0008, 0x9ef: 0x0008, 0x9f0: 0x0008, 0x9f1: 0x0008, 0x9f2: 0x0008, 0x9f3: 0x0008, 0x9f4: 0x0008, 0x9f5: 0x0008, 0x9f6: 0x0008, 0x9f7: 0x0008, 0x9f8: 0x1129, 0x9f9: 0x0008, 0x9fa: 0x0008, 0x9fb: 0x0008, 0x9fc: 0x0008, 0x9fd: 0x0008, 0x9fe: 0x0008, 0x9ff: 0x0008, // Block 0x28, offset 0xa00 0xa00: 0x0008, 0xa01: 0x0008, 0xa02: 0x0008, 0xa03: 0x0008, 0xa04: 0x0008, 0xa05: 0x0008, 0xa06: 0x0008, 0xa07: 0x0008, 0xa08: 0x0008, 0xa09: 0x0008, 0xa0a: 0x0008, 0xa0b: 0x0008, 0xa0c: 0x0008, 0xa0d: 0x0008, 0xa0e: 0x0008, 0xa0f: 0x0008, 0xa10: 0x0008, 0xa11: 0x0008, 0xa12: 0x0008, 0xa13: 0x0008, 0xa14: 0x0008, 0xa15: 0x0008, 0xa16: 0x0008, 0xa17: 0x0008, 0xa18: 0x0008, 0xa19: 0x0008, 0xa1a: 0x0008, 0xa1b: 0x1141, 0xa1c: 0x1159, 0xa1d: 0x1169, 0xa1e: 0x1181, 0xa1f: 0x1029, 0xa20: 0x1199, 0xa21: 0x11a9, 0xa22: 0x11c1, 0xa23: 0x11d9, 0xa24: 0x11f1, 0xa25: 0x1209, 0xa26: 0x1221, 0xa27: 0x05e5, 0xa28: 0x1239, 0xa29: 0x1251, 0xa2a: 0xe17d, 0xa2b: 0x1269, 0xa2c: 0x1281, 0xa2d: 0x1299, 0xa2e: 0x12b1, 0xa2f: 0x12c9, 0xa30: 0x12e1, 0xa31: 0x12f9, 0xa32: 0x1311, 0xa33: 0x1329, 0xa34: 0x1341, 0xa35: 0x1359, 0xa36: 0x1371, 0xa37: 0x1389, 0xa38: 0x05fd, 0xa39: 0x13a1, 0xa3a: 0x13b9, 0xa3b: 0x13d1, 0xa3c: 0x13e1, 0xa3d: 0x13f9, 0xa3e: 0x1411, 0xa3f: 0x1429, // Block 0x29, offset 0xa40 0xa40: 0xe00d, 0xa41: 0x0008, 0xa42: 0xe00d, 0xa43: 0x0008, 0xa44: 0xe00d, 0xa45: 0x0008, 0xa46: 0xe00d, 0xa47: 0x0008, 0xa48: 0xe00d, 0xa49: 0x0008, 0xa4a: 0xe00d, 0xa4b: 0x0008, 0xa4c: 0xe00d, 0xa4d: 0x0008, 0xa4e: 0xe00d, 0xa4f: 0x0008, 0xa50: 0xe00d, 0xa51: 0x0008, 0xa52: 0xe00d, 0xa53: 0x0008, 0xa54: 0xe00d, 0xa55: 0x0008, 0xa56: 0xe00d, 0xa57: 0x0008, 0xa58: 0xe00d, 0xa59: 0x0008, 0xa5a: 0xe00d, 0xa5b: 0x0008, 0xa5c: 0xe00d, 0xa5d: 0x0008, 0xa5e: 0xe00d, 0xa5f: 0x0008, 0xa60: 0xe00d, 0xa61: 0x0008, 0xa62: 0xe00d, 0xa63: 0x0008, 0xa64: 0xe00d, 0xa65: 0x0008, 0xa66: 0xe00d, 0xa67: 0x0008, 0xa68: 0xe00d, 0xa69: 0x0008, 0xa6a: 0xe00d, 0xa6b: 0x0008, 0xa6c: 0xe00d, 0xa6d: 0x0008, 0xa6e: 0xe00d, 0xa6f: 0x0008, 0xa70: 0xe00d, 0xa71: 0x0008, 0xa72: 0xe00d, 0xa73: 0x0008, 0xa74: 0xe00d, 0xa75: 0x0008, 0xa76: 0xe00d, 0xa77: 0x0008, 0xa78: 0xe00d, 0xa79: 0x0008, 0xa7a: 0xe00d, 0xa7b: 0x0008, 0xa7c: 0xe00d, 0xa7d: 0x0008, 0xa7e: 0xe00d, 0xa7f: 0x0008, // Block 0x2a, offset 0xa80 0xa80: 0xe00d, 0xa81: 0x0008, 0xa82: 0xe00d, 0xa83: 0x0008, 0xa84: 0xe00d, 0xa85: 0x0008, 0xa86: 0xe00d, 0xa87: 0x0008, 0xa88: 0xe00d, 0xa89: 0x0008, 0xa8a: 0xe00d, 0xa8b: 0x0008, 0xa8c: 0xe00d, 0xa8d: 0x0008, 0xa8e: 0xe00d, 0xa8f: 0x0008, 0xa90: 0xe00d, 0xa91: 0x0008, 0xa92: 0xe00d, 0xa93: 0x0008, 0xa94: 0xe00d, 0xa95: 0x0008, 0xa96: 0x0008, 0xa97: 0x0008, 0xa98: 0x0008, 0xa99: 0x0008, 0xa9a: 0x0615, 0xa9b: 0x0635, 0xa9c: 0x0008, 0xa9d: 0x0008, 0xa9e: 0x1441, 0xa9f: 0x0008, 0xaa0: 0xe00d, 0xaa1: 0x0008, 0xaa2: 0xe00d, 0xaa3: 0x0008, 0xaa4: 0xe00d, 0xaa5: 0x0008, 0xaa6: 0xe00d, 0xaa7: 0x0008, 0xaa8: 0xe00d, 0xaa9: 0x0008, 0xaaa: 0xe00d, 0xaab: 0x0008, 0xaac: 0xe00d, 0xaad: 0x0008, 0xaae: 0xe00d, 0xaaf: 0x0008, 0xab0: 0xe00d, 0xab1: 0x0008, 0xab2: 0xe00d, 0xab3: 0x0008, 0xab4: 0xe00d, 0xab5: 0x0008, 0xab6: 0xe00d, 0xab7: 0x0008, 0xab8: 0xe00d, 0xab9: 0x0008, 0xaba: 0xe00d, 0xabb: 0x0008, 0xabc: 0xe00d, 0xabd: 0x0008, 0xabe: 0xe00d, 0xabf: 0x0008, // Block 0x2b, offset 0xac0 0xac0: 0x0008, 0xac1: 0x0008, 0xac2: 0x0008, 0xac3: 0x0008, 0xac4: 0x0008, 0xac5: 0x0008, 0xac6: 0x0040, 0xac7: 0x0040, 0xac8: 0xe045, 0xac9: 0xe045, 0xaca: 0xe045, 0xacb: 0xe045, 0xacc: 0xe045, 0xacd: 0xe045, 0xace: 0x0040, 0xacf: 0x0040, 0xad0: 0x0008, 0xad1: 0x0008, 0xad2: 0x0008, 0xad3: 0x0008, 0xad4: 0x0008, 0xad5: 0x0008, 0xad6: 0x0008, 0xad7: 0x0008, 0xad8: 0x0040, 0xad9: 0xe045, 0xada: 0x0040, 0xadb: 0xe045, 0xadc: 0x0040, 0xadd: 0xe045, 0xade: 0x0040, 0xadf: 0xe045, 0xae0: 0x0008, 0xae1: 0x0008, 0xae2: 0x0008, 0xae3: 0x0008, 0xae4: 0x0008, 0xae5: 0x0008, 0xae6: 0x0008, 0xae7: 0x0008, 0xae8: 0xe045, 0xae9: 0xe045, 0xaea: 0xe045, 0xaeb: 0xe045, 0xaec: 0xe045, 0xaed: 0xe045, 0xaee: 0xe045, 0xaef: 0xe045, 0xaf0: 0x0008, 0xaf1: 0x1459, 0xaf2: 0x0008, 0xaf3: 0x1471, 0xaf4: 0x0008, 0xaf5: 0x1489, 0xaf6: 0x0008, 0xaf7: 0x14a1, 0xaf8: 0x0008, 0xaf9: 0x14b9, 0xafa: 0x0008, 0xafb: 0x14d1, 0xafc: 0x0008, 0xafd: 0x14e9, 0xafe: 0x0040, 0xaff: 0x0040, // Block 0x2c, offset 0xb00 0xb00: 0x1501, 0xb01: 0x1531, 0xb02: 0x1561, 0xb03: 0x1591, 0xb04: 0x15c1, 0xb05: 0x15f1, 0xb06: 0x1621, 0xb07: 0x1651, 0xb08: 0x1501, 0xb09: 0x1531, 0xb0a: 0x1561, 0xb0b: 0x1591, 0xb0c: 0x15c1, 0xb0d: 0x15f1, 0xb0e: 0x1621, 0xb0f: 0x1651, 0xb10: 0x1681, 0xb11: 0x16b1, 0xb12: 0x16e1, 0xb13: 0x1711, 0xb14: 0x1741, 0xb15: 0x1771, 0xb16: 0x17a1, 0xb17: 0x17d1, 0xb18: 0x1681, 0xb19: 0x16b1, 0xb1a: 0x16e1, 0xb1b: 0x1711, 0xb1c: 0x1741, 0xb1d: 0x1771, 0xb1e: 0x17a1, 0xb1f: 0x17d1, 0xb20: 0x1801, 0xb21: 0x1831, 0xb22: 0x1861, 0xb23: 0x1891, 0xb24: 0x18c1, 0xb25: 0x18f1, 0xb26: 0x1921, 0xb27: 0x1951, 0xb28: 0x1801, 0xb29: 0x1831, 0xb2a: 0x1861, 0xb2b: 0x1891, 0xb2c: 0x18c1, 0xb2d: 0x18f1, 0xb2e: 0x1921, 0xb2f: 0x1951, 0xb30: 0x0008, 0xb31: 0x0008, 0xb32: 0x1981, 0xb33: 0x19b1, 0xb34: 0x19d9, 0xb35: 0x0040, 0xb36: 0x0008, 0xb37: 0x1a01, 0xb38: 0xe045, 0xb39: 0xe045, 0xb3a: 0x064d, 0xb3b: 0x1459, 0xb3c: 0x19b1, 0xb3d: 0x0666, 0xb3e: 0x1a31, 0xb3f: 0x0686, // Block 0x2d, offset 0xb40 0xb40: 0x06a6, 0xb41: 0x1a4a, 0xb42: 0x1a79, 0xb43: 0x1aa9, 0xb44: 0x1ad1, 0xb45: 0x0040, 0xb46: 0x0008, 0xb47: 0x1af9, 0xb48: 0x06c5, 0xb49: 0x1471, 0xb4a: 0x06dd, 0xb4b: 0x1489, 0xb4c: 0x1aa9, 0xb4d: 0x1b2a, 0xb4e: 0x1b5a, 0xb4f: 0x1b8a, 0xb50: 0x0008, 0xb51: 0x0008, 0xb52: 0x0008, 0xb53: 0x1bb9, 0xb54: 0x0040, 0xb55: 0x0040, 0xb56: 0x0008, 0xb57: 0x0008, 0xb58: 0xe045, 0xb59: 0xe045, 0xb5a: 0x06f5, 0xb5b: 0x14a1, 0xb5c: 0x0040, 0xb5d: 0x1bd2, 0xb5e: 0x1c02, 0xb5f: 0x1c32, 0xb60: 0x0008, 0xb61: 0x0008, 0xb62: 0x0008, 0xb63: 0x1c61, 0xb64: 0x0008, 0xb65: 0x0008, 0xb66: 0x0008, 0xb67: 0x0008, 0xb68: 0xe045, 0xb69: 0xe045, 0xb6a: 0x070d, 0xb6b: 0x14d1, 0xb6c: 0xe04d, 0xb6d: 0x1c7a, 0xb6e: 0x03d2, 0xb6f: 0x1caa, 0xb70: 0x0040, 0xb71: 0x0040, 0xb72: 0x1cb9, 0xb73: 0x1ce9, 0xb74: 0x1d11, 0xb75: 0x0040, 0xb76: 0x0008, 0xb77: 0x1d39, 0xb78: 0x0725, 0xb79: 0x14b9, 0xb7a: 0x0515, 0xb7b: 0x14e9, 0xb7c: 0x1ce9, 0xb7d: 0x073e, 0xb7e: 0x075e, 0xb7f: 0x0040, // Block 0x2e, offset 0xb80 0xb80: 0x000a, 0xb81: 0x000a, 0xb82: 0x000a, 0xb83: 0x000a, 0xb84: 0x000a, 0xb85: 0x000a, 0xb86: 0x000a, 0xb87: 0x000a, 0xb88: 0x000a, 0xb89: 0x000a, 0xb8a: 0x000a, 0xb8b: 0x03c0, 0xb8c: 0x0003, 0xb8d: 0x0003, 0xb8e: 0x0340, 0xb8f: 0x0b40, 0xb90: 0x0018, 0xb91: 0xe00d, 0xb92: 0x0018, 0xb93: 0x0018, 0xb94: 0x0018, 0xb95: 0x0018, 0xb96: 0x0018, 0xb97: 0x077e, 0xb98: 0x0018, 0xb99: 0x0018, 0xb9a: 0x0018, 0xb9b: 0x0018, 0xb9c: 0x0018, 0xb9d: 0x0018, 0xb9e: 0x0018, 0xb9f: 0x0018, 0xba0: 0x0018, 0xba1: 0x0018, 0xba2: 0x0018, 0xba3: 0x0018, 0xba4: 0x0040, 0xba5: 0x0040, 0xba6: 0x0040, 0xba7: 0x0018, 0xba8: 0x0040, 0xba9: 0x0040, 0xbaa: 0x0340, 0xbab: 0x0340, 0xbac: 0x0340, 0xbad: 0x0340, 0xbae: 0x0340, 0xbaf: 0x000a, 0xbb0: 0x0018, 0xbb1: 0x0018, 0xbb2: 0x0018, 0xbb3: 0x1d69, 0xbb4: 0x1da1, 0xbb5: 0x0018, 0xbb6: 0x1df1, 0xbb7: 0x1e29, 0xbb8: 0x0018, 0xbb9: 0x0018, 0xbba: 0x0018, 0xbbb: 0x0018, 0xbbc: 0x1e7a, 0xbbd: 0x0018, 0xbbe: 0x079e, 0xbbf: 0x0018, // Block 0x2f, offset 0xbc0 0xbc0: 0x0018, 0xbc1: 0x0018, 0xbc2: 0x0018, 0xbc3: 0x0018, 0xbc4: 0x0018, 0xbc5: 0x0018, 0xbc6: 0x0018, 0xbc7: 0x1e92, 0xbc8: 0x1eaa, 0xbc9: 0x1ec2, 0xbca: 0x0018, 0xbcb: 0x0018, 0xbcc: 0x0018, 0xbcd: 0x0018, 0xbce: 0x0018, 0xbcf: 0x0018, 0xbd0: 0x0018, 0xbd1: 0x0018, 0xbd2: 0x0018, 0xbd3: 0x0018, 0xbd4: 0x0018, 0xbd5: 0x0018, 0xbd6: 0x0018, 0xbd7: 0x1ed9, 0xbd8: 0x0018, 0xbd9: 0x0018, 0xbda: 0x0018, 0xbdb: 0x0018, 0xbdc: 0x0018, 0xbdd: 0x0018, 0xbde: 0x0018, 0xbdf: 0x000a, 0xbe0: 0x03c0, 0xbe1: 0x0340, 0xbe2: 0x0340, 0xbe3: 0x0340, 0xbe4: 0x03c0, 0xbe5: 0x0040, 0xbe6: 0x0040, 0xbe7: 0x0040, 0xbe8: 0x0040, 0xbe9: 0x0040, 0xbea: 0x0340, 0xbeb: 0x0340, 0xbec: 0x0340, 0xbed: 0x0340, 0xbee: 0x0340, 0xbef: 0x0340, 0xbf0: 0x1f41, 0xbf1: 0x0f41, 0xbf2: 0x0040, 0xbf3: 0x0040, 0xbf4: 0x1f51, 0xbf5: 0x1f61, 0xbf6: 0x1f71, 0xbf7: 0x1f81, 0xbf8: 0x1f91, 0xbf9: 0x1fa1, 0xbfa: 0x1fb2, 0xbfb: 0x07bd, 0xbfc: 0x1fc2, 0xbfd: 0x1fd2, 0xbfe: 0x1fe2, 0xbff: 0x0f71, // Block 0x30, offset 0xc00 0xc00: 0x1f41, 0xc01: 0x00c9, 0xc02: 0x0069, 0xc03: 0x0079, 0xc04: 0x1f51, 0xc05: 0x1f61, 0xc06: 0x1f71, 0xc07: 0x1f81, 0xc08: 0x1f91, 0xc09: 0x1fa1, 0xc0a: 0x1fb2, 0xc0b: 0x07d5, 0xc0c: 0x1fc2, 0xc0d: 0x1fd2, 0xc0e: 0x1fe2, 0xc0f: 0x0040, 0xc10: 0x0039, 0xc11: 0x0f09, 0xc12: 0x00d9, 0xc13: 0x0369, 0xc14: 0x0ff9, 0xc15: 0x0249, 0xc16: 0x0f51, 0xc17: 0x0359, 0xc18: 0x0f61, 0xc19: 0x0f71, 0xc1a: 0x0f99, 0xc1b: 0x01d9, 0xc1c: 0x0fa9, 0xc1d: 0x0040, 0xc1e: 0x0040, 0xc1f: 0x0040, 0xc20: 0x0018, 0xc21: 0x0018, 0xc22: 0x0018, 0xc23: 0x0018, 0xc24: 0x0018, 0xc25: 0x0018, 0xc26: 0x0018, 0xc27: 0x0018, 0xc28: 0x1ff1, 0xc29: 0x0018, 0xc2a: 0x0018, 0xc2b: 0x0018, 0xc2c: 0x0018, 0xc2d: 0x0018, 0xc2e: 0x0018, 0xc2f: 0x0018, 0xc30: 0x0018, 0xc31: 0x0018, 0xc32: 0x0018, 0xc33: 0x0018, 0xc34: 0x0018, 0xc35: 0x0018, 0xc36: 0x0018, 0xc37: 0x0018, 0xc38: 0x0018, 0xc39: 0x0018, 0xc3a: 0x0018, 0xc3b: 0x0018, 0xc3c: 0x0018, 0xc3d: 0x0018, 0xc3e: 0x0018, 0xc3f: 0x0040, // Block 0x31, offset 0xc40 0xc40: 0x07ee, 0xc41: 0x080e, 0xc42: 0x1159, 0xc43: 0x082d, 0xc44: 0x0018, 0xc45: 0x084e, 0xc46: 0x086e, 0xc47: 0x1011, 0xc48: 0x0018, 0xc49: 0x088d, 0xc4a: 0x0f31, 0xc4b: 0x0249, 0xc4c: 0x0249, 0xc4d: 0x0249, 0xc4e: 0x0249, 0xc4f: 0x2009, 0xc50: 0x0f41, 0xc51: 0x0f41, 0xc52: 0x0359, 0xc53: 0x0359, 0xc54: 0x0018, 0xc55: 0x0f71, 0xc56: 0x2021, 0xc57: 0x0018, 0xc58: 0x0018, 0xc59: 0x0f99, 0xc5a: 0x2039, 0xc5b: 0x0269, 0xc5c: 0x0269, 0xc5d: 0x0269, 0xc5e: 0x0018, 0xc5f: 0x0018, 0xc60: 0x2049, 0xc61: 0x08ad, 0xc62: 0x2061, 0xc63: 0x0018, 0xc64: 0x13d1, 0xc65: 0x0018, 0xc66: 0x2079, 0xc67: 0x0018, 0xc68: 0x13d1, 0xc69: 0x0018, 0xc6a: 0x0f51, 0xc6b: 0x2091, 0xc6c: 0x0ee9, 0xc6d: 0x1159, 0xc6e: 0x0018, 0xc6f: 0x0f09, 0xc70: 0x0f09, 0xc71: 0x1199, 0xc72: 0x0040, 0xc73: 0x0f61, 0xc74: 0x00d9, 0xc75: 0x20a9, 0xc76: 0x20c1, 0xc77: 0x20d9, 0xc78: 0x20f1, 0xc79: 0x0f41, 0xc7a: 0x0018, 0xc7b: 0x08cd, 0xc7c: 0x2109, 0xc7d: 0x10b1, 0xc7e: 0x10b1, 0xc7f: 0x2109, // Block 0x32, offset 0xc80 0xc80: 0x08ed, 0xc81: 0x0018, 0xc82: 0x0018, 0xc83: 0x0018, 0xc84: 0x0018, 0xc85: 0x0ef9, 0xc86: 0x0ef9, 0xc87: 0x0f09, 0xc88: 0x0f41, 0xc89: 0x0259, 0xc8a: 0x0018, 0xc8b: 0x0018, 0xc8c: 0x0018, 0xc8d: 0x0018, 0xc8e: 0x0008, 0xc8f: 0x0018, 0xc90: 0x2121, 0xc91: 0x2151, 0xc92: 0x2181, 0xc93: 0x21b9, 0xc94: 0x21e9, 0xc95: 0x2219, 0xc96: 0x2249, 0xc97: 0x2279, 0xc98: 0x22a9, 0xc99: 0x22d9, 0xc9a: 0x2309, 0xc9b: 0x2339, 0xc9c: 0x2369, 0xc9d: 0x2399, 0xc9e: 0x23c9, 0xc9f: 0x23f9, 0xca0: 0x0f41, 0xca1: 0x2421, 0xca2: 0x0905, 0xca3: 0x2439, 0xca4: 0x1089, 0xca5: 0x2451, 0xca6: 0x0925, 0xca7: 0x2469, 0xca8: 0x2491, 0xca9: 0x0369, 0xcaa: 0x24a9, 0xcab: 0x0945, 0xcac: 0x0359, 0xcad: 0x1159, 0xcae: 0x0ef9, 0xcaf: 0x0f61, 0xcb0: 0x0f41, 0xcb1: 0x2421, 0xcb2: 0x0965, 0xcb3: 0x2439, 0xcb4: 0x1089, 0xcb5: 0x2451, 0xcb6: 0x0985, 0xcb7: 0x2469, 0xcb8: 0x2491, 0xcb9: 0x0369, 0xcba: 0x24a9, 0xcbb: 0x09a5, 0xcbc: 0x0359, 0xcbd: 0x1159, 0xcbe: 0x0ef9, 0xcbf: 0x0f61, // Block 0x33, offset 0xcc0 0xcc0: 0x0018, 0xcc1: 0x0018, 0xcc2: 0x0018, 0xcc3: 0x0018, 0xcc4: 0x0018, 0xcc5: 0x0018, 0xcc6: 0x0018, 0xcc7: 0x0018, 0xcc8: 0x0018, 0xcc9: 0x0018, 0xcca: 0x0018, 0xccb: 0x0040, 0xccc: 0x0040, 0xccd: 0x0040, 0xcce: 0x0040, 0xccf: 0x0040, 0xcd0: 0x0040, 0xcd1: 0x0040, 0xcd2: 0x0040, 0xcd3: 0x0040, 0xcd4: 0x0040, 0xcd5: 0x0040, 0xcd6: 0x0040, 0xcd7: 0x0040, 0xcd8: 0x0040, 0xcd9: 0x0040, 0xcda: 0x0040, 0xcdb: 0x0040, 0xcdc: 0x0040, 0xcdd: 0x0040, 0xcde: 0x0040, 0xcdf: 0x0040, 0xce0: 0x00c9, 0xce1: 0x0069, 0xce2: 0x0079, 0xce3: 0x1f51, 0xce4: 0x1f61, 0xce5: 0x1f71, 0xce6: 0x1f81, 0xce7: 0x1f91, 0xce8: 0x1fa1, 0xce9: 0x2601, 0xcea: 0x2619, 0xceb: 0x2631, 0xcec: 0x2649, 0xced: 0x2661, 0xcee: 0x2679, 0xcef: 0x2691, 0xcf0: 0x26a9, 0xcf1: 0x26c1, 0xcf2: 0x26d9, 0xcf3: 0x26f1, 0xcf4: 0x0a06, 0xcf5: 0x0a26, 0xcf6: 0x0a46, 0xcf7: 0x0a66, 0xcf8: 0x0a86, 0xcf9: 0x0aa6, 0xcfa: 0x0ac6, 0xcfb: 0x0ae6, 0xcfc: 0x0b06, 0xcfd: 0x270a, 0xcfe: 0x2732, 0xcff: 0x275a, // Block 0x34, offset 0xd00 0xd00: 0x2782, 0xd01: 0x27aa, 0xd02: 0x27d2, 0xd03: 0x27fa, 0xd04: 0x2822, 0xd05: 0x284a, 0xd06: 0x2872, 0xd07: 0x289a, 0xd08: 0x0040, 0xd09: 0x0040, 0xd0a: 0x0040, 0xd0b: 0x0040, 0xd0c: 0x0040, 0xd0d: 0x0040, 0xd0e: 0x0040, 0xd0f: 0x0040, 0xd10: 0x0040, 0xd11: 0x0040, 0xd12: 0x0040, 0xd13: 0x0040, 0xd14: 0x0040, 0xd15: 0x0040, 0xd16: 0x0040, 0xd17: 0x0040, 0xd18: 0x0040, 0xd19: 0x0040, 0xd1a: 0x0040, 0xd1b: 0x0040, 0xd1c: 0x0b26, 0xd1d: 0x0b46, 0xd1e: 0x0b66, 0xd1f: 0x0b86, 0xd20: 0x0ba6, 0xd21: 0x0bc6, 0xd22: 0x0be6, 0xd23: 0x0c06, 0xd24: 0x0c26, 0xd25: 0x0c46, 0xd26: 0x0c66, 0xd27: 0x0c86, 0xd28: 0x0ca6, 0xd29: 0x0cc6, 0xd2a: 0x0ce6, 0xd2b: 0x0d06, 0xd2c: 0x0d26, 0xd2d: 0x0d46, 0xd2e: 0x0d66, 0xd2f: 0x0d86, 0xd30: 0x0da6, 0xd31: 0x0dc6, 0xd32: 0x0de6, 0xd33: 0x0e06, 0xd34: 0x0e26, 0xd35: 0x0e46, 0xd36: 0x0039, 0xd37: 0x0ee9, 0xd38: 0x1159, 0xd39: 0x0ef9, 0xd3a: 0x0f09, 0xd3b: 0x1199, 0xd3c: 0x0f31, 0xd3d: 0x0249, 0xd3e: 0x0f41, 0xd3f: 0x0259, // Block 0x35, offset 0xd40 0xd40: 0x0f51, 0xd41: 0x0359, 0xd42: 0x0f61, 0xd43: 0x0f71, 0xd44: 0x00d9, 0xd45: 0x0f99, 0xd46: 0x2039, 0xd47: 0x0269, 0xd48: 0x01d9, 0xd49: 0x0fa9, 0xd4a: 0x0fb9, 0xd4b: 0x1089, 0xd4c: 0x0279, 0xd4d: 0x0369, 0xd4e: 0x0289, 0xd4f: 0x13d1, 0xd50: 0x0039, 0xd51: 0x0ee9, 0xd52: 0x1159, 0xd53: 0x0ef9, 0xd54: 0x0f09, 0xd55: 0x1199, 0xd56: 0x0f31, 0xd57: 0x0249, 0xd58: 0x0f41, 0xd59: 0x0259, 0xd5a: 0x0f51, 0xd5b: 0x0359, 0xd5c: 0x0f61, 0xd5d: 0x0f71, 0xd5e: 0x00d9, 0xd5f: 0x0f99, 0xd60: 0x2039, 0xd61: 0x0269, 0xd62: 0x01d9, 0xd63: 0x0fa9, 0xd64: 0x0fb9, 0xd65: 0x1089, 0xd66: 0x0279, 0xd67: 0x0369, 0xd68: 0x0289, 0xd69: 0x13d1, 0xd6a: 0x1f41, 0xd6b: 0x0018, 0xd6c: 0x0018, 0xd6d: 0x0018, 0xd6e: 0x0018, 0xd6f: 0x0018, 0xd70: 0x0018, 0xd71: 0x0018, 0xd72: 0x0018, 0xd73: 0x0018, 0xd74: 0x0018, 0xd75: 0x0018, 0xd76: 0x0018, 0xd77: 0x0018, 0xd78: 0x0018, 0xd79: 0x0018, 0xd7a: 0x0018, 0xd7b: 0x0018, 0xd7c: 0x0018, 0xd7d: 0x0018, 0xd7e: 0x0018, 0xd7f: 0x0018, // Block 0x36, offset 0xd80 0xd80: 0x0008, 0xd81: 0x0008, 0xd82: 0x0008, 0xd83: 0x0008, 0xd84: 0x0008, 0xd85: 0x0008, 0xd86: 0x0008, 0xd87: 0x0008, 0xd88: 0x0008, 0xd89: 0x0008, 0xd8a: 0x0008, 0xd8b: 0x0008, 0xd8c: 0x0008, 0xd8d: 0x0008, 0xd8e: 0x0008, 0xd8f: 0x0008, 0xd90: 0x0008, 0xd91: 0x0008, 0xd92: 0x0008, 0xd93: 0x0008, 0xd94: 0x0008, 0xd95: 0x0008, 0xd96: 0x0008, 0xd97: 0x0008, 0xd98: 0x0008, 0xd99: 0x0008, 0xd9a: 0x0008, 0xd9b: 0x0008, 0xd9c: 0x0008, 0xd9d: 0x0008, 0xd9e: 0x0008, 0xd9f: 0x0040, 0xda0: 0xe00d, 0xda1: 0x0008, 0xda2: 0x2971, 0xda3: 0x0ebd, 0xda4: 0x2989, 0xda5: 0x0008, 0xda6: 0x0008, 0xda7: 0xe07d, 0xda8: 0x0008, 0xda9: 0xe01d, 0xdaa: 0x0008, 0xdab: 0xe03d, 0xdac: 0x0008, 0xdad: 0x0fe1, 0xdae: 0x1281, 0xdaf: 0x0fc9, 0xdb0: 0x1141, 0xdb1: 0x0008, 0xdb2: 0xe00d, 0xdb3: 0x0008, 0xdb4: 0x0008, 0xdb5: 0xe01d, 0xdb6: 0x0008, 0xdb7: 0x0008, 0xdb8: 0x0008, 0xdb9: 0x0008, 0xdba: 0x0008, 0xdbb: 0x0008, 0xdbc: 0x0259, 0xdbd: 0x1089, 0xdbe: 0x29a1, 0xdbf: 0x29b9, // Block 0x37, offset 0xdc0 0xdc0: 0xe00d, 0xdc1: 0x0008, 0xdc2: 0xe00d, 0xdc3: 0x0008, 0xdc4: 0xe00d, 0xdc5: 0x0008, 0xdc6: 0xe00d, 0xdc7: 0x0008, 0xdc8: 0xe00d, 0xdc9: 0x0008, 0xdca: 0xe00d, 0xdcb: 0x0008, 0xdcc: 0xe00d, 0xdcd: 0x0008, 0xdce: 0xe00d, 0xdcf: 0x0008, 0xdd0: 0xe00d, 0xdd1: 0x0008, 0xdd2: 0xe00d, 0xdd3: 0x0008, 0xdd4: 0xe00d, 0xdd5: 0x0008, 0xdd6: 0xe00d, 0xdd7: 0x0008, 0xdd8: 0xe00d, 0xdd9: 0x0008, 0xdda: 0xe00d, 0xddb: 0x0008, 0xddc: 0xe00d, 0xddd: 0x0008, 0xdde: 0xe00d, 0xddf: 0x0008, 0xde0: 0xe00d, 0xde1: 0x0008, 0xde2: 0xe00d, 0xde3: 0x0008, 0xde4: 0x0008, 0xde5: 0x0018, 0xde6: 0x0018, 0xde7: 0x0018, 0xde8: 0x0018, 0xde9: 0x0018, 0xdea: 0x0018, 0xdeb: 0xe03d, 0xdec: 0x0008, 0xded: 0xe01d, 0xdee: 0x0008, 0xdef: 0x3308, 0xdf0: 0x3308, 0xdf1: 0x3308, 0xdf2: 0xe00d, 0xdf3: 0x0008, 0xdf4: 0x0040, 0xdf5: 0x0040, 0xdf6: 0x0040, 0xdf7: 0x0040, 0xdf8: 0x0040, 0xdf9: 0x0018, 0xdfa: 0x0018, 0xdfb: 0x0018, 0xdfc: 0x0018, 0xdfd: 0x0018, 0xdfe: 0x0018, 0xdff: 0x0018, // Block 0x38, offset 0xe00 0xe00: 0x26fd, 0xe01: 0x271d, 0xe02: 0x273d, 0xe03: 0x275d, 0xe04: 0x277d, 0xe05: 0x279d, 0xe06: 0x27bd, 0xe07: 0x27dd, 0xe08: 0x27fd, 0xe09: 0x281d, 0xe0a: 0x283d, 0xe0b: 0x285d, 0xe0c: 0x287d, 0xe0d: 0x289d, 0xe0e: 0x28bd, 0xe0f: 0x28dd, 0xe10: 0x28fd, 0xe11: 0x291d, 0xe12: 0x293d, 0xe13: 0x295d, 0xe14: 0x297d, 0xe15: 0x299d, 0xe16: 0x0040, 0xe17: 0x0040, 0xe18: 0x0040, 0xe19: 0x0040, 0xe1a: 0x0040, 0xe1b: 0x0040, 0xe1c: 0x0040, 0xe1d: 0x0040, 0xe1e: 0x0040, 0xe1f: 0x0040, 0xe20: 0x0040, 0xe21: 0x0040, 0xe22: 0x0040, 0xe23: 0x0040, 0xe24: 0x0040, 0xe25: 0x0040, 0xe26: 0x0040, 0xe27: 0x0040, 0xe28: 0x0040, 0xe29: 0x0040, 0xe2a: 0x0040, 0xe2b: 0x0040, 0xe2c: 0x0040, 0xe2d: 0x0040, 0xe2e: 0x0040, 0xe2f: 0x0040, 0xe30: 0x0040, 0xe31: 0x0040, 0xe32: 0x0040, 0xe33: 0x0040, 0xe34: 0x0040, 0xe35: 0x0040, 0xe36: 0x0040, 0xe37: 0x0040, 0xe38: 0x0040, 0xe39: 0x0040, 0xe3a: 0x0040, 0xe3b: 0x0040, 0xe3c: 0x0040, 0xe3d: 0x0040, 0xe3e: 0x0040, 0xe3f: 0x0040, // Block 0x39, offset 0xe40 0xe40: 0x000a, 0xe41: 0x0018, 0xe42: 0x29d1, 0xe43: 0x0018, 0xe44: 0x0018, 0xe45: 0x0008, 0xe46: 0x0008, 0xe47: 0x0008, 0xe48: 0x0018, 0xe49: 0x0018, 0xe4a: 0x0018, 0xe4b: 0x0018, 0xe4c: 0x0018, 0xe4d: 0x0018, 0xe4e: 0x0018, 0xe4f: 0x0018, 0xe50: 0x0018, 0xe51: 0x0018, 0xe52: 0x0018, 0xe53: 0x0018, 0xe54: 0x0018, 0xe55: 0x0018, 0xe56: 0x0018, 0xe57: 0x0018, 0xe58: 0x0018, 0xe59: 0x0018, 0xe5a: 0x0018, 0xe5b: 0x0018, 0xe5c: 0x0018, 0xe5d: 0x0018, 0xe5e: 0x0018, 0xe5f: 0x0018, 0xe60: 0x0018, 0xe61: 0x0018, 0xe62: 0x0018, 0xe63: 0x0018, 0xe64: 0x0018, 0xe65: 0x0018, 0xe66: 0x0018, 0xe67: 0x0018, 0xe68: 0x0018, 0xe69: 0x0018, 0xe6a: 0x3308, 0xe6b: 0x3308, 0xe6c: 0x3308, 0xe6d: 0x3308, 0xe6e: 0x3018, 0xe6f: 0x3018, 0xe70: 0x0018, 0xe71: 0x0018, 0xe72: 0x0018, 0xe73: 0x0018, 0xe74: 0x0018, 0xe75: 0x0018, 0xe76: 0xe125, 0xe77: 0x0018, 0xe78: 0x29bd, 0xe79: 0x29dd, 0xe7a: 0x29fd, 0xe7b: 0x0018, 0xe7c: 0x0008, 0xe7d: 0x0018, 0xe7e: 0x0018, 0xe7f: 0x0018, // Block 0x3a, offset 0xe80 0xe80: 0x2b3d, 0xe81: 0x2b5d, 0xe82: 0x2b7d, 0xe83: 0x2b9d, 0xe84: 0x2bbd, 0xe85: 0x2bdd, 0xe86: 0x2bdd, 0xe87: 0x2bdd, 0xe88: 0x2bfd, 0xe89: 0x2bfd, 0xe8a: 0x2bfd, 0xe8b: 0x2bfd, 0xe8c: 0x2c1d, 0xe8d: 0x2c1d, 0xe8e: 0x2c1d, 0xe8f: 0x2c3d, 0xe90: 0x2c5d, 0xe91: 0x2c5d, 0xe92: 0x2a7d, 0xe93: 0x2a7d, 0xe94: 0x2c5d, 0xe95: 0x2c5d, 0xe96: 0x2c7d, 0xe97: 0x2c7d, 0xe98: 0x2c5d, 0xe99: 0x2c5d, 0xe9a: 0x2a7d, 0xe9b: 0x2a7d, 0xe9c: 0x2c5d, 0xe9d: 0x2c5d, 0xe9e: 0x2c3d, 0xe9f: 0x2c3d, 0xea0: 0x2c9d, 0xea1: 0x2c9d, 0xea2: 0x2cbd, 0xea3: 0x2cbd, 0xea4: 0x0040, 0xea5: 0x2cdd, 0xea6: 0x2cfd, 0xea7: 0x2d1d, 0xea8: 0x2d1d, 0xea9: 0x2d3d, 0xeaa: 0x2d5d, 0xeab: 0x2d7d, 0xeac: 0x2d9d, 0xead: 0x2dbd, 0xeae: 0x2ddd, 0xeaf: 0x2dfd, 0xeb0: 0x2e1d, 0xeb1: 0x2e3d, 0xeb2: 0x2e3d, 0xeb3: 0x2e5d, 0xeb4: 0x2e7d, 0xeb5: 0x2e7d, 0xeb6: 0x2e9d, 0xeb7: 0x2ebd, 0xeb8: 0x2e5d, 0xeb9: 0x2edd, 0xeba: 0x2efd, 0xebb: 0x2edd, 0xebc: 0x2e5d, 0xebd: 0x2f1d, 0xebe: 0x2f3d, 0xebf: 0x2f5d, // Block 0x3b, offset 0xec0 0xec0: 0x2f7d, 0xec1: 0x2f9d, 0xec2: 0x2cfd, 0xec3: 0x2cdd, 0xec4: 0x2fbd, 0xec5: 0x2fdd, 0xec6: 0x2ffd, 0xec7: 0x301d, 0xec8: 0x303d, 0xec9: 0x305d, 0xeca: 0x307d, 0xecb: 0x309d, 0xecc: 0x30bd, 0xecd: 0x30dd, 0xece: 0x30fd, 0xecf: 0x0040, 0xed0: 0x0018, 0xed1: 0x0018, 0xed2: 0x311d, 0xed3: 0x313d, 0xed4: 0x315d, 0xed5: 0x317d, 0xed6: 0x319d, 0xed7: 0x31bd, 0xed8: 0x31dd, 0xed9: 0x31fd, 0xeda: 0x321d, 0xedb: 0x323d, 0xedc: 0x315d, 0xedd: 0x325d, 0xede: 0x327d, 0xedf: 0x329d, 0xee0: 0x0008, 0xee1: 0x0008, 0xee2: 0x0008, 0xee3: 0x0008, 0xee4: 0x0008, 0xee5: 0x0008, 0xee6: 0x0008, 0xee7: 0x0008, 0xee8: 0x0008, 0xee9: 0x0008, 0xeea: 0x0008, 0xeeb: 0x0008, 0xeec: 0x0008, 0xeed: 0x0008, 0xeee: 0x0008, 0xeef: 0x0008, 0xef0: 0x0008, 0xef1: 0x0008, 0xef2: 0x0008, 0xef3: 0x0008, 0xef4: 0x0008, 0xef5: 0x0008, 0xef6: 0x0008, 0xef7: 0x0008, 0xef8: 0x0008, 0xef9: 0x0008, 0xefa: 0x0008, 0xefb: 0x0040, 0xefc: 0x0040, 0xefd: 0x0040, 0xefe: 0x0040, 0xeff: 0x0040, // Block 0x3c, offset 0xf00 0xf00: 0x36a2, 0xf01: 0x36d2, 0xf02: 0x3702, 0xf03: 0x3732, 0xf04: 0x32bd, 0xf05: 0x32dd, 0xf06: 0x32fd, 0xf07: 0x331d, 0xf08: 0x0018, 0xf09: 0x0018, 0xf0a: 0x0018, 0xf0b: 0x0018, 0xf0c: 0x0018, 0xf0d: 0x0018, 0xf0e: 0x0018, 0xf0f: 0x0018, 0xf10: 0x333d, 0xf11: 0x3761, 0xf12: 0x3779, 0xf13: 0x3791, 0xf14: 0x37a9, 0xf15: 0x37c1, 0xf16: 0x37d9, 0xf17: 0x37f1, 0xf18: 0x3809, 0xf19: 0x3821, 0xf1a: 0x3839, 0xf1b: 0x3851, 0xf1c: 0x3869, 0xf1d: 0x3881, 0xf1e: 0x3899, 0xf1f: 0x38b1, 0xf20: 0x335d, 0xf21: 0x337d, 0xf22: 0x339d, 0xf23: 0x33bd, 0xf24: 0x33dd, 0xf25: 0x33dd, 0xf26: 0x33fd, 0xf27: 0x341d, 0xf28: 0x343d, 0xf29: 0x345d, 0xf2a: 0x347d, 0xf2b: 0x349d, 0xf2c: 0x34bd, 0xf2d: 0x34dd, 0xf2e: 0x34fd, 0xf2f: 0x351d, 0xf30: 0x353d, 0xf31: 0x355d, 0xf32: 0x357d, 0xf33: 0x359d, 0xf34: 0x35bd, 0xf35: 0x35dd, 0xf36: 0x35fd, 0xf37: 0x361d, 0xf38: 0x363d, 0xf39: 0x365d, 0xf3a: 0x367d, 0xf3b: 0x369d, 0xf3c: 0x38c9, 0xf3d: 0x3901, 0xf3e: 0x36bd, 0xf3f: 0x0018, // Block 0x3d, offset 0xf40 0xf40: 0x36dd, 0xf41: 0x36fd, 0xf42: 0x371d, 0xf43: 0x373d, 0xf44: 0x375d, 0xf45: 0x377d, 0xf46: 0x379d, 0xf47: 0x37bd, 0xf48: 0x37dd, 0xf49: 0x37fd, 0xf4a: 0x381d, 0xf4b: 0x383d, 0xf4c: 0x385d, 0xf4d: 0x387d, 0xf4e: 0x389d, 0xf4f: 0x38bd, 0xf50: 0x38dd, 0xf51: 0x38fd, 0xf52: 0x391d, 0xf53: 0x393d, 0xf54: 0x395d, 0xf55: 0x397d, 0xf56: 0x399d, 0xf57: 0x39bd, 0xf58: 0x39dd, 0xf59: 0x39fd, 0xf5a: 0x3a1d, 0xf5b: 0x3a3d, 0xf5c: 0x3a5d, 0xf5d: 0x3a7d, 0xf5e: 0x3a9d, 0xf5f: 0x3abd, 0xf60: 0x3add, 0xf61: 0x3afd, 0xf62: 0x3b1d, 0xf63: 0x3b3d, 0xf64: 0x3b5d, 0xf65: 0x3b7d, 0xf66: 0x127d, 0xf67: 0x3b9d, 0xf68: 0x3bbd, 0xf69: 0x3bdd, 0xf6a: 0x3bfd, 0xf6b: 0x3c1d, 0xf6c: 0x3c3d, 0xf6d: 0x3c5d, 0xf6e: 0x239d, 0xf6f: 0x3c7d, 0xf70: 0x3c9d, 0xf71: 0x3939, 0xf72: 0x3951, 0xf73: 0x3969, 0xf74: 0x3981, 0xf75: 0x3999, 0xf76: 0x39b1, 0xf77: 0x39c9, 0xf78: 0x39e1, 0xf79: 0x39f9, 0xf7a: 0x3a11, 0xf7b: 0x3a29, 0xf7c: 0x3a41, 0xf7d: 0x3a59, 0xf7e: 0x3a71, 0xf7f: 0x3a89, // Block 0x3e, offset 0xf80 0xf80: 0x3aa1, 0xf81: 0x3ac9, 0xf82: 0x3af1, 0xf83: 0x3b19, 0xf84: 0x3b41, 0xf85: 0x3b69, 0xf86: 0x3b91, 0xf87: 0x3bb9, 0xf88: 0x3be1, 0xf89: 0x3c09, 0xf8a: 0x3c39, 0xf8b: 0x3c69, 0xf8c: 0x3c99, 0xf8d: 0x3cbd, 0xf8e: 0x3cb1, 0xf8f: 0x3cdd, 0xf90: 0x3cfd, 0xf91: 0x3d15, 0xf92: 0x3d2d, 0xf93: 0x3d45, 0xf94: 0x3d5d, 0xf95: 0x3d5d, 0xf96: 0x3d45, 0xf97: 0x3d75, 0xf98: 0x07bd, 0xf99: 0x3d8d, 0xf9a: 0x3da5, 0xf9b: 0x3dbd, 0xf9c: 0x3dd5, 0xf9d: 0x3ded, 0xf9e: 0x3e05, 0xf9f: 0x3e1d, 0xfa0: 0x3e35, 0xfa1: 0x3e4d, 0xfa2: 0x3e65, 0xfa3: 0x3e7d, 0xfa4: 0x3e95, 0xfa5: 0x3e95, 0xfa6: 0x3ead, 0xfa7: 0x3ead, 0xfa8: 0x3ec5, 0xfa9: 0x3ec5, 0xfaa: 0x3edd, 0xfab: 0x3ef5, 0xfac: 0x3f0d, 0xfad: 0x3f25, 0xfae: 0x3f3d, 0xfaf: 0x3f3d, 0xfb0: 0x3f55, 0xfb1: 0x3f55, 0xfb2: 0x3f55, 0xfb3: 0x3f6d, 0xfb4: 0x3f85, 0xfb5: 0x3f9d, 0xfb6: 0x3fb5, 0xfb7: 0x3f9d, 0xfb8: 0x3fcd, 0xfb9: 0x3fe5, 0xfba: 0x3f6d, 0xfbb: 0x3ffd, 0xfbc: 0x4015, 0xfbd: 0x4015, 0xfbe: 0x4015, 0xfbf: 0x0040, // Block 0x3f, offset 0xfc0 0xfc0: 0x3cc9, 0xfc1: 0x3d31, 0xfc2: 0x3d99, 0xfc3: 0x3e01, 0xfc4: 0x3e51, 0xfc5: 0x3eb9, 0xfc6: 0x3f09, 0xfc7: 0x3f59, 0xfc8: 0x3fd9, 0xfc9: 0x4041, 0xfca: 0x4091, 0xfcb: 0x40e1, 0xfcc: 0x4131, 0xfcd: 0x4199, 0xfce: 0x4201, 0xfcf: 0x4251, 0xfd0: 0x42a1, 0xfd1: 0x42d9, 0xfd2: 0x4329, 0xfd3: 0x4391, 0xfd4: 0x43f9, 0xfd5: 0x4431, 0xfd6: 0x44b1, 0xfd7: 0x4549, 0xfd8: 0x45c9, 0xfd9: 0x4619, 0xfda: 0x4699, 0xfdb: 0x4719, 0xfdc: 0x4781, 0xfdd: 0x47d1, 0xfde: 0x4821, 0xfdf: 0x4871, 0xfe0: 0x48d9, 0xfe1: 0x4959, 0xfe2: 0x49c1, 0xfe3: 0x4a11, 0xfe4: 0x4a61, 0xfe5: 0x4ab1, 0xfe6: 0x4ae9, 0xfe7: 0x4b21, 0xfe8: 0x4b59, 0xfe9: 0x4b91, 0xfea: 0x4be1, 0xfeb: 0x4c31, 0xfec: 0x4cb1, 0xfed: 0x4d01, 0xfee: 0x4d69, 0xfef: 0x4de9, 0xff0: 0x4e39, 0xff1: 0x4e71, 0xff2: 0x4ea9, 0xff3: 0x4f29, 0xff4: 0x4f91, 0xff5: 0x5011, 0xff6: 0x5061, 0xff7: 0x50e1, 0xff8: 0x5119, 0xff9: 0x5169, 0xffa: 0x51b9, 0xffb: 0x5209, 0xffc: 0x5259, 0xffd: 0x52a9, 0xffe: 0x5311, 0xfff: 0x5361, // Block 0x40, offset 0x1000 0x1000: 0x5399, 0x1001: 0x53e9, 0x1002: 0x5439, 0x1003: 0x5489, 0x1004: 0x54f1, 0x1005: 0x5541, 0x1006: 0x5591, 0x1007: 0x55e1, 0x1008: 0x5661, 0x1009: 0x56c9, 0x100a: 0x5701, 0x100b: 0x5781, 0x100c: 0x57b9, 0x100d: 0x5821, 0x100e: 0x5889, 0x100f: 0x58d9, 0x1010: 0x5929, 0x1011: 0x5979, 0x1012: 0x59e1, 0x1013: 0x5a19, 0x1014: 0x5a69, 0x1015: 0x5ad1, 0x1016: 0x5b09, 0x1017: 0x5b89, 0x1018: 0x5bd9, 0x1019: 0x5c01, 0x101a: 0x5c29, 0x101b: 0x5c51, 0x101c: 0x5c79, 0x101d: 0x5ca1, 0x101e: 0x5cc9, 0x101f: 0x5cf1, 0x1020: 0x5d19, 0x1021: 0x5d41, 0x1022: 0x5d69, 0x1023: 0x5d99, 0x1024: 0x5dc9, 0x1025: 0x5df9, 0x1026: 0x5e29, 0x1027: 0x5e59, 0x1028: 0x5e89, 0x1029: 0x5eb9, 0x102a: 0x5ee9, 0x102b: 0x5f19, 0x102c: 0x5f49, 0x102d: 0x5f79, 0x102e: 0x5fa9, 0x102f: 0x5fd9, 0x1030: 0x6009, 0x1031: 0x402d, 0x1032: 0x6039, 0x1033: 0x6051, 0x1034: 0x404d, 0x1035: 0x6069, 0x1036: 0x6081, 0x1037: 0x6099, 0x1038: 0x406d, 0x1039: 0x406d, 0x103a: 0x60b1, 0x103b: 0x60c9, 0x103c: 0x6101, 0x103d: 0x6139, 0x103e: 0x6171, 0x103f: 0x61a9, // Block 0x41, offset 0x1040 0x1040: 0x6211, 0x1041: 0x6229, 0x1042: 0x408d, 0x1043: 0x6241, 0x1044: 0x6259, 0x1045: 0x6271, 0x1046: 0x6289, 0x1047: 0x62a1, 0x1048: 0x40ad, 0x1049: 0x62b9, 0x104a: 0x62e1, 0x104b: 0x62f9, 0x104c: 0x40cd, 0x104d: 0x40cd, 0x104e: 0x6311, 0x104f: 0x6329, 0x1050: 0x6341, 0x1051: 0x40ed, 0x1052: 0x410d, 0x1053: 0x412d, 0x1054: 0x414d, 0x1055: 0x416d, 0x1056: 0x6359, 0x1057: 0x6371, 0x1058: 0x6389, 0x1059: 0x63a1, 0x105a: 0x63b9, 0x105b: 0x418d, 0x105c: 0x63d1, 0x105d: 0x63e9, 0x105e: 0x6401, 0x105f: 0x41ad, 0x1060: 0x41cd, 0x1061: 0x6419, 0x1062: 0x41ed, 0x1063: 0x420d, 0x1064: 0x422d, 0x1065: 0x6431, 0x1066: 0x424d, 0x1067: 0x6449, 0x1068: 0x6479, 0x1069: 0x6211, 0x106a: 0x426d, 0x106b: 0x428d, 0x106c: 0x42ad, 0x106d: 0x42cd, 0x106e: 0x64b1, 0x106f: 0x64f1, 0x1070: 0x6539, 0x1071: 0x6551, 0x1072: 0x42ed, 0x1073: 0x6569, 0x1074: 0x6581, 0x1075: 0x6599, 0x1076: 0x430d, 0x1077: 0x65b1, 0x1078: 0x65c9, 0x1079: 0x65b1, 0x107a: 0x65e1, 0x107b: 0x65f9, 0x107c: 0x432d, 0x107d: 0x6611, 0x107e: 0x6629, 0x107f: 0x6611, // Block 0x42, offset 0x1080 0x1080: 0x434d, 0x1081: 0x436d, 0x1082: 0x0040, 0x1083: 0x6641, 0x1084: 0x6659, 0x1085: 0x6671, 0x1086: 0x6689, 0x1087: 0x0040, 0x1088: 0x66c1, 0x1089: 0x66d9, 0x108a: 0x66f1, 0x108b: 0x6709, 0x108c: 0x6721, 0x108d: 0x6739, 0x108e: 0x6401, 0x108f: 0x6751, 0x1090: 0x6769, 0x1091: 0x6781, 0x1092: 0x438d, 0x1093: 0x6799, 0x1094: 0x6289, 0x1095: 0x43ad, 0x1096: 0x43cd, 0x1097: 0x67b1, 0x1098: 0x0040, 0x1099: 0x43ed, 0x109a: 0x67c9, 0x109b: 0x67e1, 0x109c: 0x67f9, 0x109d: 0x6811, 0x109e: 0x6829, 0x109f: 0x6859, 0x10a0: 0x6889, 0x10a1: 0x68b1, 0x10a2: 0x68d9, 0x10a3: 0x6901, 0x10a4: 0x6929, 0x10a5: 0x6951, 0x10a6: 0x6979, 0x10a7: 0x69a1, 0x10a8: 0x69c9, 0x10a9: 0x69f1, 0x10aa: 0x6a21, 0x10ab: 0x6a51, 0x10ac: 0x6a81, 0x10ad: 0x6ab1, 0x10ae: 0x6ae1, 0x10af: 0x6b11, 0x10b0: 0x6b41, 0x10b1: 0x6b71, 0x10b2: 0x6ba1, 0x10b3: 0x6bd1, 0x10b4: 0x6c01, 0x10b5: 0x6c31, 0x10b6: 0x6c61, 0x10b7: 0x6c91, 0x10b8: 0x6cc1, 0x10b9: 0x6cf1, 0x10ba: 0x6d21, 0x10bb: 0x6d51, 0x10bc: 0x6d81, 0x10bd: 0x6db1, 0x10be: 0x6de1, 0x10bf: 0x440d, // Block 0x43, offset 0x10c0 0x10c0: 0xe00d, 0x10c1: 0x0008, 0x10c2: 0xe00d, 0x10c3: 0x0008, 0x10c4: 0xe00d, 0x10c5: 0x0008, 0x10c6: 0xe00d, 0x10c7: 0x0008, 0x10c8: 0xe00d, 0x10c9: 0x0008, 0x10ca: 0xe00d, 0x10cb: 0x0008, 0x10cc: 0xe00d, 0x10cd: 0x0008, 0x10ce: 0xe00d, 0x10cf: 0x0008, 0x10d0: 0xe00d, 0x10d1: 0x0008, 0x10d2: 0xe00d, 0x10d3: 0x0008, 0x10d4: 0xe00d, 0x10d5: 0x0008, 0x10d6: 0xe00d, 0x10d7: 0x0008, 0x10d8: 0xe00d, 0x10d9: 0x0008, 0x10da: 0xe00d, 0x10db: 0x0008, 0x10dc: 0xe00d, 0x10dd: 0x0008, 0x10de: 0xe00d, 0x10df: 0x0008, 0x10e0: 0xe00d, 0x10e1: 0x0008, 0x10e2: 0xe00d, 0x10e3: 0x0008, 0x10e4: 0xe00d, 0x10e5: 0x0008, 0x10e6: 0xe00d, 0x10e7: 0x0008, 0x10e8: 0xe00d, 0x10e9: 0x0008, 0x10ea: 0xe00d, 0x10eb: 0x0008, 0x10ec: 0xe00d, 0x10ed: 0x0008, 0x10ee: 0x0008, 0x10ef: 0x3308, 0x10f0: 0x3318, 0x10f1: 0x3318, 0x10f2: 0x3318, 0x10f3: 0x0018, 0x10f4: 0x3308, 0x10f5: 0x3308, 0x10f6: 0x3308, 0x10f7: 0x3308, 0x10f8: 0x3308, 0x10f9: 0x3308, 0x10fa: 0x3308, 0x10fb: 0x3308, 0x10fc: 0x3308, 0x10fd: 0x3308, 0x10fe: 0x0018, 0x10ff: 0x0008, // Block 0x44, offset 0x1100 0x1100: 0xe00d, 0x1101: 0x0008, 0x1102: 0xe00d, 0x1103: 0x0008, 0x1104: 0xe00d, 0x1105: 0x0008, 0x1106: 0xe00d, 0x1107: 0x0008, 0x1108: 0xe00d, 0x1109: 0x0008, 0x110a: 0xe00d, 0x110b: 0x0008, 0x110c: 0xe00d, 0x110d: 0x0008, 0x110e: 0xe00d, 0x110f: 0x0008, 0x1110: 0xe00d, 0x1111: 0x0008, 0x1112: 0xe00d, 0x1113: 0x0008, 0x1114: 0xe00d, 0x1115: 0x0008, 0x1116: 0xe00d, 0x1117: 0x0008, 0x1118: 0xe00d, 0x1119: 0x0008, 0x111a: 0xe00d, 0x111b: 0x0008, 0x111c: 0x0ea1, 0x111d: 0x6e11, 0x111e: 0x3308, 0x111f: 0x3308, 0x1120: 0x0008, 0x1121: 0x0008, 0x1122: 0x0008, 0x1123: 0x0008, 0x1124: 0x0008, 0x1125: 0x0008, 0x1126: 0x0008, 0x1127: 0x0008, 0x1128: 0x0008, 0x1129: 0x0008, 0x112a: 0x0008, 0x112b: 0x0008, 0x112c: 0x0008, 0x112d: 0x0008, 0x112e: 0x0008, 0x112f: 0x0008, 0x1130: 0x0008, 0x1131: 0x0008, 0x1132: 0x0008, 0x1133: 0x0008, 0x1134: 0x0008, 0x1135: 0x0008, 0x1136: 0x0008, 0x1137: 0x0008, 0x1138: 0x0008, 0x1139: 0x0008, 0x113a: 0x0008, 0x113b: 0x0008, 0x113c: 0x0008, 0x113d: 0x0008, 0x113e: 0x0008, 0x113f: 0x0008, // Block 0x45, offset 0x1140 0x1140: 0x0018, 0x1141: 0x0018, 0x1142: 0x0018, 0x1143: 0x0018, 0x1144: 0x0018, 0x1145: 0x0018, 0x1146: 0x0018, 0x1147: 0x0018, 0x1148: 0x0018, 0x1149: 0x0018, 0x114a: 0x0018, 0x114b: 0x0018, 0x114c: 0x0018, 0x114d: 0x0018, 0x114e: 0x0018, 0x114f: 0x0018, 0x1150: 0x0018, 0x1151: 0x0018, 0x1152: 0x0018, 0x1153: 0x0018, 0x1154: 0x0018, 0x1155: 0x0018, 0x1156: 0x0018, 0x1157: 0x0008, 0x1158: 0x0008, 0x1159: 0x0008, 0x115a: 0x0008, 0x115b: 0x0008, 0x115c: 0x0008, 0x115d: 0x0008, 0x115e: 0x0008, 0x115f: 0x0008, 0x1160: 0x0018, 0x1161: 0x0018, 0x1162: 0xe00d, 0x1163: 0x0008, 0x1164: 0xe00d, 0x1165: 0x0008, 0x1166: 0xe00d, 0x1167: 0x0008, 0x1168: 0xe00d, 0x1169: 0x0008, 0x116a: 0xe00d, 0x116b: 0x0008, 0x116c: 0xe00d, 0x116d: 0x0008, 0x116e: 0xe00d, 0x116f: 0x0008, 0x1170: 0x0008, 0x1171: 0x0008, 0x1172: 0xe00d, 0x1173: 0x0008, 0x1174: 0xe00d, 0x1175: 0x0008, 0x1176: 0xe00d, 0x1177: 0x0008, 0x1178: 0xe00d, 0x1179: 0x0008, 0x117a: 0xe00d, 0x117b: 0x0008, 0x117c: 0xe00d, 0x117d: 0x0008, 0x117e: 0xe00d, 0x117f: 0x0008, // Block 0x46, offset 0x1180 0x1180: 0xe00d, 0x1181: 0x0008, 0x1182: 0xe00d, 0x1183: 0x0008, 0x1184: 0xe00d, 0x1185: 0x0008, 0x1186: 0xe00d, 0x1187: 0x0008, 0x1188: 0xe00d, 0x1189: 0x0008, 0x118a: 0xe00d, 0x118b: 0x0008, 0x118c: 0xe00d, 0x118d: 0x0008, 0x118e: 0xe00d, 0x118f: 0x0008, 0x1190: 0xe00d, 0x1191: 0x0008, 0x1192: 0xe00d, 0x1193: 0x0008, 0x1194: 0xe00d, 0x1195: 0x0008, 0x1196: 0xe00d, 0x1197: 0x0008, 0x1198: 0xe00d, 0x1199: 0x0008, 0x119a: 0xe00d, 0x119b: 0x0008, 0x119c: 0xe00d, 0x119d: 0x0008, 0x119e: 0xe00d, 0x119f: 0x0008, 0x11a0: 0xe00d, 0x11a1: 0x0008, 0x11a2: 0xe00d, 0x11a3: 0x0008, 0x11a4: 0xe00d, 0x11a5: 0x0008, 0x11a6: 0xe00d, 0x11a7: 0x0008, 0x11a8: 0xe00d, 0x11a9: 0x0008, 0x11aa: 0xe00d, 0x11ab: 0x0008, 0x11ac: 0xe00d, 0x11ad: 0x0008, 0x11ae: 0xe00d, 0x11af: 0x0008, 0x11b0: 0xe0fd, 0x11b1: 0x0008, 0x11b2: 0x0008, 0x11b3: 0x0008, 0x11b4: 0x0008, 0x11b5: 0x0008, 0x11b6: 0x0008, 0x11b7: 0x0008, 0x11b8: 0x0008, 0x11b9: 0xe01d, 0x11ba: 0x0008, 0x11bb: 0xe03d, 0x11bc: 0x0008, 0x11bd: 0x442d, 0x11be: 0xe00d, 0x11bf: 0x0008, // Block 0x47, offset 0x11c0 0x11c0: 0xe00d, 0x11c1: 0x0008, 0x11c2: 0xe00d, 0x11c3: 0x0008, 0x11c4: 0xe00d, 0x11c5: 0x0008, 0x11c6: 0xe00d, 0x11c7: 0x0008, 0x11c8: 0x0008, 0x11c9: 0x0018, 0x11ca: 0x0018, 0x11cb: 0xe03d, 0x11cc: 0x0008, 0x11cd: 0x11d9, 0x11ce: 0x0008, 0x11cf: 0x0008, 0x11d0: 0xe00d, 0x11d1: 0x0008, 0x11d2: 0xe00d, 0x11d3: 0x0008, 0x11d4: 0x0008, 0x11d5: 0x0008, 0x11d6: 0xe00d, 0x11d7: 0x0008, 0x11d8: 0xe00d, 0x11d9: 0x0008, 0x11da: 0xe00d, 0x11db: 0x0008, 0x11dc: 0xe00d, 0x11dd: 0x0008, 0x11de: 0xe00d, 0x11df: 0x0008, 0x11e0: 0xe00d, 0x11e1: 0x0008, 0x11e2: 0xe00d, 0x11e3: 0x0008, 0x11e4: 0xe00d, 0x11e5: 0x0008, 0x11e6: 0xe00d, 0x11e7: 0x0008, 0x11e8: 0xe00d, 0x11e9: 0x0008, 0x11ea: 0x6e29, 0x11eb: 0x1029, 0x11ec: 0x11c1, 0x11ed: 0x6e41, 0x11ee: 0x1221, 0x11ef: 0x0040, 0x11f0: 0x6e59, 0x11f1: 0x6e71, 0x11f2: 0x1239, 0x11f3: 0x444d, 0x11f4: 0xe00d, 0x11f5: 0x0008, 0x11f6: 0xe00d, 0x11f7: 0x0008, 0x11f8: 0x0040, 0x11f9: 0x0040, 0x11fa: 0x0040, 0x11fb: 0x0040, 0x11fc: 0x0040, 0x11fd: 0x0040, 0x11fe: 0x0040, 0x11ff: 0x0040, // Block 0x48, offset 0x1200 0x1200: 0x64d5, 0x1201: 0x64f5, 0x1202: 0x6515, 0x1203: 0x6535, 0x1204: 0x6555, 0x1205: 0x6575, 0x1206: 0x6595, 0x1207: 0x65b5, 0x1208: 0x65d5, 0x1209: 0x65f5, 0x120a: 0x6615, 0x120b: 0x6635, 0x120c: 0x6655, 0x120d: 0x6675, 0x120e: 0x0008, 0x120f: 0x0008, 0x1210: 0x6695, 0x1211: 0x0008, 0x1212: 0x66b5, 0x1213: 0x0008, 0x1214: 0x0008, 0x1215: 0x66d5, 0x1216: 0x66f5, 0x1217: 0x6715, 0x1218: 0x6735, 0x1219: 0x6755, 0x121a: 0x6775, 0x121b: 0x6795, 0x121c: 0x67b5, 0x121d: 0x67d5, 0x121e: 0x67f5, 0x121f: 0x0008, 0x1220: 0x6815, 0x1221: 0x0008, 0x1222: 0x6835, 0x1223: 0x0008, 0x1224: 0x0008, 0x1225: 0x6855, 0x1226: 0x6875, 0x1227: 0x0008, 0x1228: 0x0008, 0x1229: 0x0008, 0x122a: 0x6895, 0x122b: 0x68b5, 0x122c: 0x68d5, 0x122d: 0x68f5, 0x122e: 0x6915, 0x122f: 0x6935, 0x1230: 0x6955, 0x1231: 0x6975, 0x1232: 0x6995, 0x1233: 0x69b5, 0x1234: 0x69d5, 0x1235: 0x69f5, 0x1236: 0x6a15, 0x1237: 0x6a35, 0x1238: 0x6a55, 0x1239: 0x6a75, 0x123a: 0x6a95, 0x123b: 0x6ab5, 0x123c: 0x6ad5, 0x123d: 0x6af5, 0x123e: 0x6b15, 0x123f: 0x6b35, // Block 0x49, offset 0x1240 0x1240: 0x7a95, 0x1241: 0x7ab5, 0x1242: 0x7ad5, 0x1243: 0x7af5, 0x1244: 0x7b15, 0x1245: 0x7b35, 0x1246: 0x7b55, 0x1247: 0x7b75, 0x1248: 0x7b95, 0x1249: 0x7bb5, 0x124a: 0x7bd5, 0x124b: 0x7bf5, 0x124c: 0x7c15, 0x124d: 0x7c35, 0x124e: 0x7c55, 0x124f: 0x6ec9, 0x1250: 0x6ef1, 0x1251: 0x6f19, 0x1252: 0x7c75, 0x1253: 0x7c95, 0x1254: 0x7cb5, 0x1255: 0x6f41, 0x1256: 0x6f69, 0x1257: 0x6f91, 0x1258: 0x7cd5, 0x1259: 0x7cf5, 0x125a: 0x0040, 0x125b: 0x0040, 0x125c: 0x0040, 0x125d: 0x0040, 0x125e: 0x0040, 0x125f: 0x0040, 0x1260: 0x0040, 0x1261: 0x0040, 0x1262: 0x0040, 0x1263: 0x0040, 0x1264: 0x0040, 0x1265: 0x0040, 0x1266: 0x0040, 0x1267: 0x0040, 0x1268: 0x0040, 0x1269: 0x0040, 0x126a: 0x0040, 0x126b: 0x0040, 0x126c: 0x0040, 0x126d: 0x0040, 0x126e: 0x0040, 0x126f: 0x0040, 0x1270: 0x0040, 0x1271: 0x0040, 0x1272: 0x0040, 0x1273: 0x0040, 0x1274: 0x0040, 0x1275: 0x0040, 0x1276: 0x0040, 0x1277: 0x0040, 0x1278: 0x0040, 0x1279: 0x0040, 0x127a: 0x0040, 0x127b: 0x0040, 0x127c: 0x0040, 0x127d: 0x0040, 0x127e: 0x0040, 0x127f: 0x0040, // Block 0x4a, offset 0x1280 0x1280: 0x6fb9, 0x1281: 0x6fd1, 0x1282: 0x6fe9, 0x1283: 0x7d15, 0x1284: 0x7d35, 0x1285: 0x7001, 0x1286: 0x7001, 0x1287: 0x0040, 0x1288: 0x0040, 0x1289: 0x0040, 0x128a: 0x0040, 0x128b: 0x0040, 0x128c: 0x0040, 0x128d: 0x0040, 0x128e: 0x0040, 0x128f: 0x0040, 0x1290: 0x0040, 0x1291: 0x0040, 0x1292: 0x0040, 0x1293: 0x7019, 0x1294: 0x7041, 0x1295: 0x7069, 0x1296: 0x7091, 0x1297: 0x70b9, 0x1298: 0x0040, 0x1299: 0x0040, 0x129a: 0x0040, 0x129b: 0x0040, 0x129c: 0x0040, 0x129d: 0x70e1, 0x129e: 0x3308, 0x129f: 0x7109, 0x12a0: 0x7131, 0x12a1: 0x20a9, 0x12a2: 0x20f1, 0x12a3: 0x7149, 0x12a4: 0x7161, 0x12a5: 0x7179, 0x12a6: 0x7191, 0x12a7: 0x71a9, 0x12a8: 0x71c1, 0x12a9: 0x1fb2, 0x12aa: 0x71d9, 0x12ab: 0x7201, 0x12ac: 0x7229, 0x12ad: 0x7261, 0x12ae: 0x7299, 0x12af: 0x72c1, 0x12b0: 0x72e9, 0x12b1: 0x7311, 0x12b2: 0x7339, 0x12b3: 0x7361, 0x12b4: 0x7389, 0x12b5: 0x73b1, 0x12b6: 0x73d9, 0x12b7: 0x0040, 0x12b8: 0x7401, 0x12b9: 0x7429, 0x12ba: 0x7451, 0x12bb: 0x7479, 0x12bc: 0x74a1, 0x12bd: 0x0040, 0x12be: 0x74c9, 0x12bf: 0x0040, // Block 0x4b, offset 0x12c0 0x12c0: 0x74f1, 0x12c1: 0x7519, 0x12c2: 0x0040, 0x12c3: 0x7541, 0x12c4: 0x7569, 0x12c5: 0x0040, 0x12c6: 0x7591, 0x12c7: 0x75b9, 0x12c8: 0x75e1, 0x12c9: 0x7609, 0x12ca: 0x7631, 0x12cb: 0x7659, 0x12cc: 0x7681, 0x12cd: 0x76a9, 0x12ce: 0x76d1, 0x12cf: 0x76f9, 0x12d0: 0x7721, 0x12d1: 0x7721, 0x12d2: 0x7739, 0x12d3: 0x7739, 0x12d4: 0x7739, 0x12d5: 0x7739, 0x12d6: 0x7751, 0x12d7: 0x7751, 0x12d8: 0x7751, 0x12d9: 0x7751, 0x12da: 0x7769, 0x12db: 0x7769, 0x12dc: 0x7769, 0x12dd: 0x7769, 0x12de: 0x7781, 0x12df: 0x7781, 0x12e0: 0x7781, 0x12e1: 0x7781, 0x12e2: 0x7799, 0x12e3: 0x7799, 0x12e4: 0x7799, 0x12e5: 0x7799, 0x12e6: 0x77b1, 0x12e7: 0x77b1, 0x12e8: 0x77b1, 0x12e9: 0x77b1, 0x12ea: 0x77c9, 0x12eb: 0x77c9, 0x12ec: 0x77c9, 0x12ed: 0x77c9, 0x12ee: 0x77e1, 0x12ef: 0x77e1, 0x12f0: 0x77e1, 0x12f1: 0x77e1, 0x12f2: 0x77f9, 0x12f3: 0x77f9, 0x12f4: 0x77f9, 0x12f5: 0x77f9, 0x12f6: 0x7811, 0x12f7: 0x7811, 0x12f8: 0x7811, 0x12f9: 0x7811, 0x12fa: 0x7829, 0x12fb: 0x7829, 0x12fc: 0x7829, 0x12fd: 0x7829, 0x12fe: 0x7841, 0x12ff: 0x7841, // Block 0x4c, offset 0x1300 0x1300: 0x7841, 0x1301: 0x7841, 0x1302: 0x7859, 0x1303: 0x7859, 0x1304: 0x7871, 0x1305: 0x7871, 0x1306: 0x7889, 0x1307: 0x7889, 0x1308: 0x78a1, 0x1309: 0x78a1, 0x130a: 0x78b9, 0x130b: 0x78b9, 0x130c: 0x78d1, 0x130d: 0x78d1, 0x130e: 0x78e9, 0x130f: 0x78e9, 0x1310: 0x78e9, 0x1311: 0x78e9, 0x1312: 0x7901, 0x1313: 0x7901, 0x1314: 0x7901, 0x1315: 0x7901, 0x1316: 0x7919, 0x1317: 0x7919, 0x1318: 0x7919, 0x1319: 0x7919, 0x131a: 0x7931, 0x131b: 0x7931, 0x131c: 0x7931, 0x131d: 0x7931, 0x131e: 0x7949, 0x131f: 0x7949, 0x1320: 0x7961, 0x1321: 0x7961, 0x1322: 0x7961, 0x1323: 0x7961, 0x1324: 0x7979, 0x1325: 0x7979, 0x1326: 0x7991, 0x1327: 0x7991, 0x1328: 0x7991, 0x1329: 0x7991, 0x132a: 0x79a9, 0x132b: 0x79a9, 0x132c: 0x79a9, 0x132d: 0x79a9, 0x132e: 0x79c1, 0x132f: 0x79c1, 0x1330: 0x79d9, 0x1331: 0x79d9, 0x1332: 0x0818, 0x1333: 0x0818, 0x1334: 0x0818, 0x1335: 0x0818, 0x1336: 0x0818, 0x1337: 0x0818, 0x1338: 0x0818, 0x1339: 0x0818, 0x133a: 0x0818, 0x133b: 0x0818, 0x133c: 0x0818, 0x133d: 0x0818, 0x133e: 0x0818, 0x133f: 0x0818, // Block 0x4d, offset 0x1340 0x1340: 0x0818, 0x1341: 0x0818, 0x1342: 0x0040, 0x1343: 0x0040, 0x1344: 0x0040, 0x1345: 0x0040, 0x1346: 0x0040, 0x1347: 0x0040, 0x1348: 0x0040, 0x1349: 0x0040, 0x134a: 0x0040, 0x134b: 0x0040, 0x134c: 0x0040, 0x134d: 0x0040, 0x134e: 0x0040, 0x134f: 0x0040, 0x1350: 0x0040, 0x1351: 0x0040, 0x1352: 0x0040, 0x1353: 0x79f1, 0x1354: 0x79f1, 0x1355: 0x79f1, 0x1356: 0x79f1, 0x1357: 0x7a09, 0x1358: 0x7a09, 0x1359: 0x7a21, 0x135a: 0x7a21, 0x135b: 0x7a39, 0x135c: 0x7a39, 0x135d: 0x0479, 0x135e: 0x7a51, 0x135f: 0x7a51, 0x1360: 0x7a69, 0x1361: 0x7a69, 0x1362: 0x7a81, 0x1363: 0x7a81, 0x1364: 0x7a99, 0x1365: 0x7a99, 0x1366: 0x7a99, 0x1367: 0x7a99, 0x1368: 0x7ab1, 0x1369: 0x7ab1, 0x136a: 0x7ac9, 0x136b: 0x7ac9, 0x136c: 0x7af1, 0x136d: 0x7af1, 0x136e: 0x7b19, 0x136f: 0x7b19, 0x1370: 0x7b41, 0x1371: 0x7b41, 0x1372: 0x7b69, 0x1373: 0x7b69, 0x1374: 0x7b91, 0x1375: 0x7b91, 0x1376: 0x7bb9, 0x1377: 0x7bb9, 0x1378: 0x7bb9, 0x1379: 0x7be1, 0x137a: 0x7be1, 0x137b: 0x7be1, 0x137c: 0x7c09, 0x137d: 0x7c09, 0x137e: 0x7c09, 0x137f: 0x7c09, // Block 0x4e, offset 0x1380 0x1380: 0x85f9, 0x1381: 0x8621, 0x1382: 0x8649, 0x1383: 0x8671, 0x1384: 0x8699, 0x1385: 0x86c1, 0x1386: 0x86e9, 0x1387: 0x8711, 0x1388: 0x8739, 0x1389: 0x8761, 0x138a: 0x8789, 0x138b: 0x87b1, 0x138c: 0x87d9, 0x138d: 0x8801, 0x138e: 0x8829, 0x138f: 0x8851, 0x1390: 0x8879, 0x1391: 0x88a1, 0x1392: 0x88c9, 0x1393: 0x88f1, 0x1394: 0x8919, 0x1395: 0x8941, 0x1396: 0x8969, 0x1397: 0x8991, 0x1398: 0x89b9, 0x1399: 0x89e1, 0x139a: 0x8a09, 0x139b: 0x8a31, 0x139c: 0x8a59, 0x139d: 0x8a81, 0x139e: 0x8aaa, 0x139f: 0x8ada, 0x13a0: 0x8b0a, 0x13a1: 0x8b3a, 0x13a2: 0x8b6a, 0x13a3: 0x8b9a, 0x13a4: 0x8bc9, 0x13a5: 0x8bf1, 0x13a6: 0x7c71, 0x13a7: 0x8c19, 0x13a8: 0x7be1, 0x13a9: 0x7c99, 0x13aa: 0x8c41, 0x13ab: 0x8c69, 0x13ac: 0x7d39, 0x13ad: 0x8c91, 0x13ae: 0x7d61, 0x13af: 0x7d89, 0x13b0: 0x8cb9, 0x13b1: 0x8ce1, 0x13b2: 0x7e29, 0x13b3: 0x8d09, 0x13b4: 0x7e51, 0x13b5: 0x7e79, 0x13b6: 0x8d31, 0x13b7: 0x8d59, 0x13b8: 0x7ec9, 0x13b9: 0x8d81, 0x13ba: 0x7ef1, 0x13bb: 0x7f19, 0x13bc: 0x83a1, 0x13bd: 0x83c9, 0x13be: 0x8441, 0x13bf: 0x8469, // Block 0x4f, offset 0x13c0 0x13c0: 0x8491, 0x13c1: 0x8531, 0x13c2: 0x8559, 0x13c3: 0x8581, 0x13c4: 0x85a9, 0x13c5: 0x8649, 0x13c6: 0x8671, 0x13c7: 0x8699, 0x13c8: 0x8da9, 0x13c9: 0x8739, 0x13ca: 0x8dd1, 0x13cb: 0x8df9, 0x13cc: 0x8829, 0x13cd: 0x8e21, 0x13ce: 0x8851, 0x13cf: 0x8879, 0x13d0: 0x8a81, 0x13d1: 0x8e49, 0x13d2: 0x8e71, 0x13d3: 0x89b9, 0x13d4: 0x8e99, 0x13d5: 0x89e1, 0x13d6: 0x8a09, 0x13d7: 0x7c21, 0x13d8: 0x7c49, 0x13d9: 0x8ec1, 0x13da: 0x7c71, 0x13db: 0x8ee9, 0x13dc: 0x7cc1, 0x13dd: 0x7ce9, 0x13de: 0x7d11, 0x13df: 0x7d39, 0x13e0: 0x8f11, 0x13e1: 0x7db1, 0x13e2: 0x7dd9, 0x13e3: 0x7e01, 0x13e4: 0x7e29, 0x13e5: 0x8f39, 0x13e6: 0x7ec9, 0x13e7: 0x7f41, 0x13e8: 0x7f69, 0x13e9: 0x7f91, 0x13ea: 0x7fb9, 0x13eb: 0x7fe1, 0x13ec: 0x8031, 0x13ed: 0x8059, 0x13ee: 0x8081, 0x13ef: 0x80a9, 0x13f0: 0x80d1, 0x13f1: 0x80f9, 0x13f2: 0x8f61, 0x13f3: 0x8121, 0x13f4: 0x8149, 0x13f5: 0x8171, 0x13f6: 0x8199, 0x13f7: 0x81c1, 0x13f8: 0x81e9, 0x13f9: 0x8239, 0x13fa: 0x8261, 0x13fb: 0x8289, 0x13fc: 0x82b1, 0x13fd: 0x82d9, 0x13fe: 0x8301, 0x13ff: 0x8329, // Block 0x50, offset 0x1400 0x1400: 0x8351, 0x1401: 0x8379, 0x1402: 0x83f1, 0x1403: 0x8419, 0x1404: 0x84b9, 0x1405: 0x84e1, 0x1406: 0x8509, 0x1407: 0x8531, 0x1408: 0x8559, 0x1409: 0x85d1, 0x140a: 0x85f9, 0x140b: 0x8621, 0x140c: 0x8649, 0x140d: 0x8f89, 0x140e: 0x86c1, 0x140f: 0x86e9, 0x1410: 0x8711, 0x1411: 0x8739, 0x1412: 0x87b1, 0x1413: 0x87d9, 0x1414: 0x8801, 0x1415: 0x8829, 0x1416: 0x8fb1, 0x1417: 0x88a1, 0x1418: 0x88c9, 0x1419: 0x8fd9, 0x141a: 0x8941, 0x141b: 0x8969, 0x141c: 0x8991, 0x141d: 0x89b9, 0x141e: 0x9001, 0x141f: 0x7c71, 0x1420: 0x8ee9, 0x1421: 0x7d39, 0x1422: 0x8f11, 0x1423: 0x7e29, 0x1424: 0x8f39, 0x1425: 0x7ec9, 0x1426: 0x9029, 0x1427: 0x80d1, 0x1428: 0x9051, 0x1429: 0x9079, 0x142a: 0x90a1, 0x142b: 0x8531, 0x142c: 0x8559, 0x142d: 0x8649, 0x142e: 0x8829, 0x142f: 0x8fb1, 0x1430: 0x89b9, 0x1431: 0x9001, 0x1432: 0x90c9, 0x1433: 0x9101, 0x1434: 0x9139, 0x1435: 0x9171, 0x1436: 0x9199, 0x1437: 0x91c1, 0x1438: 0x91e9, 0x1439: 0x9211, 0x143a: 0x9239, 0x143b: 0x9261, 0x143c: 0x9289, 0x143d: 0x92b1, 0x143e: 0x92d9, 0x143f: 0x9301, // Block 0x51, offset 0x1440 0x1440: 0x9329, 0x1441: 0x9351, 0x1442: 0x9379, 0x1443: 0x93a1, 0x1444: 0x93c9, 0x1445: 0x93f1, 0x1446: 0x9419, 0x1447: 0x9441, 0x1448: 0x9469, 0x1449: 0x9491, 0x144a: 0x94b9, 0x144b: 0x94e1, 0x144c: 0x9079, 0x144d: 0x9509, 0x144e: 0x9531, 0x144f: 0x9559, 0x1450: 0x9581, 0x1451: 0x9171, 0x1452: 0x9199, 0x1453: 0x91c1, 0x1454: 0x91e9, 0x1455: 0x9211, 0x1456: 0x9239, 0x1457: 0x9261, 0x1458: 0x9289, 0x1459: 0x92b1, 0x145a: 0x92d9, 0x145b: 0x9301, 0x145c: 0x9329, 0x145d: 0x9351, 0x145e: 0x9379, 0x145f: 0x93a1, 0x1460: 0x93c9, 0x1461: 0x93f1, 0x1462: 0x9419, 0x1463: 0x9441, 0x1464: 0x9469, 0x1465: 0x9491, 0x1466: 0x94b9, 0x1467: 0x94e1, 0x1468: 0x9079, 0x1469: 0x9509, 0x146a: 0x9531, 0x146b: 0x9559, 0x146c: 0x9581, 0x146d: 0x9491, 0x146e: 0x94b9, 0x146f: 0x94e1, 0x1470: 0x9079, 0x1471: 0x9051, 0x1472: 0x90a1, 0x1473: 0x8211, 0x1474: 0x8059, 0x1475: 0x8081, 0x1476: 0x80a9, 0x1477: 0x9491, 0x1478: 0x94b9, 0x1479: 0x94e1, 0x147a: 0x8211, 0x147b: 0x8239, 0x147c: 0x95a9, 0x147d: 0x95a9, 0x147e: 0x0018, 0x147f: 0x0018, // Block 0x52, offset 0x1480 0x1480: 0x0040, 0x1481: 0x0040, 0x1482: 0x0040, 0x1483: 0x0040, 0x1484: 0x0040, 0x1485: 0x0040, 0x1486: 0x0040, 0x1487: 0x0040, 0x1488: 0x0040, 0x1489: 0x0040, 0x148a: 0x0040, 0x148b: 0x0040, 0x148c: 0x0040, 0x148d: 0x0040, 0x148e: 0x0040, 0x148f: 0x0040, 0x1490: 0x95d1, 0x1491: 0x9609, 0x1492: 0x9609, 0x1493: 0x9641, 0x1494: 0x9679, 0x1495: 0x96b1, 0x1496: 0x96e9, 0x1497: 0x9721, 0x1498: 0x9759, 0x1499: 0x9759, 0x149a: 0x9791, 0x149b: 0x97c9, 0x149c: 0x9801, 0x149d: 0x9839, 0x149e: 0x9871, 0x149f: 0x98a9, 0x14a0: 0x98a9, 0x14a1: 0x98e1, 0x14a2: 0x9919, 0x14a3: 0x9919, 0x14a4: 0x9951, 0x14a5: 0x9951, 0x14a6: 0x9989, 0x14a7: 0x99c1, 0x14a8: 0x99c1, 0x14a9: 0x99f9, 0x14aa: 0x9a31, 0x14ab: 0x9a31, 0x14ac: 0x9a69, 0x14ad: 0x9a69, 0x14ae: 0x9aa1, 0x14af: 0x9ad9, 0x14b0: 0x9ad9, 0x14b1: 0x9b11, 0x14b2: 0x9b11, 0x14b3: 0x9b49, 0x14b4: 0x9b81, 0x14b5: 0x9bb9, 0x14b6: 0x9bf1, 0x14b7: 0x9bf1, 0x14b8: 0x9c29, 0x14b9: 0x9c61, 0x14ba: 0x9c99, 0x14bb: 0x9cd1, 0x14bc: 0x9d09, 0x14bd: 0x9d09, 0x14be: 0x9d41, 0x14bf: 0x9d79, // Block 0x53, offset 0x14c0 0x14c0: 0xa949, 0x14c1: 0xa981, 0x14c2: 0xa9b9, 0x14c3: 0xa8a1, 0x14c4: 0x9bb9, 0x14c5: 0x9989, 0x14c6: 0xa9f1, 0x14c7: 0xaa29, 0x14c8: 0x0040, 0x14c9: 0x0040, 0x14ca: 0x0040, 0x14cb: 0x0040, 0x14cc: 0x0040, 0x14cd: 0x0040, 0x14ce: 0x0040, 0x14cf: 0x0040, 0x14d0: 0x0040, 0x14d1: 0x0040, 0x14d2: 0x0040, 0x14d3: 0x0040, 0x14d4: 0x0040, 0x14d5: 0x0040, 0x14d6: 0x0040, 0x14d7: 0x0040, 0x14d8: 0x0040, 0x14d9: 0x0040, 0x14da: 0x0040, 0x14db: 0x0040, 0x14dc: 0x0040, 0x14dd: 0x0040, 0x14de: 0x0040, 0x14df: 0x0040, 0x14e0: 0x0040, 0x14e1: 0x0040, 0x14e2: 0x0040, 0x14e3: 0x0040, 0x14e4: 0x0040, 0x14e5: 0x0040, 0x14e6: 0x0040, 0x14e7: 0x0040, 0x14e8: 0x0040, 0x14e9: 0x0040, 0x14ea: 0x0040, 0x14eb: 0x0040, 0x14ec: 0x0040, 0x14ed: 0x0040, 0x14ee: 0x0040, 0x14ef: 0x0040, 0x14f0: 0xaa61, 0x14f1: 0xaa99, 0x14f2: 0xaad1, 0x14f3: 0xab19, 0x14f4: 0xab61, 0x14f5: 0xaba9, 0x14f6: 0xabf1, 0x14f7: 0xac39, 0x14f8: 0xac81, 0x14f9: 0xacc9, 0x14fa: 0xad02, 0x14fb: 0xae12, 0x14fc: 0xae91, 0x14fd: 0x0018, 0x14fe: 0x0040, 0x14ff: 0x0040, // Block 0x54, offset 0x1500 0x1500: 0x33c0, 0x1501: 0x33c0, 0x1502: 0x33c0, 0x1503: 0x33c0, 0x1504: 0x33c0, 0x1505: 0x33c0, 0x1506: 0x33c0, 0x1507: 0x33c0, 0x1508: 0x33c0, 0x1509: 0x33c0, 0x150a: 0x33c0, 0x150b: 0x33c0, 0x150c: 0x33c0, 0x150d: 0x33c0, 0x150e: 0x33c0, 0x150f: 0x33c0, 0x1510: 0xaeda, 0x1511: 0x7d55, 0x1512: 0x0040, 0x1513: 0xaeea, 0x1514: 0x03c2, 0x1515: 0xaefa, 0x1516: 0xaf0a, 0x1517: 0x7d75, 0x1518: 0x7d95, 0x1519: 0x0040, 0x151a: 0x0040, 0x151b: 0x0040, 0x151c: 0x0040, 0x151d: 0x0040, 0x151e: 0x0040, 0x151f: 0x0040, 0x1520: 0x3308, 0x1521: 0x3308, 0x1522: 0x3308, 0x1523: 0x3308, 0x1524: 0x3308, 0x1525: 0x3308, 0x1526: 0x3308, 0x1527: 0x3308, 0x1528: 0x3308, 0x1529: 0x3308, 0x152a: 0x3308, 0x152b: 0x3308, 0x152c: 0x3308, 0x152d: 0x3308, 0x152e: 0x3308, 0x152f: 0x3308, 0x1530: 0x0040, 0x1531: 0x7db5, 0x1532: 0x7dd5, 0x1533: 0xaf1a, 0x1534: 0xaf1a, 0x1535: 0x1fd2, 0x1536: 0x1fe2, 0x1537: 0xaf2a, 0x1538: 0xaf3a, 0x1539: 0x7df5, 0x153a: 0x7e15, 0x153b: 0x7e35, 0x153c: 0x7df5, 0x153d: 0x7e55, 0x153e: 0x7e75, 0x153f: 0x7e55, // Block 0x55, offset 0x1540 0x1540: 0x7e95, 0x1541: 0x7eb5, 0x1542: 0x7ed5, 0x1543: 0x7eb5, 0x1544: 0x7ef5, 0x1545: 0x0018, 0x1546: 0x0018, 0x1547: 0xaf4a, 0x1548: 0xaf5a, 0x1549: 0x7f16, 0x154a: 0x7f36, 0x154b: 0x7f56, 0x154c: 0x7f76, 0x154d: 0xaf1a, 0x154e: 0xaf1a, 0x154f: 0xaf1a, 0x1550: 0xaeda, 0x1551: 0x7f95, 0x1552: 0x0040, 0x1553: 0x0040, 0x1554: 0x03c2, 0x1555: 0xaeea, 0x1556: 0xaf0a, 0x1557: 0xaefa, 0x1558: 0x7fb5, 0x1559: 0x1fd2, 0x155a: 0x1fe2, 0x155b: 0xaf2a, 0x155c: 0xaf3a, 0x155d: 0x7e95, 0x155e: 0x7ef5, 0x155f: 0xaf6a, 0x1560: 0xaf7a, 0x1561: 0xaf8a, 0x1562: 0x1fb2, 0x1563: 0xaf99, 0x1564: 0xafaa, 0x1565: 0xafba, 0x1566: 0x1fc2, 0x1567: 0x0040, 0x1568: 0xafca, 0x1569: 0xafda, 0x156a: 0xafea, 0x156b: 0xaffa, 0x156c: 0x0040, 0x156d: 0x0040, 0x156e: 0x0040, 0x156f: 0x0040, 0x1570: 0x7fd6, 0x1571: 0xb009, 0x1572: 0x7ff6, 0x1573: 0x0808, 0x1574: 0x8016, 0x1575: 0x0040, 0x1576: 0x8036, 0x1577: 0xb031, 0x1578: 0x8056, 0x1579: 0xb059, 0x157a: 0x8076, 0x157b: 0xb081, 0x157c: 0x8096, 0x157d: 0xb0a9, 0x157e: 0x80b6, 0x157f: 0xb0d1, // Block 0x56, offset 0x1580 0x1580: 0xb0f9, 0x1581: 0xb111, 0x1582: 0xb111, 0x1583: 0xb129, 0x1584: 0xb129, 0x1585: 0xb141, 0x1586: 0xb141, 0x1587: 0xb159, 0x1588: 0xb159, 0x1589: 0xb171, 0x158a: 0xb171, 0x158b: 0xb171, 0x158c: 0xb171, 0x158d: 0xb189, 0x158e: 0xb189, 0x158f: 0xb1a1, 0x1590: 0xb1a1, 0x1591: 0xb1a1, 0x1592: 0xb1a1, 0x1593: 0xb1b9, 0x1594: 0xb1b9, 0x1595: 0xb1d1, 0x1596: 0xb1d1, 0x1597: 0xb1d1, 0x1598: 0xb1d1, 0x1599: 0xb1e9, 0x159a: 0xb1e9, 0x159b: 0xb1e9, 0x159c: 0xb1e9, 0x159d: 0xb201, 0x159e: 0xb201, 0x159f: 0xb201, 0x15a0: 0xb201, 0x15a1: 0xb219, 0x15a2: 0xb219, 0x15a3: 0xb219, 0x15a4: 0xb219, 0x15a5: 0xb231, 0x15a6: 0xb231, 0x15a7: 0xb231, 0x15a8: 0xb231, 0x15a9: 0xb249, 0x15aa: 0xb249, 0x15ab: 0xb261, 0x15ac: 0xb261, 0x15ad: 0xb279, 0x15ae: 0xb279, 0x15af: 0xb291, 0x15b0: 0xb291, 0x15b1: 0xb2a9, 0x15b2: 0xb2a9, 0x15b3: 0xb2a9, 0x15b4: 0xb2a9, 0x15b5: 0xb2c1, 0x15b6: 0xb2c1, 0x15b7: 0xb2c1, 0x15b8: 0xb2c1, 0x15b9: 0xb2d9, 0x15ba: 0xb2d9, 0x15bb: 0xb2d9, 0x15bc: 0xb2d9, 0x15bd: 0xb2f1, 0x15be: 0xb2f1, 0x15bf: 0xb2f1, // Block 0x57, offset 0x15c0 0x15c0: 0xb2f1, 0x15c1: 0xb309, 0x15c2: 0xb309, 0x15c3: 0xb309, 0x15c4: 0xb309, 0x15c5: 0xb321, 0x15c6: 0xb321, 0x15c7: 0xb321, 0x15c8: 0xb321, 0x15c9: 0xb339, 0x15ca: 0xb339, 0x15cb: 0xb339, 0x15cc: 0xb339, 0x15cd: 0xb351, 0x15ce: 0xb351, 0x15cf: 0xb351, 0x15d0: 0xb351, 0x15d1: 0xb369, 0x15d2: 0xb369, 0x15d3: 0xb369, 0x15d4: 0xb369, 0x15d5: 0xb381, 0x15d6: 0xb381, 0x15d7: 0xb381, 0x15d8: 0xb381, 0x15d9: 0xb399, 0x15da: 0xb399, 0x15db: 0xb399, 0x15dc: 0xb399, 0x15dd: 0xb3b1, 0x15de: 0xb3b1, 0x15df: 0xb3b1, 0x15e0: 0xb3b1, 0x15e1: 0xb3c9, 0x15e2: 0xb3c9, 0x15e3: 0xb3c9, 0x15e4: 0xb3c9, 0x15e5: 0xb3e1, 0x15e6: 0xb3e1, 0x15e7: 0xb3e1, 0x15e8: 0xb3e1, 0x15e9: 0xb3f9, 0x15ea: 0xb3f9, 0x15eb: 0xb3f9, 0x15ec: 0xb3f9, 0x15ed: 0xb411, 0x15ee: 0xb411, 0x15ef: 0x7ab1, 0x15f0: 0x7ab1, 0x15f1: 0xb429, 0x15f2: 0xb429, 0x15f3: 0xb429, 0x15f4: 0xb429, 0x15f5: 0xb441, 0x15f6: 0xb441, 0x15f7: 0xb469, 0x15f8: 0xb469, 0x15f9: 0xb491, 0x15fa: 0xb491, 0x15fb: 0xb4b9, 0x15fc: 0xb4b9, 0x15fd: 0x0040, 0x15fe: 0x0040, 0x15ff: 0x03c0, // Block 0x58, offset 0x1600 0x1600: 0x0040, 0x1601: 0xaefa, 0x1602: 0xb4e2, 0x1603: 0xaf6a, 0x1604: 0xafda, 0x1605: 0xafea, 0x1606: 0xaf7a, 0x1607: 0xb4f2, 0x1608: 0x1fd2, 0x1609: 0x1fe2, 0x160a: 0xaf8a, 0x160b: 0x1fb2, 0x160c: 0xaeda, 0x160d: 0xaf99, 0x160e: 0x29d1, 0x160f: 0xb502, 0x1610: 0x1f41, 0x1611: 0x00c9, 0x1612: 0x0069, 0x1613: 0x0079, 0x1614: 0x1f51, 0x1615: 0x1f61, 0x1616: 0x1f71, 0x1617: 0x1f81, 0x1618: 0x1f91, 0x1619: 0x1fa1, 0x161a: 0xaeea, 0x161b: 0x03c2, 0x161c: 0xafaa, 0x161d: 0x1fc2, 0x161e: 0xafba, 0x161f: 0xaf0a, 0x1620: 0xaffa, 0x1621: 0x0039, 0x1622: 0x0ee9, 0x1623: 0x1159, 0x1624: 0x0ef9, 0x1625: 0x0f09, 0x1626: 0x1199, 0x1627: 0x0f31, 0x1628: 0x0249, 0x1629: 0x0f41, 0x162a: 0x0259, 0x162b: 0x0f51, 0x162c: 0x0359, 0x162d: 0x0f61, 0x162e: 0x0f71, 0x162f: 0x00d9, 0x1630: 0x0f99, 0x1631: 0x2039, 0x1632: 0x0269, 0x1633: 0x01d9, 0x1634: 0x0fa9, 0x1635: 0x0fb9, 0x1636: 0x1089, 0x1637: 0x0279, 0x1638: 0x0369, 0x1639: 0x0289, 0x163a: 0x13d1, 0x163b: 0xaf4a, 0x163c: 0xafca, 0x163d: 0xaf5a, 0x163e: 0xb512, 0x163f: 0xaf1a, // Block 0x59, offset 0x1640 0x1640: 0x1caa, 0x1641: 0x0039, 0x1642: 0x0ee9, 0x1643: 0x1159, 0x1644: 0x0ef9, 0x1645: 0x0f09, 0x1646: 0x1199, 0x1647: 0x0f31, 0x1648: 0x0249, 0x1649: 0x0f41, 0x164a: 0x0259, 0x164b: 0x0f51, 0x164c: 0x0359, 0x164d: 0x0f61, 0x164e: 0x0f71, 0x164f: 0x00d9, 0x1650: 0x0f99, 0x1651: 0x2039, 0x1652: 0x0269, 0x1653: 0x01d9, 0x1654: 0x0fa9, 0x1655: 0x0fb9, 0x1656: 0x1089, 0x1657: 0x0279, 0x1658: 0x0369, 0x1659: 0x0289, 0x165a: 0x13d1, 0x165b: 0xaf2a, 0x165c: 0xb522, 0x165d: 0xaf3a, 0x165e: 0xb532, 0x165f: 0x80d5, 0x1660: 0x80f5, 0x1661: 0x29d1, 0x1662: 0x8115, 0x1663: 0x8115, 0x1664: 0x8135, 0x1665: 0x8155, 0x1666: 0x8175, 0x1667: 0x8195, 0x1668: 0x81b5, 0x1669: 0x81d5, 0x166a: 0x81f5, 0x166b: 0x8215, 0x166c: 0x8235, 0x166d: 0x8255, 0x166e: 0x8275, 0x166f: 0x8295, 0x1670: 0x82b5, 0x1671: 0x82d5, 0x1672: 0x82f5, 0x1673: 0x8315, 0x1674: 0x8335, 0x1675: 0x8355, 0x1676: 0x8375, 0x1677: 0x8395, 0x1678: 0x83b5, 0x1679: 0x83d5, 0x167a: 0x83f5, 0x167b: 0x8415, 0x167c: 0x81b5, 0x167d: 0x8435, 0x167e: 0x8455, 0x167f: 0x8215, // Block 0x5a, offset 0x1680 0x1680: 0x8475, 0x1681: 0x8495, 0x1682: 0x84b5, 0x1683: 0x84d5, 0x1684: 0x84f5, 0x1685: 0x8515, 0x1686: 0x8535, 0x1687: 0x8555, 0x1688: 0x84d5, 0x1689: 0x8575, 0x168a: 0x84d5, 0x168b: 0x8595, 0x168c: 0x8595, 0x168d: 0x85b5, 0x168e: 0x85b5, 0x168f: 0x85d5, 0x1690: 0x8515, 0x1691: 0x85f5, 0x1692: 0x8615, 0x1693: 0x85f5, 0x1694: 0x8635, 0x1695: 0x8615, 0x1696: 0x8655, 0x1697: 0x8655, 0x1698: 0x8675, 0x1699: 0x8675, 0x169a: 0x8695, 0x169b: 0x8695, 0x169c: 0x8615, 0x169d: 0x8115, 0x169e: 0x86b5, 0x169f: 0x86d5, 0x16a0: 0x0040, 0x16a1: 0x86f5, 0x16a2: 0x8715, 0x16a3: 0x8735, 0x16a4: 0x8755, 0x16a5: 0x8735, 0x16a6: 0x8775, 0x16a7: 0x8795, 0x16a8: 0x87b5, 0x16a9: 0x87b5, 0x16aa: 0x87d5, 0x16ab: 0x87d5, 0x16ac: 0x87f5, 0x16ad: 0x87f5, 0x16ae: 0x87d5, 0x16af: 0x87d5, 0x16b0: 0x8815, 0x16b1: 0x8835, 0x16b2: 0x8855, 0x16b3: 0x8875, 0x16b4: 0x8895, 0x16b5: 0x88b5, 0x16b6: 0x88b5, 0x16b7: 0x88b5, 0x16b8: 0x88d5, 0x16b9: 0x88d5, 0x16ba: 0x88d5, 0x16bb: 0x88d5, 0x16bc: 0x87b5, 0x16bd: 0x87b5, 0x16be: 0x87b5, 0x16bf: 0x0040, // Block 0x5b, offset 0x16c0 0x16c0: 0x0040, 0x16c1: 0x0040, 0x16c2: 0x8715, 0x16c3: 0x86f5, 0x16c4: 0x88f5, 0x16c5: 0x86f5, 0x16c6: 0x8715, 0x16c7: 0x86f5, 0x16c8: 0x0040, 0x16c9: 0x0040, 0x16ca: 0x8915, 0x16cb: 0x8715, 0x16cc: 0x8935, 0x16cd: 0x88f5, 0x16ce: 0x8935, 0x16cf: 0x8715, 0x16d0: 0x0040, 0x16d1: 0x0040, 0x16d2: 0x8955, 0x16d3: 0x8975, 0x16d4: 0x8875, 0x16d5: 0x8935, 0x16d6: 0x88f5, 0x16d7: 0x8935, 0x16d8: 0x0040, 0x16d9: 0x0040, 0x16da: 0x8995, 0x16db: 0x89b5, 0x16dc: 0x8995, 0x16dd: 0x0040, 0x16de: 0x0040, 0x16df: 0x0040, 0x16e0: 0xb541, 0x16e1: 0xb559, 0x16e2: 0xb571, 0x16e3: 0x89d6, 0x16e4: 0xb589, 0x16e5: 0xb5a1, 0x16e6: 0x89f5, 0x16e7: 0x0040, 0x16e8: 0x8a15, 0x16e9: 0x8a35, 0x16ea: 0x8a55, 0x16eb: 0x8a35, 0x16ec: 0x8a75, 0x16ed: 0x8a95, 0x16ee: 0x8ab5, 0x16ef: 0x0040, 0x16f0: 0x0040, 0x16f1: 0x0040, 0x16f2: 0x0040, 0x16f3: 0x0040, 0x16f4: 0x0040, 0x16f5: 0x0040, 0x16f6: 0x0040, 0x16f7: 0x0040, 0x16f8: 0x0040, 0x16f9: 0x0340, 0x16fa: 0x0340, 0x16fb: 0x0340, 0x16fc: 0x0040, 0x16fd: 0x0040, 0x16fe: 0x0040, 0x16ff: 0x0040, // Block 0x5c, offset 0x1700 0x1700: 0x0a08, 0x1701: 0x0a08, 0x1702: 0x0a08, 0x1703: 0x0a08, 0x1704: 0x0a08, 0x1705: 0x0c08, 0x1706: 0x0808, 0x1707: 0x0c08, 0x1708: 0x0818, 0x1709: 0x0c08, 0x170a: 0x0c08, 0x170b: 0x0808, 0x170c: 0x0808, 0x170d: 0x0908, 0x170e: 0x0c08, 0x170f: 0x0c08, 0x1710: 0x0c08, 0x1711: 0x0c08, 0x1712: 0x0c08, 0x1713: 0x0a08, 0x1714: 0x0a08, 0x1715: 0x0a08, 0x1716: 0x0a08, 0x1717: 0x0908, 0x1718: 0x0a08, 0x1719: 0x0a08, 0x171a: 0x0a08, 0x171b: 0x0a08, 0x171c: 0x0a08, 0x171d: 0x0c08, 0x171e: 0x0a08, 0x171f: 0x0a08, 0x1720: 0x0a08, 0x1721: 0x0c08, 0x1722: 0x0808, 0x1723: 0x0808, 0x1724: 0x0c08, 0x1725: 0x3308, 0x1726: 0x3308, 0x1727: 0x0040, 0x1728: 0x0040, 0x1729: 0x0040, 0x172a: 0x0040, 0x172b: 0x0a18, 0x172c: 0x0a18, 0x172d: 0x0a18, 0x172e: 0x0a18, 0x172f: 0x0c18, 0x1730: 0x0818, 0x1731: 0x0818, 0x1732: 0x0818, 0x1733: 0x0818, 0x1734: 0x0818, 0x1735: 0x0818, 0x1736: 0x0818, 0x1737: 0x0040, 0x1738: 0x0040, 0x1739: 0x0040, 0x173a: 0x0040, 0x173b: 0x0040, 0x173c: 0x0040, 0x173d: 0x0040, 0x173e: 0x0040, 0x173f: 0x0040, // Block 0x5d, offset 0x1740 0x1740: 0x0a08, 0x1741: 0x0c08, 0x1742: 0x0a08, 0x1743: 0x0c08, 0x1744: 0x0c08, 0x1745: 0x0c08, 0x1746: 0x0a08, 0x1747: 0x0a08, 0x1748: 0x0a08, 0x1749: 0x0c08, 0x174a: 0x0a08, 0x174b: 0x0a08, 0x174c: 0x0c08, 0x174d: 0x0a08, 0x174e: 0x0c08, 0x174f: 0x0c08, 0x1750: 0x0a08, 0x1751: 0x0c08, 0x1752: 0x0040, 0x1753: 0x0040, 0x1754: 0x0040, 0x1755: 0x0040, 0x1756: 0x0040, 0x1757: 0x0040, 0x1758: 0x0040, 0x1759: 0x0818, 0x175a: 0x0818, 0x175b: 0x0818, 0x175c: 0x0818, 0x175d: 0x0040, 0x175e: 0x0040, 0x175f: 0x0040, 0x1760: 0x0040, 0x1761: 0x0040, 0x1762: 0x0040, 0x1763: 0x0040, 0x1764: 0x0040, 0x1765: 0x0040, 0x1766: 0x0040, 0x1767: 0x0040, 0x1768: 0x0040, 0x1769: 0x0c18, 0x176a: 0x0c18, 0x176b: 0x0c18, 0x176c: 0x0c18, 0x176d: 0x0a18, 0x176e: 0x0a18, 0x176f: 0x0818, 0x1770: 0x0040, 0x1771: 0x0040, 0x1772: 0x0040, 0x1773: 0x0040, 0x1774: 0x0040, 0x1775: 0x0040, 0x1776: 0x0040, 0x1777: 0x0040, 0x1778: 0x0040, 0x1779: 0x0040, 0x177a: 0x0040, 0x177b: 0x0040, 0x177c: 0x0040, 0x177d: 0x0040, 0x177e: 0x0040, 0x177f: 0x0040, // Block 0x5e, offset 0x1780 0x1780: 0x3308, 0x1781: 0x3308, 0x1782: 0x3008, 0x1783: 0x3008, 0x1784: 0x0040, 0x1785: 0x0008, 0x1786: 0x0008, 0x1787: 0x0008, 0x1788: 0x0008, 0x1789: 0x0008, 0x178a: 0x0008, 0x178b: 0x0008, 0x178c: 0x0008, 0x178d: 0x0040, 0x178e: 0x0040, 0x178f: 0x0008, 0x1790: 0x0008, 0x1791: 0x0040, 0x1792: 0x0040, 0x1793: 0x0008, 0x1794: 0x0008, 0x1795: 0x0008, 0x1796: 0x0008, 0x1797: 0x0008, 0x1798: 0x0008, 0x1799: 0x0008, 0x179a: 0x0008, 0x179b: 0x0008, 0x179c: 0x0008, 0x179d: 0x0008, 0x179e: 0x0008, 0x179f: 0x0008, 0x17a0: 0x0008, 0x17a1: 0x0008, 0x17a2: 0x0008, 0x17a3: 0x0008, 0x17a4: 0x0008, 0x17a5: 0x0008, 0x17a6: 0x0008, 0x17a7: 0x0008, 0x17a8: 0x0008, 0x17a9: 0x0040, 0x17aa: 0x0008, 0x17ab: 0x0008, 0x17ac: 0x0008, 0x17ad: 0x0008, 0x17ae: 0x0008, 0x17af: 0x0008, 0x17b0: 0x0008, 0x17b1: 0x0040, 0x17b2: 0x0008, 0x17b3: 0x0008, 0x17b4: 0x0040, 0x17b5: 0x0008, 0x17b6: 0x0008, 0x17b7: 0x0008, 0x17b8: 0x0008, 0x17b9: 0x0008, 0x17ba: 0x0040, 0x17bb: 0x0040, 0x17bc: 0x3308, 0x17bd: 0x0008, 0x17be: 0x3008, 0x17bf: 0x3008, // Block 0x5f, offset 0x17c0 0x17c0: 0x3308, 0x17c1: 0x3008, 0x17c2: 0x3008, 0x17c3: 0x3008, 0x17c4: 0x3008, 0x17c5: 0x0040, 0x17c6: 0x0040, 0x17c7: 0x3008, 0x17c8: 0x3008, 0x17c9: 0x0040, 0x17ca: 0x0040, 0x17cb: 0x3008, 0x17cc: 0x3008, 0x17cd: 0x3808, 0x17ce: 0x0040, 0x17cf: 0x0040, 0x17d0: 0x0008, 0x17d1: 0x0040, 0x17d2: 0x0040, 0x17d3: 0x0040, 0x17d4: 0x0040, 0x17d5: 0x0040, 0x17d6: 0x0040, 0x17d7: 0x3008, 0x17d8: 0x0040, 0x17d9: 0x0040, 0x17da: 0x0040, 0x17db: 0x0040, 0x17dc: 0x0040, 0x17dd: 0x0008, 0x17de: 0x0008, 0x17df: 0x0008, 0x17e0: 0x0008, 0x17e1: 0x0008, 0x17e2: 0x3008, 0x17e3: 0x3008, 0x17e4: 0x0040, 0x17e5: 0x0040, 0x17e6: 0x3308, 0x17e7: 0x3308, 0x17e8: 0x3308, 0x17e9: 0x3308, 0x17ea: 0x3308, 0x17eb: 0x3308, 0x17ec: 0x3308, 0x17ed: 0x0040, 0x17ee: 0x0040, 0x17ef: 0x0040, 0x17f0: 0x3308, 0x17f1: 0x3308, 0x17f2: 0x3308, 0x17f3: 0x3308, 0x17f4: 0x3308, 0x17f5: 0x0040, 0x17f6: 0x0040, 0x17f7: 0x0040, 0x17f8: 0x0040, 0x17f9: 0x0040, 0x17fa: 0x0040, 0x17fb: 0x0040, 0x17fc: 0x0040, 0x17fd: 0x0040, 0x17fe: 0x0040, 0x17ff: 0x0040, // Block 0x60, offset 0x1800 0x1800: 0x0039, 0x1801: 0x0ee9, 0x1802: 0x1159, 0x1803: 0x0ef9, 0x1804: 0x0f09, 0x1805: 0x1199, 0x1806: 0x0f31, 0x1807: 0x0249, 0x1808: 0x0f41, 0x1809: 0x0259, 0x180a: 0x0f51, 0x180b: 0x0359, 0x180c: 0x0f61, 0x180d: 0x0f71, 0x180e: 0x00d9, 0x180f: 0x0f99, 0x1810: 0x2039, 0x1811: 0x0269, 0x1812: 0x01d9, 0x1813: 0x0fa9, 0x1814: 0x0fb9, 0x1815: 0x1089, 0x1816: 0x0279, 0x1817: 0x0369, 0x1818: 0x0289, 0x1819: 0x13d1, 0x181a: 0x0039, 0x181b: 0x0ee9, 0x181c: 0x1159, 0x181d: 0x0ef9, 0x181e: 0x0f09, 0x181f: 0x1199, 0x1820: 0x0f31, 0x1821: 0x0249, 0x1822: 0x0f41, 0x1823: 0x0259, 0x1824: 0x0f51, 0x1825: 0x0359, 0x1826: 0x0f61, 0x1827: 0x0f71, 0x1828: 0x00d9, 0x1829: 0x0f99, 0x182a: 0x2039, 0x182b: 0x0269, 0x182c: 0x01d9, 0x182d: 0x0fa9, 0x182e: 0x0fb9, 0x182f: 0x1089, 0x1830: 0x0279, 0x1831: 0x0369, 0x1832: 0x0289, 0x1833: 0x13d1, 0x1834: 0x0039, 0x1835: 0x0ee9, 0x1836: 0x1159, 0x1837: 0x0ef9, 0x1838: 0x0f09, 0x1839: 0x1199, 0x183a: 0x0f31, 0x183b: 0x0249, 0x183c: 0x0f41, 0x183d: 0x0259, 0x183e: 0x0f51, 0x183f: 0x0359, // Block 0x61, offset 0x1840 0x1840: 0x0f61, 0x1841: 0x0f71, 0x1842: 0x00d9, 0x1843: 0x0f99, 0x1844: 0x2039, 0x1845: 0x0269, 0x1846: 0x01d9, 0x1847: 0x0fa9, 0x1848: 0x0fb9, 0x1849: 0x1089, 0x184a: 0x0279, 0x184b: 0x0369, 0x184c: 0x0289, 0x184d: 0x13d1, 0x184e: 0x0039, 0x184f: 0x0ee9, 0x1850: 0x1159, 0x1851: 0x0ef9, 0x1852: 0x0f09, 0x1853: 0x1199, 0x1854: 0x0f31, 0x1855: 0x0040, 0x1856: 0x0f41, 0x1857: 0x0259, 0x1858: 0x0f51, 0x1859: 0x0359, 0x185a: 0x0f61, 0x185b: 0x0f71, 0x185c: 0x00d9, 0x185d: 0x0f99, 0x185e: 0x2039, 0x185f: 0x0269, 0x1860: 0x01d9, 0x1861: 0x0fa9, 0x1862: 0x0fb9, 0x1863: 0x1089, 0x1864: 0x0279, 0x1865: 0x0369, 0x1866: 0x0289, 0x1867: 0x13d1, 0x1868: 0x0039, 0x1869: 0x0ee9, 0x186a: 0x1159, 0x186b: 0x0ef9, 0x186c: 0x0f09, 0x186d: 0x1199, 0x186e: 0x0f31, 0x186f: 0x0249, 0x1870: 0x0f41, 0x1871: 0x0259, 0x1872: 0x0f51, 0x1873: 0x0359, 0x1874: 0x0f61, 0x1875: 0x0f71, 0x1876: 0x00d9, 0x1877: 0x0f99, 0x1878: 0x2039, 0x1879: 0x0269, 0x187a: 0x01d9, 0x187b: 0x0fa9, 0x187c: 0x0fb9, 0x187d: 0x1089, 0x187e: 0x0279, 0x187f: 0x0369, // Block 0x62, offset 0x1880 0x1880: 0x0289, 0x1881: 0x13d1, 0x1882: 0x0039, 0x1883: 0x0ee9, 0x1884: 0x1159, 0x1885: 0x0ef9, 0x1886: 0x0f09, 0x1887: 0x1199, 0x1888: 0x0f31, 0x1889: 0x0249, 0x188a: 0x0f41, 0x188b: 0x0259, 0x188c: 0x0f51, 0x188d: 0x0359, 0x188e: 0x0f61, 0x188f: 0x0f71, 0x1890: 0x00d9, 0x1891: 0x0f99, 0x1892: 0x2039, 0x1893: 0x0269, 0x1894: 0x01d9, 0x1895: 0x0fa9, 0x1896: 0x0fb9, 0x1897: 0x1089, 0x1898: 0x0279, 0x1899: 0x0369, 0x189a: 0x0289, 0x189b: 0x13d1, 0x189c: 0x0039, 0x189d: 0x0040, 0x189e: 0x1159, 0x189f: 0x0ef9, 0x18a0: 0x0040, 0x18a1: 0x0040, 0x18a2: 0x0f31, 0x18a3: 0x0040, 0x18a4: 0x0040, 0x18a5: 0x0259, 0x18a6: 0x0f51, 0x18a7: 0x0040, 0x18a8: 0x0040, 0x18a9: 0x0f71, 0x18aa: 0x00d9, 0x18ab: 0x0f99, 0x18ac: 0x2039, 0x18ad: 0x0040, 0x18ae: 0x01d9, 0x18af: 0x0fa9, 0x18b0: 0x0fb9, 0x18b1: 0x1089, 0x18b2: 0x0279, 0x18b3: 0x0369, 0x18b4: 0x0289, 0x18b5: 0x13d1, 0x18b6: 0x0039, 0x18b7: 0x0ee9, 0x18b8: 0x1159, 0x18b9: 0x0ef9, 0x18ba: 0x0040, 0x18bb: 0x1199, 0x18bc: 0x0040, 0x18bd: 0x0249, 0x18be: 0x0f41, 0x18bf: 0x0259, // Block 0x63, offset 0x18c0 0x18c0: 0x0f51, 0x18c1: 0x0359, 0x18c2: 0x0f61, 0x18c3: 0x0f71, 0x18c4: 0x0040, 0x18c5: 0x0f99, 0x18c6: 0x2039, 0x18c7: 0x0269, 0x18c8: 0x01d9, 0x18c9: 0x0fa9, 0x18ca: 0x0fb9, 0x18cb: 0x1089, 0x18cc: 0x0279, 0x18cd: 0x0369, 0x18ce: 0x0289, 0x18cf: 0x13d1, 0x18d0: 0x0039, 0x18d1: 0x0ee9, 0x18d2: 0x1159, 0x18d3: 0x0ef9, 0x18d4: 0x0f09, 0x18d5: 0x1199, 0x18d6: 0x0f31, 0x18d7: 0x0249, 0x18d8: 0x0f41, 0x18d9: 0x0259, 0x18da: 0x0f51, 0x18db: 0x0359, 0x18dc: 0x0f61, 0x18dd: 0x0f71, 0x18de: 0x00d9, 0x18df: 0x0f99, 0x18e0: 0x2039, 0x18e1: 0x0269, 0x18e2: 0x01d9, 0x18e3: 0x0fa9, 0x18e4: 0x0fb9, 0x18e5: 0x1089, 0x18e6: 0x0279, 0x18e7: 0x0369, 0x18e8: 0x0289, 0x18e9: 0x13d1, 0x18ea: 0x0039, 0x18eb: 0x0ee9, 0x18ec: 0x1159, 0x18ed: 0x0ef9, 0x18ee: 0x0f09, 0x18ef: 0x1199, 0x18f0: 0x0f31, 0x18f1: 0x0249, 0x18f2: 0x0f41, 0x18f3: 0x0259, 0x18f4: 0x0f51, 0x18f5: 0x0359, 0x18f6: 0x0f61, 0x18f7: 0x0f71, 0x18f8: 0x00d9, 0x18f9: 0x0f99, 0x18fa: 0x2039, 0x18fb: 0x0269, 0x18fc: 0x01d9, 0x18fd: 0x0fa9, 0x18fe: 0x0fb9, 0x18ff: 0x1089, // Block 0x64, offset 0x1900 0x1900: 0x0279, 0x1901: 0x0369, 0x1902: 0x0289, 0x1903: 0x13d1, 0x1904: 0x0039, 0x1905: 0x0ee9, 0x1906: 0x0040, 0x1907: 0x0ef9, 0x1908: 0x0f09, 0x1909: 0x1199, 0x190a: 0x0f31, 0x190b: 0x0040, 0x190c: 0x0040, 0x190d: 0x0259, 0x190e: 0x0f51, 0x190f: 0x0359, 0x1910: 0x0f61, 0x1911: 0x0f71, 0x1912: 0x00d9, 0x1913: 0x0f99, 0x1914: 0x2039, 0x1915: 0x0040, 0x1916: 0x01d9, 0x1917: 0x0fa9, 0x1918: 0x0fb9, 0x1919: 0x1089, 0x191a: 0x0279, 0x191b: 0x0369, 0x191c: 0x0289, 0x191d: 0x0040, 0x191e: 0x0039, 0x191f: 0x0ee9, 0x1920: 0x1159, 0x1921: 0x0ef9, 0x1922: 0x0f09, 0x1923: 0x1199, 0x1924: 0x0f31, 0x1925: 0x0249, 0x1926: 0x0f41, 0x1927: 0x0259, 0x1928: 0x0f51, 0x1929: 0x0359, 0x192a: 0x0f61, 0x192b: 0x0f71, 0x192c: 0x00d9, 0x192d: 0x0f99, 0x192e: 0x2039, 0x192f: 0x0269, 0x1930: 0x01d9, 0x1931: 0x0fa9, 0x1932: 0x0fb9, 0x1933: 0x1089, 0x1934: 0x0279, 0x1935: 0x0369, 0x1936: 0x0289, 0x1937: 0x13d1, 0x1938: 0x0039, 0x1939: 0x0ee9, 0x193a: 0x0040, 0x193b: 0x0ef9, 0x193c: 0x0f09, 0x193d: 0x1199, 0x193e: 0x0f31, 0x193f: 0x0040, // Block 0x65, offset 0x1940 0x1940: 0x0f41, 0x1941: 0x0259, 0x1942: 0x0f51, 0x1943: 0x0359, 0x1944: 0x0f61, 0x1945: 0x0040, 0x1946: 0x00d9, 0x1947: 0x0040, 0x1948: 0x0040, 0x1949: 0x0040, 0x194a: 0x01d9, 0x194b: 0x0fa9, 0x194c: 0x0fb9, 0x194d: 0x1089, 0x194e: 0x0279, 0x194f: 0x0369, 0x1950: 0x0289, 0x1951: 0x0040, 0x1952: 0x0039, 0x1953: 0x0ee9, 0x1954: 0x1159, 0x1955: 0x0ef9, 0x1956: 0x0f09, 0x1957: 0x1199, 0x1958: 0x0f31, 0x1959: 0x0249, 0x195a: 0x0f41, 0x195b: 0x0259, 0x195c: 0x0f51, 0x195d: 0x0359, 0x195e: 0x0f61, 0x195f: 0x0f71, 0x1960: 0x00d9, 0x1961: 0x0f99, 0x1962: 0x2039, 0x1963: 0x0269, 0x1964: 0x01d9, 0x1965: 0x0fa9, 0x1966: 0x0fb9, 0x1967: 0x1089, 0x1968: 0x0279, 0x1969: 0x0369, 0x196a: 0x0289, 0x196b: 0x13d1, 0x196c: 0x0039, 0x196d: 0x0ee9, 0x196e: 0x1159, 0x196f: 0x0ef9, 0x1970: 0x0f09, 0x1971: 0x1199, 0x1972: 0x0f31, 0x1973: 0x0249, 0x1974: 0x0f41, 0x1975: 0x0259, 0x1976: 0x0f51, 0x1977: 0x0359, 0x1978: 0x0f61, 0x1979: 0x0f71, 0x197a: 0x00d9, 0x197b: 0x0f99, 0x197c: 0x2039, 0x197d: 0x0269, 0x197e: 0x01d9, 0x197f: 0x0fa9, // Block 0x66, offset 0x1980 0x1980: 0x0fb9, 0x1981: 0x1089, 0x1982: 0x0279, 0x1983: 0x0369, 0x1984: 0x0289, 0x1985: 0x13d1, 0x1986: 0x0039, 0x1987: 0x0ee9, 0x1988: 0x1159, 0x1989: 0x0ef9, 0x198a: 0x0f09, 0x198b: 0x1199, 0x198c: 0x0f31, 0x198d: 0x0249, 0x198e: 0x0f41, 0x198f: 0x0259, 0x1990: 0x0f51, 0x1991: 0x0359, 0x1992: 0x0f61, 0x1993: 0x0f71, 0x1994: 0x00d9, 0x1995: 0x0f99, 0x1996: 0x2039, 0x1997: 0x0269, 0x1998: 0x01d9, 0x1999: 0x0fa9, 0x199a: 0x0fb9, 0x199b: 0x1089, 0x199c: 0x0279, 0x199d: 0x0369, 0x199e: 0x0289, 0x199f: 0x13d1, 0x19a0: 0x0039, 0x19a1: 0x0ee9, 0x19a2: 0x1159, 0x19a3: 0x0ef9, 0x19a4: 0x0f09, 0x19a5: 0x1199, 0x19a6: 0x0f31, 0x19a7: 0x0249, 0x19a8: 0x0f41, 0x19a9: 0x0259, 0x19aa: 0x0f51, 0x19ab: 0x0359, 0x19ac: 0x0f61, 0x19ad: 0x0f71, 0x19ae: 0x00d9, 0x19af: 0x0f99, 0x19b0: 0x2039, 0x19b1: 0x0269, 0x19b2: 0x01d9, 0x19b3: 0x0fa9, 0x19b4: 0x0fb9, 0x19b5: 0x1089, 0x19b6: 0x0279, 0x19b7: 0x0369, 0x19b8: 0x0289, 0x19b9: 0x13d1, 0x19ba: 0x0039, 0x19bb: 0x0ee9, 0x19bc: 0x1159, 0x19bd: 0x0ef9, 0x19be: 0x0f09, 0x19bf: 0x1199, // Block 0x67, offset 0x19c0 0x19c0: 0x0f31, 0x19c1: 0x0249, 0x19c2: 0x0f41, 0x19c3: 0x0259, 0x19c4: 0x0f51, 0x19c5: 0x0359, 0x19c6: 0x0f61, 0x19c7: 0x0f71, 0x19c8: 0x00d9, 0x19c9: 0x0f99, 0x19ca: 0x2039, 0x19cb: 0x0269, 0x19cc: 0x01d9, 0x19cd: 0x0fa9, 0x19ce: 0x0fb9, 0x19cf: 0x1089, 0x19d0: 0x0279, 0x19d1: 0x0369, 0x19d2: 0x0289, 0x19d3: 0x13d1, 0x19d4: 0x0039, 0x19d5: 0x0ee9, 0x19d6: 0x1159, 0x19d7: 0x0ef9, 0x19d8: 0x0f09, 0x19d9: 0x1199, 0x19da: 0x0f31, 0x19db: 0x0249, 0x19dc: 0x0f41, 0x19dd: 0x0259, 0x19de: 0x0f51, 0x19df: 0x0359, 0x19e0: 0x0f61, 0x19e1: 0x0f71, 0x19e2: 0x00d9, 0x19e3: 0x0f99, 0x19e4: 0x2039, 0x19e5: 0x0269, 0x19e6: 0x01d9, 0x19e7: 0x0fa9, 0x19e8: 0x0fb9, 0x19e9: 0x1089, 0x19ea: 0x0279, 0x19eb: 0x0369, 0x19ec: 0x0289, 0x19ed: 0x13d1, 0x19ee: 0x0039, 0x19ef: 0x0ee9, 0x19f0: 0x1159, 0x19f1: 0x0ef9, 0x19f2: 0x0f09, 0x19f3: 0x1199, 0x19f4: 0x0f31, 0x19f5: 0x0249, 0x19f6: 0x0f41, 0x19f7: 0x0259, 0x19f8: 0x0f51, 0x19f9: 0x0359, 0x19fa: 0x0f61, 0x19fb: 0x0f71, 0x19fc: 0x00d9, 0x19fd: 0x0f99, 0x19fe: 0x2039, 0x19ff: 0x0269, // Block 0x68, offset 0x1a00 0x1a00: 0x01d9, 0x1a01: 0x0fa9, 0x1a02: 0x0fb9, 0x1a03: 0x1089, 0x1a04: 0x0279, 0x1a05: 0x0369, 0x1a06: 0x0289, 0x1a07: 0x13d1, 0x1a08: 0x0039, 0x1a09: 0x0ee9, 0x1a0a: 0x1159, 0x1a0b: 0x0ef9, 0x1a0c: 0x0f09, 0x1a0d: 0x1199, 0x1a0e: 0x0f31, 0x1a0f: 0x0249, 0x1a10: 0x0f41, 0x1a11: 0x0259, 0x1a12: 0x0f51, 0x1a13: 0x0359, 0x1a14: 0x0f61, 0x1a15: 0x0f71, 0x1a16: 0x00d9, 0x1a17: 0x0f99, 0x1a18: 0x2039, 0x1a19: 0x0269, 0x1a1a: 0x01d9, 0x1a1b: 0x0fa9, 0x1a1c: 0x0fb9, 0x1a1d: 0x1089, 0x1a1e: 0x0279, 0x1a1f: 0x0369, 0x1a20: 0x0289, 0x1a21: 0x13d1, 0x1a22: 0x0039, 0x1a23: 0x0ee9, 0x1a24: 0x1159, 0x1a25: 0x0ef9, 0x1a26: 0x0f09, 0x1a27: 0x1199, 0x1a28: 0x0f31, 0x1a29: 0x0249, 0x1a2a: 0x0f41, 0x1a2b: 0x0259, 0x1a2c: 0x0f51, 0x1a2d: 0x0359, 0x1a2e: 0x0f61, 0x1a2f: 0x0f71, 0x1a30: 0x00d9, 0x1a31: 0x0f99, 0x1a32: 0x2039, 0x1a33: 0x0269, 0x1a34: 0x01d9, 0x1a35: 0x0fa9, 0x1a36: 0x0fb9, 0x1a37: 0x1089, 0x1a38: 0x0279, 0x1a39: 0x0369, 0x1a3a: 0x0289, 0x1a3b: 0x13d1, 0x1a3c: 0x0039, 0x1a3d: 0x0ee9, 0x1a3e: 0x1159, 0x1a3f: 0x0ef9, // Block 0x69, offset 0x1a40 0x1a40: 0x0f09, 0x1a41: 0x1199, 0x1a42: 0x0f31, 0x1a43: 0x0249, 0x1a44: 0x0f41, 0x1a45: 0x0259, 0x1a46: 0x0f51, 0x1a47: 0x0359, 0x1a48: 0x0f61, 0x1a49: 0x0f71, 0x1a4a: 0x00d9, 0x1a4b: 0x0f99, 0x1a4c: 0x2039, 0x1a4d: 0x0269, 0x1a4e: 0x01d9, 0x1a4f: 0x0fa9, 0x1a50: 0x0fb9, 0x1a51: 0x1089, 0x1a52: 0x0279, 0x1a53: 0x0369, 0x1a54: 0x0289, 0x1a55: 0x13d1, 0x1a56: 0x0039, 0x1a57: 0x0ee9, 0x1a58: 0x1159, 0x1a59: 0x0ef9, 0x1a5a: 0x0f09, 0x1a5b: 0x1199, 0x1a5c: 0x0f31, 0x1a5d: 0x0249, 0x1a5e: 0x0f41, 0x1a5f: 0x0259, 0x1a60: 0x0f51, 0x1a61: 0x0359, 0x1a62: 0x0f61, 0x1a63: 0x0f71, 0x1a64: 0x00d9, 0x1a65: 0x0f99, 0x1a66: 0x2039, 0x1a67: 0x0269, 0x1a68: 0x01d9, 0x1a69: 0x0fa9, 0x1a6a: 0x0fb9, 0x1a6b: 0x1089, 0x1a6c: 0x0279, 0x1a6d: 0x0369, 0x1a6e: 0x0289, 0x1a6f: 0x13d1, 0x1a70: 0x0039, 0x1a71: 0x0ee9, 0x1a72: 0x1159, 0x1a73: 0x0ef9, 0x1a74: 0x0f09, 0x1a75: 0x1199, 0x1a76: 0x0f31, 0x1a77: 0x0249, 0x1a78: 0x0f41, 0x1a79: 0x0259, 0x1a7a: 0x0f51, 0x1a7b: 0x0359, 0x1a7c: 0x0f61, 0x1a7d: 0x0f71, 0x1a7e: 0x00d9, 0x1a7f: 0x0f99, // Block 0x6a, offset 0x1a80 0x1a80: 0x2039, 0x1a81: 0x0269, 0x1a82: 0x01d9, 0x1a83: 0x0fa9, 0x1a84: 0x0fb9, 0x1a85: 0x1089, 0x1a86: 0x0279, 0x1a87: 0x0369, 0x1a88: 0x0289, 0x1a89: 0x13d1, 0x1a8a: 0x0039, 0x1a8b: 0x0ee9, 0x1a8c: 0x1159, 0x1a8d: 0x0ef9, 0x1a8e: 0x0f09, 0x1a8f: 0x1199, 0x1a90: 0x0f31, 0x1a91: 0x0249, 0x1a92: 0x0f41, 0x1a93: 0x0259, 0x1a94: 0x0f51, 0x1a95: 0x0359, 0x1a96: 0x0f61, 0x1a97: 0x0f71, 0x1a98: 0x00d9, 0x1a99: 0x0f99, 0x1a9a: 0x2039, 0x1a9b: 0x0269, 0x1a9c: 0x01d9, 0x1a9d: 0x0fa9, 0x1a9e: 0x0fb9, 0x1a9f: 0x1089, 0x1aa0: 0x0279, 0x1aa1: 0x0369, 0x1aa2: 0x0289, 0x1aa3: 0x13d1, 0x1aa4: 0xba81, 0x1aa5: 0xba99, 0x1aa6: 0x0040, 0x1aa7: 0x0040, 0x1aa8: 0xbab1, 0x1aa9: 0x1099, 0x1aaa: 0x10b1, 0x1aab: 0x10c9, 0x1aac: 0xbac9, 0x1aad: 0xbae1, 0x1aae: 0xbaf9, 0x1aaf: 0x1429, 0x1ab0: 0x1a31, 0x1ab1: 0xbb11, 0x1ab2: 0xbb29, 0x1ab3: 0xbb41, 0x1ab4: 0xbb59, 0x1ab5: 0xbb71, 0x1ab6: 0xbb89, 0x1ab7: 0x2109, 0x1ab8: 0x1111, 0x1ab9: 0x1429, 0x1aba: 0xbba1, 0x1abb: 0xbbb9, 0x1abc: 0xbbd1, 0x1abd: 0x10e1, 0x1abe: 0x10f9, 0x1abf: 0xbbe9, // Block 0x6b, offset 0x1ac0 0x1ac0: 0x2079, 0x1ac1: 0xbc01, 0x1ac2: 0xbab1, 0x1ac3: 0x1099, 0x1ac4: 0x10b1, 0x1ac5: 0x10c9, 0x1ac6: 0xbac9, 0x1ac7: 0xbae1, 0x1ac8: 0xbaf9, 0x1ac9: 0x1429, 0x1aca: 0x1a31, 0x1acb: 0xbb11, 0x1acc: 0xbb29, 0x1acd: 0xbb41, 0x1ace: 0xbb59, 0x1acf: 0xbb71, 0x1ad0: 0xbb89, 0x1ad1: 0x2109, 0x1ad2: 0x1111, 0x1ad3: 0xbba1, 0x1ad4: 0xbba1, 0x1ad5: 0xbbb9, 0x1ad6: 0xbbd1, 0x1ad7: 0x10e1, 0x1ad8: 0x10f9, 0x1ad9: 0xbbe9, 0x1ada: 0x2079, 0x1adb: 0xbc21, 0x1adc: 0xbac9, 0x1add: 0x1429, 0x1ade: 0xbb11, 0x1adf: 0x10e1, 0x1ae0: 0x1111, 0x1ae1: 0x2109, 0x1ae2: 0xbab1, 0x1ae3: 0x1099, 0x1ae4: 0x10b1, 0x1ae5: 0x10c9, 0x1ae6: 0xbac9, 0x1ae7: 0xbae1, 0x1ae8: 0xbaf9, 0x1ae9: 0x1429, 0x1aea: 0x1a31, 0x1aeb: 0xbb11, 0x1aec: 0xbb29, 0x1aed: 0xbb41, 0x1aee: 0xbb59, 0x1aef: 0xbb71, 0x1af0: 0xbb89, 0x1af1: 0x2109, 0x1af2: 0x1111, 0x1af3: 0x1429, 0x1af4: 0xbba1, 0x1af5: 0xbbb9, 0x1af6: 0xbbd1, 0x1af7: 0x10e1, 0x1af8: 0x10f9, 0x1af9: 0xbbe9, 0x1afa: 0x2079, 0x1afb: 0xbc01, 0x1afc: 0xbab1, 0x1afd: 0x1099, 0x1afe: 0x10b1, 0x1aff: 0x10c9, // Block 0x6c, offset 0x1b00 0x1b00: 0xbac9, 0x1b01: 0xbae1, 0x1b02: 0xbaf9, 0x1b03: 0x1429, 0x1b04: 0x1a31, 0x1b05: 0xbb11, 0x1b06: 0xbb29, 0x1b07: 0xbb41, 0x1b08: 0xbb59, 0x1b09: 0xbb71, 0x1b0a: 0xbb89, 0x1b0b: 0x2109, 0x1b0c: 0x1111, 0x1b0d: 0xbba1, 0x1b0e: 0xbba1, 0x1b0f: 0xbbb9, 0x1b10: 0xbbd1, 0x1b11: 0x10e1, 0x1b12: 0x10f9, 0x1b13: 0xbbe9, 0x1b14: 0x2079, 0x1b15: 0xbc21, 0x1b16: 0xbac9, 0x1b17: 0x1429, 0x1b18: 0xbb11, 0x1b19: 0x10e1, 0x1b1a: 0x1111, 0x1b1b: 0x2109, 0x1b1c: 0xbab1, 0x1b1d: 0x1099, 0x1b1e: 0x10b1, 0x1b1f: 0x10c9, 0x1b20: 0xbac9, 0x1b21: 0xbae1, 0x1b22: 0xbaf9, 0x1b23: 0x1429, 0x1b24: 0x1a31, 0x1b25: 0xbb11, 0x1b26: 0xbb29, 0x1b27: 0xbb41, 0x1b28: 0xbb59, 0x1b29: 0xbb71, 0x1b2a: 0xbb89, 0x1b2b: 0x2109, 0x1b2c: 0x1111, 0x1b2d: 0x1429, 0x1b2e: 0xbba1, 0x1b2f: 0xbbb9, 0x1b30: 0xbbd1, 0x1b31: 0x10e1, 0x1b32: 0x10f9, 0x1b33: 0xbbe9, 0x1b34: 0x2079, 0x1b35: 0xbc01, 0x1b36: 0xbab1, 0x1b37: 0x1099, 0x1b38: 0x10b1, 0x1b39: 0x10c9, 0x1b3a: 0xbac9, 0x1b3b: 0xbae1, 0x1b3c: 0xbaf9, 0x1b3d: 0x1429, 0x1b3e: 0x1a31, 0x1b3f: 0xbb11, // Block 0x6d, offset 0x1b40 0x1b40: 0xbb29, 0x1b41: 0xbb41, 0x1b42: 0xbb59, 0x1b43: 0xbb71, 0x1b44: 0xbb89, 0x1b45: 0x2109, 0x1b46: 0x1111, 0x1b47: 0xbba1, 0x1b48: 0xbba1, 0x1b49: 0xbbb9, 0x1b4a: 0xbbd1, 0x1b4b: 0x10e1, 0x1b4c: 0x10f9, 0x1b4d: 0xbbe9, 0x1b4e: 0x2079, 0x1b4f: 0xbc21, 0x1b50: 0xbac9, 0x1b51: 0x1429, 0x1b52: 0xbb11, 0x1b53: 0x10e1, 0x1b54: 0x1111, 0x1b55: 0x2109, 0x1b56: 0xbab1, 0x1b57: 0x1099, 0x1b58: 0x10b1, 0x1b59: 0x10c9, 0x1b5a: 0xbac9, 0x1b5b: 0xbae1, 0x1b5c: 0xbaf9, 0x1b5d: 0x1429, 0x1b5e: 0x1a31, 0x1b5f: 0xbb11, 0x1b60: 0xbb29, 0x1b61: 0xbb41, 0x1b62: 0xbb59, 0x1b63: 0xbb71, 0x1b64: 0xbb89, 0x1b65: 0x2109, 0x1b66: 0x1111, 0x1b67: 0x1429, 0x1b68: 0xbba1, 0x1b69: 0xbbb9, 0x1b6a: 0xbbd1, 0x1b6b: 0x10e1, 0x1b6c: 0x10f9, 0x1b6d: 0xbbe9, 0x1b6e: 0x2079, 0x1b6f: 0xbc01, 0x1b70: 0xbab1, 0x1b71: 0x1099, 0x1b72: 0x10b1, 0x1b73: 0x10c9, 0x1b74: 0xbac9, 0x1b75: 0xbae1, 0x1b76: 0xbaf9, 0x1b77: 0x1429, 0x1b78: 0x1a31, 0x1b79: 0xbb11, 0x1b7a: 0xbb29, 0x1b7b: 0xbb41, 0x1b7c: 0xbb59, 0x1b7d: 0xbb71, 0x1b7e: 0xbb89, 0x1b7f: 0x2109, // Block 0x6e, offset 0x1b80 0x1b80: 0x1111, 0x1b81: 0xbba1, 0x1b82: 0xbba1, 0x1b83: 0xbbb9, 0x1b84: 0xbbd1, 0x1b85: 0x10e1, 0x1b86: 0x10f9, 0x1b87: 0xbbe9, 0x1b88: 0x2079, 0x1b89: 0xbc21, 0x1b8a: 0xbac9, 0x1b8b: 0x1429, 0x1b8c: 0xbb11, 0x1b8d: 0x10e1, 0x1b8e: 0x1111, 0x1b8f: 0x2109, 0x1b90: 0xbab1, 0x1b91: 0x1099, 0x1b92: 0x10b1, 0x1b93: 0x10c9, 0x1b94: 0xbac9, 0x1b95: 0xbae1, 0x1b96: 0xbaf9, 0x1b97: 0x1429, 0x1b98: 0x1a31, 0x1b99: 0xbb11, 0x1b9a: 0xbb29, 0x1b9b: 0xbb41, 0x1b9c: 0xbb59, 0x1b9d: 0xbb71, 0x1b9e: 0xbb89, 0x1b9f: 0x2109, 0x1ba0: 0x1111, 0x1ba1: 0x1429, 0x1ba2: 0xbba1, 0x1ba3: 0xbbb9, 0x1ba4: 0xbbd1, 0x1ba5: 0x10e1, 0x1ba6: 0x10f9, 0x1ba7: 0xbbe9, 0x1ba8: 0x2079, 0x1ba9: 0xbc01, 0x1baa: 0xbab1, 0x1bab: 0x1099, 0x1bac: 0x10b1, 0x1bad: 0x10c9, 0x1bae: 0xbac9, 0x1baf: 0xbae1, 0x1bb0: 0xbaf9, 0x1bb1: 0x1429, 0x1bb2: 0x1a31, 0x1bb3: 0xbb11, 0x1bb4: 0xbb29, 0x1bb5: 0xbb41, 0x1bb6: 0xbb59, 0x1bb7: 0xbb71, 0x1bb8: 0xbb89, 0x1bb9: 0x2109, 0x1bba: 0x1111, 0x1bbb: 0xbba1, 0x1bbc: 0xbba1, 0x1bbd: 0xbbb9, 0x1bbe: 0xbbd1, 0x1bbf: 0x10e1, // Block 0x6f, offset 0x1bc0 0x1bc0: 0x10f9, 0x1bc1: 0xbbe9, 0x1bc2: 0x2079, 0x1bc3: 0xbc21, 0x1bc4: 0xbac9, 0x1bc5: 0x1429, 0x1bc6: 0xbb11, 0x1bc7: 0x10e1, 0x1bc8: 0x1111, 0x1bc9: 0x2109, 0x1bca: 0xbc41, 0x1bcb: 0xbc41, 0x1bcc: 0x0040, 0x1bcd: 0x0040, 0x1bce: 0x1f41, 0x1bcf: 0x00c9, 0x1bd0: 0x0069, 0x1bd1: 0x0079, 0x1bd2: 0x1f51, 0x1bd3: 0x1f61, 0x1bd4: 0x1f71, 0x1bd5: 0x1f81, 0x1bd6: 0x1f91, 0x1bd7: 0x1fa1, 0x1bd8: 0x1f41, 0x1bd9: 0x00c9, 0x1bda: 0x0069, 0x1bdb: 0x0079, 0x1bdc: 0x1f51, 0x1bdd: 0x1f61, 0x1bde: 0x1f71, 0x1bdf: 0x1f81, 0x1be0: 0x1f91, 0x1be1: 0x1fa1, 0x1be2: 0x1f41, 0x1be3: 0x00c9, 0x1be4: 0x0069, 0x1be5: 0x0079, 0x1be6: 0x1f51, 0x1be7: 0x1f61, 0x1be8: 0x1f71, 0x1be9: 0x1f81, 0x1bea: 0x1f91, 0x1beb: 0x1fa1, 0x1bec: 0x1f41, 0x1bed: 0x00c9, 0x1bee: 0x0069, 0x1bef: 0x0079, 0x1bf0: 0x1f51, 0x1bf1: 0x1f61, 0x1bf2: 0x1f71, 0x1bf3: 0x1f81, 0x1bf4: 0x1f91, 0x1bf5: 0x1fa1, 0x1bf6: 0x1f41, 0x1bf7: 0x00c9, 0x1bf8: 0x0069, 0x1bf9: 0x0079, 0x1bfa: 0x1f51, 0x1bfb: 0x1f61, 0x1bfc: 0x1f71, 0x1bfd: 0x1f81, 0x1bfe: 0x1f91, 0x1bff: 0x1fa1, // Block 0x70, offset 0x1c00 0x1c00: 0xe115, 0x1c01: 0xe115, 0x1c02: 0xe135, 0x1c03: 0xe135, 0x1c04: 0xe115, 0x1c05: 0xe115, 0x1c06: 0xe175, 0x1c07: 0xe175, 0x1c08: 0xe115, 0x1c09: 0xe115, 0x1c0a: 0xe135, 0x1c0b: 0xe135, 0x1c0c: 0xe115, 0x1c0d: 0xe115, 0x1c0e: 0xe1f5, 0x1c0f: 0xe1f5, 0x1c10: 0xe115, 0x1c11: 0xe115, 0x1c12: 0xe135, 0x1c13: 0xe135, 0x1c14: 0xe115, 0x1c15: 0xe115, 0x1c16: 0xe175, 0x1c17: 0xe175, 0x1c18: 0xe115, 0x1c19: 0xe115, 0x1c1a: 0xe135, 0x1c1b: 0xe135, 0x1c1c: 0xe115, 0x1c1d: 0xe115, 0x1c1e: 0x8b05, 0x1c1f: 0x8b05, 0x1c20: 0x04b5, 0x1c21: 0x04b5, 0x1c22: 0x0a08, 0x1c23: 0x0a08, 0x1c24: 0x0a08, 0x1c25: 0x0a08, 0x1c26: 0x0a08, 0x1c27: 0x0a08, 0x1c28: 0x0a08, 0x1c29: 0x0a08, 0x1c2a: 0x0a08, 0x1c2b: 0x0a08, 0x1c2c: 0x0a08, 0x1c2d: 0x0a08, 0x1c2e: 0x0a08, 0x1c2f: 0x0a08, 0x1c30: 0x0a08, 0x1c31: 0x0a08, 0x1c32: 0x0a08, 0x1c33: 0x0a08, 0x1c34: 0x0a08, 0x1c35: 0x0a08, 0x1c36: 0x0a08, 0x1c37: 0x0a08, 0x1c38: 0x0a08, 0x1c39: 0x0a08, 0x1c3a: 0x0a08, 0x1c3b: 0x0a08, 0x1c3c: 0x0a08, 0x1c3d: 0x0a08, 0x1c3e: 0x0a08, 0x1c3f: 0x0a08, // Block 0x71, offset 0x1c40 0x1c40: 0xb189, 0x1c41: 0xb1a1, 0x1c42: 0xb201, 0x1c43: 0xb249, 0x1c44: 0x0040, 0x1c45: 0xb411, 0x1c46: 0xb291, 0x1c47: 0xb219, 0x1c48: 0xb309, 0x1c49: 0xb429, 0x1c4a: 0xb399, 0x1c4b: 0xb3b1, 0x1c4c: 0xb3c9, 0x1c4d: 0xb3e1, 0x1c4e: 0xb2a9, 0x1c4f: 0xb339, 0x1c50: 0xb369, 0x1c51: 0xb2d9, 0x1c52: 0xb381, 0x1c53: 0xb279, 0x1c54: 0xb2c1, 0x1c55: 0xb1d1, 0x1c56: 0xb1e9, 0x1c57: 0xb231, 0x1c58: 0xb261, 0x1c59: 0xb2f1, 0x1c5a: 0xb321, 0x1c5b: 0xb351, 0x1c5c: 0xbc59, 0x1c5d: 0x7949, 0x1c5e: 0xbc71, 0x1c5f: 0xbc89, 0x1c60: 0x0040, 0x1c61: 0xb1a1, 0x1c62: 0xb201, 0x1c63: 0x0040, 0x1c64: 0xb3f9, 0x1c65: 0x0040, 0x1c66: 0x0040, 0x1c67: 0xb219, 0x1c68: 0x0040, 0x1c69: 0xb429, 0x1c6a: 0xb399, 0x1c6b: 0xb3b1, 0x1c6c: 0xb3c9, 0x1c6d: 0xb3e1, 0x1c6e: 0xb2a9, 0x1c6f: 0xb339, 0x1c70: 0xb369, 0x1c71: 0xb2d9, 0x1c72: 0xb381, 0x1c73: 0x0040, 0x1c74: 0xb2c1, 0x1c75: 0xb1d1, 0x1c76: 0xb1e9, 0x1c77: 0xb231, 0x1c78: 0x0040, 0x1c79: 0xb2f1, 0x1c7a: 0x0040, 0x1c7b: 0xb351, 0x1c7c: 0x0040, 0x1c7d: 0x0040, 0x1c7e: 0x0040, 0x1c7f: 0x0040, // Block 0x72, offset 0x1c80 0x1c80: 0x0040, 0x1c81: 0x0040, 0x1c82: 0xb201, 0x1c83: 0x0040, 0x1c84: 0x0040, 0x1c85: 0x0040, 0x1c86: 0x0040, 0x1c87: 0xb219, 0x1c88: 0x0040, 0x1c89: 0xb429, 0x1c8a: 0x0040, 0x1c8b: 0xb3b1, 0x1c8c: 0x0040, 0x1c8d: 0xb3e1, 0x1c8e: 0xb2a9, 0x1c8f: 0xb339, 0x1c90: 0x0040, 0x1c91: 0xb2d9, 0x1c92: 0xb381, 0x1c93: 0x0040, 0x1c94: 0xb2c1, 0x1c95: 0x0040, 0x1c96: 0x0040, 0x1c97: 0xb231, 0x1c98: 0x0040, 0x1c99: 0xb2f1, 0x1c9a: 0x0040, 0x1c9b: 0xb351, 0x1c9c: 0x0040, 0x1c9d: 0x7949, 0x1c9e: 0x0040, 0x1c9f: 0xbc89, 0x1ca0: 0x0040, 0x1ca1: 0xb1a1, 0x1ca2: 0xb201, 0x1ca3: 0x0040, 0x1ca4: 0xb3f9, 0x1ca5: 0x0040, 0x1ca6: 0x0040, 0x1ca7: 0xb219, 0x1ca8: 0xb309, 0x1ca9: 0xb429, 0x1caa: 0xb399, 0x1cab: 0x0040, 0x1cac: 0xb3c9, 0x1cad: 0xb3e1, 0x1cae: 0xb2a9, 0x1caf: 0xb339, 0x1cb0: 0xb369, 0x1cb1: 0xb2d9, 0x1cb2: 0xb381, 0x1cb3: 0x0040, 0x1cb4: 0xb2c1, 0x1cb5: 0xb1d1, 0x1cb6: 0xb1e9, 0x1cb7: 0xb231, 0x1cb8: 0x0040, 0x1cb9: 0xb2f1, 0x1cba: 0xb321, 0x1cbb: 0xb351, 0x1cbc: 0xbc59, 0x1cbd: 0x0040, 0x1cbe: 0xbc71, 0x1cbf: 0x0040, // Block 0x73, offset 0x1cc0 0x1cc0: 0xb189, 0x1cc1: 0xb1a1, 0x1cc2: 0xb201, 0x1cc3: 0xb249, 0x1cc4: 0xb3f9, 0x1cc5: 0xb411, 0x1cc6: 0xb291, 0x1cc7: 0xb219, 0x1cc8: 0xb309, 0x1cc9: 0xb429, 0x1cca: 0x0040, 0x1ccb: 0xb3b1, 0x1ccc: 0xb3c9, 0x1ccd: 0xb3e1, 0x1cce: 0xb2a9, 0x1ccf: 0xb339, 0x1cd0: 0xb369, 0x1cd1: 0xb2d9, 0x1cd2: 0xb381, 0x1cd3: 0xb279, 0x1cd4: 0xb2c1, 0x1cd5: 0xb1d1, 0x1cd6: 0xb1e9, 0x1cd7: 0xb231, 0x1cd8: 0xb261, 0x1cd9: 0xb2f1, 0x1cda: 0xb321, 0x1cdb: 0xb351, 0x1cdc: 0x0040, 0x1cdd: 0x0040, 0x1cde: 0x0040, 0x1cdf: 0x0040, 0x1ce0: 0x0040, 0x1ce1: 0xb1a1, 0x1ce2: 0xb201, 0x1ce3: 0xb249, 0x1ce4: 0x0040, 0x1ce5: 0xb411, 0x1ce6: 0xb291, 0x1ce7: 0xb219, 0x1ce8: 0xb309, 0x1ce9: 0xb429, 0x1cea: 0x0040, 0x1ceb: 0xb3b1, 0x1cec: 0xb3c9, 0x1ced: 0xb3e1, 0x1cee: 0xb2a9, 0x1cef: 0xb339, 0x1cf0: 0xb369, 0x1cf1: 0xb2d9, 0x1cf2: 0xb381, 0x1cf3: 0xb279, 0x1cf4: 0xb2c1, 0x1cf5: 0xb1d1, 0x1cf6: 0xb1e9, 0x1cf7: 0xb231, 0x1cf8: 0xb261, 0x1cf9: 0xb2f1, 0x1cfa: 0xb321, 0x1cfb: 0xb351, 0x1cfc: 0x0040, 0x1cfd: 0x0040, 0x1cfe: 0x0040, 0x1cff: 0x0040, // Block 0x74, offset 0x1d00 0x1d00: 0x0040, 0x1d01: 0xbca2, 0x1d02: 0xbcba, 0x1d03: 0xbcd2, 0x1d04: 0xbcea, 0x1d05: 0xbd02, 0x1d06: 0xbd1a, 0x1d07: 0xbd32, 0x1d08: 0xbd4a, 0x1d09: 0xbd62, 0x1d0a: 0xbd7a, 0x1d0b: 0x0018, 0x1d0c: 0x0018, 0x1d0d: 0x0040, 0x1d0e: 0x0040, 0x1d0f: 0x0040, 0x1d10: 0xbd92, 0x1d11: 0xbdb2, 0x1d12: 0xbdd2, 0x1d13: 0xbdf2, 0x1d14: 0xbe12, 0x1d15: 0xbe32, 0x1d16: 0xbe52, 0x1d17: 0xbe72, 0x1d18: 0xbe92, 0x1d19: 0xbeb2, 0x1d1a: 0xbed2, 0x1d1b: 0xbef2, 0x1d1c: 0xbf12, 0x1d1d: 0xbf32, 0x1d1e: 0xbf52, 0x1d1f: 0xbf72, 0x1d20: 0xbf92, 0x1d21: 0xbfb2, 0x1d22: 0xbfd2, 0x1d23: 0xbff2, 0x1d24: 0xc012, 0x1d25: 0xc032, 0x1d26: 0xc052, 0x1d27: 0xc072, 0x1d28: 0xc092, 0x1d29: 0xc0b2, 0x1d2a: 0xc0d1, 0x1d2b: 0x1159, 0x1d2c: 0x0269, 0x1d2d: 0x6671, 0x1d2e: 0xc111, 0x1d2f: 0x0040, 0x1d30: 0x0039, 0x1d31: 0x0ee9, 0x1d32: 0x1159, 0x1d33: 0x0ef9, 0x1d34: 0x0f09, 0x1d35: 0x1199, 0x1d36: 0x0f31, 0x1d37: 0x0249, 0x1d38: 0x0f41, 0x1d39: 0x0259, 0x1d3a: 0x0f51, 0x1d3b: 0x0359, 0x1d3c: 0x0f61, 0x1d3d: 0x0f71, 0x1d3e: 0x00d9, 0x1d3f: 0x0f99, // Block 0x75, offset 0x1d40 0x1d40: 0x2039, 0x1d41: 0x0269, 0x1d42: 0x01d9, 0x1d43: 0x0fa9, 0x1d44: 0x0fb9, 0x1d45: 0x1089, 0x1d46: 0x0279, 0x1d47: 0x0369, 0x1d48: 0x0289, 0x1d49: 0x13d1, 0x1d4a: 0xc129, 0x1d4b: 0x65b1, 0x1d4c: 0xc141, 0x1d4d: 0x1441, 0x1d4e: 0xc159, 0x1d4f: 0xc179, 0x1d50: 0x0018, 0x1d51: 0x0018, 0x1d52: 0x0018, 0x1d53: 0x0018, 0x1d54: 0x0018, 0x1d55: 0x0018, 0x1d56: 0x0018, 0x1d57: 0x0018, 0x1d58: 0x0018, 0x1d59: 0x0018, 0x1d5a: 0x0018, 0x1d5b: 0x0018, 0x1d5c: 0x0018, 0x1d5d: 0x0018, 0x1d5e: 0x0018, 0x1d5f: 0x0018, 0x1d60: 0x0018, 0x1d61: 0x0018, 0x1d62: 0x0018, 0x1d63: 0x0018, 0x1d64: 0x0018, 0x1d65: 0x0018, 0x1d66: 0x0018, 0x1d67: 0x0018, 0x1d68: 0x0018, 0x1d69: 0x0018, 0x1d6a: 0xc191, 0x1d6b: 0xc1a9, 0x1d6c: 0x0040, 0x1d6d: 0x0040, 0x1d6e: 0x0040, 0x1d6f: 0x0040, 0x1d70: 0x0018, 0x1d71: 0x0018, 0x1d72: 0x0018, 0x1d73: 0x0018, 0x1d74: 0x0018, 0x1d75: 0x0018, 0x1d76: 0x0018, 0x1d77: 0x0018, 0x1d78: 0x0018, 0x1d79: 0x0018, 0x1d7a: 0x0018, 0x1d7b: 0x0018, 0x1d7c: 0x0018, 0x1d7d: 0x0018, 0x1d7e: 0x0018, 0x1d7f: 0x0018, // Block 0x76, offset 0x1d80 0x1d80: 0xc1d9, 0x1d81: 0xc211, 0x1d82: 0xc249, 0x1d83: 0x0040, 0x1d84: 0x0040, 0x1d85: 0x0040, 0x1d86: 0x0040, 0x1d87: 0x0040, 0x1d88: 0x0040, 0x1d89: 0x0040, 0x1d8a: 0x0040, 0x1d8b: 0x0040, 0x1d8c: 0x0040, 0x1d8d: 0x0040, 0x1d8e: 0x0040, 0x1d8f: 0x0040, 0x1d90: 0xc269, 0x1d91: 0xc289, 0x1d92: 0xc2a9, 0x1d93: 0xc2c9, 0x1d94: 0xc2e9, 0x1d95: 0xc309, 0x1d96: 0xc329, 0x1d97: 0xc349, 0x1d98: 0xc369, 0x1d99: 0xc389, 0x1d9a: 0xc3a9, 0x1d9b: 0xc3c9, 0x1d9c: 0xc3e9, 0x1d9d: 0xc409, 0x1d9e: 0xc429, 0x1d9f: 0xc449, 0x1da0: 0xc469, 0x1da1: 0xc489, 0x1da2: 0xc4a9, 0x1da3: 0xc4c9, 0x1da4: 0xc4e9, 0x1da5: 0xc509, 0x1da6: 0xc529, 0x1da7: 0xc549, 0x1da8: 0xc569, 0x1da9: 0xc589, 0x1daa: 0xc5a9, 0x1dab: 0xc5c9, 0x1dac: 0xc5e9, 0x1dad: 0xc609, 0x1dae: 0xc629, 0x1daf: 0xc649, 0x1db0: 0xc669, 0x1db1: 0xc689, 0x1db2: 0xc6a9, 0x1db3: 0xc6c9, 0x1db4: 0xc6e9, 0x1db5: 0xc709, 0x1db6: 0xc729, 0x1db7: 0xc749, 0x1db8: 0xc769, 0x1db9: 0xc789, 0x1dba: 0xc7a9, 0x1dbb: 0xc7c9, 0x1dbc: 0x0040, 0x1dbd: 0x0040, 0x1dbe: 0x0040, 0x1dbf: 0x0040, // Block 0x77, offset 0x1dc0 0x1dc0: 0xcaf9, 0x1dc1: 0xcb19, 0x1dc2: 0xcb39, 0x1dc3: 0x8b1d, 0x1dc4: 0xcb59, 0x1dc5: 0xcb79, 0x1dc6: 0xcb99, 0x1dc7: 0xcbb9, 0x1dc8: 0xcbd9, 0x1dc9: 0xcbf9, 0x1dca: 0xcc19, 0x1dcb: 0xcc39, 0x1dcc: 0xcc59, 0x1dcd: 0x8b3d, 0x1dce: 0xcc79, 0x1dcf: 0xcc99, 0x1dd0: 0xccb9, 0x1dd1: 0xccd9, 0x1dd2: 0x8b5d, 0x1dd3: 0xccf9, 0x1dd4: 0xcd19, 0x1dd5: 0xc429, 0x1dd6: 0x8b7d, 0x1dd7: 0xcd39, 0x1dd8: 0xcd59, 0x1dd9: 0xcd79, 0x1dda: 0xcd99, 0x1ddb: 0xcdb9, 0x1ddc: 0x8b9d, 0x1ddd: 0xcdd9, 0x1dde: 0xcdf9, 0x1ddf: 0xce19, 0x1de0: 0xce39, 0x1de1: 0xce59, 0x1de2: 0xc789, 0x1de3: 0xce79, 0x1de4: 0xce99, 0x1de5: 0xceb9, 0x1de6: 0xced9, 0x1de7: 0xcef9, 0x1de8: 0xcf19, 0x1de9: 0xcf39, 0x1dea: 0xcf59, 0x1deb: 0xcf79, 0x1dec: 0xcf99, 0x1ded: 0xcfb9, 0x1dee: 0xcfd9, 0x1def: 0xcff9, 0x1df0: 0xd019, 0x1df1: 0xd039, 0x1df2: 0xd039, 0x1df3: 0xd039, 0x1df4: 0x8bbd, 0x1df5: 0xd059, 0x1df6: 0xd079, 0x1df7: 0xd099, 0x1df8: 0x8bdd, 0x1df9: 0xd0b9, 0x1dfa: 0xd0d9, 0x1dfb: 0xd0f9, 0x1dfc: 0xd119, 0x1dfd: 0xd139, 0x1dfe: 0xd159, 0x1dff: 0xd179, // Block 0x78, offset 0x1e00 0x1e00: 0xd199, 0x1e01: 0xd1b9, 0x1e02: 0xd1d9, 0x1e03: 0xd1f9, 0x1e04: 0xd219, 0x1e05: 0xd239, 0x1e06: 0xd239, 0x1e07: 0xd259, 0x1e08: 0xd279, 0x1e09: 0xd299, 0x1e0a: 0xd2b9, 0x1e0b: 0xd2d9, 0x1e0c: 0xd2f9, 0x1e0d: 0xd319, 0x1e0e: 0xd339, 0x1e0f: 0xd359, 0x1e10: 0xd379, 0x1e11: 0xd399, 0x1e12: 0xd3b9, 0x1e13: 0xd3d9, 0x1e14: 0xd3f9, 0x1e15: 0xd419, 0x1e16: 0xd439, 0x1e17: 0xd459, 0x1e18: 0xd479, 0x1e19: 0x8bfd, 0x1e1a: 0xd499, 0x1e1b: 0xd4b9, 0x1e1c: 0xd4d9, 0x1e1d: 0xc309, 0x1e1e: 0xd4f9, 0x1e1f: 0xd519, 0x1e20: 0x8c1d, 0x1e21: 0x8c3d, 0x1e22: 0xd539, 0x1e23: 0xd559, 0x1e24: 0xd579, 0x1e25: 0xd599, 0x1e26: 0xd5b9, 0x1e27: 0xd5d9, 0x1e28: 0x2040, 0x1e29: 0xd5f9, 0x1e2a: 0xd619, 0x1e2b: 0xd619, 0x1e2c: 0x8c5d, 0x1e2d: 0xd639, 0x1e2e: 0xd659, 0x1e2f: 0xd679, 0x1e30: 0xd699, 0x1e31: 0x8c7d, 0x1e32: 0xd6b9, 0x1e33: 0xd6d9, 0x1e34: 0x2040, 0x1e35: 0xd6f9, 0x1e36: 0xd719, 0x1e37: 0xd739, 0x1e38: 0xd759, 0x1e39: 0xd779, 0x1e3a: 0xd799, 0x1e3b: 0x8c9d, 0x1e3c: 0xd7b9, 0x1e3d: 0x8cbd, 0x1e3e: 0xd7d9, 0x1e3f: 0xd7f9, // Block 0x79, offset 0x1e40 0x1e40: 0xd819, 0x1e41: 0xd839, 0x1e42: 0xd859, 0x1e43: 0xd879, 0x1e44: 0xd899, 0x1e45: 0xd8b9, 0x1e46: 0xd8d9, 0x1e47: 0xd8f9, 0x1e48: 0xd919, 0x1e49: 0x8cdd, 0x1e4a: 0xd939, 0x1e4b: 0xd959, 0x1e4c: 0xd979, 0x1e4d: 0xd999, 0x1e4e: 0xd9b9, 0x1e4f: 0x8cfd, 0x1e50: 0xd9d9, 0x1e51: 0x8d1d, 0x1e52: 0x8d3d, 0x1e53: 0xd9f9, 0x1e54: 0xda19, 0x1e55: 0xda19, 0x1e56: 0xda39, 0x1e57: 0x8d5d, 0x1e58: 0x8d7d, 0x1e59: 0xda59, 0x1e5a: 0xda79, 0x1e5b: 0xda99, 0x1e5c: 0xdab9, 0x1e5d: 0xdad9, 0x1e5e: 0xdaf9, 0x1e5f: 0xdb19, 0x1e60: 0xdb39, 0x1e61: 0xdb59, 0x1e62: 0xdb79, 0x1e63: 0xdb99, 0x1e64: 0x8d9d, 0x1e65: 0xdbb9, 0x1e66: 0xdbd9, 0x1e67: 0xdbf9, 0x1e68: 0xdc19, 0x1e69: 0xdbf9, 0x1e6a: 0xdc39, 0x1e6b: 0xdc59, 0x1e6c: 0xdc79, 0x1e6d: 0xdc99, 0x1e6e: 0xdcb9, 0x1e6f: 0xdcd9, 0x1e70: 0xdcf9, 0x1e71: 0xdd19, 0x1e72: 0xdd39, 0x1e73: 0xdd59, 0x1e74: 0xdd79, 0x1e75: 0xdd99, 0x1e76: 0xddb9, 0x1e77: 0xddd9, 0x1e78: 0x8dbd, 0x1e79: 0xddf9, 0x1e7a: 0xde19, 0x1e7b: 0xde39, 0x1e7c: 0xde59, 0x1e7d: 0xde79, 0x1e7e: 0x8ddd, 0x1e7f: 0xde99, // Block 0x7a, offset 0x1e80 0x1e80: 0xe599, 0x1e81: 0xe5b9, 0x1e82: 0xe5d9, 0x1e83: 0xe5f9, 0x1e84: 0xe619, 0x1e85: 0xe639, 0x1e86: 0x8efd, 0x1e87: 0xe659, 0x1e88: 0xe679, 0x1e89: 0xe699, 0x1e8a: 0xe6b9, 0x1e8b: 0xe6d9, 0x1e8c: 0xe6f9, 0x1e8d: 0x8f1d, 0x1e8e: 0xe719, 0x1e8f: 0xe739, 0x1e90: 0x8f3d, 0x1e91: 0x8f5d, 0x1e92: 0xe759, 0x1e93: 0xe779, 0x1e94: 0xe799, 0x1e95: 0xe7b9, 0x1e96: 0xe7d9, 0x1e97: 0xe7f9, 0x1e98: 0xe819, 0x1e99: 0xe839, 0x1e9a: 0xe859, 0x1e9b: 0x8f7d, 0x1e9c: 0xe879, 0x1e9d: 0x8f9d, 0x1e9e: 0xe899, 0x1e9f: 0x2040, 0x1ea0: 0xe8b9, 0x1ea1: 0xe8d9, 0x1ea2: 0xe8f9, 0x1ea3: 0x8fbd, 0x1ea4: 0xe919, 0x1ea5: 0xe939, 0x1ea6: 0x8fdd, 0x1ea7: 0x8ffd, 0x1ea8: 0xe959, 0x1ea9: 0xe979, 0x1eaa: 0xe999, 0x1eab: 0xe9b9, 0x1eac: 0xe9d9, 0x1ead: 0xe9d9, 0x1eae: 0xe9f9, 0x1eaf: 0xea19, 0x1eb0: 0xea39, 0x1eb1: 0xea59, 0x1eb2: 0xea79, 0x1eb3: 0xea99, 0x1eb4: 0xeab9, 0x1eb5: 0x901d, 0x1eb6: 0xead9, 0x1eb7: 0x903d, 0x1eb8: 0xeaf9, 0x1eb9: 0x905d, 0x1eba: 0xeb19, 0x1ebb: 0x907d, 0x1ebc: 0x909d, 0x1ebd: 0x90bd, 0x1ebe: 0xeb39, 0x1ebf: 0xeb59, // Block 0x7b, offset 0x1ec0 0x1ec0: 0xeb79, 0x1ec1: 0x90dd, 0x1ec2: 0x90fd, 0x1ec3: 0x911d, 0x1ec4: 0x913d, 0x1ec5: 0xeb99, 0x1ec6: 0xebb9, 0x1ec7: 0xebb9, 0x1ec8: 0xebd9, 0x1ec9: 0xebf9, 0x1eca: 0xec19, 0x1ecb: 0xec39, 0x1ecc: 0xec59, 0x1ecd: 0x915d, 0x1ece: 0xec79, 0x1ecf: 0xec99, 0x1ed0: 0xecb9, 0x1ed1: 0xecd9, 0x1ed2: 0x917d, 0x1ed3: 0xecf9, 0x1ed4: 0x919d, 0x1ed5: 0x91bd, 0x1ed6: 0xed19, 0x1ed7: 0xed39, 0x1ed8: 0xed59, 0x1ed9: 0xed79, 0x1eda: 0xed99, 0x1edb: 0xedb9, 0x1edc: 0x91dd, 0x1edd: 0x91fd, 0x1ede: 0x921d, 0x1edf: 0x2040, 0x1ee0: 0xedd9, 0x1ee1: 0x923d, 0x1ee2: 0xedf9, 0x1ee3: 0xee19, 0x1ee4: 0xee39, 0x1ee5: 0x925d, 0x1ee6: 0xee59, 0x1ee7: 0xee79, 0x1ee8: 0xee99, 0x1ee9: 0xeeb9, 0x1eea: 0xeed9, 0x1eeb: 0x927d, 0x1eec: 0xeef9, 0x1eed: 0xef19, 0x1eee: 0xef39, 0x1eef: 0xef59, 0x1ef0: 0xef79, 0x1ef1: 0xef99, 0x1ef2: 0x929d, 0x1ef3: 0x92bd, 0x1ef4: 0xefb9, 0x1ef5: 0x92dd, 0x1ef6: 0xefd9, 0x1ef7: 0x92fd, 0x1ef8: 0xeff9, 0x1ef9: 0xf019, 0x1efa: 0xf039, 0x1efb: 0x931d, 0x1efc: 0x933d, 0x1efd: 0xf059, 0x1efe: 0x935d, 0x1eff: 0xf079, // Block 0x7c, offset 0x1f00 0x1f00: 0xf6b9, 0x1f01: 0xf6d9, 0x1f02: 0xf6f9, 0x1f03: 0xf719, 0x1f04: 0xf739, 0x1f05: 0x951d, 0x1f06: 0xf759, 0x1f07: 0xf779, 0x1f08: 0xf799, 0x1f09: 0xf7b9, 0x1f0a: 0xf7d9, 0x1f0b: 0x953d, 0x1f0c: 0x955d, 0x1f0d: 0xf7f9, 0x1f0e: 0xf819, 0x1f0f: 0xf839, 0x1f10: 0xf859, 0x1f11: 0xf879, 0x1f12: 0xf899, 0x1f13: 0x957d, 0x1f14: 0xf8b9, 0x1f15: 0xf8d9, 0x1f16: 0xf8f9, 0x1f17: 0xf919, 0x1f18: 0x959d, 0x1f19: 0x95bd, 0x1f1a: 0xf939, 0x1f1b: 0xf959, 0x1f1c: 0xf979, 0x1f1d: 0x95dd, 0x1f1e: 0xf999, 0x1f1f: 0xf9b9, 0x1f20: 0x6815, 0x1f21: 0x95fd, 0x1f22: 0xf9d9, 0x1f23: 0xf9f9, 0x1f24: 0xfa19, 0x1f25: 0x961d, 0x1f26: 0xfa39, 0x1f27: 0xfa59, 0x1f28: 0xfa79, 0x1f29: 0xfa99, 0x1f2a: 0xfab9, 0x1f2b: 0xfad9, 0x1f2c: 0xfaf9, 0x1f2d: 0x963d, 0x1f2e: 0xfb19, 0x1f2f: 0xfb39, 0x1f30: 0xfb59, 0x1f31: 0x965d, 0x1f32: 0xfb79, 0x1f33: 0xfb99, 0x1f34: 0xfbb9, 0x1f35: 0xfbd9, 0x1f36: 0x7b35, 0x1f37: 0x967d, 0x1f38: 0xfbf9, 0x1f39: 0xfc19, 0x1f3a: 0xfc39, 0x1f3b: 0x969d, 0x1f3c: 0xfc59, 0x1f3d: 0x96bd, 0x1f3e: 0xfc79, 0x1f3f: 0xfc79, // Block 0x7d, offset 0x1f40 0x1f40: 0xfc99, 0x1f41: 0x96dd, 0x1f42: 0xfcb9, 0x1f43: 0xfcd9, 0x1f44: 0xfcf9, 0x1f45: 0xfd19, 0x1f46: 0xfd39, 0x1f47: 0xfd59, 0x1f48: 0xfd79, 0x1f49: 0x96fd, 0x1f4a: 0xfd99, 0x1f4b: 0xfdb9, 0x1f4c: 0xfdd9, 0x1f4d: 0xfdf9, 0x1f4e: 0xfe19, 0x1f4f: 0xfe39, 0x1f50: 0x971d, 0x1f51: 0xfe59, 0x1f52: 0x973d, 0x1f53: 0x975d, 0x1f54: 0x977d, 0x1f55: 0xfe79, 0x1f56: 0xfe99, 0x1f57: 0xfeb9, 0x1f58: 0xfed9, 0x1f59: 0xfef9, 0x1f5a: 0xff19, 0x1f5b: 0xff39, 0x1f5c: 0xff59, 0x1f5d: 0x979d, 0x1f5e: 0x0040, 0x1f5f: 0x0040, 0x1f60: 0x0040, 0x1f61: 0x0040, 0x1f62: 0x0040, 0x1f63: 0x0040, 0x1f64: 0x0040, 0x1f65: 0x0040, 0x1f66: 0x0040, 0x1f67: 0x0040, 0x1f68: 0x0040, 0x1f69: 0x0040, 0x1f6a: 0x0040, 0x1f6b: 0x0040, 0x1f6c: 0x0040, 0x1f6d: 0x0040, 0x1f6e: 0x0040, 0x1f6f: 0x0040, 0x1f70: 0x0040, 0x1f71: 0x0040, 0x1f72: 0x0040, 0x1f73: 0x0040, 0x1f74: 0x0040, 0x1f75: 0x0040, 0x1f76: 0x0040, 0x1f77: 0x0040, 0x1f78: 0x0040, 0x1f79: 0x0040, 0x1f7a: 0x0040, 0x1f7b: 0x0040, 0x1f7c: 0x0040, 0x1f7d: 0x0040, 0x1f7e: 0x0040, 0x1f7f: 0x0040, } // idnaIndex: 35 blocks, 2240 entries, 4480 bytes // Block 0 is the zero block. var idnaIndex = [2240]uint16{ // Block 0x0, offset 0x0 // Block 0x1, offset 0x40 // Block 0x2, offset 0x80 // Block 0x3, offset 0xc0 0xc2: 0x01, 0xc3: 0x7c, 0xc4: 0x02, 0xc5: 0x03, 0xc6: 0x04, 0xc7: 0x05, 0xc8: 0x06, 0xc9: 0x7d, 0xca: 0x7e, 0xcb: 0x07, 0xcc: 0x7f, 0xcd: 0x08, 0xce: 0x09, 0xcf: 0x0a, 0xd0: 0x80, 0xd1: 0x0b, 0xd2: 0x0c, 0xd3: 0x0d, 0xd4: 0x0e, 0xd5: 0x81, 0xd6: 0x82, 0xd7: 0x83, 0xd8: 0x0f, 0xd9: 0x10, 0xda: 0x84, 0xdb: 0x11, 0xdc: 0x12, 0xdd: 0x85, 0xde: 0x86, 0xdf: 0x87, 0xe0: 0x02, 0xe1: 0x03, 0xe2: 0x04, 0xe3: 0x05, 0xe4: 0x06, 0xe5: 0x07, 0xe6: 0x07, 0xe7: 0x07, 0xe8: 0x07, 0xe9: 0x08, 0xea: 0x09, 0xeb: 0x07, 0xec: 0x07, 0xed: 0x0a, 0xee: 0x0b, 0xef: 0x0c, 0xf0: 0x1c, 0xf1: 0x1d, 0xf2: 0x1d, 0xf3: 0x1f, 0xf4: 0x20, // Block 0x4, offset 0x100 0x120: 0x88, 0x121: 0x89, 0x122: 0x8a, 0x123: 0x8b, 0x124: 0x8c, 0x125: 0x13, 0x126: 0x14, 0x127: 0x15, 0x128: 0x16, 0x129: 0x17, 0x12a: 0x18, 0x12b: 0x19, 0x12c: 0x1a, 0x12d: 0x1b, 0x12e: 0x1c, 0x12f: 0x8d, 0x130: 0x8e, 0x131: 0x1d, 0x132: 0x1e, 0x133: 0x1f, 0x134: 0x8f, 0x135: 0x20, 0x136: 0x90, 0x137: 0x91, 0x138: 0x92, 0x139: 0x93, 0x13a: 0x21, 0x13b: 0x94, 0x13c: 0x95, 0x13d: 0x22, 0x13e: 0x23, 0x13f: 0x96, // Block 0x5, offset 0x140 0x140: 0x97, 0x141: 0x98, 0x142: 0x99, 0x143: 0x9a, 0x144: 0x9b, 0x145: 0x9c, 0x146: 0x9d, 0x147: 0x9e, 0x148: 0x9f, 0x149: 0xa0, 0x14a: 0xa1, 0x14b: 0xa2, 0x14c: 0xa3, 0x14d: 0xa4, 0x14e: 0xa5, 0x14f: 0xa6, 0x150: 0xa7, 0x151: 0x9f, 0x152: 0x9f, 0x153: 0x9f, 0x154: 0x9f, 0x155: 0x9f, 0x156: 0x9f, 0x157: 0x9f, 0x158: 0x9f, 0x159: 0xa8, 0x15a: 0xa9, 0x15b: 0xaa, 0x15c: 0xab, 0x15d: 0xac, 0x15e: 0xad, 0x15f: 0xae, 0x160: 0xaf, 0x161: 0xb0, 0x162: 0xb1, 0x163: 0xb2, 0x164: 0xb3, 0x165: 0xb4, 0x166: 0xb5, 0x167: 0xb6, 0x168: 0xb7, 0x169: 0xb8, 0x16a: 0xb9, 0x16b: 0xba, 0x16c: 0xbb, 0x16d: 0xbc, 0x16e: 0xbd, 0x16f: 0xbe, 0x170: 0xbf, 0x171: 0xc0, 0x172: 0xc1, 0x173: 0xc2, 0x174: 0x24, 0x175: 0x25, 0x176: 0x26, 0x177: 0xc3, 0x178: 0x27, 0x179: 0x27, 0x17a: 0x28, 0x17b: 0x27, 0x17c: 0xc4, 0x17d: 0x29, 0x17e: 0x2a, 0x17f: 0x2b, // Block 0x6, offset 0x180 0x180: 0x2c, 0x181: 0x2d, 0x182: 0x2e, 0x183: 0xc5, 0x184: 0x2f, 0x185: 0x30, 0x186: 0xc6, 0x187: 0x9b, 0x188: 0xc7, 0x189: 0xc8, 0x18a: 0x9b, 0x18b: 0x9b, 0x18c: 0xc9, 0x18d: 0x9b, 0x18e: 0x9b, 0x18f: 0xca, 0x190: 0xcb, 0x191: 0x31, 0x192: 0x32, 0x193: 0x33, 0x194: 0x9b, 0x195: 0x9b, 0x196: 0x9b, 0x197: 0x9b, 0x198: 0x9b, 0x199: 0x9b, 0x19a: 0x9b, 0x19b: 0x9b, 0x19c: 0x9b, 0x19d: 0x9b, 0x19e: 0x9b, 0x19f: 0x9b, 0x1a0: 0x9b, 0x1a1: 0x9b, 0x1a2: 0x9b, 0x1a3: 0x9b, 0x1a4: 0x9b, 0x1a5: 0x9b, 0x1a6: 0x9b, 0x1a7: 0x9b, 0x1a8: 0xcc, 0x1a9: 0xcd, 0x1aa: 0x9b, 0x1ab: 0xce, 0x1ac: 0x9b, 0x1ad: 0xcf, 0x1ae: 0xd0, 0x1af: 0xd1, 0x1b0: 0xd2, 0x1b1: 0x34, 0x1b2: 0x27, 0x1b3: 0x35, 0x1b4: 0xd3, 0x1b5: 0xd4, 0x1b6: 0xd5, 0x1b7: 0xd6, 0x1b8: 0xd7, 0x1b9: 0xd8, 0x1ba: 0xd9, 0x1bb: 0xda, 0x1bc: 0xdb, 0x1bd: 0xdc, 0x1be: 0xdd, 0x1bf: 0x36, // Block 0x7, offset 0x1c0 0x1c0: 0x37, 0x1c1: 0xde, 0x1c2: 0xdf, 0x1c3: 0xe0, 0x1c4: 0xe1, 0x1c5: 0x38, 0x1c6: 0x39, 0x1c7: 0xe2, 0x1c8: 0xe3, 0x1c9: 0x3a, 0x1ca: 0x3b, 0x1cb: 0x3c, 0x1cc: 0x3d, 0x1cd: 0x3e, 0x1ce: 0x3f, 0x1cf: 0x40, 0x1d0: 0x9f, 0x1d1: 0x9f, 0x1d2: 0x9f, 0x1d3: 0x9f, 0x1d4: 0x9f, 0x1d5: 0x9f, 0x1d6: 0x9f, 0x1d7: 0x9f, 0x1d8: 0x9f, 0x1d9: 0x9f, 0x1da: 0x9f, 0x1db: 0x9f, 0x1dc: 0x9f, 0x1dd: 0x9f, 0x1de: 0x9f, 0x1df: 0x9f, 0x1e0: 0x9f, 0x1e1: 0x9f, 0x1e2: 0x9f, 0x1e3: 0x9f, 0x1e4: 0x9f, 0x1e5: 0x9f, 0x1e6: 0x9f, 0x1e7: 0x9f, 0x1e8: 0x9f, 0x1e9: 0x9f, 0x1ea: 0x9f, 0x1eb: 0x9f, 0x1ec: 0x9f, 0x1ed: 0x9f, 0x1ee: 0x9f, 0x1ef: 0x9f, 0x1f0: 0x9f, 0x1f1: 0x9f, 0x1f2: 0x9f, 0x1f3: 0x9f, 0x1f4: 0x9f, 0x1f5: 0x9f, 0x1f6: 0x9f, 0x1f7: 0x9f, 0x1f8: 0x9f, 0x1f9: 0x9f, 0x1fa: 0x9f, 0x1fb: 0x9f, 0x1fc: 0x9f, 0x1fd: 0x9f, 0x1fe: 0x9f, 0x1ff: 0x9f, // Block 0x8, offset 0x200 0x200: 0x9f, 0x201: 0x9f, 0x202: 0x9f, 0x203: 0x9f, 0x204: 0x9f, 0x205: 0x9f, 0x206: 0x9f, 0x207: 0x9f, 0x208: 0x9f, 0x209: 0x9f, 0x20a: 0x9f, 0x20b: 0x9f, 0x20c: 0x9f, 0x20d: 0x9f, 0x20e: 0x9f, 0x20f: 0x9f, 0x210: 0x9f, 0x211: 0x9f, 0x212: 0x9f, 0x213: 0x9f, 0x214: 0x9f, 0x215: 0x9f, 0x216: 0x9f, 0x217: 0x9f, 0x218: 0x9f, 0x219: 0x9f, 0x21a: 0x9f, 0x21b: 0x9f, 0x21c: 0x9f, 0x21d: 0x9f, 0x21e: 0x9f, 0x21f: 0x9f, 0x220: 0x9f, 0x221: 0x9f, 0x222: 0x9f, 0x223: 0x9f, 0x224: 0x9f, 0x225: 0x9f, 0x226: 0x9f, 0x227: 0x9f, 0x228: 0x9f, 0x229: 0x9f, 0x22a: 0x9f, 0x22b: 0x9f, 0x22c: 0x9f, 0x22d: 0x9f, 0x22e: 0x9f, 0x22f: 0x9f, 0x230: 0x9f, 0x231: 0x9f, 0x232: 0x9f, 0x233: 0x9f, 0x234: 0x9f, 0x235: 0x9f, 0x236: 0xb2, 0x237: 0x9b, 0x238: 0x9f, 0x239: 0x9f, 0x23a: 0x9f, 0x23b: 0x9f, 0x23c: 0x9f, 0x23d: 0x9f, 0x23e: 0x9f, 0x23f: 0x9f, // Block 0x9, offset 0x240 0x240: 0x9f, 0x241: 0x9f, 0x242: 0x9f, 0x243: 0x9f, 0x244: 0x9f, 0x245: 0x9f, 0x246: 0x9f, 0x247: 0x9f, 0x248: 0x9f, 0x249: 0x9f, 0x24a: 0x9f, 0x24b: 0x9f, 0x24c: 0x9f, 0x24d: 0x9f, 0x24e: 0x9f, 0x24f: 0x9f, 0x250: 0x9f, 0x251: 0x9f, 0x252: 0x9f, 0x253: 0x9f, 0x254: 0x9f, 0x255: 0x9f, 0x256: 0x9f, 0x257: 0x9f, 0x258: 0x9f, 0x259: 0x9f, 0x25a: 0x9f, 0x25b: 0x9f, 0x25c: 0x9f, 0x25d: 0x9f, 0x25e: 0x9f, 0x25f: 0x9f, 0x260: 0x9f, 0x261: 0x9f, 0x262: 0x9f, 0x263: 0x9f, 0x264: 0x9f, 0x265: 0x9f, 0x266: 0x9f, 0x267: 0x9f, 0x268: 0x9f, 0x269: 0x9f, 0x26a: 0x9f, 0x26b: 0x9f, 0x26c: 0x9f, 0x26d: 0x9f, 0x26e: 0x9f, 0x26f: 0x9f, 0x270: 0x9f, 0x271: 0x9f, 0x272: 0x9f, 0x273: 0x9f, 0x274: 0x9f, 0x275: 0x9f, 0x276: 0x9f, 0x277: 0x9f, 0x278: 0x9f, 0x279: 0x9f, 0x27a: 0x9f, 0x27b: 0x9f, 0x27c: 0x9f, 0x27d: 0x9f, 0x27e: 0x9f, 0x27f: 0x9f, // Block 0xa, offset 0x280 0x280: 0x9f, 0x281: 0x9f, 0x282: 0x9f, 0x283: 0x9f, 0x284: 0x9f, 0x285: 0x9f, 0x286: 0x9f, 0x287: 0x9f, 0x288: 0x9f, 0x289: 0x9f, 0x28a: 0x9f, 0x28b: 0x9f, 0x28c: 0x9f, 0x28d: 0x9f, 0x28e: 0x9f, 0x28f: 0x9f, 0x290: 0x9f, 0x291: 0x9f, 0x292: 0x9f, 0x293: 0x9f, 0x294: 0x9f, 0x295: 0x9f, 0x296: 0x9f, 0x297: 0x9f, 0x298: 0x9f, 0x299: 0x9f, 0x29a: 0x9f, 0x29b: 0x9f, 0x29c: 0x9f, 0x29d: 0x9f, 0x29e: 0x9f, 0x29f: 0x9f, 0x2a0: 0x9f, 0x2a1: 0x9f, 0x2a2: 0x9f, 0x2a3: 0x9f, 0x2a4: 0x9f, 0x2a5: 0x9f, 0x2a6: 0x9f, 0x2a7: 0x9f, 0x2a8: 0x9f, 0x2a9: 0x9f, 0x2aa: 0x9f, 0x2ab: 0x9f, 0x2ac: 0x9f, 0x2ad: 0x9f, 0x2ae: 0x9f, 0x2af: 0x9f, 0x2b0: 0x9f, 0x2b1: 0x9f, 0x2b2: 0x9f, 0x2b3: 0x9f, 0x2b4: 0x9f, 0x2b5: 0x9f, 0x2b6: 0x9f, 0x2b7: 0x9f, 0x2b8: 0x9f, 0x2b9: 0x9f, 0x2ba: 0x9f, 0x2bb: 0x9f, 0x2bc: 0x9f, 0x2bd: 0x9f, 0x2be: 0x9f, 0x2bf: 0xe4, // Block 0xb, offset 0x2c0 0x2c0: 0x9f, 0x2c1: 0x9f, 0x2c2: 0x9f, 0x2c3: 0x9f, 0x2c4: 0x9f, 0x2c5: 0x9f, 0x2c6: 0x9f, 0x2c7: 0x9f, 0x2c8: 0x9f, 0x2c9: 0x9f, 0x2ca: 0x9f, 0x2cb: 0x9f, 0x2cc: 0x9f, 0x2cd: 0x9f, 0x2ce: 0x9f, 0x2cf: 0x9f, 0x2d0: 0x9f, 0x2d1: 0x9f, 0x2d2: 0xe5, 0x2d3: 0xe6, 0x2d4: 0x9f, 0x2d5: 0x9f, 0x2d6: 0x9f, 0x2d7: 0x9f, 0x2d8: 0xe7, 0x2d9: 0x41, 0x2da: 0x42, 0x2db: 0xe8, 0x2dc: 0x43, 0x2dd: 0x44, 0x2de: 0x45, 0x2df: 0xe9, 0x2e0: 0xea, 0x2e1: 0xeb, 0x2e2: 0xec, 0x2e3: 0xed, 0x2e4: 0xee, 0x2e5: 0xef, 0x2e6: 0xf0, 0x2e7: 0xf1, 0x2e8: 0xf2, 0x2e9: 0xf3, 0x2ea: 0xf4, 0x2eb: 0xf5, 0x2ec: 0xf6, 0x2ed: 0xf7, 0x2ee: 0xf8, 0x2ef: 0xf9, 0x2f0: 0x9f, 0x2f1: 0x9f, 0x2f2: 0x9f, 0x2f3: 0x9f, 0x2f4: 0x9f, 0x2f5: 0x9f, 0x2f6: 0x9f, 0x2f7: 0x9f, 0x2f8: 0x9f, 0x2f9: 0x9f, 0x2fa: 0x9f, 0x2fb: 0x9f, 0x2fc: 0x9f, 0x2fd: 0x9f, 0x2fe: 0x9f, 0x2ff: 0x9f, // Block 0xc, offset 0x300 0x300: 0x9f, 0x301: 0x9f, 0x302: 0x9f, 0x303: 0x9f, 0x304: 0x9f, 0x305: 0x9f, 0x306: 0x9f, 0x307: 0x9f, 0x308: 0x9f, 0x309: 0x9f, 0x30a: 0x9f, 0x30b: 0x9f, 0x30c: 0x9f, 0x30d: 0x9f, 0x30e: 0x9f, 0x30f: 0x9f, 0x310: 0x9f, 0x311: 0x9f, 0x312: 0x9f, 0x313: 0x9f, 0x314: 0x9f, 0x315: 0x9f, 0x316: 0x9f, 0x317: 0x9f, 0x318: 0x9f, 0x319: 0x9f, 0x31a: 0x9f, 0x31b: 0x9f, 0x31c: 0x9f, 0x31d: 0x9f, 0x31e: 0xfa, 0x31f: 0xfb, // Block 0xd, offset 0x340 0x340: 0xba, 0x341: 0xba, 0x342: 0xba, 0x343: 0xba, 0x344: 0xba, 0x345: 0xba, 0x346: 0xba, 0x347: 0xba, 0x348: 0xba, 0x349: 0xba, 0x34a: 0xba, 0x34b: 0xba, 0x34c: 0xba, 0x34d: 0xba, 0x34e: 0xba, 0x34f: 0xba, 0x350: 0xba, 0x351: 0xba, 0x352: 0xba, 0x353: 0xba, 0x354: 0xba, 0x355: 0xba, 0x356: 0xba, 0x357: 0xba, 0x358: 0xba, 0x359: 0xba, 0x35a: 0xba, 0x35b: 0xba, 0x35c: 0xba, 0x35d: 0xba, 0x35e: 0xba, 0x35f: 0xba, 0x360: 0xba, 0x361: 0xba, 0x362: 0xba, 0x363: 0xba, 0x364: 0xba, 0x365: 0xba, 0x366: 0xba, 0x367: 0xba, 0x368: 0xba, 0x369: 0xba, 0x36a: 0xba, 0x36b: 0xba, 0x36c: 0xba, 0x36d: 0xba, 0x36e: 0xba, 0x36f: 0xba, 0x370: 0xba, 0x371: 0xba, 0x372: 0xba, 0x373: 0xba, 0x374: 0xba, 0x375: 0xba, 0x376: 0xba, 0x377: 0xba, 0x378: 0xba, 0x379: 0xba, 0x37a: 0xba, 0x37b: 0xba, 0x37c: 0xba, 0x37d: 0xba, 0x37e: 0xba, 0x37f: 0xba, // Block 0xe, offset 0x380 0x380: 0xba, 0x381: 0xba, 0x382: 0xba, 0x383: 0xba, 0x384: 0xba, 0x385: 0xba, 0x386: 0xba, 0x387: 0xba, 0x388: 0xba, 0x389: 0xba, 0x38a: 0xba, 0x38b: 0xba, 0x38c: 0xba, 0x38d: 0xba, 0x38e: 0xba, 0x38f: 0xba, 0x390: 0xba, 0x391: 0xba, 0x392: 0xba, 0x393: 0xba, 0x394: 0xba, 0x395: 0xba, 0x396: 0xba, 0x397: 0xba, 0x398: 0xba, 0x399: 0xba, 0x39a: 0xba, 0x39b: 0xba, 0x39c: 0xba, 0x39d: 0xba, 0x39e: 0xba, 0x39f: 0xba, 0x3a0: 0xba, 0x3a1: 0xba, 0x3a2: 0xba, 0x3a3: 0xba, 0x3a4: 0xfc, 0x3a5: 0xfd, 0x3a6: 0xfe, 0x3a7: 0xff, 0x3a8: 0x46, 0x3a9: 0x100, 0x3aa: 0x101, 0x3ab: 0x47, 0x3ac: 0x48, 0x3ad: 0x49, 0x3ae: 0x4a, 0x3af: 0x4b, 0x3b0: 0x102, 0x3b1: 0x4c, 0x3b2: 0x4d, 0x3b3: 0x4e, 0x3b4: 0x4f, 0x3b5: 0x50, 0x3b6: 0x103, 0x3b7: 0x51, 0x3b8: 0x52, 0x3b9: 0x53, 0x3ba: 0x54, 0x3bb: 0x55, 0x3bc: 0x56, 0x3bd: 0x57, 0x3be: 0x58, 0x3bf: 0x59, // Block 0xf, offset 0x3c0 0x3c0: 0x104, 0x3c1: 0x105, 0x3c2: 0x9f, 0x3c3: 0x106, 0x3c4: 0x107, 0x3c5: 0x9b, 0x3c6: 0x108, 0x3c7: 0x109, 0x3c8: 0xba, 0x3c9: 0xba, 0x3ca: 0x10a, 0x3cb: 0x10b, 0x3cc: 0x10c, 0x3cd: 0x10d, 0x3ce: 0x10e, 0x3cf: 0x10f, 0x3d0: 0x110, 0x3d1: 0x9f, 0x3d2: 0x111, 0x3d3: 0x112, 0x3d4: 0x113, 0x3d5: 0x114, 0x3d6: 0xba, 0x3d7: 0xba, 0x3d8: 0x9f, 0x3d9: 0x9f, 0x3da: 0x9f, 0x3db: 0x9f, 0x3dc: 0x115, 0x3dd: 0x116, 0x3de: 0xba, 0x3df: 0xba, 0x3e0: 0x117, 0x3e1: 0x118, 0x3e2: 0x119, 0x3e3: 0x11a, 0x3e4: 0x11b, 0x3e5: 0xba, 0x3e6: 0x11c, 0x3e7: 0x11d, 0x3e8: 0x11e, 0x3e9: 0x11f, 0x3ea: 0x120, 0x3eb: 0x5a, 0x3ec: 0x121, 0x3ed: 0x122, 0x3ee: 0x5b, 0x3ef: 0xba, 0x3f0: 0x123, 0x3f1: 0x124, 0x3f2: 0x125, 0x3f3: 0x126, 0x3f4: 0xba, 0x3f5: 0xba, 0x3f6: 0xba, 0x3f7: 0xba, 0x3f8: 0xba, 0x3f9: 0x127, 0x3fa: 0xba, 0x3fb: 0xba, 0x3fc: 0xba, 0x3fd: 0xba, 0x3fe: 0xba, 0x3ff: 0xba, // Block 0x10, offset 0x400 0x400: 0x128, 0x401: 0x129, 0x402: 0x12a, 0x403: 0x12b, 0x404: 0x12c, 0x405: 0x12d, 0x406: 0x12e, 0x407: 0x12f, 0x408: 0x130, 0x409: 0xba, 0x40a: 0x131, 0x40b: 0x132, 0x40c: 0x5c, 0x40d: 0x5d, 0x40e: 0xba, 0x40f: 0xba, 0x410: 0x133, 0x411: 0x134, 0x412: 0x135, 0x413: 0x136, 0x414: 0xba, 0x415: 0xba, 0x416: 0x137, 0x417: 0x138, 0x418: 0x139, 0x419: 0x13a, 0x41a: 0x13b, 0x41b: 0x13c, 0x41c: 0x13d, 0x41d: 0xba, 0x41e: 0xba, 0x41f: 0xba, 0x420: 0xba, 0x421: 0xba, 0x422: 0x13e, 0x423: 0x13f, 0x424: 0xba, 0x425: 0xba, 0x426: 0xba, 0x427: 0xba, 0x428: 0xba, 0x429: 0xba, 0x42a: 0xba, 0x42b: 0x140, 0x42c: 0xba, 0x42d: 0xba, 0x42e: 0xba, 0x42f: 0xba, 0x430: 0x141, 0x431: 0x142, 0x432: 0x143, 0x433: 0xba, 0x434: 0xba, 0x435: 0xba, 0x436: 0xba, 0x437: 0xba, 0x438: 0xba, 0x439: 0xba, 0x43a: 0xba, 0x43b: 0xba, 0x43c: 0xba, 0x43d: 0xba, 0x43e: 0xba, 0x43f: 0xba, // Block 0x11, offset 0x440 0x440: 0x9f, 0x441: 0x9f, 0x442: 0x9f, 0x443: 0x9f, 0x444: 0x9f, 0x445: 0x9f, 0x446: 0x9f, 0x447: 0x9f, 0x448: 0x9f, 0x449: 0x9f, 0x44a: 0x9f, 0x44b: 0x9f, 0x44c: 0x9f, 0x44d: 0x9f, 0x44e: 0x144, 0x44f: 0xba, 0x450: 0x9b, 0x451: 0x145, 0x452: 0x9f, 0x453: 0x9f, 0x454: 0x9f, 0x455: 0x146, 0x456: 0xba, 0x457: 0xba, 0x458: 0xba, 0x459: 0xba, 0x45a: 0xba, 0x45b: 0xba, 0x45c: 0xba, 0x45d: 0xba, 0x45e: 0xba, 0x45f: 0xba, 0x460: 0xba, 0x461: 0xba, 0x462: 0xba, 0x463: 0xba, 0x464: 0xba, 0x465: 0xba, 0x466: 0xba, 0x467: 0xba, 0x468: 0xba, 0x469: 0xba, 0x46a: 0xba, 0x46b: 0xba, 0x46c: 0xba, 0x46d: 0xba, 0x46e: 0xba, 0x46f: 0xba, 0x470: 0xba, 0x471: 0xba, 0x472: 0xba, 0x473: 0xba, 0x474: 0xba, 0x475: 0xba, 0x476: 0xba, 0x477: 0xba, 0x478: 0xba, 0x479: 0xba, 0x47a: 0xba, 0x47b: 0xba, 0x47c: 0xba, 0x47d: 0xba, 0x47e: 0xba, 0x47f: 0xba, // Block 0x12, offset 0x480 0x480: 0x9f, 0x481: 0x9f, 0x482: 0x9f, 0x483: 0x9f, 0x484: 0x9f, 0x485: 0x9f, 0x486: 0x9f, 0x487: 0x9f, 0x488: 0x9f, 0x489: 0x9f, 0x48a: 0x9f, 0x48b: 0x9f, 0x48c: 0x9f, 0x48d: 0x9f, 0x48e: 0x9f, 0x48f: 0x9f, 0x490: 0x147, 0x491: 0xba, 0x492: 0xba, 0x493: 0xba, 0x494: 0xba, 0x495: 0xba, 0x496: 0xba, 0x497: 0xba, 0x498: 0xba, 0x499: 0xba, 0x49a: 0xba, 0x49b: 0xba, 0x49c: 0xba, 0x49d: 0xba, 0x49e: 0xba, 0x49f: 0xba, 0x4a0: 0xba, 0x4a1: 0xba, 0x4a2: 0xba, 0x4a3: 0xba, 0x4a4: 0xba, 0x4a5: 0xba, 0x4a6: 0xba, 0x4a7: 0xba, 0x4a8: 0xba, 0x4a9: 0xba, 0x4aa: 0xba, 0x4ab: 0xba, 0x4ac: 0xba, 0x4ad: 0xba, 0x4ae: 0xba, 0x4af: 0xba, 0x4b0: 0xba, 0x4b1: 0xba, 0x4b2: 0xba, 0x4b3: 0xba, 0x4b4: 0xba, 0x4b5: 0xba, 0x4b6: 0xba, 0x4b7: 0xba, 0x4b8: 0xba, 0x4b9: 0xba, 0x4ba: 0xba, 0x4bb: 0xba, 0x4bc: 0xba, 0x4bd: 0xba, 0x4be: 0xba, 0x4bf: 0xba, // Block 0x13, offset 0x4c0 0x4c0: 0xba, 0x4c1: 0xba, 0x4c2: 0xba, 0x4c3: 0xba, 0x4c4: 0xba, 0x4c5: 0xba, 0x4c6: 0xba, 0x4c7: 0xba, 0x4c8: 0xba, 0x4c9: 0xba, 0x4ca: 0xba, 0x4cb: 0xba, 0x4cc: 0xba, 0x4cd: 0xba, 0x4ce: 0xba, 0x4cf: 0xba, 0x4d0: 0x9f, 0x4d1: 0x9f, 0x4d2: 0x9f, 0x4d3: 0x9f, 0x4d4: 0x9f, 0x4d5: 0x9f, 0x4d6: 0x9f, 0x4d7: 0x9f, 0x4d8: 0x9f, 0x4d9: 0x148, 0x4da: 0xba, 0x4db: 0xba, 0x4dc: 0xba, 0x4dd: 0xba, 0x4de: 0xba, 0x4df: 0xba, 0x4e0: 0xba, 0x4e1: 0xba, 0x4e2: 0xba, 0x4e3: 0xba, 0x4e4: 0xba, 0x4e5: 0xba, 0x4e6: 0xba, 0x4e7: 0xba, 0x4e8: 0xba, 0x4e9: 0xba, 0x4ea: 0xba, 0x4eb: 0xba, 0x4ec: 0xba, 0x4ed: 0xba, 0x4ee: 0xba, 0x4ef: 0xba, 0x4f0: 0xba, 0x4f1: 0xba, 0x4f2: 0xba, 0x4f3: 0xba, 0x4f4: 0xba, 0x4f5: 0xba, 0x4f6: 0xba, 0x4f7: 0xba, 0x4f8: 0xba, 0x4f9: 0xba, 0x4fa: 0xba, 0x4fb: 0xba, 0x4fc: 0xba, 0x4fd: 0xba, 0x4fe: 0xba, 0x4ff: 0xba, // Block 0x14, offset 0x500 0x500: 0xba, 0x501: 0xba, 0x502: 0xba, 0x503: 0xba, 0x504: 0xba, 0x505: 0xba, 0x506: 0xba, 0x507: 0xba, 0x508: 0xba, 0x509: 0xba, 0x50a: 0xba, 0x50b: 0xba, 0x50c: 0xba, 0x50d: 0xba, 0x50e: 0xba, 0x50f: 0xba, 0x510: 0xba, 0x511: 0xba, 0x512: 0xba, 0x513: 0xba, 0x514: 0xba, 0x515: 0xba, 0x516: 0xba, 0x517: 0xba, 0x518: 0xba, 0x519: 0xba, 0x51a: 0xba, 0x51b: 0xba, 0x51c: 0xba, 0x51d: 0xba, 0x51e: 0xba, 0x51f: 0xba, 0x520: 0x9f, 0x521: 0x9f, 0x522: 0x9f, 0x523: 0x9f, 0x524: 0x9f, 0x525: 0x9f, 0x526: 0x9f, 0x527: 0x9f, 0x528: 0x140, 0x529: 0x149, 0x52a: 0xba, 0x52b: 0x14a, 0x52c: 0x14b, 0x52d: 0x14c, 0x52e: 0x14d, 0x52f: 0xba, 0x530: 0xba, 0x531: 0xba, 0x532: 0xba, 0x533: 0xba, 0x534: 0xba, 0x535: 0xba, 0x536: 0xba, 0x537: 0xba, 0x538: 0xba, 0x539: 0xba, 0x53a: 0xba, 0x53b: 0xba, 0x53c: 0x9f, 0x53d: 0x14e, 0x53e: 0x14f, 0x53f: 0x150, // Block 0x15, offset 0x540 0x540: 0x9f, 0x541: 0x9f, 0x542: 0x9f, 0x543: 0x9f, 0x544: 0x9f, 0x545: 0x9f, 0x546: 0x9f, 0x547: 0x9f, 0x548: 0x9f, 0x549: 0x9f, 0x54a: 0x9f, 0x54b: 0x9f, 0x54c: 0x9f, 0x54d: 0x9f, 0x54e: 0x9f, 0x54f: 0x9f, 0x550: 0x9f, 0x551: 0x9f, 0x552: 0x9f, 0x553: 0x9f, 0x554: 0x9f, 0x555: 0x9f, 0x556: 0x9f, 0x557: 0x9f, 0x558: 0x9f, 0x559: 0x9f, 0x55a: 0x9f, 0x55b: 0x9f, 0x55c: 0x9f, 0x55d: 0x9f, 0x55e: 0x9f, 0x55f: 0x151, 0x560: 0x9f, 0x561: 0x9f, 0x562: 0x9f, 0x563: 0x9f, 0x564: 0x9f, 0x565: 0x9f, 0x566: 0x9f, 0x567: 0x9f, 0x568: 0x9f, 0x569: 0x9f, 0x56a: 0x9f, 0x56b: 0x152, 0x56c: 0xba, 0x56d: 0xba, 0x56e: 0xba, 0x56f: 0xba, 0x570: 0xba, 0x571: 0xba, 0x572: 0xba, 0x573: 0xba, 0x574: 0xba, 0x575: 0xba, 0x576: 0xba, 0x577: 0xba, 0x578: 0xba, 0x579: 0xba, 0x57a: 0xba, 0x57b: 0xba, 0x57c: 0xba, 0x57d: 0xba, 0x57e: 0xba, 0x57f: 0xba, // Block 0x16, offset 0x580 0x580: 0x153, 0x581: 0xba, 0x582: 0xba, 0x583: 0xba, 0x584: 0xba, 0x585: 0xba, 0x586: 0xba, 0x587: 0xba, 0x588: 0xba, 0x589: 0xba, 0x58a: 0xba, 0x58b: 0xba, 0x58c: 0xba, 0x58d: 0xba, 0x58e: 0xba, 0x58f: 0xba, 0x590: 0xba, 0x591: 0xba, 0x592: 0xba, 0x593: 0xba, 0x594: 0xba, 0x595: 0xba, 0x596: 0xba, 0x597: 0xba, 0x598: 0xba, 0x599: 0xba, 0x59a: 0xba, 0x59b: 0xba, 0x59c: 0xba, 0x59d: 0xba, 0x59e: 0xba, 0x59f: 0xba, 0x5a0: 0xba, 0x5a1: 0xba, 0x5a2: 0xba, 0x5a3: 0xba, 0x5a4: 0xba, 0x5a5: 0xba, 0x5a6: 0xba, 0x5a7: 0xba, 0x5a8: 0xba, 0x5a9: 0xba, 0x5aa: 0xba, 0x5ab: 0xba, 0x5ac: 0xba, 0x5ad: 0xba, 0x5ae: 0xba, 0x5af: 0xba, 0x5b0: 0x9f, 0x5b1: 0x154, 0x5b2: 0x155, 0x5b3: 0xba, 0x5b4: 0xba, 0x5b5: 0xba, 0x5b6: 0xba, 0x5b7: 0xba, 0x5b8: 0xba, 0x5b9: 0xba, 0x5ba: 0xba, 0x5bb: 0xba, 0x5bc: 0xba, 0x5bd: 0xba, 0x5be: 0xba, 0x5bf: 0xba, // Block 0x17, offset 0x5c0 0x5c0: 0x9b, 0x5c1: 0x9b, 0x5c2: 0x9b, 0x5c3: 0x156, 0x5c4: 0x157, 0x5c5: 0x158, 0x5c6: 0x159, 0x5c7: 0x15a, 0x5c8: 0x9b, 0x5c9: 0x15b, 0x5ca: 0xba, 0x5cb: 0xba, 0x5cc: 0x9b, 0x5cd: 0x15c, 0x5ce: 0xba, 0x5cf: 0xba, 0x5d0: 0x5e, 0x5d1: 0x5f, 0x5d2: 0x60, 0x5d3: 0x61, 0x5d4: 0x62, 0x5d5: 0x63, 0x5d6: 0x64, 0x5d7: 0x65, 0x5d8: 0x66, 0x5d9: 0x67, 0x5da: 0x68, 0x5db: 0x69, 0x5dc: 0x6a, 0x5dd: 0x6b, 0x5de: 0x6c, 0x5df: 0x6d, 0x5e0: 0x9b, 0x5e1: 0x9b, 0x5e2: 0x9b, 0x5e3: 0x9b, 0x5e4: 0x9b, 0x5e5: 0x9b, 0x5e6: 0x9b, 0x5e7: 0x9b, 0x5e8: 0x15d, 0x5e9: 0x15e, 0x5ea: 0x15f, 0x5eb: 0xba, 0x5ec: 0xba, 0x5ed: 0xba, 0x5ee: 0xba, 0x5ef: 0xba, 0x5f0: 0xba, 0x5f1: 0xba, 0x5f2: 0xba, 0x5f3: 0xba, 0x5f4: 0xba, 0x5f5: 0xba, 0x5f6: 0xba, 0x5f7: 0xba, 0x5f8: 0xba, 0x5f9: 0xba, 0x5fa: 0xba, 0x5fb: 0xba, 0x5fc: 0xba, 0x5fd: 0xba, 0x5fe: 0xba, 0x5ff: 0xba, // Block 0x18, offset 0x600 0x600: 0x160, 0x601: 0xba, 0x602: 0xba, 0x603: 0xba, 0x604: 0xba, 0x605: 0xba, 0x606: 0xba, 0x607: 0xba, 0x608: 0xba, 0x609: 0xba, 0x60a: 0xba, 0x60b: 0xba, 0x60c: 0xba, 0x60d: 0xba, 0x60e: 0xba, 0x60f: 0xba, 0x610: 0xba, 0x611: 0xba, 0x612: 0xba, 0x613: 0xba, 0x614: 0xba, 0x615: 0xba, 0x616: 0xba, 0x617: 0xba, 0x618: 0xba, 0x619: 0xba, 0x61a: 0xba, 0x61b: 0xba, 0x61c: 0xba, 0x61d: 0xba, 0x61e: 0xba, 0x61f: 0xba, 0x620: 0x123, 0x621: 0x123, 0x622: 0x123, 0x623: 0x161, 0x624: 0x6e, 0x625: 0x162, 0x626: 0xba, 0x627: 0xba, 0x628: 0xba, 0x629: 0xba, 0x62a: 0xba, 0x62b: 0xba, 0x62c: 0xba, 0x62d: 0xba, 0x62e: 0xba, 0x62f: 0xba, 0x630: 0xba, 0x631: 0xba, 0x632: 0xba, 0x633: 0xba, 0x634: 0xba, 0x635: 0xba, 0x636: 0xba, 0x637: 0xba, 0x638: 0x6f, 0x639: 0x70, 0x63a: 0x71, 0x63b: 0x163, 0x63c: 0xba, 0x63d: 0xba, 0x63e: 0xba, 0x63f: 0xba, // Block 0x19, offset 0x640 0x640: 0x164, 0x641: 0x9b, 0x642: 0x165, 0x643: 0x166, 0x644: 0x72, 0x645: 0x73, 0x646: 0x167, 0x647: 0x168, 0x648: 0x74, 0x649: 0x169, 0x64a: 0xba, 0x64b: 0xba, 0x64c: 0x9b, 0x64d: 0x9b, 0x64e: 0x9b, 0x64f: 0x9b, 0x650: 0x9b, 0x651: 0x9b, 0x652: 0x9b, 0x653: 0x9b, 0x654: 0x9b, 0x655: 0x9b, 0x656: 0x9b, 0x657: 0x9b, 0x658: 0x9b, 0x659: 0x9b, 0x65a: 0x9b, 0x65b: 0x16a, 0x65c: 0x9b, 0x65d: 0x16b, 0x65e: 0x9b, 0x65f: 0x16c, 0x660: 0x16d, 0x661: 0x16e, 0x662: 0x16f, 0x663: 0xba, 0x664: 0x170, 0x665: 0x171, 0x666: 0x172, 0x667: 0x173, 0x668: 0xba, 0x669: 0xba, 0x66a: 0xba, 0x66b: 0xba, 0x66c: 0xba, 0x66d: 0xba, 0x66e: 0xba, 0x66f: 0xba, 0x670: 0xba, 0x671: 0xba, 0x672: 0xba, 0x673: 0xba, 0x674: 0xba, 0x675: 0xba, 0x676: 0xba, 0x677: 0xba, 0x678: 0xba, 0x679: 0xba, 0x67a: 0xba, 0x67b: 0xba, 0x67c: 0xba, 0x67d: 0xba, 0x67e: 0xba, 0x67f: 0xba, // Block 0x1a, offset 0x680 0x680: 0x9f, 0x681: 0x9f, 0x682: 0x9f, 0x683: 0x9f, 0x684: 0x9f, 0x685: 0x9f, 0x686: 0x9f, 0x687: 0x9f, 0x688: 0x9f, 0x689: 0x9f, 0x68a: 0x9f, 0x68b: 0x9f, 0x68c: 0x9f, 0x68d: 0x9f, 0x68e: 0x9f, 0x68f: 0x9f, 0x690: 0x9f, 0x691: 0x9f, 0x692: 0x9f, 0x693: 0x9f, 0x694: 0x9f, 0x695: 0x9f, 0x696: 0x9f, 0x697: 0x9f, 0x698: 0x9f, 0x699: 0x9f, 0x69a: 0x9f, 0x69b: 0x174, 0x69c: 0x9f, 0x69d: 0x9f, 0x69e: 0x9f, 0x69f: 0x9f, 0x6a0: 0x9f, 0x6a1: 0x9f, 0x6a2: 0x9f, 0x6a3: 0x9f, 0x6a4: 0x9f, 0x6a5: 0x9f, 0x6a6: 0x9f, 0x6a7: 0x9f, 0x6a8: 0x9f, 0x6a9: 0x9f, 0x6aa: 0x9f, 0x6ab: 0x9f, 0x6ac: 0x9f, 0x6ad: 0x9f, 0x6ae: 0x9f, 0x6af: 0x9f, 0x6b0: 0x9f, 0x6b1: 0x9f, 0x6b2: 0x9f, 0x6b3: 0x9f, 0x6b4: 0x9f, 0x6b5: 0x9f, 0x6b6: 0x9f, 0x6b7: 0x9f, 0x6b8: 0x9f, 0x6b9: 0x9f, 0x6ba: 0x9f, 0x6bb: 0x9f, 0x6bc: 0x9f, 0x6bd: 0x9f, 0x6be: 0x9f, 0x6bf: 0x9f, // Block 0x1b, offset 0x6c0 0x6c0: 0x9f, 0x6c1: 0x9f, 0x6c2: 0x9f, 0x6c3: 0x9f, 0x6c4: 0x9f, 0x6c5: 0x9f, 0x6c6: 0x9f, 0x6c7: 0x9f, 0x6c8: 0x9f, 0x6c9: 0x9f, 0x6ca: 0x9f, 0x6cb: 0x9f, 0x6cc: 0x9f, 0x6cd: 0x9f, 0x6ce: 0x9f, 0x6cf: 0x9f, 0x6d0: 0x9f, 0x6d1: 0x9f, 0x6d2: 0x9f, 0x6d3: 0x9f, 0x6d4: 0x9f, 0x6d5: 0x9f, 0x6d6: 0x9f, 0x6d7: 0x9f, 0x6d8: 0x9f, 0x6d9: 0x9f, 0x6da: 0x9f, 0x6db: 0x9f, 0x6dc: 0x175, 0x6dd: 0x9f, 0x6de: 0x9f, 0x6df: 0x9f, 0x6e0: 0x176, 0x6e1: 0x9f, 0x6e2: 0x9f, 0x6e3: 0x9f, 0x6e4: 0x9f, 0x6e5: 0x9f, 0x6e6: 0x9f, 0x6e7: 0x9f, 0x6e8: 0x9f, 0x6e9: 0x9f, 0x6ea: 0x9f, 0x6eb: 0x9f, 0x6ec: 0x9f, 0x6ed: 0x9f, 0x6ee: 0x9f, 0x6ef: 0x9f, 0x6f0: 0x9f, 0x6f1: 0x9f, 0x6f2: 0x9f, 0x6f3: 0x9f, 0x6f4: 0x9f, 0x6f5: 0x9f, 0x6f6: 0x9f, 0x6f7: 0x9f, 0x6f8: 0x9f, 0x6f9: 0x9f, 0x6fa: 0x9f, 0x6fb: 0x9f, 0x6fc: 0x9f, 0x6fd: 0x9f, 0x6fe: 0x9f, 0x6ff: 0x9f, // Block 0x1c, offset 0x700 0x700: 0x9f, 0x701: 0x9f, 0x702: 0x9f, 0x703: 0x9f, 0x704: 0x9f, 0x705: 0x9f, 0x706: 0x9f, 0x707: 0x9f, 0x708: 0x9f, 0x709: 0x9f, 0x70a: 0x9f, 0x70b: 0x9f, 0x70c: 0x9f, 0x70d: 0x9f, 0x70e: 0x9f, 0x70f: 0x9f, 0x710: 0x9f, 0x711: 0x9f, 0x712: 0x9f, 0x713: 0x9f, 0x714: 0x9f, 0x715: 0x9f, 0x716: 0x9f, 0x717: 0x9f, 0x718: 0x9f, 0x719: 0x9f, 0x71a: 0x9f, 0x71b: 0x9f, 0x71c: 0x9f, 0x71d: 0x9f, 0x71e: 0x9f, 0x71f: 0x9f, 0x720: 0x9f, 0x721: 0x9f, 0x722: 0x9f, 0x723: 0x9f, 0x724: 0x9f, 0x725: 0x9f, 0x726: 0x9f, 0x727: 0x9f, 0x728: 0x9f, 0x729: 0x9f, 0x72a: 0x9f, 0x72b: 0x9f, 0x72c: 0x9f, 0x72d: 0x9f, 0x72e: 0x9f, 0x72f: 0x9f, 0x730: 0x9f, 0x731: 0x9f, 0x732: 0x9f, 0x733: 0x9f, 0x734: 0x9f, 0x735: 0x9f, 0x736: 0x9f, 0x737: 0x9f, 0x738: 0x9f, 0x739: 0x9f, 0x73a: 0x177, 0x73b: 0xba, 0x73c: 0xba, 0x73d: 0xba, 0x73e: 0xba, 0x73f: 0xba, // Block 0x1d, offset 0x740 0x740: 0xba, 0x741: 0xba, 0x742: 0xba, 0x743: 0xba, 0x744: 0xba, 0x745: 0xba, 0x746: 0xba, 0x747: 0xba, 0x748: 0xba, 0x749: 0xba, 0x74a: 0xba, 0x74b: 0xba, 0x74c: 0xba, 0x74d: 0xba, 0x74e: 0xba, 0x74f: 0xba, 0x750: 0xba, 0x751: 0xba, 0x752: 0xba, 0x753: 0xba, 0x754: 0xba, 0x755: 0xba, 0x756: 0xba, 0x757: 0xba, 0x758: 0xba, 0x759: 0xba, 0x75a: 0xba, 0x75b: 0xba, 0x75c: 0xba, 0x75d: 0xba, 0x75e: 0xba, 0x75f: 0xba, 0x760: 0x75, 0x761: 0x76, 0x762: 0x77, 0x763: 0x178, 0x764: 0x78, 0x765: 0x79, 0x766: 0x179, 0x767: 0x7a, 0x768: 0x7b, 0x769: 0xba, 0x76a: 0xba, 0x76b: 0xba, 0x76c: 0xba, 0x76d: 0xba, 0x76e: 0xba, 0x76f: 0xba, 0x770: 0xba, 0x771: 0xba, 0x772: 0xba, 0x773: 0xba, 0x774: 0xba, 0x775: 0xba, 0x776: 0xba, 0x777: 0xba, 0x778: 0xba, 0x779: 0xba, 0x77a: 0xba, 0x77b: 0xba, 0x77c: 0xba, 0x77d: 0xba, 0x77e: 0xba, 0x77f: 0xba, // Block 0x1e, offset 0x780 0x790: 0x0d, 0x791: 0x0e, 0x792: 0x0f, 0x793: 0x10, 0x794: 0x11, 0x795: 0x0b, 0x796: 0x12, 0x797: 0x07, 0x798: 0x13, 0x799: 0x0b, 0x79a: 0x0b, 0x79b: 0x14, 0x79c: 0x0b, 0x79d: 0x15, 0x79e: 0x16, 0x79f: 0x17, 0x7a0: 0x07, 0x7a1: 0x07, 0x7a2: 0x07, 0x7a3: 0x07, 0x7a4: 0x07, 0x7a5: 0x07, 0x7a6: 0x07, 0x7a7: 0x07, 0x7a8: 0x07, 0x7a9: 0x07, 0x7aa: 0x18, 0x7ab: 0x19, 0x7ac: 0x1a, 0x7ad: 0x0b, 0x7ae: 0x0b, 0x7af: 0x1b, 0x7b0: 0x0b, 0x7b1: 0x0b, 0x7b2: 0x0b, 0x7b3: 0x0b, 0x7b4: 0x0b, 0x7b5: 0x0b, 0x7b6: 0x0b, 0x7b7: 0x0b, 0x7b8: 0x0b, 0x7b9: 0x0b, 0x7ba: 0x0b, 0x7bb: 0x0b, 0x7bc: 0x0b, 0x7bd: 0x0b, 0x7be: 0x0b, 0x7bf: 0x0b, // Block 0x1f, offset 0x7c0 0x7c0: 0x0b, 0x7c1: 0x0b, 0x7c2: 0x0b, 0x7c3: 0x0b, 0x7c4: 0x0b, 0x7c5: 0x0b, 0x7c6: 0x0b, 0x7c7: 0x0b, 0x7c8: 0x0b, 0x7c9: 0x0b, 0x7ca: 0x0b, 0x7cb: 0x0b, 0x7cc: 0x0b, 0x7cd: 0x0b, 0x7ce: 0x0b, 0x7cf: 0x0b, 0x7d0: 0x0b, 0x7d1: 0x0b, 0x7d2: 0x0b, 0x7d3: 0x0b, 0x7d4: 0x0b, 0x7d5: 0x0b, 0x7d6: 0x0b, 0x7d7: 0x0b, 0x7d8: 0x0b, 0x7d9: 0x0b, 0x7da: 0x0b, 0x7db: 0x0b, 0x7dc: 0x0b, 0x7dd: 0x0b, 0x7de: 0x0b, 0x7df: 0x0b, 0x7e0: 0x0b, 0x7e1: 0x0b, 0x7e2: 0x0b, 0x7e3: 0x0b, 0x7e4: 0x0b, 0x7e5: 0x0b, 0x7e6: 0x0b, 0x7e7: 0x0b, 0x7e8: 0x0b, 0x7e9: 0x0b, 0x7ea: 0x0b, 0x7eb: 0x0b, 0x7ec: 0x0b, 0x7ed: 0x0b, 0x7ee: 0x0b, 0x7ef: 0x0b, 0x7f0: 0x0b, 0x7f1: 0x0b, 0x7f2: 0x0b, 0x7f3: 0x0b, 0x7f4: 0x0b, 0x7f5: 0x0b, 0x7f6: 0x0b, 0x7f7: 0x0b, 0x7f8: 0x0b, 0x7f9: 0x0b, 0x7fa: 0x0b, 0x7fb: 0x0b, 0x7fc: 0x0b, 0x7fd: 0x0b, 0x7fe: 0x0b, 0x7ff: 0x0b, // Block 0x20, offset 0x800 0x800: 0x17a, 0x801: 0x17b, 0x802: 0xba, 0x803: 0xba, 0x804: 0x17c, 0x805: 0x17c, 0x806: 0x17c, 0x807: 0x17d, 0x808: 0xba, 0x809: 0xba, 0x80a: 0xba, 0x80b: 0xba, 0x80c: 0xba, 0x80d: 0xba, 0x80e: 0xba, 0x80f: 0xba, 0x810: 0xba, 0x811: 0xba, 0x812: 0xba, 0x813: 0xba, 0x814: 0xba, 0x815: 0xba, 0x816: 0xba, 0x817: 0xba, 0x818: 0xba, 0x819: 0xba, 0x81a: 0xba, 0x81b: 0xba, 0x81c: 0xba, 0x81d: 0xba, 0x81e: 0xba, 0x81f: 0xba, 0x820: 0xba, 0x821: 0xba, 0x822: 0xba, 0x823: 0xba, 0x824: 0xba, 0x825: 0xba, 0x826: 0xba, 0x827: 0xba, 0x828: 0xba, 0x829: 0xba, 0x82a: 0xba, 0x82b: 0xba, 0x82c: 0xba, 0x82d: 0xba, 0x82e: 0xba, 0x82f: 0xba, 0x830: 0xba, 0x831: 0xba, 0x832: 0xba, 0x833: 0xba, 0x834: 0xba, 0x835: 0xba, 0x836: 0xba, 0x837: 0xba, 0x838: 0xba, 0x839: 0xba, 0x83a: 0xba, 0x83b: 0xba, 0x83c: 0xba, 0x83d: 0xba, 0x83e: 0xba, 0x83f: 0xba, // Block 0x21, offset 0x840 0x840: 0x0b, 0x841: 0x0b, 0x842: 0x0b, 0x843: 0x0b, 0x844: 0x0b, 0x845: 0x0b, 0x846: 0x0b, 0x847: 0x0b, 0x848: 0x0b, 0x849: 0x0b, 0x84a: 0x0b, 0x84b: 0x0b, 0x84c: 0x0b, 0x84d: 0x0b, 0x84e: 0x0b, 0x84f: 0x0b, 0x850: 0x0b, 0x851: 0x0b, 0x852: 0x0b, 0x853: 0x0b, 0x854: 0x0b, 0x855: 0x0b, 0x856: 0x0b, 0x857: 0x0b, 0x858: 0x0b, 0x859: 0x0b, 0x85a: 0x0b, 0x85b: 0x0b, 0x85c: 0x0b, 0x85d: 0x0b, 0x85e: 0x0b, 0x85f: 0x0b, 0x860: 0x1e, 0x861: 0x0b, 0x862: 0x0b, 0x863: 0x0b, 0x864: 0x0b, 0x865: 0x0b, 0x866: 0x0b, 0x867: 0x0b, 0x868: 0x0b, 0x869: 0x0b, 0x86a: 0x0b, 0x86b: 0x0b, 0x86c: 0x0b, 0x86d: 0x0b, 0x86e: 0x0b, 0x86f: 0x0b, 0x870: 0x0b, 0x871: 0x0b, 0x872: 0x0b, 0x873: 0x0b, 0x874: 0x0b, 0x875: 0x0b, 0x876: 0x0b, 0x877: 0x0b, 0x878: 0x0b, 0x879: 0x0b, 0x87a: 0x0b, 0x87b: 0x0b, 0x87c: 0x0b, 0x87d: 0x0b, 0x87e: 0x0b, 0x87f: 0x0b, // Block 0x22, offset 0x880 0x880: 0x0b, 0x881: 0x0b, 0x882: 0x0b, 0x883: 0x0b, 0x884: 0x0b, 0x885: 0x0b, 0x886: 0x0b, 0x887: 0x0b, 0x888: 0x0b, 0x889: 0x0b, 0x88a: 0x0b, 0x88b: 0x0b, 0x88c: 0x0b, 0x88d: 0x0b, 0x88e: 0x0b, 0x88f: 0x0b, } // idnaSparseOffset: 258 entries, 516 bytes var idnaSparseOffset = []uint16{0x0, 0x8, 0x19, 0x25, 0x27, 0x2c, 0x34, 0x3f, 0x4b, 0x4f, 0x5e, 0x63, 0x6b, 0x77, 0x85, 0x93, 0x98, 0xa1, 0xb1, 0xbf, 0xcc, 0xd8, 0xe9, 0xf3, 0xfa, 0x107, 0x118, 0x11f, 0x12a, 0x139, 0x147, 0x151, 0x153, 0x158, 0x15b, 0x15e, 0x160, 0x16c, 0x177, 0x17f, 0x185, 0x18b, 0x190, 0x195, 0x198, 0x19c, 0x1a2, 0x1a7, 0x1b3, 0x1bd, 0x1c3, 0x1d4, 0x1de, 0x1e1, 0x1e9, 0x1ec, 0x1f9, 0x201, 0x205, 0x20c, 0x214, 0x224, 0x230, 0x232, 0x23c, 0x248, 0x254, 0x260, 0x268, 0x26d, 0x277, 0x288, 0x28c, 0x297, 0x29b, 0x2a4, 0x2ac, 0x2b2, 0x2b7, 0x2ba, 0x2bd, 0x2c1, 0x2c7, 0x2cb, 0x2cf, 0x2d5, 0x2dc, 0x2e2, 0x2ea, 0x2f1, 0x2fc, 0x306, 0x30a, 0x30d, 0x313, 0x317, 0x319, 0x31c, 0x31e, 0x321, 0x32b, 0x32e, 0x33d, 0x341, 0x346, 0x349, 0x34d, 0x352, 0x357, 0x35d, 0x363, 0x372, 0x378, 0x37c, 0x38b, 0x390, 0x398, 0x3a2, 0x3ad, 0x3b5, 0x3c6, 0x3cf, 0x3df, 0x3ec, 0x3f6, 0x3fb, 0x408, 0x40c, 0x411, 0x413, 0x417, 0x419, 0x41d, 0x426, 0x42c, 0x430, 0x440, 0x44a, 0x44f, 0x452, 0x458, 0x45f, 0x464, 0x468, 0x46e, 0x473, 0x47c, 0x481, 0x487, 0x48e, 0x495, 0x49c, 0x4a0, 0x4a5, 0x4a8, 0x4ad, 0x4b9, 0x4bf, 0x4c4, 0x4cb, 0x4d3, 0x4d8, 0x4dc, 0x4ec, 0x4f3, 0x4f7, 0x4fb, 0x502, 0x504, 0x507, 0x50a, 0x50e, 0x512, 0x518, 0x521, 0x52d, 0x534, 0x53d, 0x545, 0x54c, 0x55a, 0x567, 0x574, 0x57d, 0x581, 0x58f, 0x597, 0x5a2, 0x5ab, 0x5b1, 0x5b9, 0x5c2, 0x5cc, 0x5cf, 0x5db, 0x5de, 0x5e3, 0x5e6, 0x5f0, 0x5f9, 0x605, 0x608, 0x60d, 0x610, 0x613, 0x616, 0x61d, 0x624, 0x628, 0x633, 0x636, 0x63c, 0x641, 0x645, 0x648, 0x64b, 0x64e, 0x653, 0x65d, 0x660, 0x664, 0x673, 0x67f, 0x683, 0x688, 0x68d, 0x691, 0x696, 0x69f, 0x6aa, 0x6b0, 0x6b8, 0x6bc, 0x6c0, 0x6c6, 0x6cc, 0x6d1, 0x6d4, 0x6e2, 0x6e9, 0x6ec, 0x6ef, 0x6f3, 0x6f9, 0x6fe, 0x708, 0x70d, 0x710, 0x713, 0x716, 0x719, 0x71d, 0x720, 0x730, 0x741, 0x746, 0x748, 0x74a} // idnaSparseValues: 1869 entries, 7476 bytes var idnaSparseValues = [1869]valueRange{ // Block 0x0, offset 0x0 {value: 0x0000, lo: 0x07}, {value: 0xe105, lo: 0x80, hi: 0x96}, {value: 0x0018, lo: 0x97, hi: 0x97}, {value: 0xe105, lo: 0x98, hi: 0x9e}, {value: 0x001f, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbf}, // Block 0x1, offset 0x8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0xe01d, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0335, lo: 0x83, hi: 0x83}, {value: 0x034d, lo: 0x84, hi: 0x84}, {value: 0x0365, lo: 0x85, hi: 0x85}, {value: 0xe00d, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0xe00d, lo: 0x88, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x89}, {value: 0xe00d, lo: 0x8a, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe00d, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0x8d}, {value: 0xe00d, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0xbf}, // Block 0x2, offset 0x19 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x0249, lo: 0xb0, hi: 0xb0}, {value: 0x037d, lo: 0xb1, hi: 0xb1}, {value: 0x0259, lo: 0xb2, hi: 0xb2}, {value: 0x0269, lo: 0xb3, hi: 0xb3}, {value: 0x034d, lo: 0xb4, hi: 0xb4}, {value: 0x0395, lo: 0xb5, hi: 0xb5}, {value: 0xe1bd, lo: 0xb6, hi: 0xb6}, {value: 0x0279, lo: 0xb7, hi: 0xb7}, {value: 0x0289, lo: 0xb8, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbf}, // Block 0x3, offset 0x25 {value: 0x0000, lo: 0x01}, {value: 0x3308, lo: 0x80, hi: 0xbf}, // Block 0x4, offset 0x27 {value: 0x0000, lo: 0x04}, {value: 0x03f5, lo: 0x80, hi: 0x8f}, {value: 0xe105, lo: 0x90, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x5, offset 0x2c {value: 0x0000, lo: 0x07}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x0545, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x0008, lo: 0x99, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x6, offset 0x34 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0401, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x88}, {value: 0x0018, lo: 0x89, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x3308, lo: 0x91, hi: 0xbd}, {value: 0x0818, lo: 0xbe, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x7, offset 0x3f {value: 0x0000, lo: 0x0b}, {value: 0x0818, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x82}, {value: 0x0818, lo: 0x83, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x85}, {value: 0x0818, lo: 0x86, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0808, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x8, offset 0x4b {value: 0x0000, lo: 0x03}, {value: 0x0a08, lo: 0x80, hi: 0x87}, {value: 0x0c08, lo: 0x88, hi: 0x99}, {value: 0x0a08, lo: 0x9a, hi: 0xbf}, // Block 0x9, offset 0x4f {value: 0x0000, lo: 0x0e}, {value: 0x3308, lo: 0x80, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8c}, {value: 0x0c08, lo: 0x8d, hi: 0x8d}, {value: 0x0a08, lo: 0x8e, hi: 0x98}, {value: 0x0c08, lo: 0x99, hi: 0x9b}, {value: 0x0a08, lo: 0x9c, hi: 0xaa}, {value: 0x0c08, lo: 0xab, hi: 0xac}, {value: 0x0a08, lo: 0xad, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb1}, {value: 0x0a08, lo: 0xb2, hi: 0xb2}, {value: 0x0c08, lo: 0xb3, hi: 0xb4}, {value: 0x0a08, lo: 0xb5, hi: 0xb7}, {value: 0x0c08, lo: 0xb8, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbf}, // Block 0xa, offset 0x5e {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xb0}, {value: 0x0808, lo: 0xb1, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xb, offset 0x63 {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0xc, offset 0x6b {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x99}, {value: 0x0808, lo: 0x9a, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa3}, {value: 0x0808, lo: 0xa4, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa7}, {value: 0x0808, lo: 0xa8, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0818, lo: 0xb0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd, offset 0x77 {value: 0x0000, lo: 0x0d}, {value: 0x0c08, lo: 0x80, hi: 0x80}, {value: 0x0a08, lo: 0x81, hi: 0x85}, {value: 0x0c08, lo: 0x86, hi: 0x87}, {value: 0x0a08, lo: 0x88, hi: 0x88}, {value: 0x0c08, lo: 0x89, hi: 0x89}, {value: 0x0a08, lo: 0x8a, hi: 0x93}, {value: 0x0c08, lo: 0x94, hi: 0x94}, {value: 0x0a08, lo: 0x95, hi: 0x95}, {value: 0x0808, lo: 0x96, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xe, offset 0x85 {value: 0x0000, lo: 0x0d}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0a08, lo: 0xa0, hi: 0xa9}, {value: 0x0c08, lo: 0xaa, hi: 0xac}, {value: 0x0808, lo: 0xad, hi: 0xad}, {value: 0x0c08, lo: 0xae, hi: 0xae}, {value: 0x0a08, lo: 0xaf, hi: 0xb0}, {value: 0x0c08, lo: 0xb1, hi: 0xb2}, {value: 0x0a08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0a08, lo: 0xb6, hi: 0xb8}, {value: 0x0c08, lo: 0xb9, hi: 0xb9}, {value: 0x0a08, lo: 0xba, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0xf, offset 0x93 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa1}, {value: 0x0840, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xbf}, // Block 0x10, offset 0x98 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x11, offset 0xa1 {value: 0x0000, lo: 0x0f}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x85}, {value: 0x3008, lo: 0x86, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x3008, lo: 0x8a, hi: 0x8c}, {value: 0x3b08, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x12, offset 0xb1 {value: 0x0000, lo: 0x0d}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xa9}, {value: 0x0008, lo: 0xaa, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x13, offset 0xbf {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x14, offset 0xcc {value: 0x0000, lo: 0x0b}, {value: 0x0040, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x15, offset 0xd8 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x89}, {value: 0x3b08, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x3008, lo: 0x98, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x16, offset 0xe9 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb2}, {value: 0x08f1, lo: 0xb3, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb9}, {value: 0x3b08, lo: 0xba, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x0018, lo: 0xbf, hi: 0xbf}, // Block 0x17, offset 0xf3 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x8e}, {value: 0x0018, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0xbf}, // Block 0x18, offset 0xfa {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0961, lo: 0x9c, hi: 0x9c}, {value: 0x0999, lo: 0x9d, hi: 0x9d}, {value: 0x0008, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x19, offset 0x107 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8a}, {value: 0x0008, lo: 0x8b, hi: 0x8b}, {value: 0xe03d, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x1a, offset 0x118 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0xbf}, // Block 0x1b, offset 0x11f {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x1c, offset 0x12a {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x3008, lo: 0x96, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x3308, lo: 0x9e, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xa1}, {value: 0x3008, lo: 0xa2, hi: 0xa4}, {value: 0x0008, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xbf}, // Block 0x1d, offset 0x139 {value: 0x0000, lo: 0x0d}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x8c}, {value: 0x3308, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x8e}, {value: 0x3008, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x3008, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0x1e, offset 0x147 {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x86}, {value: 0x055d, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8c}, {value: 0x055d, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbb}, {value: 0xe105, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0x1f, offset 0x151 {value: 0x0000, lo: 0x01}, {value: 0x0018, lo: 0x80, hi: 0xbf}, // Block 0x20, offset 0x153 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa0}, {value: 0x2018, lo: 0xa1, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x21, offset 0x158 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa7}, {value: 0x2018, lo: 0xa8, hi: 0xbf}, // Block 0x22, offset 0x15b {value: 0x0000, lo: 0x02}, {value: 0x2018, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0xbf}, // Block 0x23, offset 0x15e {value: 0x0000, lo: 0x01}, {value: 0x0008, lo: 0x80, hi: 0xbf}, // Block 0x24, offset 0x160 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x99}, {value: 0x0008, lo: 0x9a, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x25, offset 0x16c {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x26, offset 0x177 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x27, offset 0x17f {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0x0008, lo: 0x92, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbf}, // Block 0x28, offset 0x185 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x29, offset 0x18b {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2a, offset 0x190 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x2b, offset 0x195 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x2c, offset 0x198 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xbf}, // Block 0x2d, offset 0x19c {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x2e, offset 0x1a2 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0x2f, offset 0x1a7 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8d}, {value: 0x0008, lo: 0x8e, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x3b08, lo: 0x94, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3b08, lo: 0xb4, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x30, offset 0x1b3 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x31, offset 0x1bd {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xb3}, {value: 0x3340, lo: 0xb4, hi: 0xb5}, {value: 0x3008, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbf}, // Block 0x32, offset 0x1c3 {value: 0x0000, lo: 0x10}, {value: 0x3008, lo: 0x80, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x3008, lo: 0x87, hi: 0x88}, {value: 0x3308, lo: 0x89, hi: 0x91}, {value: 0x3b08, lo: 0x92, hi: 0x92}, {value: 0x3308, lo: 0x93, hi: 0x93}, {value: 0x0018, lo: 0x94, hi: 0x96}, {value: 0x0008, lo: 0x97, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x33, offset 0x1d4 {value: 0x0000, lo: 0x09}, {value: 0x0018, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x86}, {value: 0x0218, lo: 0x87, hi: 0x87}, {value: 0x0018, lo: 0x88, hi: 0x8a}, {value: 0x33c0, lo: 0x8b, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0208, lo: 0xa0, hi: 0xbf}, // Block 0x34, offset 0x1de {value: 0x0000, lo: 0x02}, {value: 0x0208, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x35, offset 0x1e1 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0208, lo: 0x87, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xa9}, {value: 0x0208, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x36, offset 0x1e9 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0x37, offset 0x1ec {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb8}, {value: 0x3308, lo: 0xb9, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x38, offset 0x1f9 {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0008, lo: 0x86, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0x39, offset 0x201 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x3a, offset 0x205 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0028, lo: 0x9a, hi: 0x9a}, {value: 0x0040, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0xbf}, // Block 0x3b, offset 0x20c {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x3308, lo: 0x97, hi: 0x98}, {value: 0x3008, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x3c, offset 0x214 {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x94}, {value: 0x3008, lo: 0x95, hi: 0x95}, {value: 0x3308, lo: 0x96, hi: 0x96}, {value: 0x3008, lo: 0x97, hi: 0x97}, {value: 0x3308, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3b08, lo: 0xa0, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xac}, {value: 0x3008, lo: 0xad, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0x3d, offset 0x224 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xbd}, {value: 0x3318, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x3e, offset 0x230 {value: 0x0000, lo: 0x01}, {value: 0x0040, lo: 0x80, hi: 0xbf}, // Block 0x3f, offset 0x232 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x83}, {value: 0x3008, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x40, offset 0x23c {value: 0x0000, lo: 0x0b}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x3808, lo: 0x84, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x41, offset 0x248 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3808, lo: 0xaa, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xbf}, // Block 0x42, offset 0x254 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa9}, {value: 0x3008, lo: 0xaa, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3808, lo: 0xb2, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbf}, // Block 0x43, offset 0x260 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x3008, lo: 0xa4, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbf}, // Block 0x44, offset 0x268 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x45, offset 0x26d {value: 0x0000, lo: 0x09}, {value: 0x0e29, lo: 0x80, hi: 0x80}, {value: 0x0e41, lo: 0x81, hi: 0x81}, {value: 0x0e59, lo: 0x82, hi: 0x82}, {value: 0x0e71, lo: 0x83, hi: 0x83}, {value: 0x0e89, lo: 0x84, hi: 0x85}, {value: 0x0ea1, lo: 0x86, hi: 0x86}, {value: 0x0eb9, lo: 0x87, hi: 0x87}, {value: 0x057d, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0x46, offset 0x277 {value: 0x0000, lo: 0x10}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x92}, {value: 0x0018, lo: 0x93, hi: 0x93}, {value: 0x3308, lo: 0x94, hi: 0xa0}, {value: 0x3008, lo: 0xa1, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa8}, {value: 0x0008, lo: 0xa9, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x0008, lo: 0xae, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x47, offset 0x288 {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0x48, offset 0x28c {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x87}, {value: 0xe045, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0xe045, lo: 0x98, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0xe045, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb7}, {value: 0xe045, lo: 0xb8, hi: 0xbf}, // Block 0x49, offset 0x297 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x3318, lo: 0x90, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbf}, // Block 0x4a, offset 0x29b {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x88}, {value: 0x24c1, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x4b, offset 0x2a4 {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x24f1, lo: 0xac, hi: 0xac}, {value: 0x2529, lo: 0xad, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xae}, {value: 0x2579, lo: 0xaf, hi: 0xaf}, {value: 0x25b1, lo: 0xb0, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0x4c, offset 0x2ac {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x9f}, {value: 0x0080, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xad}, {value: 0x0080, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x4d, offset 0x2b2 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xa8}, {value: 0x09c5, lo: 0xa9, hi: 0xa9}, {value: 0x09e5, lo: 0xaa, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xbf}, // Block 0x4e, offset 0x2b7 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x4f, offset 0x2ba {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xbf}, // Block 0x50, offset 0x2bd {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x28c1, lo: 0x8c, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0xbf}, // Block 0x51, offset 0x2c1 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0e66, lo: 0xb4, hi: 0xb4}, {value: 0x292a, lo: 0xb5, hi: 0xb5}, {value: 0x0e86, lo: 0xb6, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x52, offset 0x2c7 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x9b}, {value: 0x2941, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0xbf}, // Block 0x53, offset 0x2cb {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0x54, offset 0x2cf {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0018, lo: 0x98, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbc}, {value: 0x0018, lo: 0xbd, hi: 0xbf}, // Block 0x55, offset 0x2d5 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0xab}, {value: 0x0018, lo: 0xac, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x56, offset 0x2dc {value: 0x0000, lo: 0x05}, {value: 0xe185, lo: 0x80, hi: 0x8f}, {value: 0x03f5, lo: 0x90, hi: 0x9f}, {value: 0x0ea5, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x57, offset 0x2e2 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xa6}, {value: 0x0008, lo: 0xa7, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xac}, {value: 0x0008, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x58, offset 0x2ea {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xae}, {value: 0xe075, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0x59, offset 0x2f1 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x0008, lo: 0xb8, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x5a, offset 0x2fc {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xbf}, // Block 0x5b, offset 0x306 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0008, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x5c, offset 0x30a {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0xbf}, // Block 0x5d, offset 0x30d {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9e}, {value: 0x0edd, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0x5e, offset 0x313 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xb2}, {value: 0x0efd, lo: 0xb3, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0x5f, offset 0x317 {value: 0x0020, lo: 0x01}, {value: 0x0f1d, lo: 0x80, hi: 0xbf}, // Block 0x60, offset 0x319 {value: 0x0020, lo: 0x02}, {value: 0x171d, lo: 0x80, hi: 0x8f}, {value: 0x18fd, lo: 0x90, hi: 0xbf}, // Block 0x61, offset 0x31c {value: 0x0020, lo: 0x01}, {value: 0x1efd, lo: 0x80, hi: 0xbf}, // Block 0x62, offset 0x31e {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0xbf}, // Block 0x63, offset 0x321 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x98}, {value: 0x3308, lo: 0x99, hi: 0x9a}, {value: 0x29e2, lo: 0x9b, hi: 0x9b}, {value: 0x2a0a, lo: 0x9c, hi: 0x9c}, {value: 0x0008, lo: 0x9d, hi: 0x9e}, {value: 0x2a31, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0008, lo: 0xa1, hi: 0xbf}, // Block 0x64, offset 0x32b {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xbe}, {value: 0x2a69, lo: 0xbf, hi: 0xbf}, // Block 0x65, offset 0x32e {value: 0x0000, lo: 0x0e}, {value: 0x0040, lo: 0x80, hi: 0x84}, {value: 0x0008, lo: 0x85, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xb0}, {value: 0x2a1d, lo: 0xb1, hi: 0xb1}, {value: 0x2a3d, lo: 0xb2, hi: 0xb2}, {value: 0x2a5d, lo: 0xb3, hi: 0xb3}, {value: 0x2a7d, lo: 0xb4, hi: 0xb4}, {value: 0x2a5d, lo: 0xb5, hi: 0xb5}, {value: 0x2a9d, lo: 0xb6, hi: 0xb6}, {value: 0x2abd, lo: 0xb7, hi: 0xb7}, {value: 0x2add, lo: 0xb8, hi: 0xb9}, {value: 0x2afd, lo: 0xba, hi: 0xbb}, {value: 0x2b1d, lo: 0xbc, hi: 0xbd}, {value: 0x2afd, lo: 0xbe, hi: 0xbf}, // Block 0x66, offset 0x33d {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x67, offset 0x341 {value: 0x0030, lo: 0x04}, {value: 0x2aa2, lo: 0x80, hi: 0x9d}, {value: 0x305a, lo: 0x9e, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x30a2, lo: 0xa0, hi: 0xbf}, // Block 0x68, offset 0x346 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x69, offset 0x349 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0040, lo: 0x8d, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0x6a, offset 0x34d {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0x6b, offset 0x352 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xbf}, // Block 0x6c, offset 0x357 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb1}, {value: 0x0018, lo: 0xb2, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x6d, offset 0x35d {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0xb6}, {value: 0x0008, lo: 0xb7, hi: 0xb7}, {value: 0x2009, lo: 0xb8, hi: 0xb8}, {value: 0x6e89, lo: 0xb9, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xbf}, // Block 0x6e, offset 0x363 {value: 0x0000, lo: 0x0e}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x3308, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x3308, lo: 0x8b, hi: 0x8b}, {value: 0x0008, lo: 0x8c, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa6}, {value: 0x3008, lo: 0xa7, hi: 0xa7}, {value: 0x0018, lo: 0xa8, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x6f, offset 0x372 {value: 0x0000, lo: 0x05}, {value: 0x0208, lo: 0x80, hi: 0xb1}, {value: 0x0108, lo: 0xb2, hi: 0xb2}, {value: 0x0008, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0x70, offset 0x378 {value: 0x0000, lo: 0x03}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xbf}, // Block 0x71, offset 0x37c {value: 0x0000, lo: 0x0e}, {value: 0x3008, lo: 0x80, hi: 0x83}, {value: 0x3b08, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8d}, {value: 0x0018, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xba}, {value: 0x0008, lo: 0xbb, hi: 0xbb}, {value: 0x0018, lo: 0xbc, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x72, offset 0x38b {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x73, offset 0x390 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x3308, lo: 0x87, hi: 0x91}, {value: 0x3008, lo: 0x92, hi: 0x92}, {value: 0x3808, lo: 0x93, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0x74, offset 0x398 {value: 0x0000, lo: 0x09}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x3008, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb9}, {value: 0x3008, lo: 0xba, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbf}, // Block 0x75, offset 0x3a2 {value: 0x0000, lo: 0x0a}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0x76, offset 0x3ad {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xa8}, {value: 0x3308, lo: 0xa9, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb0}, {value: 0x3308, lo: 0xb1, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x77, offset 0x3b5 {value: 0x0000, lo: 0x10}, {value: 0x0008, lo: 0x80, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8c}, {value: 0x3008, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xb9}, {value: 0x0008, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbc}, {value: 0x3008, lo: 0xbd, hi: 0xbd}, {value: 0x0008, lo: 0xbe, hi: 0xbf}, // Block 0x78, offset 0x3c6 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb0}, {value: 0x0008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb4}, {value: 0x0008, lo: 0xb5, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb8}, {value: 0x0008, lo: 0xb9, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbf}, // Block 0x79, offset 0x3cf {value: 0x0000, lo: 0x0f}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x9a}, {value: 0x0008, lo: 0x9b, hi: 0x9d}, {value: 0x0018, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xaa}, {value: 0x3008, lo: 0xab, hi: 0xab}, {value: 0x3308, lo: 0xac, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb5}, {value: 0x3b08, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x7a, offset 0x3df {value: 0x0000, lo: 0x0c}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x88}, {value: 0x0008, lo: 0x89, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x90}, {value: 0x0008, lo: 0x91, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x7b, offset 0x3ec {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x4465, lo: 0x9c, hi: 0x9c}, {value: 0x447d, lo: 0x9d, hi: 0x9d}, {value: 0x2971, lo: 0x9e, hi: 0x9e}, {value: 0xe06d, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa5}, {value: 0x0040, lo: 0xa6, hi: 0xaf}, {value: 0x4495, lo: 0xb0, hi: 0xbf}, // Block 0x7c, offset 0x3f6 {value: 0x0000, lo: 0x04}, {value: 0x44b5, lo: 0x80, hi: 0x8f}, {value: 0x44d5, lo: 0x90, hi: 0x9f}, {value: 0x44f5, lo: 0xa0, hi: 0xaf}, {value: 0x44d5, lo: 0xb0, hi: 0xbf}, // Block 0x7d, offset 0x3fb {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0xa2}, {value: 0x3008, lo: 0xa3, hi: 0xa4}, {value: 0x3308, lo: 0xa5, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa7}, {value: 0x3308, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xaa}, {value: 0x0018, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3b08, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0x7e, offset 0x408 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0x7f, offset 0x40c {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x80, offset 0x411 {value: 0x0020, lo: 0x01}, {value: 0x4515, lo: 0x80, hi: 0xbf}, // Block 0x81, offset 0x413 {value: 0x0020, lo: 0x03}, {value: 0x4d15, lo: 0x80, hi: 0x94}, {value: 0x4ad5, lo: 0x95, hi: 0x95}, {value: 0x4fb5, lo: 0x96, hi: 0xbf}, // Block 0x82, offset 0x417 {value: 0x0020, lo: 0x01}, {value: 0x54f5, lo: 0x80, hi: 0xbf}, // Block 0x83, offset 0x419 {value: 0x0020, lo: 0x03}, {value: 0x5cf5, lo: 0x80, hi: 0x84}, {value: 0x5655, lo: 0x85, hi: 0x85}, {value: 0x5d95, lo: 0x86, hi: 0xbf}, // Block 0x84, offset 0x41d {value: 0x0020, lo: 0x08}, {value: 0x6b55, lo: 0x80, hi: 0x8f}, {value: 0x6d15, lo: 0x90, hi: 0x90}, {value: 0x6d55, lo: 0x91, hi: 0xab}, {value: 0x6ea1, lo: 0xac, hi: 0xac}, {value: 0x70b5, lo: 0xad, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x70d5, lo: 0xb0, hi: 0xbf}, // Block 0x85, offset 0x426 {value: 0x0020, lo: 0x05}, {value: 0x72d5, lo: 0x80, hi: 0xad}, {value: 0x6535, lo: 0xae, hi: 0xae}, {value: 0x7895, lo: 0xaf, hi: 0xb5}, {value: 0x6f55, lo: 0xb6, hi: 0xb6}, {value: 0x7975, lo: 0xb7, hi: 0xbf}, // Block 0x86, offset 0x42c {value: 0x0028, lo: 0x03}, {value: 0x7c21, lo: 0x80, hi: 0x82}, {value: 0x7be1, lo: 0x83, hi: 0x83}, {value: 0x7c99, lo: 0x84, hi: 0xbf}, // Block 0x87, offset 0x430 {value: 0x0038, lo: 0x0f}, {value: 0x9db1, lo: 0x80, hi: 0x83}, {value: 0x9e59, lo: 0x84, hi: 0x85}, {value: 0x9e91, lo: 0x86, hi: 0x87}, {value: 0x9ec9, lo: 0x88, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x91}, {value: 0xa089, lo: 0x92, hi: 0x97}, {value: 0xa1a1, lo: 0x98, hi: 0x9c}, {value: 0xa281, lo: 0x9d, hi: 0xb3}, {value: 0x9d41, lo: 0xb4, hi: 0xb4}, {value: 0x9db1, lo: 0xb5, hi: 0xb5}, {value: 0xa789, lo: 0xb6, hi: 0xbb}, {value: 0xa869, lo: 0xbc, hi: 0xbc}, {value: 0xa7f9, lo: 0xbd, hi: 0xbd}, {value: 0xa8d9, lo: 0xbe, hi: 0xbf}, // Block 0x88, offset 0x440 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8c}, {value: 0x0008, lo: 0x8d, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbb}, {value: 0x0008, lo: 0xbc, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0x89, offset 0x44a {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0x8a, offset 0x44f {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x8b, offset 0x452 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x82}, {value: 0x0040, lo: 0x83, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0x8c, offset 0x458 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x8e}, {value: 0x0040, lo: 0x8f, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0x8d, offset 0x45f {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x0040, lo: 0xbe, hi: 0xbf}, // Block 0x8e, offset 0x464 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9c}, {value: 0x0040, lo: 0x9d, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x8f, offset 0x468 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x90}, {value: 0x0040, lo: 0x91, hi: 0x9f}, {value: 0x3308, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x90, offset 0x46e {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x91, offset 0x473 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x81}, {value: 0x0008, lo: 0x82, hi: 0x89}, {value: 0x0018, lo: 0x8a, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbf}, // Block 0x92, offset 0x47c {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0x93, offset 0x481 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0xbf}, // Block 0x94, offset 0x487 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x97}, {value: 0x8ad5, lo: 0x98, hi: 0x9f}, {value: 0x8aed, lo: 0xa0, hi: 0xa7}, {value: 0x0008, lo: 0xa8, hi: 0xbf}, // Block 0x95, offset 0x48e {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x8aed, lo: 0xb0, hi: 0xb7}, {value: 0x8ad5, lo: 0xb8, hi: 0xbf}, // Block 0x96, offset 0x495 {value: 0x0000, lo: 0x06}, {value: 0xe145, lo: 0x80, hi: 0x87}, {value: 0xe1c5, lo: 0x88, hi: 0x8f}, {value: 0xe145, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0xbb}, {value: 0x0040, lo: 0xbc, hi: 0xbf}, // Block 0x97, offset 0x49c {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0x98, offset 0x4a0 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xae}, {value: 0x0018, lo: 0xaf, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x99, offset 0x4a5 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0x9a, offset 0x4a8 {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xbf}, // Block 0x9b, offset 0x4ad {value: 0x0000, lo: 0x0b}, {value: 0x0808, lo: 0x80, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x87}, {value: 0x0808, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0808, lo: 0x8a, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb6}, {value: 0x0808, lo: 0xb7, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbb}, {value: 0x0808, lo: 0xbc, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbe}, {value: 0x0808, lo: 0xbf, hi: 0xbf}, // Block 0x9c, offset 0x4b9 {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x96}, {value: 0x0818, lo: 0x97, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb6}, {value: 0x0818, lo: 0xb7, hi: 0xbf}, // Block 0x9d, offset 0x4bf {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xa6}, {value: 0x0818, lo: 0xa7, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0x9e, offset 0x4c4 {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb3}, {value: 0x0808, lo: 0xb4, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xba}, {value: 0x0818, lo: 0xbb, hi: 0xbf}, // Block 0x9f, offset 0x4cb {value: 0x0000, lo: 0x07}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0818, lo: 0x96, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbe}, {value: 0x0818, lo: 0xbf, hi: 0xbf}, // Block 0xa0, offset 0x4d3 {value: 0x0000, lo: 0x04}, {value: 0x0808, lo: 0x80, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbb}, {value: 0x0818, lo: 0xbc, hi: 0xbd}, {value: 0x0808, lo: 0xbe, hi: 0xbf}, // Block 0xa1, offset 0x4d8 {value: 0x0000, lo: 0x03}, {value: 0x0818, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x0818, lo: 0x92, hi: 0xbf}, // Block 0xa2, offset 0x4dc {value: 0x0000, lo: 0x0f}, {value: 0x0808, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x84}, {value: 0x3308, lo: 0x85, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x8b}, {value: 0x3308, lo: 0x8c, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x94}, {value: 0x0808, lo: 0x95, hi: 0x97}, {value: 0x0040, lo: 0x98, hi: 0x98}, {value: 0x0808, lo: 0x99, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xba}, {value: 0x0040, lo: 0xbb, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xa3, offset 0x4ec {value: 0x0000, lo: 0x06}, {value: 0x0818, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0818, lo: 0x90, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xbc}, {value: 0x0818, lo: 0xbd, hi: 0xbf}, // Block 0xa4, offset 0x4f3 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0x9c}, {value: 0x0818, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xa5, offset 0x4f7 {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb8}, {value: 0x0018, lo: 0xb9, hi: 0xbf}, // Block 0xa6, offset 0x4fb {value: 0x0000, lo: 0x06}, {value: 0x0808, lo: 0x80, hi: 0x95}, {value: 0x0040, lo: 0x96, hi: 0x97}, {value: 0x0818, lo: 0x98, hi: 0x9f}, {value: 0x0808, lo: 0xa0, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb7}, {value: 0x0818, lo: 0xb8, hi: 0xbf}, // Block 0xa7, offset 0x502 {value: 0x0000, lo: 0x01}, {value: 0x0808, lo: 0x80, hi: 0xbf}, // Block 0xa8, offset 0x504 {value: 0x0000, lo: 0x02}, {value: 0x0808, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0xbf}, // Block 0xa9, offset 0x507 {value: 0x0000, lo: 0x02}, {value: 0x03dd, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xaa, offset 0x50a {value: 0x0000, lo: 0x03}, {value: 0x0808, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xb9}, {value: 0x0818, lo: 0xba, hi: 0xbf}, // Block 0xab, offset 0x50e {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0818, lo: 0xa0, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xac, offset 0x512 {value: 0x0000, lo: 0x05}, {value: 0x3008, lo: 0x80, hi: 0x80}, {value: 0x3308, lo: 0x81, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xad, offset 0x518 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x85}, {value: 0x3b08, lo: 0x86, hi: 0x86}, {value: 0x0018, lo: 0x87, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x91}, {value: 0x0018, lo: 0x92, hi: 0xa5}, {value: 0x0008, lo: 0xa6, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xae, offset 0x521 {value: 0x0000, lo: 0x0b}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb6}, {value: 0x3008, lo: 0xb7, hi: 0xb8}, {value: 0x3b08, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x0018, lo: 0xbb, hi: 0xbc}, {value: 0x0340, lo: 0xbd, hi: 0xbd}, {value: 0x0018, lo: 0xbe, hi: 0xbf}, // Block 0xaf, offset 0x52d {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb0, offset 0x534 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xb2}, {value: 0x3b08, lo: 0xb3, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xbf}, // Block 0xb1, offset 0x53d {value: 0x0000, lo: 0x07}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb3}, {value: 0x0018, lo: 0xb4, hi: 0xb5}, {value: 0x0008, lo: 0xb6, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xb2, offset 0x545 {value: 0x0000, lo: 0x06}, {value: 0x3308, lo: 0x80, hi: 0x81}, {value: 0x3008, lo: 0x82, hi: 0x82}, {value: 0x0008, lo: 0x83, hi: 0xb2}, {value: 0x3008, lo: 0xb3, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xbe}, {value: 0x3008, lo: 0xbf, hi: 0xbf}, // Block 0xb3, offset 0x54c {value: 0x0000, lo: 0x0d}, {value: 0x3808, lo: 0x80, hi: 0x80}, {value: 0x0008, lo: 0x81, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x89}, {value: 0x3308, lo: 0x8a, hi: 0x8c}, {value: 0x0018, lo: 0x8d, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0008, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x0018, lo: 0xa1, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xb4, offset 0x55a {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xae}, {value: 0x3308, lo: 0xaf, hi: 0xb1}, {value: 0x3008, lo: 0xb2, hi: 0xb3}, {value: 0x3308, lo: 0xb4, hi: 0xb4}, {value: 0x3808, lo: 0xb5, hi: 0xb5}, {value: 0x3308, lo: 0xb6, hi: 0xb7}, {value: 0x0018, lo: 0xb8, hi: 0xbd}, {value: 0x3308, lo: 0xbe, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xb5, offset 0x567 {value: 0x0000, lo: 0x0c}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x0008, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0x8d}, {value: 0x0040, lo: 0x8e, hi: 0x8e}, {value: 0x0008, lo: 0x8f, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9e}, {value: 0x0008, lo: 0x9f, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbf}, // Block 0xb6, offset 0x574 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x3308, lo: 0x9f, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa9}, {value: 0x3b08, lo: 0xaa, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0040, lo: 0xba, hi: 0xbf}, // Block 0xb7, offset 0x57d {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x3008, lo: 0xb5, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbf}, // Block 0xb8, offset 0x581 {value: 0x0000, lo: 0x0d}, {value: 0x3008, lo: 0x80, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x84}, {value: 0x3008, lo: 0x85, hi: 0x85}, {value: 0x3308, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x8a}, {value: 0x0018, lo: 0x8b, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0x9b}, {value: 0x0040, lo: 0x9c, hi: 0x9c}, {value: 0x0018, lo: 0x9d, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xb9, offset 0x58f {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xb8}, {value: 0x3008, lo: 0xb9, hi: 0xb9}, {value: 0x3308, lo: 0xba, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbe}, {value: 0x3308, lo: 0xbf, hi: 0xbf}, // Block 0xba, offset 0x597 {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x3008, lo: 0x81, hi: 0x81}, {value: 0x3b08, lo: 0x82, hi: 0x82}, {value: 0x3308, lo: 0x83, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x85}, {value: 0x0018, lo: 0x86, hi: 0x86}, {value: 0x0008, lo: 0x87, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xbb, offset 0x5a2 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xb7}, {value: 0x3008, lo: 0xb8, hi: 0xbb}, {value: 0x3308, lo: 0xbc, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbc, offset 0x5ab {value: 0x0000, lo: 0x05}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x97}, {value: 0x0008, lo: 0x98, hi: 0x9b}, {value: 0x3308, lo: 0x9c, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0xbf}, // Block 0xbd, offset 0x5b1 {value: 0x0000, lo: 0x07}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3008, lo: 0xb0, hi: 0xb2}, {value: 0x3308, lo: 0xb3, hi: 0xba}, {value: 0x3008, lo: 0xbb, hi: 0xbc}, {value: 0x3308, lo: 0xbd, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xbe, offset 0x5b9 {value: 0x0000, lo: 0x08}, {value: 0x3308, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x83}, {value: 0x0008, lo: 0x84, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xbf, offset 0x5c2 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x3308, lo: 0xab, hi: 0xab}, {value: 0x3008, lo: 0xac, hi: 0xac}, {value: 0x3308, lo: 0xad, hi: 0xad}, {value: 0x3008, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb5}, {value: 0x3808, lo: 0xb6, hi: 0xb6}, {value: 0x3308, lo: 0xb7, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbf}, // Block 0xc0, offset 0x5cc {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x89}, {value: 0x0040, lo: 0x8a, hi: 0xbf}, // Block 0xc1, offset 0x5cf {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9f}, {value: 0x3008, lo: 0xa0, hi: 0xa1}, {value: 0x3308, lo: 0xa2, hi: 0xa5}, {value: 0x3008, lo: 0xa6, hi: 0xa6}, {value: 0x3308, lo: 0xa7, hi: 0xaa}, {value: 0x3b08, lo: 0xab, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xb9}, {value: 0x0018, lo: 0xba, hi: 0xbf}, // Block 0xc2, offset 0x5db {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x049d, lo: 0xa0, hi: 0xbf}, // Block 0xc3, offset 0x5de {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbe}, {value: 0x0008, lo: 0xbf, hi: 0xbf}, // Block 0xc4, offset 0x5e3 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb8}, {value: 0x0040, lo: 0xb9, hi: 0xbf}, // Block 0xc5, offset 0x5e6 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x89}, {value: 0x0008, lo: 0x8a, hi: 0xae}, {value: 0x3008, lo: 0xaf, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xb7}, {value: 0x3308, lo: 0xb8, hi: 0xbd}, {value: 0x3008, lo: 0xbe, hi: 0xbe}, {value: 0x3b08, lo: 0xbf, hi: 0xbf}, // Block 0xc6, offset 0x5f0 {value: 0x0000, lo: 0x08}, {value: 0x0008, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0018, lo: 0x9a, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0008, lo: 0xb2, hi: 0xbf}, // Block 0xc7, offset 0x5f9 {value: 0x0000, lo: 0x0b}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x91}, {value: 0x3308, lo: 0x92, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xa8}, {value: 0x3008, lo: 0xa9, hi: 0xa9}, {value: 0x3308, lo: 0xaa, hi: 0xb0}, {value: 0x3008, lo: 0xb1, hi: 0xb1}, {value: 0x3308, lo: 0xb2, hi: 0xb3}, {value: 0x3008, lo: 0xb4, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xc8, offset 0x605 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0xbf}, // Block 0xc9, offset 0x608 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xca, offset 0x60d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0040, lo: 0x84, hi: 0xbf}, // Block 0xcb, offset 0x610 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xbf}, // Block 0xcc, offset 0x613 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0xbf}, // Block 0xcd, offset 0x616 {value: 0x0000, lo: 0x06}, {value: 0x0008, lo: 0x80, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa9}, {value: 0x0040, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xce, offset 0x61d {value: 0x0000, lo: 0x06}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb4}, {value: 0x0018, lo: 0xb5, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xcf, offset 0x624 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0xaf}, {value: 0x3308, lo: 0xb0, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xbf}, // Block 0xd0, offset 0x628 {value: 0x0000, lo: 0x0a}, {value: 0x0008, lo: 0x80, hi: 0x83}, {value: 0x0018, lo: 0x84, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9a}, {value: 0x0018, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x0008, lo: 0xa3, hi: 0xb7}, {value: 0x0040, lo: 0xb8, hi: 0xbc}, {value: 0x0008, lo: 0xbd, hi: 0xbf}, // Block 0xd1, offset 0x633 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0xbf}, // Block 0xd2, offset 0x636 {value: 0x0000, lo: 0x05}, {value: 0x0008, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x90}, {value: 0x3008, lo: 0x91, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xd3, offset 0x63c {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x8e}, {value: 0x3308, lo: 0x8f, hi: 0x92}, {value: 0x0008, lo: 0x93, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xd4, offset 0x641 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xa0}, {value: 0x0040, lo: 0xa1, hi: 0xbf}, // Block 0xd5, offset 0x645 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xd6, offset 0x648 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb2}, {value: 0x0040, lo: 0xb3, hi: 0xbf}, // Block 0xd7, offset 0x64b {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0xbf}, // Block 0xd8, offset 0x64e {value: 0x0000, lo: 0x04}, {value: 0x0008, lo: 0x80, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xaf}, {value: 0x0008, lo: 0xb0, hi: 0xbc}, {value: 0x0040, lo: 0xbd, hi: 0xbf}, // Block 0xd9, offset 0x653 {value: 0x0000, lo: 0x09}, {value: 0x0008, lo: 0x80, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0x0008, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9b}, {value: 0x0018, lo: 0x9c, hi: 0x9c}, {value: 0x3308, lo: 0x9d, hi: 0x9e}, {value: 0x0018, lo: 0x9f, hi: 0x9f}, {value: 0x03c0, lo: 0xa0, hi: 0xa3}, {value: 0x0040, lo: 0xa4, hi: 0xbf}, // Block 0xda, offset 0x65d {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xdb, offset 0x660 {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xa6}, {value: 0x0040, lo: 0xa7, hi: 0xa8}, {value: 0x0018, lo: 0xa9, hi: 0xbf}, // Block 0xdc, offset 0x664 {value: 0x0000, lo: 0x0e}, {value: 0x0018, lo: 0x80, hi: 0x9d}, {value: 0xb5b9, lo: 0x9e, hi: 0x9e}, {value: 0xb601, lo: 0x9f, hi: 0x9f}, {value: 0xb649, lo: 0xa0, hi: 0xa0}, {value: 0xb6b1, lo: 0xa1, hi: 0xa1}, {value: 0xb719, lo: 0xa2, hi: 0xa2}, {value: 0xb781, lo: 0xa3, hi: 0xa3}, {value: 0xb7e9, lo: 0xa4, hi: 0xa4}, {value: 0x3018, lo: 0xa5, hi: 0xa6}, {value: 0x3318, lo: 0xa7, hi: 0xa9}, {value: 0x0018, lo: 0xaa, hi: 0xac}, {value: 0x3018, lo: 0xad, hi: 0xb2}, {value: 0x0340, lo: 0xb3, hi: 0xba}, {value: 0x3318, lo: 0xbb, hi: 0xbf}, // Block 0xdd, offset 0x673 {value: 0x0000, lo: 0x0b}, {value: 0x3318, lo: 0x80, hi: 0x82}, {value: 0x0018, lo: 0x83, hi: 0x84}, {value: 0x3318, lo: 0x85, hi: 0x8b}, {value: 0x0018, lo: 0x8c, hi: 0xa9}, {value: 0x3318, lo: 0xaa, hi: 0xad}, {value: 0x0018, lo: 0xae, hi: 0xba}, {value: 0xb851, lo: 0xbb, hi: 0xbb}, {value: 0xb899, lo: 0xbc, hi: 0xbc}, {value: 0xb8e1, lo: 0xbd, hi: 0xbd}, {value: 0xb949, lo: 0xbe, hi: 0xbe}, {value: 0xb9b1, lo: 0xbf, hi: 0xbf}, // Block 0xde, offset 0x67f {value: 0x0000, lo: 0x03}, {value: 0xba19, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0xa8}, {value: 0x0040, lo: 0xa9, hi: 0xbf}, // Block 0xdf, offset 0x683 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x81}, {value: 0x3318, lo: 0x82, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x85}, {value: 0x0040, lo: 0x86, hi: 0xbf}, // Block 0xe0, offset 0x688 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xe1, offset 0x68d {value: 0x0000, lo: 0x03}, {value: 0x3308, lo: 0x80, hi: 0xb6}, {value: 0x0018, lo: 0xb7, hi: 0xba}, {value: 0x3308, lo: 0xbb, hi: 0xbf}, // Block 0xe2, offset 0x691 {value: 0x0000, lo: 0x04}, {value: 0x3308, lo: 0x80, hi: 0xac}, {value: 0x0018, lo: 0xad, hi: 0xb4}, {value: 0x3308, lo: 0xb5, hi: 0xb5}, {value: 0x0018, lo: 0xb6, hi: 0xbf}, // Block 0xe3, offset 0x696 {value: 0x0000, lo: 0x08}, {value: 0x0018, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x84}, {value: 0x0018, lo: 0x85, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xa0}, {value: 0x3308, lo: 0xa1, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, // Block 0xe4, offset 0x69f {value: 0x0000, lo: 0x0a}, {value: 0x3308, lo: 0x80, hi: 0x86}, {value: 0x0040, lo: 0x87, hi: 0x87}, {value: 0x3308, lo: 0x88, hi: 0x98}, {value: 0x0040, lo: 0x99, hi: 0x9a}, {value: 0x3308, lo: 0x9b, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xa2}, {value: 0x3308, lo: 0xa3, hi: 0xa4}, {value: 0x0040, lo: 0xa5, hi: 0xa5}, {value: 0x3308, lo: 0xa6, hi: 0xaa}, {value: 0x0040, lo: 0xab, hi: 0xbf}, // Block 0xe5, offset 0x6aa {value: 0x0000, lo: 0x05}, {value: 0x0808, lo: 0x80, hi: 0x84}, {value: 0x0040, lo: 0x85, hi: 0x86}, {value: 0x0818, lo: 0x87, hi: 0x8f}, {value: 0x3308, lo: 0x90, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xe6, offset 0x6b0 {value: 0x0000, lo: 0x07}, {value: 0x0a08, lo: 0x80, hi: 0x83}, {value: 0x3308, lo: 0x84, hi: 0x8a}, {value: 0x0040, lo: 0x8b, hi: 0x8f}, {value: 0x0808, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9d}, {value: 0x0818, lo: 0x9e, hi: 0x9f}, {value: 0x0040, lo: 0xa0, hi: 0xbf}, // Block 0xe7, offset 0x6b8 {value: 0x0000, lo: 0x03}, {value: 0x0040, lo: 0x80, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb1}, {value: 0x0040, lo: 0xb2, hi: 0xbf}, // Block 0xe8, offset 0x6bc {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0xab}, {value: 0x0040, lo: 0xac, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xbf}, // Block 0xe9, offset 0x6c0 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x93}, {value: 0x0040, lo: 0x94, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xae}, {value: 0x0040, lo: 0xaf, hi: 0xb0}, {value: 0x0018, lo: 0xb1, hi: 0xbf}, // Block 0xea, offset 0x6c6 {value: 0x0000, lo: 0x05}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0018, lo: 0x81, hi: 0x8f}, {value: 0x0040, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xb5}, {value: 0x0040, lo: 0xb6, hi: 0xbf}, // Block 0xeb, offset 0x6cc {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8f}, {value: 0xc1c1, lo: 0x90, hi: 0x90}, {value: 0x0018, lo: 0x91, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xbf}, // Block 0xec, offset 0x6d1 {value: 0x0000, lo: 0x02}, {value: 0x0040, lo: 0x80, hi: 0xa5}, {value: 0x0018, lo: 0xa6, hi: 0xbf}, // Block 0xed, offset 0x6d4 {value: 0x0000, lo: 0x0d}, {value: 0xc7e9, lo: 0x80, hi: 0x80}, {value: 0xc839, lo: 0x81, hi: 0x81}, {value: 0xc889, lo: 0x82, hi: 0x82}, {value: 0xc8d9, lo: 0x83, hi: 0x83}, {value: 0xc929, lo: 0x84, hi: 0x84}, {value: 0xc979, lo: 0x85, hi: 0x85}, {value: 0xc9c9, lo: 0x86, hi: 0x86}, {value: 0xca19, lo: 0x87, hi: 0x87}, {value: 0xca69, lo: 0x88, hi: 0x88}, {value: 0x0040, lo: 0x89, hi: 0x8f}, {value: 0xcab9, lo: 0x90, hi: 0x90}, {value: 0xcad9, lo: 0x91, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0xbf}, // Block 0xee, offset 0x6e2 {value: 0x0000, lo: 0x06}, {value: 0x0018, lo: 0x80, hi: 0x92}, {value: 0x0040, lo: 0x93, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xac}, {value: 0x0040, lo: 0xad, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb6}, {value: 0x0040, lo: 0xb7, hi: 0xbf}, // Block 0xef, offset 0x6e9 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0xb3}, {value: 0x0040, lo: 0xb4, hi: 0xbf}, // Block 0xf0, offset 0x6ec {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x94}, {value: 0x0040, lo: 0x95, hi: 0xbf}, // Block 0xf1, offset 0x6ef {value: 0x0000, lo: 0x03}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xbf}, // Block 0xf2, offset 0x6f3 {value: 0x0000, lo: 0x05}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x99}, {value: 0x0040, lo: 0x9a, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xbf}, // Block 0xf3, offset 0x6f9 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x87}, {value: 0x0040, lo: 0x88, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0xad}, {value: 0x0040, lo: 0xae, hi: 0xbf}, // Block 0xf4, offset 0x6fe {value: 0x0000, lo: 0x09}, {value: 0x0040, lo: 0x80, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0x9f}, {value: 0x0018, lo: 0xa0, hi: 0xa7}, {value: 0x0040, lo: 0xa8, hi: 0xaf}, {value: 0x0018, lo: 0xb0, hi: 0xb0}, {value: 0x0040, lo: 0xb1, hi: 0xb2}, {value: 0x0018, lo: 0xb3, hi: 0xbe}, {value: 0x0040, lo: 0xbf, hi: 0xbf}, // Block 0xf5, offset 0x708 {value: 0x0000, lo: 0x04}, {value: 0x0018, lo: 0x80, hi: 0x8b}, {value: 0x0040, lo: 0x8c, hi: 0x8f}, {value: 0x0018, lo: 0x90, hi: 0x9e}, {value: 0x0040, lo: 0x9f, hi: 0xbf}, // Block 0xf6, offset 0x70d {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x91}, {value: 0x0040, lo: 0x92, hi: 0xbf}, // Block 0xf7, offset 0x710 {value: 0x0000, lo: 0x02}, {value: 0x0018, lo: 0x80, hi: 0x80}, {value: 0x0040, lo: 0x81, hi: 0xbf}, // Block 0xf8, offset 0x713 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0x96}, {value: 0x0040, lo: 0x97, hi: 0xbf}, // Block 0xf9, offset 0x716 {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xb4}, {value: 0x0040, lo: 0xb5, hi: 0xbf}, // Block 0xfa, offset 0x719 {value: 0x0000, lo: 0x03}, {value: 0x0008, lo: 0x80, hi: 0x9d}, {value: 0x0040, lo: 0x9e, hi: 0x9f}, {value: 0x0008, lo: 0xa0, hi: 0xbf}, // Block 0xfb, offset 0x71d {value: 0x0000, lo: 0x02}, {value: 0x0008, lo: 0x80, hi: 0xa1}, {value: 0x0040, lo: 0xa2, hi: 0xbf}, // Block 0xfc, offset 0x720 {value: 0x0020, lo: 0x0f}, {value: 0xdeb9, lo: 0x80, hi: 0x89}, {value: 0x8dfd, lo: 0x8a, hi: 0x8a}, {value: 0xdff9, lo: 0x8b, hi: 0x9c}, {value: 0x8e1d, lo: 0x9d, hi: 0x9d}, {value: 0xe239, lo: 0x9e, hi: 0xa2}, {value: 0x8e3d, lo: 0xa3, hi: 0xa3}, {value: 0xe2d9, lo: 0xa4, hi: 0xab}, {value: 0x7ed5, lo: 0xac, hi: 0xac}, {value: 0xe3d9, lo: 0xad, hi: 0xaf}, {value: 0x8e5d, lo: 0xb0, hi: 0xb0}, {value: 0xe439, lo: 0xb1, hi: 0xb6}, {value: 0x8e7d, lo: 0xb7, hi: 0xb9}, {value: 0xe4f9, lo: 0xba, hi: 0xba}, {value: 0x8edd, lo: 0xbb, hi: 0xbb}, {value: 0xe519, lo: 0xbc, hi: 0xbf}, // Block 0xfd, offset 0x730 {value: 0x0020, lo: 0x10}, {value: 0x937d, lo: 0x80, hi: 0x80}, {value: 0xf099, lo: 0x81, hi: 0x86}, {value: 0x939d, lo: 0x87, hi: 0x8a}, {value: 0xd9f9, lo: 0x8b, hi: 0x8b}, {value: 0xf159, lo: 0x8c, hi: 0x96}, {value: 0x941d, lo: 0x97, hi: 0x97}, {value: 0xf2b9, lo: 0x98, hi: 0xa3}, {value: 0x943d, lo: 0xa4, hi: 0xa6}, {value: 0xf439, lo: 0xa7, hi: 0xaa}, {value: 0x949d, lo: 0xab, hi: 0xab}, {value: 0xf4b9, lo: 0xac, hi: 0xac}, {value: 0x94bd, lo: 0xad, hi: 0xad}, {value: 0xf4d9, lo: 0xae, hi: 0xaf}, {value: 0x94dd, lo: 0xb0, hi: 0xb1}, {value: 0xf519, lo: 0xb2, hi: 0xbe}, {value: 0x2040, lo: 0xbf, hi: 0xbf}, // Block 0xfe, offset 0x741 {value: 0x0000, lo: 0x04}, {value: 0x0040, lo: 0x80, hi: 0x80}, {value: 0x0340, lo: 0x81, hi: 0x81}, {value: 0x0040, lo: 0x82, hi: 0x9f}, {value: 0x0340, lo: 0xa0, hi: 0xbf}, // Block 0xff, offset 0x746 {value: 0x0000, lo: 0x01}, {value: 0x0340, lo: 0x80, hi: 0xbf}, // Block 0x100, offset 0x748 {value: 0x0000, lo: 0x01}, {value: 0x33c0, lo: 0x80, hi: 0xbf}, // Block 0x101, offset 0x74a {value: 0x0000, lo: 0x02}, {value: 0x33c0, lo: 0x80, hi: 0xaf}, {value: 0x0040, lo: 0xb0, hi: 0xbf}, } // Total table size 41662 bytes (40KiB); checksum: 355A58A4 ================================================ FILE: vendor/golang.org/x/net/idna/trie.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. // Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package idna // appendMapping appends the mapping for the respective rune. isMapped must be // true. A mapping is a categorization of a rune as defined in UTS #46. func (c info) appendMapping(b []byte, s string) []byte { index := int(c >> indexShift) if c&xorBit == 0 { s := mappings[index:] return append(b, s[1:s[0]+1]...) } b = append(b, s...) if c&inlineXOR == inlineXOR { // TODO: support and handle two-byte inline masks b[len(b)-1] ^= byte(index) } else { for p := len(b) - int(xorData[index]); p < len(b); p++ { index++ b[p] ^= xorData[index] } } return b } // Sparse block handling code. type valueRange struct { value uint16 // header: value:stride lo, hi byte // header: lo:n } type sparseBlocks struct { values []valueRange offset []uint16 } var idnaSparse = sparseBlocks{ values: idnaSparseValues[:], offset: idnaSparseOffset[:], } // Don't use newIdnaTrie to avoid unconditional linking in of the table. var trie = &idnaTrie{} // lookup determines the type of block n and looks up the value for b. // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block // is a list of ranges with an accompanying value. Given a matching range r, // the value for b is by r.value + (b - r.lo) * stride. func (t *sparseBlocks) lookup(n uint32, b byte) uint16 { offset := t.offset[n] header := t.values[offset] lo := offset + 1 hi := lo + uint16(header.lo) for lo < hi { m := lo + (hi-lo)/2 r := t.values[m] if r.lo <= b && b <= r.hi { return r.value + uint16(b-r.lo)*header.value } if b < r.lo { hi = m } else { lo = m + 1 } } return 0 } ================================================ FILE: vendor/golang.org/x/net/idna/trieval.go ================================================ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. package idna // This file contains definitions for interpreting the trie value of the idna // trie generated by "go run gen*.go". It is shared by both the generator // program and the resultant package. Sharing is achieved by the generator // copying gen_trieval.go to trieval.go and changing what's above this comment. // info holds information from the IDNA mapping table for a single rune. It is // the value returned by a trie lookup. In most cases, all information fits in // a 16-bit value. For mappings, this value may contain an index into a slice // with the mapped string. Such mappings can consist of the actual mapped value // or an XOR pattern to be applied to the bytes of the UTF8 encoding of the // input rune. This technique is used by the cases packages and reduces the // table size significantly. // // The per-rune values have the following format: // // if mapped { // if inlinedXOR { // 15..13 inline XOR marker // 12..11 unused // 10..3 inline XOR mask // } else { // 15..3 index into xor or mapping table // } // } else { // 15..14 unused // 13 mayNeedNorm // 12..11 attributes // 10..8 joining type // 7..3 category type // } // 2 use xor pattern // 1..0 mapped category // // See the definitions below for a more detailed description of the various // bits. type info uint16 const ( catSmallMask = 0x3 catBigMask = 0xF8 indexShift = 3 xorBit = 0x4 // interpret the index as an xor pattern inlineXOR = 0xE000 // These bits are set if the XOR pattern is inlined. joinShift = 8 joinMask = 0x07 // Attributes attributesMask = 0x1800 viramaModifier = 0x1800 modifier = 0x1000 rtl = 0x0800 mayNeedNorm = 0x2000 ) // A category corresponds to a category defined in the IDNA mapping table. type category uint16 const ( unknown category = 0 // not currently defined in unicode. mapped category = 1 disallowedSTD3Mapped category = 2 deviation category = 3 ) const ( valid category = 0x08 validNV8 category = 0x18 validXV8 category = 0x28 disallowed category = 0x40 disallowedSTD3Valid category = 0x80 ignored category = 0xC0 ) // join types and additional rune information const ( joiningL = (iota + 1) joiningD joiningT joiningR //the following types are derived during processing joinZWJ joinZWNJ joinVirama numJoinTypes ) func (c info) isMapped() bool { return c&0x3 != 0 } func (c info) category() category { small := c & catSmallMask if small != 0 { return category(small) } return category(c & catBigMask) } func (c info) joinType() info { if c.isMapped() { return 0 } return (c >> joinShift) & joinMask } func (c info) isModifier() bool { return c&(modifier|catSmallMask) == modifier } func (c info) isViramaModifier() bool { return c&(attributesMask|catSmallMask) == viramaModifier } ================================================ FILE: vendor/golang.org/x/net/internal/timeseries/timeseries.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package timeseries implements a time series structure for stats collection. package timeseries // import "golang.org/x/net/internal/timeseries" import ( "fmt" "log" "time" ) const ( timeSeriesNumBuckets = 64 minuteHourSeriesNumBuckets = 60 ) var timeSeriesResolutions = []time.Duration{ 1 * time.Second, 10 * time.Second, 1 * time.Minute, 10 * time.Minute, 1 * time.Hour, 6 * time.Hour, 24 * time.Hour, // 1 day 7 * 24 * time.Hour, // 1 week 4 * 7 * 24 * time.Hour, // 4 weeks 16 * 7 * 24 * time.Hour, // 16 weeks } var minuteHourSeriesResolutions = []time.Duration{ 1 * time.Second, 1 * time.Minute, } // An Observable is a kind of data that can be aggregated in a time series. type Observable interface { Multiply(ratio float64) // Multiplies the data in self by a given ratio Add(other Observable) // Adds the data from a different observation to self Clear() // Clears the observation so it can be reused. CopyFrom(other Observable) // Copies the contents of a given observation to self } // Float attaches the methods of Observable to a float64. type Float float64 // NewFloat returns a Float. func NewFloat() Observable { f := Float(0) return &f } // String returns the float as a string. func (f *Float) String() string { return fmt.Sprintf("%g", f.Value()) } // Value returns the float's value. func (f *Float) Value() float64 { return float64(*f) } func (f *Float) Multiply(ratio float64) { *f *= Float(ratio) } func (f *Float) Add(other Observable) { o := other.(*Float) *f += *o } func (f *Float) Clear() { *f = 0 } func (f *Float) CopyFrom(other Observable) { o := other.(*Float) *f = *o } // A Clock tells the current time. type Clock interface { Time() time.Time } type defaultClock int var defaultClockInstance defaultClock func (defaultClock) Time() time.Time { return time.Now() } // Information kept per level. Each level consists of a circular list of // observations. The start of the level may be derived from end and the // len(buckets) * sizeInMillis. type tsLevel struct { oldest int // index to oldest bucketed Observable newest int // index to newest bucketed Observable end time.Time // end timestamp for this level size time.Duration // duration of the bucketed Observable buckets []Observable // collections of observations provider func() Observable // used for creating new Observable } func (l *tsLevel) Clear() { l.oldest = 0 l.newest = len(l.buckets) - 1 l.end = time.Time{} for i := range l.buckets { if l.buckets[i] != nil { l.buckets[i].Clear() l.buckets[i] = nil } } } func (l *tsLevel) InitLevel(size time.Duration, numBuckets int, f func() Observable) { l.size = size l.provider = f l.buckets = make([]Observable, numBuckets) } // Keeps a sequence of levels. Each level is responsible for storing data at // a given resolution. For example, the first level stores data at a one // minute resolution while the second level stores data at a one hour // resolution. // Each level is represented by a sequence of buckets. Each bucket spans an // interval equal to the resolution of the level. New observations are added // to the last bucket. type timeSeries struct { provider func() Observable // make more Observable numBuckets int // number of buckets in each level levels []*tsLevel // levels of bucketed Observable lastAdd time.Time // time of last Observable tracked total Observable // convenient aggregation of all Observable clock Clock // Clock for getting current time pending Observable // observations not yet bucketed pendingTime time.Time // what time are we keeping in pending dirty bool // if there are pending observations } // init initializes a level according to the supplied criteria. func (ts *timeSeries) init(resolutions []time.Duration, f func() Observable, numBuckets int, clock Clock) { ts.provider = f ts.numBuckets = numBuckets ts.clock = clock ts.levels = make([]*tsLevel, len(resolutions)) for i := range resolutions { if i > 0 && resolutions[i-1] >= resolutions[i] { log.Print("timeseries: resolutions must be monotonically increasing") break } newLevel := new(tsLevel) newLevel.InitLevel(resolutions[i], ts.numBuckets, ts.provider) ts.levels[i] = newLevel } ts.Clear() } // Clear removes all observations from the time series. func (ts *timeSeries) Clear() { ts.lastAdd = time.Time{} ts.total = ts.resetObservation(ts.total) ts.pending = ts.resetObservation(ts.pending) ts.pendingTime = time.Time{} ts.dirty = false for i := range ts.levels { ts.levels[i].Clear() } } // Add records an observation at the current time. func (ts *timeSeries) Add(observation Observable) { ts.AddWithTime(observation, ts.clock.Time()) } // AddWithTime records an observation at the specified time. func (ts *timeSeries) AddWithTime(observation Observable, t time.Time) { smallBucketDuration := ts.levels[0].size if t.After(ts.lastAdd) { ts.lastAdd = t } if t.After(ts.pendingTime) { ts.advance(t) ts.mergePendingUpdates() ts.pendingTime = ts.levels[0].end ts.pending.CopyFrom(observation) ts.dirty = true } else if t.After(ts.pendingTime.Add(-1 * smallBucketDuration)) { // The observation is close enough to go into the pending bucket. // This compensates for clock skewing and small scheduling delays // by letting the update stay in the fast path. ts.pending.Add(observation) ts.dirty = true } else { ts.mergeValue(observation, t) } } // mergeValue inserts the observation at the specified time in the past into all levels. func (ts *timeSeries) mergeValue(observation Observable, t time.Time) { for _, level := range ts.levels { index := (ts.numBuckets - 1) - int(level.end.Sub(t)/level.size) if 0 <= index && index < ts.numBuckets { bucketNumber := (level.oldest + index) % ts.numBuckets if level.buckets[bucketNumber] == nil { level.buckets[bucketNumber] = level.provider() } level.buckets[bucketNumber].Add(observation) } } ts.total.Add(observation) } // mergePendingUpdates applies the pending updates into all levels. func (ts *timeSeries) mergePendingUpdates() { if ts.dirty { ts.mergeValue(ts.pending, ts.pendingTime) ts.pending = ts.resetObservation(ts.pending) ts.dirty = false } } // advance cycles the buckets at each level until the latest bucket in // each level can hold the time specified. func (ts *timeSeries) advance(t time.Time) { if !t.After(ts.levels[0].end) { return } for i := 0; i < len(ts.levels); i++ { level := ts.levels[i] if !level.end.Before(t) { break } // If the time is sufficiently far, just clear the level and advance // directly. if !t.Before(level.end.Add(level.size * time.Duration(ts.numBuckets))) { for _, b := range level.buckets { ts.resetObservation(b) } level.end = time.Unix(0, (t.UnixNano()/level.size.Nanoseconds())*level.size.Nanoseconds()) } for t.After(level.end) { level.end = level.end.Add(level.size) level.newest = level.oldest level.oldest = (level.oldest + 1) % ts.numBuckets ts.resetObservation(level.buckets[level.newest]) } t = level.end } } // Latest returns the sum of the num latest buckets from the level. func (ts *timeSeries) Latest(level, num int) Observable { now := ts.clock.Time() if ts.levels[0].end.Before(now) { ts.advance(now) } ts.mergePendingUpdates() result := ts.provider() l := ts.levels[level] index := l.newest for i := 0; i < num; i++ { if l.buckets[index] != nil { result.Add(l.buckets[index]) } if index == 0 { index = ts.numBuckets } index-- } return result } // LatestBuckets returns a copy of the num latest buckets from level. func (ts *timeSeries) LatestBuckets(level, num int) []Observable { if level < 0 || level > len(ts.levels) { log.Print("timeseries: bad level argument: ", level) return nil } if num < 0 || num >= ts.numBuckets { log.Print("timeseries: bad num argument: ", num) return nil } results := make([]Observable, num) now := ts.clock.Time() if ts.levels[0].end.Before(now) { ts.advance(now) } ts.mergePendingUpdates() l := ts.levels[level] index := l.newest for i := 0; i < num; i++ { result := ts.provider() results[i] = result if l.buckets[index] != nil { result.CopyFrom(l.buckets[index]) } if index == 0 { index = ts.numBuckets } index -= 1 } return results } // ScaleBy updates observations by scaling by factor. func (ts *timeSeries) ScaleBy(factor float64) { for _, l := range ts.levels { for i := 0; i < ts.numBuckets; i++ { l.buckets[i].Multiply(factor) } } ts.total.Multiply(factor) ts.pending.Multiply(factor) } // Range returns the sum of observations added over the specified time range. // If start or finish times don't fall on bucket boundaries of the same // level, then return values are approximate answers. func (ts *timeSeries) Range(start, finish time.Time) Observable { return ts.ComputeRange(start, finish, 1)[0] } // Recent returns the sum of observations from the last delta. func (ts *timeSeries) Recent(delta time.Duration) Observable { now := ts.clock.Time() return ts.Range(now.Add(-delta), now) } // Total returns the total of all observations. func (ts *timeSeries) Total() Observable { ts.mergePendingUpdates() return ts.total } // ComputeRange computes a specified number of values into a slice using // the observations recorded over the specified time period. The return // values are approximate if the start or finish times don't fall on the // bucket boundaries at the same level or if the number of buckets spanning // the range is not an integral multiple of num. func (ts *timeSeries) ComputeRange(start, finish time.Time, num int) []Observable { if start.After(finish) { log.Printf("timeseries: start > finish, %v>%v", start, finish) return nil } if num < 0 { log.Printf("timeseries: num < 0, %v", num) return nil } results := make([]Observable, num) for _, l := range ts.levels { if !start.Before(l.end.Add(-l.size * time.Duration(ts.numBuckets))) { ts.extract(l, start, finish, num, results) return results } } // Failed to find a level that covers the desired range. So just // extract from the last level, even if it doesn't cover the entire // desired range. ts.extract(ts.levels[len(ts.levels)-1], start, finish, num, results) return results } // RecentList returns the specified number of values in slice over the most // recent time period of the specified range. func (ts *timeSeries) RecentList(delta time.Duration, num int) []Observable { if delta < 0 { return nil } now := ts.clock.Time() return ts.ComputeRange(now.Add(-delta), now, num) } // extract returns a slice of specified number of observations from a given // level over a given range. func (ts *timeSeries) extract(l *tsLevel, start, finish time.Time, num int, results []Observable) { ts.mergePendingUpdates() srcInterval := l.size dstInterval := finish.Sub(start) / time.Duration(num) dstStart := start srcStart := l.end.Add(-srcInterval * time.Duration(ts.numBuckets)) srcIndex := 0 // Where should scanning start? if dstStart.After(srcStart) { advance := dstStart.Sub(srcStart) / srcInterval srcIndex += int(advance) srcStart = srcStart.Add(advance * srcInterval) } // The i'th value is computed as show below. // interval = (finish/start)/num // i'th value = sum of observation in range // [ start + i * interval, // start + (i + 1) * interval ) for i := 0; i < num; i++ { results[i] = ts.resetObservation(results[i]) dstEnd := dstStart.Add(dstInterval) for srcIndex < ts.numBuckets && srcStart.Before(dstEnd) { srcEnd := srcStart.Add(srcInterval) if srcEnd.After(ts.lastAdd) { srcEnd = ts.lastAdd } if !srcEnd.Before(dstStart) { srcValue := l.buckets[(srcIndex+l.oldest)%ts.numBuckets] if !srcStart.Before(dstStart) && !srcEnd.After(dstEnd) { // dst completely contains src. if srcValue != nil { results[i].Add(srcValue) } } else { // dst partially overlaps src. overlapStart := maxTime(srcStart, dstStart) overlapEnd := minTime(srcEnd, dstEnd) base := srcEnd.Sub(srcStart) fraction := overlapEnd.Sub(overlapStart).Seconds() / base.Seconds() used := ts.provider() if srcValue != nil { used.CopyFrom(srcValue) } used.Multiply(fraction) results[i].Add(used) } if srcEnd.After(dstEnd) { break } } srcIndex++ srcStart = srcStart.Add(srcInterval) } dstStart = dstStart.Add(dstInterval) } } // resetObservation clears the content so the struct may be reused. func (ts *timeSeries) resetObservation(observation Observable) Observable { if observation == nil { observation = ts.provider() } else { observation.Clear() } return observation } // TimeSeries tracks data at granularities from 1 second to 16 weeks. type TimeSeries struct { timeSeries } // NewTimeSeries creates a new TimeSeries using the function provided for creating new Observable. func NewTimeSeries(f func() Observable) *TimeSeries { return NewTimeSeriesWithClock(f, defaultClockInstance) } // NewTimeSeriesWithClock creates a new TimeSeries using the function provided for creating new Observable and the clock for // assigning timestamps. func NewTimeSeriesWithClock(f func() Observable, clock Clock) *TimeSeries { ts := new(TimeSeries) ts.timeSeries.init(timeSeriesResolutions, f, timeSeriesNumBuckets, clock) return ts } // MinuteHourSeries tracks data at granularities of 1 minute and 1 hour. type MinuteHourSeries struct { timeSeries } // NewMinuteHourSeries creates a new MinuteHourSeries using the function provided for creating new Observable. func NewMinuteHourSeries(f func() Observable) *MinuteHourSeries { return NewMinuteHourSeriesWithClock(f, defaultClockInstance) } // NewMinuteHourSeriesWithClock creates a new MinuteHourSeries using the function provided for creating new Observable and the clock for // assigning timestamps. func NewMinuteHourSeriesWithClock(f func() Observable, clock Clock) *MinuteHourSeries { ts := new(MinuteHourSeries) ts.timeSeries.init(minuteHourSeriesResolutions, f, minuteHourSeriesNumBuckets, clock) return ts } func (ts *MinuteHourSeries) Minute() Observable { return ts.timeSeries.Latest(0, 60) } func (ts *MinuteHourSeries) Hour() Observable { return ts.timeSeries.Latest(1, 60) } func minTime(a, b time.Time) time.Time { if a.Before(b) { return a } return b } func maxTime(a, b time.Time) time.Time { if a.After(b) { return a } return b } ================================================ FILE: vendor/golang.org/x/net/trace/events.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package trace import ( "bytes" "fmt" "html/template" "io" "log" "net/http" "runtime" "sort" "strconv" "strings" "sync" "sync/atomic" "text/tabwriter" "time" ) const maxEventsPerLog = 100 type bucket struct { MaxErrAge time.Duration String string } var buckets = []bucket{ {0, "total"}, {10 * time.Second, "errs<10s"}, {1 * time.Minute, "errs<1m"}, {10 * time.Minute, "errs<10m"}, {1 * time.Hour, "errs<1h"}, {10 * time.Hour, "errs<10h"}, {24000 * time.Hour, "errors"}, } // RenderEvents renders the HTML page typically served at /debug/events. // It does not do any auth checking. The request may be nil. // // Most users will use the Events handler. func RenderEvents(w http.ResponseWriter, req *http.Request, sensitive bool) { now := time.Now() data := &struct { Families []string // family names Buckets []bucket Counts [][]int // eventLog count per family/bucket // Set when a bucket has been selected. Family string Bucket int EventLogs eventLogs Expanded bool }{ Buckets: buckets, } data.Families = make([]string, 0, len(families)) famMu.RLock() for name := range families { data.Families = append(data.Families, name) } famMu.RUnlock() sort.Strings(data.Families) // Count the number of eventLogs in each family for each error age. data.Counts = make([][]int, len(data.Families)) for i, name := range data.Families { // TODO(sameer): move this loop under the family lock. f := getEventFamily(name) data.Counts[i] = make([]int, len(data.Buckets)) for j, b := range data.Buckets { data.Counts[i][j] = f.Count(now, b.MaxErrAge) } } if req != nil { var ok bool data.Family, data.Bucket, ok = parseEventsArgs(req) if !ok { // No-op } else { data.EventLogs = getEventFamily(data.Family).Copy(now, buckets[data.Bucket].MaxErrAge) } if data.EventLogs != nil { defer data.EventLogs.Free() sort.Sort(data.EventLogs) } if exp, err := strconv.ParseBool(req.FormValue("exp")); err == nil { data.Expanded = exp } } famMu.RLock() defer famMu.RUnlock() if err := eventsTmpl().Execute(w, data); err != nil { log.Printf("net/trace: Failed executing template: %v", err) } } func parseEventsArgs(req *http.Request) (fam string, b int, ok bool) { fam, bStr := req.FormValue("fam"), req.FormValue("b") if fam == "" || bStr == "" { return "", 0, false } b, err := strconv.Atoi(bStr) if err != nil || b < 0 || b >= len(buckets) { return "", 0, false } return fam, b, true } // An EventLog provides a log of events associated with a specific object. type EventLog interface { // Printf formats its arguments with fmt.Sprintf and adds the // result to the event log. Printf(format string, a ...interface{}) // Errorf is like Printf, but it marks this event as an error. Errorf(format string, a ...interface{}) // Finish declares that this event log is complete. // The event log should not be used after calling this method. Finish() } // NewEventLog returns a new EventLog with the specified family name // and title. func NewEventLog(family, title string) EventLog { el := newEventLog() el.ref() el.Family, el.Title = family, title el.Start = time.Now() el.events = make([]logEntry, 0, maxEventsPerLog) el.stack = make([]uintptr, 32) n := runtime.Callers(2, el.stack) el.stack = el.stack[:n] getEventFamily(family).add(el) return el } func (el *eventLog) Finish() { getEventFamily(el.Family).remove(el) el.unref() // matches ref in New } var ( famMu sync.RWMutex families = make(map[string]*eventFamily) // family name => family ) func getEventFamily(fam string) *eventFamily { famMu.Lock() defer famMu.Unlock() f := families[fam] if f == nil { f = &eventFamily{} families[fam] = f } return f } type eventFamily struct { mu sync.RWMutex eventLogs eventLogs } func (f *eventFamily) add(el *eventLog) { f.mu.Lock() f.eventLogs = append(f.eventLogs, el) f.mu.Unlock() } func (f *eventFamily) remove(el *eventLog) { f.mu.Lock() defer f.mu.Unlock() for i, el0 := range f.eventLogs { if el == el0 { copy(f.eventLogs[i:], f.eventLogs[i+1:]) f.eventLogs = f.eventLogs[:len(f.eventLogs)-1] return } } } func (f *eventFamily) Count(now time.Time, maxErrAge time.Duration) (n int) { f.mu.RLock() defer f.mu.RUnlock() for _, el := range f.eventLogs { if el.hasRecentError(now, maxErrAge) { n++ } } return } func (f *eventFamily) Copy(now time.Time, maxErrAge time.Duration) (els eventLogs) { f.mu.RLock() defer f.mu.RUnlock() els = make(eventLogs, 0, len(f.eventLogs)) for _, el := range f.eventLogs { if el.hasRecentError(now, maxErrAge) { el.ref() els = append(els, el) } } return } type eventLogs []*eventLog // Free calls unref on each element of the list. func (els eventLogs) Free() { for _, el := range els { el.unref() } } // eventLogs may be sorted in reverse chronological order. func (els eventLogs) Len() int { return len(els) } func (els eventLogs) Less(i, j int) bool { return els[i].Start.After(els[j].Start) } func (els eventLogs) Swap(i, j int) { els[i], els[j] = els[j], els[i] } // A logEntry is a timestamped log entry in an event log. type logEntry struct { When time.Time Elapsed time.Duration // since previous event in log NewDay bool // whether this event is on a different day to the previous event What string IsErr bool } // WhenString returns a string representation of the elapsed time of the event. // It will include the date if midnight was crossed. func (e logEntry) WhenString() string { if e.NewDay { return e.When.Format("2006/01/02 15:04:05.000000") } return e.When.Format("15:04:05.000000") } // An eventLog represents an active event log. type eventLog struct { // Family is the top-level grouping of event logs to which this belongs. Family string // Title is the title of this event log. Title string // Timing information. Start time.Time // Call stack where this event log was created. stack []uintptr // Append-only sequence of events. // // TODO(sameer): change this to a ring buffer to avoid the array copy // when we hit maxEventsPerLog. mu sync.RWMutex events []logEntry LastErrorTime time.Time discarded int refs int32 // how many buckets this is in } func (el *eventLog) reset() { // Clear all but the mutex. Mutexes may not be copied, even when unlocked. el.Family = "" el.Title = "" el.Start = time.Time{} el.stack = nil el.events = nil el.LastErrorTime = time.Time{} el.discarded = 0 el.refs = 0 } func (el *eventLog) hasRecentError(now time.Time, maxErrAge time.Duration) bool { if maxErrAge == 0 { return true } el.mu.RLock() defer el.mu.RUnlock() return now.Sub(el.LastErrorTime) < maxErrAge } // delta returns the elapsed time since the last event or the log start, // and whether it spans midnight. // L >= el.mu func (el *eventLog) delta(t time.Time) (time.Duration, bool) { if len(el.events) == 0 { return t.Sub(el.Start), false } prev := el.events[len(el.events)-1].When return t.Sub(prev), prev.Day() != t.Day() } func (el *eventLog) Printf(format string, a ...interface{}) { el.printf(false, format, a...) } func (el *eventLog) Errorf(format string, a ...interface{}) { el.printf(true, format, a...) } func (el *eventLog) printf(isErr bool, format string, a ...interface{}) { e := logEntry{When: time.Now(), IsErr: isErr, What: fmt.Sprintf(format, a...)} el.mu.Lock() e.Elapsed, e.NewDay = el.delta(e.When) if len(el.events) < maxEventsPerLog { el.events = append(el.events, e) } else { // Discard the oldest event. if el.discarded == 0 { // el.discarded starts at two to count for the event it // is replacing, plus the next one that we are about to // drop. el.discarded = 2 } else { el.discarded++ } // TODO(sameer): if this causes allocations on a critical path, // change eventLog.What to be a fmt.Stringer, as in trace.go. el.events[0].What = fmt.Sprintf("(%d events discarded)", el.discarded) // The timestamp of the discarded meta-event should be // the time of the last event it is representing. el.events[0].When = el.events[1].When copy(el.events[1:], el.events[2:]) el.events[maxEventsPerLog-1] = e } if e.IsErr { el.LastErrorTime = e.When } el.mu.Unlock() } func (el *eventLog) ref() { atomic.AddInt32(&el.refs, 1) } func (el *eventLog) unref() { if atomic.AddInt32(&el.refs, -1) == 0 { freeEventLog(el) } } func (el *eventLog) When() string { return el.Start.Format("2006/01/02 15:04:05.000000") } func (el *eventLog) ElapsedTime() string { elapsed := time.Since(el.Start) return fmt.Sprintf("%.6f", elapsed.Seconds()) } func (el *eventLog) Stack() string { buf := new(bytes.Buffer) tw := tabwriter.NewWriter(buf, 1, 8, 1, '\t', 0) printStackRecord(tw, el.stack) tw.Flush() return buf.String() } // printStackRecord prints the function + source line information // for a single stack trace. // Adapted from runtime/pprof/pprof.go. func printStackRecord(w io.Writer, stk []uintptr) { for _, pc := range stk { f := runtime.FuncForPC(pc) if f == nil { continue } file, line := f.FileLine(pc) name := f.Name() // Hide runtime.goexit and any runtime functions at the beginning. if strings.HasPrefix(name, "runtime.") { continue } fmt.Fprintf(w, "# %s\t%s:%d\n", name, file, line) } } func (el *eventLog) Events() []logEntry { el.mu.RLock() defer el.mu.RUnlock() return el.events } // freeEventLogs is a freelist of *eventLog var freeEventLogs = make(chan *eventLog, 1000) // newEventLog returns a event log ready to use. func newEventLog() *eventLog { select { case el := <-freeEventLogs: return el default: return new(eventLog) } } // freeEventLog adds el to freeEventLogs if there's room. // This is non-blocking. func freeEventLog(el *eventLog) { el.reset() select { case freeEventLogs <- el: default: } } var eventsTmplCache *template.Template var eventsTmplOnce sync.Once func eventsTmpl() *template.Template { eventsTmplOnce.Do(func() { eventsTmplCache = template.Must(template.New("events").Funcs(template.FuncMap{ "elapsed": elapsed, "trimSpace": strings.TrimSpace, }).Parse(eventsHTML)) }) return eventsTmplCache } const eventsHTML = ` events

/debug/events

{{range $i, $fam := .Families}} {{range $j, $bucket := $.Buckets}} {{$n := index $.Counts $i $j}} {{end}} {{end}}
{{$fam}} {{if $n}}{{end}} [{{$n}} {{$bucket.String}}] {{if $n}}{{end}}
{{if $.EventLogs}}

Family: {{$.Family}}

{{if $.Expanded}}{{end}} [Summary]{{if $.Expanded}}{{end}} {{if not $.Expanded}}{{end}} [Expanded]{{if not $.Expanded}}{{end}} {{range $el := $.EventLogs}} {{if $.Expanded}} {{range $el.Events}} {{end}} {{end}} {{end}}
WhenElapsed
{{$el.When}} {{$el.ElapsedTime}} {{$el.Title}}
{{$el.Stack|trimSpace}}
{{.WhenString}} {{elapsed .Elapsed}} .{{if .IsErr}}E{{else}}.{{end}}. {{.What}}
{{end}} ` ================================================ FILE: vendor/golang.org/x/net/trace/histogram.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package trace // This file implements histogramming for RPC statistics collection. import ( "bytes" "fmt" "html/template" "log" "math" "sync" "golang.org/x/net/internal/timeseries" ) const ( bucketCount = 38 ) // histogram keeps counts of values in buckets that are spaced // out in powers of 2: 0-1, 2-3, 4-7... // histogram implements timeseries.Observable type histogram struct { sum int64 // running total of measurements sumOfSquares float64 // square of running total buckets []int64 // bucketed values for histogram value int // holds a single value as an optimization valueCount int64 // number of values recorded for single value } // AddMeasurement records a value measurement observation to the histogram. func (h *histogram) addMeasurement(value int64) { // TODO: assert invariant h.sum += value h.sumOfSquares += float64(value) * float64(value) bucketIndex := getBucket(value) if h.valueCount == 0 || (h.valueCount > 0 && h.value == bucketIndex) { h.value = bucketIndex h.valueCount++ } else { h.allocateBuckets() h.buckets[bucketIndex]++ } } func (h *histogram) allocateBuckets() { if h.buckets == nil { h.buckets = make([]int64, bucketCount) h.buckets[h.value] = h.valueCount h.value = 0 h.valueCount = -1 } } func log2(i int64) int { n := 0 for ; i >= 0x100; i >>= 8 { n += 8 } for ; i > 0; i >>= 1 { n += 1 } return n } func getBucket(i int64) (index int) { index = log2(i) - 1 if index < 0 { index = 0 } if index >= bucketCount { index = bucketCount - 1 } return } // Total returns the number of recorded observations. func (h *histogram) total() (total int64) { if h.valueCount >= 0 { total = h.valueCount } for _, val := range h.buckets { total += int64(val) } return } // Average returns the average value of recorded observations. func (h *histogram) average() float64 { t := h.total() if t == 0 { return 0 } return float64(h.sum) / float64(t) } // Variance returns the variance of recorded observations. func (h *histogram) variance() float64 { t := float64(h.total()) if t == 0 { return 0 } s := float64(h.sum) / t return h.sumOfSquares/t - s*s } // StandardDeviation returns the standard deviation of recorded observations. func (h *histogram) standardDeviation() float64 { return math.Sqrt(h.variance()) } // PercentileBoundary estimates the value that the given fraction of recorded // observations are less than. func (h *histogram) percentileBoundary(percentile float64) int64 { total := h.total() // Corner cases (make sure result is strictly less than Total()) if total == 0 { return 0 } else if total == 1 { return int64(h.average()) } percentOfTotal := round(float64(total) * percentile) var runningTotal int64 for i := range h.buckets { value := h.buckets[i] runningTotal += value if runningTotal == percentOfTotal { // We hit an exact bucket boundary. If the next bucket has data, it is a // good estimate of the value. If the bucket is empty, we interpolate the // midpoint between the next bucket's boundary and the next non-zero // bucket. If the remaining buckets are all empty, then we use the // boundary for the next bucket as the estimate. j := uint8(i + 1) min := bucketBoundary(j) if runningTotal < total { for h.buckets[j] == 0 { j++ } } max := bucketBoundary(j) return min + round(float64(max-min)/2) } else if runningTotal > percentOfTotal { // The value is in this bucket. Interpolate the value. delta := runningTotal - percentOfTotal percentBucket := float64(value-delta) / float64(value) bucketMin := bucketBoundary(uint8(i)) nextBucketMin := bucketBoundary(uint8(i + 1)) bucketSize := nextBucketMin - bucketMin return bucketMin + round(percentBucket*float64(bucketSize)) } } return bucketBoundary(bucketCount - 1) } // Median returns the estimated median of the observed values. func (h *histogram) median() int64 { return h.percentileBoundary(0.5) } // Add adds other to h. func (h *histogram) Add(other timeseries.Observable) { o := other.(*histogram) if o.valueCount == 0 { // Other histogram is empty } else if h.valueCount >= 0 && o.valueCount > 0 && h.value == o.value { // Both have a single bucketed value, aggregate them h.valueCount += o.valueCount } else { // Two different values necessitate buckets in this histogram h.allocateBuckets() if o.valueCount >= 0 { h.buckets[o.value] += o.valueCount } else { for i := range h.buckets { h.buckets[i] += o.buckets[i] } } } h.sumOfSquares += o.sumOfSquares h.sum += o.sum } // Clear resets the histogram to an empty state, removing all observed values. func (h *histogram) Clear() { h.buckets = nil h.value = 0 h.valueCount = 0 h.sum = 0 h.sumOfSquares = 0 } // CopyFrom copies from other, which must be a *histogram, into h. func (h *histogram) CopyFrom(other timeseries.Observable) { o := other.(*histogram) if o.valueCount == -1 { h.allocateBuckets() copy(h.buckets, o.buckets) } h.sum = o.sum h.sumOfSquares = o.sumOfSquares h.value = o.value h.valueCount = o.valueCount } // Multiply scales the histogram by the specified ratio. func (h *histogram) Multiply(ratio float64) { if h.valueCount == -1 { for i := range h.buckets { h.buckets[i] = int64(float64(h.buckets[i]) * ratio) } } else { h.valueCount = int64(float64(h.valueCount) * ratio) } h.sum = int64(float64(h.sum) * ratio) h.sumOfSquares = h.sumOfSquares * ratio } // New creates a new histogram. func (h *histogram) New() timeseries.Observable { r := new(histogram) r.Clear() return r } func (h *histogram) String() string { return fmt.Sprintf("%d, %f, %d, %d, %v", h.sum, h.sumOfSquares, h.value, h.valueCount, h.buckets) } // round returns the closest int64 to the argument func round(in float64) int64 { return int64(math.Floor(in + 0.5)) } // bucketBoundary returns the first value in the bucket. func bucketBoundary(bucket uint8) int64 { if bucket == 0 { return 0 } return 1 << bucket } // bucketData holds data about a specific bucket for use in distTmpl. type bucketData struct { Lower, Upper int64 N int64 Pct, CumulativePct float64 GraphWidth int } // data holds data about a Distribution for use in distTmpl. type data struct { Buckets []*bucketData Count, Median int64 Mean, StandardDeviation float64 } // maxHTMLBarWidth is the maximum width of the HTML bar for visualizing buckets. const maxHTMLBarWidth = 350.0 // newData returns data representing h for use in distTmpl. func (h *histogram) newData() *data { // Force the allocation of buckets to simplify the rendering implementation h.allocateBuckets() // We scale the bars on the right so that the largest bar is // maxHTMLBarWidth pixels in width. maxBucket := int64(0) for _, n := range h.buckets { if n > maxBucket { maxBucket = n } } total := h.total() barsizeMult := maxHTMLBarWidth / float64(maxBucket) var pctMult float64 if total == 0 { pctMult = 1.0 } else { pctMult = 100.0 / float64(total) } buckets := make([]*bucketData, len(h.buckets)) runningTotal := int64(0) for i, n := range h.buckets { if n == 0 { continue } runningTotal += n var upperBound int64 if i < bucketCount-1 { upperBound = bucketBoundary(uint8(i + 1)) } else { upperBound = math.MaxInt64 } buckets[i] = &bucketData{ Lower: bucketBoundary(uint8(i)), Upper: upperBound, N: n, Pct: float64(n) * pctMult, CumulativePct: float64(runningTotal) * pctMult, GraphWidth: int(float64(n) * barsizeMult), } } return &data{ Buckets: buckets, Count: total, Median: h.median(), Mean: h.average(), StandardDeviation: h.standardDeviation(), } } func (h *histogram) html() template.HTML { buf := new(bytes.Buffer) if err := distTmpl().Execute(buf, h.newData()); err != nil { buf.Reset() log.Printf("net/trace: couldn't execute template: %v", err) } return template.HTML(buf.String()) } var distTmplCache *template.Template var distTmplOnce sync.Once func distTmpl() *template.Template { distTmplOnce.Do(func() { // Input: data distTmplCache = template.Must(template.New("distTmpl").Parse(`
Count: {{.Count}} Mean: {{printf "%.0f" .Mean}} StdDev: {{printf "%.0f" .StandardDeviation}} Median: {{.Median}}

{{range $b := .Buckets}} {{if $b}} {{end}} {{end}}
[ {{.Lower}}, {{.Upper}}) {{.N}} {{printf "%#.3f" .Pct}}% {{printf "%#.3f" .CumulativePct}}%
`)) }) return distTmplCache } ================================================ FILE: vendor/golang.org/x/net/trace/trace.go ================================================ // Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package trace implements tracing of requests and long-lived objects. It exports HTTP interfaces on /debug/requests and /debug/events. A trace.Trace provides tracing for short-lived objects, usually requests. A request handler might be implemented like this: func fooHandler(w http.ResponseWriter, req *http.Request) { tr := trace.New("mypkg.Foo", req.URL.Path) defer tr.Finish() ... tr.LazyPrintf("some event %q happened", str) ... if err := somethingImportant(); err != nil { tr.LazyPrintf("somethingImportant failed: %v", err) tr.SetError() } } The /debug/requests HTTP endpoint organizes the traces by family, errors, and duration. It also provides histogram of request duration for each family. A trace.EventLog provides tracing for long-lived objects, such as RPC connections. // A Fetcher fetches URL paths for a single domain. type Fetcher struct { domain string events trace.EventLog } func NewFetcher(domain string) *Fetcher { return &Fetcher{ domain, trace.NewEventLog("mypkg.Fetcher", domain), } } func (f *Fetcher) Fetch(path string) (string, error) { resp, err := http.Get("http://" + f.domain + "/" + path) if err != nil { f.events.Errorf("Get(%q) = %v", path, err) return "", err } f.events.Printf("Get(%q) = %s", path, resp.Status) ... } func (f *Fetcher) Close() error { f.events.Finish() return nil } The /debug/events HTTP endpoint organizes the event logs by family and by time since the last error. The expanded view displays recent log entries and the log's call stack. */ package trace // import "golang.org/x/net/trace" import ( "bytes" "context" "fmt" "html/template" "io" "log" "net" "net/http" "net/url" "runtime" "sort" "strconv" "sync" "sync/atomic" "time" "golang.org/x/net/internal/timeseries" ) // DebugUseAfterFinish controls whether to debug uses of Trace values after finishing. // FOR DEBUGGING ONLY. This will slow down the program. var DebugUseAfterFinish = false // HTTP ServeMux paths. const ( debugRequestsPath = "/debug/requests" debugEventsPath = "/debug/events" ) // AuthRequest determines whether a specific request is permitted to load the // /debug/requests or /debug/events pages. // // It returns two bools; the first indicates whether the page may be viewed at all, // and the second indicates whether sensitive events will be shown. // // AuthRequest may be replaced by a program to customize its authorization requirements. // // The default AuthRequest function returns (true, true) if and only if the request // comes from localhost/127.0.0.1/[::1]. var AuthRequest = func(req *http.Request) (any, sensitive bool) { // RemoteAddr is commonly in the form "IP" or "IP:port". // If it is in the form "IP:port", split off the port. host, _, err := net.SplitHostPort(req.RemoteAddr) if err != nil { host = req.RemoteAddr } switch host { case "localhost", "127.0.0.1", "::1": return true, true default: return false, false } } func init() { _, pat := http.DefaultServeMux.Handler(&http.Request{URL: &url.URL{Path: debugRequestsPath}}) if pat == debugRequestsPath { panic("/debug/requests is already registered. You may have two independent copies of " + "golang.org/x/net/trace in your binary, trying to maintain separate state. This may " + "involve a vendored copy of golang.org/x/net/trace.") } // TODO(jbd): Serve Traces from /debug/traces in the future? // There is no requirement for a request to be present to have traces. http.HandleFunc(debugRequestsPath, Traces) http.HandleFunc(debugEventsPath, Events) } // NewContext returns a copy of the parent context // and associates it with a Trace. func NewContext(ctx context.Context, tr Trace) context.Context { return context.WithValue(ctx, contextKey, tr) } // FromContext returns the Trace bound to the context, if any. func FromContext(ctx context.Context) (tr Trace, ok bool) { tr, ok = ctx.Value(contextKey).(Trace) return } // Traces responds with traces from the program. // The package initialization registers it in http.DefaultServeMux // at /debug/requests. // // It performs authorization by running AuthRequest. func Traces(w http.ResponseWriter, req *http.Request) { any, sensitive := AuthRequest(req) if !any { http.Error(w, "not allowed", http.StatusUnauthorized) return } w.Header().Set("Content-Type", "text/html; charset=utf-8") Render(w, req, sensitive) } // Events responds with a page of events collected by EventLogs. // The package initialization registers it in http.DefaultServeMux // at /debug/events. // // It performs authorization by running AuthRequest. func Events(w http.ResponseWriter, req *http.Request) { any, sensitive := AuthRequest(req) if !any { http.Error(w, "not allowed", http.StatusUnauthorized) return } w.Header().Set("Content-Type", "text/html; charset=utf-8") RenderEvents(w, req, sensitive) } // Render renders the HTML page typically served at /debug/requests. // It does not do any auth checking. The request may be nil. // // Most users will use the Traces handler. func Render(w io.Writer, req *http.Request, sensitive bool) { data := &struct { Families []string ActiveTraceCount map[string]int CompletedTraces map[string]*family // Set when a bucket has been selected. Traces traceList Family string Bucket int Expanded bool Traced bool Active bool ShowSensitive bool // whether to show sensitive events Histogram template.HTML HistogramWindow string // e.g. "last minute", "last hour", "all time" // If non-zero, the set of traces is a partial set, // and this is the total number. Total int }{ CompletedTraces: completedTraces, } data.ShowSensitive = sensitive if req != nil { // Allow show_sensitive=0 to force hiding of sensitive data for testing. // This only goes one way; you can't use show_sensitive=1 to see things. if req.FormValue("show_sensitive") == "0" { data.ShowSensitive = false } if exp, err := strconv.ParseBool(req.FormValue("exp")); err == nil { data.Expanded = exp } if exp, err := strconv.ParseBool(req.FormValue("rtraced")); err == nil { data.Traced = exp } } completedMu.RLock() data.Families = make([]string, 0, len(completedTraces)) for fam := range completedTraces { data.Families = append(data.Families, fam) } completedMu.RUnlock() sort.Strings(data.Families) // We are careful here to minimize the time spent locking activeMu, // since that lock is required every time an RPC starts and finishes. data.ActiveTraceCount = make(map[string]int, len(data.Families)) activeMu.RLock() for fam, s := range activeTraces { data.ActiveTraceCount[fam] = s.Len() } activeMu.RUnlock() var ok bool data.Family, data.Bucket, ok = parseArgs(req) switch { case !ok: // No-op case data.Bucket == -1: data.Active = true n := data.ActiveTraceCount[data.Family] data.Traces = getActiveTraces(data.Family) if len(data.Traces) < n { data.Total = n } case data.Bucket < bucketsPerFamily: if b := lookupBucket(data.Family, data.Bucket); b != nil { data.Traces = b.Copy(data.Traced) } default: if f := getFamily(data.Family, false); f != nil { var obs timeseries.Observable f.LatencyMu.RLock() switch o := data.Bucket - bucketsPerFamily; o { case 0: obs = f.Latency.Minute() data.HistogramWindow = "last minute" case 1: obs = f.Latency.Hour() data.HistogramWindow = "last hour" case 2: obs = f.Latency.Total() data.HistogramWindow = "all time" } f.LatencyMu.RUnlock() if obs != nil { data.Histogram = obs.(*histogram).html() } } } if data.Traces != nil { defer data.Traces.Free() sort.Sort(data.Traces) } completedMu.RLock() defer completedMu.RUnlock() if err := pageTmpl().ExecuteTemplate(w, "Page", data); err != nil { log.Printf("net/trace: Failed executing template: %v", err) } } func parseArgs(req *http.Request) (fam string, b int, ok bool) { if req == nil { return "", 0, false } fam, bStr := req.FormValue("fam"), req.FormValue("b") if fam == "" || bStr == "" { return "", 0, false } b, err := strconv.Atoi(bStr) if err != nil || b < -1 { return "", 0, false } return fam, b, true } func lookupBucket(fam string, b int) *traceBucket { f := getFamily(fam, false) if f == nil || b < 0 || b >= len(f.Buckets) { return nil } return f.Buckets[b] } type contextKeyT string var contextKey = contextKeyT("golang.org/x/net/trace.Trace") // Trace represents an active request. type Trace interface { // LazyLog adds x to the event log. It will be evaluated each time the // /debug/requests page is rendered. Any memory referenced by x will be // pinned until the trace is finished and later discarded. LazyLog(x fmt.Stringer, sensitive bool) // LazyPrintf evaluates its arguments with fmt.Sprintf each time the // /debug/requests page is rendered. Any memory referenced by a will be // pinned until the trace is finished and later discarded. LazyPrintf(format string, a ...interface{}) // SetError declares that this trace resulted in an error. SetError() // SetRecycler sets a recycler for the trace. // f will be called for each event passed to LazyLog at a time when // it is no longer required, whether while the trace is still active // and the event is discarded, or when a completed trace is discarded. SetRecycler(f func(interface{})) // SetTraceInfo sets the trace info for the trace. // This is currently unused. SetTraceInfo(traceID, spanID uint64) // SetMaxEvents sets the maximum number of events that will be stored // in the trace. This has no effect if any events have already been // added to the trace. SetMaxEvents(m int) // Finish declares that this trace is complete. // The trace should not be used after calling this method. Finish() } type lazySprintf struct { format string a []interface{} } func (l *lazySprintf) String() string { return fmt.Sprintf(l.format, l.a...) } // New returns a new Trace with the specified family and title. func New(family, title string) Trace { tr := newTrace() tr.ref() tr.Family, tr.Title = family, title tr.Start = time.Now() tr.maxEvents = maxEventsPerTrace tr.events = tr.eventsBuf[:0] activeMu.RLock() s := activeTraces[tr.Family] activeMu.RUnlock() if s == nil { activeMu.Lock() s = activeTraces[tr.Family] // check again if s == nil { s = new(traceSet) activeTraces[tr.Family] = s } activeMu.Unlock() } s.Add(tr) // Trigger allocation of the completed trace structure for this family. // This will cause the family to be present in the request page during // the first trace of this family. We don't care about the return value, // nor is there any need for this to run inline, so we execute it in its // own goroutine, but only if the family isn't allocated yet. completedMu.RLock() if _, ok := completedTraces[tr.Family]; !ok { go allocFamily(tr.Family) } completedMu.RUnlock() return tr } func (tr *trace) Finish() { elapsed := time.Now().Sub(tr.Start) tr.mu.Lock() tr.Elapsed = elapsed tr.mu.Unlock() if DebugUseAfterFinish { buf := make([]byte, 4<<10) // 4 KB should be enough n := runtime.Stack(buf, false) tr.finishStack = buf[:n] } activeMu.RLock() m := activeTraces[tr.Family] activeMu.RUnlock() m.Remove(tr) f := getFamily(tr.Family, true) tr.mu.RLock() // protects tr fields in Cond.match calls for _, b := range f.Buckets { if b.Cond.match(tr) { b.Add(tr) } } tr.mu.RUnlock() // Add a sample of elapsed time as microseconds to the family's timeseries h := new(histogram) h.addMeasurement(elapsed.Nanoseconds() / 1e3) f.LatencyMu.Lock() f.Latency.Add(h) f.LatencyMu.Unlock() tr.unref() // matches ref in New } const ( bucketsPerFamily = 9 tracesPerBucket = 10 maxActiveTraces = 20 // Maximum number of active traces to show. maxEventsPerTrace = 10 numHistogramBuckets = 38 ) var ( // The active traces. activeMu sync.RWMutex activeTraces = make(map[string]*traceSet) // family -> traces // Families of completed traces. completedMu sync.RWMutex completedTraces = make(map[string]*family) // family -> traces ) type traceSet struct { mu sync.RWMutex m map[*trace]bool // We could avoid the entire map scan in FirstN by having a slice of all the traces // ordered by start time, and an index into that from the trace struct, with a periodic // repack of the slice after enough traces finish; we could also use a skip list or similar. // However, that would shift some of the expense from /debug/requests time to RPC time, // which is probably the wrong trade-off. } func (ts *traceSet) Len() int { ts.mu.RLock() defer ts.mu.RUnlock() return len(ts.m) } func (ts *traceSet) Add(tr *trace) { ts.mu.Lock() if ts.m == nil { ts.m = make(map[*trace]bool) } ts.m[tr] = true ts.mu.Unlock() } func (ts *traceSet) Remove(tr *trace) { ts.mu.Lock() delete(ts.m, tr) ts.mu.Unlock() } // FirstN returns the first n traces ordered by time. func (ts *traceSet) FirstN(n int) traceList { ts.mu.RLock() defer ts.mu.RUnlock() if n > len(ts.m) { n = len(ts.m) } trl := make(traceList, 0, n) // Fast path for when no selectivity is needed. if n == len(ts.m) { for tr := range ts.m { tr.ref() trl = append(trl, tr) } sort.Sort(trl) return trl } // Pick the oldest n traces. // This is inefficient. See the comment in the traceSet struct. for tr := range ts.m { // Put the first n traces into trl in the order they occur. // When we have n, sort trl, and thereafter maintain its order. if len(trl) < n { tr.ref() trl = append(trl, tr) if len(trl) == n { // This is guaranteed to happen exactly once during this loop. sort.Sort(trl) } continue } if tr.Start.After(trl[n-1].Start) { continue } // Find where to insert this one. tr.ref() i := sort.Search(n, func(i int) bool { return trl[i].Start.After(tr.Start) }) trl[n-1].unref() copy(trl[i+1:], trl[i:]) trl[i] = tr } return trl } func getActiveTraces(fam string) traceList { activeMu.RLock() s := activeTraces[fam] activeMu.RUnlock() if s == nil { return nil } return s.FirstN(maxActiveTraces) } func getFamily(fam string, allocNew bool) *family { completedMu.RLock() f := completedTraces[fam] completedMu.RUnlock() if f == nil && allocNew { f = allocFamily(fam) } return f } func allocFamily(fam string) *family { completedMu.Lock() defer completedMu.Unlock() f := completedTraces[fam] if f == nil { f = newFamily() completedTraces[fam] = f } return f } // family represents a set of trace buckets and associated latency information. type family struct { // traces may occur in multiple buckets. Buckets [bucketsPerFamily]*traceBucket // latency time series LatencyMu sync.RWMutex Latency *timeseries.MinuteHourSeries } func newFamily() *family { return &family{ Buckets: [bucketsPerFamily]*traceBucket{ {Cond: minCond(0)}, {Cond: minCond(50 * time.Millisecond)}, {Cond: minCond(100 * time.Millisecond)}, {Cond: minCond(200 * time.Millisecond)}, {Cond: minCond(500 * time.Millisecond)}, {Cond: minCond(1 * time.Second)}, {Cond: minCond(10 * time.Second)}, {Cond: minCond(100 * time.Second)}, {Cond: errorCond{}}, }, Latency: timeseries.NewMinuteHourSeries(func() timeseries.Observable { return new(histogram) }), } } // traceBucket represents a size-capped bucket of historic traces, // along with a condition for a trace to belong to the bucket. type traceBucket struct { Cond cond // Ring buffer implementation of a fixed-size FIFO queue. mu sync.RWMutex buf [tracesPerBucket]*trace start int // < tracesPerBucket length int // <= tracesPerBucket } func (b *traceBucket) Add(tr *trace) { b.mu.Lock() defer b.mu.Unlock() i := b.start + b.length if i >= tracesPerBucket { i -= tracesPerBucket } if b.length == tracesPerBucket { // "Remove" an element from the bucket. b.buf[i].unref() b.start++ if b.start == tracesPerBucket { b.start = 0 } } b.buf[i] = tr if b.length < tracesPerBucket { b.length++ } tr.ref() } // Copy returns a copy of the traces in the bucket. // If tracedOnly is true, only the traces with trace information will be returned. // The logs will be ref'd before returning; the caller should call // the Free method when it is done with them. // TODO(dsymonds): keep track of traced requests in separate buckets. func (b *traceBucket) Copy(tracedOnly bool) traceList { b.mu.RLock() defer b.mu.RUnlock() trl := make(traceList, 0, b.length) for i, x := 0, b.start; i < b.length; i++ { tr := b.buf[x] if !tracedOnly || tr.spanID != 0 { tr.ref() trl = append(trl, tr) } x++ if x == b.length { x = 0 } } return trl } func (b *traceBucket) Empty() bool { b.mu.RLock() defer b.mu.RUnlock() return b.length == 0 } // cond represents a condition on a trace. type cond interface { match(t *trace) bool String() string } type minCond time.Duration func (m minCond) match(t *trace) bool { return t.Elapsed >= time.Duration(m) } func (m minCond) String() string { return fmt.Sprintf("≥%gs", time.Duration(m).Seconds()) } type errorCond struct{} func (e errorCond) match(t *trace) bool { return t.IsError } func (e errorCond) String() string { return "errors" } type traceList []*trace // Free calls unref on each element of the list. func (trl traceList) Free() { for _, t := range trl { t.unref() } } // traceList may be sorted in reverse chronological order. func (trl traceList) Len() int { return len(trl) } func (trl traceList) Less(i, j int) bool { return trl[i].Start.After(trl[j].Start) } func (trl traceList) Swap(i, j int) { trl[i], trl[j] = trl[j], trl[i] } // An event is a timestamped log entry in a trace. type event struct { When time.Time Elapsed time.Duration // since previous event in trace NewDay bool // whether this event is on a different day to the previous event Recyclable bool // whether this event was passed via LazyLog Sensitive bool // whether this event contains sensitive information What interface{} // string or fmt.Stringer } // WhenString returns a string representation of the elapsed time of the event. // It will include the date if midnight was crossed. func (e event) WhenString() string { if e.NewDay { return e.When.Format("2006/01/02 15:04:05.000000") } return e.When.Format("15:04:05.000000") } // discarded represents a number of discarded events. // It is stored as *discarded to make it easier to update in-place. type discarded int func (d *discarded) String() string { return fmt.Sprintf("(%d events discarded)", int(*d)) } // trace represents an active or complete request, // either sent or received by this program. type trace struct { // Family is the top-level grouping of traces to which this belongs. Family string // Title is the title of this trace. Title string // Start time of the this trace. Start time.Time mu sync.RWMutex events []event // Append-only sequence of events (modulo discards). maxEvents int recycler func(interface{}) IsError bool // Whether this trace resulted in an error. Elapsed time.Duration // Elapsed time for this trace, zero while active. traceID uint64 // Trace information if non-zero. spanID uint64 refs int32 // how many buckets this is in disc discarded // scratch space to avoid allocation finishStack []byte // where finish was called, if DebugUseAfterFinish is set eventsBuf [4]event // preallocated buffer in case we only log a few events } func (tr *trace) reset() { // Clear all but the mutex. Mutexes may not be copied, even when unlocked. tr.Family = "" tr.Title = "" tr.Start = time.Time{} tr.mu.Lock() tr.Elapsed = 0 tr.traceID = 0 tr.spanID = 0 tr.IsError = false tr.maxEvents = 0 tr.events = nil tr.recycler = nil tr.mu.Unlock() tr.refs = 0 tr.disc = 0 tr.finishStack = nil for i := range tr.eventsBuf { tr.eventsBuf[i] = event{} } } // delta returns the elapsed time since the last event or the trace start, // and whether it spans midnight. // L >= tr.mu func (tr *trace) delta(t time.Time) (time.Duration, bool) { if len(tr.events) == 0 { return t.Sub(tr.Start), false } prev := tr.events[len(tr.events)-1].When return t.Sub(prev), prev.Day() != t.Day() } func (tr *trace) addEvent(x interface{}, recyclable, sensitive bool) { if DebugUseAfterFinish && tr.finishStack != nil { buf := make([]byte, 4<<10) // 4 KB should be enough n := runtime.Stack(buf, false) log.Printf("net/trace: trace used after finish:\nFinished at:\n%s\nUsed at:\n%s", tr.finishStack, buf[:n]) } /* NOTE TO DEBUGGERS If you are here because your program panicked in this code, it is almost definitely the fault of code using this package, and very unlikely to be the fault of this code. The most likely scenario is that some code elsewhere is using a trace.Trace after its Finish method is called. You can temporarily set the DebugUseAfterFinish var to help discover where that is; do not leave that var set, since it makes this package much less efficient. */ e := event{When: time.Now(), What: x, Recyclable: recyclable, Sensitive: sensitive} tr.mu.Lock() e.Elapsed, e.NewDay = tr.delta(e.When) if len(tr.events) < tr.maxEvents { tr.events = append(tr.events, e) } else { // Discard the middle events. di := int((tr.maxEvents - 1) / 2) if d, ok := tr.events[di].What.(*discarded); ok { (*d)++ } else { // disc starts at two to count for the event it is replacing, // plus the next one that we are about to drop. tr.disc = 2 if tr.recycler != nil && tr.events[di].Recyclable { go tr.recycler(tr.events[di].What) } tr.events[di].What = &tr.disc } // The timestamp of the discarded meta-event should be // the time of the last event it is representing. tr.events[di].When = tr.events[di+1].When if tr.recycler != nil && tr.events[di+1].Recyclable { go tr.recycler(tr.events[di+1].What) } copy(tr.events[di+1:], tr.events[di+2:]) tr.events[tr.maxEvents-1] = e } tr.mu.Unlock() } func (tr *trace) LazyLog(x fmt.Stringer, sensitive bool) { tr.addEvent(x, true, sensitive) } func (tr *trace) LazyPrintf(format string, a ...interface{}) { tr.addEvent(&lazySprintf{format, a}, false, false) } func (tr *trace) SetError() { tr.mu.Lock() tr.IsError = true tr.mu.Unlock() } func (tr *trace) SetRecycler(f func(interface{})) { tr.mu.Lock() tr.recycler = f tr.mu.Unlock() } func (tr *trace) SetTraceInfo(traceID, spanID uint64) { tr.mu.Lock() tr.traceID, tr.spanID = traceID, spanID tr.mu.Unlock() } func (tr *trace) SetMaxEvents(m int) { tr.mu.Lock() // Always keep at least three events: first, discarded count, last. if len(tr.events) == 0 && m > 3 { tr.maxEvents = m } tr.mu.Unlock() } func (tr *trace) ref() { atomic.AddInt32(&tr.refs, 1) } func (tr *trace) unref() { if atomic.AddInt32(&tr.refs, -1) == 0 { tr.mu.RLock() if tr.recycler != nil { // freeTrace clears tr, so we hold tr.recycler and tr.events here. go func(f func(interface{}), es []event) { for _, e := range es { if e.Recyclable { f(e.What) } } }(tr.recycler, tr.events) } tr.mu.RUnlock() freeTrace(tr) } } func (tr *trace) When() string { return tr.Start.Format("2006/01/02 15:04:05.000000") } func (tr *trace) ElapsedTime() string { tr.mu.RLock() t := tr.Elapsed tr.mu.RUnlock() if t == 0 { // Active trace. t = time.Since(tr.Start) } return fmt.Sprintf("%.6f", t.Seconds()) } func (tr *trace) Events() []event { tr.mu.RLock() defer tr.mu.RUnlock() return tr.events } var traceFreeList = make(chan *trace, 1000) // TODO(dsymonds): Use sync.Pool? // newTrace returns a trace ready to use. func newTrace() *trace { select { case tr := <-traceFreeList: return tr default: return new(trace) } } // freeTrace adds tr to traceFreeList if there's room. // This is non-blocking. func freeTrace(tr *trace) { if DebugUseAfterFinish { return // never reuse } tr.reset() select { case traceFreeList <- tr: default: } } func elapsed(d time.Duration) string { b := []byte(fmt.Sprintf("%.6f", d.Seconds())) // For subsecond durations, blank all zeros before decimal point, // and all zeros between the decimal point and the first non-zero digit. if d < time.Second { dot := bytes.IndexByte(b, '.') for i := 0; i < dot; i++ { b[i] = ' ' } for i := dot + 1; i < len(b); i++ { if b[i] == '0' { b[i] = ' ' } else { break } } } return string(b) } var pageTmplCache *template.Template var pageTmplOnce sync.Once func pageTmpl() *template.Template { pageTmplOnce.Do(func() { pageTmplCache = template.Must(template.New("Page").Funcs(template.FuncMap{ "elapsed": elapsed, "add": func(a, b int) int { return a + b }, }).Parse(pageHTML)) }) return pageTmplCache } const pageHTML = ` {{template "Prolog" .}} {{template "StatusTable" .}} {{template "Epilog" .}} {{define "Prolog"}} /debug/requests

/debug/requests

{{end}} {{/* end of Prolog */}} {{define "StatusTable"}} {{range $fam := .Families}} {{$n := index $.ActiveTraceCount $fam}} {{$f := index $.CompletedTraces $fam}} {{range $i, $b := $f.Buckets}} {{$empty := $b.Empty}} {{end}} {{$nb := len $f.Buckets}} {{end}}
{{$fam}} {{if $n}}{{end}} [{{$n}} active] {{if $n}}{{end}} {{if not $empty}}{{end}} [{{.Cond}}] {{if not $empty}}{{end}} [minute] [hour] [total]
{{end}} {{/* end of StatusTable */}} {{define "Epilog"}} {{if $.Traces}}

Family: {{$.Family}}

{{if or $.Expanded $.Traced}} [Normal/Summary] {{else}} [Normal/Summary] {{end}} {{if or (not $.Expanded) $.Traced}} [Normal/Expanded] {{else}} [Normal/Expanded] {{end}} {{if not $.Active}} {{if or $.Expanded (not $.Traced)}} [Traced/Summary] {{else}} [Traced/Summary] {{end}} {{if or (not $.Expanded) (not $.Traced)}} [Traced/Expanded] {{else}} [Traced/Expanded] {{end}} {{end}} {{if $.Total}}

Showing {{len $.Traces}} of {{$.Total}} traces.

{{end}} {{range $tr := $.Traces}} {{/* TODO: include traceID/spanID */}} {{if $.Expanded}} {{range $tr.Events}} {{end}} {{end}} {{end}}
{{if $.Active}}Active{{else}}Completed{{end}} Requests
WhenElapsed (s)
{{$tr.When}} {{$tr.ElapsedTime}} {{$tr.Title}}
{{.WhenString}} {{elapsed .Elapsed}} {{if or $.ShowSensitive (not .Sensitive)}}... {{.What}}{{else}}[redacted]{{end}}
{{end}} {{/* if $.Traces */}} {{if $.Histogram}}

Latency (µs) of {{$.Family}} over {{$.HistogramWindow}}

{{$.Histogram}} {{end}} {{/* if $.Histogram */}} {{end}} {{/* end of Epilog */}} ` ================================================ FILE: vendor/golang.org/x/oauth2/.travis.yml ================================================ language: go go: - tip install: - export GOPATH="$HOME/gopath" - mkdir -p "$GOPATH/src/golang.org/x" - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" - go get -v -t -d golang.org/x/oauth2/... script: - go test -v golang.org/x/oauth2/... ================================================ FILE: vendor/golang.org/x/oauth2/AUTHORS ================================================ # This source code refers to The Go Authors for copyright purposes. # The master list of authors is in the main Go distribution, # visible at http://tip.golang.org/AUTHORS. ================================================ FILE: vendor/golang.org/x/oauth2/CONTRIBUTING.md ================================================ # Contributing to Go Go is an open source project. It is the work of hundreds of contributors. We appreciate your help! ## Filing issues When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: 1. What version of Go are you using (`go version`)? 2. What operating system and processor architecture are you using? 3. What did you do? 4. What did you expect to see? 5. What did you see instead? General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. The gophers there will answer or ask you to file an issue if you've tripped over a bug. ## Contributing code Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) before sending patches. Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. ================================================ FILE: vendor/golang.org/x/oauth2/CONTRIBUTORS ================================================ # This source code was written by the Go contributors. # The master list of contributors is in the main Go distribution, # visible at http://tip.golang.org/CONTRIBUTORS. ================================================ FILE: vendor/golang.org/x/oauth2/LICENSE ================================================ Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/oauth2/README.md ================================================ # OAuth2 for Go [![Build Status](https://travis-ci.org/golang/oauth2.svg?branch=master)](https://travis-ci.org/golang/oauth2) [![GoDoc](https://godoc.org/golang.org/x/oauth2?status.svg)](https://godoc.org/golang.org/x/oauth2) oauth2 package contains a client implementation for OAuth 2.0 spec. ## Installation ~~~~ go get golang.org/x/oauth2 ~~~~ Or you can manually git clone the repository to `$(go env GOPATH)/src/golang.org/x/oauth2`. See godoc for further documentation and examples. * [godoc.org/golang.org/x/oauth2](http://godoc.org/golang.org/x/oauth2) * [godoc.org/golang.org/x/oauth2/google](http://godoc.org/golang.org/x/oauth2/google) ## App Engine In change 96e89be (March 2015), we removed the `oauth2.Context2` type in favor of the [`context.Context`](https://golang.org/x/net/context#Context) type from the `golang.org/x/net/context` package. Later replaced by the standard `context` package of the [`context.Context`](https://golang.org/pkg/context#Context) type. This means it's no longer possible to use the "Classic App Engine" `appengine.Context` type with the `oauth2` package. (You're using Classic App Engine if you import the package `"appengine"`.) To work around this, you may use the new `"google.golang.org/appengine"` package. This package has almost the same API as the `"appengine"` package, but it can be fetched with `go get` and used on "Managed VMs" and well as Classic App Engine. See the [new `appengine` package's readme](https://github.com/golang/appengine#updating-a-go-app-engine-app) for information on updating your app. If you don't want to update your entire app to use the new App Engine packages, you may use both sets of packages in parallel, using only the new packages with the `oauth2` package. ```go import ( "context" "golang.org/x/oauth2" "golang.org/x/oauth2/google" newappengine "google.golang.org/appengine" newurlfetch "google.golang.org/appengine/urlfetch" "appengine" ) func handler(w http.ResponseWriter, r *http.Request) { var c appengine.Context = appengine.NewContext(r) c.Infof("Logging a message with the old package") var ctx context.Context = newappengine.NewContext(r) client := &http.Client{ Transport: &oauth2.Transport{ Source: google.AppEngineTokenSource(ctx, "scope"), Base: &newurlfetch.Transport{Context: ctx}, }, } client.Get("...") } ``` ## Policy for new packages We no longer accept new provider-specific packages in this repo. For defining provider endpoints and provider-specific OAuth2 behavior, we encourage you to create packages elsewhere. We'll keep the existing packages for compatibility. ## Report Issues / Send Patches This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html. The main issue tracker for the oauth2 repository is located at https://github.com/golang/oauth2/issues. ================================================ FILE: vendor/golang.org/x/oauth2/internal/client_appengine.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build appengine package internal import "google.golang.org/appengine/urlfetch" func init() { appengineClientHook = urlfetch.Client } ================================================ FILE: vendor/golang.org/x/oauth2/internal/doc.go ================================================ // Copyright 2017 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package internal contains support packages for oauth2 package. package internal ================================================ FILE: vendor/golang.org/x/oauth2/internal/oauth2.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package internal import ( "crypto/rsa" "crypto/x509" "encoding/pem" "errors" "fmt" ) // ParseKey converts the binary contents of a private key file // to an *rsa.PrivateKey. It detects whether the private key is in a // PEM container or not. If so, it extracts the the private key // from PEM container before conversion. It only supports PEM // containers with no passphrase. func ParseKey(key []byte) (*rsa.PrivateKey, error) { block, _ := pem.Decode(key) if block != nil { key = block.Bytes } parsedKey, err := x509.ParsePKCS8PrivateKey(key) if err != nil { parsedKey, err = x509.ParsePKCS1PrivateKey(key) if err != nil { return nil, fmt.Errorf("private key should be a PEM or plain PKCS1 or PKCS8; parse error: %v", err) } } parsed, ok := parsedKey.(*rsa.PrivateKey) if !ok { return nil, errors.New("private key is invalid") } return parsed, nil } ================================================ FILE: vendor/golang.org/x/oauth2/internal/token.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package internal import ( "context" "encoding/json" "errors" "fmt" "io" "io/ioutil" "mime" "net/http" "net/url" "strconv" "strings" "time" "golang.org/x/net/context/ctxhttp" ) // Token represents the credentials used to authorize // the requests to access protected resources on the OAuth 2.0 // provider's backend. // // This type is a mirror of oauth2.Token and exists to break // an otherwise-circular dependency. Other internal packages // should convert this Token into an oauth2.Token before use. type Token struct { // AccessToken is the token that authorizes and authenticates // the requests. AccessToken string // TokenType is the type of token. // The Type method returns either this or "Bearer", the default. TokenType string // RefreshToken is a token that's used by the application // (as opposed to the user) to refresh the access token // if it expires. RefreshToken string // Expiry is the optional expiration time of the access token. // // If zero, TokenSource implementations will reuse the same // token forever and RefreshToken or equivalent // mechanisms for that TokenSource will not be used. Expiry time.Time // Raw optionally contains extra metadata from the server // when updating a token. Raw interface{} } // tokenJSON is the struct representing the HTTP response from OAuth2 // providers returning a token in JSON form. type tokenJSON struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` RefreshToken string `json:"refresh_token"` ExpiresIn expirationTime `json:"expires_in"` // at least PayPal returns string, while most return number Expires expirationTime `json:"expires"` // broken Facebook spelling of expires_in } func (e *tokenJSON) expiry() (t time.Time) { if v := e.ExpiresIn; v != 0 { return time.Now().Add(time.Duration(v) * time.Second) } if v := e.Expires; v != 0 { return time.Now().Add(time.Duration(v) * time.Second) } return } type expirationTime int32 func (e *expirationTime) UnmarshalJSON(b []byte) error { var n json.Number err := json.Unmarshal(b, &n) if err != nil { return err } i, err := n.Int64() if err != nil { return err } *e = expirationTime(i) return nil } var brokenAuthHeaderProviders = []string{ "https://accounts.google.com/", "https://api.codeswholesale.com/oauth/token", "https://api.dropbox.com/", "https://api.dropboxapi.com/", "https://api.instagram.com/", "https://api.netatmo.net/", "https://api.odnoklassniki.ru/", "https://api.pushbullet.com/", "https://api.soundcloud.com/", "https://api.twitch.tv/", "https://id.twitch.tv/", "https://app.box.com/", "https://api.box.com/", "https://connect.stripe.com/", "https://login.mailchimp.com/", "https://login.microsoftonline.com/", "https://login.salesforce.com/", "https://login.windows.net", "https://login.live.com/", "https://login.live-int.com/", "https://oauth.sandbox.trainingpeaks.com/", "https://oauth.trainingpeaks.com/", "https://oauth.vk.com/", "https://openapi.baidu.com/", "https://slack.com/", "https://test-sandbox.auth.corp.google.com", "https://test.salesforce.com/", "https://user.gini.net/", "https://www.douban.com/", "https://www.googleapis.com/", "https://www.linkedin.com/", "https://www.strava.com/oauth/", "https://www.wunderlist.com/oauth/", "https://api.patreon.com/", "https://sandbox.codeswholesale.com/oauth/token", "https://api.sipgate.com/v1/authorization/oauth", "https://api.medium.com/v1/tokens", "https://log.finalsurge.com/oauth/token", "https://multisport.todaysplan.com.au/rest/oauth/access_token", "https://whats.todaysplan.com.au/rest/oauth/access_token", "https://stackoverflow.com/oauth/access_token", "https://account.health.nokia.com", "https://accounts.zoho.com", "https://gitter.im/login/oauth/token", "https://openid-connect.onelogin.com/oidc", "https://api.dailymotion.com/oauth/token", } // brokenAuthHeaderDomains lists broken providers that issue dynamic endpoints. var brokenAuthHeaderDomains = []string{ ".auth0.com", ".force.com", ".myshopify.com", ".okta.com", ".oktapreview.com", } func RegisterBrokenAuthHeaderProvider(tokenURL string) { brokenAuthHeaderProviders = append(brokenAuthHeaderProviders, tokenURL) } // providerAuthHeaderWorks reports whether the OAuth2 server identified by the tokenURL // implements the OAuth2 spec correctly // See https://code.google.com/p/goauth2/issues/detail?id=31 for background. // In summary: // - Reddit only accepts client secret in the Authorization header // - Dropbox accepts either it in URL param or Auth header, but not both. // - Google only accepts URL param (not spec compliant?), not Auth header // - Stripe only accepts client secret in Auth header with Bearer method, not Basic func providerAuthHeaderWorks(tokenURL string) bool { for _, s := range brokenAuthHeaderProviders { if strings.HasPrefix(tokenURL, s) { // Some sites fail to implement the OAuth2 spec fully. return false } } if u, err := url.Parse(tokenURL); err == nil { for _, s := range brokenAuthHeaderDomains { if strings.HasSuffix(u.Host, s) { return false } } } // Assume the provider implements the spec properly // otherwise. We can add more exceptions as they're // discovered. We will _not_ be adding configurable hooks // to this package to let users select server bugs. return true } func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values) (*Token, error) { bustedAuth := !providerAuthHeaderWorks(tokenURL) if bustedAuth { if clientID != "" { v.Set("client_id", clientID) } if clientSecret != "" { v.Set("client_secret", clientSecret) } } req, err := http.NewRequest("POST", tokenURL, strings.NewReader(v.Encode())) if err != nil { return nil, err } req.Header.Set("Content-Type", "application/x-www-form-urlencoded") if !bustedAuth { req.SetBasicAuth(url.QueryEscape(clientID), url.QueryEscape(clientSecret)) } r, err := ctxhttp.Do(ctx, ContextClient(ctx), req) if err != nil { return nil, err } defer r.Body.Close() body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20)) if err != nil { return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) } if code := r.StatusCode; code < 200 || code > 299 { return nil, &RetrieveError{ Response: r, Body: body, } } var token *Token content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) switch content { case "application/x-www-form-urlencoded", "text/plain": vals, err := url.ParseQuery(string(body)) if err != nil { return nil, err } token = &Token{ AccessToken: vals.Get("access_token"), TokenType: vals.Get("token_type"), RefreshToken: vals.Get("refresh_token"), Raw: vals, } e := vals.Get("expires_in") if e == "" { // TODO(jbd): Facebook's OAuth2 implementation is broken and // returns expires_in field in expires. Remove the fallback to expires, // when Facebook fixes their implementation. e = vals.Get("expires") } expires, _ := strconv.Atoi(e) if expires != 0 { token.Expiry = time.Now().Add(time.Duration(expires) * time.Second) } default: var tj tokenJSON if err = json.Unmarshal(body, &tj); err != nil { return nil, err } token = &Token{ AccessToken: tj.AccessToken, TokenType: tj.TokenType, RefreshToken: tj.RefreshToken, Expiry: tj.expiry(), Raw: make(map[string]interface{}), } json.Unmarshal(body, &token.Raw) // no error checks for optional fields } // Don't overwrite `RefreshToken` with an empty value // if this was a token refreshing request. if token.RefreshToken == "" { token.RefreshToken = v.Get("refresh_token") } if token.AccessToken == "" { return token, errors.New("oauth2: server response missing access_token") } return token, nil } type RetrieveError struct { Response *http.Response Body []byte } func (r *RetrieveError) Error() string { return fmt.Sprintf("oauth2: cannot fetch token: %v\nResponse: %s", r.Response.Status, r.Body) } ================================================ FILE: vendor/golang.org/x/oauth2/internal/transport.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package internal import ( "context" "net/http" ) // HTTPClient is the context key to use with golang.org/x/net/context's // WithValue function to associate an *http.Client value with a context. var HTTPClient ContextKey // ContextKey is just an empty struct. It exists so HTTPClient can be // an immutable public variable with a unique type. It's immutable // because nobody else can create a ContextKey, being unexported. type ContextKey struct{} var appengineClientHook func(context.Context) *http.Client func ContextClient(ctx context.Context) *http.Client { if ctx != nil { if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok { return hc } } if appengineClientHook != nil { return appengineClientHook(ctx) } return http.DefaultClient } ================================================ FILE: vendor/golang.org/x/oauth2/oauth2.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package oauth2 provides support for making // OAuth2 authorized and authenticated HTTP requests, // as specified in RFC 6749. // It can additionally grant authorization with Bearer JWT. package oauth2 // import "golang.org/x/oauth2" import ( "bytes" "context" "errors" "net/http" "net/url" "strings" "sync" "golang.org/x/oauth2/internal" ) // NoContext is the default context you should supply if not using // your own context.Context (see https://golang.org/x/net/context). // // Deprecated: Use context.Background() or context.TODO() instead. var NoContext = context.TODO() // RegisterBrokenAuthHeaderProvider registers an OAuth2 server // identified by the tokenURL prefix as an OAuth2 implementation // which doesn't support the HTTP Basic authentication // scheme to authenticate with the authorization server. // Once a server is registered, credentials (client_id and client_secret) // will be passed as query parameters rather than being present // in the Authorization header. // See https://code.google.com/p/goauth2/issues/detail?id=31 for background. func RegisterBrokenAuthHeaderProvider(tokenURL string) { internal.RegisterBrokenAuthHeaderProvider(tokenURL) } // Config describes a typical 3-legged OAuth2 flow, with both the // client application information and the server's endpoint URLs. // For the client credentials 2-legged OAuth2 flow, see the clientcredentials // package (https://golang.org/x/oauth2/clientcredentials). type Config struct { // ClientID is the application's ID. ClientID string // ClientSecret is the application's secret. ClientSecret string // Endpoint contains the resource server's token endpoint // URLs. These are constants specific to each server and are // often available via site-specific packages, such as // google.Endpoint or github.Endpoint. Endpoint Endpoint // RedirectURL is the URL to redirect users going through // the OAuth flow, after the resource owner's URLs. RedirectURL string // Scope specifies optional requested permissions. Scopes []string } // A TokenSource is anything that can return a token. type TokenSource interface { // Token returns a token or an error. // Token must be safe for concurrent use by multiple goroutines. // The returned Token must not be modified. Token() (*Token, error) } // Endpoint contains the OAuth 2.0 provider's authorization and token // endpoint URLs. type Endpoint struct { AuthURL string TokenURL string } var ( // AccessTypeOnline and AccessTypeOffline are options passed // to the Options.AuthCodeURL method. They modify the // "access_type" field that gets sent in the URL returned by // AuthCodeURL. // // Online is the default if neither is specified. If your // application needs to refresh access tokens when the user // is not present at the browser, then use offline. This will // result in your application obtaining a refresh token the // first time your application exchanges an authorization // code for a user. AccessTypeOnline AuthCodeOption = SetAuthURLParam("access_type", "online") AccessTypeOffline AuthCodeOption = SetAuthURLParam("access_type", "offline") // ApprovalForce forces the users to view the consent dialog // and confirm the permissions request at the URL returned // from AuthCodeURL, even if they've already done so. ApprovalForce AuthCodeOption = SetAuthURLParam("approval_prompt", "force") ) // An AuthCodeOption is passed to Config.AuthCodeURL. type AuthCodeOption interface { setValue(url.Values) } type setParam struct{ k, v string } func (p setParam) setValue(m url.Values) { m.Set(p.k, p.v) } // SetAuthURLParam builds an AuthCodeOption which passes key/value parameters // to a provider's authorization endpoint. func SetAuthURLParam(key, value string) AuthCodeOption { return setParam{key, value} } // AuthCodeURL returns a URL to OAuth 2.0 provider's consent page // that asks for permissions for the required scopes explicitly. // // State is a token to protect the user from CSRF attacks. You must // always provide a non-empty string and validate that it matches the // the state query parameter on your redirect callback. // See http://tools.ietf.org/html/rfc6749#section-10.12 for more info. // // Opts may include AccessTypeOnline or AccessTypeOffline, as well // as ApprovalForce. // It can also be used to pass the PKCE challange. // See https://www.oauth.com/oauth2-servers/pkce/ for more info. func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string { var buf bytes.Buffer buf.WriteString(c.Endpoint.AuthURL) v := url.Values{ "response_type": {"code"}, "client_id": {c.ClientID}, } if c.RedirectURL != "" { v.Set("redirect_uri", c.RedirectURL) } if len(c.Scopes) > 0 { v.Set("scope", strings.Join(c.Scopes, " ")) } if state != "" { // TODO(light): Docs say never to omit state; don't allow empty. v.Set("state", state) } for _, opt := range opts { opt.setValue(v) } if strings.Contains(c.Endpoint.AuthURL, "?") { buf.WriteByte('&') } else { buf.WriteByte('?') } buf.WriteString(v.Encode()) return buf.String() } // PasswordCredentialsToken converts a resource owner username and password // pair into a token. // // Per the RFC, this grant type should only be used "when there is a high // degree of trust between the resource owner and the client (e.g., the client // is part of the device operating system or a highly privileged application), // and when other authorization grant types are not available." // See https://tools.ietf.org/html/rfc6749#section-4.3 for more info. // // The provided context optionally controls which HTTP client is used. See the HTTPClient variable. func (c *Config) PasswordCredentialsToken(ctx context.Context, username, password string) (*Token, error) { v := url.Values{ "grant_type": {"password"}, "username": {username}, "password": {password}, } if len(c.Scopes) > 0 { v.Set("scope", strings.Join(c.Scopes, " ")) } return retrieveToken(ctx, c, v) } // Exchange converts an authorization code into a token. // // It is used after a resource provider redirects the user back // to the Redirect URI (the URL obtained from AuthCodeURL). // // The provided context optionally controls which HTTP client is used. See the HTTPClient variable. // // The code will be in the *http.Request.FormValue("code"). Before // calling Exchange, be sure to validate FormValue("state"). // // Opts may include the PKCE verifier code if previously used in AuthCodeURL. // See https://www.oauth.com/oauth2-servers/pkce/ for more info. func (c *Config) Exchange(ctx context.Context, code string, opts ...AuthCodeOption) (*Token, error) { v := url.Values{ "grant_type": {"authorization_code"}, "code": {code}, } if c.RedirectURL != "" { v.Set("redirect_uri", c.RedirectURL) } for _, opt := range opts { opt.setValue(v) } return retrieveToken(ctx, c, v) } // Client returns an HTTP client using the provided token. // The token will auto-refresh as necessary. The underlying // HTTP transport will be obtained using the provided context. // The returned client and its Transport should not be modified. func (c *Config) Client(ctx context.Context, t *Token) *http.Client { return NewClient(ctx, c.TokenSource(ctx, t)) } // TokenSource returns a TokenSource that returns t until t expires, // automatically refreshing it as necessary using the provided context. // // Most users will use Config.Client instead. func (c *Config) TokenSource(ctx context.Context, t *Token) TokenSource { tkr := &tokenRefresher{ ctx: ctx, conf: c, } if t != nil { tkr.refreshToken = t.RefreshToken } return &reuseTokenSource{ t: t, new: tkr, } } // tokenRefresher is a TokenSource that makes "grant_type"=="refresh_token" // HTTP requests to renew a token using a RefreshToken. type tokenRefresher struct { ctx context.Context // used to get HTTP requests conf *Config refreshToken string } // WARNING: Token is not safe for concurrent access, as it // updates the tokenRefresher's refreshToken field. // Within this package, it is used by reuseTokenSource which // synchronizes calls to this method with its own mutex. func (tf *tokenRefresher) Token() (*Token, error) { if tf.refreshToken == "" { return nil, errors.New("oauth2: token expired and refresh token is not set") } tk, err := retrieveToken(tf.ctx, tf.conf, url.Values{ "grant_type": {"refresh_token"}, "refresh_token": {tf.refreshToken}, }) if err != nil { return nil, err } if tf.refreshToken != tk.RefreshToken { tf.refreshToken = tk.RefreshToken } return tk, err } // reuseTokenSource is a TokenSource that holds a single token in memory // and validates its expiry before each call to retrieve it with // Token. If it's expired, it will be auto-refreshed using the // new TokenSource. type reuseTokenSource struct { new TokenSource // called when t is expired. mu sync.Mutex // guards t t *Token } // Token returns the current token if it's still valid, else will // refresh the current token (using r.Context for HTTP client // information) and return the new one. func (s *reuseTokenSource) Token() (*Token, error) { s.mu.Lock() defer s.mu.Unlock() if s.t.Valid() { return s.t, nil } t, err := s.new.Token() if err != nil { return nil, err } s.t = t return t, nil } // StaticTokenSource returns a TokenSource that always returns the same token. // Because the provided token t is never refreshed, StaticTokenSource is only // useful for tokens that never expire. func StaticTokenSource(t *Token) TokenSource { return staticTokenSource{t} } // staticTokenSource is a TokenSource that always returns the same Token. type staticTokenSource struct { t *Token } func (s staticTokenSource) Token() (*Token, error) { return s.t, nil } // HTTPClient is the context key to use with golang.org/x/net/context's // WithValue function to associate an *http.Client value with a context. var HTTPClient internal.ContextKey // NewClient creates an *http.Client from a Context and TokenSource. // The returned client is not valid beyond the lifetime of the context. // // Note that if a custom *http.Client is provided via the Context it // is used only for token acquisition and is not used to configure the // *http.Client returned from NewClient. // // As a special case, if src is nil, a non-OAuth2 client is returned // using the provided context. This exists to support related OAuth2 // packages. func NewClient(ctx context.Context, src TokenSource) *http.Client { if src == nil { return internal.ContextClient(ctx) } return &http.Client{ Transport: &Transport{ Base: internal.ContextClient(ctx).Transport, Source: ReuseTokenSource(nil, src), }, } } // ReuseTokenSource returns a TokenSource which repeatedly returns the // same token as long as it's valid, starting with t. // When its cached token is invalid, a new token is obtained from src. // // ReuseTokenSource is typically used to reuse tokens from a cache // (such as a file on disk) between runs of a program, rather than // obtaining new tokens unnecessarily. // // The initial token t may be nil, in which case the TokenSource is // wrapped in a caching version if it isn't one already. This also // means it's always safe to wrap ReuseTokenSource around any other // TokenSource without adverse effects. func ReuseTokenSource(t *Token, src TokenSource) TokenSource { // Don't wrap a reuseTokenSource in itself. That would work, // but cause an unnecessary number of mutex operations. // Just build the equivalent one. if rt, ok := src.(*reuseTokenSource); ok { if t == nil { // Just use it directly. return rt } src = rt.new } return &reuseTokenSource{ t: t, new: src, } } ================================================ FILE: vendor/golang.org/x/oauth2/token.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package oauth2 import ( "context" "fmt" "net/http" "net/url" "strconv" "strings" "time" "golang.org/x/oauth2/internal" ) // expiryDelta determines how earlier a token should be considered // expired than its actual expiration time. It is used to avoid late // expirations due to client-server time mismatches. const expiryDelta = 10 * time.Second // Token represents the credentials used to authorize // the requests to access protected resources on the OAuth 2.0 // provider's backend. // // Most users of this package should not access fields of Token // directly. They're exported mostly for use by related packages // implementing derivative OAuth2 flows. type Token struct { // AccessToken is the token that authorizes and authenticates // the requests. AccessToken string `json:"access_token"` // TokenType is the type of token. // The Type method returns either this or "Bearer", the default. TokenType string `json:"token_type,omitempty"` // RefreshToken is a token that's used by the application // (as opposed to the user) to refresh the access token // if it expires. RefreshToken string `json:"refresh_token,omitempty"` // Expiry is the optional expiration time of the access token. // // If zero, TokenSource implementations will reuse the same // token forever and RefreshToken or equivalent // mechanisms for that TokenSource will not be used. Expiry time.Time `json:"expiry,omitempty"` // raw optionally contains extra metadata from the server // when updating a token. raw interface{} } // Type returns t.TokenType if non-empty, else "Bearer". func (t *Token) Type() string { if strings.EqualFold(t.TokenType, "bearer") { return "Bearer" } if strings.EqualFold(t.TokenType, "mac") { return "MAC" } if strings.EqualFold(t.TokenType, "basic") { return "Basic" } if t.TokenType != "" { return t.TokenType } return "Bearer" } // SetAuthHeader sets the Authorization header to r using the access // token in t. // // This method is unnecessary when using Transport or an HTTP Client // returned by this package. func (t *Token) SetAuthHeader(r *http.Request) { r.Header.Set("Authorization", t.Type()+" "+t.AccessToken) } // WithExtra returns a new Token that's a clone of t, but using the // provided raw extra map. This is only intended for use by packages // implementing derivative OAuth2 flows. func (t *Token) WithExtra(extra interface{}) *Token { t2 := new(Token) *t2 = *t t2.raw = extra return t2 } // Extra returns an extra field. // Extra fields are key-value pairs returned by the server as a // part of the token retrieval response. func (t *Token) Extra(key string) interface{} { if raw, ok := t.raw.(map[string]interface{}); ok { return raw[key] } vals, ok := t.raw.(url.Values) if !ok { return nil } v := vals.Get(key) switch s := strings.TrimSpace(v); strings.Count(s, ".") { case 0: // Contains no "."; try to parse as int if i, err := strconv.ParseInt(s, 10, 64); err == nil { return i } case 1: // Contains a single "."; try to parse as float if f, err := strconv.ParseFloat(s, 64); err == nil { return f } } return v } // expired reports whether the token is expired. // t must be non-nil. func (t *Token) expired() bool { if t.Expiry.IsZero() { return false } return t.Expiry.Round(0).Add(-expiryDelta).Before(time.Now()) } // Valid reports whether t is non-nil, has an AccessToken, and is not expired. func (t *Token) Valid() bool { return t != nil && t.AccessToken != "" && !t.expired() } // tokenFromInternal maps an *internal.Token struct into // a *Token struct. func tokenFromInternal(t *internal.Token) *Token { if t == nil { return nil } return &Token{ AccessToken: t.AccessToken, TokenType: t.TokenType, RefreshToken: t.RefreshToken, Expiry: t.Expiry, raw: t.Raw, } } // retrieveToken takes a *Config and uses that to retrieve an *internal.Token. // This token is then mapped from *internal.Token into an *oauth2.Token which is returned along // with an error.. func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) { tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v) if err != nil { if rErr, ok := err.(*internal.RetrieveError); ok { return nil, (*RetrieveError)(rErr) } return nil, err } return tokenFromInternal(tk), nil } // RetrieveError is the error returned when the token endpoint returns a // non-2XX HTTP status code. type RetrieveError struct { Response *http.Response // Body is the body that was consumed by reading Response.Body. // It may be truncated. Body []byte } func (r *RetrieveError) Error() string { return fmt.Sprintf("oauth2: cannot fetch token: %v\nResponse: %s", r.Response.Status, r.Body) } ================================================ FILE: vendor/golang.org/x/oauth2/transport.go ================================================ // Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package oauth2 import ( "errors" "io" "net/http" "sync" ) // Transport is an http.RoundTripper that makes OAuth 2.0 HTTP requests, // wrapping a base RoundTripper and adding an Authorization header // with a token from the supplied Sources. // // Transport is a low-level mechanism. Most code will use the // higher-level Config.Client method instead. type Transport struct { // Source supplies the token to add to outgoing requests' // Authorization headers. Source TokenSource // Base is the base RoundTripper used to make HTTP requests. // If nil, http.DefaultTransport is used. Base http.RoundTripper mu sync.Mutex // guards modReq modReq map[*http.Request]*http.Request // original -> modified } // RoundTrip authorizes and authenticates the request with an // access token from Transport's Source. func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { reqBodyClosed := false if req.Body != nil { defer func() { if !reqBodyClosed { req.Body.Close() } }() } if t.Source == nil { return nil, errors.New("oauth2: Transport's Source is nil") } token, err := t.Source.Token() if err != nil { return nil, err } req2 := cloneRequest(req) // per RoundTripper contract token.SetAuthHeader(req2) t.setModReq(req, req2) res, err := t.base().RoundTrip(req2) // req.Body is assumed to have been closed by the base RoundTripper. reqBodyClosed = true if err != nil { t.setModReq(req, nil) return nil, err } res.Body = &onEOFReader{ rc: res.Body, fn: func() { t.setModReq(req, nil) }, } return res, nil } // CancelRequest cancels an in-flight request by closing its connection. func (t *Transport) CancelRequest(req *http.Request) { type canceler interface { CancelRequest(*http.Request) } if cr, ok := t.base().(canceler); ok { t.mu.Lock() modReq := t.modReq[req] delete(t.modReq, req) t.mu.Unlock() cr.CancelRequest(modReq) } } func (t *Transport) base() http.RoundTripper { if t.Base != nil { return t.Base } return http.DefaultTransport } func (t *Transport) setModReq(orig, mod *http.Request) { t.mu.Lock() defer t.mu.Unlock() if t.modReq == nil { t.modReq = make(map[*http.Request]*http.Request) } if mod == nil { delete(t.modReq, orig) } else { t.modReq[orig] = mod } } // cloneRequest returns a clone of the provided *http.Request. // The clone is a shallow copy of the struct and its Header map. func cloneRequest(r *http.Request) *http.Request { // shallow copy of the struct r2 := new(http.Request) *r2 = *r // deep copy of the Header r2.Header = make(http.Header, len(r.Header)) for k, s := range r.Header { r2.Header[k] = append([]string(nil), s...) } return r2 } type onEOFReader struct { rc io.ReadCloser fn func() } func (r *onEOFReader) Read(p []byte) (n int, err error) { n, err = r.rc.Read(p) if err == io.EOF { r.runFunc() } return } func (r *onEOFReader) Close() error { err := r.rc.Close() r.runFunc() return err } func (r *onEOFReader) runFunc() { if fn := r.fn; fn != nil { fn() r.fn = nil } } ================================================ FILE: vendor/golang.org/x/sys/AUTHORS ================================================ # This source code refers to The Go Authors for copyright purposes. # The master list of authors is in the main Go distribution, # visible at http://tip.golang.org/AUTHORS. ================================================ FILE: vendor/golang.org/x/sys/CONTRIBUTORS ================================================ # This source code was written by the Go contributors. # The master list of contributors is in the main Go distribution, # visible at http://tip.golang.org/CONTRIBUTORS. ================================================ FILE: vendor/golang.org/x/sys/LICENSE ================================================ Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: vendor/golang.org/x/sys/PATENTS ================================================ Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. ================================================ FILE: vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !gccgo #include "textflag.h" // // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go // TEXT ·syscall6(SB),NOSPLIT,$0-88 JMP syscall·syscall6(SB) TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 JMP syscall·rawSyscall6(SB) ================================================ FILE: vendor/golang.org/x/sys/cpu/byteorder.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu import ( "encoding/binary" "runtime" ) // hostByteOrder returns binary.LittleEndian on little-endian machines and // binary.BigEndian on big-endian machines. func hostByteOrder() binary.ByteOrder { switch runtime.GOARCH { case "386", "amd64", "amd64p32", "arm", "arm64", "mipsle", "mips64le", "mips64p32le", "ppc64le", "riscv", "riscv64": return binary.LittleEndian case "armbe", "arm64be", "mips", "mips64", "mips64p32", "ppc", "ppc64", "s390", "s390x", "sparc", "sparc64": return binary.BigEndian } panic("unknown architecture") } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu.go ================================================ // Copyright 2018 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 cpu implements processor feature detection for // various CPU architectures. package cpu // Initialized reports whether the CPU features were initialized. // // For some GOOS/GOARCH combinations initialization of the CPU features depends // on reading an operating specific file, e.g. /proc/self/auxv on linux/arm // Initialized will report false if reading the file fails. var Initialized bool // CacheLinePad is used to pad structs to avoid false sharing. type CacheLinePad struct{ _ [cacheLineSize]byte } // X86 contains the supported CPU features of the // current X86/AMD64 platform. If the current platform // is not X86/AMD64 then all feature flags are false. // // X86 is padded to avoid false sharing. Further the HasAVX // and HasAVX2 are only set if the OS supports XMM and YMM // registers in addition to the CPUID feature bit being set. var X86 struct { _ CacheLinePad HasAES bool // AES hardware implementation (AES NI) HasADX bool // Multi-precision add-carry instruction extensions HasAVX bool // Advanced vector extension HasAVX2 bool // Advanced vector extension 2 HasBMI1 bool // Bit manipulation instruction set 1 HasBMI2 bool // Bit manipulation instruction set 2 HasERMS bool // Enhanced REP for MOVSB and STOSB HasFMA bool // Fused-multiply-add instructions HasOSXSAVE bool // OS supports XSAVE/XRESTOR for saving/restoring XMM registers. HasPCLMULQDQ bool // PCLMULQDQ instruction - most often used for AES-GCM HasPOPCNT bool // Hamming weight instruction POPCNT. HasRDRAND bool // RDRAND instruction (on-chip random number generator) HasRDSEED bool // RDSEED instruction (on-chip random number generator) HasSSE2 bool // Streaming SIMD extension 2 (always available on amd64) HasSSE3 bool // Streaming SIMD extension 3 HasSSSE3 bool // Supplemental streaming SIMD extension 3 HasSSE41 bool // Streaming SIMD extension 4 and 4.1 HasSSE42 bool // Streaming SIMD extension 4 and 4.2 _ CacheLinePad } // ARM64 contains the supported CPU features of the // current ARMv8(aarch64) platform. If the current platform // is not arm64 then all feature flags are false. var ARM64 struct { _ CacheLinePad HasFP bool // Floating-point instruction set (always available) HasASIMD bool // Advanced SIMD (always available) HasEVTSTRM bool // Event stream support HasAES bool // AES hardware implementation HasPMULL bool // Polynomial multiplication instruction set HasSHA1 bool // SHA1 hardware implementation HasSHA2 bool // SHA2 hardware implementation HasCRC32 bool // CRC32 hardware implementation HasATOMICS bool // Atomic memory operation instruction set HasFPHP bool // Half precision floating-point instruction set HasASIMDHP bool // Advanced SIMD half precision instruction set HasCPUID bool // CPUID identification scheme registers HasASIMDRDM bool // Rounding double multiply add/subtract instruction set HasJSCVT bool // Javascript conversion from floating-point to integer HasFCMA bool // Floating-point multiplication and addition of complex numbers HasLRCPC bool // Release Consistent processor consistent support HasDCPOP bool // Persistent memory support HasSHA3 bool // SHA3 hardware implementation HasSM3 bool // SM3 hardware implementation HasSM4 bool // SM4 hardware implementation HasASIMDDP bool // Advanced SIMD double precision instruction set HasSHA512 bool // SHA512 hardware implementation HasSVE bool // Scalable Vector Extensions HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32 _ CacheLinePad } // PPC64 contains the supported CPU features of the current ppc64/ppc64le platforms. // If the current platform is not ppc64/ppc64le then all feature flags are false. // // For ppc64/ppc64le, it is safe to check only for ISA level starting on ISA v3.00, // since there are no optional categories. There are some exceptions that also // require kernel support to work (DARN, SCV), so there are feature bits for // those as well. The minimum processor requirement is POWER8 (ISA 2.07). // The struct is padded to avoid false sharing. var PPC64 struct { _ CacheLinePad HasDARN bool // Hardware random number generator (requires kernel enablement) HasSCV bool // Syscall vectored (requires kernel enablement) IsPOWER8 bool // ISA v2.07 (POWER8) IsPOWER9 bool // ISA v3.00 (POWER9) _ CacheLinePad } // S390X contains the supported CPU features of the current IBM Z // (s390x) platform. If the current platform is not IBM Z then all // feature flags are false. // // S390X is padded to avoid false sharing. Further HasVX is only set // if the OS supports vector registers in addition to the STFLE // feature bit being set. var S390X struct { _ CacheLinePad HasZARCH bool // z/Architecture mode is active [mandatory] HasSTFLE bool // store facility list extended HasLDISP bool // long (20-bit) displacements HasEIMM bool // 32-bit immediates HasDFP bool // decimal floating point HasETF3EH bool // ETF-3 enhanced HasMSA bool // message security assist (CPACF) HasAES bool // KM-AES{128,192,256} functions HasAESCBC bool // KMC-AES{128,192,256} functions HasAESCTR bool // KMCTR-AES{128,192,256} functions HasAESGCM bool // KMA-GCM-AES{128,192,256} functions HasGHASH bool // KIMD-GHASH function HasSHA1 bool // K{I,L}MD-SHA-1 functions HasSHA256 bool // K{I,L}MD-SHA-256 functions HasSHA512 bool // K{I,L}MD-SHA-512 functions HasSHA3 bool // K{I,L}MD-SHA3-{224,256,384,512} and K{I,L}MD-SHAKE-{128,256} functions HasVX bool // vector facility HasVXE bool // vector-enhancements facility 1 _ CacheLinePad } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_aix_ppc64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build aix,ppc64 package cpu const cacheLineSize = 128 const ( // getsystemcfg constants _SC_IMPL = 2 _IMPL_POWER8 = 0x10000 _IMPL_POWER9 = 0x20000 ) func init() { impl := getsystemcfg(_SC_IMPL) if impl&_IMPL_POWER8 != 0 { PPC64.IsPOWER8 = true } if impl&_IMPL_POWER9 != 0 { PPC64.IsPOWER9 = true } Initialized = true } func getsystemcfg(label int) (n uint64) { r0, _ := callgetsystemcfg(label) n = uint64(r0) return } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_arm.go ================================================ // Copyright 2018 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 cpu const cacheLineSize = 32 func doinit() {} ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !gccgo package cpu // haveAsmFunctions reports whether the other functions in this file can // be safely called. func haveAsmFunctions() bool { return true } // The following feature detection functions are defined in cpu_s390x.s. // They are likely to be expensive to call so the results should be cached. func stfle() facilityList func kmQuery() queryResult func kmcQuery() queryResult func kmctrQuery() queryResult func kmaQuery() queryResult func kimdQuery() queryResult func klmdQuery() queryResult ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gc_x86.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build 386 amd64 amd64p32 // +build !gccgo package cpu // cpuid is implemented in cpu_x86.s for gc compiler // and in cpu_gccgo.c for gccgo. func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) // xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler // and in cpu_gccgo.c for gccgo. func xgetbv() (eax, edx uint32) ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gccgo.c ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build 386 amd64 amd64p32 // +build gccgo #include #include // Need to wrap __get_cpuid_count because it's declared as static. int gccgoGetCpuidCount(uint32_t leaf, uint32_t subleaf, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) { return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx); } // xgetbv reads the contents of an XCR (Extended Control Register) // specified in the ECX register into registers EDX:EAX. // Currently, the only supported value for XCR is 0. // // TODO: Replace with a better alternative: // // #include // // #pragma GCC target("xsave") // // void gccgoXgetbv(uint32_t *eax, uint32_t *edx) { // unsigned long long x = _xgetbv(0); // *eax = x & 0xffffffff; // *edx = (x >> 32) & 0xffffffff; // } // // Note that _xgetbv is defined starting with GCC 8. void gccgoXgetbv(uint32_t *eax, uint32_t *edx) { __asm(" xorl %%ecx, %%ecx\n" " xgetbv" : "=a"(*eax), "=d"(*edx)); } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gccgo.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build 386 amd64 amd64p32 // +build gccgo package cpu //extern gccgoGetCpuidCount func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32) func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) { var a, b, c, d uint32 gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d) return a, b, c, d } //extern gccgoXgetbv func gccgoXgetbv(eax, edx *uint32) func xgetbv() (eax, edx uint32) { var a, d uint32 gccgoXgetbv(&a, &d) return a, d } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build gccgo package cpu // haveAsmFunctions reports whether the other functions in this file can // be safely called. func haveAsmFunctions() bool { return false } // TODO(mundaym): the following feature detection functions are currently // stubs. See https://golang.org/cl/162887 for how to fix this. // They are likely to be expensive to call so the results should be cached. func stfle() facilityList { panic("not implemented for gccgo") } func kmQuery() queryResult { panic("not implemented for gccgo") } func kmcQuery() queryResult { panic("not implemented for gccgo") } func kmctrQuery() queryResult { panic("not implemented for gccgo") } func kmaQuery() queryResult { panic("not implemented for gccgo") } func kimdQuery() queryResult { panic("not implemented for gccgo") } func klmdQuery() queryResult { panic("not implemented for gccgo") } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //+build !amd64,!amd64p32,!386 package cpu import ( "io/ioutil" ) const ( _AT_HWCAP = 16 _AT_HWCAP2 = 26 procAuxv = "/proc/self/auxv" uintSize = int(32 << (^uint(0) >> 63)) ) // For those platforms don't have a 'cpuid' equivalent we use HWCAP/HWCAP2 // These are initialized in cpu_$GOARCH.go // and should not be changed after they are initialized. var hwCap uint var hwCap2 uint func init() { buf, err := ioutil.ReadFile(procAuxv) if err != nil { // e.g. on android /proc/self/auxv is not accessible, so silently // ignore the error and leave Initialized = false return } bo := hostByteOrder() for len(buf) >= 2*(uintSize/8) { var tag, val uint switch uintSize { case 32: tag = uint(bo.Uint32(buf[0:])) val = uint(bo.Uint32(buf[4:])) buf = buf[8:] case 64: tag = uint(bo.Uint64(buf[0:])) val = uint(bo.Uint64(buf[8:])) buf = buf[16:] } switch tag { case _AT_HWCAP: hwCap = val case _AT_HWCAP2: hwCap2 = val } } doinit() Initialized = true } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go ================================================ // Copyright 2018 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 cpu const cacheLineSize = 64 // HWCAP/HWCAP2 bits. These are exposed by Linux. const ( hwcap_FP = 1 << 0 hwcap_ASIMD = 1 << 1 hwcap_EVTSTRM = 1 << 2 hwcap_AES = 1 << 3 hwcap_PMULL = 1 << 4 hwcap_SHA1 = 1 << 5 hwcap_SHA2 = 1 << 6 hwcap_CRC32 = 1 << 7 hwcap_ATOMICS = 1 << 8 hwcap_FPHP = 1 << 9 hwcap_ASIMDHP = 1 << 10 hwcap_CPUID = 1 << 11 hwcap_ASIMDRDM = 1 << 12 hwcap_JSCVT = 1 << 13 hwcap_FCMA = 1 << 14 hwcap_LRCPC = 1 << 15 hwcap_DCPOP = 1 << 16 hwcap_SHA3 = 1 << 17 hwcap_SM3 = 1 << 18 hwcap_SM4 = 1 << 19 hwcap_ASIMDDP = 1 << 20 hwcap_SHA512 = 1 << 21 hwcap_SVE = 1 << 22 hwcap_ASIMDFHM = 1 << 23 ) func doinit() { // HWCAP feature bits ARM64.HasFP = isSet(hwCap, hwcap_FP) ARM64.HasASIMD = isSet(hwCap, hwcap_ASIMD) ARM64.HasEVTSTRM = isSet(hwCap, hwcap_EVTSTRM) ARM64.HasAES = isSet(hwCap, hwcap_AES) ARM64.HasPMULL = isSet(hwCap, hwcap_PMULL) ARM64.HasSHA1 = isSet(hwCap, hwcap_SHA1) ARM64.HasSHA2 = isSet(hwCap, hwcap_SHA2) ARM64.HasCRC32 = isSet(hwCap, hwcap_CRC32) ARM64.HasATOMICS = isSet(hwCap, hwcap_ATOMICS) ARM64.HasFPHP = isSet(hwCap, hwcap_FPHP) ARM64.HasASIMDHP = isSet(hwCap, hwcap_ASIMDHP) ARM64.HasCPUID = isSet(hwCap, hwcap_CPUID) ARM64.HasASIMDRDM = isSet(hwCap, hwcap_ASIMDRDM) ARM64.HasJSCVT = isSet(hwCap, hwcap_JSCVT) ARM64.HasFCMA = isSet(hwCap, hwcap_FCMA) ARM64.HasLRCPC = isSet(hwCap, hwcap_LRCPC) ARM64.HasDCPOP = isSet(hwCap, hwcap_DCPOP) ARM64.HasSHA3 = isSet(hwCap, hwcap_SHA3) ARM64.HasSM3 = isSet(hwCap, hwcap_SM3) ARM64.HasSM4 = isSet(hwCap, hwcap_SM4) ARM64.HasASIMDDP = isSet(hwCap, hwcap_ASIMDDP) ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512) ARM64.HasSVE = isSet(hwCap, hwcap_SVE) ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM) } func isSet(hwc uint, value uint) bool { return hwc&value != 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux // +build ppc64 ppc64le package cpu const cacheLineSize = 128 // HWCAP/HWCAP2 bits. These are exposed by the kernel. const ( // ISA Level _PPC_FEATURE2_ARCH_2_07 = 0x80000000 _PPC_FEATURE2_ARCH_3_00 = 0x00800000 // CPU features _PPC_FEATURE2_DARN = 0x00200000 _PPC_FEATURE2_SCV = 0x00100000 ) func doinit() { // HWCAP2 feature bits PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07) PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00) PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN) PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV) } func isSet(hwc uint, value uint) bool { return hwc&value != 0 } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cpu const cacheLineSize = 256 const ( // bit mask values from /usr/include/bits/hwcap.h hwcap_ZARCH = 2 hwcap_STFLE = 4 hwcap_MSA = 8 hwcap_LDISP = 16 hwcap_EIMM = 32 hwcap_DFP = 64 hwcap_ETF3EH = 256 hwcap_VX = 2048 hwcap_VXE = 8192 ) // bitIsSet reports whether the bit at index is set. The bit index // is in big endian order, so bit index 0 is the leftmost bit. func bitIsSet(bits []uint64, index uint) bool { return bits[index/64]&((1<<63)>>(index%64)) != 0 } // function is the code for the named cryptographic function. type function uint8 const ( // KM{,A,C,CTR} function codes aes128 function = 18 // AES-128 aes192 function = 19 // AES-192 aes256 function = 20 // AES-256 // K{I,L}MD function codes sha1 function = 1 // SHA-1 sha256 function = 2 // SHA-256 sha512 function = 3 // SHA-512 sha3_224 function = 32 // SHA3-224 sha3_256 function = 33 // SHA3-256 sha3_384 function = 34 // SHA3-384 sha3_512 function = 35 // SHA3-512 shake128 function = 36 // SHAKE-128 shake256 function = 37 // SHAKE-256 // KLMD function codes ghash function = 65 // GHASH ) // queryResult contains the result of a Query function // call. Bits are numbered in big endian order so the // leftmost bit (the MSB) is at index 0. type queryResult struct { bits [2]uint64 } // Has reports whether the given functions are present. func (q *queryResult) Has(fns ...function) bool { if len(fns) == 0 { panic("no function codes provided") } for _, f := range fns { if !bitIsSet(q.bits[:], uint(f)) { return false } } return true } // facility is a bit index for the named facility. type facility uint8 const ( // cryptography facilities msa4 facility = 77 // message-security-assist extension 4 msa8 facility = 146 // message-security-assist extension 8 ) // facilityList contains the result of an STFLE call. // Bits are numbered in big endian order so the // leftmost bit (the MSB) is at index 0. type facilityList struct { bits [4]uint64 } // Has reports whether the given facilities are present. func (s *facilityList) Has(fs ...facility) bool { if len(fs) == 0 { panic("no facility bits provided") } for _, f := range fs { if !bitIsSet(s.bits[:], uint(f)) { return false } } return true } func doinit() { // test HWCAP bit vector has := func(featureMask uint) bool { return hwCap&featureMask == featureMask } // mandatory S390X.HasZARCH = has(hwcap_ZARCH) // optional S390X.HasSTFLE = has(hwcap_STFLE) S390X.HasLDISP = has(hwcap_LDISP) S390X.HasEIMM = has(hwcap_EIMM) S390X.HasETF3EH = has(hwcap_ETF3EH) S390X.HasDFP = has(hwcap_DFP) S390X.HasMSA = has(hwcap_MSA) S390X.HasVX = has(hwcap_VX) if S390X.HasVX { S390X.HasVXE = has(hwcap_VXE) } // We need implementations of stfle, km and so on // to detect cryptographic features. if !haveAsmFunctions() { return } // optional cryptographic functions if S390X.HasMSA { aes := []function{aes128, aes192, aes256} // cipher message km, kmc := kmQuery(), kmcQuery() S390X.HasAES = km.Has(aes...) S390X.HasAESCBC = kmc.Has(aes...) if S390X.HasSTFLE { facilities := stfle() if facilities.Has(msa4) { kmctr := kmctrQuery() S390X.HasAESCTR = kmctr.Has(aes...) } if facilities.Has(msa8) { kma := kmaQuery() S390X.HasAESGCM = kma.Has(aes...) } } // compute message digest kimd := kimdQuery() // intermediate (no padding) klmd := klmdQuery() // last (padding) S390X.HasSHA1 = kimd.Has(sha1) && klmd.Has(sha1) S390X.HasSHA256 = kimd.Has(sha256) && klmd.Has(sha256) S390X.HasSHA512 = kimd.Has(sha512) && klmd.Has(sha512) S390X.HasGHASH = kimd.Has(ghash) // KLMD-GHASH does not exist sha3 := []function{ sha3_224, sha3_256, sha3_384, sha3_512, shake128, shake256, } S390X.HasSHA3 = kimd.Has(sha3...) && klmd.Has(sha3...) } } ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_mips64x.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build mips64 mips64le package cpu const cacheLineSize = 32 func doinit() {} ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_mipsx.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build mips mipsle package cpu const cacheLineSize = 32 func doinit() {} ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_other_arm64.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !linux,arm64 package cpu const cacheLineSize = 64 func doinit() {} ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_s390x.s ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !gccgo #include "textflag.h" // func stfle() facilityList TEXT ·stfle(SB), NOSPLIT|NOFRAME, $0-32 MOVD $ret+0(FP), R1 MOVD $3, R0 // last doubleword index to store XC $32, (R1), (R1) // clear 4 doublewords (32 bytes) WORD $0xb2b01000 // store facility list extended (STFLE) RET // func kmQuery() queryResult TEXT ·kmQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KM-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xB92E0024 // cipher message (KM) RET // func kmcQuery() queryResult TEXT ·kmcQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KMC-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xB92F0024 // cipher message with chaining (KMC) RET // func kmctrQuery() queryResult TEXT ·kmctrQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KMCTR-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xB92D4024 // cipher message with counter (KMCTR) RET // func kmaQuery() queryResult TEXT ·kmaQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KMA-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xb9296024 // cipher message with authentication (KMA) RET // func kimdQuery() queryResult TEXT ·kimdQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KIMD-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xB93E0024 // compute intermediate message digest (KIMD) RET // func klmdQuery() queryResult TEXT ·klmdQuery(SB), NOSPLIT|NOFRAME, $0-16 MOVD $0, R0 // set function code to 0 (KLMD-Query) MOVD $ret+0(FP), R1 // address of 16-byte return value WORD $0xB93F0024 // compute last message digest (KLMD) RET ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_wasm.go ================================================ // Copyright 2019 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build wasm package cpu // We're compiling the cpu package for an unknown (software-abstracted) CPU. // Make CacheLinePad an empty struct and hope that the usual struct alignment // rules are good enough. const cacheLineSize = 0 func doinit() {} ================================================ FILE: vendor/golang.org/x/sys/cpu/cpu_x86.go ================================================ // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build 386 amd64 amd64p32 package cpu const cacheLineSize = 64 func init() { Initialized = true maxID, _, _, _ := cpuid(0, 0) if maxID < 1 { return } _, _, ecx1, edx1 := cpuid(1, 0) X86.HasSSE2 = isSet(26, edx1) X86.HasSSE3 = isSet(0, ecx1) X86.HasPCLMULQDQ = isSet(1, ecx1) X86.HasSSSE3 = isSet(9, ecx1) X86.HasFMA = isSet(12, ecx1) X86.HasSSE41 = isSet(19, ecx1) X86.HasSSE42 = isSet(20, ecx1) X86.HasPOPCNT = isSet(23, ecx1) X86.HasAES = isSet(25, ecx1) X86.HasOSXSAVE = isSet(27, ecx1) X86.HasRDRAND = isSet(30, ecx1) osSupportsAVX := false // For XGETBV, OSXSAVE bit is required and sufficient. if X86.HasOSXSAVE { eax, _ := xgetbv() // Check if XMM and YMM registers have OS support. osSupportsAVX = isSet(1, eax) && isSet(2, eax) } X86.HasAVX = isSet(28, ecx1) && osSupportsAVX if maxID < 7 { return } _, ebx7, _, _ := cpuid(7, 0) X86.HasBMI1 = isSet(3, ebx7) X86.HasAVX2 = isSet(5, ebx7) && osSupportsAVX X86.HasBMI2 = isSet(8, ebx7) X86.HasERMS = isSet(9, ebx7) X86.HasRDSEED = isSet(18, ebx7) X86.HasADX = isSet(19, ebx7) } func isSet(bitpos uint, value uint32) bool { return value&(1<